/*
 * Prayer Counter Pro: the tool's own components, styled in the site's design language (12 Nov 2026, automatic mode, on the
 * UltraCompress Pro template). The first part follows the Love Calculator's shared block (tokens, page, hero, toolbar and
 * pill tabs, fields, windows, toasts, information sections). Base: /libs/site-pages.css (tokens, Inter and Space Grotesk,
 * theme toggle, focus rings) and /libs/shared-nav.css (the site's header and footer). The second part is the original's
 * components (the dial with its rings and beads, the readout, the controls, the session panel, practices, history,
 * statistics, settings) on the site's tokens, with the site's violet as the dial's colour and the original's bead colours
 * (wood, plain, gold, black and white). The original's navy and gold page, its top bar, bottom tab bar, footer and own
 * light and dark themes are gone; its high contrast setting, the four counter sizes and the motion setting apply to the
 * tool (data attributes on #app-shell). The buttons keep the original's class names (btn, btn primary, btn ghost, btn
 * danger), which the script also writes. Light is the default; dark applies when <html> has no data-theme. Written once
 * from the Love Calculator's file and the original's styles, then edited by hand: this file is the source.
 */


/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --radius-lg: 16px;
    --line: rgba(0, 0, 0, 0.1);
    --line-strong: rgba(0, 0, 0, 0.24);
    --ok: #166534;
    --bad: #b91c1c;
    --bad-soft: rgba(185, 28, 28, 0.08);
    --warn: #92400e;
    --warn-soft: rgba(217, 119, 6, 0.1);
    --head: 81px;
    /* the dial */
    --pc-accent: #7c3aed;
    --pc-accent-2: #a78bfa;
    --pc-accent-text: #6d28d9;
    --pc-accent-soft: rgba(124, 58, 237, 0.08);
    --face-hi: #ffffff;
    --face-lo: #f5f3fb;
    --track: #ebe8f5;
    --dial-shadow: 0 18px 50px rgba(10, 10, 20, 0.1), 0 2px 6px rgba(10, 10, 20, 0.06);
    --scale: 1;
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.26);
    --ok: #4ade80;
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
    --pc-accent: #a78bfa;
    --pc-accent-2: #7c6bb0;
    --pc-accent-text: #c4b5fd;
    --pc-accent-soft: rgba(167, 139, 250, 0.1);
    --face-hi: #1d1d2c;
    --face-lo: #12121c;
    --track: #2a2a3d;
    --dial-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}
@media (max-width: 639.98px) { :root { --head: 65px; } }

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- The site header is the first thing on the page and stays at the top ----- */
body { padding-top: 0; }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: 90px; }
@media (max-width: 639.98px) { .theme-toggle { top: 75px; } } /* the header is 81 px tall from 640 px, 65 px below */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- Small helpers ----- */
main [hidden], .dialog [hidden] { display: none !important; } /* the script hides fields that carry their own display */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.small { font-size: 0.9rem; }
.hint { color: var(--text-3); font-size: 0.82rem; font-weight: 400; line-height: 1.45; }
.field-error { color: var(--bad); font-size: 0.85rem; font-weight: 600; }
.field-error:empty { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
kbd { font-family: inherit; font-size: 0.8rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--chip-border); border-bottom-width: 2px; background: var(--chip); color: var(--text-strong); }
kbd.listening { border-color: var(--pc-accent); color: var(--pc-accent-text); }

/* ----- The site's text rules (p, ul, li, headings) must not reach the tool: same weight as the site's, loaded later ----- */
:where(.app-shell) p, :where(.app-shell) ul, :where(.app-shell) ol, :where(.app-shell) li, :where(.app-shell) dl, :where(.app-shell) dd { margin: 0; line-height: 1.5; }
:where(.app-shell) h2, :where(.app-shell) h3, :where(.app-shell) h4 { margin: 0; line-height: 1.25; }
.app-shell :is(p, h2, h3, h4, li, strong, dd, td) { overflow-wrap: anywhere; }

/* ----- Buttons: the original's class names in the site's pills ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9999px; font-family: inherit; font-weight: 600; font-size: 0.92rem; line-height: 1.2; padding: 10px 20px; min-height: 44px; cursor: pointer; text-decoration: none; text-align: center; background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn.primary { background: var(--gradient-brand); color: #fff; border-color: transparent; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn.primary:hover:not(:disabled) { color: #fff; box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); }
.btn.danger { color: var(--danger); border-color: rgba(185, 28, 28, 0.35); }
.btn.danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; }
:root:not([data-theme="light"]) .btn.danger { border-color: rgba(248, 113, 113, 0.4); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { color: var(--link); border-color: var(--surface-border); }
.btn.full { width: 100%; }
.btn-sm { font-size: 0.85rem; padding: 8px 16px; min-height: 40px; }

/* ----- Toolbar and pill tabs ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: calc(var(--head) + 16px); }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; border-radius: 9999px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); min-width: 200px; max-width: min(100%, 340px); }
.status-logo { width: 26px; height: 26px; color: var(--pc-accent); }
.status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.status-main { font-weight: 700; font-size: 0.88rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-sub { font-size: 0.72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; }
.view-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.86rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.view-tab .ico { width: 16px; height: 16px; }
.view-tab:hover { color: var(--link); }
.view-tab.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.view-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.view { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.view[hidden] { display: none; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-title { font-size: 1.5rem; color: var(--text-strong); }
.lead { margin-top: 4px; color: var(--text-2); max-width: 70ch; }
.shell-hint { margin-top: 20px; text-align: center; }
.card-title { font-size: 1.1rem; color: var(--text-strong); display: flex; align-items: center; gap: 8px; }
.card-title .ico { color: var(--pc-accent); }

/* ----- Banners ----- */
.banners:empty { display: none; }
.banners { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.banner { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--warn-soft); color: var(--text); border: 1px solid rgba(217, 119, 6, 0.35); font-size: 0.93rem; }
.banner .ico { color: var(--warn); margin-top: 2px; }
.banner-text { flex: 1 1 260px; }
.banner .actions .btn { min-height: 40px; padding: 7px 14px; font-size: 0.85rem; }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field legend, .label { font-weight: 600; font-size: 0.88rem; color: var(--text-strong); padding: 0; margin-bottom: 6px; }
.field.two, .field.three { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.field.three { grid-template-columns: 1fr; }
@media (min-width: 520px) { .field.three { grid-template-columns: repeat(3, 1fr); } }
.field.two > div, .field.three > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.two .label, .field.three .label { margin-bottom: 0; }
.input, .select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--placeholder); }
.input[aria-invalid="true"] { border-color: var(--bad); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
.select { width: auto; max-width: 100%; appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; cursor: pointer; }
.select option { color: #0a0a14; background: #fff; }
.field.two .select, .field.three .select { width: 100%; }
.custom-num { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.custom-num .input { flex: 1 1 120px; width: auto; }
.custom-num .field-error { flex-basis: 100%; }
.switch-row, .check-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 6px 0; color: var(--text); }
.switch-row > span { display: flex; flex-direction: column; font-weight: 600; font-size: 0.93rem; color: var(--text-strong); }
.switch-row small { font-weight: 400; color: var(--text-3); font-size: 0.82rem; }
.check-row { font-size: 0.93rem; }
.switch-row input, .check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.switch-row input:disabled + span { opacity: 0.55; }
.range-row { display: flex; gap: 12px; align-items: center; }
.range-row input { flex: 1; accent-color: var(--brand); min-height: 44px; }

/* Segmented choices (radio groups) and chips: the site's pills */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 14px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; color: var(--text-2); font-size: 0.86rem; font-weight: 600; cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.seg button:hover { color: var(--link); }
.seg button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; box-shadow: 0 3px 10px rgba(139, 92, 246, 0.25); }
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wide-seg { display: flex; }
.wide-seg button { flex: 1; }
.small-seg button { min-height: 34px; padding: 4px 12px; font-size: 0.82rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; min-width: 48px; padding: 6px 14px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); font-family: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chip:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--gradient-brand); border-color: transparent; color: #fff; }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Cards: the site's white cards, one layer ----- */
/* The site's own .card (site-pages.css) frames a box; inside the tool a .card is only a group, and the frames are set
   where one is wanted (the session panel, the charts, the settings), so there is never a frame inside a frame. */
.app-shell .card { display: flex; flex-direction: column; gap: 14px; min-width: 0; background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; backdrop-filter: none; transform: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 9999px; font-size: 0.78rem; font-weight: 700; background: var(--chip); color: var(--text-2); border: 1px solid var(--chip-border); }
.pill .ico { width: 14px; height: 14px; }
.pill.on { color: var(--ok); }

/* ===== Counter ===== */
.counter-layout { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .counter-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 40px; } }
.counter-col { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.session-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.practice-btn { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; justify-items: start; border: 0; background: transparent; padding: 4px 0; text-align: left; min-width: 0; max-width: 100%; border-radius: 10px; font-family: inherit; color: var(--text-strong); cursor: pointer; }
.practice-kicker { grid-column: 1 / -1; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 700; }
.practice-name { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; min-width: 0; }
.practice-btn .ico { color: var(--text-2); }
.practice-btn:hover .practice-name { color: var(--link); }
.practice-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.notice { width: 100%; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--tint-brand); border: 1px solid var(--tint-brand-border); }
.notice-text { flex: 1 1 240px; display: flex; flex-direction: column; font-size: 0.93rem; color: var(--text); }
.notice-text strong { color: var(--text-strong); }

.dial-wrap { width: 100%; display: flex; justify-content: center; padding: 6px 0; }
.dial { --fs: 0.3; position: relative; width: min(100%, calc(360px * var(--scale)), 54vh); aspect-ratio: 1 / 1; border-radius: 50%; border: 0; padding: 0; margin: 0; background: transparent; color: var(--text-strong); display: grid; place-items: center; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; container-type: inline-size; box-shadow: var(--dial-shadow); transition: transform 0.08s ease-out; cursor: pointer; font-family: inherit; }
.dial:active { transform: scale(0.985); }
.dial:focus-visible { outline: 4px solid var(--brand); outline-offset: 6px; }
.dial-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.face { fill: url(#gFace); stroke: var(--surface-border); stroke-width: 1; }
.stop-face-hi { stop-color: var(--face-hi); }
.stop-face-lo { stop-color: var(--face-lo); }
.track { fill: none; stroke: var(--track); stroke-width: 9; }
.track.thin { stroke-width: 4; }
.arc { fill: none; stroke: var(--pc-accent); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; transform: rotate(-90deg); transform-origin: 150px 150px; transition: stroke-dashoffset 0.35s ease; }
.arc-round { stroke-width: 4; stroke: var(--pc-accent-2); }
.halo { fill: none; stroke: var(--pc-accent); stroke-width: 3; opacity: 0; transform-origin: 150px 150px; }
.dial.reached .halo { opacity: 0.55; animation: none; }
.dial.glow .halo, .dial.reached.glow .halo { animation: halo 1.8s ease-out 1; }
@keyframes halo { 0% { opacity: 0.8; transform: scale(0.97); } 100% { opacity: 0; transform: scale(1.06); } }

.bead-ring { display: none; }
.dial[data-mode="beads"] .digital-ring { display: none; }
.dial[data-mode="beads"] .bead-ring { display: inline; }
.beads { transform-origin: 150px 150px; transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.4, 1); }
.beads.instant { transition: none; }
.cord { fill: none; stroke: var(--cord, #8b6b4a); stroke-width: 1.5; opacity: 0.6; }
/* Beads light up as they are counted, so the ring fills in over a round; the start bead always shows. */
.bead { fill: url(#gBead); stroke: var(--bead-edge, rgba(0, 0, 0, 0.25)); stroke-width: 0.6; opacity: 0.42; transition: opacity 0.2s; }
.bead.done { fill: url(#gBeadDone); opacity: 1; }
.bead.active, .bead.guru { opacity: 1; }
.bead.active { stroke: var(--pc-accent); stroke-width: 2.5; }
.bead.guru { stroke: var(--pc-accent); stroke-width: 1.4; }
.pointer { fill: var(--pc-accent); }
.stop-hi { stop-color: var(--bead-hi); }
.stop-lo { stop-color: var(--bead-lo); }
.stop-done-hi { stop-color: var(--bead-done-hi); }
.stop-done-lo { stop-color: var(--bead-done-lo); }
.dial[data-bead="wood"] { --bead-hi: #d29c66; --bead-lo: #75452a; --bead-done-hi: #b77a45; --bead-done-lo: #5a3218; --cord: #8b6b4a; }
.dial[data-bead="minimal"] { --bead-hi: #f6f4ee; --bead-lo: #bdb7a9; --bead-done-hi: #8e897d; --bead-done-lo: #4c4840; --cord: #a9a397; }
:root:not([data-theme="light"]) .dial[data-bead="minimal"] { --bead-hi: #4a5674; --bead-lo: #222b44; --bead-done-hi: #c9cbd6; --bead-done-lo: #7d8297; --cord: #4a5674; }
.dial[data-bead="gold"] { --bead-hi: #f8e6a8; --bead-lo: #a87e1f; --bead-done-hi: #f6dc8c; --bead-done-lo: #9c7317; --cord: #b08a2e; }
.dial[data-bead="mono"] { --cord: var(--text-strong); }
.dial[data-bead="mono"] .bead { fill: var(--surface); stroke: var(--text-strong); stroke-width: 1.4; opacity: 0.6; }
.dial[data-bead="mono"] .bead.done { fill: var(--text-strong); }
.dial[data-bead="mono"] .bead.active { stroke: var(--pc-accent); stroke-width: 3; }
.dial[data-bead="mono"] .bead.done, .dial[data-bead="mono"] .bead.active, .dial[data-bead="mono"] .bead.guru { opacity: 1; }

.dial-center { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 74%; pointer-events: none; text-align: center; }
.count-value { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(2.4rem, 16vw, 6rem); font-size: calc(100cqw * var(--fs)); font-weight: 500; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-strong); }
.dial[data-mode="beads"] .count-value { font-size: calc(100cqw * var(--fs) * 0.74); }
.count-value[data-len="4"], .count-value[data-len="5"] { --fs: 0.25; }
.count-value[data-len="6"], .count-value[data-len="7"] { --fs: 0.195; }
.count-value[data-len="8"], .count-value[data-len="9"] { --fs: 0.155; }
.count-value[data-len="10"], .count-value[data-len="11"] { --fs: 0.13; }
.count-value[data-len="12"], .count-value[data-len="13"], .count-value[data-len="14"] { --fs: 0.11; }
.dial-sub { margin-top: 6px; color: var(--text-2); font-weight: 600; font-size: max(0.8rem, calc(100cqw * 0.05)); font-variant-numeric: tabular-nums; line-height: 1.25; }
.dial-hint { color: var(--text-2); font-size: 0.9rem; text-align: center; min-height: 1.35em; }

.readout { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; }
.readout-item { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.ro-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 700; }
.ro-value { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.ro-value.over { color: var(--pc-accent-text); }
.bar { width: min(100%, 420px); height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--gradient-brand); border-radius: inherit; transition: width 0.3s ease; }

.completion { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border-radius: 16px; background: var(--pc-accent-soft); border: 1px solid var(--tint-brand-border); animation: rise 0.5s ease-out; }
.completion h3 { font-size: 1.05rem; color: var(--text-strong); }
.completion-ico { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--gradient-brand); color: #fff; stroke-width: 3; }
.completion-text { flex: 1 1 200px; }
.completion-text p { color: var(--text-2); font-size: 0.93rem; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.controls { width: min(100%, 560px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ctrl { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; border-radius: 16px; border: 1px solid var(--surface-border); background: var(--surface); box-shadow: var(--surface-shadow); font-family: inherit; color: var(--text-strong); font-weight: 600; font-size: 0.86rem; cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.ctrl .ico { width: 22px; height: 22px; }
.ctrl:hover { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.ctrl[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.ctrl[aria-disabled="true"]:hover { border-color: var(--surface-border); color: var(--text-strong); }
.ctrl-primary, .ctrl-primary:hover, .ctrl-primary[aria-disabled="true"]:hover { background: var(--gradient-brand); border-color: transparent; color: #fff; }
.ctrl.running { border-color: var(--pc-accent); }
.status { color: var(--text-2); font-size: 0.9rem; text-align: center; min-height: 1.35em; }

/* Session panel beside the counter: a white card, one layer. */
.side-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); padding: 20px; }
.side-col > section { display: flex; flex-direction: column; gap: 18px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 0.72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.facts dd { margin: 0; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }

/* ===== Practices ===== */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.pcard { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--surface-border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--surface-shadow); min-width: 0; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--surface-hover-shadow); }
.pcard.current { border-color: var(--pc-accent); box-shadow: 0 0 0 1px var(--pc-accent); }
.pcard-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pcard h3 { font-size: 1.05rem; color: var(--text-strong); }
.pcard .desc { color: var(--text-2); font-size: 0.9rem; }
.pcard .note { font-size: 0.88rem; color: var(--text-2); border-left: 3px solid var(--line-strong); padding-left: 8px; white-space: pre-wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.78rem; padding: 3px 10px; border-radius: 9999px; background: var(--chip); border: 1px solid var(--chip-border); color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.tag.cat { background: var(--tint-brand); border-color: var(--tint-brand-border); color: var(--pc-accent-text); }
.pcard .actions { margin-top: auto; }
.pcard .actions .btn { min-height: 40px; padding: 7px 14px; font-size: 0.85rem; }
.empty { color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); padding: 28px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-ico { width: 34px; height: 34px; color: var(--pc-accent); }

/* ===== History ===== */
.filters { display: flex; flex-wrap: wrap; gap: 12px; }
.filter { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 600; color: var(--text-2); min-width: 140px; flex: 1 1 140px; max-width: 280px; }
.filter .select { width: 100%; color: var(--text); font-weight: 400; font-size: 0.93rem; }
.history-list { display: flex; flex-direction: column; }
.day-head { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 700; padding: 18px 0 6px; border-bottom: 1px solid var(--line); }
.day-head:first-child { padding-top: 0; }
.hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.hrow-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hrow-title { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.hrow-title strong { color: var(--text-strong); overflow-wrap: anywhere; }
.hrow-meta { color: var(--text-2); font-size: 0.86rem; display: flex; flex-wrap: wrap; gap: 2px 14px; font-variant-numeric: tabular-nums; }
.hrow-count { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.1; color: var(--text-strong); }
.hrow-count small { display: block; font-size: 0.75rem; color: var(--text-3); font-weight: 600; }
.hrow-note { font-size: 0.88rem; color: var(--text-2); white-space: pre-wrap; border-left: 3px solid var(--line-strong); padding-left: 8px; }
.hrow .actions { grid-column: 1 / -1; }
.hrow .actions .btn { min-height: 36px; padding: 5px 12px; font-size: 0.82rem; }
.status-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; padding: 1px 9px; border-radius: 9999px; border: 1px solid var(--chip-border); color: var(--text-2); }
.status-badge .ico { width: 13px; height: 13px; stroke-width: 2.6; }
.status-badge.completed { color: var(--ok); border-color: currentColor; }
.status-badge.interrupted { color: var(--warn); border-color: currentColor; }
.status-badge.progress { color: var(--pc-accent-text); border-color: currentColor; }

/* ===== Statistics ===== */
#statsBody { display: flex; flex-direction: column; gap: 24px; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { padding: 16px; border: 1px solid var(--surface-border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--surface-shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 700; }
.tile-value { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2; }
.tile-note { font-size: 0.8rem; color: var(--text-2); overflow-wrap: anywhere; }
.app-shell .chart-card, .app-shell .stats-cols > .card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); padding: 20px; }
.stats-cols { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .stats-cols { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-top: 20px; border-bottom: 1px solid var(--line-strong); }
.chart-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; }
.chart-bar { width: 100%; max-width: 46px; background: var(--pc-accent-2); border-radius: 6px 6px 0 0; min-height: 0; position: relative; }
.chart-bar.zero { background: transparent; border-bottom: 2px solid var(--line-strong); border-radius: 0; height: 0; }
.chart-bar.nodata { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line) 4px 6px); border: 1px dashed var(--line-strong); border-bottom: 0; height: 18px; }
.chart-bar.today { background: var(--pc-accent); }
.chart-val { font-size: 0.68rem; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-axis { display: flex; gap: 4px; margin-top: 4px; }
.chart-axis span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 0.68rem; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: clip; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend .lg-bar { background: var(--pc-accent-2); }
.legend .lg-nodata { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--line-strong) 3px 5px); border: 1px dashed var(--line-strong); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; color: var(--text); }
.app-shell .table th, .app-shell .table td { text-align: left; padding: 8px 8px 8px 0; border: 0; border-bottom: 1px solid var(--line); background: none; vertical-align: top; } /* the site's table rules draw a grid */
.app-shell .table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.app-shell .table td.num, .app-shell .table th.num { text-align: right; padding-right: 0; padding-left: 8px; }
.table-details summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; padding: 6px 0; color: var(--link); }
.plain-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
:where(.app-shell) .plain-list { list-style: disc; padding-left: 1.2em; }

/* ===== Settings ===== */
.settings-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.app-shell .settings-grid > .card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); padding: 20px; }
.swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 480px) { .swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.swatches button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; min-height: 44px; border: 1px solid var(--chip-border); border-radius: 14px; background: var(--surface); font-family: inherit; color: var(--text-strong); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: border-color 0.2s ease; }
.swatches button:hover { border-color: var(--brand); }
.swatches button[aria-checked="true"] { border-color: var(--pc-accent); box-shadow: 0 0 0 2px var(--pc-accent); }
.swatch { width: 30px; height: 30px; border-radius: 50%; }
.sw-wood { background: radial-gradient(circle at 35% 32%, #d29c66, #75452a); }
.sw-minimal { background: radial-gradient(circle at 35% 32%, #f6f4ee, #bdb7a9); border: 1px solid var(--line-strong); }
.sw-gold { background: radial-gradient(circle at 35% 32%, #f8e6a8, #a87e1f); }
.sw-mono { background: var(--surface); border: 2px solid var(--text-strong); }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 600; color: var(--text-strong); }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--line-strong); padding-top: 14px; }
.danger-zone h4 { font-size: 0.95rem; color: var(--text-strong); }

/* ----- Windows ----- */
.dialog { margin: auto; border: 1px solid var(--surface-border); border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 16px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.dialog--narrow { width: min(440px, calc(100vw - 16px)); }
.dialog--wide { width: min(680px, calc(100vw - 16px)); }
.dialog::backdrop { background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); }
.dialog[open] { animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }
.dialog-form { display: flex; flex-direction: column; margin: 0; }
.dialog-head { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-title { margin: 0; font-size: 1.15rem; color: var(--text-strong); overflow-wrap: anywhere; }
.dialog-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; font-size: 1.3rem; line-height: 1; transition: border-color 0.2s ease, color 0.2s ease; }
.dialog-close:hover { border-color: var(--brand); color: var(--link); }
.dialog-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 210px); display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { padding: 14px 20px; border-top: 1px solid var(--surface-border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.dialog-actions:empty { display: none; }
.confirm-message { margin: 0; color: var(--text); }
:where(.dialog) p, :where(.dialog) ol, :where(.dialog) li { margin: 0; line-height: 1.5; }
.help-body h3 { margin: 6px 0 0; font-size: 1rem; color: var(--text-strong); }
.help-body:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; } /* the text scrolls on phones, so it takes the focus */
.help-body p { color: var(--text-2); }
.guide { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 10px; color: var(--text); }
.picker-list { display: flex; flex-direction: column; gap: 8px; }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--chip-border); border-radius: 14px; background: var(--surface); min-height: 48px; font-family: inherit; color: var(--text-strong); cursor: pointer; transition: border-color 0.2s ease; }
.pick:hover { border-color: var(--brand); }
.pick[aria-current="true"] { border-color: var(--pc-accent); box-shadow: 0 0 0 1px var(--pc-accent); }
.pick strong { overflow-wrap: anywhere; }
.pick span { font-size: 0.85rem; color: var(--text-2); overflow-wrap: anywhere; }

/* ----- Toasts ----- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 420px; font-size: 0.9rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast button { background: none; border: 0; padding: 0 2px; color: #c4b5fd; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; min-height: 32px; }
.toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ----- High contrast (the tool's own setting): stronger colours and borders, counted beads filled ----- */
.app-shell[data-contrast="high"] {
    --surface: #ffffff; --surface-2: #f0f0f0; --surface-border: #000000; --chip: #ffffff; --chip-border: #000000;
    --text: #000000; --text-2: #1f1f1f; --text-3: #1f1f1f; --text-strong: #000000; --line: #000000; --line-strong: #000000;
    --field: #ffffff; --field-border: #000000; --tint-brand: #ffffff; --tint-brand-border: #000000;
    --pc-accent: #4c1d95; --pc-accent-2: #6d28d9; --pc-accent-text: #3b0764; --pc-accent-soft: #f3efff;
    --face-hi: #ffffff; --face-lo: #ffffff; --track: #9e9e9e; --surface-shadow: none; --dial-shadow: 0 0 0 2px #000000;
    --ok: #005c2b; --warn: #5c4000;
}
:root:not([data-theme="light"]) .app-shell[data-contrast="high"] {
    --surface: #000000; --surface-2: #141414; --surface-border: #ffffff; --chip: #000000; --chip-border: #ffffff;
    --text: #ffffff; --text-2: #e8e8e8; --text-3: #e8e8e8; --text-strong: #ffffff; --line: #ffffff; --line-strong: #ffffff;
    --field: #000000; --field-border: #ffffff; --tint-brand: #000000; --tint-brand-border: #ffffff;
    --pc-accent: #ffd34d; --pc-accent-2: #ffe28a; --pc-accent-text: #ffd34d; --pc-accent-soft: #2b2400;
    --face-hi: #000000; --face-lo: #000000; --track: #5c5c5c; --dial-shadow: 0 0 0 2px #ffffff;
    --ok: #6dff9e; --warn: #ffd34d;
}
.app-shell[data-contrast="high"] .view-tab.active, .app-shell[data-contrast="high"] .seg button[aria-checked="true"], .app-shell[data-contrast="high"] .chip[aria-pressed="true"] { outline: 2px solid var(--text-strong); outline-offset: 1px; }
.app-shell[data-contrast="high"] .dial .bead { opacity: 1; fill: var(--surface); stroke: var(--text-strong); stroke-width: 1.2; }
.app-shell[data-contrast="high"] .dial .bead.done { fill: var(--text-strong); }
.app-shell[data-contrast="high"] .dial .bead.active { stroke: var(--pc-accent); stroke-width: 3; }
.app-shell[data-contrast="high"] .ctrl, .app-shell[data-contrast="high"] .btn:not(.primary) { border-color: var(--text-strong); }

/* ----- Counter size and motion (the tool's own settings) ----- */
.app-shell[data-size="small"] { --scale: 0.85; }
.app-shell[data-size="large"] { --scale: 1.15; }
.app-shell[data-size="xl"] { --scale: 1.32; }
.app-shell[data-motion="reduce"] *, .app-shell[data-motion="reduce"] *::before, .app-shell[data-motion="reduce"] *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
.app-shell[data-motion="reduce"] .dial.glow .halo { animation: none; }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }

/* ----- Small screens ----- */
@media (max-width: 1023.98px) {
    .app-toolbar { justify-content: center; }
}
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .status-pill { display: none; } /* the practice's name is shown above the counter */
    .view-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; border-radius: 22px; }
    .view-tab { grid-column: span 2; justify-content: center; padding: 8px 6px; }
    .view-tab:nth-child(4), .view-tab:nth-child(5) { grid-column: span 3; }
    .help-btn { width: 100%; }
    .side-col { padding: 16px; }
    .pcard, .tile, .app-shell .chart-card, .app-shell .stats-cols > .card, .app-shell .settings-grid > .card { padding: 16px; }
    .toasts { bottom: 16px; right: 16px; left: 16px; align-items: stretch; }
    .toast { min-width: 0; max-width: none; }
    .dialog-body, .dialog-head, .dialog-actions { padding-left: 16px; padding-right: 16px; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
}
@media (max-width: 420px) {
    .session-head { flex-wrap: nowrap; }
    .practice-btn { flex: 1 1 auto; }
    /* Icons only; the words stay available to screen readers. */
    #modeSeg button { padding: 6px 12px; min-width: 48px; } /* icon only: still a 44 px target (h04) */
    #modeSeg button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .readout { gap: 8px 18px; }
    .ctrl { font-size: 0.8rem; }
}
@media (max-height: 560px) and (orientation: landscape) {
    .dial { width: min(100%, calc(260px * var(--scale)), 70vh); }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .dialog, .toast, .seg button, .chip, .ctrl, .pcard, .arc, .beads, .bead, .bar-fill, .completion, .dial { transition: none; animation: none; }
}

/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The dial is a drawing. */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]) { min-height: 44px; }
    main .chip, main .seg button, main .view-tab, main .btn, main .pcard .actions .btn, main .hrow .actions .btn, main .banner .actions .btn, main .toast button { min-height: 44px; }
    main .chip { min-width: 48px; }
    main .switch-row, main .check-row { min-height: 44px; align-items: center; }
    main :is(p, li, dd, td, .hint, .label, .input, .select, .seg button, .chip, .view-tab, .muted, .lead, .filter, .hrow-meta, .tag, .pill, .switch-row small, .pick span, .table, .notice-text, .banner):not(.chart-val, .practice-kicker) { font-size: 1rem; }
    main .facts dd { font-size: 1rem; }
    .dialog button, .dialog .btn, .dialog input:not([type="checkbox"]), .dialog select { min-height: 44px; }
    .dialog .dialog-close { width: 44px; height: 44px; }
    .dialog :is(p, li, .hint, .label, .input, .select, .pick span) { font-size: 1rem; }
}
