/* Task-pane styling. Deliberately small and dependency-free — the pane is a narrow strip beside a
   message, not a second SPA. Colors track the platform's AMI Navy primary. */

:root {
  --ami-navy: #112232;
  --ami-error: #a4262c;
  --ami-border: #d8dde3;
  --ami-muted: #5b6a78;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ami-navy);
}

.pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--ami-border);
  padding-bottom: 8px;
}

.pane-header h1 {
  font-size: 16px;
  margin: 0;
}

.auth {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ami-muted);
}

.block h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ami-muted);
  margin: 0 0 4px;
}

.subject {
  margin: 0 0 2px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.participants,
.match-summary {
  margin: 0;
  color: var(--ami-muted);
  overflow-wrap: anywhere;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ami-muted);
  cursor: pointer;
}

/* What Log will send. Text only (textContent), pre-wrap so the converted line breaks are visible. */
.body-preview {
  margin: 8px 0 0;
  padding: 6px;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--ami-border);
  border-radius: 2px;
  background: #f7f8fa;
  font: inherit;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.body-preview:empty {
  display: none;
}

.search {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.search select,
.search input {
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--ami-border);
  border-radius: 2px;
  font: inherit;
}

.search input {
  flex: 1 1 auto;
}

.results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}

.results li + li {
  margin-top: 4px;
}

.record-option {
  width: 100%;
  text-align: left;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--ami-border);
  border-radius: 2px;
  font: inherit;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.record-option:hover,
.record-option:focus-visible {
  border-color: var(--ami-navy);
}

/* A class that sets display (flex, block) would otherwise override the hidden attribute. */
[hidden] {
  display: none !important;
}

.attachments {
  margin-top: 8px;
}

.attachments-heading {
  margin: 0;
  font-size: 13px;
}

.attachments-hint {
  margin: 2px 0 4px;
  font-size: 12px;
  color: var(--ami-muted);
}

.attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.attachment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 4px 0;
  border-top: 1px solid var(--ami-border);
  font-size: 12px;
}

.attachment-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.attachment-note {
  flex-basis: 100%;
  color: var(--ami-muted);
}

.attachment-note-error {
  color: var(--ami-error);
}

/* "Filing…" indicator on a document-intake row (document-intake.md §5.7). */
.spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--ami-border);
  border-top-color: var(--ami-navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.create-record {
  margin-top: 8px;
}

.create-record-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--ami-border);
  border-radius: 2px;
}

.create-record-form label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--ami-muted);
}

.create-record-form input,
.create-record-form select {
  padding: 4px;
  border: 1px solid var(--ami-border);
  border-radius: 2px;
  font: inherit;
  color: var(--ami-navy);
}

.create-record-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.company-picker {
  margin: 4px 0 0;
  padding: 6px;
  border: 1px solid var(--ami-border);
  border-radius: 2px;
}

.company-picker legend {
  font-size: 12px;
  color: var(--ami-muted);
}

.company-picker .selected {
  margin: 6px 0 0;
  font-size: 12px;
}

.selected {
  margin: 12px 0 0;
}

.selected .label {
  color: var(--ami-muted);
}

button {
  padding: 6px 10px;
  border: 1px solid var(--ami-border);
  border-radius: 2px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

button.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ami-muted);
  text-decoration: underline;
  font-size: 12px;
}

button.primary {
  width: 100%;
  background: var(--ami-navy);
  border-color: var(--ami-navy);
  color: #fff;
  font-weight: 600;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.pane-footer {
  border-top: 1px solid var(--ami-border);
  padding-top: 12px;
}

.status,
.result {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.status-error {
  color: var(--ami-error);
}

.dialog {
  padding: 24px;
  text-align: center;
  color: var(--ami-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
