/* DAVE Notes: Lecture Note-Taking Trainer
   Brand: yellow #ffff00, black, white. Space Grotesk (text) + Space Mono (labels, numbers). */
:root{
  --y:#ffff00; --k:#000; --w:#fff;
  --bg:#f2f2ee; --card:#ffffff; --text:#111111; --muted:#3d3d3d; --line:#111111; --soft:#e6e6e0;
  --font:"Space Grotesk",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --mono:"Space Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0c0c0c; --card:#1c1c1c; --text:#f3f3f3; --muted:#c9c9c9; --line:#5a5a5a; --soft:#2a2a2a; color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#0c0c0c; --card:#1c1c1c; --text:#f3f3f3; --muted:#c9c9c9; --line:#5a5a5a; --soft:#2a2a2a; color-scheme:dark;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font:17px/1.55 var(--font);overflow-x:hidden}
img{max-width:100%}
a{color:inherit}
h1,h2,h3{line-height:1.15;margin:0 0 .4em;letter-spacing:-.01em}
h1{font-size:clamp(1.8rem,6vw,2.6rem)}
h2{font-size:clamp(1.4rem,4.6vw,1.9rem)}
h3{font-size:1.15rem}
p{margin:0 0 .8em}
.mono,.label{font-family:var(--mono)}
.label{font-size:.82rem;text-transform:uppercase;letter-spacing:.06em;font-weight:700}
.wrap{max-width:780px;margin:0 auto;padding:0 16px}
.wrap.wide{max-width:1120px}
.sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:8px;top:-60px;background:var(--y);color:#000;padding:10px 14px;font-weight:700;z-index:10;border:2px solid #000}
.skip:focus{top:8px}

/* focus: black ring + yellow ring, visible on any background */
:focus-visible{outline:3px solid #000;outline-offset:3px;box-shadow:0 0 0 3px var(--y);border-radius:6px}
:root[data-theme="dark"] :focus-visible{outline-color:var(--y);box-shadow:0 0 0 3px #000}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) :focus-visible{outline-color:var(--y);box-shadow:0 0 0 3px #000}}
.band :focus-visible{outline-color:var(--y);box-shadow:0 0 0 3px #000}

/* header */
.top{background:#000;color:#fff;border-bottom:4px solid var(--y)}
.top .wrap{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:64px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;font-weight:700;font-size:1.05rem}
.brand b{background:var(--y);color:#000;padding:4px 8px;font-family:var(--mono);letter-spacing:.04em}
.topnav{display:flex;gap:4px;align-items:center}
.topnav a,.topnav button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;padding:0 10px;color:#fff;text-decoration:none;font:600 .95rem var(--font);background:#000;border:0;border-radius:8px;cursor:pointer}
.topnav a:hover,.topnav button:hover{background:#333}
@media (max-width:420px){.topnav .hide-xs{display:none}}

/* bands and cards */
.band{background:#000;color:#fff;padding:24px 0 26px}
.band h1,.band h2{color:var(--y)}
.band p{color:#f0f0f0}
.band .muted{color:#d6d6d6}
.stepline{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;margin-bottom:10px;color:var(--y)}
.bar{height:8px;background:#333;border-radius:99px;overflow:hidden;margin:6px 0 2px}
.bar>i{display:block;height:100%;background:var(--y);width:0}
main{padding-bottom:40px}
.stack>*+*{margin-top:16px}
.card{background:var(--card);color:var(--text);border:2px solid var(--line);border-radius:14px;padding:18px}
.card.flat{border-width:1px}
.card h3{margin-bottom:.5em}
.muted{color:var(--muted)}
.small{font-size:.92rem}
.section{padding-top:20px}
.why{margin-top:22px;border-left:6px solid var(--y);background:#000;color:#fff;padding:12px 14px;border-radius:0 10px 10px 0;font-size:.98rem}
.why b{color:var(--y);font-family:var(--mono);font-size:.8rem;text-transform:uppercase;letter-spacing:.06em;display:block}
.notice{border:2px solid var(--line);border-left:8px solid var(--y);background:var(--card);padding:12px 14px;border-radius:10px}
.notice.warn{border-left-color:#000;background:var(--y);color:#000;border-color:#000}
.goalbox{background:var(--y);color:#000;border-radius:12px;padding:14px 16px;border:2px solid #000}
.goalbox .label{display:block;margin-bottom:2px}

/* badges */
.badges{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 10px}
.badge{display:inline-block;font:700 .78rem/1 var(--mono);text-transform:uppercase;letter-spacing:.05em;padding:6px 8px;border-radius:6px;background:var(--soft);color:var(--text);border:1px solid var(--line)}
.badge.draft{background:#fff;color:#000;border:2px dashed #000}
.band .badge{background:#222;color:#fff;border-color:#555}
.band .badge.draft{background:#fff;color:#000;border-color:#000}
.badge.main{background:#000;color:var(--y);border-color:#000}
.badge.detail{background:#fff;color:#000;border:2px solid #000}

/* buttons: solid hardcoded colours, always high contrast */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:10px 20px;border-radius:12px;border:2px solid #000;background:var(--y);color:#000;font:700 1rem/1.2 var(--font);text-decoration:none;cursor:pointer;text-align:center}
.btn:hover{background:#ffff66}
.btn.dark{background:#333;color:#fff;border-color:#333}
.btn.dark:hover{background:#4a4a4a}
.btn.light{background:#fff;color:#000;border-color:#000}
.btn.light:hover{background:#f1f1f1}
.band .btn.dark{border-color:#777}
:root[data-theme="dark"] .btn.dark{border-color:#777}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .btn.dark{border-color:#777}}
.btn[disabled]{background:#d0d0d0;color:#3a3a3a;border-color:#9a9a9a;cursor:not-allowed}
.btn.big{min-height:60px;font-size:1.1rem;padding:12px 24px}
.btn.block{display:flex;width:100%}
.btn.sm{min-height:44px;padding:8px 14px;font-size:.95rem}
.btn[aria-pressed="true"]{background:#000;color:var(--y);border-color:#000}
.band .btn[aria-pressed="true"]{border-color:var(--y)}
.btnrow{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.btnrow.end{justify-content:flex-end}
.nav-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between;align-items:center;margin-top:22px}
.nav-actions .btn:last-child{margin-left:auto}
.linkbtn{background:none;border:0;color:inherit;font:inherit;text-decoration:underline;cursor:pointer;min-height:44px;padding:0 4px}

/* lecture list */
.lectures{display:grid;gap:14px}
@media (min-width:700px){.lectures{grid-template-columns:1fr 1fr}}
.lec{display:flex;flex-direction:column;gap:6px}
.lec h3{font-size:1.2rem;margin:0}
.lec .meta{font-family:var(--mono);font-size:.85rem;color:var(--muted)}
.lec .btn{margin-top:auto}
.filebtn{position:relative}
.filebtn input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}
.filebtn:focus-within{outline:3px solid #000;outline-offset:3px;box-shadow:0 0 0 3px var(--y)}

/* forms */
label.q,legend.q{display:block;font-weight:700;font-size:1.08rem;margin-bottom:6px}
textarea,input[type=text]{width:100%;font:inherit;font-size:1.05rem;color:var(--text);background:var(--card);border:2px solid var(--line);border-radius:10px;padding:12px}
textarea{min-height:110px;resize:vertical}
textarea.notes{min-height:55vh;font-size:1.1rem;line-height:1.6}
fieldset{border:0;margin:0;padding:0;min-width:0}
.hint{font-size:.95rem;color:var(--muted);margin:-2px 0 8px}
dl.terms{margin:0;display:grid;gap:10px}
dl.terms dt{font-weight:700}
dl.terms dd{margin:0;color:var(--muted)}
dl.terms div{border-bottom:1px solid var(--soft);padding-bottom:8px}

/* number picker */
.nums{display:grid;grid-template-columns:repeat(auto-fill,minmax(56px,1fr));gap:8px}
.nums label{position:relative}
.nums input{position:absolute;opacity:0;inset:0}
.nums span{display:flex;align-items:center;justify-content:center;min-height:56px;border:2px solid #000;border-radius:10px;background:#fff;color:#000;font:700 1.2rem var(--mono);cursor:pointer}
.nums input:checked+span{background:#000;color:var(--y)}
.nums input:focus-visible+span{outline:3px solid #000;outline-offset:3px;box-shadow:0 0 0 3px var(--y)}

/* choice groups (Got it / Partly / Missed; Yes / Partly / Not yet) */
.choices{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.choices .btn{padding:8px 6px;min-height:56px}
.c-got{background:var(--y)!important;color:#000!important;border-color:#000!important}
.c-part{background:#fff!important;color:#000!important;border-color:#000!important}
.c-miss{background:#333!important;color:#fff!important;border-color:#333!important}
.choices .btn[aria-pressed="true"]{box-shadow:inset 0 0 0 4px #000;text-decoration:underline}
.choices .c-miss[aria-pressed="true"]{box-shadow:inset 0 0 0 4px var(--y)}

/* idea card */
.idea{font-size:1.25rem;font-weight:600;line-height:1.4;margin:6px 0 14px}
.dots{display:flex;gap:4px;flex-wrap:wrap;margin-top:6px}
.dots i{width:14px;height:14px;border-radius:3px;border:2px solid var(--y);display:block}
.dots i.done{background:var(--y)}
.dots i.now{background:#fff;border-color:#fff}

/* layout with notes beside */
.split{display:grid;gap:16px}
@media (min-width:900px){.split{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}.split .notespanel{position:sticky;top:12px;order:-1}}
.notespanel summary{cursor:pointer;font-weight:700;min-height:44px;display:flex;align-items:center}
.notesview{white-space:pre-wrap;word-wrap:break-word;max-height:45vh;overflow:auto;background:var(--soft);border-radius:8px;padding:12px;font-size:1rem}
@media (min-width:900px){.notesview{max-height:70vh}}
.photos{display:grid;gap:10px}
.photos button{padding:0;border:2px solid var(--line);border-radius:8px;background:var(--soft);cursor:zoom-in;display:block;width:100%}
.photos img{display:block;width:100%;max-height:60vh;object-fit:contain;border-radius:6px}
.thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px}
.thumbs figure{margin:0;border:2px solid var(--line);border-radius:10px;overflow:hidden;background:var(--card)}
.thumbs img{display:block;width:100%;height:150px;object-fit:cover}
.thumbs figcaption{padding:6px}

/* zoom dialog */
dialog.zoom{padding:0;border:0;width:100vw;height:100vh;max-width:none;max-height:none;margin:0;background:#000;color:#fff}
dialog.zoom::backdrop{background:rgba(0,0,0,.85)}
.zoom .zbar{position:sticky;top:0;display:flex;gap:8px;justify-content:flex-end;padding:8px;background:#000;z-index:1}
.zoom .zimg{overflow:auto;height:calc(100vh - 64px)}
.zoom img{display:block;width:100%;height:auto;margin:0 auto}
.zoom.big img{width:220%;max-width:none}

/* player */
.player{background:#000;color:#fff;border-radius:14px;padding:16px;border:2px solid #000}
.player .btnrow{margin-bottom:10px}
.player .stat{font-family:var(--mono);font-size:.9rem;color:#e8e8e8}
.speed{display:inline-flex;gap:6px;align-items:center}
audio{width:100%;margin-top:6px}

/* quiz */
.opts{display:grid;gap:8px}
.opt{display:flex;text-align:left;justify-content:flex-start;width:100%;background:#fff!important;color:#000!important;border:2px solid #000!important;font-weight:600}
.opt.right{background:var(--y)!important}
.opt.wrong{background:#333!important;color:#fff!important;border-color:#333!important}
.opt .mk{font-family:var(--mono);min-width:1.6em;flex:none}
.feedback{margin-top:12px}

/* review */
.script p{margin:0 0 12px}
.script .seg{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;padding:10px 0;border-bottom:1px solid var(--soft)}
.script .num{font:700 .85rem var(--mono);background:#000;color:var(--y);border-radius:6px;padding:4px 7px;margin-top:3px}
mark{background:var(--y);color:#000;padding:0 2px;border-radius:3px;font-weight:600}
.model ul{margin:4px 0 12px;padding-left:22px}
.model .h{font-weight:700;margin-top:10px;font-family:var(--mono);font-size:.98rem}
.replay-list{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.replay-list li{display:flex;gap:10px;align-items:flex-start;justify-content:space-between;border:1px solid var(--line);border-radius:10px;padding:10px}
.replay-list .t{flex:1}

/* stats */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}
.stat-box{background:#000;color:#fff;border-radius:12px;padding:14px;border:2px solid #000}
.stat-box .n{font:700 2rem/1 var(--mono);color:var(--y);display:block;margin:4px 0}
.stat-box .label{color:#fff}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips .btn{font-weight:600;text-align:left}

/* progress */
.hist{list-style:none;padding:0;margin:0;display:grid;gap:10px}
.hist li{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between}
.kv{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;margin:0}
.kv dt{font-family:var(--mono);font-size:.85rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);padding-top:2px}
.kv dd{margin:0}
.pre{white-space:pre-wrap;word-wrap:break-word}

footer.foot{border-top:4px solid var(--y);background:#000;color:#ddd;padding:20px 0 28px;font-size:.95rem}
footer.foot a{color:#fff;display:inline-flex;min-height:44px;align-items:center;margin-right:14px}

/* tips */
.tipex{display:grid;gap:8px;margin:10px 0}
.tipex div{display:grid;grid-template-columns:minmax(90px,auto) 1fr;gap:10px;align-items:baseline;border-bottom:1px solid var(--soft);padding-bottom:6px}
.tipex b{font-family:var(--mono)}

@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
@media (prefers-reduced-motion:no-preference){.btn{transition:background-color .15s,transform .1s}.btn:active{transform:translateY(1px)}}

@media print{
  body{background:#fff;color:#000;font-size:12pt}
  .top,.no-print,footer.foot,.why,.nav-actions,.skip{display:none!important}
  .band{background:#fff;color:#000;padding:0;border-bottom:3px solid #000}
  .band h1,.band h2,.band p,.band .muted{color:#000}
  .card{border:1px solid #000;break-inside:avoid}
  .photos img{max-height:none;page-break-inside:avoid}
  .notesview{max-height:none;overflow:visible;background:#fff;border:1px solid #000}
  .stat-box{background:#fff;color:#000;border:1px solid #000}.stat-box .n,.stat-box .label{color:#000}
  mark{background:#ff0!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
/* headings focused by the app (for screen readers) don't need a ring */
[tabindex="-1"]:focus{outline:none;box-shadow:none}
.player .btn[aria-pressed="true"]{border-color:var(--y)}
