@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('/fonts/Inter-Bold.ttf') format('truetype');
}
:root {
  --canvas: #F8F7F3; --paper: #FFFFFF; --paper-subtle: #F3F5FA;
  --ink: #13265B; --ink-2: #42527A; --ink-3: #5A6884;
  --blue: #1748C8; --sky: #EEF5FF; --coral: #FF5A43; --coral-soft: #FFF1EE;
  --rule: #DCE1EC; --focus-ring: #1748C8; --focus-width: 2px;
  --f-display: Georgia, 'Times New Roman', serif;
  --f-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text-base: 16px; --line-base: 1.65;
  --shadow-card: 0 10px 28px -18px rgba(19, 38, 91, 0.25);
}
html[data-theme="soft"] {
  --canvas: #F6F1E6; --paper: #FCF9F2; --paper-subtle: #EFE8D8;
  --ink: #182544; --ink-2: #3F4B68; --ink-3: #596580;
  --blue: #1748C8; --sky: #EAE2D0; --coral: #D94B38; --coral-soft: #F9E8E3;
  --rule: #DDD4C1; --focus-ring: #1748C8;
}
html[data-theme="high"] {
  --canvas: #FFFFFF; --paper: #FFFFFF; --paper-subtle: #F1F5F9;
  --ink: #020617; --ink-2: #0F172A; --ink-3: #334155;
  --blue: #1D4ED8; --sky: #F1F5F9; --coral: #B91C1C; --coral-soft: #FEF2F2;
  --rule: #0F172A; --focus-ring: #1D4ED8; --focus-width: 3px; --shadow-card: none;
}
html[data-text="large"] { --text-base: 18px; }
html[data-text="larger"] { --text-base: 20px; }
html[data-spacing="spacious"] { --line-base: 1.95; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: var(--text-base); }
html[data-motion="reduce"] { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  transition-duration: 0.001ms !important; animation-duration: 0.001ms !important;
}
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--f-body); line-height: var(--line-base); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: 2px; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--blue); color: #FFFFFF; padding: 0.65rem 1rem; border-radius: 0.5rem; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 0.75rem; }

/* Reading comfort utility bar */
.comfort-bar { position: sticky; top: 0; z-index: 40; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 0.65rem 1.25rem; }
.comfort-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem; }
.comfort-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); white-space: nowrap; }
.comfort-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem 1rem; }
.ctrl-group { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.ctrl-group-title { font-size: 0.78rem; font-weight: 600; color: var(--ink-3); margin-right: 0.15rem; }
.segmented { display: inline-flex; border: 1px solid var(--rule); border-radius: 0.55rem; background: var(--paper-subtle); padding: 2px; gap: 2px; }
.comfort-btn { appearance: none; border: 1px solid transparent; background: transparent; color: var(--ink-2); font-family: var(--f-body); font-size: 0.8rem; font-weight: 500; padding: 0.32rem 0.6rem; border-radius: 0.42rem; cursor: pointer; min-height: 32px; white-space: nowrap; }
.comfort-btn:hover { color: var(--ink); background: var(--paper); }
.comfort-btn[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; font-weight: 600; }
.comfort-btn.single-toggle { border: 1px solid var(--rule); background: var(--paper); }
.comfort-btn.single-toggle[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.print-btn { appearance: none; border: 1px solid var(--blue); background: var(--blue); color: #FFFFFF; font-family: var(--f-body); font-size: 0.82rem; font-weight: 600; padding: 0.4rem 0.85rem; border-radius: 0.5rem; cursor: pointer; min-height: 34px; white-space: nowrap; }
.print-btn:hover { filter: brightness(1.08); }

/* Editorial hero */
.hero { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.25rem 2rem; border-bottom: 1px solid var(--rule); }
.brand-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.brand-mark { display: inline-flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.brand-logo { display: block; height: 34px; width: auto; }
.hub-back { font-size: 0.84rem; font-weight: 600; color: var(--blue); text-decoration: none; border-bottom: 1px solid transparent; }
.hub-back:hover { border-bottom-color: var(--blue); }
.eyebrow { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.eyebrow-bar { width: 1.75rem; height: 2px; background: var(--coral); display: inline-block; }
h1 { font-family: var(--f-display); font-weight: 600; font-size: clamp(2rem, 3.6vw, 2.85rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0.65rem 0 0.85rem; max-width: 24ch; color: var(--ink); }
.hero-lede { font-size: 1.08rem; color: var(--ink-2); max-width: 62ch; margin: 0 0 1.75rem; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.role-card { display: flex; flex-direction: column; justify-content: space-between; gap: 0.45rem; background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--blue); border-radius: 0.75rem; padding: 1.05rem 1.15rem; text-decoration: none; color: inherit; box-shadow: var(--shadow-card); transition: transform 0.15s ease, border-color 0.15s ease; }
.role-card.role-lecturer { border-top-color: var(--coral); }
.role-card.role-admin { border-top-color: var(--ink); }
.role-card:hover { transform: translateY(-2px); border-color: var(--blue); }
.role-kicker { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue); }
.role-lecturer .role-kicker { color: var(--coral); }
.role-admin .role-kicker { color: var(--ink-3); }
.role-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 600; color: var(--ink); margin: 0; }
.role-desc { font-size: 0.88rem; color: var(--ink-2); margin: 0; }
.role-link-hint { font-size: 0.82rem; font-weight: 600; color: var(--blue); margin-top: 0.35rem; }
.quick-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem 1.25rem; margin-top: 1.15rem; font-size: 0.88rem; color: var(--ink-3); }
.quick-strip a { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Main two-column layout */
.shell { max-width: 1180px; margin: 0 auto; padding: 2rem 1.25rem 4rem; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.toc-sidebar { position: sticky; top: 4.5rem; max-height: calc(100vh - 5.5rem); overflow-y: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: 0.75rem; padding: 1rem 1.05rem; }
.toc-title { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.75rem; }
.toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.toc-list a { display: block; font-size: 0.86rem; line-height: 1.4; color: var(--ink-2); text-decoration: none; padding: 0.35rem 0.6rem; border-left: 2px solid transparent; border-radius: 0 0.35rem 0.35rem 0; }
.toc-list a:hover { color: var(--ink); background: var(--paper-subtle); }
.toc-list a.is-active { color: var(--blue); background: var(--sky); border-left-color: var(--blue); font-weight: 600; }
.toc-sub { padding-left: 1.15rem !important; font-size: 0.81rem !important; color: var(--ink-3) !important; }
.mobile-toc { display: none; background: var(--paper); border: 1px solid var(--rule); border-radius: 0.75rem; padding: 0.85rem 1rem; margin-bottom: 1.5rem; }
.mobile-toc summary { font-weight: 600; font-size: 0.95rem; cursor: pointer; color: var(--ink); }
.mobile-toc .toc-list { margin-top: 0.75rem; }

/* Main reading column */
.guide-main { min-width: 0; max-width: 68ch; width: 100%; }
section.guide-section { padding-bottom: 2.25rem; margin-bottom: 2.25rem; border-bottom: 1px solid var(--rule); scroll-margin-top: 4.75rem; }
section.guide-section:last-of-type { border-bottom: 0; margin-bottom: 0; }
h2 { font-family: var(--f-display); font-weight: 600; font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.85rem; color: var(--ink); scroll-margin-top: 4.75rem; }
h3 { font-family: var(--f-display); font-weight: 600; font-size: 1.28rem; line-height: 1.3; margin: 1.75rem 0 0.6rem; color: var(--ink); scroll-margin-top: 4.75rem; }
h4 { font-family: var(--f-body); font-weight: 700; font-size: 0.96rem; margin: 1.25rem 0 0.45rem; color: var(--ink); }
p { margin: 0 0 0.95rem; color: var(--ink-2); }
ul, ol { margin: 0 0 1.1rem; padding-left: 1.35rem; color: var(--ink-2); }
li { margin-bottom: 0.45rem; }
li strong, p strong { color: var(--ink); }
kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82em; background: var(--paper); border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 0.3rem; padding: 0.1rem 0.35rem; color: var(--ink); }

/* Semantic UI chips and live module deep-links */
.ui-btn { display: inline-flex; align-items: center; gap: 0.25em; font-family: var(--f-body); font-size: 0.85em; font-weight: 600; line-height: 1.3; padding: 0.12em 0.52em; border-radius: 0.4rem; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-bottom-width: 2px; vertical-align: baseline; max-width: 100%; }
.ui-btn.primary { background: var(--sky); color: var(--blue); border-color: var(--blue); }
.ui-label { display: inline-block; font-family: var(--f-body); font-size: 0.86em; font-weight: 600; line-height: 1.35; padding: 0.06em 0.42em; border-radius: 0.32rem; background: var(--paper-subtle); color: var(--ink); border: 1px solid var(--rule); max-width: 100%; }
.ui-path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.28em; vertical-align: baseline; max-width: 100%; }
.ui-sep { color: var(--coral); font-weight: 700; font-size: 0.92em; user-select: none; }
a.ui-link { display: inline-flex; align-items: center; gap: 0.22em; font-family: var(--f-body); font-size: 0.86em; font-weight: 600; line-height: 1.35; padding: 0.08em 0.48em; border-radius: 0.4rem; background: var(--sky); color: var(--blue); border: 1px solid var(--blue); text-decoration: none; vertical-align: baseline; max-width: 100%; transition: background-color 0.12s ease, color 0.12s ease; }
a.ui-link::after { content: " \2197"; font-size: 0.82em; }
a.ui-link.internal::after { content: " \2192"; font-size: 0.85em; }
a.ui-link:hover { background: var(--blue); color: #FFFFFF; }
html[data-theme="high"] .ui-btn, html[data-theme="high"] .ui-label { border-color: var(--ink); }
html[data-theme="high"] a.ui-link { border-width: 2px; }
.chip-legend { background: var(--paper); border: 1px solid var(--rule); border-radius: 0.75rem; padding: 0.9rem 1.05rem; margin-top: 1.15rem; break-inside: avoid; }
.chip-legend-title { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.65rem; }
.chip-legend-grid { display: flex; flex-wrap: wrap; gap: 0.65rem 1.25rem; align-items: center; font-size: 0.85rem; color: var(--ink-2); }
.chip-legend-item { display: inline-flex; align-items: center; gap: 0.45rem; }

/* Cards, flow, callouts, ladder */
.two-col-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0 1.5rem; }
.info-card { background: var(--paper); border: 1px solid var(--rule); border-radius: 0.75rem; padding: 1.1rem 1.2rem; break-inside: avoid; }
.info-card.tint { background: var(--sky); }
.card-tag { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.55rem; border-radius: 99px; background: var(--ink); color: #FFFFFF; margin-bottom: 0.55rem; }
.card-tag.blue { background: var(--blue); }
.info-card h3 { margin: 0 0 0.45rem; font-size: 1.12rem; }
.info-card p:last-child, .info-card ul:last-child { margin-bottom: 0; }
.flow-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin: 1.25rem 0 1.5rem; break-inside: avoid; }
.flow-step { background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--coral); border-radius: 0.65rem; padding: 0.85rem 0.9rem; }
.flow-num { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral); display: block; margin-bottom: 0.25rem; }
.flow-step strong { display: block; font-size: 0.92rem; color: var(--ink); margin-bottom: 0.25rem; }
.flow-step span { display: block; font-size: 0.82rem; line-height: 1.45; color: var(--ink-2); }
.callout { background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--blue); border-radius: 0 0.65rem 0.65rem 0; padding: 0.95rem 1.15rem; margin: 1.25rem 0; break-inside: avoid; }
.callout.boundary { border-left-color: var(--coral); background: var(--coral-soft); }
.callout-title { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); margin: 0 0 0.4rem; }
.callout.boundary .callout-title { color: var(--coral); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

/* Tables, glossary, hub */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; border: 1px solid var(--rule); border-radius: 0.75rem; background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; text-align: left; }
th, td { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { background: var(--paper-subtle); color: var(--ink); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { break-inside: avoid; }
.glossary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; margin: 1rem 0 0; }
.glossary-item { background: var(--paper); border: 1px solid var(--rule); border-radius: 0.65rem; padding: 0.85rem 1rem; break-inside: avoid; }
.glossary-item dt { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); margin-bottom: 0.25rem; }
.glossary-item dd { margin: 0; font-size: 0.88rem; color: var(--ink-2); }
.hub-shell { max-width: 1180px; margin: 0 auto; padding: 2.25rem 1.25rem 4rem; }
.hub-section { margin-bottom: 2.5rem; }
.hub-section-title { font-family: var(--f-display); font-size: 1.45rem; font-weight: 600; color: var(--ink); margin: 0 0 1rem; }
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; }
.hub-card { display: flex; flex-direction: column; justify-content: space-between; gap: 0.85rem; background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--blue); border-radius: 0.85rem; padding: 1.25rem 1.35rem; text-decoration: none; color: inherit; box-shadow: var(--shadow-card); transition: transform 0.15s ease, border-color 0.15s ease; }
.hub-card:hover { transform: translateY(-2px); border-color: var(--blue); }
.hub-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.76rem; color: var(--ink-3); font-weight: 600; }
.hub-card-badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 99px; background: var(--sky); color: var(--blue); font-size: 0.74rem; font-weight: 700; }
.hub-card h3 { margin: 0; font-size: 1.25rem; }
.hub-card p { margin: 0; font-size: 0.92rem; }
.hub-card-foot { display: flex; align-items: center; justify-content: space-between; font-size: 0.84rem; font-weight: 600; color: var(--blue); padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.guide-footer { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--ink-3); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; }
.guide-footer a { color: var(--blue); font-weight: 600; text-decoration: none; }
.guide-footer a:hover { text-decoration: underline; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .toc-sidebar { display: none; }
  .mobile-toc { display: block; }
  .role-grid, .hub-grid { grid-template-columns: 1fr; }
  .flow-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .two-col-cards, .glossary-grid, .flow-strip { grid-template-columns: 1fr; }
  .comfort-bar { position: static; }
}
@media print {
  @page { margin: 16mm 14mm; }
  body { background: #FFFFFF !important; color: #020617 !important; font-size: 10.5pt; }
  .comfort-bar, .toc-sidebar, .mobile-toc, .skip-link, .print-btn, .hub-back { display: none !important; }
  .hero { padding: 0 0 12pt; }
  .shell { display: block; padding: 12pt 0 0; }
  .guide-main { max-width: 100%; }
  .role-card, .info-card, .flow-step, .callout, .glossary-item, .table-wrap, .chip-legend, .hub-card { box-shadow: none !important; background: #FFFFFF !important; }
  a { color: #020617; text-decoration: none; }
  a.ui-link::after { content: ""; }
  .ui-btn, .ui-label, a.ui-link { border-color: #020617 !important; color: #020617 !important; background: #FFFFFF !important; }
}
