/* Ripe — design tokens
   Tomato for focus, leaf for rest, sun for long breaks and lunch, lilac for rituals.
   Paper is a cool porcelain, ink a deep aubergine. */
:root {
  --paper: #F4F3FA;
  --paper-2: #EAE8F4;
  --card: #FFFFFF;
  --ink: #1F1A36;
  --ink-2: #5B5674;
  --ink-3: #8E89A6;
  --line: rgba(31, 26, 54, .11);
  --tomato: #EC3A22;
  --tomato-ink: #FFF3EC;
  --leaf: #13926A;
  --leaf-soft: #D5F0E3;
  --sun: #FFB81F;
  --sun-soft: #FFF0C7;
  --lilac: #8E74F2;
  --lilac-soft: #E7E0FF;
  --tomato-soft: #FFE0D8;
  --shadow: 0 1px 0 rgba(31, 26, 54, .04), 0 12px 32px -18px rgba(31, 26, 54, .28);
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --gut: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15122A; --paper-2: #1D1938; --card: #221E40; --ink: #EFECFB; --ink-2: #ADA8C8; --ink-3: #7B769A;
    --line: rgba(239, 236, 251, .1); --leaf: #2DBA8A; --leaf-soft: #173A33; --sun-soft: #3A2F17; --lilac-soft: #2C2552; --tomato-soft: #3E1D22;
    --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 16px 40px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15122A; --paper-2: #1D1938; --card: #221E40; --ink: #EFECFB; --ink-2: #ADA8C8; --ink-3: #7B769A;
  --line: rgba(239, 236, 251, .1); --leaf: #2DBA8A; --leaf-soft: #173A33; --sun-soft: #3A2F17; --lilac-soft: #2C2552; --tomato-soft: #3E1D22;
  --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 16px 40px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 16.5px; line-height: 1.5;
  font-variation-settings: 'opsz' 14;
  -webkit-font-smoothing: antialiased;
  transition: background-color .6s var(--ease), color .6s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
/* paper grain */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.1 0 0 0 0 0.2 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: .35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { mix-blend-mode: screen; opacity: .35; } }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
svg { width: 22px; height: 22px; flex: none; }
:focus-visible { outline: 2.5px solid var(--lilac); outline-offset: 3px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
kbd { font: inherit; font-weight: 600; font-size: .92em; padding: 0 .35em; border-radius: 6px; background: var(--paper-2); }
small { font-size: .82em; }

.app { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) var(--gut) calc(env(safe-area-inset-bottom) + 120px); }
#view { outline: none; }

/* ---------- type ---------- */
.display {
  margin: 0; font-weight: 700; letter-spacing: -.035em; line-height: .92;
  font-size: clamp(2.9rem, 9.5vw, 6.6rem);
  font-variation-settings: 'opsz' 96, 'wdth' 80;
  text-wrap: balance;
}
.display-sm { margin: 0; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-size: clamp(2.1rem, 5.5vw, 3.6rem); font-variation-settings: 'opsz' 96, 'wdth' 82; }
h2 { margin: 0; font-size: 1.28rem; font-weight: 650; letter-spacing: -.015em; font-variation-settings: 'opsz' 28; }
h3 { margin: 0 0 .35rem; font-size: 1.1rem; font-weight: 650; letter-spacing: -.01em; }
.lede { max-width: 38ch; color: var(--ink-2); font-size: 1.15rem; line-height: 1.45; margin: .9rem 0 0; }
.muted { color: var(--ink-2); }
.fine { font-size: .9rem; color: var(--ink-2); margin: .8rem 0 0; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: 0 1.2rem; border-radius: 999px; font-weight: 600; letter-spacing: -.005em;
  transition: transform .25s var(--spring), background-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.big { min-height: 58px; padding: 0 1.8rem; font-size: 1.08rem; }
.btn.sm { min-height: 36px; padding: 0 .9rem; font-size: .92rem; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 10px 24px -12px var(--ink); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--paper-2); }
.btn.inverse { background: var(--tomato-ink); color: #2A0E08; }
.btn.danger, .btn.ghost.danger { color: var(--tomato); }
.btn.danger:not(.ghost) { background: var(--tomato); color: #fff; }
.btn.done { background: var(--leaf); color: #fff; }
.btn.file { position: relative; cursor: pointer; }
.link { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: var(--ink-3); font-weight: 550; }
.link:hover { text-decoration-color: var(--ink); }
.link.danger { color: var(--tomato); text-decoration-color: currentColor; margin-top: 1.2rem; display: inline-block; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; transition: background .2s; }
.icon-btn:hover { background: var(--paper-2); }
.round { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--tomato); color: #fff; flex: none; transition: transform .25s var(--spring); }
.round:active { transform: scale(.9) rotate(90deg); }
.row { display: flex; align-items: center; gap: .6rem; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 1.4rem; }
.row.between { justify-content: space-between; margin-top: 1.4rem; }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 .9rem; border-radius: 999px; background: var(--paper-2); font-size: .92rem; font-weight: 550; }
.pill.ok { background: var(--leaf-soft); color: var(--leaf); }

input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; min-height: 48px; padding: .7rem .95rem; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--card); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-3); box-shadow: 0 0 0 4px var(--line); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[type=time] { font-variant-numeric: tabular-nums; }

.field { display: grid; gap: .45rem; margin-top: 1.1rem; }
.field > span:first-child { font-weight: 600; font-size: .95rem; display: flex; flex-direction: column; }
.field > span small { font-weight: 450; color: var(--ink-2); }
.field input + input { margin-top: .1rem; }
.field.inline { grid-template-columns: 1fr minmax(0, 11rem); align-items: center; gap: 1rem; }
.field.inline > span:first-child { font-weight: 550; }
.field.toggle { grid-template-columns: 1fr auto; align-items: center; cursor: pointer; }
.field.toggle > span:first-child { font-weight: 550; }
.num { display: flex; align-items: center; gap: .5rem; }
.num input { text-align: right; font-variant-numeric: tabular-nums; }
.num em { font-style: normal; color: var(--ink-2); font-size: .9rem; min-width: 3.6em; }

.switch { position: relative; display: inline-block; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--paper-2); box-shadow: inset 0 0 0 1.5px var(--line); transition: background .25s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--card); box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .3s var(--spring); }
.switch input:checked + i { background: var(--leaf); box-shadow: none; }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2.5px solid var(--lilac); outline-offset: 2px; }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--paper-2); gap: 2px; justify-self: start; }
.seg button { min-height: 38px; padding: 0 1rem; border-radius: 999px; font-weight: 550; color: var(--ink-2); transition: background .2s, color .2s; }
.seg button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px -3px rgba(31,26,54,.25); }

.panel { background: var(--card); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.panel-head + * { margin-top: 1rem; }
.count { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 550; }
.note { margin: 1rem 0 0; padding: .8rem 1rem; border-radius: var(--r-sm); background: var(--sun-soft); font-size: .95rem; }
.note.warn { background: var(--tomato-soft); }
.empty { padding: 1.6rem 0 .4rem; color: var(--ink-2); }
.empty p { margin: 0 0 1rem; max-width: 42ch; }

/* ---------- dock ---------- */
.dock {
  position: fixed; z-index: 20; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 14px); transform: translateX(-50%);
  display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--paper);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -16px rgba(20, 14, 40, .55);
  transition: background .6s var(--ease), color .6s var(--ease);
}
.dock button { display: flex; align-items: center; gap: .45rem; height: 50px; padding: 0 15px; border-radius: 999px; opacity: .62; transition: opacity .2s, background .3s var(--ease), padding .35s var(--ease); }
.dock button span { font-weight: 600; font-size: .95rem; max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .4s var(--ease); }
.dock button:hover { opacity: 1; }
.dock button[aria-current="page"] { opacity: 1; background: color-mix(in srgb, var(--paper) 16%, transparent); padding: 0 18px 0 15px; }
.dock button[aria-current="page"] span { max-width: 6.5em; }
@media (max-width: 380px) { .dock button { padding: 0 12px; } .dock button[aria-current="page"] span { max-width: 0; } .dock button[aria-current="page"] { padding: 0 12px; } }

/* ---------- toasts & sheet ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: .85rem 1.1rem; border-radius: 16px; font-weight: 550; box-shadow: 0 16px 34px -16px rgba(0,0,0,.5); animation: toastIn .45s var(--spring); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .4s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }

.sheet { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: 560px; width: 100%; margin: auto auto 0; max-height: 92dvh; }
.sheet::backdrop { background: rgba(21, 18, 42, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet[open] { animation: sheetIn .5s var(--ease); }
.sheet[open]::backdrop { animation: fade .4s var(--ease); }
.sheet-inner { background: var(--card); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 26px var(--gut) calc(env(safe-area-inset-bottom) + 26px); overflow: auto; max-height: 92dvh; }
@media (min-width: 640px) { .sheet { margin: auto; } .sheet-inner { border-radius: var(--r-lg); padding: 30px; } }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-bar { display: flex; justify-content: space-between; align-items: center; }
.sheet-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; font-variation-settings: 'opsz' 60, 'wdth' 85; margin: 0; }
.sheet-title.big { font-size: clamp(2.1rem, 8vw, 2.8rem); line-height: .95; margin-top: 1rem; }
.welcome p { color: var(--ink-2); font-size: 1.08rem; max-width: 40ch; }
.welcome .two { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.welcome .btn { width: 100%; margin-top: 1.6rem; }
.welcome-mark img { display: block; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-4deg); } }
.stepper { display: inline-flex; align-items: center; gap: .4rem; background: var(--paper-2); border-radius: 999px; padding: 4px; justify-self: start; }
.stepper button { width: 42px; height: 42px; border-radius: 50%; background: var(--card); font-size: 1.3rem; font-weight: 600; }
.stepper output { min-width: 2.4ch; text-align: center; font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- today ---------- */
.day-head { padding: 8px 0 28px; }
.day-nav { display: flex; align-items: center; gap: .2rem; margin: 0 0 1.1rem -8px; }
.day-nav .rel { font-weight: 650; min-width: 5.5em; text-align: center; }
.day-nav .clock, .day-nav .link { margin-left: auto; }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.greet { margin: .9rem 0 0; font-size: 1.2rem; color: var(--ink-2); }

.ribbon { margin-top: 1.8rem; }
.ribbon-track { position: relative; height: 18px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.ribbon-track i { position: absolute; top: 0; bottom: 0; border-right: 1.5px solid var(--paper); opacity: .92; }
.ribbon-track i.is-logged { opacity: 1; }
.ribbon-track .now { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 3px; box-shadow: 0 0 0 2px var(--paper); }
.ribbon-hours { position: relative; height: 1.4em; margin-top: 6px; font-size: .75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ribbon-hours span { position: absolute; transform: translateX(-50%); }
.ribbon-hours span:first-child { transform: none; }
.t-focus { --c: var(--tomato); --soft: var(--tomato-soft); }
.t-short { --c: var(--leaf); --soft: var(--leaf-soft); }
.t-long { --c: var(--leaf); --soft: var(--leaf-soft); }
.t-lunch { --c: var(--sun); --soft: var(--sun-soft); }
.t-ritual { --c: var(--lilac); --soft: var(--lilac-soft); }
.ribbon-track i { background: var(--c); }
.ribbon-track i.t-short { opacity: .45; }

.figures { display: flex; flex-wrap: wrap; gap: clamp(1.2rem, 5vw, 3.2rem); margin: 1.8rem 0 0; }
.figures div { display: flex; flex-direction: column-reverse; }
.figures dt { color: var(--ink-2); font-size: .92rem; }
.figures dd { margin: 0; font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; font-variation-settings: 'opsz' 60, 'wdth' 85; }
.figures dd small { font-size: .5em; color: var(--ink-3); letter-spacing: 0; font-weight: 600; }

.today-grid { display: grid; gap: 18px; align-items: start; }
@media (min-width: 940px) { .today-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; } .tasks-panel { position: sticky; top: 18px; } }

.quick { display: flex; gap: .5rem; }
.quick input { border-radius: 999px; padding-left: 1.2rem; min-height: 50px; }
.hint { font-size: .86rem; color: var(--ink-2); margin: .7rem 0 0; line-height: 1.7; }
/* Quick-add shortcuts: a chip row that scrolls edge to edge across the card, as in the app. */
.qchips {
  --bleed: clamp(18px, 3vw, 28px);
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: .7rem calc(-1 * var(--bleed)) 0; padding: 4px var(--bleed);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.qchips::-webkit-scrollbar { display: none; }
.qchips button { flex: none; display: inline-flex; align-items: center; gap: .45rem; min-height: 38px; padding: 0 .8rem; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font-size: .9rem; white-space: nowrap; transition: transform .25s var(--spring), background .2s; }
.qchips button b { color: var(--ink); font-weight: 700; }
.qchips button:hover { background: color-mix(in srgb, var(--ink) 10%, var(--paper-2)); }
.qchips button:active { transform: scale(.92); }

.task-list { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.task { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.tick { width: 28px; height: 28px; margin-top: 1px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink-3); display: grid; place-items: center; color: transparent; transition: background .25s, box-shadow .25s, transform .3s var(--spring); flex: none; }
.tick svg { width: 16px; height: 16px; }
.tick:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.task.prio-must .tick { box-shadow: inset 0 0 0 2.5px var(--tomato); }
.task.is-done .tick { background: var(--leaf); box-shadow: none; color: #fff; transform: scale(1.04); }
.task-body { text-align: left; flex: 1; min-width: 0; display: grid; gap: .25rem; }
.task-title { font-weight: 560; font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; }
.task.is-done .task-title { text-decoration: line-through; text-decoration-color: var(--ink-3); color: var(--ink-2); }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; font-size: .84rem; color: var(--ink-2); }
.task-meta .fixed { color: var(--lilac); font-weight: 600; }
.task-meta .over { color: var(--tomato); font-weight: 600; }
.pdots { display: inline-flex; gap: 3px; }
.pdots i { width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--tomato); }
.pdots i.on { background: var(--tomato); }
.done-list { margin-top: 1rem; }
.done-list summary { cursor: pointer; color: var(--ink-2); font-weight: 550; padding: .4rem 0; }

.plan-cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.plan-cta .btn.primary { background: var(--tomato); color: #fff; flex: 1 1 12rem; }
.plan-cta .btn.primary:hover:not(:disabled) { box-shadow: 0 14px 30px -14px var(--tomato); }

/* timeline */
.timeline { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.blk { display: grid; grid-template-columns: 4.2rem 1fr 40px; gap: .6rem; align-items: stretch; }
.blk + .blk { margin-top: 6px; }
.blk time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .92rem; padding-top: .7rem; color: var(--ink-2); }
.blk-card { position: relative; min-height: var(--h); border-radius: var(--r-md); padding: .7rem .95rem; background: var(--soft); overflow: hidden; }
.t-focus .blk-card { padding-right: 3.4rem; }
.blk-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.blk-top { display: flex; justify-content: space-between; gap: .6rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.blk-title { margin: .15rem 0 0; font-weight: 580; line-height: 1.3; overflow-wrap: anywhere; }
.blk-title em { font-style: normal; color: var(--leaf); font-weight: 600; }
.t-short .blk-card, .t-long .blk-card { background: transparent; box-shadow: inset 0 0 0 1.5px var(--soft); }
.t-short .blk-title, .t-long .blk-title { font-weight: 450; color: var(--ink-2); font-size: .94rem; }
.t-focus .blk-card { background: var(--tomato-soft); }
.blk.is-past { opacity: .55; }
.blk.is-past.is-logged { opacity: .8; }
.blk.is-now .blk-card { background: var(--c); color: #fff; box-shadow: 0 14px 30px -16px var(--c); }
.blk.is-now .blk-card::before { width: calc(var(--pr) * 100%); background: rgba(255,255,255,.18); transition: width 1s linear; }
.blk.is-now .blk-top, .blk.is-now .blk-title { color: #fff; position: relative; }
.blk.is-now time { color: var(--ink); }
.blk.t-lunch.is-now .blk-card, .blk.t-lunch.is-now .blk-top, .blk.t-lunch.is-now .blk-title { color: #2B1E00; }
.blk-log { position: absolute; right: .8rem; top: 50%; margin-top: -14px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent); color: transparent; transition: .25s var(--spring); }
.blk-log svg { width: 15px; height: 15px; }
.blk-log[aria-pressed="true"] { background: var(--c); color: #fff; box-shadow: none; }
.is-now .blk-log { box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.is-now .blk-log[aria-pressed="true"] { background: #fff; color: var(--c); }
.blk-bell { width: 40px; height: 40px; margin-top: .3rem; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); transition: .2s; }
.blk-bell svg { width: 19px; height: 19px; }
.blk-bell:hover { background: var(--paper-2); }
.blk-bell { position: relative; }
.blk-bell.off { color: var(--ink-3); opacity: .55; }
.blk-bell.off::after { content: ''; position: absolute; width: 24px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); box-shadow: 0 0 0 2px var(--paper); }
.blk.enter { animation: blkIn .6s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes blkIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.tl-empty { border: 1.5px dashed var(--line); border-radius: var(--r-md); padding: 2rem 1.4rem; margin-top: 1.2rem; }

/* ---------- focus: the colour flood ---------- */
body[data-view="focus"] { background: var(--paper); }
body[data-view="focus"][data-mode="focus"] { background: var(--tomato); color: var(--tomato-ink); }
body[data-view="focus"][data-mode="short"], body[data-view="focus"][data-mode="long"] { background: var(--leaf); color: #F0FFF7; }
body[data-view="focus"][data-mode="ritual"] { background: var(--lilac); color: #fff; }
body[data-view="focus"][data-mode="idle"] { background: var(--ink); color: var(--paper); }
body[data-view="focus"]::before { mix-blend-mode: soft-light; opacity: .9; }
body[data-view="focus"] .dock { background: rgba(0, 0, 0, .22); color: inherit; box-shadow: none; }
body[data-view="focus"][data-mode="idle"] .dock { background: color-mix(in srgb, var(--paper) 14%, transparent); }

.focus { min-height: calc(100dvh - 160px); display: grid; place-items: center; text-align: center; }
.focus-inner { width: 100%; display: grid; justify-items: center; }
.focus-kind { margin: 0; font-weight: 600; font-size: 1.05rem; opacity: .85; }
.focus-title { margin: .6rem 0 0; font-size: clamp(1.5rem, 4.4vw, 2.6rem); font-weight: 650; letter-spacing: -.025em; line-height: 1.08; max-width: 22ch; text-wrap: balance; font-variation-settings: 'opsz' 60; }
.digits {
  display: flex; justify-content: center; align-items: baseline;
  font-weight: 800; letter-spacing: -.02em; line-height: .8;
  font-size: clamp(7rem, 36vw, 24rem);
  font-variation-settings: 'opsz' 96, 'wdth' 75;
  margin: clamp(1rem, 4vh, 2.4rem) 0 clamp(1rem, 3vh, 2rem);
  user-select: none;
}
.digits .dg { display: inline-block; width: .52em; text-align: center; }
.digits .colon { display: inline-block; width: .22em; transform: translateY(-.06em); opacity: .7; }
[data-mode="focus"] .digits .colon { animation: blink 2s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.bar { width: min(640px, 100%); height: 6px; border-radius: 9px; background: rgba(255,255,255,.22); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: currentColor; transform-origin: left; transform: scaleX(var(--p)); transition: transform 1s linear; }
.cycle { display: flex; gap: 8px; margin-top: 1.4rem; }
.cycle i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 2px currentColor; opacity: .7; }
.cycle i.on { background: currentColor; opacity: 1; }
.controls { display: flex; gap: 14px; margin-top: 2rem; flex-wrap: wrap; justify-content: center; }
.ctl { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); transition: transform .3s var(--spring), background .2s; }
.ctl:first-child { width: 84px; height: 84px; background: currentColor; }
.ctl:first-child svg { color: var(--tomato); width: 30px; height: 30px; }
[data-mode="short"] .ctl:first-child svg, [data-mode="long"] .ctl:first-child svg { color: var(--leaf); }
.ctl:hover { background: rgba(255,255,255,.26); }
.ctl:first-child:hover { background: currentColor; transform: scale(1.05); }
.ctl:active { transform: scale(.92); }
.focus.idle .digits { opacity: .9; }
.focus-start { display: grid; gap: .8rem; width: min(440px, 100%); }
.focus-start select { background: color-mix(in srgb, var(--paper) 10%, transparent); color: inherit; border-color: color-mix(in srgb, var(--paper) 22%, transparent); border-radius: 999px; padding: 0 1.2rem; min-height: 54px; appearance: none; text-align: center; text-align-last: center; }
.focus-start select option { color: #1F1A36; }
.focus-start .btn { background: var(--tomato); color: #fff; }
.focus-start .btn svg { width: 18px; height: 18px; }
.focus-next { margin: 1.6rem 0 0; max-width: 40ch; opacity: .72; }
body[data-view="focus"] .btn.inverse { background: rgba(255,255,255,.95); color: #2A0E08; }

/* ---------- pages ---------- */
.page-head { padding: 8px 0 30px; }
.send { display: grid; gap: 16px; margin-bottom: 18px; }
@media (min-width: 900px) { .send { grid-template-columns: repeat(3, 1fr); } }
.send-card { border-radius: var(--r-lg); padding: clamp(20px, 3vw, 28px); display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; }
.send-card p { margin: .5rem 0 1rem; max-width: 44ch; }
.send-card .fine { margin-top: 1rem; }
.send-card.get { background: var(--ink); color: var(--paper); }
.send-card.get p { color: color-mix(in srgb, var(--paper) 80%, transparent); }
.send-card.get .soon-note { color: color-mix(in srgb, var(--paper) 62%, transparent); }
.send-card.cal { background: var(--sun-soft); }
.send-card.app { background: var(--leaf-soft); }

.alarm-list { list-style: none; margin: 1rem 0 1rem; padding: 0; }
.alarm-list li { display: grid; grid-template-columns: 4.6rem 1fr auto; gap: .8rem; align-items: center; padding: .75rem 0; border-top: 1px solid var(--line); }
.alarm-list li:first-child { border-top: 0; }
.alarm-list time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.15rem; letter-spacing: -.01em; }
.alarm-list .al-text { display: flex; align-items: center; gap: .6rem; min-width: 0; overflow-wrap: anywhere; }
.alarm-list .al-text::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.alarm-list li.off time, .alarm-list li.off .al-text { opacity: .4; }

.life-grid, .set-grid { display: grid; gap: 18px; align-items: start; }
@media (min-width: 900px) { .life-grid, .set-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
.big3 { margin: 0; padding-left: 1.3rem; display: grid; gap: .3rem; font-weight: 560; }
.big3 li::marker { color: var(--tomato); font-weight: 700; }
.moods { display: flex; flex-wrap: wrap; gap: 8px; }
.moods button { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem 0 .7rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 550; transition: .25s var(--ease); }
.moods i { width: 16px; height: 16px; border-radius: 50%; background: var(--mc); }
.moods .m0 { --mc: #7A7596; } .moods .m1 { --mc: #9C84F5; } .moods .m2 { --mc: #F2C14E; } .moods .m3 { --mc: #34B98A; } .moods .m4 { --mc: #FF7A4D; }
.moods button[aria-checked="true"] { background: var(--mc); color: #fff; box-shadow: none; }
.moods button[aria-checked="true"] i { background: #fff; }
.mood .panel-head:nth-of-type(2) { margin-top: 1.8rem; }
.habits { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 6px; }
.habits button { width: 100%; display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: var(--r-sm); text-align: left; transition: background .2s; }
.habits button:hover { background: var(--paper-2); }
.hb-check { width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--ink-3); display: grid; place-items: center; color: transparent; transition: .25s var(--spring); flex: none; }
.hb-check svg { width: 15px; height: 15px; }
.habits [aria-pressed="true"] .hb-check { background: var(--leaf); box-shadow: none; color: #fff; transform: rotate(-6deg); }
.hb-name { flex: 1; font-weight: 550; }
.hb-week { display: flex; gap: 3px; }
.hb-week i { width: 7px; height: 7px; border-radius: 2px; background: var(--paper-2); }
.hb-week i.on { background: var(--leaf); }

.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 190px; align-items: end; margin-top: 1.4rem; }
.barcol { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; gap: 6px; }
.barcol i { align-self: end; height: max(var(--h), 4px); border-radius: 10px; background: var(--paper-2); transition: height .8s var(--ease); }
.barcol i:not([style*="--h:0%"]) { background: color-mix(in srgb, var(--tomato) 45%, var(--paper-2)); }
.barcol.today i { background: var(--tomato); }
.bv { font-size: .72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.bl { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.barcol.today .bl { color: var(--ink); }

.shutdown { margin: 0 0 1.4rem; padding: 0; list-style: none; counter-reset: s; display: grid; }
.shutdown li { counter-increment: s; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .9rem 0 .9rem 2.4rem; border-top: 1px solid var(--line); position: relative; }
.shutdown li:first-child { border-top: 0; }
.shutdown li::before { content: counter(s); position: absolute; left: 0; top: .85rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--lilac-soft); color: var(--lilac); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.shutdown li > span { flex: 1 1 14rem; }
.shutdown .field { margin: 0; flex: 1; }
.evening .btn.big { width: 100%; }
.evening .btn.primary { background: var(--lilac); color: #fff; }

.playbook { margin-top: clamp(56px, 10vw, 110px); }
.playbook .lede { margin-bottom: 2rem; }
.pb-grid { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); counter-reset: pb; }
.pb-grid article { padding: 1.4rem 0; border-top: 1.5px solid var(--ink); }
.pb-grid p { margin: 0; color: var(--ink-2); max-width: 46ch; }

.settings .panel .field.inline:first-of-type, .settings .panel .panel-head + .field { margin-top: 1rem; }
.colophon { margin-top: 3rem; color: var(--ink-3); font-size: .9rem; }

@media (max-width: 520px) {
  .field.inline { grid-template-columns: 1fr minmax(0, 9.5rem); }
  .blk { grid-template-columns: 3.7rem 1fr 36px; gap: .45rem; }
  .blk time { font-size: .84rem; }
  .alarm-list li { grid-template-columns: 4rem 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }

/* keep grid children from forcing horizontal scroll on phones */
.send > *, .life-grid > *, .set-grid > *, .today-grid > * { min-width: 0; }
.send-card .row { flex-wrap: wrap; }
.field.inline:has(.seg) { grid-template-columns: 1fr auto; }
@media (max-width: 520px) { .field.inline:has(.seg) { grid-template-columns: 1fr; gap: .5rem; } }
[data-hold] { touch-action: none; -webkit-touch-callout: none; transition: transform .25s var(--spring); }
[data-hold].holding { transform: scale(.94); transition: transform .5s var(--ease); }
.plan-cta + .hint { margin-top: .6rem; }

/* Focus screen: one calm action, everything else in a small menu top right. */
.session-menu { position: fixed; z-index: 30; top: calc(env(safe-area-inset-top) + 14px); right: 16px; }
.menu-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.14); color: inherit; opacity: .8; font-size: .8rem; letter-spacing: 1px; transition: background .2s, opacity .2s, transform .25s var(--spring); }
.menu-btn:hover, .session-menu.open .menu-btn { opacity: 1; background: rgba(255,255,255,.24); }
.menu-btn:active { transform: scale(.9); }
.menu-pop { position: absolute; right: 0; top: 52px; min-width: 230px; padding: 6px; border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: 0 22px 50px -18px rgba(0,0,0,.45);
  opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top right; pointer-events: none; transition: opacity .2s var(--ease), transform .25s var(--ease); }
.session-menu.open .menu-pop { opacity: 1; transform: none; pointer-events: auto; }
.menu-pop button { display: block; width: 100%; text-align: left; padding: .8rem 1rem; border-radius: 14px; font-weight: 560; }
.menu-pop button:hover, .menu-pop button:focus-visible { background: var(--paper-2); }

/* ---------- store badges & Premium (Premium lives in the phone app) ---------- */
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: .4rem; }
.store { display: block; height: 46px; border-radius: 9px; transition: transform .25s var(--spring); }
.store img { height: 100%; width: auto; display: block; }
.store:hover { transform: translateY(-2px); }
.store.soon { opacity: .55; pointer-events: none; }
.soon-note { width: 100%; margin: .2rem 0 0; font-size: .85rem; color: var(--ink-3); }
.perks { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: .6rem; }
.perks li { display: grid; grid-template-columns: 22px 1fr; gap: .6rem; align-items: start; }
.perks svg { width: 20px; height: 20px; margin-top: 2px; color: var(--tomato); }
.perks-where { margin: 1.2rem 0 .6rem; font-weight: 600; }
.premium-panel { background: var(--lilac-soft); box-shadow: none; }
.premium-title { margin: 0; font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; font-variation-settings: 'opsz' 60, 'wdth' 85; }
.premium-panel .muted { margin: .5rem 0 0; max-width: 52ch; }
.set-premium { margin-bottom: 18px; }
.set-premium .row { margin-top: 1rem; }
.sub-link { font-size: .95rem; }
.colophon a { color: inherit; }
.repeat-note { margin-top: .6rem; }
