/* Family Calendar — design system and screens.
   Warm neutral surfaces, ink primary actions, coral reserved for "today / now / alarm",
   and six person colors used consistently for calendars, tasks and avatars. */

@font-face { font-family: 'Manrope'; src: url('/static/fonts/manrope-400.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/static/fonts/manrope-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/static/fonts/manrope-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/static/fonts/manrope-800.woff2') format('woff2'); font-weight: 800 900; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --bg: #F6F4EF;
  --bg-2: #EEEBE4;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --surface-3: #F1EEE8;
  --ink: #1B1F2B;
  --ink-2: #4A5060;
  --ink-3: #767C8C;
  --ink-4: #A4A9B4;
  --line: #E8E4DC;
  --line-2: #D8D3C8;
  --primary: #1B1F2B;
  --primary-hover: #30364A;
  --on-primary: #FFFFFF;
  --accent: #E4572E;
  --accent-soft: #FCEAE3;
  --accent-ink: #B13A17;
  --success: #2E9E63; --success-soft: #E2F4EA; --success-ink: #1C6A41;
  --warning: #C7870E; --warning-soft: #FBF0D9; --warning-ink: #855600;
  --danger: #D23F2E; --danger-soft: #FBE7E4; --danger-ink: #A2291B;
  --info: #3C6FE0; --info-soft: #E7EEFC; --info-ink: #284B98;
  --focus: #3C6FE0;
  --r-xs: 6px; --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 26px;
  --sh-1: 0 1px 2px rgb(27 31 43 / .05), 0 1px 3px rgb(27 31 43 / .03);
  --sh-2: 0 6px 18px -6px rgb(27 31 43 / .14), 0 2px 4px rgb(27 31 43 / .04);
  --sh-3: 0 28px 64px -20px rgb(27 31 43 / .38), 0 10px 24px -12px rgb(27 31 43 / .2);
  --rail-w: 5.75rem;
  --top-h: 4.75rem;
  --pad: 1.5rem;
  --gap: 1rem;
  --hour: 3.25rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
html.is-frame { --rail-w: 6.25rem; --top-h: 5.25rem; --hour: 3.1rem; --gap: 1.1rem; }

[data-theme=dark] {
  color-scheme: dark;
  --bg: #121419; --bg-2: #171A21;
  --surface: #1B1E26; --surface-2: #20232C; --surface-3: #272B35;
  --ink: #ECEEF3; --ink-2: #B9BECA; --ink-3: #8C92A2; --ink-4: #636979;
  --line: #2A2E39; --line-2: #383D4A;
  --primary: #ECEEF3; --primary-hover: #FFFFFF; --on-primary: #14161D;
  --accent: #FF6B45; --accent-soft: rgb(255 107 69 / .16); --accent-ink: #FFA88E;
  --success: #43AE73; --success-soft: rgb(67 174 115 / .16); --success-ink: #9FDCB8;
  --warning: #E0A12E; --warning-soft: rgb(224 161 46 / .15); --warning-ink: #F2CC80;
  --danger: #EF5C49; --danger-soft: rgb(239 92 73 / .16); --danger-ink: #FFA294;
  --info: #6C98EC; --info-soft: rgb(108 152 236 / .16); --info-ink: #AFC8F6;
  --focus: #6C98EC;
  --sh-1: 0 1px 2px rgb(0 0 0 / .35);
  --sh-2: 0 8px 22px -8px rgb(0 0 0 / .55);
  --sh-3: 0 30px 70px -20px rgb(0 0 0 / .7);
}

/* Person colors: --p solid, --p-soft tint, --p-ink readable text on tint, --p-mid borders. */
.c-blue   { --p: #3B78D8; --p-soft: #E6EEFB; --p-ink: #1D4D9B; --p-mid: #C3D5F4; }
.c-orange { --p: #E27A2E; --p-soft: #FDEEE0; --p-ink: #974709; --p-mid: #F6CEA9; }
.c-green  { --p: #349C63; --p-soft: #E2F3E9; --p-ink: #1B683F; --p-mid: #B6DEC6; }
.c-purple { --p: #845ECF; --p-soft: #EFE9FA; --p-ink: #512D96; --p-mid: #D5C8F1; }
.c-pink   { --p: #D6538C; --p-soft: #FCE7F0; --p-ink: #932356; --p-mid: #F2BFD5; }
.c-teal   { --p: #219399; --p-soft: #DEF2F3; --p-ink: #10646A; --p-mid: #AADBDE; }
.c-ink    { --p: #1B1F2B; --p-soft: #EDEBE6; --p-ink: #1B1F2B; --p-mid: #CFCAC0; }
[data-theme=dark] .c-blue   { --p: #5B8FE6; --p-soft: rgb(91 143 230 / .17); --p-ink: #A9C6F5; --p-mid: rgb(91 143 230 / .42); }
[data-theme=dark] .c-orange { --p: #E5884A; --p-soft: rgb(229 136 74 / .17); --p-ink: #F5C39D; --p-mid: rgb(229 136 74 / .42); }
[data-theme=dark] .c-green  { --p: #47AC74; --p-soft: rgb(71 172 116 / .17); --p-ink: #A4DDBB; --p-mid: rgb(71 172 116 / .42); }
[data-theme=dark] .c-purple { --p: #9374DA; --p-soft: rgb(147 116 218 / .19); --p-ink: #CBB9F3; --p-mid: rgb(147 116 218 / .45); }
[data-theme=dark] .c-pink   { --p: #DF689B; --p-soft: rgb(223 104 155 / .17); --p-ink: #F3B3CE; --p-mid: rgb(223 104 155 / .42); }
[data-theme=dark] .c-teal   { --p: #33A6AD; --p-soft: rgb(51 166 173 / .17); --p-ink: #9FD9DD; --p-mid: rgb(51 166 173 / .42); }
[data-theme=dark] .c-ink    { --p: #4A5062; --p-soft: rgb(255 255 255 / .07); --p-ink: #ECEEF3; --p-mid: rgb(255 255 255 / .2); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; background: var(--bg); }
html.is-frame { font-size: clamp(15px, .94vw, 20px); }
body { margin: 0; min-height: 100dvh; font-family: var(--font); font-weight: 500; color: var(--ink); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--focus) 25%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.spacer { flex: 1; }
.mono { font-family: var(--mono); font-size: .85rem; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
html.is-frame ::-webkit-scrollbar { width: 6px; height: 6px; }
html.is-frame ::-webkit-scrollbar-thumb { border-width: 1px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { font-size: .75rem; font-weight: 600; color: var(--ink-3); }
.brand-mark { display: grid; grid-template-columns: repeat(2, .78rem); gap: .2rem; flex: none; }
.brand-mark i { width: .78rem; height: .78rem; border-radius: 4px; }
.brand-mark i:nth-child(1) { background: #3B78D8; }
.brand-mark i:nth-child(2) { background: #E27A2E; }
.brand-mark i:nth-child(3) { background: #349C63; }
.brand-mark i:nth-child(4) { background: #D6538C; }

/* ---------- app shell ---------- */
body.in-app { height: 100dvh; overflow: hidden; }
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); height: 100dvh; }
.rail { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.1rem .55rem; background: var(--surface); border-right: 1px solid var(--line); min-height: 0; z-index: 10; }
.rail-brand { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: .75rem; border-radius: var(--r); }
.rail-brand .brand-mark { grid-template-columns: repeat(2, .9rem); gap: .22rem; }
.rail-brand .brand-mark i { width: .9rem; height: .9rem; }
.rail-items, .rail-foot { display: flex; flex-direction: column; gap: .3rem; width: 100%; }
.rail-foot { margin-top: auto; align-items: center; }
.rail-item, .account-btn { display: flex; flex-direction: column; align-items: center; gap: .32rem; width: 100%; padding: .72rem .25rem .62rem; border-radius: var(--r); color: var(--ink-3); font-size: .72rem; font-weight: 700; letter-spacing: .01em; transition: background .15s, color .15s; }
.rail-item .icon { width: 1.55rem; height: 1.55rem; }
.rail-item:hover, .account-btn:hover { background: var(--surface-3); color: var(--ink); }
.rail-item.is-active { background: var(--primary); color: var(--on-primary); box-shadow: var(--sh-2); }
.account-btn .avatar { width: 2.2rem; height: 2.2rem; font-size: .9rem; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; min-height: var(--top-h); padding: .8rem var(--pad); flex: none; }
html.is-frame .topbar { padding-right: 236px; } /* the frame's Taskbar dock floats over the top-right corner */
.topbar-lead { flex: 1; min-width: 0; }
.topbar-tools, .topbar-view-tools { display: flex; align-items: center; gap: .55rem; }
.top-account { display: none; }
.view { flex: 1; min-height: 0; overflow: auto; padding: 0 var(--pad) var(--pad); outline: none; }
.page-title { min-width: 0; }
.page-title h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { display: block; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-label, .period-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin: 0 0 .6rem; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.75rem; padding: 0 1.1rem; border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 700; font-size: .9375rem; white-space: nowrap; text-decoration: none; user-select: none; transition: background .15s var(--ease), border-color .15s, color .15s, box-shadow .15s, transform .08s; }
.btn .icon { width: 1.15rem; height: 1.15rem; margin-left: -.2rem; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .icon-btn:disabled { opacity: .5; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--sh-1); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); box-shadow: var(--sh-1); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-4); }
.btn-secondary[aria-pressed=true] { background: var(--surface-3); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.btn-soft { background: var(--surface-3); color: var(--ink); }
.btn-soft:hover:not(:disabled) { background: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.94); }
.btn-danger-text { color: var(--danger-ink); }
.btn-danger-text:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger-ink); }
.btn-warning { background: var(--warning-soft); color: var(--warning-ink); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.btn-google { background: var(--surface); border-color: var(--line-2); color: var(--ink); box-shadow: var(--sh-1); }
.btn-google:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-4); }
.btn-google .icon { width: 1.3rem; height: 1.3rem; }
.btn-sm { height: 2.25rem; padding: 0 .8rem; font-size: .875rem; border-radius: 9px; }
.btn-sm .icon { width: 1rem; height: 1rem; }
.btn-lg { height: 3.25rem; padding: 0 1.4rem; font-size: 1rem; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn.is-busy { cursor: progress; }
.btn.is-busy > .icon { display: none; }
.btn.is-busy::before { content: ''; width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.icon-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--r-sm); border: 1px solid transparent; color: var(--ink-2); flex: none; transition: background .15s, color .15s, border-color .15s; }
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.icon-btn.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.round-btn { display: grid; place-items: center; width: 3.75rem; height: 3.75rem; border-radius: 50%; background: var(--primary); color: var(--on-primary); box-shadow: var(--sh-2); transition: transform .1s, filter .15s; }
.round-btn .icon { width: 1.5rem; height: 1.5rem; }
.round-btn:active { transform: scale(.95); }
.round-btn.is-play { background: var(--success); color: #fff; }
html.is-frame .btn { height: 3rem; }
html.is-frame .btn-sm { height: 2.5rem; }
html.is-frame .icon-btn { width: 3rem; height: 3rem; }

/* ---------- segmented & chips ---------- */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); flex: none; }
.seg label { position: relative; display: flex; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg label span, .seg button { display: flex; align-items: center; justify-content: center; height: 2.25rem; padding: 0 .95rem; border-radius: 8px; font-weight: 700; font-size: .875rem; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; width: 100%; }
.seg input:checked + span, .seg button[aria-pressed=true] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 60%, transparent); }
.seg label:hover span, .seg button:hover { color: var(--ink); }
.form .seg { display: flex; width: 100%; }
.form .seg label { flex: 1; }
html.is-frame .seg label span, html.is-frame .seg button { height: 2.5rem; padding: 0 1.1rem; }

.chip { display: inline-flex; align-items: center; gap: .45rem; height: 2.5rem; padding: 0 .95rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: .875rem; color: var(--ink-2); white-space: nowrap; flex: none; transition: background .15s, border-color .15s, color .15s; }
.chip:has(.avatar) { padding-left: .35rem; }
.chip .icon { width: 1rem; height: 1rem; }
.chip:hover { border-color: var(--ink-4); }
.chip[aria-pressed=true] { background: var(--p-soft, var(--primary)); border-color: var(--p-mid, var(--primary)); color: var(--p-ink, var(--on-primary)); }
.cal-toolbar .chip[aria-pressed=false] .avatar { background: var(--surface-3); color: var(--ink-4); }
.cal-toolbar .cal-filters .chip[aria-pressed=false] { color: var(--ink-3); background: transparent; border-style: dashed; }
html.is-frame .chip { height: 2.75rem; }

/* ---------- avatars ---------- */
.avatar { --av: 2rem; display: inline-grid; place-items: center; flex: none; width: var(--av); height: var(--av); overflow: hidden; border-radius: 50%; background: var(--p, var(--ink-3)); color: #fff; font-weight: 800; font-size: calc(var(--av) * .4); line-height: 1; letter-spacing: 0; }
.avatar-xxs { --av: 1.15rem; }
.avatar-xs { --av: 1.65rem; }
.avatar-sm { --av: 2rem; }
.avatar-md { --av: 2.5rem; }
.avatar-lg { --av: 3rem; }
.avatar-xl { --av: 4.5rem; }
.avatar-2xl { --av: 6.5rem; }
.avatar-emoji { background: var(--p-soft); box-shadow: inset 0 0 0 2px var(--p-mid); font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; font-weight: 400; font-size: calc(var(--av) * .58); }
.avatar-photo { padding: 2px; background: var(--p); }
.avatar-xxs.avatar-photo, .avatar-xs.avatar-photo { padding: 1.5px; }
.avatar-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.cal-toolbar .chip[aria-pressed=false] .avatar-emoji, .cal-toolbar .chip[aria-pressed=false] .avatar-photo img { filter: grayscale(1); opacity: .55; }
.avatar-btn { position: relative; display: inline-flex; flex: none; border-radius: 50%; transition: transform .12s; }
.avatar-btn:hover .avatar, .avatar-btn:focus-visible .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--p-mid); }
.avatar-btn:active { transform: scale(.95); }
.person-head { display: flex; align-items: center; gap: 1.25rem; }
.person-head .field { flex: 1; }
.person-preview { flex: none; }
.icon-panel { margin-top: -.4rem; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.9rem, 1fr)); gap: .35rem; max-height: 14.5rem; overflow: auto; padding: .4rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.emoji-pick { position: relative; }
.emoji-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.emoji-pick span { display: grid; place-items: center; height: 2.9rem; border-radius: var(--r-sm); font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; font-size: 1.55rem; transition: background .12s, box-shadow .12s; }
.emoji-pick:hover span { background: var(--surface-3); }
.emoji-pick input:checked + span { background: var(--surface); box-shadow: 0 0 0 2px var(--primary); }
.emoji-pick input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 60%, transparent); }
.photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.photo-actions label.btn { cursor: pointer; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-head { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.15rem .75rem; flex: none; }
.card-head > div:first-child { flex: 1; min-width: 0; }
.card-head h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; }
.card-head small { display: block; color: var(--ink-3); font-weight: 600; font-size: .84rem; }
.card-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 1.15rem 1.15rem; }
.onboarding-card { padding: 2rem 1rem; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 1.15rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field, .field-main { display: flex; flex-direction: column; gap: .42rem; min-width: 0; }
.field-label { font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.field-hint { display: block; font-size: .8125rem; color: var(--ink-3); line-height: 1.45; }
.field-hint .icon { display: inline-block; vertical-align: -.2em; width: 1rem; height: 1rem; }
.input { width: 100%; height: 2.875rem; padding: 0 .9rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--ink-4); }
.input:hover { border-color: var(--ink-4); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
textarea.input { height: auto; min-height: 4.75rem; padding: .7rem .9rem; line-height: 1.5; resize: vertical; }
select.input { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767C8C' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; background-size: 1.1rem; }
input[type=date].input, input[type=time].input { font-variant-numeric: tabular-nums; }
.input-title { height: 3.4rem; padding: 0 .1rem; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: transparent; font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; }
.input-title:hover { border-color: var(--line-2); }
.input-title:focus { box-shadow: none; border-color: var(--focus); }
.input-code { height: 3.75rem; font-size: 1.6rem; font-weight: 800; letter-spacing: .22em; text-align: center; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.form-error, .sheet-error { color: var(--danger-ink); font-weight: 600; font-size: .875rem; }
.form-error:empty, .sheet-error:empty { display: none; }
.sheet-error { margin: 0 1.5rem 1rem; padding: .7rem .9rem; border-radius: var(--r-sm); background: var(--danger-soft); }
.input-affix { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); padding-right: .9rem; transition: border-color .15s, box-shadow .15s; }
.input-affix .input { border: 0; box-shadow: none !important; }
.input-affix:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.input-affix span { color: var(--ink-3); font-weight: 600; }

.switch-field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem .95rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); cursor: pointer; }
.switch-label { display: block; font-weight: 700; font-size: .9375rem; }
.switch { appearance: none; position: relative; flex: none; width: 3rem; height: 1.75rem; margin: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: calc(1.75rem - 6px); height: calc(1.75rem - 6px); border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s var(--ease); }
.switch:checked { background: var(--success); }
.switch:checked::after { transform: translateX(1.25rem); }

.swatches { display: flex; flex-wrap: wrap; gap: .65rem; }
.swatch { position: relative; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.swatch > span:not(.sr-only) { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--p); color: #fff; transition: box-shadow .15s, transform .1s; }
.swatch .icon { width: 1.2rem; height: 1.2rem; stroke-width: 3; opacity: 0; }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--p); }
.swatch input:checked + span .icon { opacity: 1; }
.swatch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 60%, transparent); outline-offset: 5px; }

.pick-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.pick { position: relative; display: inline-flex; }
.pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.pick > span { display: inline-flex; align-items: center; gap: .45rem; height: 2.6rem; padding: 0 .95rem 0 .42rem; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: .9rem; transition: background .15s, border-color .15s, color .15s; }
.pick > span > .icon:first-child { width: 1.1rem; height: 1.1rem; margin-left: .45rem; }
.pick input:checked + span { border-color: var(--p); background: var(--p-soft); color: var(--p-ink); }
.pick input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 60%, transparent); outline-offset: 2px; }
.pick-static { display: inline-flex; align-items: center; gap: .45rem; height: 2.6rem; padding: 0 .95rem 0 .42rem; border: 1.5px solid var(--p-mid); border-radius: 999px; background: var(--p-soft); color: var(--p-ink); font-weight: 700; font-size: .9rem; }
.pick-google { width: 1rem; height: 1rem; }

.weekday-picks { display: flex; flex-wrap: wrap; gap: .4rem; }
.weekday { position: relative; }
.weekday input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.weekday span { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1.5px solid var(--line-2); font-weight: 700; font-size: .85rem; color: var(--ink-2); transition: .15s; }
.weekday input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.weekday input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 60%, transparent); }

.repeat-options { display: flex; flex-direction: column; gap: 1.15rem; }
.when-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .6rem 1rem; }
.when-row { display: flex; gap: .5rem; }
.when-row .input[type=date] { flex: 1.35; }
.when-row .time-input { flex: 1; }
.form.is-allday .time-input { display: none; }
.duration-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.duration-inputs label { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.duration-inputs .input { height: 4rem; font-size: 1.8rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.duration-inputs span { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.radio-list { display: flex; flex-direction: column; gap: .45rem; }
.radio-row { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; font-weight: 700; }
.radio-row span { display: flex; align-items: center; gap: .6rem; }
.radio-row:has(input:checked) { border-color: var(--focus); background: var(--info-soft); }
.radio-row input { accent-color: var(--focus); width: 1.1rem; height: 1.1rem; }

/* ---------- badges, banners, empty states ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; height: 1.65rem; padding: 0 .65rem; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: .75rem; font-weight: 700; white-space: nowrap; flex: none; }
.badge .icon { width: .95rem; height: .95rem; }
.badge-success { background: var(--success-soft); color: var(--success-ink); }
.badge-muted { background: var(--surface-3); color: var(--ink-3); }
.badge-ink { background: var(--primary); color: var(--on-primary); }
.badge-warning { background: var(--warning-soft); color: var(--warning-ink); }
.banner { display: flex; align-items: flex-start; gap: .75rem; padding: .85rem 1rem; border-radius: var(--r); font-size: .9rem; line-height: 1.45; margin-bottom: 1rem; }
.banner .icon { margin-top: .1rem; }
.banner p + p { margin-top: .3rem; }
.banner-warning { background: var(--warning-soft); color: var(--warning-ink); }
.banner-info { background: var(--info-soft); color: var(--info-ink); }
.callout { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: var(--r-sm); background: var(--surface-3); color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.inline-warning { display: flex; align-items: flex-start; gap: .5rem; padding: .55rem .75rem; margin-bottom: .8rem; border-radius: var(--r-sm); background: var(--warning-soft); color: var(--warning-ink); font-size: .82rem; font-weight: 600; }
.fine-print { display: flex; align-items: flex-start; gap: .55rem; margin-top: .25rem; color: var(--ink-3); font-size: .85rem; line-height: 1.5; }
.fine-print .icon { width: 1.05rem; height: 1.05rem; margin-top: .12rem; }
.fine-print a { color: var(--ink-2); font-weight: 700; }
.empty { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 2rem 1rem; text-align: center; color: var(--ink-3); }
.empty-icon { width: 3rem; height: 3rem; padding: .7rem; margin-bottom: .35rem; border-radius: 50%; background: var(--surface-3); color: var(--ink-3); }
.empty strong { color: var(--ink); font-size: 1.02rem; font-weight: 800; }
.empty p { max-width: 26rem; font-size: .9rem; line-height: 1.5; }
.empty > .btn, .empty .row-gap { margin-top: .7rem; }
.row-gap { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.centered { display: flex; align-items: center; justify-content: center; gap: .4rem; text-align: center; }

.skeleton { background: linear-gradient(90deg, var(--surface-3) 0%, var(--bg-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; border-radius: var(--r-sm); animation: shimmer 1.3s linear infinite; }
.skeleton-line { height: 1.1rem; width: 40%; margin: 1.25rem 1.2rem .5rem; }
.skeleton-line.short { width: 25%; margin-top: 0; }
.skeleton-block { height: 14rem; }
.skeleton-card .skeleton-block { margin: 1rem 1.2rem; }

/* ---------- progress rings ---------- */
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 3.4; }
.ring-fill { fill: none; stroke: var(--p, var(--success)); stroke-width: 3.4; stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.progress-ring { position: relative; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; flex: none; }
.progress-ring svg { position: absolute; inset: 0; }
.progress-ring > span { font-size: .68rem; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.progress-ring.sm { width: 2.5rem; height: 2.5rem; }
.today-tasks .progress-ring { --p: var(--success); }

/* ---------- sheets (dialogs) ---------- */
.sheet { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; color: var(--ink); overflow: visible; }
.sheet::backdrop { background: rgb(16 18 24 / .45); backdrop-filter: blur(3px); animation: fade .2s; }
.sheet-inner { position: relative; display: flex; flex-direction: column; width: min(36rem, calc(100vw - 2rem)); max-height: min(54rem, calc(100dvh - 3rem)); overflow: hidden; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-3); animation: rise .22s var(--ease); outline: none; }
.sheet-sm .sheet-inner { width: min(28rem, calc(100vw - 2rem)); }
.sheet-lg .sheet-inner { width: min(46rem, calc(100vw - 2rem)); }
.sheet-head { display: flex; align-items: flex-start; gap: 1rem; padding: 1.35rem 1.5rem .25rem; }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.sheet-head p { margin-top: .2rem; color: var(--ink-3); font-weight: 600; font-size: .9rem; }
.sheet-close { margin: -.45rem -.6rem 0 0; }
.sheet-close.floating { position: absolute; top: .8rem; right: .8rem; z-index: 2; margin: 0; }
.sheet-body { flex: 1; min-height: 0; overflow: auto; padding: 1rem 1.5rem 1.35rem; }
.sheet-foot { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.5rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.sheet-message { color: var(--ink-2); line-height: 1.55; }
.code-block { margin-top: 1rem; padding: 1rem; border-radius: var(--r); background: var(--surface-3); font-size: 1.15rem; font-weight: 700; letter-spacing: .05em; text-align: center; word-break: break-all; }

/* ---------- menus, toasts, offline ---------- */
.menu { position: fixed; z-index: 100; min-width: 14rem; max-width: 20rem; padding: .35rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-3); animation: pop .14s var(--ease); }
.menu-item { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .72rem .8rem; border-radius: var(--r-sm); font-weight: 600; font-size: .9375rem; color: var(--ink); text-align: left; }
.menu-item .icon { color: var(--ink-3); width: 1.15rem; height: 1.15rem; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); outline: none; }
.menu-item.is-danger, .menu-item.is-danger .icon { color: var(--danger-ink); }
.menu hr { margin: .3rem .2rem; border: 0; border-top: 1px solid var(--line); }
.toasts { position: fixed; z-index: 200; left: 50%; bottom: 1.5rem; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .5rem; width: max-content; max-width: calc(100vw - 2rem); pointer-events: none; }
.toast { display: flex; align-items: center; gap: .65rem; padding: .78rem 1.05rem; border-radius: var(--r); background: #1B1F2B; color: #fff; box-shadow: var(--sh-3); font-weight: 600; font-size: .9375rem; pointer-events: auto; opacity: 0; transform: translateY(8px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.toast.is-in { opacity: 1; transform: none; }
.toast-success .icon { color: #6FD89C; }
.toast-error .icon { color: #FF8B75; }
.toast-action { margin-left: .4rem; padding: .25rem .5rem; border-radius: 6px; font-weight: 800; color: #9DB9FF; }
[data-theme=dark] .toast { background: #ECEEF3; color: #14161D; }
[data-theme=dark] .toast-success .icon { color: var(--success); }
[data-theme=dark] .toast-action { color: var(--info); }
.offline-banner { position: fixed; z-index: 150; top: .75rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .6rem; padding: .6rem 1.05rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent); background: var(--warning-soft); color: var(--warning-ink); box-shadow: var(--sh-2); font-weight: 700; font-size: .875rem; white-space: nowrap; }

/* ---------- timer pill & alarm ---------- */
#timer-pill:empty { display: none; }
.timer-pill { display: inline-flex; align-items: center; gap: .5rem; height: 2.75rem; max-width: 19rem; padding: 0 1rem; border-radius: 999px; background: var(--info-soft); color: var(--info-ink); font-weight: 700; font-size: .9rem; white-space: nowrap; }
.timer-pill strong { font-weight: 800; font-variant-numeric: tabular-nums; }
.timer-pill-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.timer-pill-more { padding: .05rem .4rem; border-radius: 999px; background: color-mix(in srgb, var(--info) 18%, transparent); font-size: .75rem; }
.timer-pill.is-finished { background: var(--accent); color: #fff; animation: ringpulse 1.6s infinite; }
html.is-frame .timer-pill { height: 3rem; }
.alarm { width: 100vw; height: 100dvh; max-width: none; max-height: none; padding: 0; border: 0; background: transparent; }
.alarm[open] { display: grid; place-items: center; }
.alarm::backdrop { background: rgb(16 18 24 / .72); backdrop-filter: blur(6px); }
.alarm-card { width: min(34rem, calc(100vw - 2rem)); padding: 2.6rem 2rem 1.75rem; border-radius: 2rem; background: var(--surface); box-shadow: var(--sh-3); text-align: center; animation: rise .3s var(--ease); }
.alarm-bell { display: grid; place-items: center; width: 6rem; height: 6rem; margin: 0 auto 1.25rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); animation: ringpulse 1.6s infinite; }
.alarm-bell .icon { width: 3rem; height: 3rem; transform-origin: 50% 12%; animation: wiggle 1.3s infinite; }
.alarm-eyebrow { font-size: .85rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.alarm-card h2 { margin: .35rem 0 .45rem; font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; overflow-wrap: anywhere; }
.alarm-sub { color: var(--ink-3); font-weight: 600; }
.alarm-more { margin-top: .5rem; color: var(--ink-2); font-weight: 700; }
.alarm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .75rem; margin-top: 1.75rem; }
.alarm-silence { margin-top: .75rem; }
.alarm-hint { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1rem; color: var(--warning-ink); font-size: .875rem; font-weight: 600; }
.alarm-hint .icon { width: 1rem; height: 1rem; }

/* ---------- Today ---------- */
.today-hero { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.hero-clock { display: flex; align-items: baseline; gap: .3rem; font-size: 2.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-clock .ampm { font-size: .95rem; font-weight: 800; letter-spacing: .02em; color: var(--ink-3); }
html.is-frame .hero-clock { font-size: 3.3rem; }
.hero-date { display: flex; flex-direction: column; min-width: 0; padding-left: 1.1rem; border-left: 2px solid var(--line); }
.hero-date .short { display: none; }
.hero-date strong { font-size: 1.2rem; font-weight: 800; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-date span { color: var(--ink-3); font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.is-frame .hero-date strong { font-size: 1.35rem; }
.today { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr) minmax(0, .95fr); gap: var(--gap); height: 100%; min-height: 0; }
.today-card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.today-side { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--gap); min-height: 0; }
.today-timers .card-scroll { max-height: 21rem; }
.next-up { display: flex; flex-direction: column; gap: .3rem; width: 100%; margin-bottom: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--p-mid); border-radius: var(--r); background: var(--p-soft); color: var(--p-ink); text-align: left; transition: transform .12s; }
.next-up:active { transform: scale(.99); }
.next-up-label { display: flex; align-items: center; gap: .45rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.next-up strong { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--ink); }
.next-up-meta { display: flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .9rem; }
.pulse { width: .55rem; height: .55rem; border-radius: 50%; background: var(--p); animation: pulse 1.8s infinite; }
.allday-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.allday-chip { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .75rem; border-radius: var(--r-sm); background: var(--p); color: #fff; font-weight: 700; font-size: .875rem; }
.allday-chip span { font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; opacity: .85; }
.timeline { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.tl { display: grid; grid-template-columns: 4.7rem 4px minmax(0, 1fr); gap: .8rem; min-height: 3.5rem; }
.tl-time { padding-top: .62rem; text-align: right; font-size: .84rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-bar { margin: .38rem 0; border-radius: 4px; background: var(--p); }
.tl-main { display: flex; flex-direction: column; justify-content: center; min-width: 0; margin: .1rem 0; padding: .45rem .6rem; border-radius: var(--r-sm); text-align: left; }
.tl-main:hover { background: var(--surface-3); }
.tl-main strong { font-size: 1rem; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-main small { color: var(--ink-3); font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl.is-past { opacity: .48; }
.tl.is-live .tl-main { background: var(--p-soft); }
.tl-now { display: flex; align-items: center; gap: .8rem; margin: .15rem 0; color: var(--accent); font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tl-now span { width: 4.7rem; text-align: right; flex: none; }
.tl-now::after { content: ''; flex: 1; height: 10px; background: radial-gradient(circle at 5px 50%, var(--accent) 4.5px, transparent 5px), linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat; }
.timeline.is-compact .tl { min-height: 3rem; }
.tomorrow-label { margin-top: 1.4rem; }
.person-group { padding: .3rem 0 .55rem; }
.person-group + .person-group { margin-top: .3rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.person-group-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .2rem; }
.person-group-head strong { font-size: 1rem; font-weight: 800; }
.person-group-count { margin-left: auto; color: var(--ink-3); font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.col-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); flex: none; }
.col-icon.sm { width: 2rem; height: 2rem; }
.col-icon.sm .icon { width: 1.05rem; height: 1.05rem; }
.list-switch { display: flex; align-items: center; gap: .3rem; flex: 1; min-width: 0; text-align: left; }
.list-switch h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-switch .icon { color: var(--ink-3); }
.list-count { color: var(--ink-3); font-weight: 700; font-size: .84rem; white-space: nowrap; }
.list-done-note { padding: .6rem .5rem 0; }

/* ---------- task rows ---------- */
.task { display: flex; align-items: center; gap: .75rem; min-height: 3.5rem; padding: .5rem .35rem .5rem .15rem; border-radius: var(--r-sm); }
.task-check { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 2.5px solid var(--p); border-radius: 50%; background: var(--surface); color: transparent; flex: none; transition: background .15s, color .15s, transform .12s; }
.task-check .icon { width: 1.25rem; height: 1.25rem; stroke-width: 3; }
.task-check:hover:not(:disabled) { background: var(--p-soft); color: color-mix(in srgb, var(--p) 50%, transparent); }
.task-check:active:not(:disabled) { transform: scale(.9); }
.task-check:disabled { opacity: 1; cursor: default; }
.task.is-done .task-check { background: var(--p); color: #fff; }
.task.is-skipped .task-check { border-style: dashed; border-color: var(--ink-4); color: var(--ink-3); }
.task.is-skipped .task-check .icon { stroke-width: 2; width: 1rem; }
.task-check.is-open-pool { border: 2px dashed var(--line-2); background: transparent; color: var(--ink-4); }
.task-check.is-open-pool .icon { width: 1.1rem; height: 1.1rem; stroke-width: 1.8; }
.task-main { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.task-title { display: flex; align-items: flex-start; gap: .35rem; width: 100%; text-align: left; font-size: 1rem; font-weight: 700; line-height: 1.3; border-radius: .2rem; }
.task-title-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; min-width: 0; }
.task-title > .icon { flex: none; width: .9rem; height: .9rem; margin-top: .18rem; color: var(--ink-3); }
.task-title:hover .task-title-text { text-decoration: underline; text-underline-offset: .15em; }
.task-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.task.is-done .task-title { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--ink-3) 60%, transparent); }
.task.is-skipped .task-title { color: var(--ink-3); }
.task-meta { display: flex; flex-wrap: wrap; gap: .15rem .65rem; color: var(--ink-3); font-size: .8rem; font-weight: 600; }
.task-meta > span { display: inline-flex; align-items: center; gap: .3rem; }
.task-meta .icon { width: .9rem; height: .9rem; }
.is-overdue { color: var(--accent-ink); }
.task-detail-sheet .sheet-head h2 { overflow-wrap: anywhere; }
.task-detail-sheet .sheet-head, .task-detail-sheet .sheet-foot { flex-shrink: 0; }
.task-detail-notes { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: var(--ink-2); }
.task-detail-notes a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: .15em; }
.task-trail { display: flex; align-items: center; gap: .2rem; align-self: flex-start; margin-top: .1rem; }
.task-more { width: 2.25rem; height: 2.25rem; color: var(--ink-4); }
.task.is-compact { min-height: 3.1rem; padding: .3rem .2rem; }
.task.is-compact .task-check { width: 2.15rem; height: 2.15rem; }
.task.is-compact .task-check .icon { width: 1.1rem; height: 1.1rem; }
html.is-frame .task-check { width: 2.6rem; height: 2.6rem; }
html.is-frame .task.is-compact .task-check { width: 2.35rem; height: 2.35rem; }

/* ---------- earning tasks ---------- */
.value-badge { display: inline-flex; align-items: center; gap: .3rem; height: 1.75rem; padding: 0 .6rem; border-radius: 999px; background: var(--warning-soft); color: var(--warning-ink); font-size: .8rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }
.value-badge .icon { width: .95rem; height: .95rem; }
.value-badge.is-balance { height: 1.5rem; font-size: .74rem; }
.task.is-locked .value-badge { background: var(--surface-3); color: var(--ink-3); }
.task.is-locked .task-title { color: var(--ink-2); }
.task-check.is-locked { border: 2px dashed var(--line-2); background: var(--surface-2); color: var(--ink-3); }
.task-check.is-locked .icon { width: 1.05rem; height: 1.05rem; stroke-width: 2; }
.task-check.is-locked:hover { background: var(--surface-3); color: var(--ink-2); }
.is-locked-text { color: var(--ink-3); }
.section-earn { display: flex; align-items: center; gap: .35rem; color: var(--warning-ink); }
.section-earn .icon { width: .95rem; height: .95rem; }
.col-body .section-earn { margin-top: 1.1rem; }
.earn-lock { display: flex; align-items: center; gap: .55rem; margin: .2rem .2rem .4rem; padding: .6rem .75rem; border-radius: var(--r-sm); background: var(--surface-3); color: var(--ink-2); font-size: .82rem; font-weight: 700; }
.earn-lock .icon { width: 1rem; height: 1rem; flex: none; color: var(--ink-3); }
.earn-mini { display: flex; align-items: center; gap: .4rem; margin: .4rem 0 .1rem 3rem; color: var(--warning-ink); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.earn-mini .icon { width: .9rem; height: .9rem; }
.earn-mini.is-locked { color: var(--ink-3); }
.claim-person:disabled { opacity: .55; cursor: not-allowed; }
.claim-person:disabled:hover { border-color: var(--line); background: transparent; }
.claim-person small { display: inline-flex; align-items: center; gap: .3rem; color: var(--ink-3); font-size: .74rem; font-weight: 700; }
.claim-person small .icon { width: .85rem; height: .85rem; }
.earn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .6rem; }
.earn-card { display: flex; align-items: center; gap: .8rem; padding: .85rem .9rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.earn-card-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.earn-card-main strong { font-weight: 700; }
.earn-balance { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.earn-card-main small { color: var(--ink-3); font-size: .78rem; font-weight: 600; }
.earn-recent { margin-top: 1.4rem; }
.earn-entry.is-earned .history-icon { background: var(--warning-soft); color: var(--warning-ink); }
.earn-entry.is-paid .history-icon { background: var(--info-soft); color: var(--info-ink); }
.input-affix.has-prefix { padding: 0 0 0 .9rem; }
.input-affix.has-prefix .input { padding-left: .35rem; }
.affix-star { display: inline-flex; color: var(--warning); }
.affix-star .icon { width: 1.1rem; height: 1.1rem; }
.value-badge .icon, .section-earn .icon, .earn-mini .icon { fill: currentColor; }

/* ---------- Tasks board ---------- */
.tasks { display: flex; flex-direction: column; gap: 1rem; height: 100%; min-height: 0; }
.tasks-toolbar, .cal-toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; flex: none; }
.cal-nav { display: flex; align-items: center; gap: .4rem; flex: none; }
.cal-filters { display: flex; gap: .45rem; flex: 1; min-width: 0; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.cal-filters::-webkit-scrollbar { display: none; }
.date-chip { position: relative; display: inline-flex; align-items: center; gap: .45rem; height: 2.75rem; padding: 0 .9rem; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 700; cursor: pointer; }
.date-chip:hover { background: var(--surface-3); color: var(--ink); }
.date-chip input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.board { flex: 1; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(18.5rem, 1fr); gap: var(--gap); overflow-x: auto; padding-bottom: .25rem; }
.board-col { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.board-col::before { content: ''; height: 5px; flex: none; background: var(--p, var(--ink-4)); }
.board-col.is-pool::before { background: repeating-linear-gradient(-45deg, var(--ink-4) 0 6px, transparent 6px 12px); }
.col-head { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.1rem .7rem; }
.col-head > div { flex: 1; min-width: 0; }
.col-head h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.015em; }
.col-head small { color: var(--ink-3); font-weight: 600; font-size: .84rem; }
.col-body { flex: 1; min-height: 0; overflow: auto; padding: 0 .8rem 1rem; }
.col-body .period-label { margin: .9rem .35rem .25rem; }
.col-body > .period-label:first-child { margin-top: .25rem; }
.claim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.claim-person { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.15rem .5rem; border: 1.5px solid var(--line); border-radius: var(--r-lg); font-weight: 800; font-size: 1.05rem; transition: border-color .15s, background .15s, transform .1s; }
.claim-person:hover { border-color: var(--p); background: var(--p-soft); }
.claim-person:active { transform: scale(.97); }
.history-day + .history-day { margin-top: 1.1rem; }
.history-row { display: flex; gap: .75rem; padding: .55rem 0; }
.history-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); flex: none; }
.history-icon .icon { width: 1rem; height: 1rem; }
.history-row.is-complete .history-icon { background: var(--success-soft); color: var(--success-ink); }
.history-row.is-claim .history-icon { background: var(--info-soft); color: var(--info-ink); }
.history-row p { font-size: .9375rem; }
.history-row small { color: var(--ink-3); font-size: .8rem; font-weight: 600; }

/* ---------- list rows (settings, sheets) ---------- */
.list-card { padding: .3rem 0; }
.list-rows { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: .85rem; min-height: 4rem; padding: .8rem 1.15rem; }
.list-card > .list-row + .list-row, .list-rows > .list-row + .list-row { border-top: 1px solid var(--line); }
.list-rows .list-row { padding: .75rem 0; }
.list-row-main { display: flex; flex-direction: column; gap: .1rem; flex: 1 1 9rem; min-width: 0; }
.list-row-main strong { font-size: .98rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-main small { color: var(--ink-3); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row > strong { font-weight: 700; }
.list-row.is-button { width: 100%; border-radius: var(--r); text-align: left; }
.list-row.is-button:hover { background: var(--surface-3); }
.row-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: var(--r-sm); background: var(--surface-3); color: var(--ink-2); flex: none; }
.list-card .empty { padding: 2.25rem 1rem; }
.steps { margin: .25rem 0 0; padding-left: 1.3rem; color: var(--ink-2); line-height: 1.75; }
.steps li::marker { font-weight: 800; color: var(--ink-3); }
.sheet .steps { margin-bottom: 1rem; }
.display-settings { display: flex; flex-direction: column; gap: .4rem; }
.display-settings .list-row { padding: .6rem 0; }
.display-settings .field { padding: .5rem 0; }

/* ---------- Lists ---------- */
.lists { display: grid; grid-template-columns: 17rem minmax(0, 58rem); gap: var(--gap); align-items: start; height: 100%; min-height: 0; }
.lists-nav { display: flex; flex-direction: column; gap: .25rem; }
.lists-nav-item { display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem; border-radius: var(--r); color: var(--ink-2); font-weight: 700; text-align: left; flex: none; transition: background .15s, color .15s; }
.lists-nav-item > span:not(.count) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lists-nav-item .count, .done-toggle .count { display: grid; place-items: center; min-width: 1.75rem; height: 1.5rem; padding: 0 .45rem; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.lists-nav-item:hover { background: var(--surface-3); color: var(--ink); }
.lists-nav-item.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); }
.lists-nav-item.is-active .count { background: var(--primary); color: var(--on-primary); }
.lists-nav-item.is-add { color: var(--ink-3); }
.list-panel { display: flex; flex-direction: column; max-height: 100%; min-height: 0; overflow: auto; }
.list-head { display: flex; align-items: center; gap: .85rem; padding: 1.15rem 1.25rem .9rem; }
.list-head h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.list-head small { color: var(--ink-3); font-weight: 600; }
.list-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--r); background: var(--surface-3); color: var(--ink-2); flex: none; }
.quick-add { display: flex; align-items: center; gap: .6rem; margin: 0 1.25rem .5rem; padding: .35rem .35rem .35rem .9rem; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--surface-2); flex: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.quick-add:focus-within { border-color: var(--focus); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.quick-add > .icon { color: var(--ink-3); }
.quick-add-input { flex: 1; min-width: 0; height: 2.5rem; border: 0; background: transparent; font-size: 1rem; outline: none; }
.quick-add-input::placeholder { color: var(--ink-4); }
.quick-add.is-compact { margin: 0 1.15rem .4rem; }
.items { padding: .25rem .75rem; }
.items.is-compact { padding: 0; }
.item { display: flex; align-items: center; gap: .2rem; border-radius: var(--r-sm); }
.item-toggle { display: flex; align-items: center; gap: .85rem; flex: 1; min-width: 0; min-height: 3.25rem; padding: .65rem .5rem; border-radius: var(--r-sm); text-align: left; }
.item-toggle:hover:not(:disabled) { background: var(--surface-3); }
.item-toggle:disabled { cursor: default; opacity: 1; }
.checkbox { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border: 2px solid var(--line-2); border-radius: 7px; color: transparent; flex: none; transition: background .15s, border-color .15s, color .15s; }
.checkbox .icon { width: 1.05rem; height: 1.05rem; stroke-width: 3; }
.item.is-done .checkbox { background: var(--success); border-color: var(--success); color: #fff; }
.item-text { font-size: 1.02rem; font-weight: 600; overflow-wrap: anywhere; }
.item.is-done .item-text { color: var(--ink-3); text-decoration: line-through; }
.item-edit { color: var(--ink-4); opacity: 0; transition: opacity .15s; }
.item:hover .item-edit, .item-edit:focus-visible { opacity: 1; }
@media (hover: none) { .item-edit { opacity: .75; } }
html.is-frame .item-edit { opacity: .75; }
.item-product-image { flex: none; width: 2.75rem; height: 2.75rem; object-fit: contain; border-radius: var(--r-sm); background: white; }
.item-product-link { flex: none; }
.shop-product { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.list-cart { margin: .25rem 1.25rem .5rem; }
.items.is-compact .item-toggle { min-height: 2.8rem; padding: .45rem .35rem; }
.done-section { margin: .5rem .75rem 1rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.done-head { display: flex; align-items: center; justify-content: space-between; }
.done-toggle { display: flex; align-items: center; gap: .5rem; padding: .5rem; color: var(--ink-3); font-size: .9rem; font-weight: 700; }
.done-toggle .icon { transition: transform .2s; }
.done-section.is-collapsed .done-toggle .icon { transform: rotate(-90deg); }
.done-section.is-collapsed > .items { display: none; }
.done-section > .items { padding: 0; }
.all-done { display: flex; align-items: center; gap: .6rem; padding: .9rem .5rem; color: var(--success-ink); font-weight: 700; }
.all-done .icon { width: 1.8rem; height: 1.8rem; padding: .32rem; border-radius: 50%; background: var(--success-soft); }

/* ---------- Timers ---------- */
.timers { display: flex; flex-direction: column; gap: 1.4rem; }
.presets { display: flex; flex-wrap: wrap; gap: .6rem; }
.preset { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 5.4rem; height: 5.4rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); transition: border-color .15s, transform .12s; }
.preset strong { font-size: 1.65rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.preset span { margin-top: .2rem; color: var(--ink-3); font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.preset:hover { border-color: var(--ink-4); transform: translateY(-1px); }
.preset:active { transform: scale(.97); }
.preset.is-custom { color: var(--ink-3); }
.preset.is-custom .icon { width: 1.5rem; height: 1.5rem; }
.presets.is-compact { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.presets.is-compact .preset { width: auto; height: 3.8rem; border-radius: var(--r); box-shadow: none; background: var(--surface-2); }
.presets.is-compact .preset strong { font-size: 1.2rem; }
.presets.is-compact .preset span { margin-top: .1rem; font-size: .62rem; }
.timer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--gap); }
.timer-card { --p: var(--info); display: flex; flex-direction: column; align-items: center; padding: 1.6rem 1.25rem 1.3rem; text-align: center; transition: border-color .2s, box-shadow .2s; }
.timer-card.is-paused, .timer-row.is-paused { --p: var(--ink-4); }
.timer-card.is-finished { --p: var(--accent); border-color: var(--accent); animation: ringpulse 1.6s infinite; }
.timer-dial { position: relative; width: 12rem; height: 12rem; margin-bottom: 1rem; }
.timer-dial .ring-track, .timer-dial .ring-fill { stroke-width: 2.3; }
.timer-dial-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-time { font-size: 2.65rem; font-weight: 800; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.timer-state { margin-top: .4rem; color: var(--ink-3); font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.timer-card.is-finished .timer-state, .timer-row.is-finished small { color: var(--accent-ink); }
.timer-card h3 { font-size: 1.15rem; font-weight: 800; overflow-wrap: anywhere; }
.timer-card > .muted { font-size: .875rem; font-weight: 600; }
.timer-controls { display: flex; align-items: center; justify-content: center; gap: .9rem; min-height: 3.75rem; margin-top: 1rem; }
.ctl-btn { display: inline-flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 3.5rem; color: var(--ink-2); font-size: .72rem; font-weight: 700; }
.ctl-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--sh-1); transition: background .15s, border-color .15s; }
.ctl-icon .icon { width: 1.25rem; height: 1.25rem; }
.ctl-btn:hover .ctl-icon { background: var(--surface-2); border-color: var(--ink-4); }
.ctl-btn:active .ctl-icon { transform: scale(.95); }
.ctl-btn.is-danger { color: var(--danger-ink); }
.ctl-btn.is-danger .ctl-icon { color: var(--danger-ink); }
.ctl-btn.is-danger:hover .ctl-icon { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.timer-controls .ctl-btn { margin-top: 1.05rem; }
.timer-row-actions { display: flex; gap: .35rem; flex: none; }
.icon-btn.is-danger { color: var(--danger-ink); }
.icon-btn.is-danger:hover:not(:disabled) { background: var(--danger-soft); }
.timer-rows { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.timer-row { --p: var(--info); display: flex; align-items: center; gap: .75rem; padding: .5rem .55rem .5rem .6rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.timer-row.is-finished { --p: var(--accent); border-color: transparent; background: var(--accent-soft); }
.timer-row-ring { width: 2.5rem; height: 2.5rem; flex: none; }
.timer-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.timer-row-main strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-row-main small { color: var(--ink-3); font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.timer-row-time { font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.sound-btn.btn-sm { flex: none; }

/* ---------- Calendar ---------- */
.cal { display: flex; flex-direction: column; gap: .9rem; height: 100%; min-height: 0; }
.cal-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cal-body[data-mode=agenda] { overflow: auto; }
.cal-status { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; padding-top: .55rem; color: var(--ink-4); font-size: .75rem; font-weight: 600; flex: none; }
.cal-status .icon { width: .85rem; height: .85rem; }
.tg { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.tg-head { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tg-gutter { display: flex; align-items: center; justify-content: flex-end; width: 4.4rem; padding-right: .65rem; flex: none; color: var(--ink-3); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.tg-heads, .tg-cols { display: grid; flex: 1; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.tg-dayhead { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem .25rem; border-left: 1px solid var(--line); }
.tg-dayhead .dow { color: var(--ink-3); font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.tg-dayhead .dnum { display: grid; place-items: center; min-width: 2.15rem; height: 2.15rem; padding: 0 .3rem; border-radius: 999px; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; transition: background .15s; }
.tg-dayhead:hover .dnum { background: var(--surface-3); }
.tg-dayhead.is-today .dow { color: var(--accent-ink); }
.tg-dayhead.is-today .dnum { background: var(--accent); color: #fff; }
.tg-allday { display: flex; flex: none; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tg-allday.is-empty { display: none; }
.tg-allday-grid { display: grid; flex: 1; gap: 3px; padding: 4px; max-height: 6.6rem; overflow: auto; grid-auto-rows: min-content; border-left: 1px solid var(--line); }
.tg-allday-event { display: flex; align-items: center; min-width: 0; padding: .3rem .55rem; border-radius: 7px; background: var(--p); color: #fff; font-size: .8rem; text-align: left; }
.tg-allday-event strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; }
.tg-body { position: relative; display: flex; height: calc(var(--hour) * 24); }
.tg-hours { display: flex; flex-direction: column; width: 4.4rem; flex: none; }
.tg-hour { position: relative; height: var(--hour); flex: none; }
.tg-hour span { position: absolute; top: -.55rem; right: .65rem; color: var(--ink-3); font-size: .68rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tg-cols { background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)); }
.tg-col { position: relative; border-left: 1px solid var(--line); }
.tg-col.is-weekend { background: color-mix(in srgb, var(--surface-3) 40%, transparent); }
.tg-col.is-today { background: color-mix(in srgb, var(--accent-soft) 32%, transparent); }
.tg-event { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: .05rem; overflow: hidden; padding: .28rem .5rem; border-left: 4px solid var(--p); border-radius: 8px; background: var(--p-soft); color: var(--p-ink); text-align: left; font-size: .76rem; line-height: 1.25; box-shadow: 0 0 0 1px var(--surface); transition: filter .15s; }
.tg-event strong { max-width: 100%; color: var(--ink); font-size: .84rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.tg-event > span:not(.sr-only) { max-width: 100%; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-event.is-short { flex-direction: row; align-items: center; gap: .4rem; padding-top: 0; padding-bottom: 0; }
.tg-event.is-short strong { -webkit-line-clamp: 1; white-space: nowrap; display: block; }
.tg-event.is-past { opacity: .6; }
.tg-event:hover { z-index: 2; filter: brightness(.97) saturate(1.15); }
.tg[data-days="1"] .tg-event { font-size: .88rem; padding: .4rem .7rem; }
.tg[data-days="1"] .tg-event strong { font-size: 1rem; }
.tg-now { position: absolute; left: -1px; right: 0; z-index: 3; height: 2px; background: var(--accent); pointer-events: none; }
.tg-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.month { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.month-names { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); flex: none; }
.month-names div { padding: .6rem .8rem; color: var(--ink-3); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.month-grid { display: grid; flex: 1; min-height: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(5.5rem, 1fr)); }
.mcell { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: hidden; padding: .35rem .35rem .3rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell:nth-last-child(-n+7) { border-bottom: 0; }
.mcell:hover { background: var(--surface-2); }
.mcell.is-outside { background: var(--surface-2); }
.mcell.is-outside .mnum { color: var(--ink-4); }
.mcell-head { display: flex; padding: 0 .15rem .1rem; flex: none; }
.mnum { display: grid; place-items: center; min-width: 1.8rem; height: 1.8rem; padding: 0 .4rem; border-radius: 999px; color: var(--ink-2); font-size: .875rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mcell.is-today .mnum { background: var(--accent); color: #fff; }
.mcell-events { position: relative; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow: hidden; }
.mchip { display: flex; align-items: center; gap: .35rem; width: 100%; min-width: 0; padding: .14rem .4rem; border-radius: 6px; font-size: .78rem; line-height: 1.35; text-align: left; flex: none; }
.mchip:hover { background: var(--p-soft); }
.mchip .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--p); flex: none; }
.mchip-time { color: var(--ink-3); font-weight: 700; flex: none; font-variant-numeric: tabular-nums; }
.mchip-title { min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mchip.is-allday { background: var(--p); color: #fff; }
.mchip.is-allday:hover { background: var(--p); filter: brightness(.94); }
.mchip.is-past { opacity: .55; }
.mmore { align-self: flex-start; padding: .1rem .45rem; border-radius: 6px; color: var(--ink-2); font-size: .74rem; font-weight: 800; flex: none; }
.mmore:hover { background: var(--surface-3); }
.cm { padding: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.cm-names, .cm-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cm-names div { padding: .35rem 0; text-align: center; color: var(--ink-3); font-size: .72rem; font-weight: 800; }
.cm-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: .3rem 0 .4rem; border-radius: var(--r-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.cm-cell > span:first-child { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: 50%; }
.cm-cell.is-outside { color: var(--ink-4); }
.cm-cell.is-today > span:first-child { color: var(--accent); font-weight: 800; }
.cm-cell.is-selected > span:first-child { background: var(--primary); color: var(--on-primary); }
.cm-cell.is-selected.is-today > span:first-child { background: var(--accent); color: #fff; }
.cm-dots { display: flex; gap: 2px; height: 6px; }
.cm-dots .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--p); }
.cm-day { margin-top: 1.1rem; }
.cm-day header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cm-day h2 { display: flex; flex-direction: column; font-size: 1.15rem; font-weight: 800; }
.cm-day h2 span { color: var(--ink-3); font-size: .85rem; font-weight: 600; }
.agenda { display: flex; flex-direction: column; max-width: 54rem; }
.agenda-day { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.agenda-day:first-child { border-top: 0; padding-top: 0; }
.agenda-date { display: flex; align-items: flex-start; gap: .7rem; }
.agenda-dnum { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 1.2rem; font-weight: 800; flex: none; font-variant-numeric: tabular-nums; }
.agenda-day.is-today .agenda-dnum { background: var(--accent); border-color: var(--accent); color: #fff; }
.agenda-date > span:last-child { display: flex; flex-direction: column; padding-top: .15rem; }
.agenda-date strong { font-weight: 800; }
.agenda-date small { color: var(--ink-3); font-size: .8rem; font-weight: 600; }
.agenda-items { display: flex; flex-direction: column; gap: .4rem; }
.agenda-item { display: grid; grid-template-columns: 5.4rem 4px minmax(0, 1fr); align-items: center; gap: .85rem; min-height: 3.8rem; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left; transition: border-color .15s, box-shadow .15s; }
.agenda-item:hover { border-color: var(--line-2); box-shadow: var(--sh-1); }
.agenda-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.agenda-time strong { font-size: .9rem; font-weight: 800; }
.agenda-time small { color: var(--ink-3); font-size: .78rem; font-weight: 600; }
.agenda-bar { align-self: stretch; border-radius: 4px; background: var(--p); }
.agenda-main { display: flex; flex-direction: column; min-width: 0; }
.agenda-main strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-main small { color: var(--ink-3); font-size: .82rem; font-weight: 600; }
.agenda-item.is-past { opacity: .55; }
.sheet .agenda-items .agenda-item { background: var(--surface-2); }
.event-detail::before { content: ''; display: block; width: 3rem; height: 5px; margin-bottom: 1rem; border-radius: 3px; background: var(--p); }
.event-detail-cal { display: flex; align-items: center; gap: .5rem; color: var(--p-ink); font-size: .9rem; font-weight: 700; }
.event-detail h2 { margin: .6rem 2.5rem .9rem 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.event-detail-row { display: flex; align-items: flex-start; gap: .7rem; margin-top: .55rem; color: var(--ink-2); font-weight: 600; }
.event-detail-row .icon { margin-top: .1rem; color: var(--ink-3); }
.event-detail-notes p { font-weight: 500; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.event-sheet .sheet-body { padding-top: 1.6rem; }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: 15rem minmax(0, 54rem); gap: 2rem; align-items: start; }
.settings-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: .2rem; }
.settings-nav-item { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; border-radius: var(--r); color: var(--ink-2); font-weight: 700; text-align: left; flex: none; transition: background .15s, color .15s; }
.settings-nav-item:hover { background: var(--surface-3); color: var(--ink); }
.settings-nav-item.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); }
.settings-section { display: flex; flex-direction: column; gap: 1rem; }
.settings-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: .25rem; }
.settings-head h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.settings-head p { max-width: 40rem; margin-top: .3rem; color: var(--ink-3); line-height: 1.5; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1.5rem; padding: 1.15rem 1.25rem; border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); border-radius: var(--r-lg); background: var(--danger-soft); }
.danger-zone strong { color: var(--danger-ink); }
.danger-zone p { margin-top: .2rem; color: var(--danger-ink); font-size: .875rem; line-height: 1.5; opacity: .9; }
.account-card { display: flex; align-items: center; gap: 1.1rem; padding: 1.3rem; flex-wrap: wrap; }
.account-card h3 { font-size: 1.2rem; font-weight: 800; }
.account-card p { display: flex; align-items: center; gap: .4rem; }

/* ---------- Landing ---------- */
body.is-landing, body.is-setup, body.is-pairing { overflow: auto; }
.landing { display: flex; flex-direction: column; min-height: 100dvh; background: radial-gradient(60rem 40rem at 85% -10%, color-mix(in srgb, #E27A2E 10%, transparent), transparent 70%), radial-gradient(50rem 36rem at -10% 100%, color-mix(in srgb, #3B78D8 9%, transparent), transparent 70%), var(--bg); }
.landing-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem clamp(1.25rem, 4vw, 3rem); }
.landing-main { display: grid; flex: 1; grid-template-columns: minmax(0, 1.3fr) minmax(21rem, 27rem); gap: clamp(2rem, 5vw, 5rem); align-items: center; width: 100%; max-width: 86rem; margin: 0 auto; padding: 1rem clamp(1.25rem, 4vw, 3rem) 3rem; }
.landing-story h1 { max-width: 15ch; margin: .6rem 0 1rem; font-size: clamp(2.4rem, 4.6vw, 4.1rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.02; }
.lead { max-width: 37rem; color: var(--ink-2); font-size: clamp(1.05rem, 1.35vw, 1.2rem); line-height: 1.55; }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; max-width: 42rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.feature-list li { display: flex; align-items: flex-start; gap: .8rem; }
.feature-list .icon { width: 2.5rem; height: 2.5rem; padding: .55rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2); }
.feature-list span { display: flex; flex-direction: column; color: var(--ink-3); font-size: .9rem; line-height: 1.4; }
.feature-list b { color: var(--ink); font-size: .95rem; font-weight: 800; }
.auth-card { display: flex; flex-direction: column; gap: 1rem; padding: 2rem; box-shadow: var(--sh-2); }
.auth-card h2 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.025em; }
.auth-card > p.muted { margin-top: -.6rem; }
.auth-card .banner { margin: 0; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--ink-4); font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.local-login summary { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .75rem; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 700; cursor: pointer; list-style: none; }
.local-login summary::-webkit-details-marker { display: none; }
.local-login summary:hover { background: var(--surface-3); color: var(--ink); }
.local-login summary .chev { width: 1rem; height: 1rem; transition: transform .2s; }
.local-login[open] summary .chev { transform: rotate(180deg); }
.auth-tabs { display: flex; width: 100%; margin: .5rem 0 1rem; }
.auth-tabs button { flex: 1; }
.auth-foot { display: flex; align-items: flex-start; gap: .55rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .85rem; line-height: 1.45; }
.auth-foot .icon { width: 1.05rem; height: 1.05rem; margin-top: .1rem; }
.auth-foot a { color: var(--ink-2); font-weight: 700; }
.landing-foot { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem clamp(1.25rem, 4vw, 3rem); color: var(--ink-3); font-size: .85rem; }
.landing-foot a { text-decoration: none; }
.landing-foot a:hover { color: var(--ink); }
.mockup { max-width: 42rem; margin-top: 2.2rem; padding: .85rem; border-radius: 1.6rem; background: #23262F; box-shadow: var(--sh-3), inset 0 0 0 1px rgb(255 255 255 / .06); }
.mk-screen { display: flex; flex-direction: column; gap: 3.5%; aspect-ratio: 16 / 9; overflow: hidden; padding: 3.5%; border-radius: .9rem; background: #F6F4EF; color: #1B1F2B; font-size: clamp(5.5px, .8vw, 10px); }
.mk-top { display: flex; align-items: center; gap: 1.2em; }
.mk-clock { font-size: 2.9em; font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.mk-clock small { margin-left: .2em; font-size: .34em; color: #767C8C; letter-spacing: 0; }
.mk-date { display: flex; flex-direction: column; padding-left: 1em; border-left: 2px solid #E8E4DC; }
.mk-date b { font-size: 1.25em; }
.mk-date i { font-style: normal; color: #767C8C; }
.mk-pill { margin-left: auto; padding: .55em 1.05em; border-radius: 999px; background: #E7EEFC; color: #284B98; font-weight: 700; }
.mk-grid { display: grid; flex: 1; grid-template-columns: 1.15fr 1fr .9fr; gap: 1.1em; min-height: 0; }
.mk-card { display: flex; flex-direction: column; gap: .6em; overflow: hidden; padding: 1em 1.1em; border: 1px solid #E8E4DC; border-radius: 1em; background: #fff; }
.mk-h { margin-bottom: .1em; font-size: 1.2em; font-weight: 800; }
.mk-next { display: flex; flex-direction: column; padding: .6em .8em; border-radius: .7em; background: #E2F3E9; border: 1px solid #B6DEC6; }
.mk-next i { color: #1B683F; font-style: normal; font-size: .72em; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.mk-next b { font-size: 1.25em; }
.mk-ev { display: flex; flex-direction: column; padding-left: .65em; border-left: 3px solid var(--p); }
.mk-ev b { font-size: .98em; }
.mk-ev i { color: #767C8C; font-style: normal; font-size: .82em; }
.mk-person { display: flex; align-items: center; gap: .5em; margin-top: .15em; }
.mk-person span { display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--p); color: #fff; font-size: .8em; font-weight: 800; }
.mk-task { display: flex; align-items: center; gap: .55em; font-size: .94em; font-weight: 600; }
.mk-task s { width: 1.2em; height: 1.2em; border: 2px solid #CFCAC0; border-radius: 50%; flex: none; }
.mk-task.is-done { color: #A4A9B4; text-decoration: line-through; }
.mk-task.is-done s { border-color: #349C63; background: #349C63; }
.mockup .c-blue { --p: #3B78D8; } .mockup .c-pink { --p: #D6538C; } .mockup .c-orange { --p: #E27A2E; } .mockup .c-green { --p: #349C63; } .mockup .c-purple { --p: #845ECF; }

/* ---------- Setup ---------- */
.setup { display: flex; flex-direction: column; min-height: 100dvh; }
.setup-main { display: grid; flex: 1; grid-template-columns: minmax(0, 36rem) minmax(0, 20rem); gap: 1.5rem; justify-content: center; align-items: start; padding: 1rem 1.25rem 3rem; }
.setup-card { padding: 2rem; }
.setup-card h1 { margin: .3rem 0 .5rem; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.setup-card > p { margin-bottom: 1.6rem; line-height: 1.55; }
.setup-aside { display: flex; flex-direction: column; gap: 1rem; }
.setup-aside .card { padding: 1.25rem; }
.setup-aside h2 { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: 1rem; font-weight: 800; }
.setup-aside p { font-size: .9rem; line-height: 1.5; }
.calendar-rows { display: flex; flex-direction: column; gap: .5rem; }
.calendar-row { display: flex; align-items: center; gap: .6rem; }
.dot-lg { width: .95rem; height: .95rem; border-radius: 50%; background: var(--p); flex: none; }
.add-row { align-self: flex-start; margin-top: .25rem; }

/* ---------- Pairing ---------- */
.pair { display: grid; place-items: center; min-height: 100dvh; padding: 2rem; }
.pair-card { width: min(70rem, 100%); padding: 3rem; border: 1px solid var(--line); border-radius: 2rem; background: var(--surface); box-shadow: var(--sh-2); }
.pair-brand { margin-bottom: 2rem; }
.pair h1 { margin-bottom: 2.2rem; font-size: 2.7rem; font-weight: 800; letter-spacing: -.035em; }
.pair-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.pair-steps { display: flex; flex-direction: column; gap: 1.6rem; margin: 0; padding: 0; list-style: none; }
.pair-steps li { display: flex; align-items: flex-start; gap: 1rem; }
.pair-steps li > span { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 800; flex: none; }
.pair-steps div { display: flex; flex-direction: column; color: var(--ink-2); font-size: 1.1rem; line-height: 1.45; }
.pair-steps b { color: var(--ink); font-size: 1.25rem; }
.pair-code-box { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2.6rem 1.5rem; border-radius: 1.5rem; background: var(--surface-3); }
.pair-label { color: var(--ink-3); font-size: .85rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.pair-code { display: flex; align-items: center; gap: .3em; font-size: clamp(2.4rem, 4.6vw, 4.4rem); font-weight: 800; letter-spacing: .12em; line-height: 1; font-variant-numeric: tabular-nums; }
.pair-code i { width: .45em; height: 5px; border-radius: 3px; background: var(--ink-4); }
.pair-status { color: var(--ink-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.pair-foot { display: flex; align-items: center; gap: .6rem; margin-top: 2.2rem; color: var(--ink-3); font-weight: 600; }
.pair-card > .btn { margin-top: 1.5rem; }

/* ---------- misc ---------- */
.boot { display: grid; place-items: center; min-height: 100dvh; }
.boot .brand-mark { grid-template-columns: repeat(2, 1.1rem); gap: .3rem; animation: breathe 1.4s ease-in-out infinite; }
.boot .brand-mark i { width: 1.1rem; height: 1.1rem; border-radius: 5px; }
.fatal { max-width: 34rem; margin: 18vh auto; padding: 2rem; text-align: center; }
.fatal h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.fatal p { margin: .75rem 0 1.5rem; color: var(--ink-3); }
.legal { max-width: 46rem; margin: 0 auto; padding: 1rem clamp(1.25rem, 4vw, 3rem) 4rem; }
.legal h1 { margin: 1rem 0 1rem; font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.legal h2 { margin: 2rem 0 .5rem; font-size: 1.2rem; font-weight: 800; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.65; }
.legal p + p { margin-top: .75rem; }

/* ---------- animation ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--p) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 .5rem transparent; } }
@keyframes ringpulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 .6rem transparent; } }
@keyframes wiggle { 0%, 55%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } }
@keyframes breathe { 50% { opacity: .55; transform: scale(.94); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px), (max-height: 700px) {
  .today { height: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-schedule { grid-row: span 2; }
  .today-side { grid-template-rows: auto auto; }
  .today-card .card-scroll { max-height: none; overflow: visible; }
  .today-schedule, .today-tasks { max-height: none; }
}
@media (max-width: 960px) {
  .landing-main { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
  .landing-story { display: contents; }
  .landing-story > .eyebrow, .landing-story > h1, .landing-story > .lead { order: 1; }
  .auth-card { order: 2; }
  .mockup { order: 3; margin-top: 0; }
  .feature-list { order: 4; margin-top: 0; }
  .landing-main > * { max-width: 40rem; }
  .landing-story h1 { margin-bottom: 0; }
  .setup-main { grid-template-columns: minmax(0, 36rem); }
  .lists { grid-template-columns: minmax(0, 1fr); height: auto; }
  .lists-nav { flex-direction: row; overflow-x: auto; padding: 2px; scrollbar-width: none; }
  .list-panel { max-height: none; overflow: visible; }
  .settings { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding: 2px; scrollbar-width: none; }
  .settings-nav-item { padding: .6rem .85rem; }
  .settings-head { flex-direction: column; align-items: flex-start; gap: .9rem; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .pair-layout { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .pair-card { padding: 2rem; }
}
@media (max-width: 720px) {
  :root { --pad: 1rem; --hour: 3.4rem; }
  body.in-app { height: auto; overflow: visible; }
  .app { display: block; height: auto; }
  .main { min-height: 100dvh; }
  .rail { position: fixed; inset: auto 0 0 0; z-index: 40; flex-direction: row; padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); }
  .rail-brand, .rail-foot { display: none; }
  .rail-items { flex-direction: row; justify-content: space-around; gap: 0; }
  .rail-item { gap: .2rem; padding: .3rem .1rem; font-size: .68rem; }
  .rail-item .icon { width: 3.4rem; height: 1.95rem; padding: .26rem 0; border-radius: 999px; transition: background .15s; }
  .rail-item:hover { background: transparent; }
  .rail-item.is-active { background: transparent; color: var(--ink); box-shadow: none; }
  .rail-item.is-active .icon { background: var(--primary); color: var(--on-primary); }
  .topbar { position: sticky; top: 0; z-index: 30; min-height: 3.9rem; padding: .55rem 1rem; gap: .6rem; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); }
  .top-account { display: flex; }
  .account-btn.top-account { width: auto; padding: 0; }
  .account-btn.top-account .account-name { display: none; }
  .view { overflow: visible; padding: .25rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
  .page-title h1 { font-size: 1.4rem; }
  .eyebrow { font-size: .68rem; }
  .topbar-view-tools .btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar-view-tools .btn { width: 2.75rem; padding: 0; }
  .topbar-view-tools .btn .icon { margin: 0; }
  .topbar-view-tools .btn-secondary { display: none; }
  .timer-pill-name { display: none; }
  .hero-clock { display: none; }
  .hero-date { padding-left: 0; border-left: 0; }
  .hero-date strong { font-size: 1.15rem; }
  .hero-date .long { display: none; }
  .hero-date .short { display: inline; }
  .today { grid-template-columns: minmax(0, 1fr); }
  .today-schedule { grid-row: auto; }
  .tasks { height: auto; }
  .board { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
  .board-col .col-body { overflow: visible; }
  .cal { height: auto; }
  .cal-toolbar { gap: .6rem; }
  .cal-toolbar .seg { order: -1; width: 100%; }
  .cal-toolbar .seg button { flex: 1; }
  .cal-filters { order: 3; flex-basis: 100%; }
  .cal-body { min-height: 0; }
  .tg { height: calc(100dvh - 15rem); flex: none; }
  .tg-gutter, .tg-hours { width: 3.4rem; }
  .agenda-day { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
  .agenda-item { grid-template-columns: 4.6rem 4px minmax(0, 1fr); gap: .7rem; padding: .6rem .7rem; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .repeat-options { display: flex; flex-direction: column; gap: 1.15rem; }
.when-grid { grid-template-columns: minmax(0, 1fr); gap: .4rem; }
  .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; }
  .sheet-inner, .sheet-sm .sheet-inner, .sheet-lg .sheet-inner { width: 100vw; max-height: calc(100dvh - 1.5rem); border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: env(safe-area-inset-bottom); animation: slideup .26s var(--ease); }
  .sheet-head, .sheet-body, .sheet-foot { padding-left: 1.15rem; padding-right: 1.15rem; }
  .toasts { bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  .list-row { flex-wrap: wrap; row-gap: .5rem; padding: .8rem 1rem; }
  .landing-nav .btn > span, .landing-foot span { display: none; }
  .auth-card { padding: 1.5rem; }
  .feature-list { grid-template-columns: minmax(0, 1fr); }
  .setup-card { padding: 1.4rem; }
  .pair { padding: 1rem; }
  .pair h1 { font-size: 2rem; }
  .alarm-card h2 { font-size: 2rem; }
  .timer-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Shared clock alarms. */
.alarms-page { display: grid; gap: 1.25rem; }
.alarm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.clock-alarm, .reminder-help { padding: 1.5rem; }
.clock-alarm-time { font-size: 2.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock-alarm h2 { margin: .5rem 0; }
.clock-alarm-actions { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.alarm-days { border: 0; padding: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.alarm-days legend { margin-bottom: .5rem; font-weight: 600; }
.alarm-days label { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .3rem; }
.reminder-help p { margin: .75rem 0; }

/* Claim controls occupy the same leading holder throughout the task's life. */
.task .task-check.task-holder { position: relative; width: 3.25rem; height: 3.25rem; gap: 0; padding: .1rem; align-content: center; }
.task .task-holder.is-open-pool { color: var(--ink-2); border-color: var(--ink-4); background: var(--surface-2); }
.task-holder.is-open-pool .icon { width: 1rem; height: 1rem; }
.task-claim-label { font-size: .68rem; line-height: 1.2; font-weight: 800; }
.task .task-holder.is-claimed { border: 2px dashed var(--ink-4); background: color-mix(in srgb, var(--ink-3) 14%, var(--surface)); color: var(--ink-2); }
.task-holder.is-claimed .avatar { --av: 1.9rem; }
.task-claim-time { padding: .05rem .25rem; border-radius: .35rem; background: var(--info-soft); color: var(--info-ink); font-size: .7rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.task .task-holder.is-claimed-done { background: var(--surface); border-color: var(--p); }
.task-holder.is-claimed-done .avatar { --av: 2.45rem; }
.task-complete-mark { position: absolute; right: -.15rem; bottom: -.1rem; display: grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--p); color: #fff; border: 2px solid var(--surface); }
.task .task-complete-mark .icon { width: .75rem; height: .75rem; }
.task .task-holder:hover:not(:disabled) { border-color: var(--ink-2); background: var(--surface-3); color: var(--ink); }
.claim-section-label { margin: .6rem 0 .2rem 3.9rem; color: var(--ink-3); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.task-lead { position: relative; display: inline-flex; flex: none; }
.task.is-earning .task-lead { margin-right: .4rem; }
.task-points-badge { position: absolute; top: -1.35rem; right: -.9rem; display: grid; place-items: center; width: 2.8rem; height: 2.8rem; color: #513000; pointer-events: none; filter: drop-shadow(0 1px 1px rgb(81 48 0 / .2)); }
.task-points-badge .points-star { position: absolute; inset: 0; width: 100%; height: 100%; }
.task-points-badge > span { position: relative; padding-top: .1rem; color: #513000; font-size: .78rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.task-points-badge.is-wide > span { font-size: .65rem; }

/* Mask code inputs visually without identifying them as account-password fields. */
.pin-input { -webkit-text-security: disc; text-align: center; font-size: 1.6rem; letter-spacing: .45rem; font-variant-numeric: tabular-nums; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.pin-keypad .btn { min-height: 3rem; font-size: 1.1rem; }
.pin-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.pin-error { color: var(--danger-ink); font-size: .9rem; }
.pin-error:empty { display: none; }
.pin-settings { padding: 1.25rem; }
.pin-settings p { margin-top: .65rem; }
.pin-audit-row .list-row-main { overflow-wrap: anywhere; }

.toast-warning, [data-theme=dark] .toast-warning { background: #fff0dd; color: #8a3c0a; border: 1px solid #dd7a22; }
.toast-urgent, [data-theme=dark] .toast-urgent { background: #fff0f0; color: #a21d26; border: 1px solid #dc414b; }
.claim-countdowns { position: fixed; bottom: 1rem; right: 1rem; z-index: 90; width: min(40rem, calc(100vw - 2rem)); max-height: 42vh; overflow: auto; display: grid; gap: .5rem; }
.claim-countdowns[hidden] { display: none; }
.claim-countdown { display: flex; align-items: center; gap: .75rem; padding: .85rem; border: 2px solid #dc414b; border-radius: var(--r-lg); box-shadow: var(--sh-3); background: #fff0f0; color: #a21d26; }
.claim-countdown-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.claim-countdown-main strong { font-size: .8rem; }
.claim-countdown-main > span { font-weight: 700; overflow-wrap: anywhere; }
.claim-seconds { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
body:has(.claim-countdowns:not([hidden])) .toasts { bottom: min(47vh, 20rem); }
@media (max-width: 720px) {
  .claim-countdowns { bottom: calc(5rem + env(safe-area-inset-bottom)); }
  .claim-countdown { flex-wrap: wrap; gap: .5rem; }
  .claim-countdown-main { flex-basis: calc(100% - 5rem); }
  .claim-countdown .btn { margin-left: auto; }
}

.toast-warning .toast-action, .toast-urgent .toast-action, [data-theme=dark] .toast-warning .toast-action, [data-theme=dark] .toast-urgent .toast-action { color: inherit; text-decoration: underline; }
