/* VOICE calm, finite, a little strict. IDEA a printed TV programme for today, not a feed.
   PICTURE the day's meter + a short list that ends. COLOUR near-black/white, ultramarine as the one highlight;
   orange only for over budget, green only for learning. TYPE Roboto Flex; the slowww wordmark widens letter by letter.
   LAYOUT full width; card grid on wide screens; bottom tab bar with icons on phones. */
:root{color-scheme:light dark;--bg:light-dark(#fff,#121314);--ink:light-dark(#111,#eceae6);--mute:light-dark(#6b6b6b,#9a9893);--line:light-dark(#e3e3e3,#2a2b2d);--soft:light-dark(#f4f4f3,#1b1c1e);--hl:light-dark(#3f5cf2,#5470ff);--hl-ink:#fff;--hl-soft:light-dark(#e9edff,#1c2240);--learn:light-dark(#e8501a,#ff5a1f);--over:repeating-linear-gradient(135deg,var(--hl) 0 6px,light-dark(#9aaaf8,#2b3a99) 6px 10px);--err:light-dark(#c62828,#ff6b6b)}
*{box-sizing:border-box;min-width:0}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 "Roboto Flex",system-ui,sans-serif;overflow-x:clip;-webkit-text-size-adjust:100%}
a{color:inherit}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:8px 14px;min-height:40px}
button:hover{border-color:var(--ink)}
button:disabled{opacity:.5;cursor:default}
a.btnlink{display:inline-grid;place-items:center;text-decoration:none;border:1px solid var(--line);border-radius:8px;padding:0 14px;min-height:40px}
button.primary{background:var(--hl);color:var(--hl-ink);border-color:var(--hl);font-weight:600}
button.primary:hover{filter:brightness(1.08);border-color:var(--hl)}
button.icon{padding:6px;min-width:40px;display:inline-grid;place-items:center}
button.icon svg{width:20px;height:20px;fill:currentColor;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
button.linkbtn{border:0;background:none;padding:0;min-height:0;color:var(--hl);text-decoration:underline;font-weight:600}
button.warn{background:var(--ink);border-color:var(--ink);color:var(--bg);font-weight:600}
button.ghost{border-color:transparent;color:var(--mute);padding:8px 10px}
button.ghost:hover{color:var(--ink)}
input,select,textarea{border:1px solid var(--line);background:var(--bg);border-radius:8px;padding:9px 12px;min-height:42px;width:100%;font-size:16px}
textarea{line-height:1.5;resize:vertical}
:focus-visible{outline:2px solid var(--hl);outline-offset:2px}
.wrap{margin:0 auto;padding:0 max(3vw,16px)}
header{border-bottom:3px solid var(--ink);padding-top:calc(env(safe-area-inset-top) + 18px)}
.top{display:flex;gap:18px 28px;align-items:center;justify-content:space-between}
h1{font-weight:800;font-size:clamp(26px,4vw,40px);line-height:1;margin:0;letter-spacing:-.01em}
/* wordmark "slowing down": same weight, each w wider than the last */
.wm{white-space:nowrap;font-weight:800;letter-spacing:.005em}
.wm i{font-style:normal;display:inline-block;font-variation-settings:"wdth" var(--w,52),"opsz" 144}
.wm i:nth-child(4){--w:80;margin-left:.015em}.wm i:nth-child(5){--w:115;margin-left:.025em}.wm i:nth-child(6){--w:151;margin-left:.04em}
h1 small{display:block;font-stretch:100%;font-weight:400;font-size:12px;color:var(--mute);margin-top:4px;letter-spacing:0;white-space:nowrap}
.meter{flex:1 1 auto;min-width:0;max-width:460px}
.meter .read{display:flex;justify-content:space-between;gap:10px;font-size:14px;margin-bottom:6px}
.meter .read b{font-size:22px;font-stretch:115%}
.scale{position:relative;height:14px;background:var(--soft);border-radius:3px;overflow:hidden}
.scale i{position:absolute;inset:0 auto 0 0;background:var(--hl);transition:width .4s}
.scale i.over{background:var(--over)}
.scale u{position:absolute;left:0;bottom:0;height:4px;background:var(--learn);transition:width .4s}
#mLearn{color:var(--learn);font-weight:600}
nav{display:flex;gap:4px;margin-top:18px;overflow-x:auto}
nav a{flex:none;text-decoration:none;padding:9px 14px 9px 12px;border-radius:8px 8px 0 0;color:var(--mute);font-weight:600;white-space:nowrap;display:flex;align-items:center;gap:7px}
nav a:hover{color:var(--ink)}
nav svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round;flex:none}
nav a.dot span::after{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--hl);margin-left:5px;vertical-align:2px}
nav a[aria-current]{background:var(--ink);color:var(--bg)}
nav a[aria-current] svg{color:var(--hl)}
main.wrap{padding-top:30px;padding-bottom:80px}
h2{font-stretch:115%;font-size:26px;line-height:1.1;margin:0 0 6px}
.lede{color:var(--mute);margin:0 0 20px;max-width:62ch}
.bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:18px}
.bar .info{color:var(--mute);font-size:14px}
.chip{border-radius:99px;padding:6px 12px;min-height:34px;font-size:14px}
.chip[aria-pressed=true]{background:var(--hl);color:var(--hl-ink);border-color:var(--hl)}
.list{display:grid;gap:14px 28px;grid-template-columns:repeat(auto-fill,minmax(min(100%,560px),1fr))}
.card{display:grid;grid-template-columns:220px minmax(0,1fr);gap:16px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.thumb{position:relative;padding:0;border:0;border-radius:8px;overflow:hidden;aspect-ratio:16/9;background:var(--soft);align-self:start}
.thumb img{width:100%;height:100%;object-fit:cover;display:block;filter:grayscale(1) contrast(.95);transition:filter .3s}
.card:hover .thumb img{filter:none}
.prog{position:absolute;left:0;bottom:0;height:4px;background:var(--hl);border-radius:0 2px 2px 0}
.dur{position:absolute;right:6px;bottom:8px;background:#000c;color:#fff;font-size:12px;padding:1px 6px;border-radius:4px;white-space:nowrap}
.card h3{margin:0 0 4px;font-size:17px;line-height:1.3;font-weight:600}
.card p{margin:0;color:var(--mute);font-size:14px}
.card .why{position:relative;display:inline-block;max-width:100%;margin:12px 0 0;padding:7px 13px;border-radius:14px;background:var(--soft);color:var(--ink);font-size:14px;line-height:1.4}
.card .why::before{content:'';position:absolute;left:18px;top:-6px;border:6px solid transparent;border-top:0;border-bottom-color:var(--soft)}
.acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;align-items:center}
.vote{padding:6px 10px;min-width:44px;display:inline-grid;place-items:center}
.vote svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}
.vote[aria-pressed=true]{background:var(--hl);color:var(--hl-ink);border-color:var(--hl)}
.vote.down[aria-pressed=true]{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.empty{padding:36px 24px;border:1px dashed var(--line);border-radius:12px;text-align:center;color:var(--mute)}
.empty b{display:block;color:var(--ink);font-size:18px;margin-bottom:4px}
.end{margin-top:22px;padding:18px;text-align:center;color:var(--mute);border-top:3px double var(--line)}
.note{background:var(--soft);border-radius:10px;padding:12px 14px;font-size:15px;margin-bottom:18px}
.note.alert{background:var(--hl-soft)}
.note .acts{margin-top:8px}
form.row{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,2fr) auto;gap:8px;margin-bottom:20px}
form.row.two{grid-template-columns:minmax(0,1fr) auto}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px 20px}
label{display:block;font-size:14px;font-weight:600}
label span{display:block;font-weight:400;color:var(--mute);margin-bottom:4px}
section.box{border-top:1px solid var(--line);padding-top:22px;margin-top:28px}
h4{margin:0 0 10px;font-size:18px}
.chan{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:6px 0;border-bottom:1px solid var(--line);font-size:15px}
.chan small{color:var(--mute)}
.chan .acts{margin:0;flex:none}
.chan>span:first-child{min-width:0;overflow-wrap:anywhere}
.chan>button{flex:none}
.chan[hidden]{display:none}
.back{display:inline-block;color:var(--mute);text-decoration:none;font-weight:600;margin-bottom:10px}
.back:hover{color:var(--ink)}
.filebtn{margin:0}.filebtn span{display:inline-grid;place-items:center;border:1px solid var(--line);border-radius:8px;min-height:40px;padding:0 14px;cursor:pointer;font-weight:400;font-size:16px;color:var(--ink)}
.filebtn span:hover{border-color:var(--ink)}
/* ⋯ menu on cards */
.more{position:relative}
.menu{display:none;position:absolute;z-index:4;right:0;top:calc(100% + 4px);min-width:200px;background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:6px;box-shadow:0 12px 32px #0003}
.more.open .menu{display:grid}
.menu button{border:0;text-align:left;border-radius:6px;padding:10px 12px;min-height:40px;display:flex;justify-content:space-between;gap:12px}
.menu button:hover{background:var(--soft)}
.menu button span{color:var(--hl)}
.menu.stack{min-width:250px}.menu.stack button{flex-direction:column;align-items:flex-start;gap:2px}.menu.stack button span{color:var(--mute);font-size:13px}
.acts .more{margin-left:auto}
.learn{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 16px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}
.learn h3{margin:0;font-size:17px}.learn p{margin:2px 0 0;color:var(--mute);font-size:14px}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:24px}
.stat{background:var(--soft);border-radius:10px;padding:14px}
.stat b{display:block;font-size:30px;font-stretch:115%;line-height:1.1}
.stat span{font-size:13px;color:var(--mute)}
.days{display:grid;gap:8px}
.day{display:grid;grid-template-columns:70px minmax(0,1fr) 92px;gap:10px;align-items:center;font-size:14px}
.day .bars{position:relative;display:flex;height:12px}
.day .bars i{display:block;height:100%;background:var(--hl);border-radius:2px 0 0 2px;min-width:2px}
.day .bars i.over{background:var(--over)}
.day .bars u{display:block;height:100%;background:var(--learn);border-radius:0 2px 2px 0}
.legend i.overkey{background:var(--over)}
.logform{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,120px) minmax(0,180px) auto;gap:10px;padding:12px;background:var(--soft);border-radius:10px;margin-top:6px}
@media(max-width:520px){.logform{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.logform .acts{grid-column:1/-1}}
.day .bars s{position:absolute;top:-3px;bottom:-3px;border-left:1px dashed var(--mute)}
.day em{font-style:normal;text-align:right;white-space:nowrap;color:var(--mute)}
.legend{display:flex;flex-wrap:wrap;gap:16px;font-size:13px;color:var(--mute);margin:10px 0 0}
.legend i{display:inline-block;width:12px;height:8px;margin-right:6px;vertical-align:middle}
.persona{white-space:pre-wrap}
.notes{white-space:pre-wrap;margin:10px 0 4px;font-size:14px;max-height:240px;overflow:auto;color:var(--ink)}
.dlg p{margin:0 0 6px}
.queries{display:grid;gap:8px}
.q{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:8px 0;border-bottom:1px solid var(--line);font-size:15px}
.q b{font-weight:600}.q span{color:var(--mute);font-size:14px;grid-column:1}.q em{font-style:normal;color:var(--mute);font-size:13px;white-space:nowrap;grid-row:1;grid-column:2}
details{margin-top:18px}
details summary{cursor:pointer;font-weight:600;min-height:32px}
details ol{padding-left:20px}
details ol li{margin-bottom:10px}
code{font-size:14px;background:var(--soft);padding:1px 5px;border-radius:4px;overflow-wrap:anywhere}
.busy{display:inline-block;width:14px;height:14px;border:2px solid var(--line);border-top-color:var(--ink);border-radius:50%;animation:spin 1s linear infinite;vertical-align:-2px;margin-right:6px}
@keyframes spin{to{transform:rotate(1turn)}}
/* login */
.login{min-height:100vh;display:grid;place-items:center;padding:24px}
.login form{width:min(360px,100%);display:grid;gap:12px}
.login h1{font-size:44px}.login p{color:var(--mute);margin:0 0 8px}.login .err{color:var(--err)}
/* player */
#player{position:fixed;inset:0;background:#0b0b0b;color:#eee;display:none;flex-direction:column;z-index:10;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
#player.on{display:flex}
#player .ph{display:flex;gap:16px;align-items:center;justify-content:space-between;padding:12px max(3vw,14px)}
#player .ph h3{margin:0;font-size:16px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#player .ph p{margin:0;font-size:13px;color:#aaa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#player button{background:#1c1c1c;border-color:#333;color:#eee;flex:none}
#player button.primary{background:#5470ff;border-color:#5470ff;color:#fff}
#player .vote[aria-pressed=true]{background:#5470ff;border-color:#5470ff;color:#fff}
.stage{flex:1;display:grid;place-items:center;padding:0 max(3vw,14px) 20px;overflow:auto}
.frame{width:min(100%,calc((100vh - 120px)*16/9));aspect-ratio:16/9;background:#000}
.frame iframe,.frame>div{width:100%;height:100%;border:0;display:block}
.done{max-width:560px;width:100%;text-align:center}
.done h2{font-size:30px}.done p{color:#aaa}
.done .learn{border-color:#2a2a2a;text-align:left}.done .learn p{color:#999}
.done .acts{justify-content:center}
#budgetHit{display:none;background:#3f5cf2;color:#fff;text-align:center;padding:6px;font-size:14px}
dialog{border:0;border-radius:14px;padding:0;max-width:520px;width:calc(100% - 32px);max-height:calc(100% - 32px);background:var(--bg);color:var(--ink);box-shadow:0 30px 80px #0006}
dialog::backdrop{background:#000a}
.dlg{padding:24px}
.dlg h3{margin:0 0 4px;font-size:20px;line-height:1.25}
.dlg .sub{color:var(--mute);font-size:14px;margin:0 0 16px}
.intents{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 18px}
.dlg .acts{justify-content:flex-end;margin-top:18px}
.dlghead{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px}
.dlghead h3{margin:0}
.guide{padding-left:20px;margin:0}.guide li{margin-bottom:12px}
#toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:8px;font-size:14px;opacity:0;pointer-events:none;transition:opacity .2s;z-index:20;max-width:calc(100% - 32px)}
#toast.on{opacity:1}
@media(max-width:700px){
  .top{gap:16px}.meter .read{font-size:12px;margin-bottom:4px}.meter .read b{font-size:17px}.scale{height:10px}
  h1{font-size:28px}
  nav{position:fixed;left:12px;right:12px;bottom:max(12px,calc(env(safe-area-inset-bottom) - 8px));z-index:5;margin:0 auto;max-width:480px;gap:0;justify-content:space-between;background:color-mix(in srgb,var(--soft) 88%,transparent);backdrop-filter:blur(16px) saturate(1.4);-webkit-backdrop-filter:blur(16px) saturate(1.4);border:1px solid var(--line);border-radius:30px;padding:6px 4px;box-shadow:0 8px 28px #0003}
  nav a{flex:1 1 0;flex-direction:column;gap:3px;font-size:11px;font-weight:600;padding:2px 0;border-radius:0;background:none!important;color:var(--mute)}
  nav a svg{width:52px;height:30px;padding:5px 15px;border-radius:15px;box-sizing:border-box;transition:background .2s}
  nav a[aria-current]{color:var(--ink)}
  nav a[aria-current] svg{background:var(--hl);color:var(--hl-ink)}
  nav a.dot span::after{position:absolute;margin:2px 0 0 2px}
  header{padding-bottom:12px;padding-top:calc(env(safe-area-inset-top) + 14px)}
  main.wrap{padding-bottom:calc(100px + env(safe-area-inset-bottom))}
  #toast{bottom:calc(90px + env(safe-area-inset-bottom))}
  .card{grid-template-columns:minmax(0,1fr)}
  form.row{grid-template-columns:minmax(0,1fr)}
  .day{grid-template-columns:52px minmax(0,1fr) 74px}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* v0.4: header rows, segmented control, icon buttons */
.headrow{display:flex;align-items:center;gap:12px 18px;flex-wrap:wrap;margin-bottom:6px}
.headrow h2{margin:0}
.headrow .tools{margin-left:auto;display:flex;gap:6px}
.seg{display:inline-flex;background:var(--soft);border-radius:10px;padding:3px}
.seg a{text-decoration:none;padding:7px 16px;border-radius:8px;font-weight:600;font-size:15px;color:var(--mute)}
.seg a[aria-selected=true]{background:var(--bg);color:var(--ink);box-shadow:0 1px 3px #0002}
.iconbtn{display:inline-grid;place-items:center;width:42px;height:42px;padding:0;border-radius:50%;min-height:0}
a.iconbtn{border:1px solid var(--line)}
.i{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
button.icon svg.i{fill:none}
.act{display:inline-flex;align-items:center;gap:6px;padding:8px 12px}
.act.icononly{padding:8px 10px}
.act .sm{display:none}
.filters{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 14px}
.fchip{display:inline-flex;align-items:center;gap:0}
.act.saved{color:var(--hl);border-color:var(--hl)}
.ask{font-size:14px;color:var(--mute);margin-right:4px}
/* rated cards: short countdown with undo */
.card.gone{display:block;padding:0;border:0}
.gonebar{position:relative;overflow:hidden;display:flex;align-items:center;gap:12px;background:var(--soft);border-radius:10px;padding:12px 14px;min-height:56px}
.gonebar span:first-child{font-weight:600;white-space:nowrap}
.gonebar .gtitle{color:var(--mute);font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.gonebar button{flex:none}
.countdown{position:absolute;left:0;bottom:0;height:3px;width:100%;background:var(--hl);transform-origin:left;animation:countdown linear forwards}
@keyframes countdown{from{transform:scaleX(1)}to{transform:scaleX(0)}}
/* taste */
.profile{margin:0;padding-left:20px;display:grid;gap:6px;max-width:80ch}
.kind{display:inline-block;padding:1px 8px;border-radius:99px;background:var(--soft);color:var(--ink);font-size:12px}
.kind.core{background:var(--hl-soft);color:var(--hl)}
.kind.wildcard{background:color-mix(in srgb,var(--learn) 16%,var(--bg));color:var(--learn)}
.stackform{display:grid;gap:12px}
.stackform .acts{justify-content:flex-end}
@media(max-width:700px){
  .learn{grid-template-columns:minmax(0,1fr)}
  .learn .acts{flex-wrap:wrap}
  .headrow .seg{order:3;width:100%}
  .seg a{flex:1;text-align:center}
  .act .lg{display:none}.act .sm{display:inline}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:8px}.stat{padding:10px 12px}.stat b{font-size:21px}.stat span{font-size:12px;line-height:1.3;display:block}
  .card .acts{gap:5px}.act{padding:8px 7px;gap:3px}.act.icononly{padding:8px 8px}.card .acts .primary{padding-left:12px;padding-right:12px}
  .filters{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-right:-16px;padding-right:16px}
  .filters::-webkit-scrollbar{display:none}
  .fchip{flex:none}
}
.fchip .gdot{width:10px;height:10px;margin-right:7px}
.fchip[aria-pressed=true] .gdot{box-shadow:0 0 0 1.5px var(--hl-ink)}
.searchrow{margin:4px 0 14px}
@media(prefers-reduced-motion:reduce){.countdown{animation:none}}

/* v0.5: taste map */
.tlegend{display:flex;flex-wrap:wrap;gap:8px 16px;font-size:14px;color:var(--mute);margin:4px 0 10px}
.tlegend i{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:6px;vertical-align:-1px}
.tlegend .newkey{border:1.4px dashed var(--mute)}.tlegend .dormkey{background:var(--mute);opacity:.45}
.tmap{background:var(--soft);border-radius:14px;padding:6px;color:var(--ink)}
.tmap svg{display:block;width:100%;height:auto;max-height:78vh}
.tmap .b{cursor:pointer;transition:opacity .15s;outline:none}
.tmap .b:focus-visible circle:last-of-type{stroke:var(--ink);stroke-width:2}
.tmap .th{transition:opacity .15s}
.tmap svg.dim .b:not(.hot){opacity:.22!important}.tmap svg.dim .th:not(.hot){opacity:.3}
.tmap text{pointer-events:none}
.tpanel{padding:12px 2px 4px}
.youhead{margin-top:26px}
.tpanel p{margin:0 0 4px;color:var(--mute);font-size:15px}
.tpanel .crumb{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-size:17px;font-weight:600;margin-bottom:6px}
.tpanel .crumb i,.gdot{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:6px;vertical-align:-1px}
.tpanel .crumb .sep{color:var(--mute);font-weight:400}
.sr{position:absolute;left:-9999px}
