/* Study BudE: one stylesheet. Colours, sizes and shadows are tokens; a subject's colour comes from its tone class on every surface. */
@font-face { font-family: "Inter"; src: url("../kit/fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-display: block; }
:root {
  --bg: #F4F5F7; --panel: #FFFFFF; --panel-2: #F1F4F9; --panel-line: #E1E5EC; --panel-ink: #111827; --panel-muted: #6B7280;
  --glass: rgba(255, 255, 255, .16); --glass-2: rgba(255, 255, 255, .55);
  --paper: #FFFFFF; --ink: #111827; --muted: #6B7280; --line: #E5E7EB; --wash: #F3F4F6; --bar: #FFFFFF; --bar-ink: #6B7280; --track: var(--line);
  --accent: #2563EB; --accent-ring: rgba(37, 99, 235, .2); --field: #CBD2DC; --accent-soft: #EFF4FF; --hot: #B45309; --hot-soft: #FEF3C7; --ok: #15803D; --ok-soft: #ECFDF3; --ok-v: #15803D;
  --teal: #0F766E; --teal-soft: #E6F4F2; --teal-d: #0B3F4A;
  --green: #3F7D20; --green-soft: #EDF5E6; --green-d: #1E4620;
  --blue: #1D4ED8; --blue-soft: #E8EEFC; --blue-d: #1E2A78;
  --purple: #6D28D9; --purple-soft: #F0EAFB; --purple-d: #3B1A78;
  --red: #BE123C; --red-soft: #FBEAED; --red-d: #6B1230;
  --orange: #C2410C; --orange-soft: #FBF0E0; --orange-d: #6E2A0C;
  --r-l: 10px; --r: 8px; --r-s: 5px; --gap: 14px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .07); --shadow-2: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 16px rgba(16, 24, 40, .08); --shadow-3: 0 2px 6px rgba(16, 24, 40, .08), 0 14px 32px rgba(16, 24, 40, .14);
  --font: "Inter", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --c: var(--teal); --cs: var(--teal-soft); --d: var(--teal-d); --v: var(--teal);
}
.tone-teal { --c: var(--teal); --cs: var(--teal-soft); --d: var(--teal-d); --v: var(--teal); }
.tone-green { --c: var(--green); --cs: var(--green-soft); --d: var(--green-d); --v: var(--green); }
.tone-blue { --c: var(--blue); --cs: var(--blue-soft); --d: var(--blue-d); --v: var(--blue); }
.tone-purple { --c: var(--purple); --cs: var(--purple-soft); --d: var(--purple-d); --v: var(--purple); }
.tone-red { --c: var(--red); --cs: var(--red-soft); --d: var(--red-d); --v: var(--red); }
.tone-orange { --c: var(--orange); --cs: var(--orange-soft); --d: var(--orange-d); --v: var(--orange); }
.tone-ink { --c: var(--ink); --cs: var(--wash); --d: var(--muted); --v: var(--ink); }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; } h1, h2, h3 { letter-spacing: -.015em; } button, input { font: inherit; color: inherit; } a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); font-size: 13px; }
.ico { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; } .ico.ok { color: var(--ok); width: 18px; height: 18px; }

/* bar */
.bar { display: flex; align-items: center; gap: 28px; padding: 8px 14px; background: var(--bar); color: var(--bar-ink); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; color: var(--ink); padding: 4px 0; font-weight: 800; letter-spacing: -.02em; } .brand img { width: 26px; height: 26px; }
.tabs { display: flex; gap: 4px; }
.tab { display: flex; align-items: center; white-space: nowrap; padding: 6px 14px; font-weight: 600; font-size: 14px; border-radius: var(--r-s); }
.tab:hover { color: var(--ink); } .tab.on { color: var(--paper); background: var(--ink); }
.bar-end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.bar .chip { padding: 4px 10px; background: var(--panel-2); border-color: transparent; color: var(--bar-ink); } .bar .chip.hot { background: var(--hot-soft); color: var(--hot); } .bar .chip.ok { background: var(--ok-soft); color: var(--ok); }

/* chips and buttons */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--r-s); font-size: 12px; font-weight: 600; background: var(--paper); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.tone { background: var(--cs); border-color: transparent; color: var(--c); }
.chip.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip.hot { background: var(--hot-soft); border-color: transparent; color: var(--hot); }
.chip.pick { cursor: pointer; padding: 5px 10px; font-size: 13px; } .chip.pick:hover { border-color: var(--c); } .chip.pick.on { background: var(--c); color: var(--paper); border-color: transparent; }
.chip.pick:not(.tone).on { background: var(--ink); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--paper); font-weight: 600; font-size: 14px; cursor: pointer; }
.btn { box-shadow: var(--shadow); } .btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); } .btn.primary:hover { filter: brightness(1.1); }
.btn.big { padding: 10px 20px; font-size: 15px; } .btn.small { padding: 3px 8px; font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the view: controls on the left, the stage on the right */
.view { flex: 1; min-height: 0; display: flex; gap: var(--gap); padding: var(--gap); }
.side { flex: 0 0 320px; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); flex: none; }
.card h2 { font-size: 20px; line-height: 1.25; } .card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 4px; } .card-head .btn, .card-head .muted:last-child { margin-left: auto; }
.meter { appearance: none; -webkit-appearance: none; width: 100%; height: 4px; border: 0; border-radius: 2px; background: var(--track); display: block; margin-bottom: 4px; }
.meter::-webkit-progress-bar { background: var(--track); border-radius: 2px; } .meter::-webkit-progress-value { background: var(--c); border-radius: 2px; }
.meter::-moz-progress-bar { background: var(--c); border-radius: 2px; }

/* a lesson row */
.row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px 7px 0; border: 0; border-radius: var(--r-s); background: none; text-align: left; cursor: pointer; }
.row:hover { background: var(--wash); } .row.on { background: var(--cs); }
.row-mark { flex: none; width: 3px; align-self: stretch; border-radius: 2px; background: var(--c); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; } .row-text b { font-size: 14px; font-weight: 600; line-height: 1.3; }
.row.done .row-text b { font-weight: 500; color: var(--muted); }
.row-end { flex: none; display: flex; align-items: center; }

/* the stage */
.stage { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--paper); border-radius: var(--r-l); box-shadow: var(--shadow-2); }
.ava { flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; font-size: 12px; font-weight: 800; letter-spacing: -.01em; background: var(--cs); color: var(--c); }
.row.on .ava, .acc-head.on .ava, .pick-item.on .ava, .acc-item.open > .acc-head .ava { background: var(--paper); box-shadow: var(--shadow); }
.strip { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.strip-tab { display: flex; align-items: center; gap: 7px; padding: 11px 12px 9px; border: 0; border-bottom: 2px solid transparent; background: none; font-weight: 500; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.strip-tab:hover { color: var(--ink); } .strip-tab.on { color: var(--c); font-weight: 700; border-bottom-color: var(--c); }
.stage-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 22px 24px; }
.parts { margin: 0; padding: 0; list-style: none; counter-reset: part; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 28px; }
.parts li { counter-increment: part; display: flex; align-items: baseline; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.parts li::before { content: counter(part, decimal-leading-zero); flex: none; color: var(--c); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.prose { display: flex; flex-direction: column; gap: 12px; max-width: 820px; } .prose b, .alerts b, .steps b { font-weight: 600; color: var(--ink); }
.prose .note b { color: var(--c); }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; } .tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom-color: var(--ink); }
.cols { display: flex; flex-wrap: wrap; gap: 32px; } .col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.col h3, .teach h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.alerts, .steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.alerts { gap: 6px; } .alerts li { display: flex; gap: 10px; padding: 8px 12px; border-left: 3px solid var(--hot); background: var(--hot-soft); border-radius: 0 var(--r-s) var(--r-s) 0; } .alerts .ico { color: var(--hot); margin-top: 3px; }
.steps { counter-reset: step; } .steps li { counter-increment: step; display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step); flex: none; font-weight: 600; color: var(--c); width: 14px; }
.ask { font-size: 17px; font-weight: 600; line-height: 1.4; }
.teach { display: flex; flex-direction: column; gap: 12px; max-width: 640px; padding: 18px; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: var(--r-s); }
.empty { padding: 30px; color: var(--muted); text-align: center; }

/* study: the heading band in the subject's colour, the lesson frame, the time figures */
.top { display: flex; flex-direction: column; gap: 14px; padding: 18px 22px 16px; border-radius: var(--r-l) var(--r-l) 0 0; background: var(--cs); }
.top-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; } .top-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); } .crumb b { color: var(--c); font-weight: 700; }
.dot { flex: none; width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.top h1 { font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.top .chip { box-shadow: var(--shadow); background: var(--paper); border-color: transparent; color: var(--ink); padding: 3px 9px; } .top .chip.hot { background: var(--hot-soft); color: var(--hot); } .top .chip.ok { color: var(--ok); }
.pager { flex: none; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; }
.btn.step { padding: 6px; font-size: 18px; border-color: transparent; color: var(--c); box-shadow: var(--shadow); } .btn.step:hover { border-color: var(--c); } .btn.step:disabled { opacity: .35; cursor: default; border-color: transparent; }
.segs { display: flex; gap: 4px; } .seg { flex: 1; height: 5px; padding: 0; border: 0; border-radius: 3px; background: var(--paper); cursor: pointer; } .seg.done { background: var(--c); opacity: .4; } .seg.on, .seg:hover { background: var(--c); opacity: 1; }
.stage-body.flush { padding: 0; display: flex; overflow: visible; }
.player { flex: 1; min-height: 0; width: 100%; border: 0; border-radius: 0 0 var(--r-l) var(--r-l); background: var(--wash); }
.col.wide { flex: 2 1 420px; } .col .qc { margin: 0; max-width: none; } .prose.full { max-width: none; } .label { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 6px; }
.figures { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: var(--r-s); }
.figure { flex: 1 1 140px; display: flex; flex-direction: column; padding: 10px 14px; border-right: 1px solid var(--line); } .figure:last-child { border-right: 0; } .figure b { font-size: 19px; font-weight: 700; }

/* the left side: one panel: the subject is picked in its heading, the topics are an accordion with the lessons inside */
.nav { min-width: 0; overflow: visible; gap: 0; background: var(--paper); border-radius: var(--r-l); box-shadow: var(--shadow-2); }
.nav-head { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); } .nav .meter { margin: 0; }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px 9px 12px; border: 1px solid var(--field); border-radius: var(--r-s); background: var(--paper); box-shadow: var(--shadow); cursor: pointer; text-align: left; transition: border-color .12s ease, box-shadow .12s ease; }
.pick:hover { border-color: var(--muted); } .pick.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.pick b { flex: 1; font-size: 17px; font-weight: 700; letter-spacing: -.01em; } .pick-arrow { width: 20px; height: 20px; color: var(--muted); transform: rotate(90deg); transition: transform .15s ease; } .pick.open .pick-arrow { transform: rotate(-90deg); }
.pick-menu { display: flex; flex-direction: column; gap: 1px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--shadow-3); }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 4px; background: none; cursor: pointer; text-align: left; }
.pick-item:hover { background: var(--wash); } .pick-item.on { background: var(--cs); } .pick .ava, .pick-item .ava { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; } .pick-item b { flex: 1; font-size: 14.5px; font-weight: 600; } .pick-item.on b, .pick-item .ico { color: var(--c); }
.find { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 10px; border: 1px solid var(--field); border-radius: var(--r-s); background: var(--paper); box-shadow: var(--shadow); color: var(--muted); cursor: text; transition: border-color .12s ease, box-shadow .12s ease; }
.find:hover { border-color: var(--muted); } .find:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.find input { flex: 1; min-width: 0; padding: 8px 0; border: 0; outline: 0; background: none; font-size: 14.5px; color: var(--ink); appearance: none; -webkit-appearance: none; } .find input::placeholder { color: var(--muted); }
.find input::-webkit-search-cancel-button { display: none; }
.find-clear { flex: none; display: flex; padding: 4px; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; } .find-clear:hover { background: var(--wash); color: var(--ink); }
.nav-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.count { flex: none; padding: 1px 7px; border-radius: var(--r-s); font-size: 12px; font-weight: 700; background: var(--wash); color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 1px; padding: 4px 8px 12px; }
.nav .row { flex: none; padding: 7px 8px 7px 6px; }
.acc-sub { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 8px 4px; }
.acc-sub h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.acc-item { flex: none; display: flex; flex-direction: column; }
.acc-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px 7px 6px; border: 0; border-radius: var(--r-s); background: none; color: inherit; cursor: pointer; text-align: left; }
.acc-head:hover { background: var(--wash); } .acc-head.on { background: var(--cs); }
.acc-arrow { color: var(--muted); transition: transform .15s ease; } .open > .acc-head .acc-arrow { transform: rotate(90deg); } .acc-head.has .acc-arrow { color: var(--c); }
.acc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; } .acc-text b { font-size: 14.5px; font-weight: 600; line-height: 1.3; } .acc-head.has .acc-text b { color: var(--c); font-weight: 700; }
.acc-body { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px 20px; padding-left: 8px; border-left: 2px solid var(--line); }
.lesson { display: flex; align-items: flex-start; gap: 9px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r-s); background: none; color: inherit; text-align: left; cursor: pointer; }
.lesson:hover { background: var(--wash); } .lesson.on { background: var(--cs); }
.lesson-num { flex: none; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-top: 1px; border-radius: var(--r-s); font-size: 11px; font-weight: 700; background: var(--wash); color: var(--muted); }
.lesson.done .lesson-num { background: var(--ok-soft); color: var(--ok); } .lesson.on .lesson-num { background: var(--c); color: var(--paper); }
.lesson-text { flex: 1; min-width: 0; display: flex; flex-direction: column; } .lesson-text b { font-size: 13.5px; font-weight: 600; line-height: 1.3; } .lesson.on .lesson-text b { color: var(--c); }
.lesson-text .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .lesson-end { flex: none; font-size: 12px; white-space: nowrap; margin-top: 2px; }

/* quick check */
.qc { display: flex; flex-direction: column; gap: 14px; max-width: 700px; margin: 0 auto; }
.qc-dots { display: flex; gap: 3px; } .qc-dots i { flex: 1; height: 3px; background: var(--line); } .qc-dots i.past { background: var(--c); } .qc-dots i.now { background: var(--ink); }
.qc-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r); min-height: 220px; box-shadow: var(--shadow-2); }
.qc-q { font-size: 20px; font-weight: 600; line-height: 1.35; } .qc-a { padding: 10px 14px; border-left: 3px solid var(--ok); background: var(--ok-soft); font-size: 17px; font-weight: 600; }
.qc-card .acts { margin-top: auto; }

/* 3D labs and progress */
.stage.wide { overflow: auto; padding: 20px 22px; gap: 18px; }
.view-progress .card { border: 0; border-radius: var(--r-l); box-shadow: var(--shadow-2); }
.wall-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; } .wall-head h1 { font-size: 22px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); transition: border-color .15s ease, box-shadow .15s ease; }
.tile { box-shadow: var(--shadow); } .tile:hover { border-color: var(--c); box-shadow: var(--shadow-3); }
.tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px 7px 0 0; background: var(--wash); display: block; }
.tile-text { display: flex; flex-direction: column; padding: 0 10px; } .tile-text b { font-weight: 600; } .tile .chips { padding: 0 10px; margin-top: auto; }
.exam { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 8px 10px; border: 0; border-left: 3px solid var(--c); border-radius: 0 var(--r-s) var(--r-s) 0; background: none; text-align: left; cursor: pointer; }
.exam:hover { background: var(--wash); } .exam.past { opacity: .5; } .exam.hot { background: var(--hot-soft); } .exam b { font-weight: 600; }
.exam-top { display: flex; flex-direction: column; } .exam-bar { display: flex; align-items: center; gap: 10px; } .exam-bar .meter { flex: 1; margin: 0; } .exam-bar .muted { flex: none; font-size: 12px; }
.map { display: flex; flex-direction: column; gap: 16px; }
.map-row { display: flex; gap: 18px; align-items: flex-start; } .map-name { flex: 0 0 150px; display: flex; flex-direction: column; } .map-name b { font-weight: 600; }
.cells { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.cell { width: 24px; height: 24px; padding: 0; border-radius: 3px; border: 0; background: var(--cs); box-shadow: inset 0 0 0 1px var(--c); cursor: pointer; display: inline-block; opacity: .75; }
.cell:hover { opacity: 1; } .cell.done { background: var(--c); opacity: 1; } .cell.sure { box-shadow: inset 0 0 0 1px var(--c), 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.key { margin-top: auto; padding-top: 6px; } .key-item { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; } .key .cell { width: 14px; height: 14px; cursor: default; }

/* narrow screens: the list above, the stage below, the page scrolls */
@media (max-width: 900px) {
  html, body { height: auto; } .bar { flex-wrap: wrap; gap: 0 14px; padding: 8px 12px; } .bar-end { margin-left: 0; } .brand { flex: 1 0 100%; }
  .view { flex-direction: column; padding: 12px; } .side { flex: none; overflow: visible; } .nav-body { flex: none; max-height: 46vh; }
  .top-row { flex-direction: column; } .player { min-height: 70vh; }
  .stage-body { overflow: visible; padding: 14px; } .map-row { flex-direction: column; gap: 6px; } .map-name { flex: none; }
}
