:root{
  --bg:#F4F7FA; --surface:#fff; --surface-2:#EAF1F7; --line:#D9E3EC;
  --ink:#12273A; --text:#364B5F; --muted:#5F7487; --primary:#2A5C80;
  --primary-hover:#1F4A68; --primary-soft:#E3EEF6; --accent:#E0A04A;
  --ok:#2E8B6E; --danger:#C4503F; --screen:#0F2233; --warn:#795016; --warn-bg:#fff4df;
  --shadow:0 1px 2px rgba(18,39,58,.05),0 12px 28px -14px rgba(18,39,58,.14);
  --shadow-1:var(--shadow); --green:var(--primary); --green-dark:var(--primary-hover);
  --teal:var(--primary); --mint:var(--primary-soft); --pale:var(--surface-2); --paper:var(--bg);
  --soft:var(--surface-2); --red:var(--danger); --amber:var(--warn);
  --r-sm:6px; --r-md:16px; --r-lg:24px; --book-width:min(calc(100% - 48px),1120px);
}
body.handbook{margin:0;background:var(--bg);color:var(--text);font-family:"PingFang SC","Noto Sans SC",system-ui,sans-serif;line-height:1.7}
.handbook :is(h1,h2,h3){font-family:inherit;color:var(--ink);font-weight:700;line-height:1.27;letter-spacing:-.015em;text-wrap:balance}
.handbook .eyebrow{font-family:inherit;letter-spacing:.045em;font-size:13px;color:var(--muted)}
.handbook .book-header,.handbook .book-footer,.handbook:not(.book-options)>main{width:var(--book-width);max-width:none;margin-inline:auto;padding-inline:0;box-sizing:border-box}
.handbook .book-header{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:20px;padding-block:16px;border-bottom:1px solid var(--line);background:var(--bg);height:auto}
.book-header .book-brand{display:inline-flex;align-items:center;gap:9px;color:var(--ink);font-size:22px;font-weight:700;text-decoration:none;line-height:1.15;white-space:nowrap}
.book-mark{display:grid;place-items:center;width:39px;height:39px;border-radius:10px;background:var(--primary);color:white;font:700 29px/1 system-ui}
.book-brand small{display:block;font:650 9px/1.5 system-ui;letter-spacing:.13em}
.book-header nav{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:clamp(8px,1.3vw,22px);font-size:14px}
.book-header nav a,.book-footer nav a{color:var(--muted);text-decoration:none;padding:5px 0}
.book-header nav a[aria-current]{color:var(--primary);border-bottom:2px solid var(--primary);font-weight:700}
.book-actions{display:flex;align-items:center;gap:10px}.backup-status,.book-config{font-size:13px;line-height:1.4;white-space:nowrap;text-decoration:none}
.backup-status{color:var(--primary);border-radius:10px;padding:5px 8px}.backup-status.overdue{color:var(--warn);background:var(--warn-bg)}
.book-actions .book-config{display:inline-flex;align-items:center;min-height:40px;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:white;color:var(--ink);font-weight:600}
.handbook .book-footer{display:flex;align-items:center;gap:14px;flex-wrap:wrap;justify-content:flex-start;padding-block:20px;border-top:1px solid var(--line);color:var(--muted);font-size:13px}.book-footer strong{color:var(--ink)}.book-footer nav{flex:auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:14px;font-size:13px}.book-footer small{display:block;font:13px system-ui}
.handbook .book-header :focus-visible,.handbook :focus-visible{outline:2px solid var(--primary);outline-offset:3px}
.handbook :is(button,input:not([type=checkbox],[type=radio]),select,textarea,.button){border-radius:var(--r-sm)}
.handbook :is(button,.button):active:not(:disabled){transform:scale(.98)}.handbook button:disabled{opacity:.55;cursor:not-allowed}
.handbook .button.primary,.handbook button.primary{background:var(--primary);color:white}.handbook .button.secondary{background:#fff;color:var(--primary);border-color:var(--line)}
body.profile-open>header.book-header,body.profile-open>footer.book-footer{display:flex}body.profile-open>header.book-header{display:grid}
body.profile-open #profile-frame{height:calc(100dvh - var(--header-height,80px));background:var(--bg)}
.handbook:not(.embedded-editor).book-options>.sidebar{top:80px}.book-options:not(.embedded-editor) .sidebar>.brand{display:none}
@media(max-width:1050px){.handbook .book-header{grid-template-columns:1fr auto;gap:5px 12px}.book-header nav{grid-column:1/-1;grid-row:2;justify-content:flex-start;gap:20px}.book-actions{grid-column:2;grid-row:1}}
@media(max-width:660px){:root{--book-width:calc(100% - 32px)}.handbook .book-header{padding:8px 0}.book-actions{gap:4px}.book-actions .backup-status{white-space:normal;max-width:120px}.book-header nav{overflow-x:auto;flex-wrap:nowrap;gap:14px}.book-header nav a{min-height:44px;align-content:center;white-space:nowrap}.book-actions a,.book-actions button{min-height:44px;align-content:center}.book-header .book-brand{font-size:18px}.book-mark{width:30px;height:32px;font-size:24px}.book-footer nav{justify-content:flex-start}.handbook .book-footer a{padding-block:10px}}
@media(prefers-reduced-motion:reduce){.handbook *,.handbook *::after,.handbook *::before{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media print{.handbook .book-header,.handbook .book-footer{display:none!important}}
.handbook .lab-scene h1{color:white}.handbook .lab-scene .criteria-link{color:#e6f3e9;font-size:13px;text-underline-offset:3px}.book-transfer .book-header nav,.book-transfer .book-footer nav{margin-bottom:0}
.handbook :is(.step p,.step-link,.activity-heading p:last-child,.resume-card p,.stats small,.notes p,.notes a,.chip,.tag,.hero-links,.source-note,.profile-next span,.profile-overview p,.profile-overview a,.sidebar-progress strong,.sidebar-progress a,.method-note,.step-link,.hero-description,.count,.facet-note){font-size:max(13px,.82rem)}
.handbook :is(.notice,.message,.profile-overview){border-radius:10px}
.book-analysis #workflow{border-radius:16px}.book-options .hero,.book-opportunities .hero,.book-analysis .lab-scene{border-radius:24px}
.handbook .book-footer nav{width:auto;margin:0}.book-transfer .book-footer{margin-top:32px}
@media(max-width:660px){.handbook :is(button:not(.close-button),select,.button){min-height:44px}}
/* Shared dimensions; the room owns its pigment and material. */
:root{--header-h:64px;--container:1120px;--space:4px;--fs-h1:clamp(36px,5vw,56px);--fs-h2:32px;--fs-h3:20px;--fs-body:16px;--fs-sm:13px;--btn-h:44px}
body[data-theme] .book-header{min-height:var(--header-h);padding-block:8px}
.book-header .book-mark{color:var(--primary);background:transparent;border:0;border-radius:0;padding:0}
.book-mark svg{display:block;width:100%;height:100%}
.book-footer strong{display:inline-flex;align-items:center;gap:6px}.footer-mark{display:inline-flex;color:inherit;width:24px}
.book-actions .book-config{background:var(--surface);border-color:var(--line);color:var(--text);min-height:var(--btn-h);border-radius:var(--r-sm)}
.book-actions .backup-status{border-radius:var(--r-sm)}
body[data-theme] .book-header a:not(.book-brand):hover,.book-footer a:hover{text-decoration:underline;text-underline-offset:4px}
@media(prefers-reduced-motion:no-preference){@view-transition{navigation:auto}body[data-theme]{transition:background-color .4s,color .4s}}

:root{--ease:cubic-bezier(.2,.7,.2,1);--fast:150ms;--normal:250ms;--slow:500ms}
.handbook,.handbook :is(.num,strong,small,#completion-ring){font-variant-numeric:lining-nums tabular-nums}
body.handbook .book-header{padding-top:max(8px,env(safe-area-inset-top));overflow:visible}
.book-actions .backup-status:not(.overdue){color:var(--muted);background:transparent}
body.handbook .book-config:before{content:"";width:7px;height:7px;flex:none;border-radius:50%;background:#ac761f;margin-right:7px}
body.handbook .book-config[data-connected=true]:before{background:var(--ok)}
@media(prefers-reduced-motion:no-preference){.handbook,.handbook :is(button,a,input,select){transition-timing-function:var(--ease);transition-duration:var(--fast)}body.handbook{transition-duration:var(--normal)}}

.handbook .book-header .book-brand,.handbook .footer-mark{color:var(--primary)}
.handbook .book-header nav a:not([aria-current="page"]){border-bottom:0;text-decoration:none}
.handbook .book-header nav a[aria-current="page"]{border-bottom:2px solid var(--primary);color:var(--primary)}
.handbook .book-header nav a:not([aria-current="page"]):after{content:none}
.handbook .button.primary:hover,.handbook button.primary:hover:not(:disabled){background:var(--primary-hover)}
.handbook :is(#completion-ring,.snapshot-number,.snapshot-bottom b,.stats strong){font-variant-numeric:lining-nums tabular-nums;font-feature-settings:"lnum","tnum"}

.book-actions .account-link{font-size:14px;white-space:nowrap;color:var(--primary)}
