/* SpeechTool v2 — tablet-first redesign (Figma "SpeechTool — Redesign v2").
   Loaded last; overrides the earlier layers. Tokens come straight from the Figma file. */
:root{
  --v2-green:#165E4D;--v2-green-2:#23836B;--v2-mint:#A9D8B8;--v2-rail-ink:#E3F1E9;
  --v2-cream:#FBF7F0;--v2-oat:#F6EFE3;--v2-sand-line:#ECD6B6;--v2-line:#EDE4D8;--v2-pill-line:#E7DCCB;
  --v2-ink:#2A1B2C;--v2-ink-2:#3D2E3F;--v2-muted:#7C7072;
  --v2-strip-shadow:0 8px 24px rgba(161,110,41,.10);
  --v2-card-shadow:0 6px 9px rgba(41,26,43,.07);
  --v2-sel-shadow:0 10px 13px rgba(28,110,89,.28);
  --focus:0 0 0 4px #fff,0 0 0 7px #23836B;
}
html,body{background:var(--v2-cream)}
body{color:var(--v2-ink)}

/* ───── Shell ───── */
.app{display:grid;grid-template-columns:104px minmax(0,1fr);min-height:100vh;background:var(--v2-cream)}
.side{display:none}
.rail{position:sticky;top:0;height:100vh;height:100dvh;background:var(--v2-green);display:flex;flex-direction:column;align-items:center;gap:6px;padding:18px 10px;padding-top:calc(18px + env(safe-area-inset-top));padding-bottom:calc(18px + env(safe-area-inset-bottom));z-index:20}
.rail-logo{width:56px;height:56px;border-radius:18px;background:var(--v2-mint);display:grid;place-items:center;flex-shrink:0;margin-bottom:12px}
.rail-nav{display:flex;flex-direction:column;gap:6px;overflow-y:auto;scrollbar-width:none;min-height:0}
.rail-nav::-webkit-scrollbar{display:none}
.rail-foot{margin-top:auto;display:flex;flex-direction:column;gap:6px;padding-top:6px}
.rail-item{width:84px;min-height:72px;flex-shrink:0;border-radius:20px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:6px 4px;color:var(--v2-rail-ink);font-size:13px;font-weight:800;line-height:1.1;text-align:center;transition:background .15s}
.rail-item svg.i{width:26px;height:26px;stroke-width:1.9}
.rail-item>span{max-width:76px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rail-item:hover{background:rgba(255,255,255,.09)}
.rail-item.active{background:#fff;color:var(--v2-green)}
.rail-item .avatar{width:28px;height:28px}
.rail-item:focus-visible{box-shadow:0 0 0 3px var(--v2-green),0 0 0 6px #fff!important;border-radius:20px}

.main{display:flex;flex-direction:column;min-width:0}
.topbar{display:none}
.content{width:100%;max-width:none;margin:0;padding:20px 28px 22px;padding-top:calc(20px + env(safe-area-inset-top));display:flex;flex-direction:column;gap:18px}

/* Edit banner */
.edit-banner{margin:0;padding:12px 16px;border:1.5px solid #ECD07B;border-radius:18px;background:#FFF7D9;color:#5E4600;font-size:14px;font-weight:700;line-height:1.45}
.edit-banner>span:first-child svg{width:20px;height:20px}
.edit-banner-actions button{border:1.5px solid #ECD07B;background:#fff;color:#5E4600;border-radius:12px;padding:8px 12px;font-size:13px;font-weight:800}
.edit-banner-actions button:last-child{background:var(--v2-green);border-color:var(--v2-green);color:#fff}

/* ───── Sentence strip ───── */
.words{display:flex;align-items:center;gap:14px;padding:12px;background:#fff;border:1.5px solid var(--v2-sand-line);border-radius:26px;box-shadow:var(--v2-strip-shadow);min-height:91px;transition:border-color .2s,box-shadow .2s}
.words.speaking{border-color:var(--v2-green-2);box-shadow:0 0 0 4px #E2F2E7,var(--v2-strip-shadow)}
.chosen{display:flex;align-items:center;gap:10px;padding:8px 16px 8px 8px;border-radius:18px;background:var(--bg);flex-shrink:0;max-width:230px}
.chosen-tile{width:44px;height:44px;border-radius:12px;background:var(--t);display:grid;place-items:center;font-size:26px;line-height:1;overflow:hidden;flex-shrink:0}
.chosen-tile svg.i{width:26px;height:26px;stroke-width:1.9;color:var(--v2-ink)}
.chosen-tile img{width:100%;height:100%;object-fit:cover}
.chosen-lbl{font-size:18px;font-weight:800;color:var(--v2-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.words-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.words .words-line{font-size:28px;font-weight:800;line-height:1.2;color:var(--v2-ink);margin:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.words .words-line.is-empty{font-size:22px;font-weight:700;color:#9B8C80}
.words.typing .words-line{display:none}
.type-row textarea{width:100%;min-height:52px;max-height:120px;resize:none;border:2px solid var(--v2-line);border-radius:16px;padding:11px 14px;background:#FFFEFC;font-family:inherit;font-size:22px;font-weight:800;color:var(--v2-ink);outline:none;line-height:1.3}
.type-row textarea:focus{border-color:var(--v2-green-2);box-shadow:0 0 0 4px #E2F2E7}
.type-row textarea::placeholder{color:#A69A8D;font-weight:700}
.speaking-ind{display:none;align-items:center;gap:4px;height:19px;color:var(--v2-green-2);font-size:14px;font-weight:700}
.words.speaking .speaking-ind{display:flex}
.speaking-ind i{display:block;width:4px;height:10px;border-radius:2px;background:var(--v2-green-2);animation:eq .9s ease-in-out infinite}
.speaking-ind i:nth-child(1){height:8px;animation-delay:-.2s}.speaking-ind i:nth-child(2){height:14px;animation-delay:-.5s}.speaking-ind i:nth-child(3){height:10px;animation-delay:-.1s}.speaking-ind i:nth-child(4){height:16px;animation-delay:-.7s}.speaking-ind i:nth-child(5){height:9px;animation-delay:-.35s}
.speaking-ind span{margin-left:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@keyframes eq{0%,100%{transform:scaleY(.55)}50%{transform:scaleY(1.15)}}
.strip-actions{display:flex;align-items:center;gap:14px;flex-shrink:0}
.strip-btn,.words .btn-clear{width:56px;height:56px;border-radius:18px;background:var(--v2-oat);color:var(--v2-ink);display:grid;place-items:center;flex-shrink:0;transition:background .15s}
.strip-btn:hover,.words .btn-clear:hover{background:#EFE4D2;color:var(--v2-ink)}
.strip-btn svg.i{width:26px;height:26px;stroke-width:1.9}
.strip-btn[aria-pressed="true"]{background:#E2F2E7;color:var(--v2-green)}
.words .btn-speak{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:64px;padding:17px 30px 17px 26px;border-radius:20px;background:var(--v2-green);color:#fff;font-size:22px;font-weight:900;box-shadow:none;animation:none}
.words .btn-speak:hover{background:#12503F}
.words .btn-speak svg.i{width:26px;height:26px;stroke-width:2}
.words.speaking .btn-speak{background:var(--v2-green-2);animation:none}

/* ───── Quick words ───── */
.quickwords{display:flex;align-items:center;gap:10px;overflow-x:auto;scrollbar-width:none;margin:0 -4px;padding:2px 4px}
.quickwords::-webkit-scrollbar{display:none}
.q-lbl{font-size:13px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--v2-muted);flex-shrink:0;margin-right:2px}
.qw{flex-shrink:0;padding:12px 22px;border-radius:999px;background:#fff;border:1.5px solid var(--v2-pill-line);font-size:19px;font-weight:800;color:var(--v2-ink);transition:transform .12s,filter .15s}
.qw[class*="c-"]{background:var(--bg);border-color:var(--b)}
.qw:hover{filter:brightness(.98)}
.qw:active{transform:scale(.96)}
.qw:focus-visible{border-radius:999px}

/* ───── Section heading ───── */
.sec-head{display:flex;align-items:center;gap:12px;margin:0;flex-wrap:wrap}
.sec-head h1{font-size:34px;font-weight:900;letter-spacing:-.02em;line-height:1.2;color:var(--v2-ink);margin:0}
.sec-head .eyebrow{display:none}
.sec-head .tools{margin-left:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.timer-intro{display:none}
.edit-btn{display:inline-flex;align-items:center;gap:8px;padding:10px 16px 10px 14px;border-radius:14px;background:#fff;border:1.5px solid var(--v2-line);color:var(--v2-ink-2);font-size:15px;font-weight:800;min-height:43px}
.edit-btn svg.i{width:18px;height:18px}
.edit-btn:hover{border-color:#DCCDB8}
.edit-btn.on{background:var(--v2-green);border-color:var(--v2-green);color:#fff}
.chip{padding:10px 16px;border-radius:999px;background:#fff;border:1.5px solid var(--v2-line);color:var(--v2-ink-2);font-size:15px;font-weight:800;min-height:43px}
.chip.active{background:var(--v2-green);border-color:var(--v2-green);color:#fff}
.btn-soft{background:#E2F2E7;color:var(--v2-green)}

/* ───── Picture cards ───── */
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.card{--sel:var(--v2-green-2);position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;min-height:220px;padding:22px 16px 20px;border:2px solid var(--b);border-radius:28px;background:var(--bg);box-shadow:var(--v2-card-shadow);text-align:center;transition:transform .16s ease,box-shadow .16s ease,border-color .16s}
.card:hover{transform:translateY(-2px);box-shadow:0 10px 18px rgba(41,26,43,.09)}
.card:active{transform:scale(.985)}
.card.sel{border:4px solid var(--sel);padding:20px 14px 18px;box-shadow:var(--v2-sel-shadow)}
.card .tile{width:112px;height:112px;border-radius:30px;background:var(--t);display:grid;place-items:center;font-size:58px;line-height:1;flex-shrink:0}
.card .tile svg.i{width:60px;height:60px;stroke-width:1.6;color:var(--v2-ink)}
.card .lbl{font-size:26px;font-weight:800;letter-spacing:0;line-height:1.15;color:var(--v2-ink);overflow-wrap:anywhere}
.card.has-photo{justify-content:flex-start;gap:12px;padding:12px 12px 16px}
.card.has-photo.sel{padding:10px 10px 14px}
.card .photo{width:100%;flex:1 1 auto;min-height:96px;aspect-ratio:auto;border-radius:20px;background:var(--t);overflow:hidden;display:grid;place-items:center;font-size:52px}
.card .photo img{width:100%;height:100%;object-fit:cover}
.card .photo img.contain{object-fit:contain;padding:14px;background:#fff}
.card.has-photo .lbl{font-size:22px}
.card-btn{position:absolute;top:12px;width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:rgba(255,255,255,.9);color:var(--v2-ink-2);box-shadow:0 2px 6px rgba(0,0,0,.06);z-index:2}
.card-btn.fav{left:12px;color:#B9A27A}
.card-btn.fav.on{background:#FFD45C;color:#7A5300}
.card-btn.edit{right:12px;background:var(--v2-green);color:#fff}
.card.add{border:2px dashed #C9BBA6;background:transparent;box-shadow:none}
.card.add .tile{background:#fff;color:var(--v2-green-2)}
.card.add .tile svg.i{width:44px;height:44px}
.card.add .lbl{font-size:20px;color:var(--v2-muted)}
.empty{border-radius:28px}

/* On tablets and larger, card screens fill the screen: no page scroll for six cards. */
@media (min-width:861px){
  body[data-screen="cards"] .main{height:100vh;height:100dvh;overflow:hidden}
  body[data-screen="cards"] .content{flex:1;min-height:0}
  body[data-screen="cards"] #view{flex:1;min-height:0;display:flex;flex-direction:column;gap:18px}
  body[data-screen="cards"] .grid{flex:1;min-height:0;overflow-y:auto;grid-auto-rows:minmax(200px,1fr);margin:-6px;padding:6px 6px 8px;overscroll-behavior:contain}
  .grid.many{grid-auto-rows:minmax(220px,1fr)}
}
/* No 4-column switch for big boards: a card's spot must not depend on how many cards there are. */
@media (min-width:861px) and (max-height:700px){
  body[data-screen="cards"] .main{height:auto;overflow:visible}
  body[data-screen="cards"] .grid{overflow:visible;grid-auto-rows:minmax(200px,auto)}
}

/* Strip and quick words are hidden on Settings */
body[data-screen="settings"] .words,body[data-screen="settings"] .quickwords{display:none}

/* ───── Shared surfaces (Timers, My day, Goals, Settings) ───── */
.panel,.journey,.visual-timer{background:#fff;border:1.5px solid var(--v2-line);border-radius:26px;box-shadow:var(--v2-card-shadow)}
.panel{padding:24px}
.panel h2,.journey h2{font-size:22px;font-weight:900;color:var(--v2-ink)}
.panel .sub,.journey .sub{color:var(--v2-muted)}
.btn{border-radius:16px;font-weight:800;min-height:48px}
.btn-primary{background:var(--v2-green);color:#fff}
.btn-ghost{background:#fff;border:1.5px solid var(--v2-line);color:var(--v2-ink-2)}
.step{background:var(--v2-cream);border:1.5px solid var(--v2-line);border-radius:20px;min-height:64px}
.step .st-title{font-size:19px}
.step.done .chk{background:var(--v2-green-2);border-color:var(--v2-green-2)}
.pbar i,.track>i{background:var(--v2-green-2)}
.visual-timer{padding:22px 20px 18px}
.timer-countdown,.t-display{color:var(--v2-green)}
.timer-progress span{background:var(--v2-green-2)}
.timer-preset{border:1.5px solid var(--v2-pill-line);background:#fff;color:var(--v2-ink-2);font-size:14px;min-height:44px}
.timer-preset.active{background:var(--v2-green);border-color:var(--v2-green);color:#fff}
.bank{background:var(--v2-green);border-radius:28px;box-shadow:0 14px 30px rgba(22,94,77,.22)}
.bank .eyebrow{color:var(--v2-mint)}
.quick button{border-radius:16px;min-height:52px}
.goal{border-radius:28px;box-shadow:var(--v2-card-shadow)}
.goal.unlocked{border:4px solid var(--v2-green-2);box-shadow:var(--v2-sel-shadow)}
.goal .tile{background:var(--t)}
.goal .gbar i{background:var(--v2-green-2)}
.goal .card-btn.snd{right:16px;top:16px}
.add-goal{border-radius:28px}
.node.hit .n-dot{background:var(--v2-green-2);border-color:var(--v2-green-2)}
.toggle.on{background:var(--v2-green-2)}
.settings{gap:18px}
.field input,.field select,.field textarea{border:1.5px solid var(--v2-line);border-radius:14px;background:#fff;min-height:48px}

/* Modal */
.sheet{background:#fff;border:1.5px solid var(--v2-line);border-radius:28px}
.sheet h2{color:var(--v2-ink)}
.tabs{background:var(--v2-oat)}
.tabs button.on{color:var(--v2-green)}
.picker button{background:var(--v2-oat)}
.picker button.on{border-color:var(--v2-green-2);background:#E2F2E7}
.keypad button{background:var(--v2-oat);height:64px;border-radius:18px}

.toast{background:var(--v2-green)}

/* ───── Phone (≤860px): top bar + stacked strip + bottom bar ───── */
.bnav{display:none}
@media (max-width:860px){
  .app{grid-template-columns:minmax(0,1fr)}
  .rail{display:none}
  .topbar{display:flex;align-items:center;gap:8px;position:sticky;top:0;z-index:30;min-height:0;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;background:rgba(251,247,240,.94);backdrop-filter:blur(10px);border-bottom:0}
  .topbar:before{display:none}
  .mbrand{display:flex;align-items:center;gap:8px;margin-right:auto;color:var(--v2-green);font-size:21px;font-weight:900;letter-spacing:-.02em;text-decoration:none}
  .mbrand img{width:36px;height:36px;border-radius:11px}
  .top-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:42px;height:42px;padding:0 10px;border-radius:13px;background:#fff;border:1px solid var(--v2-line);color:var(--v2-ink-2);font-size:14px;font-weight:800}
  .top-btn svg.i{width:20px;height:20px}
  .top-btn .avatar{width:26px;height:26px}
  .content{padding:6px 16px calc(110px + env(safe-area-inset-bottom));gap:12px}
  .words{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;padding:12px;border-radius:22px;min-height:0}
  .chosen{padding:0;background:none;border-radius:12px}
  .chosen-lbl{display:none}
  .words-txt{grid-column:2}
  .chosen[hidden]+.words-txt{grid-column:1/-1}
  .strip-actions{grid-column:1/-1}
  .words .words-line{font-size:20px;min-height:44px;display:flex;align-items:center;-webkit-line-clamp:unset}
  .words .words-line.is-empty{font-size:17px}
  .strip-actions{gap:8px}
  .strip-btn,.words .btn-clear{width:50px;height:50px;border-radius:16px}
  .strip-btn svg.i{width:22px;height:22px}
  .words .btn-speak{flex:1;min-height:54px;padding:14px;border-radius:16px;font-size:19px}
  .words .btn-speak svg.i{width:22px;height:22px}
  .type-row textarea{font-size:19px}
  .qw{padding:12px 20px;font-size:18px}
  .q-lbl{display:none}
  .sec-head h1{font-size:26px}
  .edit-btn span{display:none}
  .edit-btn{padding:10px 12px}
  .chip{font-size:14px;padding:9px 13px;min-height:42px}
  .grid,.grid.many{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .card{min-height:118px;gap:6px;padding:10px 12px;border-radius:22px}
  .card.sel{padding:8px 10px}
  .card .tile{width:58px;height:58px;border-radius:18px;font-size:32px}
  .card .tile svg.i{width:32px;height:32px}
  .card .lbl{font-size:19px}
  .card.has-photo{padding:8px 8px 10px;gap:8px}
  .card .photo{aspect-ratio:16/10;flex:none;min-height:0;border-radius:15px}
  .card.has-photo .lbl{font-size:17px}
  .card-btn{width:34px;height:34px;top:8px;border-radius:11px}
  .card-btn.fav{left:8px}.card-btn.edit{right:8px}
  .card.add{min-height:118px}
  .card.add .tile svg.i{width:30px;height:30px}
  .card.add .lbl{font-size:16px}
  .bnav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:40;background:var(--v2-green);padding:6px 6px calc(10px + env(safe-area-inset-bottom));gap:0;overflow-x:auto;scrollbar-width:none;box-shadow:none}
  .bnav::-webkit-scrollbar{display:none}
  .bnav button{flex:1 0 63px;min-width:63px;height:62px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:4px 2px;border-radius:20px;color:var(--v2-rail-ink);font-size:13px;font-weight:800;white-space:nowrap}
  .bnav button svg.i{width:26px;height:26px;stroke-width:1.9}
  .bnav button.active{background:#fff;color:var(--v2-green)}
  .bnav button span{max-width:60px;overflow:hidden;text-overflow:ellipsis}
  .toast{bottom:calc(100px + env(safe-area-inset-bottom))}
}
@media (max-width:360px){.bnav button{font-size:11px}.card .lbl{font-size:17px}}
@media (prefers-reduced-motion:reduce){.speaking-ind i{animation:none}.card,.qw{transition:none}}

/* Vertical rhythm for non-card screens */
body:not([data-screen="cards"]) #view>*+*{margin-top:18px}
body:not([data-screen="cards"]) #view>.sec-head+*{margin-top:16px}

/* My day: routine only (timers live on the Timers screen) */
.day{grid-template-columns:minmax(0,820px);justify-content:start}

/* Timer photos */
.timer-photo{width:100%;max-width:240px;aspect-ratio:4/3;margin:8px auto 4px;border-radius:20px;overflow:hidden;background:var(--v2-oat)}
.timer-photo img{width:100%;height:100%;object-fit:cover}

/* ── iOS app: Sign in with Apple / Google (Apple HIG: Apple button at least as prominent) ── */
.st-social{display:flex;flex-direction:column;gap:10px;margin:4px 0 6px}
.st-social .btn{justify-content:center;gap:10px;min-height:52px;border-radius:14px;font-size:17px;font-weight:800}
.st-apple{background:#000;color:#fff;border:0}
.st-apple:hover{background:#1d1d1f}
.st-google{background:#fff;color:#1f1f1f;border:1.5px solid #dadce0}
.st-google:hover{background:#f8f9fa}
.st-or{display:flex;align-items:center;gap:12px;margin:14px 0 10px;color:var(--muted,#7c7072);font-weight:800;font-size:12px;letter-spacing:.08em}
.st-or span{flex:1;height:1px;background:var(--line,#e7dccb)}


/* ───────── Word variations ───────── */
.card-btn.var{top:auto;bottom:12px;right:12px;left:auto;width:40px;height:40px;border-radius:14px;color:var(--v2-green)}
.var-btn{width:auto!important;padding:0 16px;gap:8px;display:inline-flex!important;align-items:center;font-weight:800;font-size:15px;color:var(--v2-green)}
.var-btn[hidden]{display:none!important}
.sheet.wide{max-width:min(980px,calc(100vw - 32px))}
.sheet .sub{color:var(--v2-ink-2,#5c4f5d);font-weight:600;margin:-4px 0 16px}
.vh-ic{font-size:28px;margin-right:4px}
.vcols{display:grid;grid-template-columns:repeat(var(--n),minmax(140px,1fr));gap:12px;overflow-x:auto;padding-bottom:4px}
.vcol{background:var(--v2-cream);border:1.5px solid var(--v2-line);border-radius:20px;padding:14px;display:flex;flex-direction:column;gap:8px;min-width:140px}
.vcol.home{background:#E9F5EE;border-color:#A9D8B8}
.vcol-h{display:flex;align-items:center;gap:8px;font-weight:900;font-size:15px;color:var(--v2-ink);padding-bottom:8px;border-bottom:1.5px dashed var(--v2-line);flex-wrap:wrap}
.rg-flag{font-size:22px;line-height:1}
.home-tag{margin-left:auto;font-size:11px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;background:var(--v2-green);color:#fff;border-radius:99px;padding:3px 8px}
.vw{display:flex;align-items:center;gap:8px;min-height:48px;padding:8px 12px;border-radius:14px;background:#fff;border:1.5px solid var(--v2-line);font:800 17px/1.2 Nunito,system-ui,sans-serif;color:var(--v2-ink);text-align:left;width:100%}
.vw svg.i{width:18px;height:18px;flex-shrink:0;color:var(--v2-green-2)}
.vw:hover{border-color:var(--v2-green-2)}
.vtable-wrap{overflow:auto;max-height:60vh;border:1.5px solid var(--v2-line);border-radius:18px}
.vtable{border-collapse:separate;border-spacing:0;width:100%;min-width:640px}
.vtable th,.vtable td{padding:8px;border-bottom:1px solid var(--v2-line);vertical-align:top;text-align:left}
.vtable thead th{position:sticky;top:0;background:var(--v2-oat);z-index:2;font-size:14px;white-space:nowrap}
.vtable thead th .rg-flag{margin-right:6px;font-size:18px}
.vtable tbody th{position:sticky;left:0;background:#fff;z-index:1;font-size:15px;font-weight:900;white-space:nowrap}
.vtable thead th:first-child{left:0;z-index:3}
.vt-ic{font-size:20px;margin-right:6px}
.vtable td .vw{min-height:40px;font-size:15px;margin-bottom:6px}
.addons{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:8px}
.addon{display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 14px;border-radius:16px;background:var(--v2-cream);border:1.5px solid var(--v2-line);font:800 15px Nunito,system-ui,sans-serif;color:var(--v2-ink);text-align:left}
.addon span{font-size:22px}
.addon b{margin-left:auto;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#fff;color:var(--v2-green)}
.addon b svg.i{width:16px;height:16px}
.addon.on{background:#E9F5EE;border-color:var(--v2-green-2)}
.addon.on b{background:var(--v2-green-2);color:#fff}

/* ───────── My day: whole-day view ───────── */
.seg{display:inline-flex;background:var(--v2-oat);border-radius:16px;padding:4px;gap:4px}
.seg button{display:inline-flex;align-items:center;gap:8px;padding:9px 14px;border-radius:12px;font:800 15px Nunito,system-ui,sans-serif;color:var(--v2-ink-2,#5c4f5d)}
.seg button svg.i{width:18px;height:18px}
.seg button.on{background:#fff;color:var(--v2-green);box-shadow:0 1px 4px rgba(42,27,44,.1)}
body[data-screen="day"] .day{grid-template-columns:minmax(0,900px)}
.dayline{--gut:132px;padding:18px 18px 14px;margin-bottom:18px;overflow:hidden}
.dl-scroll{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
.dl-inner{min-width:760px;position:relative}
.dl-row{display:flex}
.dl-gut{width:var(--gut);flex-shrink:0}
.dl-sky{--sky-ground:#7FBF8E;position:relative;flex:1;height:118px;border-radius:22px 22px 8px 8px;overflow:hidden}
.dl-ground{position:absolute;left:0;right:0;bottom:0;height:20px;background:#7FBF8E;border-top:3px solid #6AAE7B}
.sky-ic{position:absolute;width:34px;height:34px;transform:translate(-50%,-50%);filter:drop-shadow(0 2px 3px rgba(0,0,0,.15))}
.sky-ic svg{width:100%;height:100%}
.sky-ic.sunrise,.sky-ic.sunset{--sky-ground:transparent}
.dl-kid{position:absolute;bottom:12px;width:52px;height:52px;transform:translateX(-50%);transition:left 1s ease}
.dl-kid .kid{width:100%;height:100%;overflow:visible}
.dl-kid.asleep{width:60px;height:60px;bottom:6px}
.kid-legs{animation:walk .9s ease-in-out infinite alternate;transform-origin:32px 44px}
.kid-body{animation:bob .45s ease-in-out infinite alternate}
@keyframes walk{from{transform:skewX(-10deg)}to{transform:skewX(10deg)}}
@keyframes bob{from{transform:translateY(0)}to{transform:translateY(-1.5px)}}
.kid-bubble{position:absolute;left:50%;bottom:100%;transform:translateX(-50%);margin-bottom:2px;background:#fff;border-radius:14px;padding:3px 7px;font-size:18px;line-height:1.2;box-shadow:0 2px 6px rgba(0,0,0,.15);white-space:nowrap}
.kid-bubble svg.i{width:18px;height:18px;vertical-align:-3px}
.kid-bubble::after{content:"";position:absolute;left:50%;top:100%;border:6px solid transparent;border-top-color:#fff;transform:translateX(-50%)}
.dl-axis{position:relative;flex:1;height:26px;font-size:12.5px;font-weight:800;color:var(--v2-ink-2,#6b5d6c)}
.dl-axis span{position:absolute;top:5px;transform:translateX(-50%);white-space:nowrap}
.dl-axis span:first-child{transform:none}.dl-axis span:last-child{transform:translateX(-100%)}
.dl-lanes{display:flex;flex-direction:column;gap:10px}
.dl-lane{display:flex;align-items:stretch;min-height:92px}
.dl-who{width:calc(var(--gut) - 12px);margin-right:12px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border-radius:20px;background:var(--bg,#E9F5EE);border:2px solid var(--b,#A9D8B8);font:900 15px Nunito,system-ui,sans-serif;color:var(--v2-ink);padding:6px;text-align:center}
.dl-who .who-ic{font-size:30px;line-height:1}
.dl-who .who-name{overflow:hidden;text-overflow:ellipsis;max-width:100%;white-space:nowrap}
.dl-who.add{background:#fff;border-style:dashed;border-color:#D8CCBA;color:var(--v2-green);font-size:14px}
.dl-who.add svg.i{width:24px;height:24px}
.dl-track{position:relative;flex:1;border-radius:18px;background:repeating-linear-gradient(135deg,#FBF7F0 0 8px,#F3ECDF 8px 10px);border:1.5px dashed #E2D6C4}
.dl-track.empty{display:flex;align-items:center;padding:0 18px;color:var(--v2-ink-2,#6b5d6c);font-weight:700;font-size:15px;background:#fff}
.chunk{position:absolute;top:6px;bottom:6px;container-type:inline-size;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border-radius:14px;background:var(--bg);border:2px solid var(--b);box-shadow:0 2px 0 var(--b);padding:4px 2px;overflow:hidden;font-family:Nunito,system-ui,sans-serif;color:var(--v2-ink);transition:transform .12s,box-shadow .12s;min-width:0}
.chunk:hover{transform:translateY(-1px)}
.chunk .ck-ic{font-size:24px;line-height:1}
.chunk .ck-ic svg.i{width:24px;height:24px}
.chunk .ck-t{font-weight:900;font-size:14px;line-height:1.1;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 4px}
.chunk .ck-time{font-weight:800;font-size:11.5px;color:rgba(42,27,44,.7);white-space:nowrap}
.chunk .ck-done{position:absolute;top:3px;right:3px;width:18px;height:18px;border-radius:50%;background:var(--v2-green-2);color:#fff;display:grid;place-items:center}
.chunk .ck-done svg.i{width:12px;height:12px;stroke-width:3}
@container (max-width:96px){.chunk .ck-time{display:none}}
@container (max-width:58px){.chunk .ck-t{display:none}.chunk .ck-ic{font-size:20px}}
.chunk.inner{top:auto;bottom:-1px;height:54%;z-index:2;border-radius:12px;box-shadow:0 -2px 8px rgba(42,27,44,.12);flex-direction:row;gap:4px}
.chunk.inner .ck-ic{font-size:18px}.chunk.inner .ck-time{display:none}
.chunk.past{opacity:.55;filter:saturate(.6)}
.chunk.done{opacity:.7}
.chunk.now{z-index:3;outline:4px solid var(--v2-green-2);outline-offset:1px;box-shadow:0 6px 16px rgba(35,131,107,.28)}
.chunk.inner.now{z-index:4}
.chunk.sel{outline:4px solid #2A1B2C;outline-offset:1px;z-index:5}
.dl-nowline{position:absolute;top:-8px;bottom:-8px;width:3px;margin-left:-1.5px;background:#E2574C;border-radius:2px;z-index:6;pointer-events:none}
.dl-nowline::before{content:"";position:absolute;top:-4px;left:50%;width:11px;height:11px;margin-left:-5.5px;border-radius:50%;background:#E2574C}
.dl-legend{display:flex;flex-wrap:wrap;gap:6px 18px;margin:14px 0 0 var(--gut);font-size:13px;font-weight:700;color:var(--v2-ink-2,#6b5d6c)}
.dl-legend span{display:inline-flex;align-items:center;gap:6px}
.lg{display:inline-block;width:22px;height:14px;border-radius:5px}
.lg.busy{background:#FDE1CF;border:2px solid #F4BE9E}
.lg.free{background:repeating-linear-gradient(135deg,#FBF7F0 0 4px,#E8DDCB 4px 6px);border:1.5px dashed #D8CCBA}
.lg.now{width:3px;height:16px;background:#E2574C;border-radius:2px}
.dl-now-panel h2{margin-bottom:10px}
.now-rows{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}
.now-row{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:18px;background:var(--v2-cream);border:1.5px solid var(--v2-line);font-size:16px;font-weight:700;color:var(--v2-ink)}
.now-row.busy{background:var(--bg);border-color:var(--b)}
.now-row .who-ic{font-size:26px}
.now-row .now-name{font-weight:900}
.now-row .now-ic{font-size:24px;margin-left:auto}
.now-row .now-ic svg.i{width:24px;height:24px}
.now-row .now-txt{flex-basis:100%;order:5;font-size:15px}
.now-row{flex-wrap:wrap}
.dl-detail{display:flex;align-items:center;gap:18px;margin-top:18px;background:var(--bg);border-color:var(--b)}
.dd-ic{width:84px;height:84px;border-radius:24px;background:#fff;display:grid;place-items:center;font-size:46px;flex-shrink:0}
.dd-ic svg.i{width:44px;height:44px}
.dd-info{flex:1;min-width:0}
.dd-info h2{font-size:26px;margin:2px 0}
.dd-time{font-weight:900;font-size:18px}
.dd-time span{font-weight:700;color:rgba(42,27,44,.65)}
.dd-state{font-weight:700;font-size:15px;margin:6px 0}
.dl-detail .pbar{background:rgba(255,255,255,.7)}
.dd-btns{display:flex;flex-direction:column;gap:8px}
.st-who{display:inline-flex;align-items:center;gap:4px;margin-left:8px;padding:1px 8px;border-radius:99px;background:var(--bg);border:1px solid var(--b);font-size:12px;font-weight:800;color:var(--v2-ink)}
.swatches{display:flex;flex-wrap:wrap;gap:8px}
.sw{width:40px;height:40px;border-radius:12px;background:var(--bg);border:2px solid var(--b)}
.sw.auto{width:auto;padding:0 12px;background:#fff;border:2px dashed #D8CCBA;font:800 13px Nunito,system-ui,sans-serif;color:var(--v2-ink)}
.sw.on{outline:3px solid var(--v2-green-2);outline-offset:2px}
.check-row{display:flex;align-items:center;gap:10px;font-weight:700;margin:6px 0 4px;color:var(--v2-ink)}
.check-row input{width:22px;height:22px;accent-color:var(--v2-green-2)}
.btn.danger{color:#B4382E;margin-right:auto}

/* ───────── Timer pictures ───────── */
.art-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px;max-height:260px;overflow:auto;padding:3px}
.art-opt{position:relative;cursor:pointer}
.art-opt input{position:absolute;opacity:0;pointer-events:none}
.art-box{display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 4px 8px;border-radius:16px;background:var(--v2-cream);border:2px solid transparent}
.art-box .timer-art{width:100%;height:58px}
.art-lbl{font-size:12.5px;font-weight:800;color:var(--v2-ink);text-align:center;line-height:1.15}
.art-opt input:checked+.art-box{border-color:var(--v2-green-2);background:#E2F2E7}
.art-opt input:focus-visible+.art-box{outline:3px solid var(--v2-green-2);outline-offset:2px}

@media (max-width:860px){
  .dayline{--gut:84px;padding:12px 10px 10px}
  .dl-inner{min-width:1000px}
  .dl-sky{height:100px}
  .dl-lane{min-height:84px}
  .dl-who{font-size:13px;border-radius:16px}
  .dl-who .who-ic{font-size:24px}
  .dl-legend{margin-left:0;font-size:12px}
  .seg button span{display:none}
  .seg button{padding:9px 12px}
  .dl-detail{flex-wrap:wrap}
  .dd-ic{width:64px;height:64px;font-size:36px;border-radius:18px}
  .dd-btns{flex-direction:row;flex-wrap:wrap;width:100%}
  .dd-btns .btn{flex:1}
  .vcols{grid-template-columns:repeat(var(--n),minmax(130px,1fr))}
  .var-btn span{display:none}
  .var-btn{padding:0!important;width:50px!important;justify-content:center}
  .card-btn.var{width:34px;height:34px;bottom:8px;right:8px;border-radius:11px}
}
@media (prefers-reduced-motion:reduce){.kid-legs,.kid-body{animation:none}.dl-kid{transition:none}}
.dl-who{position:sticky;left:0;z-index:8}
.chunk.inner{z-index:4}
.chunk.has-inner{justify-content:flex-start;padding-top:6px}
.chunk.has-inner .ck-ic{font-size:20px}
.dl-detail{margin:0 0 18px}
.dl-add{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:10px 16px;border-radius:18px;border:2px dashed #D8CCBA;background:#fff;color:var(--v2-green);font:800 15px Nunito,system-ui,sans-serif;text-align:left;position:sticky;left:0}
.dl-add svg.i{width:22px;height:22px;flex-shrink:0}
.art-opt,.art-lbl{text-transform:none;letter-spacing:0}
@media (max-width:860px){
  .vcols{grid-template-columns:repeat(var(--n),minmax(96px,1fr));gap:6px}
  .vcol{padding:8px;min-width:96px;border-radius:16px;gap:6px}
  .vcol-h{flex-direction:column;align-items:flex-start;gap:2px;font-size:13px}
  .home-tag{margin-left:0;font-size:10px}
  .vw{font-size:15px;padding:6px 8px;min-height:44px;gap:5px}
  .vw svg.i{width:14px;height:14px}
  .dl-add{max-width:calc(100vw - 54px);font-size:14px}
}
.chunk.has-inner{flex-direction:row;flex-wrap:wrap;align-items:center;align-content:flex-start;justify-content:center;gap:2px 6px;padding-top:7px}
.chunk.inner{height:48%}
.addons-h{font-weight:900;font-size:16px;margin:18px 0 2px;color:var(--v2-ink)}
.addons-sub{font-size:13px;font-weight:700;color:var(--v2-ink-2,#6b5d6c);margin-bottom:10px}
.s-sub svg.i{width:14px;height:14px;vertical-align:-2px}
.who-seg{margin-bottom:14px;flex-wrap:wrap}
.who-seg .who-e{font-size:20px}

/* ───── AAC: motor planning, bigger symbols, deeper contrast, core words ─────
   Feedback from a speech pathologist (Dec 2026):
   - buttons stay in the same place on every page (no reflow, no sideways scroll);
   - symbols are bigger than the text and have stronger contrast;
   - core words (More, Finished…) on every page. */

/* Deep border for each palette: at least 3:1 against both the card and the page (WCAG 1.4.11). */
.c-peach{--bd:#DD5708}.c-sand{--bd:#B4812E}.c-sage{--bd:#508A45}.c-lavender{--bd:#916BE5}
.c-butter{--bd:#A67F09}.c-rose{--bd:#E33D57}.c-sky{--bd:#2087DA}.c-mint{--bd:#30965C}

/* Core words: one fixed row of 8 on tablet, a fixed 4×2 block on phones. Never scrolls. */
.quickwords{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:10px;overflow:visible;margin:0;padding:0}
.quickwords[hidden]{display:none}
.qw{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:84px;padding:6px 4px;border-radius:18px;border:3px solid var(--bd,var(--v2-pill-line));background:var(--bg,#fff);font-size:17px;line-height:1.1;font-weight:900;color:var(--v2-ink);text-align:center}
.qw[class*="c-"]{border-color:var(--bd,var(--b))}
.qw:focus-visible{border-radius:18px}
.qw-ic{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:#fff}
.qw-ic svg.i{width:32px;height:32px;stroke-width:2.6;color:var(--bd,var(--v2-ink))}
.qw-t{max-width:100%;overflow-wrap:anywhere}

/* Cards: symbol is the hero, label is secondary. */
.card{border:3px solid var(--bd,var(--b));gap:10px;padding:16px 12px 14px}
.card.sel{border:5px solid var(--v2-ink);padding:14px 10px 12px}
.card .tile{width:auto;height:auto;aspect-ratio:1;flex:1 1 auto;min-height:96px;max-height:min(340px,100%);max-width:100%;border-radius:26px;background:#fff;font-size:clamp(64px,11vh,180px)}
.card .tile svg.i{width:62%;height:62%;stroke-width:2.1}
.card .lbl{font-size:21px;font-weight:900}
.card.has-photo .lbl{font-size:19px}
.card.add .tile{flex:0 0 auto;width:96px;height:96px;min-height:0}
/* An empty slot keeps the grid in place when cards are filtered out. */
.card.slot-gap{visibility:hidden;pointer-events:none}

@media (max-width:860px){
  .quickwords{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
  .qw{min-height:64px;padding:6px 2px;gap:3px;font-size:14px;border-radius:16px}
  .qw-ic{width:30px;height:30px;border-radius:10px}
  .qw-ic svg.i{width:22px;height:22px}
  .card{min-height:150px;gap:6px;padding:8px 8px 10px}
  .card.sel{padding:6px 6px 8px}
  .card .tile{width:96px;height:96px;flex:none;min-height:0;border-radius:20px;font-size:62px}
  .card .tile svg.i{width:60px;height:60px}
  .card .lbl{font-size:17px}
  .card.has-photo .lbl{font-size:15px}
  .card .photo{aspect-ratio:4/3}
  .card.add{min-height:150px}
  .card.add .tile{width:72px;height:72px}
}
@media (max-width:360px){.qw{font-size:12px}.card .lbl{font-size:15px}}

/* ───── Display modes (Settings › Display) ─────
   data-colours: soft (default) | contrast.  data-symbols: symbol | both (default) | words.
   Modes restyle cards only; grid and core-word positions never change. */

/* High contrast: bright fills (black text ≥7:1), thick black outlines, white page. */
body[data-colours="contrast"]{--v2-cream:#FFFFFF;background:#fff}
body[data-colours="contrast"] .app,body[data-colours="contrast"] .main,body[data-colours="contrast"] .topbar{background:#fff}
body[data-colours="contrast"] .c-peach{--hc:#FF8A3D}
body[data-colours="contrast"] .c-sand{--hc:#E0B96A}
body[data-colours="contrast"] .c-sage{--hc:#5FC46B}
body[data-colours="contrast"] .c-lavender{--hc:#B28CFF}
body[data-colours="contrast"] .c-butter{--hc:#FFD60A}
body[data-colours="contrast"] .c-rose{--hc:#FF6B8B}
body[data-colours="contrast"] .c-sky{--hc:#45B5FF}
body[data-colours="contrast"] .c-mint{--hc:#2FD3A0}
body[data-colours="contrast"] .card:not(.add):not(.slot-gap),body[data-colours="contrast"] .qw{background:var(--hc,#fff);border:4px solid #000;box-shadow:none}
body[data-colours="contrast"] .card.sel{border:7px solid #000;outline:4px solid #fff;outline-offset:-11px}
body[data-colours="contrast"] .card .tile,body[data-colours="contrast"] .card .photo{background:#fff;border:3px solid #000}
body[data-colours="contrast"] .card .tile svg.i{color:#000;stroke-width:2.4}
body[data-colours="contrast"] .card .lbl,body[data-colours="contrast"] .qw{color:#000}
body[data-colours="contrast"] .qw-ic{border:2px solid #000}
body[data-colours="contrast"] .qw-ic svg.i{color:#000}
body[data-colours="contrast"] .words{border:3px solid #000;background:#fff}
body[data-colours="contrast"] .sec-head h1{color:#000}

/* Pictures only: the word is hidden (still read by screen readers and still spoken). */
body[data-symbols="symbol"] .card:not(.add) .lbl{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
body[data-symbols="symbol"] .card .tile{max-height:min(420px,100%)}
body[data-symbols="symbol"] .card .photo{flex:1 1 auto}

/* Words first: big word, small picture beside it, for readers. */
body[data-symbols="words"] .card:not(.add){flex-direction:row;justify-content:flex-start;gap:16px;padding-left:18px;padding-right:18px;text-align:left}
body[data-symbols="words"] .card:not(.add) .tile,body[data-symbols="words"] .card:not(.add) .photo{flex:0 0 auto;width:72px;height:72px;min-height:0;max-height:none;aspect-ratio:1;font-size:44px;border-radius:18px}
body[data-symbols="words"] .card:not(.add) .tile svg.i{width:46px;height:46px}
body[data-symbols="words"] .card:not(.add) .lbl{font-size:clamp(26px,3.4vw,46px);line-height:1.1}
@media (max-width:860px){
  body[data-symbols="words"] .card:not(.add){gap:10px;padding:10px 12px}
  body[data-symbols="words"] .card:not(.add) .tile,body[data-symbols="words"] .card:not(.add) .photo{width:46px;height:46px;font-size:30px;border-radius:12px}
  body[data-symbols="words"] .card:not(.add) .tile svg.i{width:30px;height:30px}
  body[data-symbols="words"] .card:not(.add) .lbl{font-size:21px}
}

/* Settings › Display pickers */
.disp-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.disp-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.disp-opt{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:12px;border-radius:18px;border:2px solid var(--v2-line);background:#fff;text-align:left;color:var(--v2-ink)}
.disp-opt.on{border:3px solid var(--v2-green);padding:11px;background:#F1F8F3}
.disp-t{font-size:16px;font-weight:900}
.disp-s{font-size:13px;font-weight:700;color:var(--v2-muted);line-height:1.3}
.disp-prev{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px;width:100%;margin-bottom:6px}
.dp-card{min-width:0;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;height:74px;border-radius:12px;background:var(--bg);border:2px solid var(--bd,var(--b));font-style:normal}
.dp-card b{display:grid;place-items:center;width:38px;height:38px;border-radius:9px;background:#fff}
.dp-card b svg.i{width:26px;height:26px;color:var(--v2-ink)}
.dp-card em{font-style:normal;font-size:12px;font-weight:900;color:var(--v2-ink)}
.disp-colourMode-contrast .dp-card{border:3px solid #000}
.disp-colourMode-contrast .c-butter{background:#FFD60A}.disp-colourMode-contrast .c-sky{background:#45B5FF}
.disp-colourMode-contrast .dp-card b{border:2px solid #000}.disp-colourMode-contrast .dp-card b svg.i{color:#000}
.disp-symbolMode-symbol .dp-card em{display:none}.disp-symbolMode-symbol .dp-card b{width:52px;height:52px}.disp-symbolMode-symbol .dp-card b svg.i{width:36px;height:36px}
.disp-symbolMode-words .dp-card{flex-direction:row;justify-content:flex-start;gap:6px;padding:0 8px}.disp-symbolMode-words .dp-card b{width:22px;height:22px;border-radius:6px}.disp-symbolMode-words .dp-card b svg.i{width:16px;height:16px}.disp-symbolMode-words .dp-card em{font-size:14px}
@media (max-width:860px){.disp-grid.three{grid-template-columns:minmax(0,1fr)}.disp-grid.three .disp-prev{max-width:240px}}
.card .tile.colour-pic{font-size:clamp(72px,12vh,190px)}
.dp-card b{font-size:26px;line-height:1}
.disp-symbolMode-symbol .dp-card b{font-size:34px}
@media (max-width:860px){.card .tile.colour-pic{font-size:64px}}
