/* Local Inter/Outfit Latin, @fontsource-variable 5.3.0, SIL OFL.
   Design tokens adapted from TRLR-ai/src/client/src/index.css.
   Other scripts use the platform font fallback. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: Outfit;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/outfit-latin-wght-normal.woff2') format('woff2');
}

:root {
  --bg: #f4f1eb;
  --text: #1a1a2e;
  --text-dim: #8a8a90;
  --color-bg: #f4f1eb;
  --color-text-primary: #1a1a2e;
  --color-text-secondary: #8a8a90;
  --color-accent: #1a1a1e;
  --color-input-bg: rgba(0, 0, 0, .04);
  --color-input-border: rgba(0, 0, 0, .1);
  --color-input-focus-bg: rgba(0, 0, 0, .08);
  --color-input-focus-ring: rgba(0, 0, 0, .18);
  --font-display: Outfit, Inter, sans-serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --cream: var(--bg);
  --paper: #faf8f4;
  --navy: var(--text);
  /* The landing's dim text is decorative. Interface labels need more contrast. */
  --muted: #656570;
  --line: rgba(26, 26, 46, .1);
  --line-strong: rgba(26, 26, 46, .22);
  --accent: var(--text);
  --sage: #486253;
  --danger: #a33d35;
  --body: var(--font-body);
  --heading: var(--font-display);
  --header-height: 80px;
  font-family: var(--body);
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea { font: inherit; }
button, a, input, textarea, summary { touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}
input:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
[hidden] { display: none !important; }
.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;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  padding: 12px 18px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  z-index: 20;
}
.skip-link:focus { top: 12px; }
.site-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 48px;
  min-height: 44px;
  text-decoration: none;
  flex-shrink: 0;
  overflow: hidden;
}
/* The original logo includes generous transparent space. Crop its display,
   preserving the copied asset's bytes and proportions. */
.wordmark img { display: block; width: 92px; height: auto; flex-shrink: 0; mix-blend-mode: multiply; }
.lock-space { margin-left: auto; white-space: nowrap; }

/* The app remains still; brand animation is confined to entry and empty views. */
.workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  max-width: 1600px;
  height: calc(100dvh - var(--header-height));
  min-height: 560px;
  margin: auto;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 32px 20px 24px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  min-width: 0;
}
.space-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  transition: background .15s, border-color .15s;
}
.nav-button:hover, .archive-list button:hover { background: var(--color-input-bg); }
.nav-button.selected {
  background: rgba(26, 26, 46, .06);
  border-color: rgba(26, 26, 46, .04);
  font-weight: 500;
}
.nav-symbol { width: 22px; flex-shrink: 0; font-size: 22px; font-weight: 300; line-height: 1; text-align: center; }
.count {
  min-width: 24px;
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 30px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  text-align: center;
}
.history-menu { border-top: 1px solid var(--line); padding-top: 16px; min-width: 0; }
.history-menu summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 12px;
  list-style: none;
  cursor: pointer;
}
.history-menu summary::-webkit-details-marker, .receipt summary::-webkit-details-marker { display: none; }
.history-menu summary::before { content: '+'; width: 12px; font-size: 17px; font-weight: 300; }
.history-menu[open] summary::before { content: '−'; }
.archive-list { display: grid; gap: 4px; padding-top: 8px; }
.archive-list button {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  text-align: left;
  overflow-wrap: anywhere;
}
.archive-list button.selected { background: rgba(26, 26, 46, .06); border-color: var(--line); }
.archive-list p { color: var(--muted); font-size: 12px; padding: 0 12px; }
.sidebar-bottom { margin-top: auto; padding: 8px 12px 0; }
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}
.text-button:hover { color: var(--text); text-decoration-color: var(--text); }
.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.conversation {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--paper);
  outline: none;
}
.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(24px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
}
.conversation-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.conversation-heading > div { min-width: 0; }
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg);
  overflow: hidden;
}
.avatar img { display: block; width: 36px; height: auto; max-width: none; mix-blend-mode: multiply; }
.conversation-heading h2 {
  margin: 0;
  font-family: var(--heading);
  font-size: 21px;
  font-weight: 350;
  letter-spacing: -.4px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.conversation-heading p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.conversation-controls { display: flex; flex-shrink: 0; gap: 6px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  transition: background .15s, border-color .15s;
}
.button.subtle { background: transparent; }
.button.subtle:hover:not(:disabled) { background: var(--color-input-bg); border-color: var(--line-strong); }
.button.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.button.primary:hover:not(:disabled) { background: #3a3a3e; border-color: #3a3a3e; }
.conversation-controls .button { padding: 10px 12px; border-color: transparent; font-size: 12px; color: var(--muted); }
.conversation-controls .button:hover:not(:disabled) { border-color: var(--line); }
.lock-space { font-size: 12px; padding: 9px 16px; }
.transcript {
  flex: 1;
  min-height: 160px;
  padding: 36px clamp(24px, 4vw, 64px) 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.message { max-width: 720px; margin: 0 auto 32px; }
.message.user { display: flex; flex-direction: column; align-items: flex-end; }
.message-label { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .025em; }
.message-text { margin: 0; font-size: 15px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.user .message-text { max-width: 88%; padding: 14px 20px; border-radius: 14px 14px 3px 14px; background: #eeeae4; }
.assistant .message-text { max-width: 96%; }
.receipt { max-width: 100%; margin-top: 4px; color: var(--muted); font-size: 11px; text-align: right; }
.receipt summary { display: flex; justify-content: flex-end; align-items: center; min-height: 44px; padding: 8px 2px; list-style: none; cursor: pointer; }
.receipt summary::after { content: '⌄'; margin-left: 7px; font-size: 12px; }
.receipt[open] summary::after { content: '⌃'; }
.receipt dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 24px; margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 11px; }
.receipt dt { text-align: left; }
.receipt dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.receipt-label { margin-top: 10px; color: var(--muted); font-size: 11px; }
.reveal-invitation {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  min-height: 48px;
  margin-top: 20px;
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  font-size: 13px;
  text-align: left;
}
.reveal-invitation strong { font-weight: 450; }
.reveal-invitation span { font-size: 18px; font-weight: 300; }
.reveal-invitation:hover { background: #eeebe5; border-color: var(--text); }
.empty-conversation {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  width: 100%;
  max-width: 620px;
  margin: 20px auto;
  padding: 52px 24px;
  overflow: hidden;
  text-align: center;
}
.empty-conversation > :not(.entry-art) { position: relative; z-index: 1; }
.empty-conversation h3 { margin: 0; font-family: var(--heading); font-size: 30px; font-weight: 300; letter-spacing: -.7px; line-height: 1.25; }
.empty-conversation p { max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.conversation-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  width: 100%;
  max-width: calc(720px + clamp(48px, 6vw, 96px));
  margin-inline: auto;
  min-height: 32px;
  padding: 4px clamp(24px, 3vw, 48px);
  color: var(--muted);
  font-size: 12px;
}
.status-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--sage); }
.status-dot.busy { animation: breathe 2s ease-in-out infinite; }
.status-dot.still { background: var(--muted); }
.status-dot.error { background: var(--danger); }
.conversation-status .text-button { margin-left: 4px; }
.composer { padding: 12px clamp(24px, 3vw, 48px) 20px; }
.compose-field {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 12px 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, .36);
  transition: border-color .15s, box-shadow .15s;
}
.compose-field:focus-within { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  max-height: 160px;
  resize: none;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
textarea:focus-visible { outline: none; }
textarea::placeholder { color: var(--muted); }
.send-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}
.send-button:hover:not(:disabled) { background: #3a3a3e; }
.composer-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; max-width: 720px; margin: 10px auto 0; color: var(--muted); font-size: 11px; }
.error-text { margin: 8px 0 0; color: var(--danger); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.error-text:empty { display: none; }
.composer > .error-text, .draft-conflict { max-width: 720px; margin-left: auto; margin-right: auto; }
.notice { display: flex; align-items: center; gap: 12px; padding: 9px 24px; border-bottom: 1px solid var(--line); background: #eeebe5; font-size: 12px; }
.notice > span { min-width: 0; overflow-wrap: anywhere; }
.notice button { width: 44px; min-height: 44px; flex-shrink: 0; margin-left: auto; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 24px; font-weight: 300; }
.notice button:hover { background: var(--color-input-bg); }
.draft-conflict { margin-top: 0; margin-bottom: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 12px; }
.draft-conflict p { margin: 0; }
.archive-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 12px; }
.preview-banner { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 11px clamp(24px, 3vw, 48px); border-bottom: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 12px; }
.preview-banner strong { font-weight: 500; color: var(--text); }

/* The original landing rings and colours sit behind these functional forms. */
.entry-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: calc(100dvh - var(--header-height));
  padding: 72px 24px 104px;
  overflow: hidden;
  text-align: center;
}
.entry-art { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.entry-content { position: relative; z-index: 1; width: 100%; max-width: 400px; }
.entry-screen h1 { margin: 0 0 18px; font-family: var(--heading); font-size: clamp(36px, 4.5vw, 52px); font-weight: 300; line-height: 1.16; letter-spacing: -1.5px; }
.entry-content > p { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.access-form { display: grid; gap: 12px; width: 100%; max-width: 330px; margin: 32px auto 0; text-align: left; }
.access-form label { font-size: 12px; }
.access-form input { width: 100%; min-width: 0; min-height: 48px; padding: 12px 15px; border: 1px solid var(--color-input-border); border-radius: 6px; background: rgba(255, 255, 255, .4); color: var(--text); font-size: 16px; }
.access-form input:focus { background: rgba(255, 255, 255, .6); }
.access-form .error-text { margin: 0; }
.access-form button { margin-top: 4px; }

/* Evidence keeps the original prediction, actual reply, outcome and timing. */
dialog {
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 28px 100px rgba(26, 26, 46, .16);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog::backdrop { background: rgba(26, 26, 46, .3); backdrop-filter: blur(5px); }
.evidence-dialog { width: 880px; }
.dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 25px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.dialog-header > div { min-width: 0; }
.dialog-header .eyebrow { margin: 0 0 6px; }
.dialog-header .eyebrow:empty { display: none; }
.dialog-header h2, .confirm-dialog h2 { margin: 0; font-family: var(--heading); font-size: 30px; font-weight: 300; line-height: 1.2; letter-spacing: -.7px; overflow-wrap: anywhere; }
.close-button { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 26px; line-height: 1; font-weight: 300; }
.close-button:hover { background: var(--color-input-bg); }
.evidence-content { padding: 28px 32px 32px; }
.evidence-intro { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.reveal-list { display: grid; gap: 10px; }
.reveal-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; padding: 20px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); text-align: left; }
.reveal-card strong { display: block; font-family: var(--heading); font-size: 21px; font-weight: 350; }
.reveal-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.reveal-card:hover { border-color: var(--line-strong); background: #eeebe5; }
.pair { margin: 0 0 24px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pair-header { padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--bg); }
.pair-header .eyebrow { margin: 0 0 8px; font-size: 11px; }
.pair-header p { margin: 0; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.pair-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pair-side { min-width: 0; padding: 22px; }
.pair-side + .pair-side { border-left: 1px solid var(--line); background: rgba(26, 26, 46, .018); }
.pair-side h4 { margin: 0 0 14px; color: var(--muted); font-size: 12px; font-weight: 500; }
.pair-side blockquote { margin: 0; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.forecast-extra { margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.forecast-extra dt { margin-top: 14px; font-size: 11px; font-weight: 500; }
.forecast-extra dd { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pair-timing { padding: 13px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.outcome-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.outcome-item { min-width: 0; padding: 18px; font-size: 12px; }
.outcome-item + .outcome-item { border-left: 1px solid var(--line); }
.outcome-item strong { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 500; }
.outcome-score { display: inline-block; padding: 3px 8px; border-radius: 4px; background: var(--color-input-bg); color: var(--text); font-size: 11px; }
.outcome-item details { margin-top: 6px; color: var(--muted); font-size: 12px; }
.outcome-item summary { min-height: 44px; padding: 12px 0; cursor: pointer; }
.outcome-item p { margin: 6px 0 0; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.portrait { margin-top: 28px; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.portrait h3 { margin: 0 0 18px; font-family: var(--heading); font-size: 28px; font-weight: 300; line-height: 1.25; letter-spacing: -.5px; }
.portrait p:last-child { margin: 0; font-size: 15px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.evidence-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 24px; }
.empty-evidence { padding: 40px 12px; color: var(--muted); font-size: 14px; line-height: 1.8; text-align: center; }
.confirm-dialog { width: 460px; padding: 30px; }
.confirm-dialog > .eyebrow { margin-bottom: 12px; }
.confirm-dialog > p:not(.eyebrow) { margin: 18px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.confirm-dialog > .error-text { color: var(--danger); }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.noscript { padding: 24px; text-align: center; }

@keyframes breathe { 50% { opacity: .35; } }
@media (min-width: 1600px) {
  .workspace { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
@media (max-width: 1000px) {
  .workspace { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding: 24px 14px 20px; }
  .nav-button { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .conversation-header { padding: 20px 24px; }
  .conversation-heading { gap: 10px; }
  .conversation-heading h2 { font-size: 19px; }
  .transcript { padding: 30px 28px 14px; }
  .composer { padding: 12px 24px 20px; }
  .conversation-status { padding-left: 24px; padding-right: 24px; }
  .preview-banner { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 720px) {
  :root { --header-height: 68px; }
  .site-header { padding: 0 20px; gap: 16px; }
  .wordmark { width: 66px; height: 44px; }
  .wordmark img { width: 74px; }
  .lock-space { padding: 9px 13px; }
  .workspace { display: flex; flex-direction: column; min-height: 600px; }
  .sidebar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 10px;
    padding: 8px 12px 4px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
    flex-shrink: 0;
  }
  .space-nav { grid-column: 1 / -1; flex-direction: row; gap: 4px; }
  .nav-button { justify-content: center; flex: 1; gap: 7px; min-width: 0; min-height: 44px; padding: 10px 8px; font-size: 12px; }
  .nav-symbol { width: 18px; font-size: 19px; }
  .nav-button .count { margin-left: 0; padding: 0 5px; min-width: 20px; font-size: 10px; }
  .history-menu { margin: 0; padding: 0; border: 0; }
  .history-menu summary { width: fit-content; max-width: 100%; gap: 6px; padding: 7px 8px; font-size: 12px; }
  .history-menu .count { font-size: 10px; }
  .history-menu[open] .archive-list {
    position: absolute;
    left: 12px;
    top: calc(100% - 2px);
    z-index: 5;
    width: min(320px, calc(100% - 24px));
    max-height: min(300px, 50dvh);
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--paper);
    overflow-y: auto;
    box-shadow: 0 12px 30px rgba(26, 26, 46, .1);
  }
  .sidebar-bottom { margin: 0; padding: 0 6px 0 0; }
  .sidebar-bottom .text-button { font-size: 12px; }
  .conversation { flex: 1; }
  .conversation-header { gap: 8px; min-height: 80px; padding: 14px 20px; }
  .conversation-heading { gap: 10px; }
  .conversation-heading h2 { font-size: 19px; }
  .conversation-heading p { font-size: 11px; }
  .avatar { width: 36px; height: 36px; }
  .avatar img { width: 30px; }
  .conversation-controls { gap: 0; }
  .conversation-controls .button { padding: 10px; font-size: 12px; }
  .transcript { padding: 26px 22px 12px; }
  .message { margin-bottom: 28px; }
  .message-text { font-size: 15px; line-height: 1.8; }
  .user .message-text { max-width: 94%; padding: 13px 16px; }
  .assistant .message-text { max-width: 100%; }
  .composer { padding: 10px 16px max(14px, env(safe-area-inset-bottom)); }
  .conversation-status { padding: 4px 20px; font-size: 12px; }
  .compose-field { gap: 10px; padding: 10px 10px 10px 14px; }
  textarea { min-height: 44px; padding: 8px 0; font-size: 16px; line-height: 1.5; }
  .composer-footer { font-size: 11px; }
  .entry-screen { padding: 56px 24px 80px; }
  .entry-screen h1 { font-size: 38px; }
  .entry-content > p { font-size: 13px; }
  .access-form { margin-top: 28px; }
  dialog { max-width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .dialog-header { gap: 10px; padding: 20px; }
  .dialog-header h2 { font-size: 27px; }
  .evidence-content { padding: 22px 20px; }
  .pair-grid { grid-template-columns: minmax(0, 1fr); }
  .pair-side + .pair-side { border-left: 0; border-top: 1px solid var(--line); }
  .pair-header, .pair-side { padding: 18px; }
  .pair-timing { padding: 12px 18px; }
  .outcome-item { padding: 14px 12px; }
  .portrait { padding: 22px; }
  .portrait h3 { font-size: 26px; }
  .portrait p:last-child { font-size: 14px; }
  .notice { padding: 8px 16px; }
  .preview-banner { padding: 9px 20px; }
  .confirm-dialog { padding: 25px; }
  .empty-conversation { min-height: 220px; margin: 12px auto; padding: 40px 16px; }
  .empty-conversation h3 { font-size: 26px; }
  .archive-banner { padding: 14px 20px; text-align: center; }
}
@media (max-width: 400px) {
  .site-header { padding: 0 16px; }
  .sidebar { gap: 0 4px; padding-left: 8px; padding-right: 8px; }
  .nav-button { gap: 5px; padding-left: 5px; padding-right: 5px; }
  .nav-symbol { width: 15px; font-size: 17px; }
  .nav-button .count { display: none; }
  .history-menu summary { padding-left: 6px; }
  .sidebar-bottom { padding-right: 4px; }
  .conversation-header { padding: 12px 16px; }
  .conversation-heading { gap: 8px; }
  .conversation-heading h2 { font-size: 17px; }
  .conversation-heading p { font-size: 11px; }
  .conversation-controls .button { padding: 10px 8px; }
  .avatar { display: none; }
  .transcript { padding: 24px 18px 10px; }
  .conversation-status { padding-left: 16px; padding-right: 16px; }
  .composer { padding-left: 12px; padding-right: 12px; }
  .entry-screen { padding-left: 24px; padding-right: 24px; }
  .entry-screen h1 { font-size: 34px; }
  .dialog-header { padding: 18px; }
  .dialog-header h2 { font-size: 25px; }
  .evidence-content { padding: 20px 16px; }
  .outcome-list { grid-template-columns: minmax(0, 1fr); }
  .outcome-item { padding: 16px 18px; }
  .outcome-item + .outcome-item { border-left: 0; border-top: 1px solid var(--line); }
  .confirm-dialog { padding: 22px; }
  .confirm-actions .button { flex: 1; }
}
/* Short viewports scroll the document instead of concealing the composer. */
@media (max-height: 600px) {
  .entry-screen { padding-top: 40px; padding-bottom: 40px; }
  .entry-screen h1 { font-size: 34px; }
  .access-form { margin-top: 20px; }
  .workspace { height: auto; min-height: 560px; }
  .conversation { min-height: 560px; }
  .transcript { flex-basis: 220px; max-height: 420px; }
  .dialog-header { padding-top: 14px; padding-bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* The MARK 2.1 illustration reflects committed revisions, never completion. */
.mark21-development { margin: 1rem 0; padding: .8rem; text-align: center; }
.mark21-development p { font-size: .78rem; color: var(--muted, #65616a); }
.mark21-illustration { width: 100px; height: 100px; overflow: visible; }
.mark21-illustration ellipse { fill: none; stroke: #766b92; stroke-width: .7; opacity: .4; transition: transform 1.2s ease, rx 1.2s ease; }
.mark21-beat { padding: 1.2rem 0; border-bottom: 1px solid #e0dbe5; }
.mark21-beat p, .mark21-originals blockquote, .mark21-sealed-reason { white-space: pre-wrap; overflow-wrap: anywhere; }
.mark21-originals blockquote { margin: .7rem 0; border-left: 2px solid #c6bdcf; padding: .4rem 1rem; line-height: 1.65; }
.mark21-originals h4 { margin-top: 1rem; }
.mark21-deeper { margin-top: 1.2rem; }
.mark21-note, .mark21-caveat { font-size: .85rem; line-height: 1.6; color: #625e68; }
.mark21-caveat { padding: 1rem; border: 1px solid #d8d0df; border-radius: .6rem; }
.mark21-table-wrap { overflow-x: auto; margin: .8rem 0 1.5rem; }
.mark21-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.mark21-table th, .mark21-table td { padding: .65rem .45rem; text-align: left; border-bottom: 1px solid #e1dce6; }
.mark21-table caption { caption-side: bottom; text-align: left; padding-top: .6rem; color: #625e68; font-size: .78rem; }
.mark21-counts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; font-size: .8rem; }
.mark21-counts dd { margin: 0; font-variant-numeric: tabular-nums; }
.mark21-report-group { margin: 1.5rem 0; }
.mark21-report-group details { padding: .7rem 0; border-bottom: 1px solid #e1dce6; }
.mark21-report-group summary { cursor: pointer; line-height: 1.5; }
.mark21-event section { margin-top: 1rem; }
@media (prefers-reduced-motion: reduce) { .mark21-illustration ellipse { transition: none; } }
