/* ─── Design tokens (spec §4) ───────────────────────────────────────────── */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Helvetica, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --color-page-bg: #eceff2;
  --color-bg: #ffffff;
  --color-text: #14181f;
  --color-divider: #dde1e6;

  --color-accent: #1a56db;
  --color-accent-100: #e8edfc;
  --color-accent-200: #c6d5f7;
  --color-accent-700: #163f9e;
  --color-accent-800: #112f78;

  --color-neutral-600: #6b7280;
  --color-neutral-700: #4b5563;
  --color-neutral-800: #374151;

  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-danger-text: #b91c1c;
  --color-danger-bg-strong: #fee2e2;
  --color-danger-text-strong: #7f1d1d;

  --touch-target: 44px;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

/* Locks the document itself from ever scrolling. Without this, iOS Safari's
   native "scroll the focused field into view" behavior moves the whole
   document independently of the `.app-shell`'s own `100dvh` keyboard-resize
   (see docs/OVERVIEW_KEYBOARD-MESSAGE-INTERACTIONS.md) — dragging `.app-shell`
   (header included) off the top of the viewport, with nothing to reset it
   afterwards. With `body` pinned to the viewport, only `.thread-messages`
   (and other internal `overflow-y: auto` containers) can ever scroll. */
body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  margin: 0;
  background: var(--color-page-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--color-accent-700);
}

a:hover {
  color: var(--color-accent-800);
}

/* ─── Layout scaffold ────────────────────────────────────────────────────── */

.app-shell {
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;
  height: var(--vvh, 100dvh);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border-left: 1px solid var(--color-divider);
  border-right: 1px solid var(--color-divider);
}

.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Safe-area padding hooks — applied to the header/composer once they exist
   (Stages 3 and 5); harmless no-ops (0px) on devices without a notch. */
.safe-top {
  padding-top: env(safe-area-inset-top);
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ─── Typographic treatment ──────────────────────────────────────────────── */

h1,
h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-neutral-700);
}

label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-neutral-700);
}

button {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── Form elements ──────────────────────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.input {
  width: 100%;
  min-height: var(--touch-target);
  padding: 0 var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: 0;
  /* Must stay >= 16px — iOS Safari auto-zooms the page on focus of any
     input/textarea with a smaller computed font-size, leaving the viewport
     zoomed in after the field blurs. */
  font-size: 16px;
  text-transform: none;
  letter-spacing: normal;
}

.input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent-800);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
}

.btn-secondary {
  background: var(--color-bg);
  border-color: var(--color-divider);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger-bg-strong);
  border-color: var(--color-danger-text);
  color: var(--color-danger-text-strong);
}

.btn-icon {
  padding: 0;
  width: var(--touch-target);
}

.btn-icon-glyph {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ─── Inline error banners (spec §11) ────────────────────────────────────── */

.session-message {
  padding: var(--space-3);
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger-text);
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
}

.list-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  border-bottom: 1px solid var(--color-divider);
}

.info-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent-100);
  color: var(--color-accent-800);
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  border-bottom: 1px solid var(--color-divider);
}

.inline-error {
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  font-size: 12px;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
}

/* ─── Corner-bracket motif ───────────────────────────────────────────────── */
/* Used sparingly on primary containers — login/register cards, dialogs. */

.blueprint {
  position: relative;
}

.corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--color-accent);
  pointer-events: none;
}

.corner.tl {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.corner.tr {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
}

.corner.bl {
  bottom: -1px;
  left: -1px;
  border-right: none;
  border-top: none;
}

.corner.br {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

/* ─── Avatars ────────────────────────────────────────────────────────────── */

.avatar {
  flex-shrink: 0;
  width: var(--touch-target);
  height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-divider);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-700);
}

/* ─── Unread badge ───────────────────────────────────────────────────────── */

.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-bg);
  font-size: 12px;
  letter-spacing: normal;
  text-transform: none;
}

/* ─── Conversation List ──────────────────────────────────────────────────── */

.list-header {
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--color-divider);
}

.list-header-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
}

.list-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  flex: 1 1 auto;
}

.conv-list {
  display: flex;
  flex-direction: column;
}

.conv-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 64px;
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg);
  border: none;
  border-bottom: 1px solid var(--color-divider);
  text-align: left;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
}

.conv-row:hover,
.conv-row:focus-visible {
  background: var(--color-accent-100);
}

.conv-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conv-row-top,
.conv-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.conv-row-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-row-time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-neutral-600);
}

.conv-row-preview {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--color-neutral-700);
}

.empty-state {
  padding: var(--space-8) var(--space-6);
  text-align: center;
  font-size: 14px;
  color: var(--color-neutral-600);
}

.new-conv-bar {
  position: sticky;
  bottom: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg);
  border-top: 1px solid var(--color-divider);
}

/* ─── Dialog (New Conversation) ──────────────────────────────────────────── */

.dialog-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(20, 24, 31, 0.5);
  z-index: 10;
}

.dialog {
  position: relative;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
}

.user-result {
  display: block;
  width: 100%;
  min-height: var(--touch-target);
  padding: 0 var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-top: none;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

.user-result:first-child {
  border-top: 1px solid var(--color-divider);
}

.user-result.selected,
.user-result:hover,
.user-result:focus-visible {
  background: var(--color-accent-100);
}

/* ─── Conversation Thread (header) ───────────────────────────────────────── */

.thread-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}

#view-thread.is-dragover {
  outline: 2px dashed var(--color-accent);
  outline-offset: -4px;
}

.thread-back {
  position: absolute;
  left: var(--space-2);
}

.thread-header-identity {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 60vw;
}

.thread-header-avatar {
  border: none;
}

.thread-header-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

/* ─── Conversation Thread (messages & composer) ──────────────────────────── */

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

.thread-messages-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.thread-messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  overflow-y: auto;
}

.thread-new-message-pill {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  border: none;
  background: var(--color-accent);
  color: var(--color-bg);
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.thread-new-message-pill:hover {
  background: var(--color-accent-700);
}

.day-divider {
  display: flex;
  justify-content: center;
  margin: var(--space-3) 0;
}

.day-divider span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
}

.bubble {
  position: relative;
  display: block;
  max-width: 89%;
  padding: var(--space-2) var(--space-3);
  border-radius: 10px;
  text-transform: none;
  letter-spacing: normal;
}

/* Reaction pill (docs/FEAT_REACTIONS.md): straddles the bubble's lower edge,
   right-anchored beside the time. The bg-coloured border makes it read as
   cut out of the bubble. */
.bubble.has-reaction {
  margin-bottom: 10px;
}

.bubble-reaction {
  position: absolute;
  bottom: -12px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 4px;
  border: 2px solid var(--color-bg);
  border-radius: 999px;
  background: var(--color-accent-100);
  font-size: 13px;
  line-height: 1;
  color: var(--color-text);
}

/* Failed (tap-to-retry) bubbles render as a real <button> for keyboard/
   screen-reader access — strip the UA button chrome so it still looks like
   every other bubble. */
button.bubble {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  min-height: var(--touch-target);
}

.bubble.mine {
  align-self: flex-end;
  background: var(--color-accent);
  color: var(--color-bg);
}

.bubble.theirs {
  align-self: flex-start;
  background: var(--color-neutral-700);
  color: #ffffff;
}

.bubble.system {
  align-self: flex-start;
  max-width: 90%;
  background: none;
  border: none;
  color: var(--color-neutral-600);
  text-align: left;
}

.bubble-content {
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble-content.emoji-only {
  font-size: 30px;
  line-height: 1.2;
  display: flex;
  align-items: flex-end;
}

.bubble-content.emoji-only .bubble-meta {
  float: none;
  margin-top: 0;
}

.bubble-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.08);
}

.bubble.mine .bubble-content code,
.bubble.theirs .bubble-content code {
  background: rgba(255, 255, 255, 0.2);
}

.bubble-meta {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  margin-left: var(--space-2);
  font-size: 11px;
  white-space: nowrap;
}

.status-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.bubble.mine .bubble-meta {
  color: var(--color-accent-100);
}

.bubble.theirs .bubble-meta {
  color: rgba(255, 255, 255, 0.75);
}

.bubble.failed {
  cursor: pointer;
}

.bubble.mine.failed {
  background: var(--color-danger-bg-strong);
  color: var(--color-danger-text-strong);
  border: 1px solid var(--color-danger-text);
}

.bubble.mine.failed .bubble-meta {
  color: var(--color-danger-text-strong);
}

/* ─── Message menu trigger ───────────────────────────────────────────────── */
/* Wraps a real (non-optimistic) bubble alongside its menu trigger — see
   wrapBubbleRow() in thread.js. Sized to fit the same 89% column budget
   .bubble used to claim alone; .bubble-row .bubble below hands that back to
   the row so the two together still cap out at 89%. */
.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-1);
  max-width: 89%;
}

.bubble-row.mine {
  align-self: flex-end;
}

.bubble-row.theirs {
  align-self: flex-start;
}

.bubble-row .bubble {
  max-width: 100%;
}

/* Touch devices open the message menu with a long-press, so text selection
   (and iOS's own callout) is off there; Copy lives in the menu. */
@media (pointer: coarse) {
  .bubble-row .bubble {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
}

.bubble.pressing {
  transform: scale(0.97);
  transition: transform 0.4s ease-out;
}

.bubble-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-neutral-600);
  opacity: 0.6;
  cursor: pointer;
}

.bubble-menu-trigger:hover,
.bubble-menu-trigger:focus-visible {
  opacity: 1;
}

.bubble-menu-trigger .btn-icon-glyph {
  width: 16px;
  height: 16px;
}

/* ─── Message options menu + Info dialog ─────────────────────────────────── */
.message-menu {
  position: fixed;
  z-index: 9;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
}

.message-menu[hidden] {
  display: none;
}

.message-menu-reactions {
  display: flex;
  border-bottom: 1px solid var(--color-divider);
}

.message-menu-reaction {
  flex: 1;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  padding: 0;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.message-menu-reaction:hover,
.message-menu-reaction:focus-visible,
.message-menu-reaction[aria-pressed="true"] {
  background: var(--color-accent-100);
}

.message-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--touch-target);
  padding: 0 var(--space-4);
  border: none;
  background: none;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.message-menu-item:hover,
.message-menu-item:focus-visible {
  background: var(--color-accent-100);
}

.message-menu-item.danger {
  color: var(--color-danger-text);
}

.message-menu-item .btn-icon-glyph {
  width: 16px;
  height: 16px;
}

.info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}

.info-list dt {
  color: var(--color-neutral-600);
}

.info-list dd {
  margin: 0;
}

@media (max-width: 360px) {
  .info-list {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .info-list dd {
    margin-bottom: var(--space-2);
  }
}

/* Image bubbles reuse .bubble's shape/color rules (mine/theirs/failed) but
   override the text bubble's uniform padding — the image bleeds to the
   bubble's edge, with only the caption/meta text padded underneath it. */
.bubble-image {
  padding: 4px;
}

.lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.bubble-image picture {
  display: block;
}

.bubble-image img {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  max-height: 320px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.06);
}

.bubble-image-content {
  padding: var(--space-1) var(--space-2) 0;
}

/* Composes with .bubble/.bubble.theirs (shape, background, align-self) so
   the indicator sits exactly where the next incoming bubble would land,
   rather than in a fixed strip above the composer. */
.bubble.typing-indicator {
  display: flex;
  align-items: center;
  gap: 3px;
}

.typing-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-indicator-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.thread-composer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: var(--space-2) var(--space-2);
  border-top: 1px solid var(--color-divider);
}

.thread-textarea {
  flex: 1;
  resize: none;
  min-height: 36px;
  max-height: 160px;
  overflow-y: auto;
  padding: 6px var(--space-2);
}

.thread-send {
  flex-shrink: 0;
}

/* Shared compact sizing for the attach/send buttons flanking the composer —
   matches .thread-textarea's reduced min-height instead of the standard
   44px --touch-target used everywhere else. */
.thread-composer-btn {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
}

.thread-composer-btn .btn-icon-glyph {
  width: 18px;
  height: 18px;
}

/* No border/background — just the glyph, for icon buttons that shouldn't
   read as a boxed control (e.g. the composer's attach button). */
.btn-plain {
  background: none;
  border-color: transparent;
  color: var(--color-neutral-600);
}

/* Attach reads darker than the default .btn-plain neutral, and its plus
   glyph runs a size up from the other composer icons for visibility. */
.thread-attach {
  color: var(--color-text);
}

.thread-attach .btn-icon-glyph {
  width: 24px;
  height: 24px;
}

/* Matches the attach button's plus glyph in size/color (see above) so the
   header's back chevron and the composer's leading icon read as a pair. */
.thread-back {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  color: var(--color-text);
}

.thread-back .btn-icon-glyph {
  width: 24px;
  height: 24px;
}

/* Send keeps the accent blue (unlike the neutral .btn-plain default) and
   fills the plane glyph solid rather than leaving it as an outline. */
.thread-send {
  color: var(--color-accent);
}

.thread-send .btn-icon-glyph {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.image-preview {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--color-divider);
}

.image-preview img {
  max-height: 64px;
  max-width: 96px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.image-preview-info {
  flex: 1;
  color: var(--color-neutral-600);
  font-size: 0.875rem;
}

.lightbox-overlay {
  padding: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
}

/* ─── Auth (login/register) ──────────────────────────────────────────────── */

.auth-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-6);
}

.auth-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.auth-title {
  font-size: 44px;
  line-height: 1;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px solid var(--color-divider);
}

.auth-hint {
  font-size: 12px;
  color: var(--color-neutral-600);
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.auth-submit {
  width: 100%;
  font-size: 15px;
}

.auth-connected {
  font-size: 13px;
  color: var(--color-neutral-700);
}

.auth-footer {
  font-size: 13px;
}

/* ─── Shared form/dialog utilities ───────────────────────────────────────── */

.form-error {
  min-height: 1em;
  font-size: 13px;
  color: var(--color-danger-text);
}

.dialog-title {
  font-size: 18px;
}

.dialog-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.btn-full {
  width: 100%;
}

.btn-flex {
  flex: 1;
}

.settings-hint {
  font-size: 13px;
  color: var(--color-neutral-600);
}

.settings-version-text {
  font-size: 12px;
  color: var(--color-neutral-600);
  margin-top: var(--space-4);
  text-align: center;
}

.empty-hint {
  font-size: 13px;
  color: var(--color-neutral-600);
  padding: var(--space-2) 0;
}

/* ─── Conversation list header ───────────────────────────────────────────── */

.list-title {
  font-size: 22px;
}

.list-eyebrow {
  margin-top: var(--space-1);
}

.list-search-form {
  padding: var(--space-3) var(--space-4) 0;
}

.list-rows {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: var(--space-2);
}

.thread-retry-btn {
  margin-top: var(--space-3);
}

.dialog:focus {
  outline: none;
}
