/* p — pomodoro tracker. Cool paper, ink-blue text, pine accent; bricks are
   the one recurring ornament. */

:root {
    color-scheme: light;
    --paper: #eef1f4;
    --surface: #fbfcfd;
    --ink: #1d2a3a;
    --ink-2: #445365;
    --muted: #677485;
    --line: #d5dbe2;
    --line-strong: #b9c2cc;
    --accent: #0f7b5f;
    --accent-ink: #ffffff;
    --accent-soft: #dcefe8;
    --missed: #b4483c;
    --missed-soft: #f6e3e0;
    --brick: #8794a2;
    --ghost: #bcc6d0;
    --danger: #a63a2f;
    --shadow: 0 1px 0 rgba(29, 42, 58, 0.04), 0 8px 24px -12px rgba(29, 42, 58, 0.18);

    --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
    --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --radius: 10px;
    --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --paper: #12171d;
        --surface: #1a2128;
        --ink: #e6ebf0;
        --ink-2: #b9c4cf;
        --muted: #8c99a7;
        --line: #2c353f;
        --line-strong: #3d4854;
        --accent: #35a07e;
        --accent-ink: #08140f;
        --accent-soft: #1b3a30;
        --missed: #e0806f;
        --missed-soft: #3a2421;
        --brick: #75828f;
        --ghost: #3e4955;
        --danger: #e0806f;
        --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #12171d;
    --surface: #1a2128;
    --ink: #e6ebf0;
    --ink-2: #b9c4cf;
    --muted: #8c99a7;
    --line: #2c353f;
    --line-strong: #3d4854;
    --accent: #35a07e;
    --accent-ink: #08140f;
    --accent-soft: #1b3a30;
    --missed: #e0806f;
    --missed-soft: #3a2421;
    --brick: #75828f;
    --ghost: #3e4955;
    --danger: #e0806f;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.5 var(--font-body);
    -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.01em;
}
h1 { font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

a { color: var(--accent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.empty { color: var(--muted); margin: 8px 0; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------- form controls ---------- */

label { font-size: 14px; font-weight: 500; color: var(--ink-2); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], select, textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 44px;
}
textarea { resize: vertical; min-height: 64px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 6px; }

.check { display: flex; gap: 10px; align-items: center; font-weight: 400; color: var(--ink); font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.inline-num { width: 72px !important; min-height: 36px !important; padding: 6px 8px !important; }

.stack { display: flex; flex-direction: column; gap: 8px; }
.stack > label { margin-top: 6px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { display: flex; flex-direction: column; gap: 6px; }
.row > div:not(.grow) { flex: 0 1 140px; }
.field { display: flex; flex-direction: column; gap: 6px; }

.btn {
    font: 500 15px/1 var(--font-body);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 0 16px;
    min-height: 44px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--quiet:hover { border-color: var(--line-strong); }
.btn--danger { color: var(--danger); background: transparent; border-color: transparent; }
.btn--danger:hover { border-color: var(--danger); }
.btn--small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn--block { width: 100%; margin-top: 16px; }
.btn--fit { align-self: flex-start; }
.btn--end { margin-left: auto; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.form-error { color: var(--danger); min-height: 1.5em; margin: 12px 0 0; }

.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--line);
    color: var(--ink-2);
    margin-left: 6px;
}
.badge--met { background: var(--accent-soft); color: var(--accent); }

.dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 3px;
    background: var(--c, var(--brick));
    flex: none;
}

/* ---------- bricks ---------- */

.brick {
    display: inline-block;
    width: 36px;
    height: 18px;
    border-radius: 3px;
    background: var(--c, var(--brick));
    flex: none;
}
.brick--partial {
    background: repeating-linear-gradient(135deg, var(--c, var(--brick)) 0 3px, transparent 3px 6px);
    box-shadow: inset 0 0 0 1.5px var(--c, var(--brick));
}
.brick--manual { box-shadow: inset 0 -4px 0 rgba(255, 255, 255, 0.35); }
.brick--ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ghost); }
.brick-more { font-size: 12px; color: var(--muted); align-self: center; }

/* ---------- auth ---------- */

.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); }
.auth-box { width: 100%; max-width: 380px; }
.auth-lede { color: var(--ink-2); margin: 4px 0 24px; font-size: 17px; }
.auth-switch { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.auth .btn--primary { margin-top: 12px; }

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
    color: var(--ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.wordmark::after {
    content: "";
    width: 20px; height: 10px;
    border-radius: 2px;
    background: var(--accent);
    transform: translateY(5px);
}
.wordmark--large { font-size: 72px; }
.wordmark--large::after { width: 44px; height: 22px; transform: translateY(14px); border-radius: 4px; }

/* ---------- shell ---------- */

.app { max-width: 1100px; margin: 0 auto; }

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px var(--gutter);
    padding-top: max(14px, env(safe-area-inset-top));
}
.tabs { display: flex; gap: 4px; margin-left: 16px; }
.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--ink-2);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
}
.tabs a:hover { background: var(--surface); }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
.tabs svg, .icon-link svg {
    width: 20px; height: 20px;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.topbar-goal { margin: 0 0 0 auto; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.topbar-goal.is-met { color: var(--accent); font-weight: 600; }
.icon-link { color: var(--ink-2); display: inline-flex; padding: 10px; border-radius: 8px; }
.icon-link[aria-current="page"] { color: var(--accent); background: var(--surface); }

.main { padding: 8px var(--gutter) 48px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 20px; flex-wrap: wrap; }

section > h2 { margin-bottom: 10px; }

/* ---------- now ---------- */

.now-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.now-side { display: flex; flex-direction: column; gap: 28px; }

.timer-panel {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.clock {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(76px, 21vw, 168px);
    line-height: 0.95;
    letter-spacing: -0.03em;
    font-optical-sizing: auto;
    margin: 4px 0 2px;
    white-space: nowrap;
}
.clock-d { display: inline-block; width: 0.6em; text-align: center; }
.clock-sep { display: inline-block; width: 0.28em; text-align: center; transform: translateY(-0.06em); }
.clock--idle { color: var(--ink-2); }

.laying {
    height: 22px;
    border-radius: 4px;
    background: var(--paper);
    box-shadow: inset 0 0 0 1.5px var(--line-strong);
    overflow: hidden;
}
.laying-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--c, var(--accent));
    border-radius: 4px;
    transition: width 1s linear;
}
@media (prefers-reduced-motion: reduce) { .laying-fill { transition: none; } }

.timer-task { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; font-size: 18px; flex-wrap: wrap; }
.timer-estimate { font-weight: 400; font-size: 14px; color: var(--muted); }
.timer-meta { margin: 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.timer-intention { margin: 0; font-size: 17px; }
.timer-intention span, .recall-label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.sound-hint { align-self: flex-start; color: var(--accent); }

.recall { margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 56px; min-height: 44px; padding: 0 14px;
    border-radius: 8px; border: 1px solid var(--line-strong);
    font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
    background: var(--surface);
}
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips #custom-minutes { width: 96px; }

.btn--start { min-height: 56px; font-size: 18px; font-weight: 600; margin-top: 4px; }

.new-task { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; }

.today h2 { margin-bottom: 12px; }
.wall { display: flex; flex-wrap: wrap; gap: 4px; min-height: 18px; }
.wall .brick { width: 52px; height: 26px; border-radius: 4px; }
.today-status { margin: 10px 0 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.today-status.is-met { color: var(--accent); font-weight: 600; }

.pad-form { display: flex; gap: 8px; margin-top: 10px; }
.pad-list { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pad-list li { padding: 8px 12px; background: var(--surface); border-radius: 8px; border-left: 3px solid var(--ghost); }

/* ---------- log ---------- */

.log-day { margin-bottom: 24px; }
.log-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.log-day-head p { margin: 0; color: var(--muted); font-size: 14px; }
.log-entries { list-style: none; margin: 0; padding: 0; }
.log-entry {
    width: 100%;
    display: flex; gap: 14px; align-items: flex-start;
    text-align: left; font: inherit; color: inherit;
    background: none; border: 0; border-bottom: 1px solid var(--line);
    padding: 12px 4px; cursor: pointer;
}
.log-entry:hover { background: var(--surface); }
.log-entry .brick { margin-top: 3px; }
.log-entry-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.log-entry-top { display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: baseline; }
.log-entry-top .muted { font-size: 14px; font-variant-numeric: tabular-nums; }
.note { margin: 0; font-size: 15px; color: var(--ink-2); }
.note span { color: var(--muted); font-size: 13px; margin-right: 6px; }

/* ---------- tasks ---------- */

.task-form { display: grid; grid-template-columns: minmax(0, 1fr) 160px 100px auto; gap: 8px; margin-bottom: 24px; }
.task-list { list-style: none; margin: 0 0 24px; padding: 0; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task-row.is-done .task-title { color: var(--muted); }
.task-check {
    width: 28px; height: 28px; flex: none;
    border-radius: 6px; border: 1.5px solid var(--line-strong);
    background: var(--surface); color: var(--accent-ink);
    font-weight: 700; cursor: pointer;
}
.task-row.is-done .task-check { background: var(--accent); border-color: var(--accent); }
.task-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.task-title { display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
.task-title .muted { font-weight: 400; font-size: 14px; }
.task-sub { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.est { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.est-bar { width: 80px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; display: inline-block; }
.est-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.est-fill.is-over { background: var(--missed); }

.disclosure { font: 600 16px var(--font-display); background: none; border: 0; color: var(--ink); cursor: pointer; padding: 8px 0; margin-bottom: 4px; }
.disclosure::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--muted); transition: transform .15s; }
.disclosure[aria-expanded="true"]::before { transform: rotate(90deg); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 16px; }
.plain-list { list-style: none; margin: 10px 0 12px; padding: 0; }
.plain-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain-list li.is-done .grow { color: var(--muted); text-decoration: line-through; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.swatch { position: relative; width: 36px; height: 36px; border-radius: 8px; background: var(--c); cursor: pointer; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- trends ---------- */

.trends-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px; align-items: start; }
.calendar-card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-nav .btn { font-size: 22px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal-day {
    position: relative;
    aspect-ratio: 1 / 1.1;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 4px;
    display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
    font: inherit; color: var(--ink); cursor: pointer; text-align: left;
}
.cal-num { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-mark { position: absolute; top: 3px; right: 6px; font-size: 13px; font-weight: 700; }
.cal-bricks { display: flex; flex-wrap: wrap; gap: 2px; }
.cal-bricks .brick { width: 9px; height: 5px; border-radius: 1px; }
.cal-bricks .brick--partial { background: var(--c, var(--brick)); opacity: 0.45; box-shadow: none; }
.cal-bricks .brick-more { font-size: 10px; line-height: 5px; }
.day--met { background: var(--accent-soft); border-color: var(--accent); }
.day--met .cal-mark { color: var(--accent); }
.day--missed { background: var(--missed-soft); border-color: transparent; }
.day--missed .cal-mark { color: var(--missed); }
.day--today { border: 2px solid var(--accent); }
.day--bonus { background: repeating-linear-gradient(135deg, var(--surface) 0 5px, var(--accent-soft) 5px 7px); }
.day--rest { background: transparent; }
.day--future { background: transparent; color: var(--muted); border-style: dashed; }
.day--before { background: transparent; color: var(--muted); border-color: transparent; }
.cal-day.is-selected { box-shadow: 0 0 0 2px var(--ink); }
.cal-pad { aspect-ratio: 1 / 1.1; }

.cal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 14px 0 0; font-size: 13px; color: var(--ink-2); }
.cal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 18px; height: 18px; border-radius: 4px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; }
.key--met { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.key--missed { background: var(--missed-soft); color: var(--missed); }
.key--bonus { background: repeating-linear-gradient(135deg, var(--surface) 0 3px, var(--accent-soft) 3px 5px); box-shadow: inset 0 0 0 1px var(--line); }

#day-detail h3 { margin: 18px 0 4px; }
#day-detail .brick { width: 24px; height: 12px; }

.segmented { display: inline-flex; background: var(--line); border-radius: 10px; padding: 3px; margin-bottom: 20px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; }
.tile { background: var(--surface); border-radius: 12px; padding: 14px 16px; }
.tile dt { font-size: 14px; color: var(--ink-2); }
.tile dd { margin: 4px 0 0; font: 600 30px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.tile p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.chart-block { margin: 0 0 32px; }
.chart-block figcaption { margin-bottom: 8px; }
.chart-block figcaption p, .chart-block .lede { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.chart-block .lede { font-size: 16px; color: var(--ink-2); margin-bottom: 10px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-tick { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart-bar { fill: var(--accent); }
.chart-hit { fill: transparent; }
.chart-col:hover .chart-hit { fill: var(--line); opacity: 0.35; }
.chart-goal { stroke: var(--ink-2); stroke-width: 1.5; }
.chart-goal-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; font-family: var(--font-body); }
details { margin-top: 6px; font-size: 14px; }
summary { color: var(--accent); cursor: pointer; }

.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.hbar-label { display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hbar-track { height: 14px; }
.hbar-fill { display: block; height: 100%; min-width: 2px; background: var(--c); border-radius: 0 4px 4px 0; }
.hbar-value { font-variant-numeric: tabular-nums; color: var(--ink-2); }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.data-table th { text-align: left; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line-strong); padding: 6px 8px 6px 0; }
.data-table td { border-bottom: 1px solid var(--line); padding: 8px 8px 8px 0; }

/* ---------- settings ---------- */

.settings { max-width: 520px; }
.settings fieldset { margin-top: 14px; }
.settings .check { margin-top: 12px; }
.account { max-width: 520px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.account p { margin: 0; }
.radio-row { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

/* ---------- dialog, toast, tooltip ---------- */

.sheet {
    border: 0;
    border-radius: 16px;
    padding: 24px;
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
}
.sheet::backdrop { background: rgba(18, 23, 29, 0.45); }
.sheet h2 { font-size: 22px; }
.sheet-sub { margin: 0; color: var(--muted); }

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    background: var(--ink);
    color: var(--surface);
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    max-width: calc(100vw - 32px);
    z-index: 30;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.tooltip {
    position: fixed; left: 0; top: 0;
    background: var(--ink); color: var(--surface);
    font-size: 13px; padding: 6px 10px; border-radius: 6px;
    pointer-events: none; z-index: 40; white-space: nowrap;
}

/* ---------- small screens ---------- */

@media (max-width: 860px) {
    .now-grid, .trends-grid, .two-col { grid-template-columns: minmax(0, 1fr); }
    .task-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .task-form #t-title { grid-column: 1 / -1; }
    .task-form .btn { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .topbar { padding-bottom: 6px; }
    .tabs {
        position: fixed;
        z-index: 20;
        left: 0; right: 0; bottom: 0;
        margin: 0;
        justify-content: space-around;
        background: var(--surface);
        border-top: 1px solid var(--line);
        padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    }
    .tabs a { flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 10px; min-width: 64px; }
    .tabs a[aria-current="page"] { background: none; box-shadow: none; color: var(--accent); }
    .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
    .timer-panel { padding: 18px; }
    .wall .brick { width: 44px; height: 22px; }
    h1 { font-size: 24px; }
    .sheet {
        width: 100vw;
        max-width: 100vw;
        margin: auto 0 0;
        border-radius: 16px 16px 0 0;
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
    .cal-day { aspect-ratio: 1 / 1.2; padding: 3px; }
    .cal-bricks .brick { width: 6px; height: 4px; }
    .hbar { grid-template-columns: minmax(0, 42%) minmax(0, 1fr) auto; gap: 8px; }
}
