/*
 * Chronos: the tool's own components, styled in the site's design language (12 Nov 2026, on the UltraCompress Pro template,
 * after Unplug, whose shared block the first part of this file copies; it came from the Clock, 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 dial, the plan
 * and done timeline, the waiting tasks, the week board, goals and routines, tasks and the urgent and important boxes, the
 * focus ring, the insights charts, the now bar, the windows) on the site's tokens; the category colours, the dial's rings
 * and the heat map keep the original's palettes as the tool's own tokens (checked for colour-blind separation). Light is
 * the default; dark applies when <html> has no data-theme.
 * Assembled once from Unplug'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); }




/* ===== Chronos 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(.dialog) ul, :where(.dialog) li { 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 { margin: 0; line-height: 1.25; }
:where(.app-shell) table { margin: 0; }

/* ----- The tool's own colours: categories (slots 1 to 8 checked for colour-blind separation, 0 the grey of Other), the dial,
   the timeline and the charts. The drawings read them, so they are plain colours. ----- */
:root {
    --muted: #4b5563;
    --cat-0: #8a8f98; --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100;
    --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #6250d6; --cat-8: #e34948;
    --face: #ffffff; --ring-1: #e9ebef; --ring-2: #f0f1f4; --night: #dde0e6; --now: #0a0a14;
    --past: rgba(10, 10, 20, 0.035); --hour-line: #e6e8ec; --half-line: #f1f2f4; --wash: 15%; --fill: 34%;
    --series: #2a78d6; --plan-wash: #c9d3e0; --grid: #e6e8ec; --axis: #c3c8d0;
    --heat-0: #f0f1f4; --heat-1: #cde2fb; --heat-2: #9ec5f4; --heat-3: #6da7ec; --heat-4: #3987e5; --heat-5: #256abf; --heat-6: #184f95;
    --feel-ink-1: #0a0a14; --feel-ink-2: #0a0a14; --feel-ink-3: #0a0a14; --feel-ink-4: #0a0a14; --feel-ink-5: #ffffff;
    --hdr: 81px;
    --axis-w: 58px;
}
:root:not([data-theme="light"]) {
    --muted: #9ca3af;
    --cat-0: #7c838e; --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500;
    --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9; --cat-8: #e66767;
    --face: #14141f; --ring-1: #23272e; --ring-2: #1d2026; --night: #2c3139; --now: #e5e7eb;
    --past: rgba(255, 255, 255, 0.025); --hour-line: #262a31; --half-line: #1c1f25; --wash: 24%; --fill: 46%;
    --series: #3987e5; --plan-wash: #3a4250; --grid: #2c2f36; --axis: #3c424c;
    --heat-0: #1d2026; --heat-1: #104281; --heat-2: #184f95; --heat-3: #1c5cab; --heat-4: #256abf; --heat-5: #3987e5; --heat-6: #86b6ef;
    --feel-ink-1: #ffffff; --feel-ink-2: #ffffff; --feel-ink-3: #ffffff; --feel-ink-4: #ffffff; --feel-ink-5: #0a0a14;
}
@media (max-width: 639.98px) { :root { --hdr: 65px; --axis-w: 40px; } }

/* ----- Toolbar, now bar and the views ----- */
.app-toolbar .view-tabs { flex: 0 1 auto; overflow-x: auto; scrollbar-width: thin; }
.toolbar-right { margin-left: auto; }
.view-tab { display: inline-flex; align-items: center; gap: 7px; position: relative; }
.view-tab .ico { width: 16px; height: 16px; }
.nowbar { position: sticky; top: var(--hdr); z-index: 20; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 0 0 1.25rem; padding: 6px 6px 6px 16px; min-height: 58px; border-radius: 9999px; border: 1px solid var(--surface-border); background: var(--surface); box-shadow: var(--surface-shadow); }
.nb-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c, var(--line-strong)); box-shadow: 0 0 0 4px color-mix(in oklab, var(--c, var(--line-strong)) 22%, transparent); }
.nowbar.running .nb-dot { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px color-mix(in oklab, var(--c, var(--line-strong)) 10%, transparent); } }
.nb-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.nb-title { font-weight: 700; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-sub { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-actions { display: flex; gap: 6px; align-items: center; }
.num { font-variant-numeric: tabular-nums; }
.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; }
.view-head h2, .day-name h2 { font-size: 1.5rem; }
.lead { margin-top: 4px; color: var(--text-2); max-width: 72ch; }
.block { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; min-height: 34px; }
.block-head h3 { font-size: 1.05rem; }
.count { color: var(--muted); font-weight: 500; font-size: 0.9rem; margin-left: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--cat-0)); display: inline-block; flex: none; }
.empty { color: var(--text-2); font-size: 0.9rem; }
.empty--examples { padding: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.icon-btn { border-color: var(--line); background: var(--surface); }
.icon-btn:disabled { opacity: 0.45; cursor: default; }
.icon-btn.quiet { border-color: transparent; background: transparent; }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.small .ico { width: 16px; height: 16px; }
.btn.big { font-size: 1rem; padding: 14px 26px; }
.btn-secondary.big { padding: 13px 25px; }
.actions.center { justify-content: center; }
.spacer { flex: 1; }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.chip[aria-pressed="true"] .ico, .chip[aria-checked="true"] .ico { color: inherit; }
.chip .dot { box-shadow: 0 0 0 2px var(--surface); }
.seg button .ico { width: 16px; height: 16px; }
.switch { width: 46px; height: 28px; border-radius: 14px; flex: none; padding: 0; position: relative; border: 0; background: var(--line-strong); cursor: pointer; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch::before { content: ""; position: absolute; inset: -8px -2px; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 0.925rem; color: var(--text); }
.switches { display: flex; flex-direction: column; gap: 12px; }
.field-row { display: flex; gap: 12px 16px; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 140px; }
.textarea { width: 100%; min-height: 72px; 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); resize: vertical; line-height: 1.45; }
.textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); outline: none; }
.input.narrow { width: auto; min-width: 120px; }
.select:disabled { opacity: 0.55; }
input[type="date"].input { color-scheme: light; }
:root:not([data-theme="light"]) input[type="date"].input { color-scheme: dark; }
.table-wrap { overflow-x: auto; min-width: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--text); }
.data-table th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

/* ----- The day head and the quick-add box ----- */
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.day-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.day-name { display: flex; flex-direction: column; margin-left: 6px; min-width: 0; }
.day-name h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-rel { color: var(--muted); font-size: 0.875rem; min-height: 1.3em; }
.pick { position: relative; }
.pick input { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.quick { display: flex; flex-direction: column; gap: 6px; }
.quick-box { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 4px 4px 16px; border: 1px solid var(--field-border); border-radius: 9999px; background: var(--field); }
.quick-box > .ico { color: var(--muted); }
.quick-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.quick-input { flex: 1; min-width: 0; border: 0; background: transparent; font-family: inherit; font-size: 1rem; color: var(--text); padding: 8px 0; outline: none; }
.quick-input::placeholder { color: var(--placeholder); }
.quick-box .quick-input:focus-visible { outline: none; } /* the box around it shows the focus */
.quick-read { min-height: 1.6em; font-size: 0.85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quick-read .bit { padding: 1px 9px; border-radius: 9999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-variant-numeric: tabular-nums; }
.quick-read .kind { font-weight: 600; color: var(--text-strong); }

/* ----- Today: dial, timeline, waiting tasks ----- */
.today { display: grid; gap: 24px 32px; align-items: start; grid-template-columns: minmax(0, 1fr); grid-template-areas: "dial" "inbox" "tl"; }
.dial-col { grid-area: dial; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tl-col { grid-area: tl; min-width: 0; }
.inbox-col { grid-area: inbox; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (min-width: 640px) and (max-width: 899.98px) {
    .dial-col { display: grid; grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr); gap: 8px 24px; align-items: center; }
    .dial-col .dial { grid-row: 1 / span 2; }
}
@media (min-width: 900px) { .today { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); grid-template-areas: "dial tl" "inbox tl"; } }
@media (min-width: 1240px) { .today { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(240px, 300px); grid-template-areas: "dial tl inbox"; } }
.dial { position: relative; width: min(100%, 340px, 80vw); aspect-ratio: 1 / 1; margin: 0 auto; }
.dial-svg { width: 100%; height: 100%; display: block; overflow: visible; touch-action: manipulation; max-width: none; }
.d-face { fill: var(--face); stroke: var(--line); stroke-width: 1; }
.d-track { fill: none; stroke: var(--ring-1); }
.d-track.inner { stroke: var(--ring-2); }
.d-night { fill: none; stroke: var(--night); }
.d-arc { fill: none; cursor: pointer; }
.d-arc.missed { opacity: 0.4; }
.d-arc.live { opacity: 0.85; }
.d-arc:hover, .d-arc.hot { filter: brightness(1.08) saturate(1.1); }
.d-tick { stroke: var(--axis); stroke-width: 1; }
.d-tick.major { stroke: var(--muted); stroke-width: 1.5; }
.d-label { fill: var(--muted); font-size: 11px; font-weight: 500; font-family: 'Inter', sans-serif; font-variant-numeric: tabular-nums; }
.d-label.main { fill: var(--text-strong); font-size: 12px; font-weight: 700; }
.d-hand { stroke: var(--now); stroke-width: 3; stroke-linecap: round; }
.d-knob { fill: var(--now); stroke: var(--face); stroke-width: 2; }
.dial-mid { position: absolute; inset: 30%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3px; pointer-events: none; min-width: 0; color: var(--text); }
.dm-clock { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.9rem, 7vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; color: var(--text-strong); }
.dm-clock small { font-size: 0.42em; font-weight: 600; margin-left: 3px; letter-spacing: 0; color: var(--muted); }
.dm-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-top: 6px; }
.dm-title { font-weight: 600; font-size: 0.95rem; line-height: 1.2; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.dm-sub { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dial-mid > * { flex-shrink: 0; }
.dm-big { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(1.25rem, 4.6vw, 1.55rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--text-strong); }
.tip { position: absolute; z-index: 15; pointer-events: none; max-width: 240px; background: var(--text-strong); color: var(--face); padding: 6px 10px; border-radius: 8px; font-size: 0.8rem; line-height: 1.35; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); transform: translate(-50%, calc(-100% - 10px)); white-space: normal; }
.tip b { display: block; font-weight: 700; }
.day-sum { font-size: 0.925rem; color: var(--text-2); max-width: 46ch; }
.day-sum b { color: var(--text-strong); font-weight: 600; }
.cat-sum { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cat-sum li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; color: var(--text); }
.cat-sum .cs-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-sum .cs-val { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-sum .cs-bar { grid-column: 2 / -1; height: 4px; border-radius: 2px; background: var(--ring-1); position: relative; overflow: hidden; }
.cat-sum .cs-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--c); }

/* ----- The timeline board (day and week): it scrolls in its own box, its head stays at the box's top ----- */
.tl-scroll { position: relative; overflow: auto; overscroll-behavior: contain; max-height: max(360px, calc(100vh - var(--hdr) - 100px)); border: 1px solid var(--surface-border); border-radius: 16px; background: var(--surface); scrollbar-width: thin; }
@supports (height: 100dvh) { .tl-scroll { max-height: max(360px, calc(100dvh - var(--hdr) - 100px)); } }
.tl-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tl-head { display: grid; grid-template-columns: var(--axis-w) minmax(0, 1.7fr) minmax(0, 1fr); align-items: end; position: sticky; top: 0; z-index: 8; background: var(--surface); padding: 6px 0 4px; border-bottom: 1px solid var(--line); }
.tl-head .lane-name { grid-row: 1; font-size: 0.85rem; font-weight: 700; padding-left: 8px; color: var(--text-strong); }
.tl-head .lane-name:first-child { grid-column: 2; }
.tl-head .lane-name.done { grid-column: 3; }
.tl-tools { grid-column: 3; grid-row: 1; justify-self: end; display: flex; gap: 0; margin-bottom: -4px; }
.tl-tools .icon-btn { width: 34px; height: 34px; }
.board { position: relative; display: grid; grid-template-columns: var(--axis-w) minmax(0, 1fr); user-select: none; -webkit-user-select: none; padding: 8px 0; }
.b-axis { position: relative; }
.b-axis span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.b-axis span:first-child { transform: none; }
.b-axis .now-tag { color: var(--face); background: var(--now); border-radius: 6px; padding: 1px 4px; right: 2px; font-size: 0.7rem; font-weight: 700; z-index: 2; }
.b-cols { display: grid; grid-template-columns: var(--cols); position: relative; border-left: 1px solid var(--line); }
.b-col { position: relative; height: var(--h); border-right: 1px solid var(--line); min-width: 0; background-image: linear-gradient(to bottom, var(--hour-line) 1px, transparent 1px), linear-gradient(to bottom, var(--half-line) 1px, transparent 1px); background-size: 100% var(--hour), 100% var(--hour); background-position: 0 0, 0 calc(var(--hour) / 2); touch-action: pan-y; }
.b-col:last-child { border-right: 0; }
.b-col.lane-done, .b-col.off { background-color: var(--surface-2); }
.b-col.today-col { background-color: color-mix(in oklab, var(--brand) 5%, var(--surface)); }
.b-past { position: absolute; left: 0; right: 0; top: 0; background: var(--past); pointer-events: none; }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--now); z-index: 6; pointer-events: none; }
.now-line.pin::before { content: ""; position: absolute; left: -6px; top: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--now); }
.free { position: absolute; left: 8px; right: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.75rem; pointer-events: none; }
.free span { background: var(--surface); padding: 0 6px; border-radius: 6px; }
.item { --c: var(--cat-0); position: absolute; left: calc(var(--l, 0%) + 3px); width: calc(var(--w, 100%) - 6px); top: var(--t); height: var(--ht); border-radius: 8px; overflow: hidden; color: var(--text); cursor: grab; z-index: 2; background: color-mix(in oklab, var(--c) var(--wash), var(--surface)); border: 1px solid color-mix(in oklab, var(--c) 34%, transparent); border-left: 4px solid var(--c); padding: 3px 7px; display: flex; flex-direction: column; font-size: 0.82rem; line-height: 1.25; touch-action: pan-y; transition: box-shadow 0.15s; }
.item.has-tick { padding-right: 26px; }
.item:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.item:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; z-index: 7; }
.item .it-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; color: var(--text-strong); }
.item .it-title > span { overflow: hidden; text-overflow: ellipsis; }
.item .it-title .ico { width: 13px; height: 13px; flex: none; }
.item .it-time { color: var(--text-2); font-size: 0.75rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.short { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.item.short .it-title { flex: 0 1 auto; min-width: 3.5em; }
.item.short .it-time { flex: 0 1000 auto; min-width: 0; }
.item.tiny { padding: 0 4px 0 5px; font-size: 0.72rem; }
.item.tiny .it-time { display: none; }
.item.missed { background: var(--surface-2); border-style: dashed; border-left-style: solid; }
.item.k-entry { border: 0; border-radius: 6px; background: color-mix(in oklab, var(--c) var(--fill), var(--surface)); padding-right: 6px; }
.item.k-entry.live { box-shadow: inset 0 -3px 0 var(--c); }
:root:not([data-theme="light"]) .item.k-entry .it-time { color: var(--text); } /* on the darker fill of done time */
.item.dragging { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 0 2px var(--c); z-index: 9; opacity: 0.95; cursor: grabbing; transition: none; }
.item.ghost { border-style: dashed; border-left-style: solid; opacity: 0.85; pointer-events: none; z-index: 8; }
.it-tick { position: absolute; z-index: 3; top: calc(var(--t) + 3px); left: calc(var(--l, 0%) + var(--w, 100%) - 26px); width: 20px; height: 20px; border-radius: 50%; padding: 0; border: 1.5px solid color-mix(in oklab, var(--c) 70%, var(--text)); background: var(--surface); display: grid; place-items: center; color: transparent; cursor: pointer; }
.it-tick .ico { width: 12px; height: 12px; stroke-width: 3; }
.it-tick[aria-checked="true"] { background: var(--text-strong); border-color: var(--text-strong); color: var(--surface); }
.it-tick.short { top: calc(var(--t) + min(var(--ht), 44px) / 2 - 9px); width: 18px; height: 18px; }
.it-tick.tiny { display: none; }
.it-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; }
.it-grip::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: var(--c); opacity: 0; transition: opacity 0.15s; }
.item:hover .it-grip::after, .item:focus-visible .it-grip::after, .item.dragging .it-grip::after { opacity: 0.8; }
.drop-ghost { position: fixed; z-index: 200; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-left: 4px solid var(--c); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); font-weight: 600; font-size: 0.875rem; transform: translate(-50%, -120%); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
body.dragging-any { cursor: grabbing; }
body.dragging-any * { cursor: grabbing !important; }
.week-wrap { min-width: 0; }
.board.week .b-cols { --cols: repeat(7, minmax(0, 1fr)); }
.w-heads { display: grid; grid-template-columns: var(--axis-w) repeat(7, minmax(0, 1fr)); position: sticky; top: 0; z-index: 8; background: var(--surface); padding: 4px 0 6px; border-bottom: 1px solid var(--line); }
.w-head { min-width: 0; padding: 4px 6px; border-radius: 10px; background: transparent; border: 0; text-align: left; display: flex; flex-direction: column; gap: 2px; font-family: inherit; color: var(--text); cursor: pointer; }
.w-head:hover { background: var(--surface-2); }
.w-head:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.w-head .wd { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.w-head .dn { font-size: 1.1rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.w-head.is-today .dn { color: var(--face); background: var(--now); border-radius: 8px; padding: 0 6px; align-self: flex-start; }
.w-head .wh { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-head .wbar { height: 3px; border-radius: 2px; background: var(--ring-1); position: relative; overflow: hidden; margin-top: 2px; }
.w-head .wbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text-2); border-radius: 2px; }
.board.week .item { padding-right: 4px; }
.board.week .item.short .it-time { display: none; }
.b-strip { position: absolute; right: 0; top: 0; bottom: 0; width: 5px; pointer-events: none; }
.b-strip i { position: absolute; left: 0; right: 0; border-radius: 2px; background: var(--c); }
.inbox { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.in-task { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: grab; touch-action: pan-y; }
.in-task .grip { color: var(--muted); width: 18px; height: 18px; display: inline-flex; }
.in-task .grip .ico { width: 18px; height: 18px; }
.in-task.dragging { opacity: 0.4; }
.in-body { min-width: 0; display: flex; flex-direction: column; }
.in-title { font-family: inherit; font-size: 0.95rem; font-weight: 600; color: var(--text-strong); background: none; border: 0; padding: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.in-title:hover { text-decoration: underline; }
.meta { font-size: 0.8rem; color: var(--muted); display: flex; gap: 2px 10px; flex-wrap: wrap; align-items: center; font-variant-numeric: tabular-nums; }
.meta .m-cat { display: inline-flex; align-items: center; gap: 5px; }
.meta > span, .chip, .quick-read .bit { min-width: 0; max-width: 100%; overflow-wrap: anywhere; } /* a long name without spaces wraps instead of pushing the page sideways */
.meta .late { color: var(--bad); font-weight: 600; }
.meta .pri { color: var(--text-strong); font-weight: 600; }
.inbox-col .hint { padding-top: 2px; }

/* ----- Week: goals and routines ----- */
.week-lower { display: grid; gap: 28px 48px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .week-lower { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.goals { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.goal { display: grid; grid-template-columns: 10px minmax(90px, 0.8fr) minmax(0, 2fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--text); }
.goal .g-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal .g-bar { position: relative; height: 10px; border-radius: 0 4px 4px 0; background: var(--ring-1); min-width: 60px; }
.goal .g-bar .g-plan { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: color-mix(in oklab, var(--c) 30%, var(--surface)); }
.goal .g-bar .g-done { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--c); }
.goal .g-bar .g-goal { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text-strong); border-radius: 1px; }
.goal .g-val { grid-column: 2 / 4; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.goal .g-set { grid-column: 4; grid-row: 1 / span 2; display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); }
.goal .g-set select { min-height: 36px; padding: 4px 30px 4px 10px; }
.routines { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.routine { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.routine.paused .r-title { color: var(--text-2); font-style: italic; }
.routine .r-title { font-family: inherit; font-size: 0.95rem; font-weight: 600; color: var(--text-strong); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.routine .r-title:hover { text-decoration: underline; }
.routine .meta { grid-column: 2; }
.routine .actions { grid-column: 3; grid-row: 1 / span 2; }
.daypills { display: inline-flex; gap: 2px; }
.daypills i { font-style: normal; width: 18px; text-align: center; font-size: 0.72rem; border-radius: 4px; color: var(--text-3); }
.daypills i.on { background: var(--surface-2); color: var(--text-strong); font-weight: 700; border: 1px solid var(--line); }

/* ----- Tasks ----- */
.filters { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: center; }
.task-search { position: relative; flex: 1 1 220px; max-width: 360px; }
.task-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.task-search .input { padding-left: 40px; }
.task-groups { display: flex; flex-direction: column; gap: 22px; }
.tgroup h3 { font-size: 1rem; display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; color: var(--text-strong); }
.tgroup h3.late { color: var(--bad); }
.tlist { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.task { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.task.is-done .t-title { text-decoration: line-through; color: var(--text-2); }
.tick { width: 24px; height: 24px; border-radius: 50%; padding: 0; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: transparent; grid-row: 1 / span 2; cursor: pointer; }
.tick:hover { border-color: var(--text-strong); color: var(--muted); }
.tick .ico { width: 14px; height: 14px; stroke-width: 3; }
.tick[aria-checked="true"] { background: var(--text-strong); border-color: var(--text-strong); color: var(--surface); }
.tick.p3 { border-color: var(--bad); }
.tick.p2 { border-color: var(--warn); }
.tick:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.t-body { min-width: 0; display: flex; flex-direction: column; }
.t-title { font-family: inherit; font-size: 0.95rem; font-weight: 600; color: var(--text-strong); background: none; border: 0; padding: 0; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.t-title:hover { text-decoration: underline; }
.task .actions { grid-column: 3; grid-row: 1 / span 2; gap: 4px; flex-wrap: nowrap; }
.matrix { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quad { border: 1px solid var(--surface-border); border-radius: 16px; background: var(--surface); padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 180px; }
.quad.over { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.quad h3 { font-size: 1rem; color: var(--text-strong); }
.quad .q-sub { font-size: 0.8rem; color: var(--muted); margin-top: -4px; }
.quad .task { padding: 7px 0; }
.quad .task[draggable="true"] { cursor: grab; }
.matrix-hint { grid-column: 1 / -1; }

/* ----- Focus ----- */
.focus { display: grid; gap: 28px 56px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .focus { grid-template-columns: minmax(320px, 1fr) minmax(0, 1fr); } }
.focus-main { display: flex; flex-direction: column; gap: 18px; align-items: stretch; min-width: 0; }
.focus-main .ring-wrap { align-self: center; }
.focus-main .seg { align-self: center; justify-content: center; }
.ring-wrap { position: relative; width: min(100%, 320px); aspect-ratio: 1 / 1; }
.ring { width: 100%; height: 100%; display: block; max-width: none; }
.fr-face { fill: var(--face); stroke: var(--line); stroke-width: 1; }
.fr-track { fill: none; stroke: var(--ring-1); stroke-width: 10; }
.fr-arc { fill: none; stroke: var(--c, var(--brand)); stroke-width: 10; stroke-linecap: round; }
.fr-tick { stroke: var(--axis); stroke-width: 1.2; }
.fr-dot { fill: var(--line-strong); }
.fr-dot.done { fill: var(--text-strong); }
.fr-dot.now { fill: var(--c, var(--brand)); stroke: var(--face); stroke-width: 2; }
.ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 0 22%; }
.ring-phase { font-weight: 600; color: var(--text-2); overflow-wrap: anywhere; }
.ring-time { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: clamp(2.8rem, 12vw, 3.9rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--text-strong); }
.ring-round { font-size: 0.85rem; color: var(--muted); min-height: 1.3em; }
.focus.on-break .fr-arc { stroke: var(--cat-3); }
.focus-what { width: 100%; }
.focus-what .select { width: 100%; }
.plan-says { color: var(--text-2); }
.break-tip { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.break-tip .ico { color: var(--cat-3); margin-top: 2px; }
.catch { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.focus-side { display: flex; flex-direction: column; gap: 30px; min-width: 0; }
.focus-today { color: var(--text-2); }
.focus-today b { color: var(--text-strong); }
.rounds { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.rounds li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--text); }
.rounds .r-when { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rounds .part { color: var(--muted); }
.caught { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.caught li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--text); }
.caught li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ----- Insights ----- */
.ins-grid { display: grid; gap: 32px 48px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .ins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ins-grid .wide { grid-column: 1 / -1; } }
.legend { display: flex; gap: 16px; font-size: 0.82rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.plan { background: var(--plan-wash); }
.sw.done { background: var(--series); }
.chart { position: relative; min-width: 0; }
.chart svg { display: block; width: 100%; overflow: visible; max-width: none; }
.c-grid { stroke: var(--grid); stroke-width: 1; }
.c-base { stroke: var(--axis); stroke-width: 1; }
.c-lab { fill: var(--muted); font-size: 11px; font-family: 'Inter', sans-serif; font-variant-numeric: tabular-nums; }
.c-plan { fill: var(--plan-wash); }
.c-done { fill: var(--series); }
.c-hit { fill: transparent; cursor: default; }
.chart .tip { transform: translate(-50%, calc(-100% - 8px)); }
.ins-text { color: var(--text-2); max-width: 70ch; }
.ins-text b { color: var(--text-strong); font-weight: 600; }
.cbars { display: flex; flex-direction: column; gap: 10px; }
.cbar { display: grid; grid-template-columns: minmax(80px, 0.7fr) minmax(0, 2fr); gap: 4px 12px; align-items: center; font-size: 0.875rem; color: var(--text); }
.cbar .cb-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cbar .cb-track { position: relative; height: 12px; }
.cbar .cb-done { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--c); min-width: 2px; }
.cbar .cb-plan { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -2px; background: var(--text-strong); border-radius: 1px; }
.cbar .cb-val { grid-column: 2; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.heat { display: grid; gap: 2px; font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; position: relative; }
.heat .hc { aspect-ratio: 1 / 1; border-radius: 3px; background: var(--heat-0); min-width: 0; }
.heat .hl { display: flex; align-items: center; padding-right: 6px; font-weight: 600; }
.heat .hx { text-align: left; white-space: nowrap; overflow: visible; }
.heat-key { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--muted); margin-top: 8px; }
.heat-key i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.est-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.est-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; color: var(--text); }
.est-list .e-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-list .e-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.82rem; }
.est-list .e-bars { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; }
.est-list .e-bars i { display: block; height: 4px; border-radius: 0 2px 2px 0; }
.est-list .e-bars .eb-est { background: var(--plan-wash); }
.est-list .e-bars .eb-spent { background: var(--series); }
.feel { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.feel span { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; background: var(--heat-0); color: var(--muted); font-variant-numeric: tabular-nums; }
.feel span.e1 { background: var(--heat-1); color: var(--feel-ink-1); }
.feel span.e2 { background: var(--heat-2); color: var(--feel-ink-2); }
.feel span.e3 { background: var(--heat-3); color: var(--feel-ink-3); }
.feel span.e4 { background: var(--heat-4); color: var(--feel-ink-4); }
.feel span.e5 { background: var(--heat-5); color: var(--feel-ink-5); }
.entries { display: flex; flex-direction: column; gap: 18px; }
.eday h4 { font-size: 0.95rem; display: flex; justify-content: space-between; gap: 12px; margin: 0 0 4px; color: var(--text-strong); }
.eday h4 span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.elist { border-top: 1px solid var(--line); }
.elist li { border-bottom: 1px solid var(--line); }
.elist button { width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 8px 0; background: none; border: 0; text-align: left; font-family: inherit; color: var(--text); cursor: pointer; }
.elist button:hover .e-what { text-decoration: underline; }
.elist button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.elist .e-what { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elist .e-when { grid-column: 2; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.elist .e-dur { grid-column: 3; grid-row: 1 / span 2; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ----- Windows ----- */
.dialog-form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); margin: 0; }
.dialog-form .dialog-body { max-height: none; flex: 1 1 auto; min-height: 0; }
.dialog .section { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.dialog .section:first-child { border-top: 0; padding-top: 0; }
.dialog .section h3 { font-size: 1rem; }
.dialog .hint { font-size: 0.85rem; }
.time-row { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: flex-end; }
.time-row .field { flex: 1 1 110px; }
.time-in { font-variant-numeric: tabular-nums; }
.input[aria-invalid] { border-color: var(--bad); }
.dialog .field-row > .field { flex: 1 1 auto; }
.cat-pick .chip { gap: 7px; }
.subs { display: flex; flex-direction: column; gap: 4px; list-style: none; padding: 0; }
.subs li { display: flex; align-items: center; gap: 8px; }
.subs li .input { min-height: 38px; padding: 6px 10px; }
.subs li .tick { width: 22px; height: 22px; grid-row: auto; flex: none; }
.plan-list { border-top: 1px solid var(--line); list-style: none; padding: 0; }
.plan-list li { display: grid; grid-template-columns: 10px auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; color: var(--text); }
.plan-list .pl-time { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; font-size: 0.85rem; }
.plan-list .pl-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-list li.left .pl-title { font-weight: 500; color: var(--text-2); }
.review-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.review-row .rr-title { font-weight: 600; overflow-wrap: anywhere; color: var(--text-strong); }
.review-row .seg button { padding: 6px 10px; font-size: 0.8rem; }
@media (max-width: 480px) { .review-row { grid-template-columns: minmax(0, 1fr); } }
.energy { display: flex; gap: 6px; flex-wrap: wrap; }
.helpdoc { display: flex; flex-direction: column; gap: 14px; font-size: 0.925rem; color: var(--text); }
.helpdoc h3 { font-size: 1rem; margin-top: 4px; }
.helpdoc ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; list-style: disc; }
.keys { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 0.9rem; }
.keys > span:nth-child(odd) { display: flex; gap: 4px; flex-wrap: wrap; }
.settings-list { display: flex; flex-direction: column; gap: 4px; }
.cat-edit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.cat-edit .input { min-height: 38px; padding: 6px 10px; }
.slot-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.slot-pick button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0; background: var(--c); cursor: pointer; }
.slot-pick button[aria-checked="true"] { border-color: var(--text-strong); box-shadow: inset 0 0 0 2px var(--surface); }
.slot-pick button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.toast { background: #0a0a14; }
.toasts { right: 24px; }

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    .toolbar-right { width: 100%; }
    .toolbar-right .btn { 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; }
    /* the site's round theme button sits fixed at the top right: the tab row and the now bar (which stays under the header) keep 52 px free for it */
    .app-toolbar .view-tabs { width: calc(100% - 52px); }
    .nowbar { border-radius: 20px; padding: 6px 6px 6px 12px; gap: 8px; margin-right: 52px; }
    .nb-actions .btn .lbl { display: none; }
    .nb-actions .btn { width: 44px; padding: 0; }
    .nb-actions .btn.keep { width: auto; padding: 0 14px; }
    .nb-actions .btn.keep .lbl { display: inline; }
    .day-head .actions { width: 100%; }
    .day-head .actions .btn { flex: 1 1 auto; padding-left: 12px; padding-right: 12px; }
    .pick span { display: none; }
    .b-axis span { right: 5px; font-size: 0.7rem; }
    .b-axis .now-tag { right: 1px; padding: 1px 3px; font-size: 0.65rem; }
    .board.week .item { padding: 1px 2px 1px 3px; border-left-width: 3px; font-size: 0.68rem; }
    .board.week .item .it-time { display: none; }
    .board.week .item .it-title { white-space: normal; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; display: block; }
    .w-head { padding: 2px; }
    .w-head .wh { display: none; }
    .w-head .dn { font-size: 0.95rem; }
    .d-label { font-size: 13px; }
    .d-label.main { font-size: 14px; }
    .goal { grid-template-columns: 10px minmax(0, 1fr) auto; }
    .goal .g-bar { grid-column: 2 / -1; grid-row: 2; }
    .goal .g-val { grid-column: 2 / -1; grid-row: 3; }
    .goal .g-set { grid-column: 3; grid-row: 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: 459px) { .view-tab .ico { display: none; } }
@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .dialog, .dialog[open], .toast, .seg button, .chip, .view-tab, .item, .switch, .switch::after, .it-grip::after,
    .nowbar.running .nb-dot { transition: none; animation: none; }
}
@media (forced-colors: active) {
    .item, .dot, .nb-dot { border: 2px solid CanvasText; }
    .cbar .cb-done, .goal .g-done, .cat-sum .cs-bar i { background: Highlight; }
}
@media print {
    .app-toolbar, .nowbar, .actions, .quick, .tl-tools, .toasts { display: none !important; }
    .tl-scroll { max-height: none; overflow: visible; }
}
/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The dial, the timeline's blocks, the charts and
   the heat map are drawings: a block's height is its length. */
@media (max-width: 639.98px) {
    main button:not(.it-tick):not(.w-head), main select, main summary, main [role="button"]:not(.item),
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="date"]) { min-height: 44px; }
    main .seg button, main .view-tab, main .chip { min-height: 44px; }
    main .icon-btn, main .tl-tools .icon-btn { width: 44px; height: 44px; min-width: 44px; }
    main .tick { width: 44px; height: 44px; border-width: 0; background: transparent; position: relative; }
    main .tick::before { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
    main .tick.p3::before { border-color: var(--bad); }
    main .tick.p2::before { border-color: var(--warn); }
    main .tick[aria-checked="true"]::before { background: var(--text-strong); border-color: var(--text-strong); }
    main .tick .ico { position: relative; }
    main .task { grid-template-columns: 44px minmax(0, 1fr) auto; }
    main .in-title, main .t-title, main .r-title { min-height: 44px; display: flex; align-items: center; }
    main .w-head { min-height: 44px; }
    main .goal .g-set select { min-height: 44px; }
    main .quad .q-sub { font-size: 1rem; }
    main :is(p, li, .hint, .label, .form-hint, .input, .select, kbd, .seg button, .chip, .muted, .lead, .legend, .meta, .nb-sub,
        .day-rel, .quick-read, .switch-row, .empty, .cs-val, .g-val, .g-set, .e-when, .e-val, .cb-val, .r-when, .count, .view-tab,
        .ins-text, .focus-today, .plan-says, .day-sum, .q-sub, td, th) { font-size: 1rem; }
    .dialog button:not(.tick), .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 .slot-pick button { width: 44px; height: 44px; min-height: 44px; }
    .dialog .tick { width: 44px; height: 44px; }
    .dialog summary { min-height: 44px; display: flex; align-items: center; }
    .dialog :is(p, .hint, .label, .input, .textarea, li, kbd, .chip, .seg button, .switch-row, .pl-time, .rr-title, summary) { font-size: 1rem; }
}
