:root {
  --ink: var(--color-text-dark);
  --muted: var(--color-muted-dark);
  --paper: var(--color-surface-light);
  --card: #fffaf2;
  --line: var(--color-border-light);
  --forest: #3d2413;
  --forest-dark: var(--color-bg);
  --mint: #ead9bd;
  --gold: var(--color-gold);
  --red: var(--color-danger);
  --shadow: var(--brand-shadow);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
main { min-height: calc(100vh - 72px); }
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.06;
}
h1 em { color: var(--forest); font-weight: 400; }
.eyebrow {
  color: var(--gold);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
}
.muted { color: var(--muted); }
.tiny { color: var(--muted); font-size: .72rem; text-align: center; }
.mono, code { font-family: "SFMono-Regular", Consolas, monospace; }
.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;
}
.topbar {
  height: 72px;
  padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,253,248,.9);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { text-decoration: none; display: flex; align-items: center; gap: 12px; font-weight: 750; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--forest); color: white; font-family: Georgia, serif; font-size: .84rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-mark.large { width: 48px; height: 48px; margin-bottom: 18px; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: .84rem; }
.ai-topbar-status { padding: 5px 8px; color: var(--forest); background: var(--mint); font-size: .7rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.ai-topbar-status.ai-unavailable { color: #8c2f2f; background: #f8dddd; }
.ai-topbar-status.ai-fallback { color: #805a13; background: #fff0c7; }
.ai-topbar-status.ai-loading { opacity: .7; }
.role, .pill, .status {
  display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 9px;
  font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.role { color: var(--forest); background: var(--mint); }
.link-button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 0 4px 10px; }
.page { max-width: 1220px; margin: 0 auto; padding: 56px 28px 90px; }
.page.narrow { max-width: 900px; }
.hero {
  display: flex; justify-content: space-between; align-items: end; gap: 40px;
  padding: 34px 0 62px;
}
.hero h1 { font-size: clamp(2.7rem, 6vw, 5.3rem); margin: 12px 0 0; }
.hero-note {
  min-width: 160px; padding: 22px; border-left: 1px solid var(--line);
  display: grid; color: var(--muted);
}
.hero-note strong { color: var(--forest); font-family: Georgia, serif; font-size: 2.6rem; line-height: 1; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin: 42px 0 20px; }
.section-title h2 { margin: 0; font-family: Georgia, serif; font-weight: 500; font-size: 1.75rem; }
.section-title > span { color: var(--muted); font-size: .82rem; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.assignment-card {
  background: var(--card); border: 1px solid var(--line); padding: 23px; min-height: 285px;
  display: flex; flex-direction: column; box-shadow: 0 6px 20px rgba(34,50,43,.03);
  transition: transform .2s ease, box-shadow .2s ease;
}
.assignment-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-top { display: flex; justify-content: space-between; gap: 10px; }
.pill { color: var(--forest); background: var(--mint); }
.status { color: #6a5a3a; background: #eee5d3; }
.status.confirmed_pending_review { color: #7d3333; background: #f2dede; }
.assignment-card h3 { margin: 28px 0 8px; font-family: Georgia, serif; font-size: 1.4rem; font-weight: 500; line-height: 1.2; }
.assignment-card .mono { font-size: .72rem; color: var(--muted); }
.progress { width: 100%; height: 4px; background: #e7e4da; border-radius: 4px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--forest); border-radius: 4px; }
.card-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; margin: 8px 0 17px; }
.card-actions { display: grid; gap: 22px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.card-link { min-height: 42px; padding: 10px 13px; color: white; background: var(--forest); border: 1px solid var(--forest); border-radius: 3px; text-decoration: none; display: flex; align-items: center; justify-content: space-between; font-weight: 800; }
.card-link:hover { background: var(--forest-dark); border-color: var(--forest-dark); }
.danger-button { border: 1px solid #d9bcbc; border-radius: 3px; padding: 9px 12px; color: var(--red); background: #fff8f8; cursor: pointer; font-size: .75rem; font-weight: 800; }
.danger-button:hover { color: white; background: var(--red); border-color: var(--red); }
.card-delete-form { margin: 0; }
.card-delete-form .danger-button { width: 100%; min-height: 42px; }
.session-delete-form { padding-top: 18px; border-top: 1px solid #d1cec4; }
.session-delete-form .danger-button { width: 100%; }
.import-panel {
  display: grid; grid-template-columns: .85fr 1.15fr; gap: 48px; background: var(--forest);
  color: white; padding: 36px; margin-bottom: 54px; box-shadow: var(--shadow);
}
.import-panel h2 { font-family: Georgia, serif; font-size: 2rem; font-weight: 500; margin: 8px 0; }
.import-panel p { color: #bdd1c8; max-width: 46ch; }
.import-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: center; }
.import-form label:first-of-type { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-size: .78rem; font-weight: 700; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); background: white; color: var(--ink);
  border-radius: 3px; padding: 12px 13px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(31,75,60,.11); }
.primary {
  border: 0; border-radius: 3px; padding: 13px 18px; color: white; background: var(--forest);
  cursor: pointer; text-decoration: none; display: inline-flex; justify-content: center; align-items: center;
  font-weight: 800; box-shadow: 0 8px 20px rgba(20,55,43,.16);
}
.import-panel .primary { background: #f3ede0; color: var(--forest-dark); align-self: end; }
.primary:hover { background: var(--forest-dark); color: white; }
.primary.wide { width: 100%; }
.primary.large { padding: 16px 25px; font-size: 1rem; }
.alert { padding: 13px 16px; border-radius: 3px; margin-bottom: 20px; font-size: .86rem; }
.alert.error { color: #7b2d2d; background: #f4dddd; border: 1px solid #e7c2c2; }
.alert.success { color: #20523f; background: #deeee5; border: 1px solid #c5dfd1; }
.empty { grid-column: 1 / -1; text-align: center; padding: 70px 20px; border: 1px dashed #cbc8be; background: rgba(255,255,255,.35); }
.empty-icon { color: var(--gold); font-size: 2.5rem; }

.login-body { background: var(--forest-dark); }
.login-body main { min-height: 100vh; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-intro {
  color: white; padding: clamp(50px, 9vw, 130px); display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.login-intro::after {
  content: ""; position: absolute; width: 560px; height: 560px; border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%; right: -240px; bottom: -250px; box-shadow: 0 0 0 100px rgba(255,255,255,.025), 0 0 0 200px rgba(255,255,255,.015);
}
.login-intro h1 { font-size: clamp(3.2rem, 6vw, 6.3rem); margin: 20px 0 28px; max-width: 800px; }
.login-intro h1 em { color: #d3b47d; }
.login-intro > p { max-width: 570px; color: #bed0c7; font-size: 1.08rem; }
.guardrail { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; position: relative; z-index: 1; }
.guardrail span { border: 1px solid rgba(255,255,255,.2); border-radius: 99px; padding: 7px 12px; font-size: .72rem; color: #dce8e2; }
.login-card {
  background: var(--card); margin: clamp(20px, 4vw, 64px); padding: clamp(32px, 5vw, 64px);
  align-self: center; box-shadow: 0 30px 90px rgba(0,0,0,.24); max-width: 520px; width: calc(100% - 40px);
}
.login-card h2 { font-family: Georgia, serif; font-size: 2.5rem; font-weight: 500; margin-bottom: 5px; }
.stack { display: grid; gap: 18px; margin: 30px 0 18px; }

.session-body { overflow: hidden; }
.session-body main { height: calc(100vh - 72px); }
.session-layout { display: grid; grid-template-columns: 340px 1fr; height: 100%; }
.context-panel { padding: 34px 30px; border-right: 1px solid var(--line); background: #ebe9e1; overflow: auto; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: .8rem; margin-bottom: 36px; }
.context-panel .pill { margin-bottom: 14px; }
.context-panel h1 { font-size: 2rem; margin-bottom: 10px; }
.context-panel > .mono { color: var(--muted); font-size: .75rem; margin-bottom: 35px; }
.context-block { border-top: 1px solid #d1cec4; padding: 18px 0; display: grid; gap: 9px; }
.context-block > span { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.context-block > strong { font-family: Georgia, serif; font-size: 1.5rem; }
.context-block code { font-size: .75rem; word-break: break-all; }
.collaboration-request { cursor: pointer; }
.collaboration-request summary { color: var(--forest); font-weight: 800; }
.collaboration-request[open] summary { margin-bottom: 12px; }
.collaboration-request .stack { margin: 0; }
.collaboration-status small { color: var(--muted); line-height: 1.45; }
.safety-note { padding: 18px; border: 1px solid #c9c4b8; background: rgba(255,255,255,.45); font-size: .8rem; margin-top: 20px; }
.safety-note p { margin: 6px 0 0; color: var(--muted); }
.conversation { min-width: 0; min-height: 0; height: 100%; display: grid; grid-template-rows: 58px minmax(0, 1fr) auto auto auto; background: var(--card); }
.conversation-head { border-bottom: 1px solid var(--line); padding: 0 32px; display: flex; align-items: center; justify-content: space-between; font-size: .78rem; }
.conversation-head > span { color: var(--muted); }
.grill-mode-label { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.grill-mode-label select { width: auto; padding: 5px 8px; background: white; font-size: .76rem; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #5f9d79; margin-right: 8px; box-shadow: 0 0 0 4px #dfede4; }
.messages { min-height: 0; padding: 32px clamp(20px, 6vw, 85px); overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.message { display: flex; gap: 12px; max-width: 760px; margin-bottom: 26px; align-items: flex-start; }
.message.user { margin-left: auto; flex-direction: row-reverse; }
.avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--forest); color: white; font-size: .68rem; font-weight: 800; }
.message.user .avatar { background: #d8d4c9; color: var(--ink); }
.message-author { display: block; color: var(--muted); font-size: .7rem; margin: 0 0 5px 4px; }
.message.user .message-author { text-align: right; margin-right: 4px; }
.bubble { padding: 14px 17px; background: #eeece5; border-radius: 3px 14px 14px 14px; font-size: .92rem; }
.message.user .bubble { color: white; background: var(--forest); border-radius: 14px 3px 14px 14px; }
.markdown-body h3 { margin: 1.15em 0 .38em; color: var(--forest-dark); font-family: Georgia, serif; font-size: 1.08rem; }
.markdown-body h3:first-child { margin-top: 0; }
.markdown-body p { margin: 0 0 .72em; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { margin: .35em 0 .8em; padding-left: 1.35em; }
.markdown-body li { margin: .18em 0; }
.markdown-body code { padding: 1px 4px; border-radius: 3px; background: rgba(31,75,60,.09); font-size: .88em; }
.message.user .markdown-body code { background: rgba(255,255,255,.14); }
.markdown-inline p { display: inline; margin: 0; }
.streaming .bubble::after { content: ""; display: inline-block; width: 6px; height: 14px; background: var(--forest); margin-left: 3px; animation: blink .8s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.quick-actions { padding: 8px 32px 12px; display: flex; gap: 8px; overflow-x: auto; }
.quick-actions button {
  white-space: nowrap; border: 1px solid var(--line); background: white; border-radius: 99px;
  padding: 7px 11px; cursor: pointer; font-size: .72rem; color: var(--forest);
}
.quick-actions button:hover { background: var(--mint); border-color: #bad0c3; }
.quick-actions button:disabled { opacity: .45; cursor: wait; }
.composer { margin: 0 32px 10px; display: grid; grid-template-columns: 1fr 48px; border: 1px solid var(--line); background: white; box-shadow: 0 8px 30px rgba(31,45,38,.08); }
.composer textarea { border: 0; resize: none; min-height: 68px; max-height: 150px; box-shadow: none; }
.composer textarea:focus { box-shadow: none; }
.send { align-self: center; width: 36px; height: 36px; border-radius: 50%; border: 0; color: white; background: var(--forest); cursor: pointer; }
.mode-note { margin: 10px 32px 0; color: var(--muted); font-size: .76rem; }
.batch-composer { margin: 0 32px 10px; display: grid; gap: 12px; max-height: 42vh; overflow: auto; padding: 14px; border: 1px solid var(--line); background: white; box-shadow: 0 8px 30px rgba(31,45,38,.08); }
.batch-help { margin: 0; color: var(--muted); font-size: .8rem; }
.batch-question { display: grid; gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--line); }
.batch-question legend { padding: 0 5px; color: var(--forest); font-weight: 700; font-size: .84rem; }
.batch-question label { display: grid; gap: 5px; color: var(--muted); font-size: .75rem; }
.batch-question textarea { min-height: 74px; resize: vertical; }
.batch-action { max-width: 190px; }
.batch-send { justify-self: end; border: 0; padding: 10px 14px; color: white; background: var(--forest); cursor: pointer; font-weight: 800; }
.turn-progress { margin: 0 32px 10px; padding: 12px 14px; border: 1px solid #b9cfc4; background: #eef6f1; }
.turn-progress > div:first-child { display: flex; justify-content: space-between; gap: 18px; color: var(--forest-dark); font-size: .78rem; font-weight: 750; }
.turn-progress small { color: var(--muted); font-weight: 500; }
.turn-progress-track { height: 4px; margin-top: 9px; overflow: hidden; background: #d8e5dd; }
.turn-progress-track span { display: block; width: 38%; height: 100%; background: var(--forest); animation: waiting-progress 1.35s ease-in-out infinite; }
@keyframes waiting-progress { 0% { transform: translateX(-105%); } 100% { transform: translateX(365%); } }
.resume-turn { margin: 0 32px 10px; padding: 11px 14px; color: #713d20; background: #fff0d8; border: 1px solid #d6b47d; cursor: pointer; font-weight: 800; }
.summary-link { margin: 0 32px 15px; display: flex; justify-content: center; gap: 15px; color: var(--forest); font-weight: 800; text-decoration: none; font-size: .82rem; }
.summary-link.disabled { pointer-events: none; opacity: .35; }

.summary-head { margin: 25px 0 48px; }
.summary-head h1 { font-size: clamp(2.8rem, 6vw, 4.6rem); margin: 12px 0 18px; }
.summary-head p { color: var(--muted); max-width: 620px; }
.summary-form { display: grid; gap: 18px; }
.summary-field { background: var(--card); border: 1px solid var(--line); padding: 20px; }
.summary-field > span { font-family: Georgia, serif; font-size: 1.25rem; font-weight: 500; }
.summary-field small { color: var(--muted); font-weight: 400; margin-bottom: 8px; }
.summary-field textarea { min-height: 112px; resize: vertical; line-height: 1.5; background: #fbfaf5; }
.summary-field textarea[readonly] { color: #4f5954; background: #efeee9; }
.confirmation-box { padding: 22px; background: var(--mint); border-left: 4px solid var(--forest); }
.confirmation-box label { display: flex; grid-template-columns: auto 1fr; align-items: flex-start; gap: 12px; font-weight: 500; }
.confirmation-box input { width: auto; margin-top: 5px; }

.review-hero { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 10px 0 45px; border-bottom: 1px solid var(--line); }
.review-hero h1 { font-size: clamp(2.5rem, 5vw, 4.3rem); margin: 10px 0; max-width: 820px; }
.review-hero p { color: var(--muted); }
.review-grid { display: grid; grid-template-columns: 1fr 320px; gap: 42px; margin-top: 36px; }
.authority-banner { padding: 25px; background: var(--forest); color: white; margin-bottom: 18px; display: grid; }
.authority-banner > span { color: #bcd1c7; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.authority-banner strong { font-family: Georgia, serif; font-size: 2rem; margin: 3px 0; }
.authority-banner p { color: #bcd1c7; margin: 0; font-size: .8rem; }
.review-section { padding: 23px; background: var(--card); border: 1px solid var(--line); margin-bottom: 12px; }
.review-section h3 { font-family: Georgia, serif; font-weight: 500; margin-bottom: 10px; }
.review-section p { white-space: pre-wrap; margin: 0; color: #3f4944; }
.side-card { background: var(--card); border: 1px solid var(--line); padding: 20px; margin-bottom: 15px; }
.side-card h3 { font-family: Georgia, serif; font-weight: 500; }
.side-card p, .side-card code { font-size: .75rem; overflow-wrap: anywhere; color: var(--muted); }
.audit-event { border-top: 1px solid var(--line); padding: 12px 0; display: grid; }
.audit-event span { font-size: .75rem; font-weight: 750; }
.audit-event small { color: var(--muted); }
.diff { margin: 45px 0; }
.diff-row { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.diff-row h4 { margin: 10px 0; }
.diff-row > div { background: var(--card); padding: 12px; border: 1px solid var(--line); }
.diff-row span { font-size: .68rem; color: var(--muted); text-transform: uppercase; }
.diff-row p { margin: 7px 0 0; font-size: .82rem; }
.removed { border-left: 3px solid #cf7777; padding-left: 9px; }
.added { border-left: 3px solid #5d9875; padding-left: 9px; }
.transcript { border: 1px solid var(--line); background: var(--card); }
.transcript p { display: grid; grid-template-columns: 130px 1fr; padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; font-size: .8rem; }
.transcript p:last-child { border: 0; }
.transcript strong { color: var(--forest); }
.transcript span { white-space: pre-wrap; }

@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .import-panel, .review-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: 60vh; }
  .login-card { margin: -30px auto 30px; position: relative; z-index: 2; }
  .session-layout { grid-template-columns: 260px 1fr; }
  .review-side { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
}
@media (max-width: 680px) {
  .topbar { padding: 0 16px; }
  .brand > span:last-child, .topbar-user > span:first-child { display: none; }
  .page { padding: 30px 17px 70px; }
  .hero { align-items: flex-start; }
  .hero-note { min-width: 90px; }
  .card-grid { grid-template-columns: 1fr; }
  .import-panel { padding: 24px; gap: 25px; }
  .import-form { grid-template-columns: 1fr; }
  .import-form label:first-of-type { grid-column: auto; }
  .session-body { overflow: auto; }
  .session-body main { height: auto; }
  .session-layout { display: block; }
  .context-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px; }
  .context-panel .back, .context-panel .safety-note { display: none; }
  .context-panel h1 { font-size: 1.5rem; }
  .context-block { display: none; }
  .context-block.collaboration-request, .context-block.collaboration-status { display: grid; }
  .conversation { height: calc(100vh - 265px); min-height: 600px; }
  .messages { padding: 22px 14px; }
  .conversation-head, .quick-actions { padding-left: 14px; padding-right: 14px; }
  .composer, .summary-link, .mode-note, .batch-composer, .turn-progress, .resume-turn { margin-left: 14px; margin-right: 14px; }
  .turn-progress > div:first-child { display: grid; gap: 3px; }
  .review-hero { align-items: flex-start; flex-direction: column; }
  .review-side { grid-template-columns: 1fr; }
  .diff-row { grid-template-columns: 1fr; }
  .transcript p { grid-template-columns: 1fr; gap: 5px; }
}

/* Documentation hub and multisession workflows */
.main-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; margin-left: 28px; }
.main-nav a { color: var(--muted); text-decoration: none; font-size: .76rem; font-weight: 700; padding: 8px 10px; border-radius: 4px; }
.main-nav a:hover { color: var(--forest); background: var(--mint); }
.topnav-dropdown { position: relative; }
.topnav-dropdown summary { padding: 8px 10px; color: var(--muted); border-radius: 4px; cursor: pointer; font-size: .76rem; font-weight: 700; list-style: none; }
.topnav-dropdown summary::-webkit-details-marker { display: none; }
.topnav-dropdown summary::after { content: "⌄"; margin-left: 5px; }
.topnav-dropdown summary:hover { color: var(--forest); background: var(--mint); }
.topnav-dropdown > div { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; min-width: 155px; padding: 6px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.topnav-dropdown > div a { display: block; white-space: nowrap; }
.password-entry-cta { display: grid; gap: 5px; margin-top: 22px; padding: 17px 18px; color: var(--forest-dark); background: var(--mint); border: 1px solid #b7cec1; text-decoration: none; }
.password-entry-cta strong { font-family: Georgia, serif; font-size: 1.08rem; }
.password-entry-cta span { display: flex; justify-content: space-between; font-size: .78rem; }
.documentation-banner { margin: -22px 0 32px; padding: 18px 22px; color: white; background: var(--forest); text-decoration: none; display: flex; align-items: center; justify-content: space-between; }
.documentation-banner span { display: grid; gap: 3px; }
.documentation-banner small { color: #c5d7cf; }
.documentation-banner b { color: #e0c08b; }
.hero-copy { color: var(--muted); max-width: 60ch; margin-top: 20px; }
.documentation-hero { border-bottom: 1px solid var(--line); padding-bottom: 45px; }
.session-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 18px; margin: 38px 0 52px; }
.session-type-card { min-height: 270px; padding: 30px; color: var(--ink); background: var(--card); border: 1px solid var(--line); text-decoration: none; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.session-type-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.session-type-card h2 { margin: 18px 0 10px; font-family: Georgia, serif; font-size: 1.85rem; font-weight: 500; }
.session-type-card p { color: var(--muted); max-width: 48ch; }
.session-type-card > strong { color: var(--forest); margin-top: auto; display: flex; justify-content: space-between; }
.type-icon { width: 44px; height: 44px; display: grid; place-items: center; color: white; background: var(--forest); border-radius: 50%; font-family: Georgia, serif; font-size: 1.4rem; margin-bottom: 22px; }
.type-grievance .type-icon { background: #9a5d42; }
.type-wiki_entry .type-icon { background: #7f6b48; }
.quick-links { display: grid; grid-template-columns: minmax(210px, .7fr) minmax(0, 1.3fr); gap: 20px; align-items: stretch; padding: 25px 0 52px; }
.quick-links h2 { margin: 8px 0 0; font-family: Georgia, serif; font-size: 1.75rem; font-weight: 500; }
.quick-link-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 18px 20px; color: var(--ink); background: #edf4ef; border: 1px solid #bdd2c5; text-decoration: none; }
.quick-link-card:hover { background: var(--mint); box-shadow: var(--shadow); }
.quick-link-icon { width: 44px; height: 44px; display: grid; place-items: center; color: white; background: var(--forest); border-radius: 50%; font-size: .7rem; font-weight: 800; }
.quick-link-card > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.quick-link-card strong { font-family: Georgia, serif; font-size: 1.2rem; font-weight: 500; }
.quick-link-card small { color: var(--muted); }
.quick-link-card > b { color: var(--forest); font-size: 1.25rem; }
.model-selection-page .subhero { max-width: 760px; }
.model-selection-panel, .chatgpt-login-guide, .usage-cost-note { padding: 28px; background: var(--card); border: 1px solid var(--line); }
.ai-login-progress { min-height: 1.5em; margin-top: 14px; color: var(--muted); }
.ai-login-progress a { color: var(--forest); font-weight: 800; }
.ai-roster { display: grid; margin-top: 18px; border-top: 1px solid var(--line); }
.ai-roster-row { display: grid; grid-template-columns: 1.3fr 1fr 1.25fr 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .78rem; }
.ai-roster-head { color: var(--muted); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.context-window .context-meter { height: 6px; margin-top: 8px; overflow: hidden; background: #e4e2db; }
.context-window .context-meter span { display: block; height: 100%; background: var(--forest); }
.context-window.yellow .context-meter span { background: #b78328; }
.context-window.red .context-meter span { background: #a63b35; }
.context-warning { margin: 9px 0; font-size: .72rem; line-height: 1.4; }
.context-warning.yellow { color: #805a13; }
.context-warning.red { color: #8c2f2f; }
.model-selection-panel { border-top: 5px solid var(--forest); box-shadow: var(--shadow); }
.model-selection-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.connection-state { padding: 5px 9px; border-radius: 99px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.connection-state.connected { color: #1e5c3e; background: #d9ebdf; }
.connection-state.not-connected { color: #7d3e27; background: #f2e0d8; }
.model-selection-panel h2, .chatgpt-login-guide h2, .usage-cost-note h2 { margin: 10px 0; font-family: Georgia, serif; font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 500; }
.model-options { display: grid; gap: 9px; margin-top: 22px; }
.model-option { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; background: #f4f2eb; border: 1px solid var(--line); }
.model-option.selected { background: var(--mint); border-color: #a8c6b3; }
.model-option > span { width: 26px; height: 26px; display: grid; place-items: center; color: var(--forest); border: 1px solid currentColor; border-radius: 50%; font-size: .75rem; font-weight: 800; }
.model-option > div { min-width: 0; display: grid; gap: 2px; }
.model-option strong { overflow-wrap: anywhere; }
.model-option small { color: var(--muted); font-size: .75rem; }
.model-option > b { color: var(--forest); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.chatgpt-login-guide { margin-top: 18px; display: grid; grid-template-columns: .75fr 1.25fr; column-gap: 28px; }
.chatgpt-login-guide ol { margin: 3px 0 12px; padding-left: 22px; grid-column: 2; line-height: 1.7; }
.chatgpt-login-guide p { grid-column: 2; margin: 0; color: var(--muted); font-size: .85rem; }
.usage-cost-note { margin-top: 18px; color: white; background: var(--forest-dark); border-color: var(--forest-dark); }
.usage-cost-note .eyebrow { color: #d6b57e; }
.usage-cost-note p { max-width: 76ch; color: #d1dfd8; }
.activity-list { display: grid; border: 1px solid var(--line); background: var(--card); }
.activity-row { min-width: 0; display: grid; grid-template-columns: 145px minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 16px 18px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border: 0; }
.activity-row:hover { background: #f2f1eb; }
.activity-row > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.activity-row strong, .activity-row small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.activity-row small { color: var(--muted); }
.activity-type { color: var(--forest); font-size: .68rem; font-weight: 800; letter-spacing: .08em; }
.subhero { max-width: 900px; margin-bottom: 36px; }
.subhero .back { margin-bottom: 26px; }
.subhero h1 { margin: 10px 0 12px; font-size: clamp(2.8rem, 6vw, 4.8rem); }
.subhero p { color: var(--muted); max-width: 68ch; font-size: 1rem; }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 24px; align-items: start; }
.editor-card, .guide-card, .creation-panel, .question-box { background: var(--card); border: 1px solid var(--line); padding: 25px; }
.guide-card { position: sticky; top: 92px; }
.guide-card ol { padding-left: 22px; line-height: 2; }
.guide-card p { color: var(--muted); font-size: .82rem; }
.question-box { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: stretch; box-shadow: var(--shadow); }
.question-box textarea { min-height: 110px; resize: vertical; border: 0; box-shadow: none; font-size: 1.05rem; }
.question-box .primary { align-self: end; }
.creation-panel summary { cursor: pointer; font-family: Georgia, serif; font-size: 1.6rem; }
.creation-panel[open] summary { margin-bottom: 22px; }
.contribution-kind { max-width: 360px; padding: 14px; background: var(--mint); border-left: 4px solid var(--forest); }
.contribution-kind span { display: block; margin-bottom: 7px; color: var(--forest-dark); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.contribution-kind select { width: 100%; background: var(--card); }
.grievance-feed { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.grievance-card { min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 22px; color: var(--ink); background: var(--card); border: 1px solid var(--line); text-decoration: none; }
.grievance-card h3 { margin: 9px 0; font-family: Georgia, serif; font-size: 1.35rem; }
.grievance-card p { color: var(--muted); }
.card-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.coverage-chip { align-self: flex-start; padding: 6px 9px; color: #6f4d2e; background: #eee3cf; font-size: .7rem; font-weight: 800; border-radius: 99px; }
.wiki-search { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; }
.wiki-search input { font-size: 1rem; }
.secondary-button { display: inline-flex; justify-content: center; align-items: center; padding: 11px 16px; color: var(--forest); background: transparent; border: 1px solid var(--forest); text-decoration: none; font-weight: 800; font-size: .82rem; cursor: pointer; }
.wiki-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 34px; align-items: start; }
.wiki-entry-only { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 28px; margin-bottom: 34px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.wiki-entry-only > div:first-child { max-width: 720px; }
.wiki-entry-only h2 { margin: 6px 0 10px; }
.wiki-entry-actions { display: grid; min-width: 260px; gap: 10px; }
.wiki-destination-form { gap: 10px; }
.wiki-destination-form select { width: 100%; background: var(--card); }
.entry-guidance { margin-bottom: 22px; padding: 18px 20px; border-left: 4px solid var(--gold); background: #f7f2e8; }
.entry-guidance p { margin: 6px 0 0; }
.knowledge-extraction { margin-bottom: 28px; padding: 22px; border: 1px solid #b9cfc4; background: #f2f7f4; }
.knowledge-extraction > .review-section { background: white; }
.extraction-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 18px 0; }
.extraction-meta div { min-width: 0; padding: 10px 12px; background: rgba(255,255,255,.7); border: 1px solid #d4e1da; }
.extraction-meta dt { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.extraction-meta dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: .75rem; }
.checker-panel { margin: 18px 0; padding: 16px; background: white; border: 1px solid var(--line); }
.checker-panel h3 { margin: 0 0 10px; }
.checker-alerts { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.checker-alerts li { display: grid; gap: 3px; padding: 10px 12px; border-left: 4px solid #b78328; background: #fff7df; }
.checker-alerts li.blocking { border-left-color: #a14f4f; background: #f8e6e6; }
.checker-alerts span, .checker-alerts code { font-size: .75rem; overflow-wrap: anywhere; }
.checker-clear { margin: 0; color: #20523f; }
.extraction-items { display: grid; gap: 12px; }
.extraction-item { padding: 16px; background: white; border: 1px solid var(--line); border-left: 5px solid #698d7b; }
.extraction-item.category-erp_candidate_requirement { border-left-color: #b78328; }
.extraction-item.category-legacy_evidence { border-left-color: #777; background: #f5f4f0; }
.extraction-item.category-open_question { border-left-color: #a15f5f; }
.extraction-item label { display: grid; gap: 5px; margin-bottom: 10px; font-size: .72rem; font-weight: 800; }
.extraction-item select { width: 100%; background: white; }
.extraction-item textarea { min-height: 82px; resize: vertical; }
.extraction-item > p { white-space: pre-wrap; }
.category-code, .extraction-authority { color: var(--muted); font-size: .67rem; font-weight: 800; }
.provenance { margin-top: 10px; font-size: .72rem; }
.provenance summary { cursor: pointer; font-weight: 800; }
.provenance ul { display: grid; gap: 8px; padding-left: 18px; }
.provenance li { overflow-wrap: anywhere; }
.provenance li span { display: block; color: var(--muted); }
.provenance blockquote { margin: 4px 0; padding-left: 8px; border-left: 2px solid var(--line); white-space: pre-wrap; }
.add-extraction-items { margin: 16px 0; padding: 14px; background: white; border: 1px solid var(--line); }
.add-extraction-items summary { cursor: pointer; font-weight: 800; }
.add-extraction-items label { display: grid; gap: 5px; margin-top: 12px; font-size: .72rem; font-weight: 800; }
.add-extraction-items textarea { min-height: 70px; }
.extraction-actions { display: grid; gap: 12px; margin-top: 16px; }
.extraction-actions button, .refresh-extraction-form button { justify-self: start; }
.extraction-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.extraction-footer p { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .73rem; }
.integration-boundary { margin: 16px 0 0; padding: 10px 12px; color: #654a29; background: #f7f2e8; border-left: 4px solid var(--gold); font-size: .75rem; font-weight: 700; }
.source-list { display: grid; border: 1px solid var(--line); }
.source-row { display: grid; grid-template-columns: 90px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px 15px; color: var(--ink); background: var(--card); border-bottom: 1px solid var(--line); text-decoration: none; }
.source-row:last-child { border-bottom: 0; }
.source-row > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.source-row strong, .source-row small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.source-row small { color: var(--muted); }
.source-category { font-size: .65rem; color: var(--forest); font-weight: 800; }
.sensitive-badge { display: inline-block; padding: 5px 8px; color: #7a3131; background: #f1dada; font-size: .65rem; font-weight: 800; border-radius: 99px; }
.sensitive-notice { margin-top: 28px; padding: 12px 15px; color: #723c3c; background: #f4e6e2; border-left: 4px solid #a15f5f; font-size: .8rem; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.document-session-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.document-session-head h1 { margin: 10px 0; max-width: 900px; font-size: clamp(2.4rem,5vw,4.2rem); }
.document-session-head p { color: var(--muted); }
.session-badges { display: flex; gap: 8px; }
.result-document { min-width: 0; }
.route-decision, .coverage-banner { display: grid; gap: 4px; padding: 24px; color: white; background: var(--forest); margin-bottom: 18px; }
.route-decision span, .coverage-banner span { color: #bdd0c7; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.route-decision strong, .coverage-banner strong { font-family: Georgia, serif; font-size: 1.7rem; }
.coverage-banner p { margin: 5px 0 0; color: #d9e5df; font-size: .78rem; }
.coverage-covered_with_difference, .coverage-partially_covered { background: #79632d; }
.coverage-not_found { background: #8b5b48; }
.coverage-contradiction_found { background: #843e3e; }
.result-group { margin: 28px 0; padding: 20px; border: 1px solid var(--line); }
.result-group > .section-title { margin-bottom: 14px; }
.human-result-group { background: #f1f7f3; border-color: #b7cfc2; }
.ai-result-group { background: #f8f4ea; border-color: #d8c9a8; }
.attributed-section { background: var(--card); }
.attribution-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.attribution-line span { flex: 0 0 auto; color: var(--forest); font-size: .63rem; font-weight: 850; letter-spacing: .07em; }
.attributed-section small { display: block; margin-top: 12px; color: var(--muted); }
.answer-body { padding: 24px; background: var(--card); border: 1px solid var(--line); font-size: 1rem; line-height: 1.65; }
.as-of { color: var(--muted); font-size: .7rem; }
.human-correction { margin: 24px 0; padding: 20px; background: var(--mint); border-left: 4px solid var(--forest); }
.human-correction small { color: var(--muted); }
.feedback-panel, .attachment-panel { margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--line); }
.feedback-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.feedback-actions button { padding: 9px 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.feedback-actions label { flex: 1 0 100%; }
.feedback-actions .primary { color: white; background: var(--forest); }
.citation { display: grid; gap: 4px; padding: 10px 0; color: var(--ink); border-top: 1px solid var(--line); text-decoration: none; }
.citation span, .citation small { color: var(--muted); font-size: .68rem; overflow-wrap: anywhere; }
.citation em { color: var(--forest); font-size: .65rem; font-style: normal; font-weight: 800; }
.citation:hover strong, .citation:focus-visible strong { text-decoration: underline; }
.qa-session-layout { grid-template-columns: minmax(300px, 340px) minmax(0, 1fr); }
.qa-context-panel h1 { font-size: 1.55rem; line-height: 1.16; }
.qa-context-panel small { color: var(--muted); line-height: 1.45; }
.qa-citation-context { max-height: 40vh; overflow: auto; }
.qa-citation-context .citation { padding: 13px 0; }
.qa-conversation { display: flex; flex-direction: column; }
.qa-alert { margin: 14px 32px 0; }
.qa-messages { flex: 1 1 auto; padding-bottom: 12px; }
.qa-answer { max-width: min(860px, 100%); }
.qa-answer .bubble { line-height: 1.65; background: #eeece5; }
.qa-feedback-panel { margin: 0 32px 16px; padding: 18px 0 0; }
.qa-feedback-panel > p { margin: 6px 0 14px; color: var(--muted); font-size: .78rem; }
.feedback-actions { display: grid; }
.feedback-verdicts { display: flex; flex-wrap: wrap; gap: 9px; }
.feedback-actions button { font-weight: 700; }
.feedback-actions button:hover, .feedback-actions button:focus-visible { color: var(--forest); background: var(--mint); border-color: #9bbcac; }
.feedback-details { display: grid; gap: 12px; margin-top: 14px; }
.feedback-details textarea { min-height: 110px; resize: vertical; }
.coverage-summary { display: grid; gap: 5px; margin: 20px 0; padding: 17px; color: white; background: var(--forest); }
.coverage-summary > span, .coverage-summary small { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.coverage-summary strong { font-family: Georgia, serif; font-size: 1.25rem; }
.coverage-summary.coverage-partially_documented { background: #8a6b31; }
.coverage-summary.coverage-contradiction_found { background: #914b3a; }
.coverage-summary.coverage-information_not_available { background: #65645f; }
.qa-turn { align-items: flex-start; max-width: min(940px, 100%); }
.qa-turn-body { min-width: 0; width: 100%; }
.qa-turn-labels { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 7px; }
.qa-turn-labels span { padding: 3px 7px; border-radius: 99px; background: #e7e5dd; color: var(--muted); font-size: .58rem; font-weight: 800; letter-spacing: .035em; }
.qa-turn-labels .qa-coverage-tag { color: var(--forest); background: var(--mint); }
.qa-turn-sources { margin: 9px 0 0; padding: 9px 12px; background: #faf9f4; border: 1px solid var(--line); }
.qa-turn-sources summary { cursor: pointer; color: var(--forest); font-size: .72rem; font-weight: 800; }
.qa-composer-panel { display: grid; gap: 15px; margin: 0 32px 24px; padding: 22px; border-top: 1px solid var(--line); background: #f7f5ee; }
.qa-composer-panel h3 { margin: 0; font-family: Georgia, serif; font-size: 1.25rem; }
.qa-composer-panel p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }
.qa-follow-up-form { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.qa-follow-up-form label { display: grid; gap: 5px; font-size: .72rem; font-weight: 700; }
.qa-follow-up-form textarea { min-height: 82px; resize: vertical; }
.qa-finish-button, .qa-quick-actions button { padding: 9px 12px; color: #743d2b; border: 1px solid #b58b76; background: #fffaf5; cursor: pointer; font-weight: 800; }
.qa-finish-button:hover, .qa-finish-button:focus-visible { color: white; background: #743d2b; }
.qa-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qa-quick-actions form { display: grid; gap: 8px; }
.qa-quick-actions button { color: var(--forest); border-color: var(--line); background: var(--card); font-weight: 700; }
.qa-quick-actions button:hover, .qa-quick-actions button:focus-visible { background: var(--mint); border-color: #9bbcac; }
.qa-quick-actions button:disabled, .qa-finish-button:disabled { opacity: .55; cursor: wait; }
.qa-finish-form { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.qa-finish-form small { color: var(--muted); }
.qa-finish-form .session-waiting-progress, .qa-quick-actions .session-waiting-progress { flex-basis: 100%; }
.session-waiting-progress { grid-column: 1 / -1; display: grid; gap: 8px; padding: 11px 13px; border: 1px solid #b9cfc4; background: #eef6f1; }
.session-waiting-copy { display: flex; justify-content: space-between; gap: 16px; color: var(--forest-dark); font-size: .76rem; }
.session-waiting-copy small { color: var(--muted); font-weight: 500; }
.session-waiting-track { height: 4px; overflow: hidden; background: #d8e5dd; }
.session-waiting-track span { display: block; width: 38%; height: 100%; background: var(--forest); animation: waiting-progress 1.35s ease-in-out infinite; }
.session-waiting-progress[hidden] { display: none; }
form[data-waiting-form][aria-busy="true"] .primary, form[data-waiting-form][aria-busy="true"] button.is-waiting { cursor: wait; }
form[data-waiting-form][aria-busy="true"] textarea, form[data-waiting-form][aria-busy="true"] select { opacity: .72; }
.interview-finish { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px; color: var(--forest-dark); background: #fff6e9; border: 1px solid #dbc19d; }
.interview-finish small { color: var(--muted); }
.interview-finish .finish-action { margin-left: 0; color: #743d2b; border-color: #b58b76; background: #fffaf5; }
.interview-finish .finish-action:hover, .interview-finish .finish-action:focus-visible { color: white; background: #743d2b; }
.qa-artifact-panel { margin: 0 32px 30px; padding: 24px; border: 1px solid var(--line); background: var(--card); }
.qa-artifact-panel > p { color: var(--muted); }
.qa-artifact-form { display: grid; gap: 16px; }
.qa-artifact-form > label { display: grid; gap: 7px; font-weight: 700; }
.qa-artifact-form textarea { min-height: 62vh; resize: vertical; font-family: Consolas, "Courier New", monospace; font-size: .78rem; line-height: 1.55; }
.qa-artifact-downloads { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.qa-artifact-preview { margin-top: 16px; }
.qa-artifact-preview summary { cursor: pointer; font-weight: 800; }
.qa-artifact-preview pre { max-height: 65vh; overflow: auto; padding: 18px; white-space: pre-wrap; overflow-wrap: anywhere; background: #f5f3ec; border: 1px solid var(--line); }
.cited-excerpt { margin: 0 0 18px; padding: 20px 22px; background: #fff4cd; border-left: 4px solid #b78328; }
.cited-excerpt p { margin: 8px 0 0; line-height: 1.6; }
.legacy-document mark { color: inherit; background: #ffe58a; box-shadow: 0 0 0 2px #ffe58a; }
.draft-preview, .legacy-document pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: "SFMono-Regular",Consolas,monospace; font-size: .75rem; line-height: 1.55; }
.legacy-document { padding: 28px; background: var(--card); border: 1px solid var(--line); }
.source-head { margin-bottom: 30px; }
.source-head h1 { font-size: clamp(2.5rem,5vw,4.3rem); margin: 10px 0; }
.source-head > p { color: var(--muted); overflow-wrap: anywhere; }
.source-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.source-meta span { padding: 5px 8px; color: var(--forest); background: var(--mint); font-size: .7rem; }
.attachment-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.attachment-grid figure { margin: 0; padding: 10px; background: var(--card); border: 1px solid var(--line); }
.attachment-grid img { width: 100%; height: 220px; object-fit: contain; background: #e7e5de; }
.attachment-grid figcaption { display: grid; gap: 4px; margin-top: 8px; font-size: .78rem; }
.attachment-grid small { color: var(--muted); }
.upload-form { display: grid; gap: 14px; margin-top: 20px; padding: 20px; background: var(--card); border: 1px solid var(--line); }
.image-paste-zone { display: grid; gap: 7px; min-height: 150px; place-content: center; padding: 18px; text-align: center; color: var(--muted); background: rgba(255,255,255,.5); border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; transition: border-color .2s,background .2s; }
.image-paste-zone:hover, .image-paste-zone:focus { outline: none; border-color: var(--forest); background: var(--mint); }
.image-paste-zone strong { color: var(--ink); font-size: 1rem; }
.image-paste-zone img { width: 100%; max-height: 320px; object-fit: contain; margin-top: 8px; border-radius: 8px; background: #e7e5de; }
.image-paste-zone.has-image { place-content: stretch; }
.image-paste-zone small { color: var(--forest); }
.wiki-big-entry textarea { min-height: 360px; resize: vertical; }
.wiki-capture-zone { min-height: 104px; }
.consent-check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.consent-check input { width: auto; }
.wiki-section { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 0; background: rgba(255,255,255,.45); }
.wiki-section legend { padding: 0 8px; font-weight: 700; }
.form-note { color: var(--muted); font-size: .88rem; }
.guided-panel { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.guided-messages { display: grid; gap: 12px; }
.guided-message { max-width: 86%; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.guided-message.assistant { margin-right: auto; }
.guided-message.user { margin-left: auto; background: var(--mint); }
.guided-message p { margin: 6px 0; line-height: 1.55; }
.guided-message small { color: var(--muted); }
.guided-composer { margin-top: 16px; }
.guided-composer textarea { min-height: 110px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.interview-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.interview-actions button { padding: 10px 13px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; }
.interview-actions .primary { color: white; background: var(--forest); border-color: var(--forest); }
.interview-actions .finish-action { margin-left: auto; color: #743d2b; border-color: #b58b76; }
.grievance-composer > small { color: var(--muted); }
.grievance-confirmation-panel { margin-top: 36px; padding-top: 30px; border-top: 1px solid var(--line); }
.grievance-confirmation-panel > .section-title > div h2 { margin: 5px 0; }
.grievance-summary-form { display: grid; gap: 22px; }
.synthesis-fieldset { display: grid; gap: 14px; margin: 0; padding: 20px; border: 1px solid var(--line); }
.synthesis-fieldset legend { padding: 0 8px; font-family: Georgia, serif; font-size: 1.25rem; }
.synthesis-fieldset > p { color: var(--muted); font-size: .82rem; }
.human-synthesis { background: #f1f7f3; border-color: #b7cfc2; }
.ai-synthesis { background: #f8f4ea; border-color: #d8c9a8; }
.artifact-card { overflow-wrap: anywhere; }
.artifact-card small { display: block; margin-bottom: 14px; color: var(--muted); }
.artifact-card .secondary-button { width: 100%; }

@media (max-width: 1050px) {
  .main-nav { display: none; }
  .workspace-grid, .wiki-layout { grid-template-columns: 1fr; }
  .wiki-entry-only { align-items: stretch; flex-direction: column; }
  .wiki-entry-actions { min-width: 0; }
  .guide-card { position: static; }
}
@media (max-width: 760px) {
  .session-type-grid, .grievance-feed, .attachment-grid, .quick-links, .chatgpt-login-guide { grid-template-columns: 1fr; }
  .activity-row { grid-template-columns: 1fr auto; }
  .activity-type { grid-column: 1 / -1; }
  .question-box, .wiki-search, .form-pair { grid-template-columns: 1fr; }
  .document-session-head { align-items: flex-start; flex-direction: column; }
  .qa-session-layout { display: block; }
  .qa-context-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .qa-citation-context { max-height: none; }
  .qa-conversation { min-height: calc(100vh - 240px); height: auto; }
  .qa-alert, .qa-feedback-panel { margin-left: 14px; margin-right: 14px; }
  .qa-composer-panel, .qa-artifact-panel { margin-left: 14px; margin-right: 14px; }
  .qa-follow-up-form { grid-template-columns: 1fr; }
  .chatgpt-login-guide ol, .chatgpt-login-guide p { grid-column: 1; }
  .model-selection-panel, .chatgpt-login-guide, .usage-cost-note { padding: 21px; }
  .model-selection-head { align-items: flex-start; flex-direction: column; }
  .model-option { grid-template-columns: 30px minmax(0, 1fr); }
  .model-option > b { grid-column: 2; }
  .ai-roster-row { grid-template-columns: 1fr 1fr; }
  .ai-roster-head { display: none; }
  .attribution-line { display: grid; gap: 5px; }
  .interview-actions .finish-action { margin-left: 0; }
}

/* ── Progress Report (dark theme) ────────────────────────────────────── */
.prc-body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(circle at 18% 8%,rgba(32,214,176,.12),transparent 30%),
              radial-gradient(circle at 88% 18%,rgba(217,168,78,.12),transparent 26%),
              linear-gradient(135deg,#020910 0%,#041320 56%,#02070d 100%);
  font-family: Inter,Arial,Helvetica,sans-serif;
  color: #f4f7f8;
}
.prc-topbar { background: rgba(4,19,32,.92); border-bottom-color: rgba(32,214,176,.3); }
.prc-topbar .brand, .prc-topbar .topbar-user, .prc-topbar .main-nav a { color: #f4f7f8; }
.prc-topbar .main-nav a:hover { color: #20d6b0; }
.prc-nav-active { color: #20d6b0 !important; font-weight: 800; }
.prc-topbar .brand-mark { background: #20d6b0; color: #041320; }
.prc-topbar .topnav-dropdown summary { color: #f4f7f8; }
.prc-topbar .topnav-dropdown div { background: #071d2e; border-color: rgba(32,214,176,.3); }
.prc-topbar .topnav-dropdown a { color: #f4f7f8; }
.prc-topbar .link-button { color: #b8c7d0; }
.prc-topbar .role { color: #20d6b0; background: rgba(32,214,176,.15); }
.prc-page { width: min(1680px,96vw); margin: 0 auto; padding: 34px 0 42px; }
.prc-top { display: grid; grid-template-columns: 280px 1fr 280px; align-items: center; margin-bottom: 24px; }
.prc-date-box {
  justify-self: end; border: 1px solid rgba(217,168,78,.72); border-radius: 12px;
  padding: 12px 18px; text-align: center; color: #d9a84e; font-weight: 850;
  text-transform: uppercase; letter-spacing: .06em; background: rgba(0,0,0,.16);
  box-shadow: 0 0 18px rgba(217,168,78,.08);
}
.prc-date-box span { display: block; margin-top: 4px; color: #f4f7f8; font-size: 20px; letter-spacing: .02em; text-transform: none; }
.prc-cgmp { display: flex; align-items: center; gap: 16px; font-weight: 850; font-size: 48px; letter-spacing: .02em; color: #f4f7f8; }
.prc-logo-mark {
  width: 74px; height: 74px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 50% 50%,transparent 0 22%,#d9a84e 23% 29%,transparent 30% 42%,#d9a84e 43% 50%,transparent 51%);
}
.prc-logo-mark::before, .prc-logo-mark::after {
  content: ""; position: absolute; border-radius: 50%; border: 8px solid #d9a84e;
  border-right-color: transparent; border-bottom-color: transparent; transform: rotate(-22deg);
}
.prc-logo-mark::before { inset: 8px; }
.prc-logo-mark::after { inset: 22px; border-width: 6px; }
.prc-brand { text-align: center; font-size: clamp(48px,5vw,78px); font-weight: 780; letter-spacing: .19em; line-height: 1; color: #f4f7f8; }
.prc-x { color: #20d6b0; }
.prc-dashboard { display: flex; flex-direction: column; gap: 24px; }
.prc-panel {
  display: grid; grid-template-columns: 250px 1fr; column-gap: 36px;
  min-height: 372px; padding: 30px 34px;
  border: 1.5px solid rgba(32,214,176,.75); border-radius: 18px;
  background: linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,.015)),rgba(3,17,29,.83);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.015),0 22px 60px rgba(0,0,0,.22);
}
.prc-gauge-col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding-top: 18px; }
.prc-ring {
  --value: 0; width: 205px; height: 205px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(#20d6b0 calc(var(--value) * 1%), rgba(255,255,255,.13) 0);
  box-shadow: 0 0 32px rgba(32,214,176,.07);
}
.prc-ring::before { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: #061727; box-shadow: inset 0 0 28px rgba(0,0,0,.42); }
.prc-ring-inner { position: relative; z-index: 2; text-align: center; }
.prc-ring-value { color: #20d6b0; font-size: 58px; font-weight: 850; line-height: 1; }
.prc-ring-label { margin-top: 10px; font-size: 17px; font-weight: 800; line-height: 1.25; text-transform: uppercase; }
.prc-content { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.prc-panel-title { margin: 0 0 8px; color: #20d6b0; font-size: clamp(24px,2.3vw,33px); font-weight: 850; letter-spacing: .045em; text-transform: uppercase; line-height: 1.15; }
.prc-scope-pill {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  margin-bottom: 28px; padding: 7px 13px;
  border: 1px solid rgba(32,214,176,.78); border-radius: 8px;
  background: rgba(0,0,0,.12); color: #f4f7f8; font-size: 18px; font-weight: 650;
}
.prc-scope-pill strong { color: #d9a84e; font-size: 22px; font-weight: 900; }
.prc-phase-labels, .prc-bar, .prc-ruler { display: grid; grid-template-columns: var(--cols); }
.prc-phase-labels { margin-bottom: 12px; align-items: end; }
.prc-phase-label { min-width: 0; padding: 0 10px; text-align: center; line-height: 1.22; }
.prc-phase-name { display: block; font-size: clamp(12px,1vw,17px); font-weight: 850; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prc-phase-weight { display: block; margin-top: 6px; font-size: clamp(12px,.95vw,16px); font-weight: 750; }
.prc-c1 { color: #20d6b0; } .prc-c2 { color: #4fb2ff; } .prc-c3 { color: #f7a61c; }
.prc-c4 { color: #d17aff; } .prc-c5 { color: #d6e925; } .prc-c6 { color: rgba(255,255,255,.86); }
.prc-bar { height: 112px; overflow: hidden; border-radius: 8px; border: 1px solid rgba(255,255,255,.26); background: rgba(255,255,255,.05); }
.prc-segment {
  position: relative; min-width: 0; border-left: 1px solid rgba(255,255,255,.26);
  background: linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.04)),rgba(255,255,255,.1);
}
.prc-segment:first-child { border-left: 0; }
.prc-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--fill);
  background: repeating-linear-gradient(-45deg,rgba(255,255,255,.12),rgba(255,255,255,.12) 8px,rgba(255,255,255,.02) 8px,rgba(255,255,255,.02) 16px),linear-gradient(90deg,#087b72,#20d6b0);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.55);
}
.prc-fill::after { content: ""; position: absolute; top: 0; right: -1px; width: 1px; height: 100%; background: rgba(255,255,255,.78); box-shadow: 0 0 8px #20d6b0; }
.prc-segment-content { position: relative; z-index: 2; height: 100%; display: grid; place-items: center; text-align: center; padding: 8px; }
.prc-phase-progress { font-size: clamp(20px,2vw,34px); font-weight: 850; line-height: 1; }
.prc-phase-progress span { display: block; margin-top: 9px; font-size: clamp(11px,.8vw,15px); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.prc-ruler { height: 40px; margin-top: 5px; align-items: start; }
.prc-ruler-part { position: relative; min-width: 0; text-align: center; padding-top: 16px; font-size: clamp(13px,1.2vw,23px); font-weight: 800; }
.prc-ruler-part::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 2px; border-top: 2px dashed currentColor; opacity: .62; }
.prc-ruler-part::after { content: ""; position: absolute; top: 0; right: -1px; width: 1px; height: 12px; border-right: 2px dashed rgba(255,255,255,.55); }

.prc-detail-section { margin-top: 16px; }
.prc-detail-toggle {
  cursor: pointer; color: #20d6b0; font-weight: 700; font-size: .9rem;
  padding: 8px 0; border: 0; background: none; letter-spacing: .03em;
}
.prc-detail-toggle:hover { text-decoration: underline; }
.prc-detail-table { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.prc-detail-row {
  display: grid; grid-template-columns: 180px 60px 1fr; gap: 12px;
  padding: 6px 10px; border-radius: 6px; background: rgba(255,255,255,.04);
  font-size: .84rem;
}
.prc-detail-label { font-weight: 700; color: #f4f7f8; }
.prc-detail-value { font-weight: 850; color: #20d6b0; text-align: right; }
.prc-detail-desc { color: #b8c7d0; font-size: .8rem; }

.prc-history { margin-top: 32px; padding: 24px 30px; border: 1px solid rgba(32,214,176,.4); border-radius: 14px; background: rgba(3,17,29,.7); }
.prc-history-title { margin: 0 0 16px; color: #20d6b0; font-size: 1.2rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.prc-history-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.prc-history-row {
  display: grid; grid-template-columns: 180px 70px 60px 1fr; gap: 12px;
  padding: 6px 10px; border-radius: 6px; background: rgba(255,255,255,.03);
  font-size: .8rem;
}
.prc-history-date { color: #b8c7d0; }
.prc-history-trigger { color: #d9a84e; font-weight: 700; text-transform: uppercase; font-size: .7rem; }
.prc-history-global { color: #20d6b0; font-weight: 850; text-align: right; }
.prc-history-phases { color: #b8c7d0; font-size: .75rem; }

.prc-snapshot-form { margin-top: 24px; text-align: center; }
.prc-snapshot-btn {
  padding: 12px 28px; border: 1.5px solid #20d6b0; border-radius: 10px;
  background: rgba(32,214,176,.1); color: #20d6b0; font-weight: 800;
  font-size: .9rem; cursor: pointer; letter-spacing: .04em; text-transform: uppercase;
}
.prc-snapshot-btn:hover { background: rgba(32,214,176,.2); }

.prc-readiness {
  margin-top: 32px; padding: 30px 34px;
  border: 1.5px solid rgba(217,168,78,.6); border-radius: 18px;
  background: linear-gradient(180deg,rgba(217,168,78,.06),rgba(0,0,0,.1)),rgba(3,17,29,.83);
}
.prc-readiness-title { margin: 0 0 18px; color: #d9a84e; font-size: clamp(20px,1.8vw,28px); font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.prc-readiness-grid { display: grid; grid-template-columns: 220px 1fr; column-gap: 36px; align-items: center; }
.prc-readiness-gauge { display: flex; justify-content: center; }
.prc-readiness-ring {
  position: relative; width: 200px; height: 200px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(#d9a84e calc(var(--value) * 1%), rgba(255,255,255,.08) 0);
}
.prc-readiness-ring::before { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: #08111c; }
.prc-readiness-ring-inner { position: relative; text-align: center; }
.prc-readiness-value { color: #d9a84e; font-size: 52px; font-weight: 850; line-height: 1; }
.prc-readiness-value span { font-size: .5em; }
.prc-readiness-ring-label { color: #b8c7d0; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }
.prc-readiness-formula { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.prc-formula-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto 64px 92px; gap: 10px;
  padding: 9px 14px; border-radius: 8px; background: rgba(255,255,255,.04);
  font-size: .85rem; align-items: center;
}
.prc-formula-label { color: #f4f7f8; font-weight: 600; overflow-wrap: anywhere; }
.prc-formula-ratio { color: #b8c7d0; font-weight: 700; font-family: "SFMono-Regular", Consolas, monospace; text-align: right; }
.prc-formula-weight { color: #8aa0ad; font-weight: 700; text-align: center; font-family: "SFMono-Regular", Consolas, monospace; }
.prc-formula-result { color: #20d6b0; font-weight: 850; text-align: right; font-family: "SFMono-Regular", Consolas, monospace; }
.prc-formula-row--total {
  margin-top: 4px; background: rgba(217,168,78,.1); border: 1px solid rgba(217,168,78,.35);
  grid-template-columns: minmax(0,1fr) auto;
}
.prc-formula-row--total .prc-formula-label { color: #d9a84e; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; font-size: .82rem; }
.prc-formula-row--total .prc-formula-ratio { color: #d9a84e; font-size: 1rem; }

.prc-metrics { margin-top: 32px; }
.prc-metrics-title { margin: 0 0 6px; color: #20d6b0; font-size: 1.3rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.prc-metrics-desc { color: #b8c7d0; font-size: .88rem; margin: 0 0 20px; }
.prc-metrics-grid { display: flex; flex-direction: column; gap: 10px; }
.prc-metric-card {
  border: 1px solid rgba(32,214,176,.3); border-radius: 12px;
  background: rgba(3,17,29,.7); overflow: hidden;
}
.prc-metric-summary {
  display: grid; grid-template-columns: 180px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 18px; cursor: pointer; list-style: none;
}
.prc-metric-summary::-webkit-details-marker { display: none; }
.prc-metric-summary::before { content: "▸"; color: #20d6b0; font-size: 1.1rem; margin-right: -8px; }
.prc-metric-card[open] > .prc-metric-summary::before { content: "▾"; }
.prc-metric-name { color: #f4f7f8; font-weight: 800; font-size: .95rem; }
.prc-metric-source { color: #b8c7d0; font-size: .75rem; font-family: "SFMono-Regular", Consolas, monospace; }
.prc-metric-stats { display: flex; gap: 16px; align-items: center; }
.prc-metric-total, .prc-metric-done, .prc-metric-open { display: flex; flex-direction: column; align-items: center; font-weight: 800; font-size: 1.1rem; color: #f4f7f8; }
.prc-metric-total small, .prc-metric-done small, .prc-metric-open small { font-size: .6rem; font-weight: 600; color: #b8c7d0; text-transform: uppercase; letter-spacing: .06em; }
.prc-metric-done { color: #20d6b0; }
.prc-metric-open { color: #f7a61c; }
.prc-metric-pct { color: #20d6b0; font-weight: 850; font-size: 1.2rem; padding: 4px 10px; border: 1px solid rgba(32,214,176,.5); border-radius: 8px; background: rgba(32,214,176,.08); }

.prc-user-table { padding: 0 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.prc-user-head {
  display: grid; grid-template-columns: 1fr 60px 60px 60px; gap: 8px;
  padding: 6px 10px; font-size: .7rem; font-weight: 700; color: #b8c7d0;
  text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid rgba(255,255,255,.1);
}
.prc-user-head span:nth-child(n+2) { text-align: right; }
.prc-user-row {
  display: grid; grid-template-columns: 1fr 60px 60px 60px; gap: 8px;
  padding: 6px 10px; border-radius: 6px; font-size: .82rem;
}
.prc-user-row:nth-child(even) { background: rgba(255,255,255,.03); }
.prc-user-row span:first-child { color: #f4f7f8; font-weight: 600; }
.prc-user-row span:nth-child(n+2) { text-align: right; color: #b8c7d0; }
.prc-user-row span:last-child { color: #20d6b0; font-weight: 700; }

.prc-table { padding: 6px 18px 16px; overflow-x: auto; }
.prc-table-head, .prc-table-row {
  display: grid; gap: 10px; padding: 7px 10px;
}
.prc-table-head {
  font-size: .68rem; font-weight: 700; color: #b8c7d0;
  text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid rgba(255,255,255,.1);
}
.prc-table-row { font-size: .8rem; border-radius: 6px; }
.prc-table-row:nth-child(even) { background: rgba(255,255,255,.03); }
.prc-table-row span:first-child { font-weight: 600; }
.prc-table-row span:nth-child(n+2) { text-align: right; }
.prc-table-row span:last-child { color: #20d6b0; font-weight: 700; }
.prc-table-row--total { margin-top: 6px; border-top: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); }
.prc-table-row--total span { color: #d9a84e !important; }
.prc-col-file { color: #f4f7f8; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }

.prc-table-specs .prc-table-head, .prc-table-specs .prc-table-row { grid-template-columns: minmax(220px,1fr) 120px 120px 80px; }
.prc-table-status .prc-table-head, .prc-table-status .prc-table-row { grid-template-columns: minmax(160px,1fr) 90px 120px; }

/* Attribute muted color to second numeric column so last “%” stays green */
.prc-table-specs .prc-table-row span:nth-child(2), .prc-table-status .prc-table-row span:nth-child(2) { color: #b8c7d0; }

.prc-hero { margin-bottom: 28px; display: flex; flex-wrap: wrap; gap: 16px; }
.pc-hero-grid { display: contents; }
.prc-hero-card {
  flex: 1 1 360px; min-width: 0;
  padding: 28px 34px; border: 1.5px solid rgba(247,166,28,.6); border-radius: 18px;
  background: linear-gradient(180deg,rgba(247,166,28,.08),rgba(0,0,0,.1)),rgba(3,17,29,.85);
  display: grid; grid-template-columns: 1fr auto; gap: 12px 28px; align-items: center;
}
.prc-hero-card--alt { border-color: rgba(32,214,176,.6); background: linear-gradient(180deg,rgba(32,214,176,.08),rgba(0,0,0,.1)),rgba(3,17,29,.85); }
.prc-hero-card--alt .prc-hero-label { color: #20d6b0; }
.prc-hero-card--alt .prc-hero-count { color: #20d6b0; }
.prc-hero-label { grid-column: 1 / -1; color: #f7a61c; font-size: clamp(18px,1.6vw,26px); font-weight: 850; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.prc-hero-count { color: #f7a61c; font-size: clamp(48px,5vw,72px); font-weight: 850; line-height: 1; }
.prc-hero-base { color: #b8c7d0; font-size: .45em; font-weight: 600; }
.prc-hero-bar { grid-column: 2; width: 260px; height: 18px; border-radius: 9px; background: rgba(255,255,255,.08); overflow: hidden; border: 1px solid rgba(255,255,255,.15); }
.prc-hero-fill { height: 100%; width: var(--fill); background: linear-gradient(90deg,#087b72,#20d6b0); border-radius: 9px; transition: width .6s ease; }
.prc-hero-meta { grid-column: 1 / -1; display: flex; gap: 24px; color: #b8c7d0; font-size: .84rem; }

.prc-ai-readiness {
  margin-top: 28px; padding: 28px 34px;
  border: 1.5px solid rgba(79,178,255,.5); border-radius: 18px;
  background: linear-gradient(180deg,rgba(79,178,255,.06),rgba(0,0,0,.1)),rgba(3,17,29,.83);
}
.prc-ai-readiness.prc-ai-empty { text-align: center; }
.prc-ai-readiness-title { margin: 0 0 8px; color: #4fb2ff; font-size: clamp(20px,1.8vw,28px); font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.prc-ai-readiness-meta { color: #b8c7d0; font-size: .78rem; margin-bottom: 18px; }
.prc-ai-desc { color: #b8c7d0; font-size: .9rem; margin: 8px 0 20px; }
.prc-ai-readiness-grid { display: grid; grid-template-columns: 160px 1fr; gap: 28px; align-items: start; }
.prc-ai-gauge { text-align: center; }
.prc-ai-score { color: #4fb2ff; font-size: 56px; font-weight: 850; line-height: 1; }
.prc-ai-score span { font-size: .5em; }
.prc-ai-label { color: #b8c7d0; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }
.prc-ai-details { display: flex; flex-direction: column; gap: 14px; }
.prc-ai-justification { color: #f4f7f8; font-size: .92rem; line-height: 1.55; }
.prc-ai-block h3 { margin: 0 0 6px; color: #f7a61c; font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.prc-ai-block ul { margin: 0; padding-left: 20px; color: #b8c7d0; font-size: .84rem; line-height: 1.6; }
.prc-ai-block li { margin-bottom: 3px; }
.prc-ai-refresh-form { margin-top: 18px; text-align: center; }
.prc-ai-refresh-btn {
  padding: 10px 24px; border: 1.5px solid #4fb2ff; border-radius: 10px;
  background: rgba(79,178,255,.1); color: #4fb2ff; font-weight: 800;
  font-size: .85rem; cursor: pointer; letter-spacing: .04em; text-transform: uppercase;
}
.prc-ai-refresh-btn:hover { background: rgba(79,178,255,.2); }

@media (max-width: 1200px) {
  .prc-top { grid-template-columns: 1fr; gap: 14px; }
  .prc-brand { text-align: left; }
  .prc-date-box { justify-self: start; }
  .prc-panel { grid-template-columns: 1fr; row-gap: 22px; }
  .prc-gauge-col { flex-direction: row; justify-content: flex-start; padding-top: 0; }
  .prc-ring { width: 150px; height: 150px; }
  .prc-ring::before { width: 116px; height: 116px; }
  .prc-ring-value { font-size: 40px; }
  .prc-ring-label { font-size: 13px; }
  .prc-readiness-grid { grid-template-columns: 1fr; row-gap: 18px; }
  .prc-readiness-gauge { justify-content: flex-start; }
  .prc-readiness-ring { width: 150px; height: 150px; }
  .prc-readiness-ring::before { inset: 12px; }
  .prc-readiness-value { font-size: 40px; }
  .prc-formula-row { grid-template-columns: minmax(0,1fr) auto 56px 80px; gap: 8px; font-size: .8rem; padding: 8px 10px; }
  .prc-formula-row--total { grid-template-columns: minmax(0,1fr) auto; }
  .prc-ai-readiness-grid { grid-template-columns: 1fr; }
  .prc-ai-gauge { text-align: left; }
  .prc-hero-card { grid-template-columns: 1fr; }
  .prc-hero-bar { grid-column: 1; width: 100%; }
}
@media (max-width: 800px) {
  .prc-page { width: 98vw; padding: 18px 0; }
  .prc-cgmp { font-size: 34px; }
  .prc-logo-mark { width: 52px; height: 52px; }
  .prc-brand { font-size: 38px; letter-spacing: .11em; }
  .prc-panel { padding: 20px 14px; }
  .prc-phase-labels { display: none; }
  .prc-bar { height: auto; display: flex; flex-direction: column; }
  .prc-segment { min-height: 82px; border-left: 0; border-top: 1px solid rgba(255,255,255,.26); }
  .prc-segment:first-child { border-top: 0; }
  .prc-ruler { display: none; }
  .prc-detail-row { grid-template-columns: 1fr; }
  .prc-history-row { grid-template-columns: 1fr 1fr; }
  .prc-table-specs .prc-table-head, .prc-table-specs .prc-table-row { grid-template-columns: minmax(180px,1fr) 80px 80px 70px; }
  .prc-table-status .prc-table-head, .prc-table-status .prc-table-row { grid-template-columns: minmax(140px,1fr) 70px 90px; }
}

/* --- Nightly SPEC review tab --- */
.segment-nav { display:flex; gap:.4rem; flex-wrap:wrap; margin:.4rem 0 1rem; }
.segment-nav .segment { padding:.35rem .8rem; border:1px solid var(--border,#d9d9d9); border-radius:999px; font-size:.85rem; color:inherit; text-decoration:none; }
.segment-nav .segment.active { background:var(--accent,#1f6feb); color:#fff; border-color:transparent; }
.spec-review-layout { display:grid; grid-template-columns:320px 1fr; gap:1.5rem; }
.spec-review-sidebar { display:flex; flex-direction:column; gap:1rem; position:sticky; top:1rem; align-self:start; }
.spec-review-main { min-width:0; }
.spec-review-hero { display:flex; justify-content:space-between; gap:1.5rem; align-items:flex-end; flex-wrap:wrap; margin-bottom:1.5rem; }
.hero-actions { display:flex; gap:.6rem; flex-wrap:wrap; }
.spec-review-counters { display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; margin-bottom:1.5rem; }
.spec-review-counters div { background:var(--surface,#f7f7f7); border:1px solid var(--border,#e3e3e3); border-radius:12px; padding:1rem; text-align:center; }
.spec-review-counters strong { display:block; font-size:1.6rem; }
.spec-review-list { display:flex; flex-direction:column; gap:.5rem; }
.spec-review-row { display:grid; grid-template-columns:180px 1fr 160px; gap:.8rem; align-items:center; padding:.8rem 1rem; border:1px solid var(--border,#e3e3e3); border-radius:10px; text-decoration:none; color:inherit; }
.spec-review-row:hover { border-color:var(--accent,#1f6feb); }
.spec-review-row.severity-blocking { border-left:4px solid #d33; }
.spec-review-row.severity-warning { border-left:4px solid #e0a800; }
.spec-review-row.severity-info { border-left:4px solid #1f6feb; }
.spec-review-row .kind { font-size:.8rem; color:var(--muted,#666); }
.spec-review-row .title small { display:block; color:var(--muted,#666); font-size:.8rem; }
.spec-review-row .meta { text-align:right; }
.spec-review-row .status { font-size:.75rem; }
.run-row { border:1px solid var(--border,#e3e3e3); border-radius:8px; padding:.7rem; margin-bottom:.6rem; }
.run-row.run-ok { border-left:3px solid #2a7; }
.run-row.run-partial { border-left:3px solid #e0a800; }
.run-row.run-failed { border-left:3px solid #d33; }
.run-row header { display:flex; gap:.5rem; align-items:center; font-size:.8rem; }
.run-status { padding:.1rem .5rem; border-radius:999px; font-size:.7rem; text-transform:uppercase; }
.run-status.ok { background:#e6f7ee; color:#2a7; }
.run-status.partial { background:#fff7e0; color:#a80; }
.run-status.failed { background:#fde9e9; color:#d33; }
.run-counters { display:flex; gap:.8rem; font-size:.75rem; color:var(--muted,#666); margin:.3rem 0; }
.run-error { color:#d33; font-size:.8rem; }
.run-logs pre { white-space:pre-wrap; word-break:break-word; background:#f7f7f7; padding:.5rem; border-radius:6px; font-size:.72rem; max-height:240px; overflow:auto; }
.spec-review-item-head .card-chips { display:flex; gap:.5rem; margin-top:.5rem; }
.spec-review-actions { display:flex; gap:1rem; flex-wrap:wrap; margin:1.5rem 0; }
.spec-review-actions form { flex:1 1 240px; }
.spec-review-body .review-section pre { white-space:pre-wrap; word-break:break-word; background:#f7f7f7; padding:.7rem; border-radius:6px; font-size:.8rem; max-height:420px; overflow:auto; }
@media (max-width: 900px) { .spec-review-layout { grid-template-columns:1fr; } .spec-review-row { grid-template-columns:1fr; } }

/* --- SPEC_REVIEW guided chat (reuses .messages/.bubble from session view) --- */
.spec-review-chat { display:flex; flex-direction:column; gap:.6rem; margin:.5rem 0; }
.spec-review-chat .message { display:flex; gap:.6rem; }
.spec-review-chat .message.assistant .bubble { background:var(--surface-alt,#f0f3f7); }
.spec-review-body .composer { display:flex; gap:.5rem; align-items:flex-end; margin-top:.6rem; }
.spec-review-body .composer textarea { flex:1; resize:vertical; }
.spec-review-body .composer .send { border-radius:50%; width:2.4rem; height:2.4rem; }

/* Canonical lexicon and governed human proposals */
.qa-lexicon-link { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:0 0 1.2rem; padding:.8rem 1rem; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.lexicon-source { display:flex; justify-content:space-between; align-items:center; gap:1.5rem; padding:1.4rem; margin-bottom:1rem; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
.lexicon-source h2,.lexicon-source p { margin:.15rem 0; }
.lexicon-source > div:last-child { display:grid; text-align:right; }
.lexicon-source > div:last-child strong { font-size:2rem; color:var(--accent); }
.lexicon-search { display:grid; grid-template-columns:minmax(220px,1fr) auto; gap:.45rem 1rem; align-items:end; margin:1rem 0; }
.lexicon-search label { grid-column:1 / -1; font-weight:700; }
.lexicon-search input { min-width:0; }
.lexicon-search span { color:var(--muted); white-space:nowrap; }
.lexicon-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(310px,1fr)); gap:1rem; margin-bottom:2rem; }
.lexicon-entry { display:flex; flex-direction:column; gap:.65rem; padding:1.1rem; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.lexicon-entry[hidden] { display:none; }
.lexicon-entry header,.lexicon-proposal header { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; }
.lexicon-entry h3,.lexicon-proposal h3 { margin:.15rem 0; }
.lexicon-entry code { max-width:50%; overflow-wrap:anywhere; }
.lexicon-entry p { margin:0; line-height:1.5; }
.lexicon-entry details p { margin-top:.5rem; color:var(--muted); }
.lexicon-entry footer { display:flex; flex-wrap:wrap; gap:.35rem; margin-top:auto; }
.lexicon-entry footer span { padding:.2rem .45rem; border-radius:999px; background:var(--surface-alt,#f0f3f7); font-size:.7rem; }
.lexicon-example { color:var(--muted); }
.lexicon-contribution { margin:2rem 0; }
.lexicon-proposals { display:grid; gap:.75rem; }
.lexicon-proposal { padding:1rem; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.lexicon-review-form { display:grid; grid-template-columns:1fr 1fr auto; gap:.7rem; align-items:end; margin-top:1rem; }
@media (max-width: 800px) {
  .qa-lexicon-link,.lexicon-source { align-items:flex-start; flex-direction:column; }
  .lexicon-source > div:last-child { text-align:left; }
  .lexicon-search,.lexicon-review-form { grid-template-columns:1fr; }
}

/* --- AlchimiX first visual draft --- */
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(circle at 85% -10%, rgba(201,149,74,.09), transparent 31rem),
    var(--paper);
}
.topbar {
  background: rgba(10,11,12,.94);
  color: var(--color-text);
  border-bottom-color: var(--color-border);
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.brand { letter-spacing: .02em; }
.brand-logo { display: block; object-fit: contain; object-position: center; }
.brand-logo-compact { width: 34px; height: 34px; }
.brand-logo-lockup { width: min(100%, 360px); height: auto; }
.brand-mark { background: var(--color-bg); border: 1px solid var(--color-gold); }
.main-nav a, .topnav-dropdown summary, .link-button { color: var(--color-muted); }
.main-nav a:hover, .topnav-dropdown summary:hover { color: var(--color-gold-bright); background: rgba(201,149,74,.12); }
.main-nav a.active, .main-nav a[aria-current="page"] { color: var(--color-gold-bright); }
.topbar-user .role, .role, .pill { color: #24170e; background: var(--color-gold-bright); }
.ai-topbar-status { color: #25180c; background: var(--color-gold); }
.ai-topbar-status.ai-unavailable { color: #fff0ea; background: #7b3329; }
.ai-topbar-status.ai-fallback { color: #291a0b; background: var(--color-ember-bright); }
.link-button:hover { color: var(--color-gold-bright); }
.page { position: relative; }
.hero h1, .section-title h2, .assignment-card h3, .review-section h3, .side-card h3 { color: var(--color-text-dark); }
.hero h1 em { color: var(--color-ember); }
.eyebrow { color: #986322; }
.assignment-card, .review-section, .side-card, .editor-card, .guide-card, .creation-panel, .question-box {
  border-color: var(--color-border-light);
  border-radius: var(--brand-radius-md);
  box-shadow: 0 12px 35px rgba(48,31,17,.07);
}
.assignment-card:hover { box-shadow: 0 22px 55px rgba(65,38,15,.14); }
.assignment-card .progress span, .progress span { background: linear-gradient(90deg, var(--color-gold), var(--color-ember)); }
.card-link, .primary, .batch-send { background: linear-gradient(135deg, #4b2a14, #24150d); border-color: #4b2a14; }
.card-link:hover, .primary:hover, .batch-send:hover { background: linear-gradient(135deg, #6d3d17, #30180c); border-color: var(--color-ember); }
.primary:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}
input, textarea, select { border-color: var(--color-border-light); border-radius: var(--brand-radius-sm); }
input:focus, textarea:focus, select:focus { border-color: var(--color-gold); box-shadow: 0 0 0 3px rgba(201,149,74,.18); }
.import-panel, .authority-banner, .usage-cost-note { background: linear-gradient(135deg, #21140d, #0c0d0f); border: 1px solid var(--color-border); }
.import-panel .primary { background: var(--color-gold-bright); color: #21140d; }
.import-panel .primary:hover { background: var(--color-ember-bright); color: #21140d; }
.empty { border-color: var(--color-border); background: rgba(255,250,242,.62); }

.login-body { background: var(--color-bg); color: var(--color-text); }
.login-body .topbar { display: none; }
.login-shell { background: var(--color-bg); }
.login-intro {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(5,6,7,.9) 0%, rgba(5,6,7,.62) 47%, rgba(5,6,7,.18) 100%),
    url('/assets/brand/alchimix-hero.png') center / cover no-repeat,
    url('/assets/brand/alchimix-hero.svg') center / cover no-repeat;
  border-right: 1px solid var(--color-border);
}
.login-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(240,123,39,.12), transparent 42%);
  pointer-events: none;
}
.login-intro::after { border-color: rgba(239,189,105,.2); box-shadow: 0 0 0 100px rgba(239,189,105,.035), 0 0 0 200px rgba(239,189,105,.02); }
.login-intro h1, .login-intro > p { position: relative; z-index: 1; }
.login-intro h1 em { color: var(--color-gold-bright); }
.login-intro > p { color: #e2d5c4; }
.guardrail { z-index: 1; }
.guardrail span { color: #f2e4d1; border-color: rgba(239,189,105,.38); background: rgba(10,11,12,.28); }
.login-card {
  color: var(--color-text-dark);
  background: linear-gradient(145deg, #fffaf2, #e9dfd0);
  border: 1px solid rgba(239,189,105,.45);
  border-radius: var(--brand-radius-md);
  box-shadow: var(--brand-shadow);
}
.login-card h2 { color: #26170d; }
.login-card .muted, .login-card .tiny { color: var(--color-muted-dark); }
.login-card .brand-lockup { display: flex; align-items: center; min-height: 74px; margin-bottom: 18px; }
.login-card .brand-logo-lockup { max-width: 300px; }
.password-entry-cta { color: #3b2413; background: #ead9bd; border-color: #c9a568; }
.password-entry-cta:hover { background: #f0c47e; }
.alert.error { color: #702d24; background: #f7dfd8; border-color: #e2b9ae; }
.alert.success { color: #23452b; background: #e0eadb; border-color: #b5cdaa; }

.avatar-brand { padding: 5px; background: #20130c; border: 1px solid var(--color-gold); }
.avatar-brand img { width: 100%; height: 100%; object-fit: contain; }
.conversation, .conversation-head { background: #fffaf2; }
.conversation-head { border-bottom-color: var(--color-border-light); }
.message.assistant .bubble { border-color: #dfc9a8; }
.message.user .bubble { background: linear-gradient(135deg, #4b2a14, #24150d); }
.send { background: var(--color-ember); }
.send:hover { background: var(--color-ember-bright); }
.quick-actions button:hover { background: #f0dfc4; border-color: #c9a568; }

.prc-topbar { background: rgba(10,11,12,.96); }
.prc-brand { display: flex; align-items: center; max-width: 180px; height: 36px; overflow: hidden; }
.prc-brand img { width: 100%; height: auto; }
.prc-cgmp { color: var(--color-gold-bright); }
.prc-logo-mark { background: var(--color-ember); box-shadow: 0 0 18px rgba(240,123,39,.55); }
.prc-snapshot-btn, .prc-ai-refresh-btn { background: linear-gradient(135deg, #4b2a14, #24150d); border-color: var(--color-gold); }

@media (max-width: 900px) {
  .login-intro { min-height: 62vh; padding: 56px 28px; }
  .login-card { margin: -40px 20px 32px; width: calc(100% - 40px); position: relative; z-index: 2; }
  .login-shell { display: block; }
  .brand-logo-lockup { max-width: 280px; }
}
@media (max-width: 560px) {
  .topbar { height: 60px; padding: 0 16px; }
  .brand-logo-compact { width: 30px; height: 30px; }
  .login-intro h1 { font-size: clamp(2.7rem, 13vw, 4.2rem); }
  .login-card { padding: 28px 22px; }
  .login-card .brand-logo-lockup { max-width: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
