:root {
  --bg: #f4f6f3;
  --panel: #fff;
  --text: #17211d;
  --muted: #66716c;
  --line: #d7ded9;
  --accent: #1e684f;
  --danger: #8a2f2f;
  --max: 1120px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card, .dialog-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.auth-card { width: min(440px, 100%); padding: 32px; }
h1, h2 { margin: 0 0 12px; line-height: 1.1; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
form label { display: grid; gap: 6px; margin: 16px 0; font-weight: 600; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; color: var(--text); }
textarea { resize: vertical; }
button { border: 0; border-radius: 8px; padding: 10px 14px; background: var(--text); color: #fff; font-weight: 650; }
button.quiet { background: transparent; color: var(--text); border: 1px solid var(--line); }
.message { color: var(--muted); font-size: 14px; }
.message.error { color: var(--danger); }
.app-header { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding: 14px 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; text-decoration: none; white-space: nowrap; }
nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
nav a { text-decoration: none; font-size: 14px; }
nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.header-actions { display: flex; gap: 8px; }
.page-shell { max-width: var(--max); margin: 0 auto; padding: 48px 24px 120px; }
.panel { padding: 28px; }
.route-placeholder { max-width: 760px; }
.route-placeholder h1 { font-size: clamp(32px, 5vw, 56px); }
.route-meta { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.notice-floater { position: fixed; right: 24px; bottom: 24px; background: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.12); }
dialog { border: 0; padding: 0; background: transparent; width: min(720px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(10,18,15,.38); }
.dialog-card { padding: 26px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.dialog-actions { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 16px; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 18px 0 0; }
.search-results { display: grid; gap: 10px; margin-top: 20px; max-height: 52vh; overflow: auto; }
.search-result { border: 1px solid var(--line); border-radius: 9px; padding: 14px; background: #fff; }
.search-type { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.search-result h3 { margin: 5px 0 4px; font-size: 16px; }
.search-result p { margin: 0; color: var(--muted); font-size: 14px; }
.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; }
@media (max-width: 900px) {
  .app-header { grid-template-columns: 1fr auto; }
  .app-header nav { grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .header-actions { justify-content: flex-end; }
}
@media (max-width: 560px) {
  .app-header { padding: 12px 16px; gap: 10px; }
  .page-shell { padding: 32px 16px 110px; }
  .header-actions #sign-out { display: none; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
  .search-form { grid-template-columns: 1fr; }
}

/* Slice 1 v1.2 auth-flow additions */
.auth-secondary-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.auth-secondary-actions .quiet { flex: 1 1 auto; }
button.link-button { background: transparent; color: var(--accent); padding: 8px 0; }
#reset-panel form { margin-top: 18px; }

/* Slice 1 v1.3 workspace surfacing */
.workspace-page, .workspace-detail { display: grid; gap: 22px; }
.workspace-head h1, .workspace-detail h1 { font-size: clamp(32px, 5vw, 54px); }
.workspace-list { display: grid; gap: 10px; }
.workspace-item { width: 100%; display: grid; gap: 8px; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: var(--panel); color: var(--text); }
.workspace-item:hover, .workspace-item:focus-visible, .search-result-link:hover, .search-result-link:focus-visible { border-color: var(--accent); outline: none; }
.workspace-item strong { font-size: 17px; line-height: 1.35; }
.workspace-item span:not(.workspace-meta) { color: var(--muted); font-weight: 400; line-height: 1.5; }
.workspace-meta { color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.workspace-body { white-space: pre-wrap; font-size: 18px; line-height: 1.6; margin-top: 24px; }
.back-link { width: fit-content; color: var(--accent); text-decoration: none; font-weight: 700; }
.search-result-link { width: 100%; text-align: left; color: var(--text); cursor: pointer; }
.search-result-link h3, .search-result-link p { font-weight: initial; }

/* Slice 2 — Home + Learning Guide */
.home-page, .guide-page { display: grid; gap: 34px; }
.home-intro, .guide-hero { max-width: 920px; }
.home-intro h1, .guide-hero h1 { font-size: clamp(38px, 6vw, 68px); max-width: 18ch; }
.lede { font-size: clamp(18px, 2.2vw, 23px); line-height: 1.5; color: var(--muted); max-width: 780px; }
.phase-line { display: flex; gap: 12px; align-items: baseline; margin-top: 22px; font-size: 14px; color: var(--muted); }
.phase-line strong { color: var(--text); }
.route-choice-grid, .picture-grid, .guide-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.route-choice { display: grid; gap: 12px; padding: 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none; }
.route-choice:hover, .route-choice:focus-visible { border-color: var(--accent); outline: none; }
.route-choice h2 { font-size: 28px; margin: 0; }
.route-choice p { color: var(--muted); line-height: 1.55; margin: 0; }
.route-choice > strong { margin-top: 8px; color: var(--accent); }
.route-number { color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 800; }
.home-section { display: grid; gap: 16px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-heading h2 { font-size: 30px; }
.section-heading p { margin-bottom: 0; }
.section-heading > a { color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }
.attention-list { display: grid; gap: 10px; }
.attention-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.attention-item h3 { margin: 6px 0 8px; font-size: 19px; line-height: 1.35; }
.attention-reason { color: var(--accent); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.attention-meta { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.state-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.state-chip { border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--muted); font-size: 11px; }
.state-chip.is-active { color: var(--text); border-color: var(--text); font-weight: 700; }
.picture-panel { padding: 24px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; }
.picture-panel h3 { margin-top: 0; }
.summary-dl { display: grid; gap: 0; margin: 20px 0 0; }
.summary-dl div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.summary-dl dt { color: var(--muted); }
.summary-dl dd { margin: 0; font-weight: 800; }
.compact-list .workspace-item { padding: 14px 16px; }
.home-guide-link { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.button-link { display: inline-block; width: fit-content; background: var(--text); color: #fff; text-decoration: none; border-radius: 8px; padding: 11px 15px; font-weight: 700; }
.guide-section { display: grid; gap: 18px; }
.guide-section > h2, .guide-close h2 { font-size: clamp(27px, 4vw, 42px); max-width: 22ch; }
.guide-section p { line-height: 1.65; }
.guide-two-col > div { min-width: 0; }
.guide-two-col h3 { margin-top: 0; }
.guide-two-col a { color: var(--accent); font-weight: 700; text-decoration: none; }
.guide-note { padding-left: 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.phase-guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.phase-guide-grid article { border-top: 3px solid var(--text); padding: 16px 4px 0; }
.phase-guide-grid article > span { font-size: 36px; font-weight: 850; }
.phase-guide-grid article h3 { margin: 8px 0; }
.phase-guide-grid article p { color: var(--muted); line-height: 1.55; }
.guide-close { display: grid; gap: 16px; padding: 26px 0 10px; }
.guide-close p { max-width: 780px; color: var(--muted); line-height: 1.65; }
@media (max-width: 760px) {
  .route-choice-grid, .picture-grid, .guide-two-col, .phase-guide-grid { grid-template-columns: 1fr; }
  .section-heading, .home-guide-link { align-items: flex-start; flex-direction: column; }
  .home-intro h1, .guide-hero h1 { font-size: 42px; }
}
