/* Ayojana. Calm, clear, quietly satisfying.
 *
 * Colour: warm paper in light, deep ink-grey in dark, each designed on its
 * own. Three accents (Ink, Lagoon, Clay), each with a light and a dark value.
 * Translucent, frosted surfaces where they help: the tab bar, the sidebar,
 * the header once the page scrolls, sheets, quick add, the selection bar and
 * toasts. Never behind body text: lists sit on the page itself, whose
 * colour fields are soft and faint enough to read over, and cards are solid.
 * The colour fields give the glass something to catch.
 */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-latin-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --bg: #F6F4EF; --bg-2: #EEEBE4; --surface: #FFFFFF; --surface-2: #FAF9F6;
  --glass: rgba(250, 249, 245, .68); --glass-strong: rgba(253, 252, 250, .84); --glass-edge: rgba(255, 255, 255, .7);
  --ink: #1C1E24; --ink-2: #5A5F6B; --ink-3: #8D919B; --line: rgba(28, 30, 36, .08); --line-2: rgba(28, 30, 36, .15);
  --hover: rgba(28, 30, 36, .045); --press: rgba(28, 30, 36, .08);
  --late: #C4453A; --good: #2F8F5B;
  --p1: #D6463C; --p2: #DD8A1F; --p3: #3C7BD6; --p0: #A3A6AE;
  --shadow-1: 0 1px 2px rgba(20, 22, 30, .05), 0 2px 8px rgba(20, 22, 30, .04);
  --shadow-2: 0 2px 6px rgba(20, 22, 30, .06), 0 16px 40px rgba(20, 22, 30, .10);
  --scrim: rgba(18, 20, 28, .26);
  --blob-a: .16; --blob-b: .10;
  --r: 14px; --r-lg: 22px;
  --side: 284px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-accent="ink"]    { --accent: #3552A8; --accent-2: #5C6FD8; --accent-ink: #2B4491; --accent-soft: rgba(53, 82, 168, .11); --accent-line: rgba(53, 82, 168, .28); }
:root[data-accent="lagoon"] { --accent: #0E7C73; --accent-2: #2AA898; --accent-ink: #0A665E; --accent-soft: rgba(14, 124, 115, .11); --accent-line: rgba(14, 124, 115, .28); }
:root[data-accent="clay"]   { --accent: #B4532F; --accent-2: #D97A4D; --accent-ink: #9A4526; --accent-soft: rgba(180, 83, 47, .11); --accent-line: rgba(180, 83, 47, .28); }
:root { --on-accent: #fff; }

/* Dark: chosen, not inverted. */
:root[data-theme="dark"], :root.auto-dark {
  --bg: #111317; --bg-2: #16191E; --surface: #1A1D23; --surface-2: #1F232A;
  --glass: rgba(22, 25, 31, .64); --glass-strong: rgba(28, 31, 38, .82); --glass-edge: rgba(255, 255, 255, .07);
  --ink: #ECEDEF; --ink-2: #A8ACB5; --ink-3: #737882; --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --hover: rgba(255, 255, 255, .045); --press: rgba(255, 255, 255, .08);
  --late: #F07A6E; --good: #5FC58E;
  --p1: #F2685E; --p2: #F2A844; --p3: #72A5F2; --p0: #6E737D;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 8px 40px rgba(0, 0, 0, .45);
  --scrim: rgba(0, 0, 0, .45);
  --blob-a: .22; --blob-b: .14;
  --on-accent: #0D1018;
  color-scheme: dark;
}
:root[data-theme="dark"][data-accent="ink"], :root.auto-dark[data-accent="ink"]       { --accent: #94A8F2; --accent-2: #B3A6F5; --accent-ink: #AEBCF6; --accent-soft: rgba(148, 168, 242, .14); --accent-line: rgba(148, 168, 242, .34); }
:root[data-theme="dark"][data-accent="lagoon"], :root.auto-dark[data-accent="lagoon"] { --accent: #52C8B8; --accent-2: #7FD9C2; --accent-ink: #72D6C8; --accent-soft: rgba(82, 200, 184, .14); --accent-line: rgba(82, 200, 184, .34); }
:root[data-theme="dark"][data-accent="clay"], :root.auto-dark[data-accent="clay"]     { --accent: #F0916B; --accent-2: #F5B27F; --accent-ink: #F4A585; --accent-soft: rgba(240, 145, 107, .14); --accent-line: rgba(240, 145, 107, .34); }

/* Project and tag colours: muted, readable in both themes. */
.c-slate  { --c: #7C8594; } .c-red { --c: #D2564B; } .c-orange { --c: #E07B35; } .c-amber { --c: #D7A021; }
.c-green  { --c: #3E9A5D; } .c-teal { --c: #1F9A8D; } .c-sky { --c: #3AA0D8; } .c-blue { --c: #3F6FD1; }
.c-indigo { --c: #5A5FD0; } .c-violet { --c: #8A5CCB; } .c-pink { --c: #D25C92; } .c-brown { --c: #9A6B4B; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
html.booting body { visibility: hidden; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: transparent; color: var(--ink);
  font: 400 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .center { text-align: center; }
.pad { padding: 8px 4px; } .pad-l { padding-left: 38px; }
.faint { color: var(--ink-3); }

/* The colour fields behind the glass. */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop i { position: absolute; border-radius: 50%; filter: blur(70px); }
.backdrop i:nth-child(1) { width: 60vmax; height: 60vmax; left: -18vmax; top: -24vmax; background: var(--accent); opacity: var(--blob-b); }
.backdrop i:nth-child(2) { width: 46vmax; height: 46vmax; right: -16vmax; top: 24vh; background: var(--accent-2); opacity: calc(var(--blob-b) * .8); }
.backdrop i:nth-child(3) { width: 50vmax; height: 50vmax; left: 10vw; bottom: -30vmax; background: var(--accent); opacity: calc(var(--blob-b) * .6); }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--surface-2); }
}

/* ---------------------------------------------------------------- layout */

#view { padding: 0 16px calc(120px + var(--safe-b)); max-width: 760px; margin: 0 auto; }
#view.enter { animation: enter .32s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.side { display: none; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 6px 8px calc(6px + var(--safe-b));
  border-top: 1px solid var(--line);
}
.tabs .inner { display: flex; max-width: 520px; margin: 0 auto; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; color: var(--ink-3); font-size: 11px; font-weight: 600; position: relative; border-radius: 12px; }
.tabs a svg { width: 25px; height: 25px; }
.tabs a.on { color: var(--accent-ink); }
.tabs a:hover { text-decoration: none; }
.tabs a i { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink-3); color: var(--bg); font: 700 11px/18px var(--font); font-style: normal; text-align: center; }
.tabs a i.late { background: var(--late); color: #fff; }
.tabs a.on i:not(.late) { background: var(--accent); color: var(--on-accent); }
body.bare .tabs, body.bare .fab, body.bare .side { display: none !important; }
body.bare #view { max-width: 560px; }

.fab {
  position: fixed; right: max(18px, calc(50vw - 380px + 18px)); bottom: calc(82px + var(--safe-b)); z-index: 21;
  width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--accent-2), var(--accent)); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
:root[data-theme="dark"] .fab, :root.auto-dark .fab { color: var(--on-accent); }
.fab:hover { transform: translateY(-1px) scale(1.03); }
.fab:active { transform: scale(.95); }
body.selecting .fab { display: none; }

@media (min-width: 900px) {
  .tabs { display: none; }
  .side {
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: var(--side); z-index: 15;
    padding: 18px 12px 18px; border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain;
  }
  #view { margin-left: calc(var(--side) + max(24px, (100vw - var(--side) - 760px) / 2)); margin-right: auto; padding: 0 28px 80px; }
  .fab { display: none; }
  body.bare #view { margin: 0 auto; }
}

.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand b { font: 700 21px/1 var(--display); letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--accent-2), var(--accent)); }
:root[data-theme="dark"] .brand-mark, :root.auto-dark .brand-mark { color: var(--on-accent); }
.brand-mark svg { width: 18px; height: 18px; }
.side-add { margin: 0 4px 14px; justify-content: flex-start; }
.side-add kbd { margin-left: auto; font: 600 11px var(--font); opacity: .75; border: 1px solid currentColor; border-radius: 5px; padding: 0 5px; }

/* ---------------------------------------------------------------- header */

.head { position: sticky; top: 0; z-index: 10; margin: 0 -16px 6px; padding: calc(14px + var(--safe-t)) 16px 10px; transition: background .2s, border-color .2s; border-bottom: 1px solid transparent; }
body.scrolled .head { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); border-bottom-color: var(--line); }
@media (min-width: 900px) { .head { margin: 0 -28px 8px; padding: 26px 28px 12px; } }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.head-titles { display: flex; align-items: center; gap: 12px; min-width: 0; }
.head-icon { color: var(--accent); display: grid; }
.head-icon svg { width: 28px; height: 28px; }
.head h1 { margin: 0; font: 700 32px/1.1 var(--display); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: font-size .2s var(--ease); }
body.scrolled .head h1 { font-size: 22px; }
body.scrolled .head .head-icon svg { width: 22px; height: 22px; }
.head-sub { margin: 4px 0 0 40px; color: var(--ink-2); font-size: 14px; transition: opacity .2s, height .2s; }
body.scrolled .head-sub { opacity: 0; height: 0; margin-top: 0; overflow: hidden; }
.head-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.head-ring { display: grid; margin-right: 4px; }
.ring-prog { width: 24px; height: 24px; transform: rotate(-90deg); }
.ring-prog circle { fill: none; stroke: var(--line-2); stroke-width: 3; }
.ring-prog .fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }

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

.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--ink-2); transition: background .15s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.faint { color: var(--ink-3); width: 32px; height: 32px; }
.icon-btn.faint svg { width: 18px; height: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 13px; font-weight: 600; font-size: 15px; transition: transform .12s, background .15s, box-shadow .15s, opacity .15s; white-space: nowrap; }
.btn svg { width: 19px; height: 19px; }
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { color: #fff; background: linear-gradient(145deg, var(--accent-2), var(--accent)); box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent); }
:root[data-theme="dark"] .btn.primary, :root.auto-dark .btn.primary { color: var(--on-accent); }
.btn.soft { color: var(--accent-ink); background: var(--accent-soft); }
.btn.ghost { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: #fff; background: var(--late); }
.btn.small { min-height: 34px; padding: 0 13px; font-size: 14px; border-radius: 11px; }
.btn.big { min-height: 52px; font-size: 16px; border-radius: 15px; padding: 0 22px; }
.btn.wide { width: 100%; }
.btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }
.btn-row.tight { margin-top: 0; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin: 26px 0 16px; }
.link { color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.link:hover { text-decoration: underline; }

.field { width: 100%; font-size: 16px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.big { font-size: 18px; padding: 14px 16px; margin-bottom: 12px; }
.field.code { font-size: 28px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.field.area { resize: vertical; min-height: 160px; line-height: 1.5; }
select, input[type="time"] { font-size: 15px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); min-height: 36px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 17px; font-size: 14px; font-weight: 550; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); background: var(--surface); transition: background .15s, color .15s; }
.chip svg { width: 16px; height: 16px; }
.chip:hover { background: var(--hover); text-decoration: none; }
.chip.on { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line); }

.seg { display: inline-flex; background: var(--bg-2); border-radius: 11px; padding: 3px; }
.seg button { padding: 6px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink-3)); flex-shrink: 0; }
.dot.big { width: 18px; height: 18px; border-radius: 7px; }

.hint { color: var(--ink-2); font-size: 14px; margin: 8px 2px; }
.hint.warn { color: var(--late); }
.fine { color: var(--ink-3); font-size: 13px; line-height: 1.5; }

/* ---------------------------------------------------------------- task rows */

.group { margin: 4px 0 18px; border-radius: var(--r); }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 6px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.group-head h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; letter-spacing: -.005em; }
.count { font-size: 12px; font-weight: 700; color: var(--ink-3); background: var(--bg-2); border-radius: 8px; padding: 1px 7px; }
.count.late { color: var(--late); background: color-mix(in srgb, var(--late) 12%, transparent); }
.late-group .group-head h2 { color: var(--late); }
.day .dnum { font: 700 22px/1 var(--display); min-width: 28px; }
.day .dmonth { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.day-empty { color: var(--ink-3); font-size: 14px; margin: 6px 0 4px 40px; }
.group.drop-into { box-shadow: inset 0 0 0 2px var(--accent-line); background: var(--accent-soft); }

.tasks { display: flex; flex-direction: column; }
.task { position: relative; border-radius: var(--r); outline-offset: -2px; overflow: hidden; }
.task-in { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 12px; padding: 11px 10px 11px 8px; border-radius: var(--r); transition: background .15s; }
@media (hover: hover) { .task:hover .task-in { background: var(--hover); } }
.task.swiping .task-in { background: var(--bg); box-shadow: var(--shadow-1); }
.task:focus-visible { outline: 2px solid var(--accent); }
.task.selected .task-in { background: var(--accent-soft); }
.task.dragging { opacity: .4; }
.task.drop-above::before { content: ''; position: absolute; left: 10px; right: 10px; top: 0; height: 2px; background: var(--accent); border-radius: 2px; z-index: 3; }

.check { position: relative; width: 26px; height: 26px; margin-top: -1px; flex-shrink: 0; display: grid; place-items: center; }
.check .ring { width: 21px; height: 21px; border-radius: 50%; border: 2px solid var(--pc, var(--p0)); background: color-mix(in srgb, var(--pc, transparent) 9%, transparent); transition: background .2s, border-color .2s, transform .2s var(--ease); }
.check:hover .ring { background: color-mix(in srgb, var(--pc, var(--ink-3)) 16%, transparent); }
.check .tick { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; transform: scale(0); transition: transform .28s var(--ease); }
.check .tick svg { width: 14px; height: 14px; }
.task.p1 { --pc: var(--p1); } .task.p2 { --pc: var(--p2); } .task.p3 { --pc: var(--p3); }
.task.done .check .ring, .task.completing .check .ring, .check.on .ring { background: var(--pc, var(--accent)); border-color: var(--pc, var(--accent)); }
.task.done .check .tick, .task.completing .check .tick, .check.on .tick { transform: scale(1); }
.task.completing .check .ring { animation: pop .35s var(--ease); }
@keyframes pop { 50% { transform: scale(1.18); } }
.task.done .t-title, .task.completing .t-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.task.completing { animation: leave .5s .22s var(--ease) forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(8px); } }

.t-main { flex: 1; min-width: 0; padding-top: 1px; }
.t-title { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 3px; font-size: 13px; color: var(--ink-2); }
.t-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.t-meta svg { width: 14px; height: 14px; }
.m-date.late { color: var(--late); font-weight: 600; }
.m-date.today { color: var(--accent-ink); font-weight: 600; }
.m-icon { color: var(--ink-3); }
.m-tag { padding: 0 7px; border-radius: 7px; background: var(--bg-2); color: var(--ink-2); font-size: 12px; font-weight: 600; line-height: 20px; }
.m-sec { color: var(--ink-3); }
.m-proj .dot { width: 8px; height: 8px; }

.swipe-hint { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; align-items: center; padding: 0 22px; color: #fff; opacity: 0; transition: opacity .15s; }
.swipe-hint svg { width: 22px; height: 22px; }
.swipe-hint.left { left: 0; background: var(--good); }
.swipe-hint.right { right: 0; justify-content: flex-end; background: var(--accent); }
:root[data-theme="dark"] .swipe-hint, :root.auto-dark .swipe-hint { color: var(--on-accent); }
.task.swiping[data-dir="right"] .swipe-hint.left, .task.swiping[data-dir="left"] .swipe-hint.right { opacity: .55; }
.task.armed[data-dir="right"] .swipe-hint.left, .task.armed[data-dir="left"] .swipe-hint.right { opacity: 1; }

.add-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; color: var(--ink-3); font-size: 15px; border-radius: var(--r); }
.add-row svg { width: 22px; height: 22px; padding: 2px; }
.add-row:hover { color: var(--accent-ink); background: var(--hover); }

.sec .fold { color: var(--ink-3); display: grid; margin-right: -2px; transition: transform .2s; }
.sec .fold svg { width: 18px; height: 18px; }
.sec.folded .fold { transform: rotate(-90deg); }
.sec.folded .sec-body { display: none; }
.sec .group-head { justify-content: flex-start; }
.sec .group-head h2 { flex: 1; }

.done-today { margin: 20px 0 8px; }
.done-today summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 8px; color: var(--ink-2); font-weight: 600; font-size: 14px; border-radius: 12px; }
.done-today summary::-webkit-details-marker { display: none; }
.done-today summary:hover { background: var(--hover); }
.done-today summary svg { width: 18px; height: 18px; }
.log-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--ink-2); font-size: 15px; }
.log-row svg { width: 18px; height: 18px; color: var(--accent); }
.log-row .muted { margin-left: auto; }
.trash-row .task-in { align-items: center; }

.empty { text-align: center; padding: 30px 20px 10px; color: var(--ink-2); }
.empty-art { width: 200px; height: auto; margin: 0 auto 6px; display: block; }
.empty h2 { font: 700 22px/1.2 var(--display); color: var(--ink); margin: 6px 0 6px; }
.empty p { margin: 0 auto; max-width: 340px; font-size: 15px; }

/* Upcoming's week strip */
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -16px 4px; padding-left: 16px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip-day { flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 7px; border-radius: 15px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.strip-day span { font-size: 11px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.strip-day b { font: 700 19px/1.1 var(--display); }
.strip-day i { font-style: normal; font-size: 11px; font-weight: 700; color: var(--accent-ink); min-height: 15px; }
.strip-day i.none::before { content: '·'; color: var(--ink-3); }
.strip-day.today { background: linear-gradient(145deg, var(--accent-2), var(--accent)); box-shadow: none; }
.strip-day.today, .strip-day.today span, .strip-day.today i { color: #fff; }
:root[data-theme="dark"] .strip-day.today *, :root.auto-dark .strip-day.today * { color: var(--on-accent); }
.strip-day.today { color: #fff; }

/* ---------------------------------------------------------------- places (Browse, sidebar) */

.places { display: flex; flex-direction: column; gap: 1px; }
.place { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; color: var(--ink); font-size: 15px; font-weight: 500; }
.place:hover { background: var(--hover); text-decoration: none; }
.place.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.place svg { width: 21px; height: 21px; color: var(--ink-2); }
.place.on svg { color: var(--accent); }
.place .dot { width: 11px; height: 11px; margin: 0 5px; }
.pl-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-n { font-size: 13px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-n.late { color: var(--late); }
.places-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 2px; padding: 0 4px 0 10px; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.places-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.area-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 11px; font-weight: 650; font-size: 15px; color: var(--ink); }
.area-head:hover { background: var(--hover); }
.area-head svg { width: 20px; height: 20px; color: var(--ink-2); }
.area-head span:not(.chev) { flex: 1; text-align: left; }
.area-head .chev { color: var(--ink-3); transition: transform .2s; display: grid; }
.area-head .chev svg { width: 16px; height: 16px; }
.area.folded .chev { transform: rotate(-90deg); }
.area.folded .area-body { display: none; }
.area-body .place { padding-left: 22px; }
.side .places { flex: 1; }

/* ---------------------------------------------------------------- sheets */

.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .22s; }
.scrim.on { opacity: 1; }
.scrim.leaving { opacity: 0; pointer-events: none; }
.sheet {
  width: 100%; max-width: 640px; max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--glass-strong); -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
  border-radius: 26px 26px 0 0; box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-edge);
  padding: 0 0 calc(10px + var(--safe-b)); transform: translateY(24px); transition: transform .32s var(--ease);
}
.scrim.on .sheet { transform: none; }
.scrim.leaving .sheet { transform: translateY(40px); }
.scrim.tall .sheet { max-height: 94vh; max-height: 94dvh; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 4px; touch-action: none; cursor: grab; }
.sheet-body { padding: 4px 20px 12px; }
.sheet-body h2, .sheet-title { font: 700 21px/1.2 var(--display); margin: 8px 0 14px; }
.sub-head { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 18px 2px 8px; }
@media (min-width: 700px) {
  .scrim { align-items: flex-start; padding-top: 9vh; }
  .sheet { border-radius: 24px; max-width: 560px; max-height: 82vh; transform: translateY(-8px) scale(.985); }
  .scrim.tall .sheet { max-width: 620px; max-height: 84vh; }
  .scrim.small .sheet { max-width: 440px; }
  .scrim.leaving .sheet { transform: scale(.985); }
  .grab { visibility: hidden; height: 4px; }
  .scrim.qa-sheet { padding-top: 16vh; }
}

.menu { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 8px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-align: left; font-size: 16px; width: 100%; }
.menu-item:hover { background: var(--hover); }
.menu-item.on { color: var(--accent-ink); font-weight: 600; }
.menu-item.danger { color: var(--late); }
.menu-item.static:hover { background: none; }
.menu-item.indent { padding-left: 40px; font-size: 15px; }
.menu-head { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 12px 12px 4px; }
.mi-icon { width: 24px; display: grid; place-items: center; color: var(--ink-2); }
.mi-icon svg { width: 21px; height: 21px; }
.menu-item.on .mi-icon, .menu-item.danger .mi-icon { color: inherit; }
.mi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mi-text small { color: var(--ink-3); font-size: 13px; font-weight: 400; }
.mi-check { color: var(--accent); display: grid; }
.mi-check svg { width: 18px; height: 18px; }
.pick { max-height: 50vh; overflow-y: auto; margin-top: 10px; }

.row-field { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.row-field > svg { width: 20px; height: 20px; color: var(--ink-2); }
.row-field > span { flex: 1; }
.row-field input:not([type="checkbox"]):not([type="time"]) { border: 0; background: transparent; outline: none; text-align: right; font-size: 15px; flex: 1.2; min-width: 0; color: var(--ink); }
.row-field.toggle input, .set-row.toggle input { appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.row-field.toggle input::after, .set-row.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .22s var(--ease); }
.row-field.toggle input:checked, .set-row.toggle input:checked { background: var(--accent); }
.row-field.toggle input:checked::after, .set-row.toggle input:checked::after { transform: translateX(18px); }

/* When */
.quick-dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 14px; }
.quick-dates button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.quick-dates button svg { width: 22px; height: 22px; color: var(--accent); }
.quick-dates button:hover { background: var(--hover); }
.quick-dates button.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); color: var(--accent-ink); }
.cal { background: var(--surface); border-radius: 18px; padding: 8px 10px 10px; box-shadow: inset 0 0 0 1px var(--line); }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 6px; }
.cal-head b { font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-grid .wd { font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 4px 0; }
.cal-grid button { position: relative; height: 38px; border-radius: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.cal-grid button:hover { background: var(--hover); }
.cal-grid button.past { color: var(--ink-3); }
.cal-grid button.today { color: var(--accent-ink); font-weight: 800; }
.cal-grid button.sel { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cal-grid button i { position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink-3); }
.cal-grid button.sel i { background: var(--on-accent); }
.when-rows { margin-top: 8px; }
.when .chips { margin: 4px 0; }
.when .chip { min-height: 30px; font-size: 13px; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; padding: 4px 0 8px; }
.swatch { aspect-ratio: 1; border-radius: 14px; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.swatch.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }

/* Quick add */
.qa { padding-top: 10px; }
.qa-field { position: relative; }
.qa-field textarea, .qa-mirror {
  font: 500 19px/1.45 var(--font); padding: 12px 4px; margin: 0; border: 0; width: 100%;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; letter-spacing: normal;
}
.qa-field textarea { position: relative; z-index: 1; resize: none; background: transparent; color: var(--ink); outline: none; min-height: 52px; max-height: 40vh; overflow-y: auto; caret-color: var(--accent); }
.qa-field textarea::placeholder { color: var(--ink-3); }
.qa-mirror { position: absolute; inset: 0; color: transparent; pointer-events: none; overflow: hidden; }
.qa-mirror mark { color: transparent; border-radius: 6px; padding: 1px 0; box-shadow: 0 0 0 2px var(--mk); background: var(--mk); }
.k-date, .k-time { --mk: color-mix(in srgb, var(--accent) 18%, transparent); }
.k-repeat { --mk: color-mix(in srgb, var(--accent-2) 20%, transparent); }
.k-project { --mk: color-mix(in srgb, #1F9A8D 20%, transparent); }
.k-tag { --mk: color-mix(in srgb, #8A5CCB 20%, transparent); }
.k-priority { --mk: color-mix(in srgb, var(--p1) 20%, transparent); }
.k-remind, .k-email { --mk: color-mix(in srgb, var(--p2) 22%, transparent); }
.k-note { --mk: var(--bg-2); }
.qa-preview { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; margin: 2px 0 10px; }
.pv-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px 3px 9px; border-radius: 10px; font-size: 13px; font-weight: 600; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); animation: chipin .2s var(--ease); }
.pv-chip svg { width: 15px; height: 15px; }
.pv-chip > svg:last-child { width: 12px; height: 12px; opacity: .45; }
.pv-chip[data-ig=""] > svg:last-child { display: none; }
.pv-chip.late { color: var(--late); }
.pv-chip.faint { color: var(--ink-3); }
.pv-chip .dot { width: 9px; height: 9px; }
.pv-chip:hover { background: var(--hover); }
@keyframes chipin { from { opacity: 0; transform: translateY(3px); } }
.pv-many { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); }
.pv-many svg { width: 18px; height: 18px; color: var(--accent); }
.qa-bar { display: flex; align-items: center; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.qa-btn { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 9px; border-radius: 11px; color: var(--ink-2); font-size: 13px; font-weight: 600; min-width: 0; flex-shrink: 1; white-space: nowrap; }
.qa-btn span { overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
@media (max-width: 460px) { #bProj span, #bTags span, #bRem span { display: none; } }
@media (max-width: 400px) { #bWhen span, #bP span { display: none; } }
.qa-btn svg { width: 20px; height: 20px; }
.qa-btn:hover { background: var(--hover); color: var(--ink); }
.qa-btn span:empty { display: none; }
.qa-btn.p1 { color: var(--p1); } .qa-btn.p2 { color: var(--p2); } .qa-btn.p3 { color: var(--p3); }
.qa-add { margin-left: auto; min-width: 76px; flex-shrink: 0; }
.qa-tip { font-size: 13px; color: var(--ink-3); margin: 10px 2px 0; }
.qa-tip b { color: var(--ink-2); font-weight: 600; }
@media (max-width: 380px) { .qa-btn { padding: 0 6px; } }

.flag { display: inline-grid; color: var(--p0); }
.flag.p1 { color: var(--p1); } .flag.p2 { color: var(--p2); } .flag.p3 { color: var(--p3); }
.flag svg { width: 20px; height: 20px; }

/* Task detail */
.detail { padding-top: 6px; }
.d-top { display: flex; align-items: flex-start; gap: 10px; }
.check.big { width: 32px; height: 32px; margin-top: 4px; }
.check.big .ring { width: 25px; height: 25px; }
.check.small { width: 22px; height: 22px; }
.check.small .ring { width: 17px; height: 17px; border-width: 1.8px; border-radius: 6px; }
.check.small .tick svg { width: 12px; height: 12px; }
.d-title { flex: 1; border: 0; background: transparent; outline: none; resize: none; font: 650 22px/1.3 var(--font); color: var(--ink); padding: 4px 0; overflow: hidden; }
.d-note { width: 100%; border: 0; background: transparent; outline: none; resize: none; font-size: 15px; line-height: 1.5; color: var(--ink-2); padding: 4px 0 4px 42px; overflow: hidden; }
.d-note::placeholder, .d-title::placeholder { color: var(--ink-3); }
.d-steps { margin: 6px 0 10px 38px; }
.step { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.step input { flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--ink); padding: 6px 0; border-bottom: 1px solid transparent; }
.step input:focus { border-bottom-color: var(--line-2); }
.step.done input { color: var(--ink-3); text-decoration: line-through; }
.step.add { color: var(--ink-3); }
.step.add svg { width: 18px; height: 18px; margin: 0 2px; }
.step .icon-btn { opacity: 0; }
.step:hover .icon-btn, .step:focus-within .icon-btn { opacity: 1; }
@media (hover: none) { .step .icon-btn { opacity: .6; } }
.d-rows { background: var(--surface); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.d-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; text-align: left; font-size: 15px; border-top: 1px solid var(--line); }
.d-row:first-child { border-top: 0; }
.d-row:hover { background: var(--hover); }
.d-row > svg, .d-row > .flag svg { width: 20px; height: 20px; color: var(--ink-2); }
.d-row > .dot { margin: 0 5px; }
.d-row .lab { color: var(--ink-2); width: 92px; flex-shrink: 0; }
.d-row .val { flex: 1; min-width: 0; text-align: right; color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }
.d-row .val.late { color: var(--late); }
.d-foot { color: var(--ink-3); font-size: 12px; text-align: center; margin: 14px 0 0; }

/* Selection bar */
.bulk { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 18px; box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); animation: rise .25s var(--ease); max-width: calc(100vw - 20px); }
@media (min-width: 900px) { .bulk { bottom: 24px; left: calc(50% + var(--side) / 2); } }
.bulk-n { font-size: 14px; font-weight: 700; padding: 0 10px 0 8px; white-space: nowrap; }
.bulk button { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); }
.bulk button:hover { background: var(--hover); color: var(--ink); }
.bulk button svg { width: 21px; height: 21px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translate(-50%, 16px); z-index: 60; opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 18px; border-radius: 16px; max-width: calc(100vw - 32px);
  background: color-mix(in srgb, var(--ink) 88%, transparent); color: var(--bg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-2); font-size: 15px; font-weight: 500; transition: opacity .2s, transform .28s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: color-mix(in srgb, var(--accent-2) 70%, var(--bg)); font-weight: 700; padding: 4px 8px; border-radius: 8px; }
:root[data-theme="dark"] .toast button, :root.auto-dark .toast button { color: var(--accent-ink); filter: brightness(.7) saturate(1.4); }
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + var(--side) / 2); } }
body.selecting .toast { bottom: calc(150px + var(--safe-b)); }

/* ---------------------------------------------------------------- settings and other pages */

.card-list { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); margin: 14px 0 18px; overflow: hidden; }
.list-head { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 0; padding: 16px 18px 6px; display: flex; align-items: center; justify-content: space-between; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 8px 18px; border-top: 1px solid var(--line); font-size: 15px; width: 100%; text-align: left; }
.list-head + .set-row, .list-head + .accents { border-top: 0; }
.set-row > span:first-child { display: flex; align-items: center; gap: 12px; }
.set-row > span:first-child > svg, .link-row > svg:first-child { width: 20px; height: 20px; color: var(--ink-2); }
.set-row small { display: block; color: var(--ink-3); font-size: 13px; }
.link-row { color: var(--ink); }
.link-row:hover { background: var(--hover); text-decoration: none; }
.link-row > span { flex: 1; display: block !important; }
.link-row > svg:last-child { width: 18px; height: 18px; color: var(--ink-3); }
.link-row { justify-content: flex-start; }
.set-note { display: flex; gap: 12px; padding: 12px 18px; margin: 0; color: var(--ink-2); font-size: 14px; border-top: 1px solid var(--line); }
.set-note svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); }
.set-note.small { font-size: 13px; color: var(--ink-3); padding-top: 8px; }
.danger-text { color: var(--late); }
.danger-text svg { color: var(--late) !important; }

.accents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 8px 18px 16px; }
.accent-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); text-align: left; background: var(--surface-2); transition: box-shadow .15s; }
.accent-card.on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.accent-card b { font-size: 15px; margin-top: 6px; }
.accent-card small { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.ac-swatch { display: flex; width: 100%; height: 38px; border-radius: 10px; overflow: hidden; }
.ac-swatch i { flex: 1; }
.ac-swatch i:first-child { background: linear-gradient(145deg, var(--a1), color-mix(in srgb, var(--a1) 70%, #fff)); }
.ac-swatch i:last-child { background: #15181D; position: relative; }
.ac-swatch i:last-child::after { content: ''; position: absolute; inset: 9px 12px; border-radius: 6px; background: var(--a2); }
@media (max-width: 420px) { .accent-card small { display: none; } }

.search-box { display: flex; align-items: center; gap: 10px; padding: 0 14px; margin: 4px 0 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.search-box svg { width: 20px; height: 20px; color: var(--ink-3); }
.search-box input { flex: 1; border: 0; outline: none; background: transparent; font-size: 17px; padding: 13px 0; color: var(--ink); }
.search-box:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }

.narrow { max-width: 420px; }
.lede { font-size: 19px; color: var(--ink-2); margin: 6px 0 18px; }
.lede.small { font-size: 16px; }

.welcome { text-align: center; padding: calc(48px + var(--safe-t)) 8px 40px; max-width: 460px; margin: 0 auto; }
.welcome-art { display: grid; place-items: center; margin-bottom: 8px; filter: drop-shadow(0 12px 28px color-mix(in srgb, var(--accent) 35%, transparent)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }
.welcome h1 { font: 700 46px/1.05 var(--display); margin: 12px 0 4px; letter-spacing: -.02em; }
.welcome .lede { margin-bottom: 26px; }
.welcome-points { list-style: none; padding: 0; margin: 0; text-align: left; display: flex; flex-direction: column; gap: 14px; }
.welcome-points li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.welcome-points li b { color: var(--ink); font-weight: 600; }
.welcome-points svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; margin-top: 1px; padding: 6px; box-sizing: content-box; border-radius: 11px; background: var(--accent-soft); }

/* Plan my day */
.plan-dots { display: flex; gap: 5px; flex-wrap: wrap; margin: 4px 0 18px; }
.plan-dots i { width: 22px; height: 5px; border-radius: 3px; background: var(--line-2); transition: background .3s; }
.plan-dots i.past { background: var(--accent-line); }
.plan-dots i.now { background: var(--accent); }
.plan-card { padding: 22px 22px 20px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); animation: enter .35s var(--ease); }
.plan-card h2 { font: 700 26px/1.2 var(--display); margin: 4px 0 8px; overflow-wrap: anywhere; }
.plan-late { color: var(--late); font-weight: 700; font-size: 13px; margin: 0; text-transform: uppercase; letter-spacing: .05em; }
.plan-today { color: var(--accent-ink); font-weight: 700; font-size: 13px; margin: 0; text-transform: uppercase; letter-spacing: .05em; }
.plan-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.plan-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; font-size: 14px; transition: transform .12s, background .15s; }
.plan-btn svg { width: 24px; height: 24px; color: var(--accent); }
.plan-btn:hover { background: var(--hover); }
.plan-btn:active { transform: scale(.96); }
.plan-btn.primary { background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: none; }
:root[data-theme="dark"] .plan-btn.primary, :root.auto-dark .plan-btn.primary { color: var(--on-accent); }
.plan-btn.primary svg { color: inherit; }
.plan-btn.ghost { background: transparent; color: var(--ink-2); }
.plan-done { text-align: center; padding: 30px 0; }
.plan-done h2 { font: 700 24px/1.2 var(--display); margin: 8px 0 6px; }
.plan-done p { color: var(--ink-2); }
.btn.soft.small svg { width: 17px; height: 17px; }

/* Import preview */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-grid div { background: var(--surface); border-radius: 14px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; }
.stat-grid b { font: 700 22px/1.1 var(--display); }
.stat-grid span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.warn-list { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.warn-list summary { cursor: pointer; font-weight: 600; }

/* Help */
.prose { font-size: 15px; }
.prose h2 { font: 700 20px/1.2 var(--display); margin: 22px 0 10px; }
table.help { width: 100%; border-collapse: collapse; }
table.help td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
table.help td:first-child { width: 46%; }
table.help code { font: 600 13px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; background: var(--accent-soft); color: var(--accent-ink); padding: 2px 6px; border-radius: 6px; }

/* Admin */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.tile { background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 2px; }
.tile b { font: 700 24px/1.1 var(--display); }
.tile span { font-size: 13px; color: var(--ink-2); }
.tile small { font-size: 12px; color: var(--ink-3); }
.chart { margin: 8px 0 18px; background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .s0 { fill: var(--accent); } .chart .s1 { fill: var(--accent-2); opacity: .55; }
.chart .ax { fill: var(--ink-3); font-size: 11px; } .chart .axl { stroke: var(--line-2); }
.chart figcaption { font-size: 12px; color: var(--ink-2); display: flex; gap: 14px; align-items: center; margin-top: 6px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -8px; }
.key.s0 { background: var(--accent); } .key.s1 { background: var(--accent-2); opacity: .55; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 700; padding: 10px 12px; }
table.data td { padding: 10px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
table.data tr[data-u] { cursor: pointer; }
table.data tr[data-u]:hover td { background: var(--hover); }

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .welcome-art { animation: none; }
}
.sheet:focus { outline: none; }

/* ---------------------------------------------------------------- daylight glass (light mode)
 *
 * Light mode gets the same depth as dark: a luminous page with livelier
 * colour fields, glass that is bright rather than grey (white sheen, a lit
 * top edge, a soft accent-tinted shadow), a scrim that frosts the page
 * instead of greying it, and milk-glass cards the colour fields glow through.
 * Dark mode is untouched. Text stays on surfaces at least 72% opaque.
 */
:root:not([data-theme="dark"]):not(.auto-dark) {
  --blob-b: .20;
  --warm: #FFC996; --warm-o: .30;
  --glass: rgba(255, 255, 255, .66);
  --glass-strong: rgba(255, 255, 255, .80);
  --glass-edge: rgba(255, 255, 255, .95);
  --glass-rim: rgba(255, 255, 255, .75);
  --milk: rgba(255, 255, 255, .74);
  --scrim: color-mix(in srgb, var(--accent) 10%, rgba(240, 238, 232, .38));
  --shadow-glass: 0 1px 1px rgba(20, 22, 30, .03), 0 12px 32px -8px color-mix(in srgb, var(--accent) 22%, rgba(20, 22, 30, .10));
  --shadow-2: 0 2px 6px rgba(20, 22, 30, .05), 0 24px 56px -12px color-mix(in srgb, var(--accent) 28%, rgba(20, 22, 30, .14));
}
html:not([data-theme="dark"]):not(.auto-dark) {
  background: linear-gradient(180deg, #F9F7F2 0%, #F4F2EC 55%, #F1EFEA 100%) fixed;
}

/* Clay is already warm: a quieter sunrise field. */
html[data-accent="clay"]:not([data-theme="dark"]):not(.auto-dark) { --warm-o: .16; }

/* Colour fields: livelier, plus a warm sunrise field (the icon's peach dot). */
html:not([data-theme="dark"]):not(.auto-dark) .backdrop i { filter: blur(80px) saturate(140%); }
html:not([data-theme="dark"]):not(.auto-dark) .backdrop::before {
  content: ''; position: absolute; width: 44vmax; height: 44vmax; right: -12vmax; top: -14vmax; border-radius: 50%;
  background: var(--warm); opacity: var(--warm-o); filter: blur(90px);
}

/* Glass: bright sheen, lit top edge, soft coloured shadow. */
html:not([data-theme="dark"]):not(.auto-dark) .glass,
html:not([data-theme="dark"]):not(.auto-dark) body.scrolled .head {
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), var(--glass));
  -webkit-backdrop-filter: saturate(200%) blur(24px); backdrop-filter: saturate(200%) blur(24px);
}
html:not([data-theme="dark"]):not(.auto-dark) .tabs { border-top-color: var(--glass-rim); box-shadow: 0 -1px 0 rgba(20, 22, 30, .05), 0 -10px 30px -12px color-mix(in srgb, var(--accent) 18%, transparent); }
html:not([data-theme="dark"]):not(.auto-dark) .side { border-right-color: var(--glass-rim); box-shadow: 1px 0 0 rgba(20, 22, 30, .05); }
html:not([data-theme="dark"]):not(.auto-dark) body.scrolled .head { background: linear-gradient(180deg, rgba(255, 255, 255, .90), rgba(255, 255, 255, .76)); border-bottom-color: rgba(20, 22, 30, .06); box-shadow: inset 0 -1px 0 var(--glass-rim); }

/* The scrim frosts the page behind a sheet instead of greying it. */
html:not([data-theme="dark"]):not(.auto-dark) .scrim { -webkit-backdrop-filter: blur(4px) saturate(120%); backdrop-filter: blur(4px) saturate(120%); }
html:not([data-theme="dark"]):not(.auto-dark) .sheet {
  background: linear-gradient(180deg, rgba(255, 255, 255, .90), var(--glass-strong) 40%);
  -webkit-backdrop-filter: saturate(200%) blur(30px); backdrop-filter: saturate(200%) blur(30px);
  box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px var(--glass-rim);
}

/* Milk-glass cards: the colour fields glow faintly through. */
html:not([data-theme="dark"]):not(.auto-dark) :is(.card-list, .plan-card, .d-rows, .cal, .tile, .stat-grid div, .strip-day:not(.today), .quick-dates button, .accent-card, .plan-btn:not(.primary):not(.ghost)) {
  background: var(--milk);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
}
html:not([data-theme="dark"]):not(.auto-dark) :is(.card-list, .plan-card) { box-shadow: var(--shadow-glass), inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px rgba(20, 22, 30, .05); }
html:not([data-theme="dark"]):not(.auto-dark) .accent-card.on { background: color-mix(in srgb, var(--accent) 10%, var(--milk)); }

/* Toast: dark glass on a light page, so it reads at a glance. */
html:not([data-theme="dark"]):not(.auto-dark) .toast { background: color-mix(in srgb, var(--ink) 80%, transparent); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, .12); }

/* Jewel sheen on gradient elements (both themes): a lit top edge. */
.btn.primary, .fab, .brand-mark, .strip-day.today, .plan-btn.primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent); }
.fab { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .30), 0 10px 26px -4px color-mix(in srgb, var(--accent) 50%, transparent), var(--shadow-1); }
.btn.soft { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
:root[data-theme="dark"] .btn.soft, :root.auto-dark .btn.soft { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html:not([data-theme="dark"]):not(.auto-dark) :is(.glass, .sheet, body.scrolled .head) { background: var(--surface-2); }
}

/* Dark mode: text on the light red danger fill uses the dark on-accent ink (was white, about 2.6:1). */
:root[data-theme="dark"] .btn.danger, :root.auto-dark .btn.danger { color: var(--on-accent); }

/* ================================================================ version 2 */

/* Small additions to rows and fields */
.m-dur { color: var(--ink-3); font-weight: 500; }
.t-meta .m-dur svg { width: 13px; height: 13px; }
.m-alarm { color: var(--p1); }
.m-focus { color: var(--ink-3); }
.row-field > span small, .set-row small { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.btn-row.start { justify-content: flex-start; }
.k-duration { --mk: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); }
.k-alarm { --mk: color-mix(in srgb, var(--p1) 24%, transparent); }
.focus-btn { margin-top: 14px; }
.count.focus { display: inline-flex; align-items: center; gap: 3px; color: var(--accent-ink); background: var(--accent-soft); }
.count.focus svg { width: 12px; height: 12px; }
.log-row.focus { cursor: pointer; border-radius: 12px; }
.log-row.focus:hover { background: var(--hover); }
.log-row.focus svg { color: var(--accent); }

/* A switch of icons: list, timeline, week, month */
.seg.icons { padding: 3px; }
.seg.icons button { display: grid; place-items: center; width: 36px; height: 30px; padding: 0; }
.seg.icons svg { width: 19px; height: 19px; }
.seg.icons button.on { color: var(--accent-ink); }
@media (max-width: 480px) { .plan-link span { display: none; } .plan-link { padding: 0 9px; } }
@media (max-width: 360px) { .head h1 { font-size: 27px; } }

/* Today's banner when reminders are off */
.rem-banner { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; padding: 10px 8px 10px 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent-line); font-size: 14px; color: var(--ink-2); animation: enter .3s var(--ease); }
.rem-banner > svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.rem-banner > span { flex: 1; min-width: 0; }
.rem-banner b { color: var(--ink); font-weight: 650; }

/* The sheet that turns reminders on */
.rs { padding-top: 0; }
.rs-art { display: block; width: 96px; height: 96px; margin: 2px auto 0; filter: drop-shadow(0 10px 22px color-mix(in srgb, var(--accent) 30%, transparent)); }
.rs-art .rs-wave { animation: ring 2.4s var(--ease) infinite; transform-origin: 60px 60px; }
@keyframes ring { 0%, 60%, 100% { opacity: .9; transform: none; } 70% { transform: rotate(-6deg); } 80% { transform: rotate(6deg); } 90% { transform: rotate(-3deg); } }
.rs .sheet-title { margin: 10px 0 4px; }
.rs-lede { margin: 0 auto 16px; max-width: 360px; font-size: 15px; }
.rs-steps { list-style: none; padding: 0; margin: 0 0 8px; position: relative; }
.rs-steps::before { content: ''; position: absolute; left: 15px; top: 18px; bottom: 18px; width: 2px; background: var(--line-2); border-radius: 1px; }
.rs-step { position: relative; display: flex; gap: 14px; padding: 8px 0; }
.rs-n { position: relative; z-index: 1; flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--font);
  background: var(--surface); color: var(--ink-3); box-shadow: inset 0 0 0 2px var(--line-2); }
.rs-n svg { width: 16px; height: 16px; }
.rs-step.now .rs-n { background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: var(--on-accent); box-shadow: 0 3px 12px color-mix(in srgb, var(--accent) 35%, transparent); }
:root:not([data-theme="dark"]):not(.auto-dark) .rs-step.now .rs-n { color: #fff; }
.rs-step.done .rs-n { background: var(--good); color: #fff; box-shadow: none; }
.rs-body { flex: 1; min-width: 0; padding-top: 5px; }
.rs-body b { font-size: 16px; font-weight: 650; }
.rs-step.later .rs-body { opacity: .55; }
.rs-step.done .rs-body b { color: var(--ink-2); }
.rs-body p { margin: 3px 0 10px; color: var(--ink-2); font-size: 14px; }
.rs-step.later .rs-body p { display: none; }
.rs-how { margin: 0 0 12px; padding-left: 20px; font-size: 14px; color: var(--ink-2); }
.rs-how li { margin: 4px 0; }
.rs-how.pics { list-style: none; padding: 0; }
.rs-how.pics li { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.rs-pic { flex: 0 0 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); color: #0A84FF; }
.rs-pic img { width: 26px; height: 26px; border-radius: 7px; }
.rs .row-field { border-bottom: 0; padding: 8px 0; }

/* ---------------------------------------------------------------- the timeline */

.tl-wrap { margin: 2px 0 20px; }
.tl-tray { margin: 0 0 14px; padding: 10px 12px 12px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, background .15s; }
.tl-tray-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0 2px 8px; }
.tl-tray-head .hint { margin: 0; font-weight: 500; color: var(--ink-3); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 36px; padding: 4px 12px 4px 6px; border-radius: 12px; font-size: 14px; font-weight: 550;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tl-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-chip small { color: var(--ink-3); font-size: 12px; }
.tl-chip.late > span { color: var(--late); }
.tl-chip.p1 { --pc: var(--p1); } .tl-chip.p2 { --pc: var(--p2); } .tl-chip.p3 { --pc: var(--p3); }
.tl-chip.placeholder { opacity: .35; }

.tl { position: relative; margin-left: 56px; border-left: 1px solid var(--line-2); }
.tl-hour { height: 64px; position: relative; border-top: 1px solid var(--line); }
.tl-hour:first-child { border-top-color: transparent; }
.tl-hour span { position: absolute; left: -56px; top: -8px; width: 48px; text-align: right; font-size: 11.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-hour:first-child span { top: 0; }
.tl-hour::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--line); }
.tl-lane { position: absolute; inset: 0 4px 0 6px; }
.tl-now { position: absolute; left: -6px; right: 0; height: 2px; background: var(--late); z-index: 4; pointer-events: none; border-radius: 1px; }
.tl-now i { position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--late); box-shadow: 0 0 0 3px color-mix(in srgb, var(--late) 25%, transparent); }

.tl-block { position: absolute; display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px 7px 8px; border-radius: 12px; overflow: hidden;
  --tc: var(--c, var(--accent));
  background: color-mix(in srgb, var(--tc) 13%, var(--surface)); box-shadow: inset 3px 0 0 var(--pc, var(--tc)), inset 0 0 0 1px color-mix(in srgb, var(--tc) 22%, transparent);
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: box-shadow .15s, transform .15s; }
.tl-block.p1 { --pc: var(--p1); } .tl-block.p2 { --pc: var(--p2); } .tl-block.p3 { --pc: var(--p3); }
.tl-block .check { margin-top: -2px; }
.tl-block .check .ring { background: var(--surface); }
.tl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tl-text b { font-size: 14px; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-when { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-block.short { align-items: center; padding-top: 2px; padding-bottom: 2px; }
.tl-block.short .tl-text { flex-direction: row; gap: 8px; align-items: baseline; }
.tl-block.short .tl-text b { -webkit-line-clamp: 1; white-space: nowrap; display: block; text-overflow: ellipsis; }
.tl-alarm { color: var(--p1); display: grid; }
.tl-alarm svg { width: 16px; height: 16px; }
.tl-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; cursor: ns-resize; touch-action: none; }
.tl-grip::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: color-mix(in srgb, var(--tc) 45%, transparent); opacity: 0; transition: opacity .15s; }
.tl-block:hover .tl-grip::after, .tl-block.lifted .tl-grip::after { opacity: 1; }
@media (hover: none) { .tl-grip::after { opacity: .7; } }
.tl-block.done { opacity: .55; cursor: default; }
.tl-block.done .tl-text b { text-decoration: line-through; color: var(--ink-3); }
.tl-block.done .check .ring { background: var(--pc, var(--accent)); border-color: var(--pc, var(--accent)); }
.tl-block.done .check .tick { transform: scale(1); }
.tl-block.lifted { box-shadow: inset 3px 0 0 var(--pc, var(--tc)), 0 12px 30px -6px color-mix(in srgb, var(--tc) 45%, rgba(0, 0, 0, .25)); transform: scale(1.02); z-index: 6; cursor: grabbing; }
.tl-block.to-tray { opacity: .6; }
.tl-ghost { box-shadow: inset 3px 0 0 var(--pc, var(--accent)), var(--shadow-2); opacity: .95; pointer-events: none; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.tl-ghost:not(.over) { transform: rotate(-1.5deg); }
.tl-drag-label { position: absolute; right: 6px; top: 6px; padding: 2px 8px; border-radius: 8px; font: 700 12px/18px var(--font); color: var(--on-accent); background: var(--accent); pointer-events: none; }
:root:not([data-theme="dark"]):not(.auto-dark) .tl-drag-label { color: #fff; }
body.dragging-now, body.dragging-now * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }

/* ---------------------------------------------------------------- the calendar */

.cal-view { margin-bottom: 12px; }
.cal-bar { display: flex; align-items: center; gap: 4px; margin: 2px 0 10px; }
.cal-bar h2 { flex: 1; margin: 0; text-align: center; font: 700 19px/1.2 var(--display); }
.cal-grid-big { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 2px 0 4px; }
.cal-cell { position: relative; min-height: 62px; padding: 6px 5px 5px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background .15s, box-shadow .15s; }
.cal-cell:hover { background: color-mix(in srgb, var(--hover) 60%, var(--surface)); }
.cal-cell.out { opacity: .45; }
.cal-cell.past .cal-num { color: var(--ink-3); }
.cal-num { font: 700 14px/1 var(--font); font-variant-numeric: tabular-nums; align-self: flex-start; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 12px; margin: -2px 0 0 -1px; }
.cal-cell.today .cal-num { background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: var(--on-accent); }
:root:not([data-theme="dark"]):not(.auto-dark) .cal-cell.today .cal-num { color: #fff; }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.cal-cell.drop-into { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px; padding-left: 2px; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.cal-dot.p1 { background: var(--p1); } .cal-dot.p2 { background: var(--p2); } .cal-dot.p3 { background: var(--p3); }
.cal-dot.p0 { background: var(--accent); opacity: .75; }
.cal-dot.more { background: none; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-item { font-size: 12px; font-weight: 550; line-height: 1.3; padding: 2px 6px; border-radius: 7px; background: var(--accent-soft); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 2px 0 0 var(--pc, var(--accent)); cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cal-item i { font-style: normal; color: var(--ink-2); font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }
.cal-item.p1 { --pc: var(--p1); } .cal-item.p2 { --pc: var(--p2); } .cal-item.p3 { --pc: var(--p3); }
.cal-item.late { color: var(--late); }
.cal-item.placeholder { opacity: .35; }
.cal-ghost { box-shadow: var(--shadow-2); pointer-events: none; background: var(--surface); transform: rotate(-2deg); }
.cal-more { font-size: 11px; font-weight: 600; color: var(--ink-3); padding-left: 6px; }
.cal-wdn { display: none; }
.cal-day { margin-top: 16px; }
/* A week on a phone: one row a day, its tasks as chips beside the date. */
@media (max-width: 699px) {
  .cal-grid-big.week { grid-template-columns: 1fr; gap: 6px; }
  .cal-grid-big.week .cal-wd { display: none; }
  .cal-grid-big.week .cal-cell { flex-direction: row; align-items: flex-start; gap: 10px; min-height: 52px; padding: 8px 10px; }
  .cal-grid-big.week .cal-num { order: 1; margin: 0; }
  .cal-grid-big.week .cal-wdn { display: block; order: 0; width: 34px; padding-top: 4px; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
  .cal-grid-big.week .cal-items { order: 2; flex: 1; flex-direction: row; flex-wrap: wrap; gap: 4px; padding-top: 1px; }
  .cal-grid-big.week .cal-item { font-size: 13px; padding: 3px 8px; max-width: 100%; }
  .cal-grid-big.week .cal-more { align-self: center; }
}
@media (min-width: 700px) {
  .cal-cell { min-height: 104px; padding: 7px 6px 6px; }
  .cal-grid-big.week .cal-cell { min-height: 260px; }
  .cal-grid-big.week .cal-item { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; max-height: calc(3 * 1.3em + 6px); padding: 3px 5px; }
  .cal-grid-big.week .cal-item i { display: block; margin: 0; }
}
@media (max-width: 380px) { .cal-grid-big { gap: 3px; } .cal-cell { border-radius: 11px; padding: 5px 3px; } }

/* ---------------------------------------------------------------- focus */

.focus-sheet .sheet { max-width: 520px; }
.fx { text-align: center; padding-bottom: 18px; }
.fx-label { margin: 6px 0 2px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.fx-label.break, .fx-label.rested { color: var(--good); }
.fx-title { font: 700 23px/1.25 var(--display); margin: 0 auto 14px; max-width: 420px; overflow-wrap: anywhere; }
.fx-ring { position: relative; width: min(240px, 68vw); aspect-ratio: 1; margin: 4px auto 8px; }
.fx-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fx-track { fill: none; stroke: var(--line-2); stroke-width: 10; }
.fx-arc { fill: none; stroke: url(#fxg); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.fx-ring.break .fx-arc, .fx-ring.rested .fx-arc { stroke: var(--good); }
.fx-ring.paused .fx-arc { opacity: .45; }
.fx-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fx-time { font: 700 54px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.fx-time svg { width: 64px; height: 64px; color: var(--good); }
.fx-of { margin-top: 6px; color: var(--ink-3); font-size: 14px; font-weight: 550; }
.fx-dots { display: flex; justify-content: center; align-items: center; gap: 5px; min-height: 18px; margin: 4px 0 14px; }
.fx-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.fx-dots span { margin-left: 6px; font-size: 13px; color: var(--ink-2); }
.fx-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 6px 0 16px; }
.fx-btn { width: 60px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.fx-btn svg { width: 22px; height: 22px; padding: 13px; box-sizing: content-box; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); }
.fx-btn:hover svg { background: var(--hover); }
.fx-main { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--accent-2), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 26px -6px color-mix(in srgb, var(--accent) 55%, transparent); transition: transform .12s; }
:root[data-theme="dark"] .fx-main, :root.auto-dark .fx-main { color: var(--on-accent); }
.fx-main:active { transform: scale(.95); }
.fx-main svg { width: 30px; height: 30px; }
.fx .btn-col { max-width: 340px; margin: 10px auto 0; }
.chips.center { justify-content: center; }

.focus-pill { position: fixed; left: 16px; bottom: calc(86px + var(--safe-b)); z-index: 22; display: flex; align-items: center; gap: 8px; max-width: min(60vw, 300px);
  padding: 9px 14px 9px 12px; border-radius: 18px; box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); font-size: 14px; animation: rise .3s var(--ease); }
.focus-pill b { font-variant-numeric: tabular-nums; font-weight: 700; }
.fp-t { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-line); animation: breathe 2s ease-in-out infinite; flex-shrink: 0; }
.focus-pill.brk .fp-dot { background: var(--good); }
.focus-pill.paused .fp-dot { animation: none; opacity: .5; }
@keyframes breathe { 50% { box-shadow: 0 0 0 5px transparent; transform: scale(1.15); } }
@media (min-width: 900px) { .focus-pill { left: calc(var(--side) + 24px); bottom: 24px; } }
body.bare .focus-pill { display: none; }

/* The calendar link in Settings */
.feed-box { padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.feed-box .sub-head { margin: 0 0 8px; display: block; }
.feed-url { display: flex; gap: 8px; margin-bottom: 12px; }
.feed-url input { flex: 1; min-width: 0; font: 13px/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-2); }
.feed-box .chips { margin-bottom: 4px; }

/* Milk glass for the new cards in light mode */
html:not([data-theme="dark"]):not(.auto-dark) :is(.tl-tray, .cal-cell:not(.sel):not(.drop-into), .rem-banner) {
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
}
html:not([data-theme="dark"]):not(.auto-dark) :is(.tl-tray, .cal-cell:not(.sel):not(.drop-into)) { background: var(--milk); }
.log-row .muted { white-space: nowrap; }
.log-row > span:not(.muted) { flex: 1; min-width: 0; }
.focus-pill { background: var(--glass-strong); }
