/* Ghatika: one accent, turmeric brass, in light and dark; a calm ground; Cormorant Garamond for the name and the
 * time, Hanken Grotesk for the rest. A deliberate departure from the Dixith Labs design standard (his decision,
 * 16 October 2026: "Just one colour accent with light/dark options ... calm"). The colours were measured for
 * contrast on 16 October: the light accent 4.8:1 on the ground, the dark 5.2:1. */

@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/cormorant-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/cormorant-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('fonts/hanken-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('fonts/hanken-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url('fonts/hanken-600.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }

:root {
  --bg: #F2F1EE; --bg-2: #EAE8E3; --card: #F8F7F4; --surface: #F8F7F4; --chip: #E6E4DF;
  --ink: #1F1E1C; --ink-2: #5E5B56; --ink-3: #85817A; --muted: #5E5B56;
  --line: #DCD9D2; --line-2: #CFCBC3; --hover: rgba(31, 30, 28, .05);
  --water: #D5DAD9; --bed: #C9C6BF; --surface-line: rgba(94, 91, 86, .4);
  --accent: #85650C; --accent-2: #85650C; --accent-ink: #6F540A; --on-accent: #FFFFFF;
  --accent-soft: rgba(133, 101, 12, .10); --accent-line: rgba(133, 101, 12, .32);
  --late: #A33B2B;
  --shadow-1: 0 1px 2px rgba(31, 30, 28, .04);
  --font: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --ts: 1;
  --veil: 0;
  --tabs-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"], :root.auto-dark {
  --bg: #121314; --bg-2: #18191B; --card: #18191B; --surface: #1D1F21; --chip: #1D1F21;
  --ink: #ECEAE6; --ink-2: #A19E98; --ink-3: #7D7A75; --muted: #A19E98;
  --line: #2E3032; --line-2: #3A3C3F; --hover: rgba(236, 234, 230, .05);
  --water: #22272A; --bed: #33363A; --surface-line: rgba(161, 158, 152, .35);
  --accent: #A18436; --accent-2: #A18436; --accent-ink: #B89A4C; --on-accent: #121314;
  --accent-soft: rgba(161, 132, 54, .13); --accent-line: rgba(161, 132, 54, .38);
  --late: #E07A68;
  --shadow-1: none;
  color-scheme: dark;
}

/* The breaks have colours of their own (his decision, 20 October 2026: "colours in the breaks", as on the design
 * canvas). Only while a break runs, and only on the Timer (js/ui.js restTint, set by js/timer-page.js): a soft sage
 * for the short break, a soft indigo for the longer one. The round itself keeps the brass and the plain ground.
 * Sage and indigo are Tulasi and Neela from the canvas of 16 October. Contrast worked out from the WCAG formula and
 * measured in v104.test.mjs: every accent and the muted grey at least 4.5:1 on its ground. */
:root[data-rest="short"] {
  --bg: #E1E7E0; --bg-2: #D9E0D8; --card: #E9EEE8; --surface: #E9EEE8; --chip: #D6DED6;
  --line: #C9D2C9; --line-2: #BCC7BC; --hover: rgba(31, 30, 28, .05);
  --water: #CBD6CF; --bed: #BCC6BE; --surface-line: rgba(59, 106, 76, .35);
  --accent: #3B6A4C; --accent-2: #3B6A4C; --accent-ink: #2F5A3E; --on-accent: #FFFFFF;
  --accent-soft: rgba(59, 106, 76, .10); --accent-line: rgba(59, 106, 76, .32);
}
:root[data-rest="long"] {
  --bg: #DFE0E6; --bg-2: #D7D8E0; --card: #E8E9EE; --surface: #E8E9EE; --chip: #D4D6DF;
  --line: #CACDD7; --line-2: #BDC0CC; --hover: rgba(31, 30, 28, .05);
  --water: #CDD1DC; --bed: #BFC2CD; --surface-line: rgba(52, 71, 154, .30);
  --accent: #34479A; --accent-2: #34479A; --accent-ink: #2A3B85; --on-accent: #FFFFFF;
  --accent-soft: rgba(52, 71, 154, .10); --accent-line: rgba(52, 71, 154, .30);
}
:root[data-theme="dark"][data-rest="short"], :root.auto-dark[data-rest="short"] {
  --bg: #1D2320; --bg-2: #222925; --card: #232A26; --surface: #252D29; --chip: #252D29;
  --line: #2F3833; --line-2: #3A443E; --hover: rgba(236, 234, 230, .05);
  --water: #26302B; --bed: #37403A; --surface-line: rgba(115, 156, 128, .35);
  --accent: #739C80; --accent-2: #739C80; --accent-ink: #8DB49A; --on-accent: #121314;
  --accent-soft: rgba(115, 156, 128, .13); --accent-line: rgba(115, 156, 128, .38);
}
:root[data-theme="dark"][data-rest="long"], :root.auto-dark[data-rest="long"] {
  --bg: #1E2027; --bg-2: #23252D; --card: #24262F; --surface: #262934; --chip: #262934;
  --line: #31343F; --line-2: #3C404C; --hover: rgba(236, 234, 230, .05);
  --water: #282C37; --bed: #393D49; --surface-line: rgba(135, 148, 204, .32);
  --accent: #8794CC; --accent-2: #8794CC; --accent-ink: #9BA7DA; --on-accent: #121314;
  --accent-soft: rgba(135, 148, 204, .13); --accent-line: rgba(135, 148, 204, .38);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 calc(16px * var(--ts)) / 1.5 var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
  transition: background-color .8s ease;   /* a break's colour comes in gently */
}
body.no-tabs { padding-bottom: env(safe-area-inset-bottom); }
/* Screen brightness in a browser: a page cannot dim the screen, so a dark veil over the page (Settings, Display). */
body::after { content: ''; position: fixed; inset: 0; background: #000; opacity: var(--veil); pointer-events: none; z-index: 1000; transition: opacity .4s; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
svg { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875em; }
.center { text-align: center; }

main#view { max-width: 520px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 20px 24px; }
main#view.enter { animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main#view.enter { animation: none; } * { transition-duration: 0s !important; } }

/* ---------------------------------------------------------------- the tabs */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--bg); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabs .inner { max-width: 520px; margin: 0 auto; display: flex; height: var(--tabs-h); }
#tabs a {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; letter-spacing: .01em;
}
#tabs a svg { width: 22px; height: 22px; stroke-width: 1.6; }
#tabs a.on { color: var(--accent); font-weight: 600; }
body.no-tabs #tabs { display: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 22px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background .15s, opacity .15s, transform .1s;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
/* In a break, Begin the next round is drawn in the break's own colour (the canvas of 20 October 2026). */
.timer-page[data-phase="rest"] #next { color: var(--accent); border-color: var(--accent); }
.btn.danger { background: var(--late); color: #fff; }
.btn.danger-text { color: var(--late); border-color: transparent; }
.btn.big { min-height: 54px; border-radius: 27px; font-size: 17px; width: 100%; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--muted); border-radius: 22px; cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--hover); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--muted); border-radius: 16px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.chip.on { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); }

/* ---------------------------------------------------------------- the Timer */
.timer-page { display: flex; flex-direction: column; align-items: stretch; gap: 10px; height: calc(100dvh - var(--tabs-h) - env(safe-area-inset-bottom) - max(14px, env(safe-area-inset-top)) - 16px); min-height: 600px; }
.brand-head { display: flex; align-items: center; justify-content: center; height: 40px; }
.wordmark { margin: 0; font: 600 30px/1 var(--display); letter-spacing: .01em; }
.len-wrap { position: relative; display: flex; justify-content: center; }
.len-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px 0 20px;
  border: 1px solid var(--line-2); border-radius: 20px; background: transparent; color: var(--ink);
  font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .02em; cursor: pointer;
  transition: opacity .4s, border-color .4s;
}
.len-btn svg { width: 16px; height: 16px; color: var(--muted); }
.len-btn:disabled { opacity: .38; cursor: default; border-color: var(--line); padding: 0 20px; }
.len-pop {
  position: absolute; top: 46px; z-index: 30; width: min(340px, calc(100vw - 40px));
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12); opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s;
}
.len-pop.on { opacity: 1; transform: none; }
.len-opt {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 8px;
  width: 100%; text-align: left; padding: 10px 14px; border: 0; background: transparent; border-radius: 12px; cursor: pointer;
}
.len-opt b { font-weight: 600; font-variant-numeric: tabular-nums; }
.len-opt small { grid-column: 1; color: var(--muted); font-size: 13px; }
.len-opt svg { grid-row: 1 / span 2; grid-column: 2; width: 20px; height: 20px; color: var(--accent); }
.len-opt:hover, .len-opt:focus-visible { background: var(--hover); }
.len-opt.on b { color: var(--accent-ink); }
.len-custom { padding: 8px 14px 12px; display: grid; gap: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.len-custom label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 14px; }
.step { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line-2); border-radius: 20px; padding: 2px; }
.step button { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 17px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.step button svg { width: 18px; height: 18px; }
.step output { min-width: 30px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }

.intent-wrap { display: flex; justify-content: center; min-height: 44px; }
.timer-page .intent {
  width: 100%; max-width: 420px; height: 44px; text-align: center; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 17px; font-weight: 500; padding: 0 8px; border-radius: 0;
}
.timer-page .intent::placeholder { color: var(--ink-3); font-weight: 400; }
.timer-page .intent:focus { outline: 0; border-bottom-color: var(--accent); box-shadow: none; }
.intent-rest { margin: 0; align-self: center; color: var(--muted); font-size: 16px; text-align: center; }
.task-wrap { display: flex; justify-content: center; min-height: 32px; }
.task-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 12px; border: 0; border-radius: 16px;
  background: var(--chip); color: var(--ink); font-size: 14px; cursor: pointer;
}
.task-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-chip svg { width: 16px; height: 16px; color: var(--muted); }
.task-chip.quiet-link { background: transparent; color: var(--muted); }
.task-chip:disabled { cursor: default; }

.picture { margin: 0 -20px; flex: 1 1 0; min-height: 170px; max-height: 440px; display: flex; overflow: hidden; }
svg.pond { display: block; width: 100%; height: 100%; overflow: visible; }
@media (min-width: 521px) { .picture { margin: 0; border-radius: 18px; } }
.p-water { fill: var(--water); }
.p-bed { stroke: var(--bed); stroke-width: 1.6; fill: none; }
.p-surface { stroke: var(--surface-line); stroke-width: .8; fill: none; }
.p-leaves { opacity: 0; transition: opacity 1.2s ease; }
.p-leaves.on { opacity: 1; }
.p-leaf { fill: var(--accent); opacity: .28; }
.v-interior { fill: var(--bg); }
.v-water { fill: var(--water); stroke: var(--water); stroke-width: .7; }
.v-hole-wet { fill: var(--water); }
.v-hole-dry { fill: var(--bg); }
.v-line { fill: none; stroke: var(--accent); stroke-linejoin: round; stroke-linecap: butt; }
.v-wall { fill: var(--accent); }
.v-bead { fill: var(--accent); stroke: var(--accent); stroke-width: 1; stroke-linejoin: round; }
.vessel { transition: none; }
.f-tube-out { fill: none; stroke: var(--line); stroke-width: 22; stroke-linejoin: round; }
.f-tube-in { fill: none; stroke: var(--bg); stroke-width: 17; stroke-linejoin: round; }
.f-trail, .f-core, .f-halo { fill: var(--accent); }
.f-halo { opacity: .1; }
.f-core { opacity: .5; }
.resting .f-core { opacity: .25; }
.resting .f-halo { opacity: .05; }

.time {
  display: block; margin: 4px auto 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; padding: 0 12px;
  font: 500 84px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; letter-spacing: .01em;
}
@media (max-height: 700px) { .time { font-size: 68px; } }
.timer-page[data-phase="over"] .time, .timer-page[data-phase="restover"] .time { color: var(--accent-ink); }
.timer-page[data-paused] .time { opacity: .55; }
.status { margin: 0; text-align: center; color: var(--muted); font-size: 15px; min-height: 22px; }
.controls { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.ctl-main { display: flex; }
.ctl-row { display: flex; gap: 8px; }
.ctl-row .btn { flex: 1 1 0; padding: 0 10px; white-space: nowrap; }
.ctl-row .btn.narrow { flex: 0 0 76px; color: var(--muted); }
.ctl-row .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.btn.bump { animation: bump .5s ease-out; }
@keyframes bump { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.today { margin: 2px 0 0; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- pages */
.page { display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; align-items: center; gap: 4px; min-height: 48px; margin-left: -10px; }
.page-head.top { margin-left: 0; }
.page-head h1 { margin: 0; font: 600 28px/1.1 var(--display); letter-spacing: .01em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.card-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sub-title { margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.section-title { margin: 10px 4px -4px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.empty { margin: 30px 10px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px 10px 16px;
  border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer;
}
.list > .row:first-child, .list > :first-child .row { border-top: 0; }
.row:hover { background: var(--hover); }
.row-icon { color: var(--muted); display: inline-flex; }
.row-icon svg { width: 22px; height: 22px; }
.row-text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.row-text b { font-weight: 500; }
.row-text small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.row > svg:last-child { color: var(--ink-3); }
.row .right { color: var(--muted); font-size: 14px; white-space: nowrap; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; width: 46px; height: 28px; border-radius: 14px; background: var(--line-2); flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.row.sub-row { min-height: 52px; }
.range-row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.range-row label { display: flex; justify-content: space-between; color: var(--ink); }
.range-row label span { color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--chip); border-radius: 22px; }
.seg button { flex: 1 1 0; height: 36px; border: 0; border-radius: 18px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.label { display: block; margin: 16px 2px 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
input:not([type]), input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.kv { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; }
.kv b small { color: var(--muted); font-weight: 400; }

/* the tasks */
.add-task { display: flex; flex-direction: column; gap: 10px; }
.add-task input#title { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 6px 2px; font-size: 17px; }
.add-task input#title:focus { box-shadow: none; }
.add-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.add-row select { width: auto; flex: 1 1 120px; min-height: 40px; }
.add-row .btn { margin-left: auto; }
.expect { margin: 0 4px; color: var(--muted); }
.expect b { color: var(--ink); font-weight: 600; }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 10px; }
.task.chosen { border-color: var(--accent-line); }
.task .tick { width: 30px; height: 30px; border-radius: 15px; border: 1.5px solid var(--line-2); background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--on-accent); cursor: pointer; flex: none; }
.task.done .tick { background: var(--accent); border-color: var(--accent); }
.task .tick svg { width: 16px; height: 16px; }
.task-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 4px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.task-main b { font-weight: 500; overflow-wrap: anywhere; }
.task.done .task-main b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.task-main small { color: var(--muted); font-size: 13px; }
.dots { display: flex; gap: 4px; margin-top: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 4px; border: 1.2px solid var(--accent-line); }
.dots i.on { background: var(--accent); border-color: var(--accent); }
.focus-btn { color: var(--accent); }
.done-list summary { cursor: pointer; color: var(--muted); padding: 6px 4px; }
.done-list .task-list { margin: 6px 0 10px; }
.sub-list { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sub-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 6px; align-items: center; }
.sub-list li .chip { grid-column: 1 / -1; justify-self: start; }
#addsub { margin-top: 8px; }
#addsub input { flex: 1 1 auto; width: auto; }

/* the reports */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font: 600 30px/1.1 var(--display); font-variant-numeric: lining-nums; }
.tile b .plus { font-size: 18px; color: var(--muted); margin-left: 4px; }
.tile small { color: var(--muted); font-size: 13px; line-height: 1.3; }
svg.bars { width: 100%; height: auto; display: block; }
.bar { fill: var(--accent); opacity: .55; }
.bar.now { opacity: 1; }
.axis { fill: var(--muted); font-size: 10px; text-anchor: middle; font-family: var(--font); }
.baseline { stroke: var(--line-2); stroke-width: 1; }
/* 1.0.4: the day as a line (reports.js dayLines). The breaks in the colours of the breaks on the Timer. */
:root { --tl-rest: #3B6A4C; --tl-long: #34479A; }
:root[data-theme="dark"], :root.auto-dark { --tl-rest: #739C80; --tl-long: #8794CC; }
svg.timeline { width: 100%; height: auto; display: block; }
.tl-track { fill: var(--chip); }
.tl-grid { stroke: var(--line); stroke-width: 1; }
.tl-focus { fill: var(--accent); }
.tl-rest { fill: var(--tl-rest); opacity: .6; }
.tl-long { fill: var(--tl-long); opacity: .6; }
.tl-void { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; }
.tl-day { fill: var(--muted); font-size: 10px; text-anchor: end; font-family: var(--font); }
.tl-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 4px; font-size: .875em; color: var(--ink-2); }
.tl-key span { display: inline-flex; align-items: center; gap: 6px; }
.tl-key i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.tl-key .k-focus { background: var(--accent); }
.tl-key .k-rest { background: var(--tl-rest); opacity: .6; }
.tl-key .k-long { background: var(--tl-long); opacity: .6; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 6px; gap: 4px 10px; }
.hbars li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars li b { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.hbars li i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--w), var(--chip) var(--w)); }
.history { list-style: none; margin: 0 -8px; padding: 0; }
.history button { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 8px; border-top: 1px solid var(--line); cursor: pointer; }
.history li:first-child button { border-top: 0; }
.history .h-when { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.history .h-what { min-width: 0; display: flex; flex-direction: column; }
.history .h-what b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .h-what small { color: var(--muted); font-size: 12.5px; }
.history .h-rate { color: var(--accent); font-size: 8px; letter-spacing: 1px; }
.history button.void .h-what b { color: var(--muted); text-decoration: line-through; }

/* reading pages inside the app: About, Help */
.prose { font-size: 17px; line-height: 1.7; }
.prose h2 { font: 600 24px/1.25 var(--display); margin: 28px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose .lede { font: 500 21px/1.45 var(--display); color: var(--ink); }
.prose .rest { color: var(--muted); }
.prose.help h2 { font-size: 21px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 24px 0 8px; color: var(--muted); font-size: 14px; }

/* the version block at the foot of Settings, the same in every Dixith app: icon, name, version line, "a dixith.com project" */
.app-version { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 18px 0 8px; text-align: center; }
.app-version .app-icon { width: 56px; height: 56px; border-radius: 14px; }
.app-version .app-name { font: 600 22px/1.2 var(--display); }
.app-version button, .app-version .dx-version { color: var(--muted); font-size: 13px; background: none; border: 0; cursor: pointer; padding: 4px 8px; min-height: 32px; }
.app-version .app-by { color: var(--accent-ink); font-weight: 600; font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; text-decoration: none; }
.row.quiet-row .row-text b { color: var(--muted); font-weight: 400; }
.gta-slot { margin-top: 4px; }

/* ---------------------------------------------------------------- the sheet and the toast */
.scrim { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .32); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease-out; }
.scrim.leaving { animation: fadeout .25s ease-in forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow: auto; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); animation: up .26s ease-out; outline: 0;
}
.scrim.leaving .sheet { animation: down .25s ease-in forwards; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
@keyframes down { to { transform: translateY(30px); } }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 12px; }
.sheet h2 { margin: 4px 0 8px; font: 600 24px/1.25 var(--display); }
.sheet p { margin: 6px 0; }
.choices { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: transparent; cursor: pointer; }
.choice span { display: flex; flex-direction: column; min-width: 0; }
.choice b { font-weight: 500; }
.choice small { color: var(--muted); font-size: 13px; }
.choice.on { border-color: var(--accent-line); background: var(--accent-soft); }
.choice svg { color: var(--accent); }
.rate { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; }
.rate button { flex: 1 1 0; height: 54px; border: 1px solid var(--line); border-radius: 14px; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.rate button i { width: calc(28px * var(--s)); height: calc(28px * var(--s)); border-radius: 50%; border: 1.5px solid var(--accent-line); }
.rate button.on { border-color: var(--accent); }
.rate button.on i { background: var(--accent); border-color: var(--accent); }
.rate-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 6px; }
.rate-ends b { color: var(--accent-ink); font-weight: 600; }
.intent-done { font-style: italic; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); z-index: 300;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  max-width: min(480px, calc(100vw - 32px)); width: max-content; display: flex; gap: 14px; align-items: center;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
body.no-tabs .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; background: transparent; color: var(--bg); font-weight: 600; text-decoration: underline; cursor: pointer; padding: 4px; white-space: nowrap; }

/* the family's account screens, in Ghatika's own look */
.dx-page { padding-top: 10px; }
.dx-mount .dxa-card { box-shadow: none; }

/* the admin screen */
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.adm-table th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.adm-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.adm-user { display: block; color: var(--ink); text-decoration: none; }
.adm-user small { color: var(--muted); display: block; }
