:root {
  color-scheme: light;
  --paper: #f6f3ed;
  --surface: #fffdf8;
  --surface-muted: #eff2ef;
  --ink: #17202a;
  --muted: #5e6873;
  --line: #c8d0d0;
  --blue: #185adb;
  --blue-ink: #0f3f9e;
  --teal: #18794e;
  --teal-soft: #e4f1e9;
  --warn: #9a6700;
  --warn-soft: #fff0d2;
  --danger: #b42318;
  --danger-soft: #fbe7e5;
  --radius: 10px;
  --shadow: 0 6px 16px rgb(23 32 42 / 12%);
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, .nav-item:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 10; top: 8px; left: 8px; transform: translateY(-160%); padding: 8px 12px; background: var(--ink); color: white; transition: transform .15s ease; }
.skip-link:focus { transform: translateY(0); }
.app-shell { display: grid; width: 100%; max-width: 100%; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; min-height: 100vh; padding: 24px 16px 18px; border-right: 2px solid var(--ink); background: #e9eee9; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-family: "IBM Plex Serif", Georgia, serif; font-size: 22px; font-weight: 600; letter-spacing: -.035em; }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: "IBM Plex Sans", sans-serif; font-size: 14px; }
.section-label, .eyebrow, .context-kicker { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sidebar > .section-label { margin: 38px 8px 8px; }
.nav-list { display: grid; gap: 3px; }
.nav-item, .admin-nav { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 39px; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: #35424a; text-align: left; font-size: 14px; }
.nav-item span { display: inline-grid; width: 18px; place-items: center; color: var(--blue); font-weight: 800; }
.nav-item:hover, .admin-nav:hover { background: #dce5df; }
.nav-item.is-active, .admin-nav.is-active { background: var(--ink); color: var(--paper); font-weight: 700; }
.nav-item.is-active span { color: #c9dcff; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.sidebar-bottom .section-label { margin: 0 0 8px; }
.local-state { display: flex; align-items: flex-start; gap: 8px; padding: 9px 8px; }
.state-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px #cce1d2; }
.local-state strong, .local-state small { display: block; }
.local-state strong { font-size: 13px; }
.local-state small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.plain-button, .text-button, .danger-link { padding: 5px 8px; border: 0; background: transparent; font-weight: 700; font-size: 12px; text-align: left; }
.plain-button, .text-button { color: var(--blue-ink); }
.plain-button:hover, .text-button:hover { text-decoration: underline; }
.main-content, .sidebar, .screen, .page-heading, .diary-layout, .account-layout, .admin-layout, .overview-grid, .source-layout { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--surface); }
.context { display: flex; gap: 10px; align-items: baseline; }
.context-copy { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.role-button, .secondary-button, .table-button { border: 1px solid var(--ink); border-radius: 6px; background: var(--surface); color: var(--ink); font-weight: 700; }
.role-button { padding: 8px 10px; font-size: 12px; }
.role-button:hover, .secondary-button:hover, .table-button:hover { background: #e5e9e5; }
.profile-button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; background: #d6e8f0; color: var(--ink); font-weight: 700; }
.screen { display: none; max-width: 1220px; margin: 0 auto; padding: 38px 32px 54px; }
.app-shell[data-section="dashboard"] .screen-dashboard, .app-shell[data-section="diary"] .screen-diary, .app-shell[data-section="learning"] .screen-learning, .app-shell[data-section="account"] .screen-account, .app-shell[data-mode="admin"] .screen-admin { display: block; }
.app-shell[data-mode="admin"] .screen:not(.screen-admin) { display: none; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
h1, h2 { font-family: "IBM Plex Serif", Georgia, serif; }
h1 { max-width: 760px; margin: 5px 0 0; font-size: clamp(32px, 4vw, 52px); letter-spacing: -.045em; line-height: 1.02; }
h2 { margin: 5px 0 0; font-size: 21px; letter-spacing: -.025em; }
.lead { max-width: 760px; margin: 16px 0 0; color: #46525e; font-size: 16px; line-height: 1.55; }
.primary-button { padding: 11px 14px; border: 2px solid var(--blue); border-radius: 6px; background: var(--blue); color: #fff; font-weight: 700; white-space: nowrap; }
.primary-button:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
.secondary-button { padding: 9px 11px; font-size: 13px; white-space: nowrap; }
.notice { display: flex; align-items: flex-start; gap: 10px; max-width: 880px; margin-top: 25px; padding: 12px 14px; border: 2px solid #dba84a; background: var(--warn-soft); }
.notice > span { display: grid; flex: 0 0 auto; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: var(--warn); color: #fff; font-weight: 800; }
.notice p { margin: 0; color: #684800; font-size: 13px; line-height: 1.45; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 18px; margin-top: 28px; }
.feature-panel, .side-panel, .table-panel, .admin-workspace { border: 2px solid var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.feature-panel { min-height: 278px; padding: 20px; }
.panel-heading, .workspace-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.chip { display: inline-flex; align-items: center; width: fit-content; padding: 4px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.chip-neutral { background: #e5e9e5; color: #35424a; }.chip-blue { background: #dbe8ff; color: var(--blue-ink); }.chip-warning { background: var(--warn-soft); color: #704a00; }.chip-danger { background: var(--danger-soft); color: var(--danger); }
.plan-summary { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 24px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plan-time { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.05em; }.plan-summary strong, .plan-summary span { display: block; }.plan-summary strong { font-size: 14px; }.plan-summary span { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }.quiet-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.evidence-panel { background: #eef3fb; }.learning-list { display: grid; gap: 12px; margin: 19px 0; padding: 0; list-style: none; }.learning-list li { display: flex; gap: 10px; }.learning-list li > span { color: var(--blue); font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 700; }.learning-list strong, .learning-list small { display: block; }.learning-list strong { font-size: 13px; }.learning-list small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.diary-layout, .account-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(250px, .6fr); gap: 18px; margin-top: 28px; }.table-panel { overflow: hidden; }.table-panel > h2 { padding: 20px 20px 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }th { padding: 13px 18px; color: var(--muted); font-size: 11px; letter-spacing: .05em; text-align: left; text-transform: uppercase; }td { padding: 15px 18px; border-top: 1px solid var(--line); vertical-align: middle; }td strong, td small { display: block; }td strong { font-size: 13px; }td small { margin-top: 3px; color: var(--muted); font-size: 11px; }.table-button { padding: 7px 9px; font-size: 12px; }
.side-panel { padding: 20px; align-self: start; background: #edf5ef; }.side-panel > p:not(.eyebrow) { margin: 14px 0 16px; color: #435449; font-size: 14px; line-height: 1.5; }
.source-layout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }.source-card { display: flex; flex-direction: column; min-height: 300px; padding: 20px; border-top: 8px solid var(--ink); background: var(--surface); box-shadow: var(--shadow); }.source-card.historical { border-color: #5b3b25; }.source-card.evidence { border-color: var(--blue); }.source-card.regulation { border-color: var(--teal); }.source-card > p:not(.eyebrow) { margin: 14px 0 0; color: #43505b; font-size: 14px; line-height: 1.5; }.source-card footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.definition-list { margin: 18px 0 0; }.definition-list div { display: grid; grid-template-columns: minmax(140px, .45fr) minmax(0, 1fr); gap: 12px; padding: 13px 20px; border-top: 1px solid var(--line); }.definition-list dt { color: var(--muted); font-size: 12px; }.definition-list dd { margin: 0; font-size: 13px; line-height: 1.4; }
.danger-link { color: var(--danger); }.danger-link:hover { text-decoration: underline; }
.admin-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; margin-top: 28px; }.admin-rail { display: grid; align-content: start; gap: 4px; }.admin-nav { border-radius: 0; border-bottom: 1px solid var(--line); }.admin-workspace { padding: 20px; }.workspace-heading p { max-width: 470px; margin: 7px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.45; }.audit-strip { display: flex; gap: 10px; margin-top: 18px; padding: 12px; border-left: 4px solid var(--teal); background: var(--teal-soft); }.audit-strip > span { color: var(--teal); font-weight: 800; }.audit-strip > div { min-width: 0; }.audit-strip p { margin: 0; color: #365444; font-size: 12px; line-height: 1.45; }.audit-strip .text-button { display: block; margin: 7px -8px 0; }.audit-log { display: grid; gap: 5px; margin: 8px 0 0; padding-left: 17px; color: #365444; font-size: 12px; line-height: 1.4; }.audit-log li { padding-left: 2px; }.audit-log time { color: var(--muted); }
.dialog { width: min(510px, calc(100% - 28px)); border: 2px solid var(--ink); border-radius: 0; background: var(--surface); box-shadow: 0 18px 50px rgb(0 0 0 / 25%); }.dialog::backdrop { background: rgb(23 32 42 / 56%); }.dialog-content { position: relative; padding: 26px; }.dialog h2 { margin-bottom: 12px; }.dialog-content > p:not(.eyebrow) { color: #45525e; font-size: 14px; line-height: 1.5; }.dialog-close { position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border: 0; background: transparent; color: var(--ink); font-size: 25px; }.check-line { display: flex; align-items: flex-start; gap: 9px; margin: 21px 0; font-size: 13px; line-height: 1.45; }.check-line input { width: 18px; height: 18px; accent-color: var(--blue); }.dialog-content label:not(.check-line) { display: block; margin: 18px 0 7px; font-size: 13px; font-weight: 700; }.dialog textarea { width: 100%; padding: 10px; border: 2px solid var(--ink); border-radius: 0; resize: vertical; }.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }.review-list { display: grid; gap: 9px; margin: 18px 0; padding-left: 19px; color: #3f4c55; font-size: 13px; line-height: 1.4; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 11; max-width: min(400px, calc(100% - 40px)); padding: 12px 14px; transform: translateY(150%); border: 2px solid var(--ink); background: var(--ink); color: #fff; font-size: 13px; line-height: 1.35; box-shadow: var(--shadow); transition: transform .2s ease; }.toast.is-visible { transform: translateY(0); }.sr-only { position: absolute; top: auto; left: -9999px; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) { .app-shell { grid-template-columns: minmax(0, 1fr); }.sidebar { min-height: auto; padding: 14px 16px; border-right: 0; border-bottom: 2px solid var(--ink); }.sidebar .section-label, .sidebar-bottom { display: none; }.brand { display: inline-flex; }.nav-list { display: flex; gap: 5px; max-width: 100%; margin-top: 13px; overflow-x: auto; }.nav-item { flex: 0 0 auto; width: auto; white-space: nowrap; }.topbar { padding: 0 20px; }.overview-grid, .source-layout { grid-template-columns: 1fr; }.feature-panel, .source-card { min-height: auto; }.source-card { min-height: 220px; }.admin-layout { grid-template-columns: 1fr; }.admin-rail { display: flex; overflow-x: auto; }.admin-nav { width: auto; white-space: nowrap; }.screen { padding: 30px 20px 42px; } }
@media (max-width: 620px) { .topbar { min-height: 58px; padding: 0 16px; }.context-copy, .role-button { display: none; }.screen { padding: 26px 16px 36px; }.page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }.primary-button { width: 100%; }.lead { font-size: 15px; }.plan-summary { grid-template-columns: 48px minmax(0, 1fr); }.plan-summary .secondary-button { grid-column: 1 / -1; width: 100%; }.diary-layout, .account-layout { grid-template-columns: 1fr; }.table-panel { overflow-x: auto; }.table-panel table { min-width: 570px; }.definition-list div { grid-template-columns: 1fr; gap: 4px; }.source-card footer { flex-direction: column; }.admin-workspace { padding: 14px; overflow: hidden; }.admin-workspace table { table-layout: fixed; }.admin-workspace th, .admin-workspace td { padding: 10px 5px; overflow-wrap: anywhere; }.admin-workspace th:nth-child(3), .admin-workspace td:nth-child(3) { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
