@import url("./lois-tokens.css");

:root {
  color-scheme: dark;
  --font-ui: "Avenir Next", "Segoe UI Variable", system-ui, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --canvas: var(--lois-canvas);
  --surface: var(--lois-surface);
  --surface-raised: var(--lois-surface-raised);
  --surface-soft: var(--lois-interactive-subtle);
  --line: var(--lois-border);
  --line-strong: var(--lois-border-strong);
  --ink: var(--lois-text-primary);
  --ink-soft: var(--lois-text-secondary);
  --muted: var(--lois-text-secondary);
  --accent: var(--lois-interactive);
  --accent-strong: var(--lois-interactive-hover);
  --accent-ink: var(--lois-interactive-text);
  --danger: var(--lois-danger);
  --success: var(--lois-success);
  --sidebar-width: 264px;
  --topbar-height: 76px;
  --shadow: var(--lois-shadow-dark);
  font-family: var(--font-ui);
  background: var(--canvas);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-theme="light"] {
  color-scheme: light;
  --surface-soft: var(--lois-surface-subtle);
  --shadow: var(--lois-shadow-md);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, summary:focus-visible, [tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Keep intake focus rings inside cards where overflow could clip them. */
.intake-findings:focus-visible,
.intake-findings summary:focus-visible,
.intake-summary:focus-visible,
.intake-summary :focus-visible {
  outline-offset: -3px;
}

[hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 0;
  background: transparent;
}
.brand-word {
  display: block;
  width: 78px;
  height: 29px;
}
.brand-mark img { width: 36px; height: 36px; object-fit: contain; }
.brand-word img { width: 100%; height: 100%; object-fit: contain; }
.brand-on-dark { display: block; }
.brand-on-light { display: none; }
html[data-theme="light"] .brand-on-dark { display: none; }
html[data-theme="light"] .brand-on-light { display: block; }
.brand-caption {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .02em;
}

/* Authentication and access states */
.auth-view, .access-view, .loading-view {
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 32px 22px;
}
.auth-view { display: flex; }
.auth-layout {
  display: grid;
  width: min(980px, 100%);
  min-height: 620px;
  grid-template-columns: 1.08fr .92fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 42px;
  background:
    radial-gradient(ellipse at 8% 100%, color-mix(in srgb, var(--accent-strong) 19%, transparent), transparent 46%),
    linear-gradient(155deg, var(--surface-raised), var(--canvas));
}
.auth-intro::after {
  position: absolute;
  right: -115px;
  bottom: 90px;
  width: 350px;
  height: 350px;
  border: 1px solid color-mix(in srgb, var(--accent) 27%, transparent);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 36px color-mix(in srgb, var(--accent) 4%, transparent), 0 0 0 76px color-mix(in srgb, var(--accent) 3%, transparent);
  pointer-events: none;
}
.auth-intro-copy { position: relative; z-index: 1; max-width: 420px; margin: auto 0; padding: 65px 0; }
.auth-intro-copy .eyebrow { margin-bottom: 20px; color: var(--accent); }
.auth-intro-copy h1 {
  max-width: 420px;
  margin: 0;
  font: 400 clamp(40px, 4.5vw, 52px)/.99 var(--font-display);
  letter-spacing: -.04em;
}
.auth-intro-copy p {
  max-width: 360px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.75;
}
.auth-footnote { position: relative; z-index: 1; color: var(--muted); font-size: 12px; }
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 5vw, 58px);
  background: var(--surface);
}
.auth-mobile-brand { display: none; margin-bottom: 38px; }
.auth-panel h2 {
  margin: 0;
  font: 400 34px/1.1 var(--font-display);
  letter-spacing: -.025em;
}
.auth-description { margin: 11px 0 30px; color: var(--muted); font-size: 14px; }
.oauth-options { display: grid; gap: 14px; margin-bottom: 22px; }
.oauth-button {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
}
.oauth-button:hover { background: var(--surface-soft); }
.oauth-button:disabled { cursor: wait; opacity: .6; }
.oauth-mark { color: var(--ink); font: 700 17px/1 var(--font-ui); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font: 500 12px/1 var(--font-ui); }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.auth-form { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--canvas);
  color: var(--ink);
}
.field input::placeholder { color: var(--muted); opacity: .78; }
.auth-actions {
  display: flex;
  justify-content: flex-end;
  margin: -3px 0 2px;
}
.text-button, .back-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.text-button:hover, .back-button:hover { text-decoration: underline; }
.primary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-weight: 700;
  transition: background .18s ease, transform .18s ease;
}
.primary-button:hover { background: var(--accent-strong); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .55; }
.auth-error {
  min-height: 0;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}
.auth-error:not(:empty) {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 38%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}
.auth-status { margin: 17px 0 0; color: var(--muted); font-size: 13px; }
.back-button { align-self: flex-start; margin: 0 0 27px; }

.loading-view { display: flex; flex-direction: column; gap: 18px; }
.loading-card {
  display: grid;
  width: min(370px, 100%);
  justify-items: center;
  gap: 20px;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
}
.loading-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 0;
  background: transparent;
  animation: settle 1.5s ease-in-out infinite alternate;
}
.loading-mark img { width: 46px; height: 44px; object-fit: contain; }
.loading-copy { margin: 0; color: var(--ink-soft); font-size: 14px; }
.loading-track { width: 100%; height: 3px; overflow: hidden; border-radius: 3px; background: var(--surface-soft); }
.loading-track::after { display: block; width: 38%; height: 100%; border-radius: inherit; background: var(--accent); content: ""; animation: track 1.4s ease-in-out infinite; }
@keyframes track { from { transform: translateX(-110%); } to { transform: translateX(270%); } }
@keyframes settle { to { transform: translateY(-3px); } }

.access-view { display: flex; }
.access-card {
  width: min(540px, 100%);
  padding: clamp(30px, 6vw, 54px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.access-card .brand-lockup { margin-bottom: 52px; }
.access-indicator { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 15px; color: var(--muted); font: 500 11px var(--font-mono); letter-spacing: .09em; text-transform: uppercase; }
.access-indicator::before { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); content: ""; }
.access-card h1 { margin: 0; font: 400 40px/1.06 var(--font-display); letter-spacing: -.03em; }
.access-card p { margin: 16px 0 26px; color: var(--ink-soft); line-height: 1.7; }
.access-card .primary-button { min-width: 130px; }

/* Authenticated application shell */
.app-view { min-height: 100dvh; }
.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.sidebar-brand { padding: 0 8px 27px; }
.workspace-block {
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
}
.workspace-label { display: block; margin-bottom: 6px; color: var(--muted); font: 500 10px var(--font-mono); letter-spacing: .11em; text-transform: uppercase; }
.workspace-name { display: block; overflow: hidden; color: var(--ink-soft); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.header-workspace-name { color: var(--ink-soft); font-size: 13px; }
#workspace-switcher { width: 100%; margin-top: 8px; padding: 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); }
.nav-label { margin: 27px 11px 10px; color: var(--muted); font: 500 10px var(--font-mono); letter-spacing: .11em; text-transform: uppercase; }
.nav { display: grid; gap: 4px; }
.nav-link {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 12px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.nav-link:hover { background: var(--surface-raised); color: var(--ink); }
.nav-link[aria-current="page"], .nav-link.active {
  border-color: color-mix(in srgb, var(--accent) 19%, transparent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent);
}
.nav-icon {
  display: grid;
  width: 19px;
  height: 19px;
  flex: none;
  place-items: center;
  color: currentColor;
}
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.sidebar-spacer { flex: 1; }
.sidebar-foot {
  display: grid;
  gap: 10px;
  padding: 14px 8px 0;
  border-top: 1px solid var(--line);
}
.user-summary { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 3px; }
.user-initial {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent);
  font: 500 12px var(--font-mono);
}
.user-label { overflow: hidden; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-actions { display: flex; gap: 7px; }
.quiet-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.quiet-button:hover { border-color: var(--line-strong); background: var(--surface-raised); color: var(--ink); }
.quiet-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.signout-button { flex: 1; }

.app-main { min-height: 100dvh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(24px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 94%, transparent);
  backdrop-filter: blur(16px);
}
.topbar-start { display: flex; align-items: center; gap: 15px; }
.topbar-brand-icon { width: 22px; height: 22px; flex: none; }
.topbar-brand-icon img { width: 100%; height: 100%; object-fit: contain; }
.page-title { margin: 0; font: 400 24px/1.1 var(--font-display); letter-spacing: -.02em; }
.topbar-tools { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; }
.page-content { width: min(100%, 1120px); margin: 0 auto; padding: 44px clamp(24px, 5vw, 64px) 70px; }

/* Ask LOIS */
.ask-page { min-height: calc(100dvh - var(--topbar-height)); display: flex; flex-direction: column; }
.ask-page .page-content { display: flex; min-height: calc(100dvh - var(--topbar-height)); flex: 1; flex-direction: column; }
.ask-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 21px; color: var(--muted); font: 500 11px var(--font-mono); letter-spacing: .11em; text-transform: uppercase; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 12%, transparent); }
#empty-hero {
  display: flex;
  width: min(100%, 790px);
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 23px;
  margin: 0 auto;
  padding: 35px 0 62px;
}
.hero-heading { max-width: 650px; margin: 0; font: 400 clamp(42px, 6.3vw, 70px)/.97 var(--font-display); letter-spacing: -.045em; }
.hero-heading span { color: var(--accent); }
#empty-hero .hint { max-width: 510px; margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.question-composer { width: 100%; }
#chat-form { width: 100%; }
.input-row {
  display: flex;
  min-height: 66px;
  gap: 10px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgb(0 0 0 / 10%);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
#chat-input {
  width: 100%;
  min-width: 0;
  flex: 1;
  padding: 0 13px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}
#chat-input::placeholder { color: var(--muted); }
#chat-submit {
  display: inline-flex;
  min-width: 92px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background .16s ease, opacity .16s ease;
}
#chat-submit:hover { background: var(--accent-strong); }
#chat-submit:disabled { cursor: wait; opacity: .55; }
#chat-submit svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.suggestion-label { margin: 2px 0 -11px; color: var(--muted); font-size: 12px; }
.examples { display: flex; width: 100%; flex-wrap: wrap; gap: 9px; }
.example-btn {
  max-width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease;
}
.example-btn:hover { transform: translateY(-1px); border-color: var(--accent); background: var(--surface-raised); color: var(--ink); }
.source-note { display: flex; align-items: center; gap: 9px; margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.source-note::before { width: 18px; height: 1px; background: var(--line-strong); content: ""; }
#chat {
  display: none;
  width: min(100%, 790px);
  flex: 1;
  flex-direction: column;
  gap: 17px;
  margin: 0 auto;
  padding: 12px 0 155px;
}
.msg {
  max-width: min(82%, 670px);
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.msg.user { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--accent); color: var(--accent-ink); }
.msg.assistant { align-self: flex-start; border: 1px solid var(--line); border-bottom-left-radius: 4px; background: var(--surface); white-space: normal; }
.msg.system { align-self: center; color: var(--muted); font-size: 12px; }
.msg.assistant table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 12px 0; font-size: 12px; }
.msg.assistant th, .msg.assistant td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.msg.assistant th { background: var(--surface-soft); color: var(--ink); font-weight: 600; }
.msg.assistant tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-soft) 55%, transparent); }
.msg.assistant strong { color: var(--accent); }
.msg.assistant a { color: var(--accent); text-underline-offset: 3px; }
.msg.assistant p { margin: 0 0 9px; }
.msg.assistant p:last-child { margin-bottom: 0; }
.msg.assistant ul, .msg.assistant ol { margin: 5px 0 9px 18px; padding: 0; }
.msg.assistant li { margin-bottom: 4px; }
body.has-messages #empty-hero { display: none; }
body.has-messages #chat { display: flex; }
body.has-messages #chat-form {
  position: fixed;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: var(--sidebar-width);
  width: auto;
  max-width: none;
  padding: 26px clamp(24px, 5vw, 64px) 20px;
  background: linear-gradient(0deg, var(--canvas) 76%, color-mix(in srgb, var(--canvas) 0%, transparent));
}
body.has-messages #chat-form .input-row { width: min(100%, 790px); margin: 0 auto; }

/* Useful, intentional placeholders for routes not yet available */
.coming-soon {
  position: relative;
  display: grid;
  min-height: 350px;
  align-content: center;
  padding: clamp(25px, 5vw, 54px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    linear-gradient(110deg, var(--surface) 0%, color-mix(in srgb, var(--surface-raised) 65%, var(--surface)) 100%);
}
.coming-soon::after {
  position: absolute;
  top: 50%;
  right: -95px;
  width: 300px;
  height: 300px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 32px color-mix(in srgb, var(--line) 20%, transparent), 0 0 0 67px color-mix(in srgb, var(--line) 13%, transparent);
  pointer-events: none;
}
.coming-soon > * { position: relative; z-index: 1; }
.coming-soon .eyebrow { margin-bottom: 15px; color: var(--accent); }
.coming-soon h2 { max-width: 480px; margin: 0; font: 400 clamp(34px, 5vw, 50px)/1.04 var(--font-display); letter-spacing: -.035em; }
.coming-soon p:not(.eyebrow) { max-width: 450px; margin: 16px 0 0; color: var(--ink-soft); line-height: 1.7; }
.coming-tag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font: 500 10px var(--font-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.coming-tag::before { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); content: ""; }
.mobile-scrim { display: none; }

@media (max-width: 880px) {
  :root { --sidebar-width: 238px; }
  .page-content { padding-top: 34px; }
  .auth-layout { min-height: 560px; }
  .auth-intro { padding: 32px; }
}

@media (max-width: 700px) {
  :root { --topbar-height: 66px; }
  .auth-view, .access-view { padding: 0; align-items: stretch; }
  .auth-layout { display: flex; min-height: 100dvh; border: 0; border-radius: 0; }
  .auth-intro { display: none; }
  .auth-panel { width: 100%; justify-content: flex-start; padding: 34px 25px 46px; }
  .auth-mobile-brand { display: block; }
  .brand-mark img { width: 34px; height: 34px; }
  .brand-word { width: 74px; height: 28px; }
  .auth-panel h2 { font-size: 32px; }
  .auth-description { margin-bottom: 27px; }
  .access-card { align-self: center; margin: 24px; }
  .access-card .brand-lockup { margin-bottom: 40px; }
  .access-card h1 { font-size: 35px; }
  .sidebar {
    width: min(300px, calc(100vw - 54px));
    transform: translateX(-105%);
    transition: transform .24s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-scrim {
    position: fixed;
    z-index: 19;
    inset: 0;
    display: block;
    background: rgb(10 8 15 / 56%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s ease;
  }
  .mobile-scrim.is-open { opacity: 1; pointer-events: auto; }
  .app-main { margin-left: 0; }
  .topbar { padding: 0 18px; }
  .topbar-start { min-width: 0; gap: 11px; }
  .menu-toggle { display: inline-flex; width: 38px; height: 38px; flex: none; padding: 0; }
  .menu-toggle svg { width: 18px; height: 18px; }
  .page-title { min-width: 0; overflow: hidden; font-size: 22px; text-overflow: ellipsis; white-space: nowrap; }
  .header-workspace-name { max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .topbar-tools { gap: 7px; }
  .topbar-tools .quiet-button { width: 38px; padding: 0; font-size: 0; }
  .page-content { padding: 27px 20px 48px; }
  .ask-page .page-content { min-height: calc(100dvh - var(--topbar-height)); }
  #empty-hero { gap: 19px; padding: 22px 0 38px; }
  .hero-heading { font-size: clamp(43px, 12vw, 61px); }
  #empty-hero .hint { font-size: 14px; }
  .input-row { min-height: 58px; }
  #chat-input { padding: 0 8px; font-size: 14px; }
  #chat-submit { min-width: 76px; padding: 0 12px; }
  .examples { gap: 7px; }
  .example-btn { font-size: 11px; }
  #chat { padding-bottom: 145px; }
  .msg { max-width: 92%; }
  body.has-messages #chat-form { left: 0; padding: 19px 15px 15px; }
  .coming-soon { min-height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* LOIS Intake v1 -- Manual Intake / Candidate Observation / Resolution.
   Reuses existing tokens and patterns; no new colors or fonts introduced. */
.field textarea {
  width: 100%;
  min-height: 84px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
.field textarea::placeholder { color: var(--muted); opacity: .78; }
.hint { max-width: 640px; margin: 10px 0 24px; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.intake-queue-list { display: grid; gap: 10px; margin-top: 18px; }
.intake-queue-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
}
.intake-queue-item-button {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.intake-queue-item-button:hover { border-color: var(--accent); background: var(--surface-raised); }
.intake-queue-item-button strong { color: var(--ink); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.intake-queue-item-button span { color: var(--ink-soft); font-size: 14px; }
.intake-detail-card {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}
.intake-detail-card p { margin: 0 0 8px; }
.intake-detail-card p:last-child { margin-bottom: 0; }
.intake-detail-card strong { color: var(--ink); }
.intake-action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* LOIS Intake Slice 1 -- Add a Discovery / Needs Review */
.field input,
.field select,
.field textarea {
  max-width: 100%;
}
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--canvas);
  color: var(--ink);
}
.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
#manual-intake-page .auth-form,
#work-queue-page .auth-form {
  max-width: 720px;
}
.intake-heading:focus {
  outline: none;
}
.intake-summary {
  display: grid;
  max-width: 720px;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.intake-summary > div {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.intake-summary > div:first-child {
  border-top: 0;
}
.intake-summary dt {
  margin: 0 0 4px;
  color: var(--muted);
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.intake-summary dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.intake-empty {
  color: var(--muted);
  font-style: italic;
}
.intake-notice {
  max-width: 720px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}
.intake-action-row.intake-stack {
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}
.secondary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}
.secondary-button:hover {
  background: var(--surface-raised);
}
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}
.intake-findings {
  max-width: 720px;
  margin-top: 30px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.intake-findings summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}
.intake-findings[open] summary {
  margin-bottom: 8px;
}
.intake-findings .hint {
  margin: 6px 0 16px;
}
.intake-subhead {
  margin: 20px 0 6px;
  color: var(--muted);
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.intake-evidence {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.intake-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 38%, transparent);
  border-radius: 8px;
  color: var(--danger);
  font-size: 13px;
}
.intake-detail-card dl {
  margin: 0;
}
.intake-detail-card dt {
  margin: 12px 0 2px;
  color: var(--muted);
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.intake-detail-card dt:first-child {
  margin-top: 0;
}
.intake-detail-card dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .intake-action-row.intake-stack {
    flex-direction: column;
    align-items: stretch;
  }
  .intake-action-row.intake-stack .primary-button,
  .intake-action-row.intake-stack .secondary-button {
    width: 100%;
  }
  .intake-action-row.intake-stack .text-button {
    min-height: 44px;
  }
  .intake-summary > div {
    padding: 12px 14px;
  }
  .intake-action-row [data-action] {
    flex: 1 1 calc(50% - 10px);
  }
}