/* Light to Latent: page styles for map, week, library, practice, career, notes, settings, what's new, certificate. */

.subnav { display: flex; flex-wrap: wrap; gap: 6px 4px; margin-top: 16px; border-bottom: 2px solid var(--line-strong); }
.subnav a { padding: 10px 14px; font-weight: 600; text-decoration: none; color: var(--ink); border-radius: 3px 3px 0 0; min-height: 44px; display: inline-flex; align-items: center; }
.subnav a:hover { background: var(--grid-soft); }
.lsec { margin-top: 64px; scroll-margin-top: calc(var(--hdr) + 12px); }
.lsec > .h2 { margin-bottom: 14px; }
.lsec.flash { box-shadow: none; background: transparent; }
.lsec.flash > .h2, .lsec.flash .sec-head .h2 { background: var(--sel); box-shadow: 0 0 0 5px var(--sel); }
.sec-head { margin-bottom: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 28px; margin: 14px 0 0; border-top: 2px solid var(--ink); }
.facts > div { padding: 10px 0; border-bottom: 1px solid var(--line-strong); }
.facts dt { color: var(--ink-2); font-size: 14px; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.p-flag { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--red-text); font-weight: 700; font-size: 14px; }
.p-flag .ico { color: var(--red); }

/* ---------- course map ---------- */
.map-page .page-head { padding-top: 8px; margin-bottom: 8px; }
.map-hint { display: none; }
.map { margin-top: 24px; }
.map-view { padding-inline: 24px; }
.map-track { display: grid; gap: 48px; max-width: 760px; margin-inline: auto; }
.phase-band { position: relative; display: flex; gap: 16px; border-top: 4px solid var(--ink); background: var(--grid-soft); padding: 14px 16px 16px; }
.phase-band::before, .phase-band::after { content: ""; position: absolute; top: 0; width: 4px; height: 16px; background: var(--ink); }
.phase-band::before { left: 0; }
.phase-band::after { right: 0; }
.phase-n { flex: none; width: 54px; height: 54px; display: grid; place-items: center; border: 2px solid var(--blue); border-radius: 3px; color: var(--blue-text); font: 800 40px/1 var(--font-ui); font-stretch: 62%; background: var(--sheet); }
.phase-h { font: 800 26px/1.05 var(--font-ui); font-stretch: 70%; }
.phase-wk { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.phase-bl { margin-top: 6px; font-size: 15px; max-width: 52ch; }
.weeks { display: grid; gap: 0; margin-top: 18px; }
.panel { position: relative; min-width: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-strong); }
.panel .slot { aspect-ratio: 4 / 3; align-self: start; }
.p-body { padding-top: 0; min-width: 0; }
.p-no { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.p-no-n { font: 800 32px/1 var(--font-ui); font-stretch: 62%; }
.p-hrs { font: 700 17px/1 var(--font-ui); font-stretch: 68%; color: var(--ink-2); }
.p-h { font: 700 18px/1.2 var(--font-ui); margin-top: 4px; }
.p-h a { color: var(--ink); text-decoration-color: var(--blue); text-decoration-thickness: 2px; }
.p-del { color: var(--ink); font-size: 14.5px; margin-top: 2px; }
.p-dates, .p-prog { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.panel.is-done .p-prog { color: var(--blue-text); font-weight: 700; }
.p-ring { position: absolute; inset: -6px; z-index: 2; pointer-events: none; display: block; }
.p-ring .ring { width: 100%; height: 100%; }
.p-you { position: absolute; left: 6px; bottom: 6px; z-index: 3; background: var(--red-text); color: #fff; font: 700 13px/1 var(--font-ui); padding: 6px 8px; border-radius: 2px; }
:root[data-theme="dark"] .p-you { background: var(--red); color: #101215; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .p-you { background: var(--red); color: #101215; } }
.panel.is-current { background: var(--grid-soft); padding-inline: 12px; margin-inline: -12px; box-shadow: inset 4px 0 0 var(--red); }
.panel.flash { background: var(--sel); box-shadow: inset 0 0 0 3px var(--blue); }
.scrub, .scrub-win { display: none; }

/* pinned: wide screens with motion allowed */
.map.is-pinned { margin-top: 8px; }
.map.is-pinned .map-hint { display: inline; }
.map.is-pinned .map-outer { height: 300vh; position: relative; }
.map.is-pinned .map-stick { position: sticky; top: var(--hdr); height: calc(100vh - var(--hdr)); height: calc(100dvh - var(--hdr)); display: flex; flex-direction: column; justify-content: center; gap: 22px; overflow: hidden; }
.map.is-pinned .map-view { overflow: hidden; padding-left: max(24px, calc((100vw - 1248px) / 2 + 24px)); padding-right: 0; }
.map.is-pinned .map-track { display: flex; width: max-content; max-width: none; margin: 0; gap: 44px; padding-right: 64px; will-change: transform; align-items: flex-start; }
.map.is-pinned .phase { flex: none; }
.map.is-pinned .phase-band { width: 100%; }
.map.is-pinned .phase-bl { max-width: 520px; }
.map.is-pinned .weeks { display: flex; gap: 18px; margin-top: 22px; }
.map.is-pinned .panel { display: block; width: 250px; flex: none; padding: 0; border-top: 0; margin: 0; background: none; box-shadow: none; }
.map.is-pinned .panel .slot { aspect-ratio: 16 / 10; }
.map.is-pinned .p-body { padding-top: 10px; }
.map.is-pinned .panel.is-current .slot { border-color: var(--red); border-width: 3px; overflow: visible; }
.map.is-pinned .panel.is-current .slot .art { overflow: hidden; }
.map.is-pinned .panel.flash .slot { box-shadow: 0 0 0 5px var(--blue); }
.map.is-pinned .p-ring { inset: -8px; }
.map.is-pinned .scrub { display: block; position: relative; height: 22px; }
.map.is-pinned .scrub i { position: absolute; bottom: 0; width: 4px; height: 12px; margin-left: -2px; background: var(--line-strong); border-radius: 1px; }
.map.is-pinned .scrub i.cur { background: var(--red); height: 22px; }
.map.is-pinned .scrub i.dl { background: var(--red); opacity: .55; height: 18px; }
.map.is-pinned .map-scrub { position: relative; padding-bottom: 6px; }
.map.is-pinned .scrub-win { display: block; position: absolute; left: 24px; bottom: 0; height: 28px; border: 2px solid var(--blue); border-radius: 2px; background: color-mix(in srgb, var(--blue) 14%, transparent); pointer-events: none; }
@media (max-width: 899px) {
  .panel .slot-btn { display: none; }
  .map-view { padding-inline: 16px; }
  .panel { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .panel.is-current { padding-inline: 8px; margin-inline: -8px; }
  .p-ring { inset: -5px; }
  .p-you { display: none; }
  .p-no-n { font-size: 28px; }
  .p-h { font-size: 17px; }
  .phase-h { font-size: 24px; }
  .phase-n { width: 44px; height: 44px; font-size: 32px; }
}

/* ---------- week page ---------- */
.week-top { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 8px; }
.wk-n { color: var(--red-text); margin-right: 6px; }
.week-page .week { margin-top: 48px; }
.week-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; margin-top: 48px; align-items: start; }
.week-side { display: grid; gap: 22px; }
@media (max-width: 900px) { .week-top, .week-cols { grid-template-columns: minmax(0, 1fr); gap: 24px; } .week-art { max-width: 360px; } }

/* ---------- library ---------- */
.bm-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: flex-end; margin-bottom: 20px; padding: 12px 0 16px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line-strong); }
.filters .field { margin-top: 8px; }
.filters .f-inline { display: grid; grid-template-columns: 1fr; gap: 4px; }
.f-saved { margin-top: 14px; align-self: flex-end; }
.res-list { border-top: 2px solid var(--ink); }
.res { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line-strong); align-items: start; scroll-margin-top: calc(var(--hdr) + 12px); }
.res-t { font: 700 19px/1.25 var(--font-ui); }
.res-m { color: var(--ink-2); font-size: 14.5px; margin-top: 2px; }
.res-n { margin-top: 6px; max-width: 70ch; font-family: var(--font-read); }
.res-c { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); }
.res-count { margin-top: 10px; }
.bm-b[aria-pressed="true"] { background: var(--sel); border-color: var(--blue); }
.bm-b[aria-pressed="true"] .ico { fill: var(--blue); stroke: var(--blue); }
.gls-page .gl { grid-template-columns: 200px minmax(0, 1fr); }
.gls-page .gl:focus-visible { outline-offset: -2px; }
.dl-list { border-top: 2px solid var(--ink); margin-top: 14px; }
.dl-list > li { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 4px; border-bottom: 1px solid var(--line-strong); flex-wrap: wrap; }
.dl-list .h3 { font-size: 20px; }
.dl-list .field { max-width: 380px; }
.dl-sub { margin-top: 32px; }
.tbl-wrap { overflow-x: auto; margin-top: 16px; }
.plan-t { width: 100%; border-collapse: collapse; font-size: 15px; }
.plan-t th, .plan-t td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line-strong); vertical-align: top; }
.plan-t thead th { border-bottom: 2px solid var(--ink); font-size: 14px; color: var(--ink-2); }

/* ---------- practice ---------- */
.quiz-list { border-top: 2px solid var(--ink); }
.quiz-list > li { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 4px; border-bottom: 1px solid var(--line-strong); flex-wrap: wrap; scroll-margin-top: calc(var(--hdr) + 12px); }
.quiz-panel { margin-top: 32px; padding: 22px 24px; border: 2px solid var(--ink); border-radius: 3px; max-width: 800px; }
.quiz-panel:focus { outline: none; }
.score { font: 800 26px/1.1 var(--font-ui); font-stretch: 72%; margin: 6px 0 14px; }
.score b { color: var(--blue-text); font-size: 40px; }
.q { margin: 22px 0 0; padding: 0; border-left: 4px solid var(--line-strong); padding-left: 16px; }
.q legend { font: 600 18px/1.35 var(--font-ui); padding: 0; margin-bottom: 10px; }
.q-n { display: inline-block; min-width: 30px; font: 800 26px/1 var(--font-ui); font-stretch: 62%; color: var(--ink-2); }
.q-choices { display: grid; gap: 8px; }
.radio { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border: 2px solid var(--line-strong); border-radius: 3px; cursor: pointer; line-height: 1.35; }
.radio:hover { border-color: var(--blue); }
.radio input { appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--sheet); cursor: pointer; }
.radio input:checked { border-color: var(--blue); box-shadow: inset 0 0 0 4px var(--sheet), inset 0 0 0 12px var(--blue); }
.radio input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.q.is-right { border-left-color: var(--blue); }
.q.is-wrong { border-left-color: var(--red); }
.radio.is-answer { border-color: var(--blue); background: var(--sel); }
.q-why { margin-top: 10px; font-family: var(--font-read); font-size: 16px; max-width: 66ch; }
.q-act { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.fc-top { display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: flex-end; }
.fc-counts { display: flex; gap: 32px; margin: 8px 0; }
.fc-counts dt { color: var(--ink-2); font-size: 14px; }
.fc-counts dd { margin: 0; font: 800 44px/1 var(--font-ui); font-stretch: 62%; }
.fc-session { max-width: 720px; display: grid; gap: 18px; }
.fc-card { border: 2px solid var(--ink); border-radius: 3px; padding: 24px 26px; min-height: 180px; background: var(--sheet); }
.fc-side { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.fc-front { font: 700 28px/1.2 var(--font-ui); font-stretch: 78%; margin-top: 4px; }
.fc-back { font: 400 19px/1.55 var(--font-read); margin-top: 4px; }
.fc-card hr { border: 0; border-top: 1px solid var(--line-strong); margin: 18px 0 12px; }
.fc-grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.grade { flex-direction: column; min-height: 76px; gap: 2px; position: relative; }
.g-l { font-weight: 800; font-size: 17px; }
.g-i { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.grade .kbd { position: absolute; top: 5px; right: 6px; }
.g-again { border-color: var(--red-text); }
.g-good { border-color: var(--blue); }
.fc-prog { color: var(--ink-2); }
@media (max-width: 600px) { .fc-grades { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fc-front { font-size: 24px; } .quiz-panel { padding: 16px; } }

/* ---------- career ---------- */
.gate-dates { margin-bottom: 18px; }
.gate-list { border-top: 2px solid var(--ink); }
.gate-item { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-strong); }
.gate-n { font: 800 44px/1 var(--font-ui); font-stretch: 62%; color: var(--ink-2); text-align: center; }
.gate-item.is-done .gate-n { color: var(--blue-text); }
.gate-t { font: 800 22px/1.2 var(--font-ui); font-stretch: 78%; }
.gate-item.is-done .gate-t { text-decoration: line-through; text-decoration-color: var(--blue); text-decoration-thickness: 2px; color: var(--ink-2); }
.gate-item .det { margin-top: 6px; }
.gate-check { margin-top: 18px; }
.meter { margin: 6px 0 20px; max-width: 720px; }
.meter-bar { display: flex; height: 22px; border: 2px solid var(--ink); border-radius: 2px; background: var(--sheet); overflow: hidden; }
.m-cov { display: block; background: var(--blue); }
.m-pl { display: block; background: repeating-linear-gradient(135deg, var(--blue) 0 3px, var(--sheet) 3px 7px); }
.meter-t { margin-top: 6px; font-size: 15px; }
.jm-list { border-top: 2px solid var(--ink); }
.jm { padding: 14px 4px 16px; border-bottom: 1px solid var(--line-strong); border-left: 6px solid transparent; padding-left: 14px; }
.jm-covered { border-left-color: var(--blue); }
.jm-planned { border-left-color: var(--line-strong); border-left-style: dashed; }
.jm-top { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.jm-r { font-weight: 600; max-width: 70ch; }
.jm-s { font: 700 14px/1 var(--font-ui); color: var(--ink-2); }
.jm-covered .jm-s { color: var(--blue-text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1.5px solid var(--line-strong); border-radius: 3px; padding: 4px 9px; font-size: 14px; }
.chip.is-ready { border-color: var(--blue); background: var(--sel); }
.jm-pick { margin-top: 10px; }
.jm-pick summary { cursor: pointer; font-weight: 600; color: var(--blue-text); min-height: 32px; display: flex; align-items: center; width: fit-content; }
.jm-opts { display: grid; gap: 8px; margin-top: 8px; padding: 12px; background: var(--grid-soft); border: 1px solid var(--line-strong); border-radius: 3px; }
.pf-list { border-top: 2px solid var(--ink); }
.pf { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line-strong); }
.pf-t { font: 800 24px/1.1 var(--font-ui); font-stretch: 72%; }
.pf-f { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: flex-end; }
.pf-f .f-grow { min-width: 220px; }
.must { margin-top: 12px; display: grid; gap: 6px; }
.must legend { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.rows { border-top: 2px solid var(--ink); }
.rowf { padding: 16px 0 14px; border-bottom: 1px solid var(--line-strong); }
.rowf.is-due { box-shadow: inset 4px 0 0 var(--red); padding-left: 14px; }
.rowf-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 18px; }
.f-wide { grid-column: 1 / -1; }
.rowf-a { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.flag { color: #fff; background: var(--red-text); font: 700 13px/1 var(--font-ui); padding: 6px 8px; border-radius: 2px; }
:root[data-theme="dark"] .flag { background: var(--red); color: #101215; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flag { background: var(--red); color: #101215; } }
.tips { margin-bottom: 14px; max-width: 70ch; font-family: var(--font-read); }
.tips li { padding-left: 20px; position: relative; }
.tips li::before { content: ""; position: absolute; left: 0; top: .7em; width: 10px; height: 3px; background: var(--blue); }
.iv-list > li, .li-list > li { padding: 16px 0 14px; border-bottom: 1px solid var(--line-strong); }
.iv-list, .li-list { border-top: 2px solid var(--ink); }
.iv-n { font: 800 24px/1 var(--font-ui); font-stretch: 62%; color: var(--ink-2); margin-right: 8px; }
.iv .field > label { font: 700 18px/1.35 var(--font-ui); }
.iv-a, .li-a { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.up { display: grid; gap: 4px; max-width: 720px; }
.up-drop { border: 2px dashed var(--line-strong); border-radius: 3px; padding: 22px; display: grid; justify-items: start; gap: 10px; background: var(--grid-soft); }
.up-drop.is-over { border-color: var(--blue); background: var(--sel); }
.up-s { min-height: 1.4em; color: var(--ink-2); }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin-top: 18px; }
.gal-i { display: grid; gap: 10px; align-content: start; }
.gal-img { padding: 0; border: 2px solid var(--ink); border-radius: 2px; background: var(--sheet); cursor: zoom-in; display: block; }
.gal-img img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gal-vid { width: 100%; aspect-ratio: 16 / 9; background: #000; border: 2px solid var(--ink); }
.gal-pdf { display: flex; align-items: center; gap: 10px; border: 2px solid var(--ink); border-radius: 2px; aspect-ratio: 4 / 3; justify-content: center; font-weight: 700; color: var(--ink); text-decoration: none; background: var(--grid-soft); }
.gal-pdf .ico { width: 34px; height: 34px; }
.gal-m .field { margin-top: 6px; }
@media (max-width: 800px) { .pf { grid-template-columns: minmax(0, 1fr); gap: 14px; } .pf-art { max-width: 320px; } .bm-cols { grid-template-columns: minmax(0, 1fr); } .res { grid-template-columns: minmax(0, 1fr); } .gate-item { grid-template-columns: 40px minmax(0, 1fr); } .gate-n { font-size: 34px; } .gls-page .gl { grid-template-columns: 1fr; } }

/* ---------- notes, news, certificate ---------- */
.note-list { border-top: 2px solid var(--ink); margin-top: 18px; }
.note { padding: 16px 4px; border-bottom: 1px solid var(--line-strong); }
.note-m { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.note-t { margin-top: 8px; white-space: pre-line; font: 400 17px/1.55 var(--font-read); max-width: 70ch; }
.news { border-top: 2px solid var(--ink); }
.news-i { padding: 18px 4px 20px; border-bottom: 1px solid var(--line-strong); max-width: 760px; }
.news-d { color: var(--red-text); font-weight: 700; font-size: 14.5px; }
.cert { margin-top: 8px; max-width: 880px; }
.cert-frame { position: relative; border: 3px solid var(--ink); outline: 2px solid var(--line-strong); outline-offset: -12px; padding: 54px 48px; text-align: center; background: var(--sheet); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 28px 28px; }
.cert-k { font-weight: 600; color: var(--ink-2); }
.cert-title { font: 800 72px/1 var(--font-ui); font-stretch: 62%; margin: 8px 0 20px; }
.cert-line { font: 400 18px/1.5 var(--font-read); max-width: 52ch; margin: 8px auto; }
.cert-name { font: 800 52px/1.05 var(--font-ui); font-stretch: 66%; color: var(--blue-text); margin: 10px 0; border-bottom: 3px solid var(--blue); display: inline-block; padding: 0 18px 6px; }
.cert-dates { font: 700 22px/1.2 var(--font-ui); font-stretch: 72%; margin-top: 18px; }
.cert-rec { color: var(--ink-2); margin-top: 8px; font-size: 15px; }
.cert-mark { position: absolute; top: 18px; left: 22px; color: var(--red-text); font-weight: 800; font-size: 15px; border: 2px solid var(--red); padding: 4px 8px; transform: rotate(-3deg); background: var(--sheet); }
@media (max-width: 700px) { .cert-frame { padding: 44px 18px 32px; } .cert-title { font-size: 52px; } .cert-name { font-size: 38px; } }

#print-root { display: none; }

/* settings: keep single fields at a readable width */
.settings .field > input, .settings .field > select { max-width: 440px; }
.settings .lsec > p:not(.sub):not(.form-msg) { margin-top: 14px; }
.settings .btn-row { margin-top: 16px; }
.settings #d-mode { width: auto; min-width: 240px; }

.cert.is-preview .cert-frame { padding-top: 84px; }

/* Browser mode: backup reminder, gallery note, restore step */
.banner-soft { border-color: var(--line-strong); border-left-color: var(--blue); }
.banner-soft b { color: var(--ink); }
.banner-soft .btn-row { margin-top: 10px; }
.gal-note { margin-top: 8px; color: var(--ink-2); font-size: 15px; font-weight: 600; max-width: 70ch; }
.log-backup { margin-top: 12px; font-size: 14.5px; color: var(--ink-2); }
.rs-facts { grid-template-columns: 1fr; margin-bottom: 14px; }
.settings #bk-msg:not(:empty), .settings #bk-warn:not([hidden]) { max-width: 70ch; }
#bk-msg { color: var(--ink); }
.rs-copy { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-weight: 600; cursor: pointer; }
.rs-copy input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--blue); }
