/*
 * Unplug: the tool's own components, styled in the site's design language (11 Nov 2026, on the UltraCompress Pro template,
 * after the Clock, whose shared block the first part of this file copies; it came from Prana Breathing Exercises and the
 * Decision Maker). Base: /libs/site-pages.css (tokens, Inter and Space Grotesk, buttons, theme toggle, focus rings) and
 * /libs/shared-nav.css (the site's header and footer). The second part is the original's components (the day log and its
 * chart, the weeks of a life, the app rows and the feeling strip, the check, the plan, the phone-down and urge windows,
 * the printed plan) on the site's tokens; screen time and time taken back keep the original's two colours as the tool's
 * own tokens, which the drawings read. Light is the default; dark applies when <html> has no data-theme.
 * Assembled once from the Clock's file and the original's style.css, 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;
    --ok-soft: rgba(22, 101, 52, 0.09);
    --bad: #b91c1c;
    --bad-soft: rgba(185, 28, 28, 0.08);
    --warn: #92400e;
    --warn-soft: rgba(217, 119, 6, 0.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;
    --ok-soft: rgba(74, 222, 128, 0.1);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
}

/* ----- 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], .session [hidden] { display: none !important; } /* the script hides parts 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; }
.block { display: block; }
.hint { color: var(--text-3); font-size: 0.8rem; font-weight: 400; line-height: 1.45; }
.err { color: var(--bad); font-size: 0.85rem; font-weight: 600; }
.err: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; }
.link:hover { color: var(--link-hover); }
code { font-size: 0.85em; padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--code-text); }
kbd { font-family: inherit; font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9999px; font-family: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; padding: 12px 24px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.35); padding: 11px 23px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-secondary.btn-sm, .btn-danger.btn-sm { padding: 8px 15px; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; padding: 0; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.icon-btn:hover { border-color: var(--brand); color: var(--link); background: var(--surface); }
.icon-btn.del:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:focus-visible, .link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Toolbar ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.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: 220px; max-width: 100%; }
.status-icon { font-size: 1.3rem; line-height: 1; }
.status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.status-main { font-weight: 700; font-size: 0.85rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-sub { font-size: 0.72rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; }
.view-tab { padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.85rem; 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: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[hidden] { display: none; }
.shell-hint { margin-top: 14px; }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 600; font-size: 0.85rem; color: var(--text-strong); }
.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; }
input[type="time"].input { color-scheme: light; width: 9em; }
:root:not([data-theme="light"]) input[type="time"].input { color-scheme: dark; }
.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; }
.num-input { width: 7.5em; }
.num-input.wide { width: 10em; }
.check-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.925rem; color: var(--text); padding: 4px 0; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.seg button:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.seg button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chip .ico { width: 15px; height: 15px; color: var(--link); }
.chip:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- 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(420px, 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-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; }
.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; 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; }
.confirm-message { margin: 0; color: var(--text); }
.help-body h3 { margin: 6px 0 0; font-size: 1rem; }
.help-body p { margin: 0; color: var(--text-2); }

/* ----- 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.875rem; 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; color: #c4b5fd; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.toast.good { border-left-color: #4ade80; }
.toast.bad { border-left-color: #f87171; }

/* ----- 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); }



/* ===== Unplug components ===== */

/* ----- 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(.dialog) p, :where(.night) p { margin: 0; line-height: 1.5; }
:where(.app-shell) ul, :where(.app-shell) ol { padding: 0; list-style: none; }
:where(.app-shell) h2, :where(.app-shell) h3, :where(.dialog) h3, :where(.night) h2 { margin: 0; line-height: 1.25; }

/* ----- The tool's own colours: screen time and time taken back (the original's, checked for colour-blind separation),
   the weeks lived and ahead, the chart lines. The drawings read them, so they are plain colours. ----- */
:root {
    --screen: #6250d6;
    --screen-wash: rgba(98, 80, 214, 0.12);
    --back: #128f63;
    --back-wash: rgba(18, 143, 99, 0.12);
    --lived: #c9cdd4;
    --ahead: #e4e7eb;
    --grid: #e8eaee;
    --axis: #c3c8d0;
    --muted: #4b5563;
    --pos: #166534;
    --neg: #b91c1c;
}
:root:not([data-theme="light"]) {
    --screen: #9085e9;
    --screen-wash: rgba(144, 133, 233, 0.16);
    --back: #199e70;
    --back-wash: rgba(25, 158, 112, 0.16);
    --lived: #3d434d;
    --ahead: #252a31;
    --grid: #23272e;
    --axis: #3c424c;
    --muted: #9ca3af;
    --pos: #4ade80;
    --neg: #f87171;
}

/* ----- Layout of a view ----- */
.app-toolbar .view-tabs { flex: 0 1 auto; overflow-x: auto; scrollbar-width: thin; }
.toolbar-right { margin-left: auto; } /* when the toolbar wraps, the buttons stay on the right, under the tabs */
.view-tab { display: inline-flex; align-items: center; gap: 7px; position: relative; }
.view-tab .ico { width: 16px; height: 16px; }
.view-tab .short { display: none; }
.screen { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.view-head h2 { font-size: 1.5rem; color: var(--text-strong); }
.view-head .short { display: none; }
.lead { margin-top: 4px; color: var(--text-2); max-width: 72ch; }
.view-body { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.view-body:focus { outline: none; }
.section { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--surface-border); padding-top: 18px; min-width: 0; }
.section--first { border-top: 0; padding-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.section-head--gap { margin-top: 22px; }
.section-head h2 { font-size: 1.15rem; color: var(--text-strong); }
.section-head p { color: var(--text-2); font-size: 0.875rem; }
.section-note { color: var(--text-2); font-size: 0.875rem; max-width: 72ch; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 48px; align-items: start; }
@media (min-width: 1024px) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); padding: 20px; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.empty { color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: 14px; padding: 24px 12px; text-align: center; font-size: 0.925rem; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ico { width: 32px; height: 32px; color: var(--text-3); stroke-width: 1.6; }
.banner { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 1.25rem; border-radius: 14px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); font-size: 0.925rem; color: var(--text); }
.banner .ico { color: var(--link); }
.banner-text { flex: 1 1 220px; font-weight: 600; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* keys beside chart and grid labels: the colour sits next to the text, never on it */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.85rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.key { width: 11px; height: 11px; border-radius: 3px; background: var(--k); flex: none; display: inline-block; }
.key.line { height: 0; border-top: 2px solid var(--k); background: none; width: 16px; border-radius: 0; }
.key.ring { background: transparent; box-shadow: inset 0 0 0 1.5px var(--k); }
.key.dot { border-radius: 50%; }
.k-screen { --k: var(--screen); }
.k-back { --k: var(--back); }
.k-lived { --k: var(--lived); }
.k-ink { --k: var(--text-strong); }
.k-ahead { --k: var(--ahead); box-shadow: inset 0 0 0 1px var(--line-strong); }

.tip { position: fixed; z-index: 3100; pointer-events: none; max-width: 290px; background: var(--text-strong); color: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 0.85rem; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.tip b { display: block; margin-bottom: 2px; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }

/* figures: one big number per view, the rest as plain readouts */
.figure { font-family: 'Inter', system-ui, sans-serif; font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.figure small { font-size: 0.4em; font-weight: 600; letter-spacing: 0; color: var(--text-2); margin-left: 6px; }
.figure--quiet { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.figure.muted { color: var(--text-2); }
.vs { font-size: 1.05rem; max-width: 60ch; margin-top: 10px; color: var(--text); }
.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; }
.day-summary .readouts { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.readout { border-top: 1px solid var(--surface-border); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.readout .rl { color: var(--text-2); font-size: 0.85rem; }
.readout .rv { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.readout .rv--text { font-size: 1rem; }
.readout .rd { font-size: 0.82rem; color: var(--text-2); }
.chart-host { min-width: 0; }
.chart { width: 100%; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: 'Inter', system-ui, sans-serif; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .bar { fill: var(--screen); }
.chart .goal { stroke: var(--text-strong); stroke-width: 2; fill: none; stroke-linejoin: round; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .nodata { fill: var(--line-strong); }
.chart .sel { fill: var(--screen-wash); }

/* ----- Today ----- */
.day-nav { display: flex; align-items: center; gap: 8px; }
.day-nav h2 { font-size: 1.5rem; color: var(--text-strong); }
.day-nav .icon-btn { border-color: var(--surface-border); background: var(--surface); }
.day-nav .icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.day-pick { position: relative; display: inline-flex; align-items: center; cursor: pointer; border-radius: 10px; padding: 0 6px; }
.day-pick:hover { background: var(--surface-2); }
.day-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.day-pick:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px 32px; align-items: start; }
@media (min-width: 1024px) { .today-grid { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); } }
.log-form { display: flex; flex-direction: column; gap: 16px; }
.log-form .input.num { font-size: 1.05rem; }
.hm { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.suffix-wrap { position: relative; display: block; }
.suffix-wrap .input { padding-right: 58px; }
.suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; font-size: 0.9rem; }
.mood { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mood button { min-height: 44px; border: 1px solid var(--chip-border); background: var(--surface); border-radius: 9999px; font-family: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-2); padding: 4px 2px; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease; }
.mood button:hover { border-color: var(--brand); color: var(--link); }
.mood button[aria-checked="true"] { background: var(--gradient-brand); border-color: transparent; color: #fff; }
.mood button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
details.where summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--link); }
details.where[open] summary { margin-bottom: 8px; }
details.where p { font-size: 0.875rem; color: var(--text-2); margin-bottom: 6px; }
.day-summary { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.meter { position: relative; height: 12px; border-radius: 6px; background: var(--screen-wash); overflow: visible; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; max-width: 100%; border-radius: 6px; background: var(--screen); }
.meter b { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--text-strong); border-radius: 1px; }
.meter-scale { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--text-2); margin-top: 6px; }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--surface-border); }
.task:last-child { border-bottom: 0; }
.task input[type="checkbox"] { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--back); cursor: pointer; }
.task .tt { font-weight: 600; font-size: 0.95rem; color: var(--text-strong); overflow-wrap: anywhere; }
.task .th { color: var(--text-2); font-size: 0.85rem; margin-top: 2px; overflow-wrap: anywhere; }
.task .tk { font-size: 0.75rem; color: var(--text-3); font-weight: 600; margin-right: 6px; }
.task.done .tt { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--text-2); }
.task label { cursor: pointer; }
.task .icon-btn { border-color: var(--surface-border); }
.keep { display: flex; flex-wrap: wrap; gap: 6px; }
.keep .chip { gap: 8px; cursor: pointer; }
.keep .chip input { width: 18px; height: 18px; margin: 0; accent-color: var(--back); }
.keep .chip.on { border-color: var(--back); background: var(--back-wash); color: var(--text-strong); }
.label.small { font-size: 0.8rem; color: var(--text-2); }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--surface-border); font-size: 0.925rem; }
.num-table { border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; min-width: 420px; }
.num-table th { text-align: left; font-weight: 600; color: var(--text-2); padding: 6px 16px 6px 0; border-bottom: 1px solid var(--line-strong); }
.num-table td { padding: 6px 16px 6px 0; border-bottom: 1px solid var(--surface-border); }

/* ----- Your time ----- */
.time-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
@media (min-width: 900px) { .time-controls { grid-template-columns: repeat(3, minmax(0, 170px)) minmax(240px, 1fr); } }
.time-controls .slider-field { grid-column: 1 / -1; }
@media (min-width: 900px) { .time-controls .slider-field { grid-column: auto; } }
.slider-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.slider-top output { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.range { width: 100%; margin: 0; min-height: 32px; accent-color: var(--screen); }
.range.back { accent-color: var(--back); }
.statement { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.35rem, 3vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; max-width: 32ch; color: var(--text-strong); }
.statement-sub { color: var(--text-2); max-width: 70ch; margin-top: 8px; }
.weeks-wrap { position: relative; width: 100%; }
.weeks { display: block; width: 100%; touch-action: pan-y; }
.weeks-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 40px; align-items: start; }
@media (min-width: 1100px) { .weeks-layout { grid-template-columns: minmax(0, 1fr) 260px; } }
.wkey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 24px; }
@media (min-width: 1100px) { .wkey { grid-template-columns: minmax(0, 1fr); } }
.wkey li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--surface-border); font-size: 0.875rem; color: var(--text); }
.wkey li .key { align-self: center; }
.wkey li b { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.take-back { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 32px; align-items: center; }
@media (min-width: 900px) { .take-back { grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); } }
.take-back .out { font-size: 1.1rem; max-width: 52ch; color: var(--text); }
.swaps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px 24px; }
.swap { border-top: 2px solid var(--back); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.swap .sv { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-strong); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.swap .su { font-weight: 600; color: var(--text); }
.swap .sn { color: var(--text-2); font-size: 0.82rem; }
.swap.money { border-top-color: var(--text-strong); }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 16px; max-width: 760px; }
.pay-grid .select { width: 100%; }

/* ----- Your apps ----- */
.add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.add-row .input { max-width: 280px; flex: 1 1 180px; }
.app-list { display: flex; flex-direction: column; padding-top: 8px; padding-bottom: 8px; }
.app-head, .app-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px 10px; align-items: center; }
.app-row { grid-template-areas: "name del" "nums nums" "opts opts" "verdict verdict"; padding: 14px 0; border-bottom: 1px solid var(--surface-border); }
.app-row:last-child { border-bottom: 0; }
.app-row .name-cell { grid-area: name; display: flex; gap: 8px; align-items: center; min-width: 0; }
.app-row .nums-cell { grid-area: nums; }
.app-row .opts-cell { grid-area: opts; }
.app-row .verdict { grid-area: verdict; font-size: 0.875rem; display: flex; flex-direction: column; gap: 2px; color: var(--text); overflow-wrap: anywhere; }
.app-row .verdict b { font-weight: 700; color: var(--text-strong); }
.app-row .del-cell { grid-area: del; }
.app-row .del-cell:hover { border-color: var(--danger); color: var(--danger); }
.app-head { display: none; color: var(--text-2); font-size: 0.82rem; font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--surface-border); }
.app-row .name-cell .input { font-weight: 600; }
.app-row .nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.app-row .opts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.app-row .opts .seg { justify-self: start; }
.app-row .opts .urgent { grid-column: 2; }
.app-row .urgent { font-size: 0.875rem; padding: 0; align-items: center; }
.app-row .urgent input { width: 18px; height: 18px; margin: 0; }
.app-row .mlabel { font-size: 0.8rem; color: var(--text-2); font-weight: 600; }
.seg.feel button { min-width: 64px; }
@media (min-width: 1200px) {
    .app-head { display: grid; }
    .app-head, .app-row { grid-template-columns: minmax(150px, 1.1fr) minmax(180px, 0.9fr) minmax(340px, 2fr) minmax(170px, 1fr) 44px; gap: 10px 14px; }
    .app-row { grid-template-areas: "name nums opts verdict del"; }
    .app-row .mlabel { display: none; }
    .app-row .opts { display: flex; flex-wrap: wrap; gap: 8px 12px; }
}
.apps-out { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 48px; align-items: start; }
@media (min-width: 1100px) { .apps-out { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.strip .lane { fill: var(--surface-2); }
.strip .lane-label { fill: var(--text-strong); font-size: 12px; font-weight: 600; }
.strip .dot { fill: var(--screen); stroke: var(--bg); stroke-width: 2; }
.strip .dot-label { fill: var(--text-strong); font-size: 12px; }
.change-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.change-list li { padding: 10px 0; border-bottom: 1px solid var(--surface-border); display: flex; flex-direction: column; gap: 2px; }
.change-list li:last-child { border-bottom: 0; }
@media (min-width: 1100px) {
    .span-all { grid-column: 1 / -1; }
    .span-all .change-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; }
    .span-all .change-list li:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}
.change-list .ct { font-weight: 600; color: var(--text-strong); overflow-wrap: anywhere; }
.change-list .ch { color: var(--text-2); font-size: 0.85rem; overflow-wrap: anywhere; }

/* ----- Check ----- */
.quiz { display: flex; flex-direction: column; gap: 20px; max-width: 980px; }
.quiz-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.quiz-progress i { display: block; height: 100%; background: var(--gradient-brand); transition: width 0.25s; }
.q-num { color: var(--text-2); font-weight: 600; font-size: 0.9rem; }
.q-text { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; max-width: 40ch; color: var(--text-strong); }
.scale { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 760px) { .scale { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.scale button { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 52px; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-weight: 600; font-size: 0.92rem; color: var(--text); cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease; }
@media (min-width: 760px) { .scale button { flex-direction: column; justify-content: center; text-align: center; gap: 4px; min-height: 88px; } }
.scale button:hover { border-color: var(--brand); transform: translateY(-1px); }
.scale button[aria-checked="true"] { background: var(--gradient-brand); border-color: transparent; color: #fff; }
.scale button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.scale button[aria-checked="true"] kbd { background: transparent; color: inherit; border-color: currentColor; }
.scale-ends { display: none; justify-content: space-between; color: var(--text-2); font-size: 0.82rem; }
@media (min-width: 760px) { .scale-ends { display: flex; } }
.quiz-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.score-scale { position: relative; height: 14px; border-radius: 7px; background: var(--screen-wash); margin-top: 8px; }
.score-scale i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--screen); }
.score-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 0.8rem; color: var(--text-2); margin-top: 6px; }
.items { display: flex; flex-direction: column; gap: 10px; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 16px; align-items: center; }
@media (min-width: 640px) { .item-row { grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) 7.5em; } }
.item-row .il { font-size: 0.9rem; color: var(--text); }
.item-row .ib { height: 10px; border-radius: 5px; background: var(--screen-wash); position: relative; }
.item-row .ib i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--screen); border-radius: 5px; }
.item-row .iv { font-size: 0.82rem; color: var(--text-2); }

/* ----- Plan ----- */
.setup { display: flex; flex-direction: column; gap: 22px; max-width: 1040px; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.area { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; min-height: 64px; border: 1px solid var(--chip-border); border-radius: 14px; background: var(--surface); font-family: inherit; color: var(--text); cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease; }
.area:hover { border-color: var(--brand); transform: translateY(-1px); }
.area:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.area .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); flex: none; margin-top: 1px; display: grid; place-items: center; }
.area .box .ico { width: 14px; height: 14px; stroke-width: 3; visibility: hidden; }
.area[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--tint-brand); }
.area[aria-pressed="true"] .box { background: var(--gradient-brand); border-color: transparent; color: #fff; }
.area[aria-pressed="true"] .box .ico { visibility: visible; }
.area b { display: block; font-size: 0.92rem; color: var(--text-strong); }
.area small { display: block; color: var(--text-2); font-size: 0.8rem; line-height: 1.35; margin-top: 2px; }
.area .sugg { color: var(--link); font-weight: 600; }
.setup-row { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-start; }
.setup-row label.field { flex: 1 1 10rem; max-width: 14rem; }
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 40px; align-items: start; }
@media (min-width: 1100px) {
    .plan-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); }
    .plan-rail { position: sticky; top: 97px; }
}
.plan-rail { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.days { display: flex; flex-direction: column; }
.pday { border-top: 1px solid var(--surface-border); padding: 14px 0 10px; display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 97px; }
.pday.today { border-top: 2px solid var(--brand); }
.pday.past .tt { font-weight: 500; }
.pday-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.pday-head h3 { margin: 0; font-size: 1rem; color: var(--text-strong); }
.pday-head .day-date { font-weight: 500; }
.pday-head .meta { color: var(--text-2); font-size: 0.85rem; display: inline-flex; gap: 6px 14px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; padding: 2px 9px; border-radius: 9999px; background: var(--gradient-brand); color: #fff; vertical-align: 2px; margin-left: 6px; }
.keep-line { font-size: 0.85rem; color: var(--text-2); overflow-wrap: anywhere; }
.ring-figure { display: flex; align-items: center; gap: 18px; }
.ring-figure svg { width: 96px; height: 96px; flex: none; }
.ring-figure .track { stroke: var(--back-wash); }
.ring-figure .fill { stroke: var(--back); }
.ring-figure text { fill: var(--text-strong); font-weight: 700; font-size: 20px; font-family: 'Inter', system-ui, sans-serif; }
.ring-figure b { color: var(--text-strong); }
.rest-day { color: var(--text-2); font-size: 0.9rem; padding: 4px 0; }

/* ----- The phone-down timer and the urge pause: the tool's own full-screen windows, black in both themes ----- */
.night { border: 0; padding: 0; margin: 0; width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; background: #000; color: #e9ebee; }
.night::backdrop { background: #000; }
html:has(dialog.night[open]) { overflow: hidden; }
.night[open] { animation: fade 0.3s ease-out; }
@keyframes fade { from { opacity: 0; } }
.night-body { position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); text-align: center; }
@media (min-width: 640px) { .night-body { padding-left: 24px; padding-right: 24px; } }
.night h2 { font-size: 1.3rem; font-weight: 600; color: #f2f3f5; }
.night p { color: #b4bac3; max-width: 46ch; }
.night .btn-secondary { background: transparent; color: #e9ebee; border-color: #4a505a; }
.night .btn-secondary:hover:not(:disabled) { background: #15181c; border-color: #c4b5fd; color: #fff; }
.night .icon-btn { width: 44px; height: 44px; background: transparent; color: #e9ebee; border: 1px solid #4a505a; border-radius: 50%; }
.night .icon-btn:hover { border-color: #c4b5fd; color: #fff; background: #15181c; }
.night .close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 16px; }
.night .seg { justify-content: center; }
.night .seg button { background: #111317; border-color: #3a3f47; color: #c9ced6; }
.night .seg button:hover { border-color: #c4b5fd; color: #fff; }
.night .seg button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.night .actions { justify-content: center; }
.dial { width: min(72vw, 340px); height: auto; aspect-ratio: 1; }
.dial .track { stroke: #1d2126; }
.dial .arc { stroke: #199e70; transition: stroke-dashoffset 0.9s linear; }
.dial .left { fill: #f2f3f5; font-size: 44px; font-weight: 300; letter-spacing: -1px; font-variant-numeric: tabular-nums; font-family: 'Inter', system-ui, sans-serif; }
.dial .sub { fill: #a3aab4; font-size: 13px; font-family: 'Inter', system-ui, sans-serif; }
.wave-box { width: min(86vw, 560px); }
.wave-box svg { width: 100%; height: auto; display: block; }
.wave-box .sea { fill: rgba(144, 133, 233, 0.22); }
.wave-box .crest { fill: none; stroke: #9085e9; stroke-width: 2.5; }
.breath { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 300; color: #f2f3f5; min-height: 1.3em; }
.urge-count { font-variant-numeric: tabular-nums; color: #a3aab4; }

/* ----- Windows ----- */
.dialog .field > .label { font-weight: 600; font-size: 0.85rem; color: var(--text-strong); }
.set-group { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--surface-border); }
.set-group:first-child { border-top: 0; padding-top: 0; }
.set-group h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.aim-input { max-width: 12rem; }
.shortcuts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.shortcuts li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shortcuts li span:last-child { color: var(--text-2); text-align: right; }
.help-body:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ----- The printed plan ----- */
.print-sheet { display: none; }
@media print {
    @page { margin: 16mm; }
    body { background: #fff; color: #000; display: block; padding: 0; }
    body > *:not(#printSheet) { display: none !important; }
    .print-sheet { display: block !important; font-size: 10.5pt; color: #000; font-family: 'Inter', Arial, sans-serif; }
    .print-sheet h1 { font-size: 18pt; margin: 0 0 2pt; }
    .print-sheet .sub { color: #444; margin-bottom: 10pt; }
    .print-sheet h2 { font-size: 11.5pt; border-bottom: 1pt solid #000; padding-bottom: 2pt; margin: 12pt 0 4pt; break-after: avoid; }
    .print-sheet ul { margin: 0; padding-left: 0; list-style: none; }
    .print-sheet li { margin-bottom: 3pt; break-inside: avoid; }
    .print-sheet li::before { content: "[  ]  "; font-family: ui-monospace, Consolas, monospace; }
    .print-sheet .keep { color: #444; font-size: 9.5pt; margin-top: 3pt; display: block; }
    .print-sheet .day { break-inside: avoid; }
}

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .status-pill { min-width: 0; flex: 1 1 auto; }
    /* five tabs at 16 px do not fit one row on a phone: three, then two wider ones */
    .app-toolbar .view-tabs { width: 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; border-radius: 24px; }
    .view-tab { grid-column: span 2; justify-content: center; padding: 8px 6px; gap: 5px; min-width: 0; }
    .view-tab:nth-child(n+4) { grid-column: span 3; }
    .view-tab .long { display: none; }
    .view-tab .short { display: inline; }
    .toolbar-right .btn { flex: 1 1 auto; }
    .card { padding: 16px; }
    .app-row .opts { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .app-row .opts .urgent { grid-column: 1; }
    .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: 560px) {
    .view-head .long { display: none; }
    .view-head .short { display: inline; }
    .view-head .actions { width: 100%; }
    .view-head .actions .btn { flex: 1; padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 459px) {
    .view-tab .ico { display: none; }
    .mood button { font-size: 0.78rem; }
}
@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .dialog, .dialog[open], .toast, .seg button, .chip, .view-tab, .area, .scale button, .mood button,
    .night[open], .dial .arc, .quiz-progress i { transition: none; animation: none; }
}
@media (forced-colors: active) {
    .key, .meter i, .score-scale i, .item-row .ib i { forced-color-adjust: none; }
}
/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The charts and the weeks are drawings. */
@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 .seg button, main .view-tab, main .chip, main .mood button { min-height: 44px; }
    main .icon-btn { width: 44px; height: 44px; min-width: 44px; }
    main .range { min-height: 44px; }
    main .check-row, main .keep .chip { min-height: 44px; }
    main :is(p, li, .hint, .label, .status-main, .status-sub, .form-hint, .input, .select, kbd, .seg button, .chip, .muted,
        .lead, .section-note, .readout .rl, .readout .rd, .meter-scale, .score-ends, .legend, .task .th, .task .tk, .keep-line,
        .change-list .ch, .app-row .verdict, .app-row .mlabel, .app-row .urgent, .item-row .il, .item-row .iv, .swap .sn,
        .wkey li, .area small, .history li, .num-table, .view-tab, .mood button, .pday-head .meta, details.where summary,
        .scale button, .q-num, .label.small, .rest-day) { font-size: 1rem; }
    .dialog button, .dialog .btn, .dialog select, .dialog input:not([type="checkbox"]):not([type="range"]) { min-height: 44px; }
    .dialog .dialog-close, .dialog .icon-btn { width: 44px; height: 44px; }
    .dialog :is(p, .hint, .label, .input, li, kbd) { font-size: 1rem; }
    .night :is(p, .btn, .seg button) { font-size: 1rem; }
    .night .btn, .night .seg button { min-height: 44px; }
}
