  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  :root {
    --font: 'Manrope', sans-serif;
    --mono: 'DM Mono', monospace;

    --bg:        #FAFAF9;
    --surface:   #FFFFFF;
    --surface2:  #F5F4F2;
    --border:    #E8E6E1;
    --border2:   #D4D0C8;

    --text-1:    #1A1916;
    --text-2:    #4A4840;
    --text-3:    #7A7870;
    --text-4:    #A8A59E;

    --red-bg:    #FEF2F1;
    --red-mid:   #FCDAD8;
    --red-text:  #921B18;
    --red-dark:  #6B120F;
    --red-border:#F5C4C2;

    --green-bg:  #F0F8EC;
    --green-mid: #D3EDCA;
    --green-text:#2C6B1F;
    --green-dark:#1D4A14;
    --green-bdr: #BBDDB1;

    --blue-bg:   #EFF5FD;
    --blue-mid:  #CFE0F8;
    --blue-text: #1A4F8A;
    --blue-dark: #103566;
    --blue-bdr:  #AECEF4;

    --amber-bg:  #FEF8EC;
    --amber-mid: #FDEAC4;
    --amber-text:#7A4E0C;
    --amber-dark:#4E3108;
    --amber-bdr: #F5D28A;

    --purple-bg: #F3F1FE;
    --purple-txt:#3D2FA0;

    --teal-bg:   #EDFAF5;
    --teal-txt:  #0F6448;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  }

  body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-1);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
  }

  .site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .site-logo {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-1);
    text-decoration: none;
    letter-spacing: -.02em;
  }
  .site-logo span { color: var(--blue-text); }
  .site-nav { display: flex; gap: 1.5rem; font-size: 13px; }
  .site-nav a { color: var(--text-3); text-decoration: none; }
  .site-nav a:hover { color: var(--text-1); }
  .site-nav a.active { color: var(--blue-text); font-weight: 500; }
  .nav-toggle {
    display: none;
    border: 1px solid var(--border2);
    background: var(--surface2);
    color: var(--text-2);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
  }

  .container {
    max-width: 780px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem;
  }

  #study-panel {
    display: grid;
    gap: 1rem;
    margin-top: .25rem;
  }
  #study-panel > * {
    margin-bottom: 0 !important;
  }

  .study-slot {
    display: grid;
    gap: 1rem;
  }

  .study-slot + .study-slot,
  .study-slot + .topic-collapsible,
  .topic-collapsible + .study-slot,
  .topic-collapsible + .topic-collapsible,
  .study-slot + .practice-card,
  .practice-card + .study-slot,
  .topic-collapsible + .practice-card {
    position: relative;
  }
  .study-slot + .study-slot::before,
  .study-slot + .topic-collapsible::before,
  .topic-collapsible + .study-slot::before,
  .topic-collapsible + .topic-collapsible::before,
  .study-slot + .practice-card::before,
  .practice-card + .study-slot::before,
  .topic-collapsible + .practice-card::before {
    content: '';
    display: block;
    height: 1px;
    margin: 0 0 .15rem;
    background: linear-gradient(90deg, rgba(212, 208, 200, 0), rgba(212, 208, 200, .8) 16%, rgba(212, 208, 200, .8) 84%, rgba(212, 208, 200, 0));
  }

  .breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-4);
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
  }
  .breadcrumb a { color: var(--text-3); text-decoration: none; }
  .breadcrumb a:hover { color: var(--text-1); text-decoration: underline; }
  .breadcrumb-sep { color: var(--text-4); }

  .badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 20px;
    line-height: 1.5;
  }
  .badge-tier1   { background: var(--red-bg);    color: var(--red-text);    border: 1px solid var(--red-border); }
  .badge-canine  { background: var(--blue-bg);   color: var(--blue-text);   border: 1px solid var(--blue-bdr); }
  .badge-endo    { background: var(--amber-bg);  color: var(--amber-text);  border: 1px solid var(--amber-bdr); }
  .badge-emerg   { background: var(--red-bg);    color: var(--red-text);    border: 1px solid var(--red-border); }
  .badge-q-type  { background: var(--surface2);  color: var(--text-3);      border: 1px solid var(--border); }
  .badge-qnum    { background: var(--blue-bg);   color: var(--blue-text);   border: 1px solid var(--blue-bdr); }

  .hero-card,
  .card,
  .revision-card,
  .practice-card,
  .mode-card,
  .quick-bar {
    transition: opacity .18s ease, transform .18s ease;
  }

  .hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.35rem 1.5rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow-sm);
  }
  .hero-badges { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .75rem; }
  .hero-title { font-size: 24px; font-weight: 700; letter-spacing: -.025em; margin-bottom: .2rem; }
  .hero-subtitle { font-size: 13px; color: var(--text-3); margin-bottom: .35rem; }
  .hero-readtime {
    font-size: 12px;
    color: var(--text-4);
    margin-bottom: 1rem;
  }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem;
    margin-bottom: 1rem;
  }
  .stat-box {
    background: var(--surface2);
    border-radius: var(--radius-md);
    padding: .6rem .75rem;
    text-align: center;
  }
  .stat-val { font-size: 16px; font-weight: 700; }
  .stat-lbl { font-size: 10px; color: var(--text-4); margin-top: 2px; }
  .hero-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
  .btn {
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border2);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: background .12s, border-color .12s;
  }
  .btn:hover { background: var(--surface2); }
  .btn.btn-reviewed { background: var(--green-bg); border-color: var(--green-bdr); color: var(--green-text); }
  .btn.btn-weak     { background: var(--amber-bg); border-color: var(--amber-bdr); color: var(--amber-text); }

  .mode-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow-sm);
  }
  .mode-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-4);
    margin-bottom: .55rem;
  }
  .mode-row {
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
  }
  .mode-btn {
    display: flex;
    flex: 1 1 150px;
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
    border: 1px solid var(--border2);
    background: var(--surface2);
    color: var(--text-3);
    border-radius: 16px;
    padding: .7rem .95rem;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
  }
  .mode-btn.active {
    background: linear-gradient(180deg, #1A4F8A 0%, #103566 100%);
    border-color: #103566;
    color: #fff;
    box-shadow: 0 10px 22px rgba(26, 79, 138, .18);
    transform: translateY(-1px);
  }
  .mode-btn[aria-selected="true"] {
    background: linear-gradient(180deg, #1A4F8A 0%, #103566 100%);
    border-color: #103566;
    color: #fff;
    box-shadow: 0 10px 22px rgba(26, 79, 138, .18);
    transform: translateY(-1px);
  }
  .mode-btn:hover,
  .mode-btn:focus-visible {
    border-color: var(--blue-bdr);
    color: var(--text-1);
    outline: none;
  }
  .mode-btn.active:hover,
  .mode-btn.active:focus-visible,
  .mode-btn[aria-selected="true"]:hover,
  .mode-btn[aria-selected="true"]:focus-visible {
    color: #fff;
    border-color: #103566;
  }
  .mode-btn-label {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: -.01em;
  }
  .mode-btn-desc {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-4);
    transition: color .16s ease, opacity .16s ease;
  }
  .mode-btn.active .mode-btn-desc,
  .mode-btn[aria-selected="true"] .mode-btn-desc {
    color: rgba(255,255,255,.82);
  }
  #study-panel > [data-modes],
  #study-panel > .topic-collapsible {
    transition: opacity .16s ease, transform .16s ease;
  }

  .quick-bar {
    background: linear-gradient(180deg, #FFF7F6 0%, #FEF2F1 100%);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow-sm);
  }
  .quick-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--red-text);
    margin-bottom: .55rem;
  }
  .quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .45rem;
  }
  .quick-cell {
    background: rgba(255,255,255,.65);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-sm);
    padding: .5rem .6rem;
  }
  .quick-key {
    font-size: 10px;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 2px;
  }
  .quick-val {
    font-size: 12px;
    color: var(--red-dark);
    font-weight: 600;
    line-height: 1.35;
  }

  .exam-core {
    background: linear-gradient(180deg, #FFF7F6 0%, #FEF2F1 100%);
    border: 1px solid var(--red-border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow-sm);
  }
  .exam-core-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--red-text);
    margin-bottom: .55rem;
  }
  .exam-core-list {
    display: grid;
    gap: .35rem;
    font-size: 13px;
    color: var(--red-dark);
  }
  .exam-core-item strong {
    font-weight: 700;
  }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.35rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow-sm);
  }
  .card > * + *,
  .revision-card > * + *,
  .practice-card > * + *,
  .quick-bar > * + *,
  .exam-core > * + * {
    margin-top: .8rem;
  }
  .card-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-4);
    margin-bottom: .85rem;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .card h2,
  .card h3,
  .revision-card h2,
  .revision-card h3,
  .practice-card h2,
  .practice-card h3 {
    font-size: 17px;
    line-height: 1.3;
    letter-spacing: -.02em;
  }
  .card p,
  .revision-card p,
  .practice-card p,
  .topic-collapsible p {
    max-width: 66ch;
  }
  .card ul,
  .card ol,
  .revision-card ul,
  .revision-card ol,
  .practice-card ul,
  .practice-card ol,
  .topic-collapsible ul,
  .topic-collapsible ol {
    margin: .2rem 0 0 1.15rem;
    padding: 0;
  }
  .card li,
  .revision-card li,
  .practice-card li,
  .topic-collapsible li {
    padding-left: .2rem;
    line-height: 1.7;
  }
  .card li + li,
  .revision-card li + li,
  .practice-card li + li,
  .topic-collapsible li + li {
    margin-top: .45rem;
  }
  .card p + ul,
  .card p + ol,
  .revision-card p + ul,
  .revision-card p + ol,
  .practice-card p + ul,
  .practice-card p + ol,
  .topic-collapsible p + ul,
  .topic-collapsible p + ol {
    margin-top: .65rem;
  }
  .card ul + p,
  .card ol + p,
  .revision-card ul + p,
  .revision-card ol + p,
  .practice-card ul + p,
  .practice-card ol + p,
  .topic-collapsible ul + p,
  .topic-collapsible ol + p {
    margin-top: .75rem;
  }
  .card-label .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .dot-red    { background: #DC3545; }
  .dot-blue   { background: #2563EB; }
  .dot-green  { background: #22863A; }
  .dot-amber  { background: #D97706; }
  .dot-purple { background: #7C3AED; }
  .dot-teal   { background: #0D9488; }
  .dot-gray   { background: #9CA3AF; }

  .mini-mech {
    display: grid;
    gap: .45rem;
  }
  .mini-mech-row {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.55;
  }
  .mini-mech-row strong {
    color: var(--text-1);
    font-weight: 700;
  }
  .mini-mech-note {
    font-size: 12px;
    color: var(--text-4);
    border-left: 2px solid var(--border2);
    padding-left: .65rem;
    margin-top: .15rem;
    line-height: 1.5;
  }

  .pattern-block {
    margin-top: .65rem;
  }
  .pattern-subhead {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-4);
    margin-bottom: .4rem;
  }

  .pill-group { display: flex; flex-wrap: wrap; gap: .35rem; }
  .pill {
    font-size: 12px;
    padding: 3px 11px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-3);
    background: var(--surface);
  }
  .pill-alert { background: var(--red-bg); border-color: var(--red-border); color: var(--red-text); font-weight: 600; }
  .pattern-note {
    font-size: 12px;
    color: var(--red-text);
    border-left: 2px solid var(--red-border);
    padding: .4rem .65rem;
    margin-top: .75rem;
    background: var(--red-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    line-height: 1.5;
  }

  .decision-block {
    border-radius: var(--radius-md);
    padding: .85rem 1rem;
    margin-bottom: .65rem;
    font-size: 13px;
    line-height: 1.6;
  }
  .decision-block:last-child { margin-bottom: 0; }
  .db-red    { background: var(--red-bg);   border-left: 3px solid #DC3545; }
  .db-green  { background: var(--green-bg); border-left: 3px solid #22863A; }
  .db-blue   { background: var(--blue-bg);  border-left: 3px solid #2563EB; }
  .db-red   .db-title { color: var(--red-dark);   font-weight: 700; font-size: 13px; margin-bottom: .25rem; }
  .db-green .db-title { color: var(--green-dark); font-weight: 700; font-size: 13px; margin-bottom: .25rem; }
  .db-blue  .db-title { color: var(--blue-dark);  font-weight: 700; font-size: 13px; margin-bottom: .25rem; }
  .db-red   .db-body  { color: var(--red-dark); opacity: .9; }
  .db-green .db-body  { color: var(--green-dark); opacity: .9; }
  .db-blue  .db-body  { color: var(--blue-dark); opacity: .9; }

  .lab-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: .6rem;
    margin-top: .75rem;
  }
  .lab-cell {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: .7rem .8rem;
  }
  .lab-name  { font-size: 10px; color: var(--text-4); margin-bottom: 2px; }
  .lab-value { font-size: 14px; font-weight: 700; }
  .lab-note  { font-size: 11px; color: var(--text-4); margin-top: 2px; line-height: 1.3; }
  .val-red   { color: var(--red-text); }
  .val-green { color: var(--green-text); }
  .val-amber { color: var(--amber-text); }
  .lab-alert-note {
    font-size: 12px;
    color: var(--amber-text);
    background: var(--amber-bg);
    border: 1px solid var(--amber-bdr);
    border-radius: var(--radius-sm);
    padding: .45rem .75rem;
    margin-top: .5rem;
    line-height: 1.5;
  }

  .tx-row {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
  }
  .tx-row:last-child { border-bottom: none; padding-bottom: 0; }
  .tx-phase {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    margin-top: 2px;
    flex-shrink: 0;
  }
  .phase-acute   { background: var(--red-bg);   color: var(--red-text);   border: 1px solid var(--red-border); }
  .phase-chronic { background: var(--blue-bg);  color: var(--blue-text);  border: 1px solid var(--blue-bdr); }
  .phase-alt     { background: var(--surface2); color: var(--text-3);     border: 1px solid var(--border); }
  .tx-content { flex: 1; }
  .tx-drugs { color: var(--text-2); font-weight: 600; }
  .tx-note  { font-size: 11px; color: var(--text-4); margin-top: 2px; }

  .trap-item {
    display: flex;
    gap: .65rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
  }
  .trap-item:last-child { border-bottom: none; padding-bottom: 0; }
  .trap-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--red-text);
    flex-shrink: 0;
    margin-top: 1px;
  }
  .trap-content { flex: 1; }
  .trap-main { font-size: 13px; color: var(--text-2); line-height: 1.5; font-weight: 600; }
  .trap-why  { font-size: 12px; color: var(--text-4); margin-top: 2px; line-height: 1.4; }

  .diff-summary {
    font-size: 12px;
    color: var(--amber-dark);
    background: var(--amber-bg);
    border: 1px solid var(--amber-bdr);
    border-radius: var(--radius-sm);
    padding: .45rem .75rem;
    margin-bottom: .65rem;
    line-height: 1.5;
  }

  .diff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: .5rem;
  }
  .diff-table th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-4);
    text-align: left;
    padding: .35rem .6rem;
    border-bottom: 1px solid var(--border2);
    background: var(--surface2);
  }
  .diff-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
  .diff-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
  .diff-table td {
    padding: .45rem .6rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-3);
    vertical-align: top;
    line-height: 1.4;
  }
  .diff-table tr:last-child td { border-bottom: none; }
  .diff-table td:first-child { font-weight: 700; color: var(--text-1); }
  .diff-table tr.row-highlight td { background: var(--red-bg); }
  .diff-table tr.row-highlight td:first-child { color: var(--red-text); }
  .cell-red   { color: var(--red-text) !important; font-weight: 700 !important; }
  .cell-green { color: var(--green-text) !important; font-weight: 700 !important; }

  .case-card {
    background: var(--surface2);
    border-radius: var(--radius-md);
    padding: .95rem 1rem;
    margin-bottom: .7rem;
    border: 1px solid var(--border);
  }
  .case-card:last-child { margin-bottom: 0; }
  .case-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-4);
    margin-bottom: .35rem;
  }
  .case-q {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.55;
    margin-bottom: .5rem;
  }
  .case-toggle-btn {
    font-size: 12px;
    color: var(--blue-text);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 600;
  }
  .case-answer {
    font-size: 13px;
    font-weight: 700;
    color: var(--green-text);
    margin-top: .45rem;
    line-height: 1.5;
  }
  .case-exp {
    font-size: 12px;
    color: var(--text-3);
    margin-top: .2rem;
    line-height: 1.5;
  }

  .tool-note { font-size: 12px; color: var(--text-3); margin-bottom: .6rem; }
  .tool-links { display: flex; flex-wrap: wrap; gap: .4rem; }
  .tool-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--blue-text);
    background: var(--blue-bg);
    border: 1px solid var(--blue-bdr);
    border-radius: 20px;
    padding: 4px 13px;
    text-decoration: none;
    transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
  }
  .tool-link:hover,
  .tool-link:focus-visible {
    background: var(--blue-mid);
    border-color: #98baf2;
    color: #103566;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    outline: none;
  }

  .revision-card {
    background: var(--amber-bg);
    border: 1px solid var(--amber-bdr);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.35rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow-sm);
  }
  .revision-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--amber-text);
    margin-bottom: .7rem;
  }
  .rev-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: .3rem 0;
    border-bottom: 1px solid rgba(217, 119, 6, .2);
    font-size: 13px;
    gap: 1rem;
  }
  .rev-row:last-child { border-bottom: none; padding-bottom: 0; }
  .rev-key { color: var(--amber-text); opacity: .8; flex-shrink: 0; }
  .rev-val { font-weight: 700; color: var(--amber-dark); text-align: right; line-height: 1.4; }

  .practice-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: .75rem;
    box-shadow: var(--shadow-sm);
  }
  .practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .85rem 1.35rem;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
  }
  .practice-title { font-size: 14px; font-weight: 700; }
  .practice-sub   { font-size: 12px; color: var(--text-4); margin-top: 1px; }
  .practice-score { font-size: 14px; font-weight: 700; color: var(--text-3); }
  .practice-body  { padding: 1rem 1.35rem; display: flex; flex-direction: column; gap: .65rem; }
  .q-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1rem;
  }
  .q-meta { display: flex; gap: .3rem; margin-bottom: .55rem; }
  .q-stem { font-size: 13px; line-height: 1.65; color: var(--text-1); margin-bottom: .7rem; }
  .options { display: flex; flex-direction: column; gap: .3rem; }
  .opt {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    width: 100%;
    padding: .5rem .75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 13px;
    background: var(--surface);
    transition: background .1s, border-color .1s;
    line-height: 1.5;
    text-align: left;
    font-family: var(--font);
  }
  .opt:hover:not(.locked)  { background: var(--blue-bg); border-color: var(--blue-bdr); }
  .opt.opt-correct         { background: var(--green-bg); border-color: var(--green-bdr); }
  .opt.opt-wrong           { background: var(--red-bg);   border-color: var(--red-border); }
  .opt-letter {
    font-weight: 700;
    font-family: var(--mono);
    font-size: 11px;
    min-width: 16px;
    margin-top: 2px;
    color: var(--text-4);
  }
  .opt.opt-correct .opt-letter { color: var(--green-text); }
  .opt.opt-wrong   .opt-letter { color: var(--red-text); }
  .q-explanation {
    margin-top: .65rem;
    padding: .65rem .85rem;
    background: var(--surface);
    border-left: 3px solid #22863A;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.6;
  }
  .q-explanation strong { color: var(--text-1); font-weight: 700; }
  .q-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .55rem;
  }
  .result-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
  }
  .pill-correct { background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-bdr); }
  .pill-wrong   { background: var(--red-bg);   color: var(--red-text);   border: 1px solid var(--red-border); }
  .practice-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1.35rem;
    background: var(--surface2);
    border-top: 1px solid var(--border);
    font-size: 13px;
  }

  .study-slot-related {
    margin-top: .45rem;
  }
  .study-slot-related .card {
    background: linear-gradient(180deg, #FCFDFE 0%, #F8FBFF 100%);
    border-color: #D8E5F7;
    box-shadow: 0 16px 34px -28px rgba(17, 24, 39, .26);
  }
  .study-slot-related .card-label {
    margin-bottom: .85rem;
  }
  .related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: .85rem;
    margin-top: .85rem;
  }
  .related-tile {
    background: rgba(255, 255, 255, .96);
    border: 1px solid #D8E5F7;
    border-radius: var(--radius-md);
    padding: .95rem 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, transform .14s ease;
    display: block;
    box-shadow: 0 12px 28px -26px rgba(15, 23, 42, .58);
  }
  .related-tile:hover,
  .related-tile:focus-visible {
    background: #F3F8FF;
    border-color: #9DB9E8;
    box-shadow: 0 20px 36px -28px rgba(37, 99, 235, .36);
    transform: translateY(-1px);
    outline: none;
  }
  .related-name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    color: #17406f;
    margin-bottom: .3rem;
    text-wrap: balance;
  }
  .related-tile:hover .related-name,
  .related-tile:focus-visible .related-name {
    color: #103566;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .related-meta {
    font-size: 11px;
    color: var(--text-4);
    line-height: 1.5;
  }

  .nav-row {
    display: flex;
    justify-content: space-between;
    margin-top: 1.35rem;
    gap: .5rem;
  }
  .nav-spacer {
    flex: 1;
  }
  .nav-tile {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: .7rem 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .1s;
  }
  .nav-tile:hover { background: var(--surface2); }
  .nav-tile.next  { text-align: right; }
  .nav-dir  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-4); margin-bottom: 2px; }
  .nav-name { font-size: 13px; font-weight: 600; color: var(--text-1); }

  .topic-collapsible {
    margin-bottom: .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .collapsible-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border: none;
    background: var(--surface);
    color: var(--text-1);
    padding: 1rem 1.15rem;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -.01em;
    cursor: pointer;
    text-align: left;
    box-shadow: var(--shadow-sm);
  }
  .collapsible-toggle:hover {
    background: var(--surface2);
  }
  .collapsible-toggle[aria-expanded="true"] {
    border-bottom: 1px solid var(--border);
  }
  .toggle-icon {
    font-size: 18px;
    line-height: 1;
    color: var(--text-4);
    flex-shrink: 0;
  }
  .collapsible-content {
    padding: 0;
  }
  .collapsible-content > *:last-child {
    margin-bottom: 0;
  }
  .topic-collapsible .card {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: none;
  }

  .mode-hidden { display: none !important; }
  body.mode-practice .study-block:not(.revision-card) {
    opacity: .55;
  }
  body.mode-practice .practice-card {
    box-shadow: 0 0 0 2px var(--blue-bdr);
  }

  @media (max-width: 600px) {
    .nav-toggle { display: inline-flex; }
    .site-nav {
      display: none;
      position: absolute;
      top: 52px;
      left: 0;
      right: 0;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: .85rem 1.5rem 1rem;
      flex-direction: column;
      gap: .75rem;
    }
    .site-nav.open { display: flex; }
    .container { padding: 1.25rem 1rem 3.5rem; }
    #study-panel { gap: 1.1rem; }
    .hero-card,
    .mode-card,
    .quick-bar,
    .exam-core,
    .card,
    .revision-card,
    .practice-body,
    .practice-header,
    .practice-footer,
    .collapsible-toggle,
    .nav-tile { padding-left: 1rem; padding-right: 1rem; }
    .card,
    .revision-card,
    .practice-body { padding-top: 1.05rem; padding-bottom: 1.05rem; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
    .lab-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: .55rem; }
    .related-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .diff-table { font-size: 11px; }
    .hero-title { font-size: 22px; line-height: 1.08; }
    .card p,
    .revision-card p,
    .practice-card p,
    .topic-collapsible p,
    .q-stem { font-size: 13px; line-height: 1.72; }
    .card li,
    .revision-card li,
    .practice-card li,
    .topic-collapsible li { line-height: 1.72; }
    .tx-row,
    .trap-item { padding: .85rem 0; }
    .practice-header,
    .practice-footer { align-items: flex-start; gap: .5rem; }
  }
  .site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2rem 0; margin-top: 3rem; }
  .footer-grid { max-width: 780px; margin: 0 auto; padding: 0 1.25rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
  .footer-brand p { margin: .5rem 0 0; font-size: 13px; color: var(--text-3); max-width: 320px; }
  .footer-links { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 13px; }
  .footer-links a { color: var(--text-3); text-decoration: none; }
  .footer-links a:hover { color: var(--text-1); }
