/* Workboard — designed against Apple's Human Interface Guidelines (HIG).
   Quiet, system-like grouped lists; the identity lives in one place: the blue "today stack" taken from the icon.
   RTL-first: logical properties only (inline-start = right in Hebrew). Sizes in rem so iOS text size scales them. */
@font-face { font-family: 'Heebo'; src: url('/fonts/heebo-hebrew-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; src: url('/fonts/heebo-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens (contrast vs. surface, light/dark — all text ≥ 4.5:1) ---------- */
:root {
  color-scheme: light dark;
  /* grouped background / row surface / control fill / hairline */
  --bg: #F2F2F7; --surface: #FFFFFF; --elevated: #FFFFFF; --fill: #E9E9EE; --fill-2: #F2F2F7; --hover: #F5F5F8;
  --separator: #D8D8DE; --separator-strong: #C6C6CC;
  /* labels: 17.0 / 6.3 / 5.1 :1 on white */
  --text: #1C1C1E; --muted: #5F5F66; --faint: #6E6E75;
  /* accent = the icon's blue: 6.5:1 on white, white on it 6.5:1 */
  --accent: #1D4FE0; --accent-hover: #1740B8; --accent-tint: #E4EAFB; --on-accent: #FFFFFF;
  --success: #1E7A36; --success-tint: #E4EFE7; --warn: #8A5A00; --warn-tint: #F1EBE0; --danger: #C4001A; --danger-tint: #F8E0E4;
  --badge: #D70015;
  --glass: rgb(249 249 251 / 72%); --glass-border: rgb(0 0 0 / 8%);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 5%); --shadow: 0 2px 10px rgb(0 0 0 / 6%); --shadow-lg: 0 20px 60px rgb(0 0 0 / 18%);
  --radius: 10px; --radius-lg: 14px; --radius-xl: 22px;
  --sidebar: 256px; --drawer: min(560px, 100vw);
  --font: -apple-system, BlinkMacSystemFont, 'SF Hebrew', 'Heebo', system-ui, 'Segoe UI', 'Noto Sans Hebrew', Arial, sans-serif;
  /* type scale ≈ iOS text styles (Large title 34 … Caption 12) */
  --t-large: 2.125rem; --t-title1: 1.75rem; --t-title2: 1.375rem; --t-title3: 1.25rem; --t-body: 1rem;
  --t-callout: .9375rem; --t-subhead: .875rem; --t-footnote: .8125rem; --t-caption: .75rem;
  --hit: 44px;
  /* named palette (statuses, projects, priorities): text color + tint, each ≥ 4.5:1 on its tint */
  --c-gray: #5F5F66; --c-gray-t: #EDEDF0;
  --c-accent: #1D4FE0; --c-accent-t: #E4EAFB;
  --c-blue: #0B5CAD; --c-blue-t: #E1ECF7;
  --c-teal: #0B7380; --c-teal-t: #E2EEF0;
  --c-green: #1E7A36; --c-green-t: #E4EFE7;
  --c-amber: #8A5A00; --c-amber-t: #F1EBE0;
  --c-orange: #B23B00; --c-orange-t: #F6E7E0;
  --c-red: #C4001A; --c-red-t: #F8E0E4;
  --c-pink: #A8215F; --c-pink-t: #F5E2EB;
  --c-purple: #7B3FA8; --c-purple-t: #EFE8F5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --surface: #1C1C1E; --elevated: #2C2C2E; --fill: #2C2C2E; --fill-2: #232325; --hover: #242427;
    --separator: #38383A; --separator-strong: #48484A;
    --text: #F2F2F7; --muted: #AEAEB4; --faint: #98989F;
    --accent: #6E95FF; --accent-hover: #8EADFF; --accent-tint: #2B3246; --on-accent: #000000;
    --success: #4CD07D; --success-tint: #253C2F; --warn: #F5C04A; --warn-tint: #433A26; --danger: #FF6961; --danger-tint: #452A2A;
    --badge: #FF453A;
    --glass: rgb(28 28 30 / 72%); --glass-border: rgb(255 255 255 / 9%);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%); --shadow: 0 2px 12px rgb(0 0 0 / 40%); --shadow-lg: 0 24px 60px rgb(0 0 0 / 60%);
    --c-gray: #AEAEB4; --c-gray-t: #2E2E31; --c-accent: #6E95FF; --c-accent-t: #2B3246; --c-blue: #64AAF5; --c-blue-t: #1E3043;
    --c-teal: #5AC8D8; --c-teal-t: #273B3F; --c-green: #4CD07D; --c-green-t: #253C2F; --c-amber: #F5C04A; --c-amber-t: #433A26;
    --c-orange: #FF9F5A; --c-orange-t: #453429; --c-red: #FF6961; --c-red-t: #452A2A; --c-pink: #FF8AB8; --c-pink-t: #44283A;
    --c-purple: #C68BF0; --c-purple-t: #3B3044;
  }
}
/* Increase Contrast: stronger separators and secondary text. */
@media (prefers-contrast: more) {
  :root { --muted: #3A3A3F; --faint: #46464C; --separator: #9A9AA0; --glass: var(--surface); }
  @media (prefers-color-scheme: dark) { :root { --muted: #D1D1D6; --faint: #C7C7CC; --separator: #6E6E73; } }
}
.c-gray { --c: var(--c-gray); --ct: var(--c-gray-t); } .c-accent { --c: var(--c-accent); --ct: var(--c-accent-t); } .c-blue { --c: var(--c-blue); --ct: var(--c-blue-t); }
.c-teal { --c: var(--c-teal); --ct: var(--c-teal-t); } .c-green { --c: var(--c-green); --ct: var(--c-green-t); } .c-amber { --c: var(--c-amber); --ct: var(--c-amber-t); }
.c-orange { --c: var(--c-orange); --ct: var(--c-orange-t); } .c-red { --c: var(--c-red); --ct: var(--c-red-t); } .c-pink { --c: var(--c-pink); --ct: var(--c-pink-t); }
.c-purple { --c: var(--c-purple); --ct: var(--c-purple-t); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
/* iPhone: the root size follows the system text-size setting (Dynamic Type); everything is in rem. */
@supports (font: -apple-system-body) { @media (pointer: coarse) { html { font: -apple-system-body; } } }
html, body { margin: 0; block-size: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--t-body); line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
bdi { unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: var(--t-footnote); } .danger { color: var(--danger); }
.icon { flex: none; display: block; }
kbd { font: 500 var(--t-caption)/1 var(--font); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--separator); background: var(--surface); color: var(--muted); direction: ltr; unicode-bidi: isolate; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--t-footnote); background: var(--fill); padding: 1px 5px; border-radius: 5px; }
::selection { background: var(--accent-tint); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.boot { display: grid; place-items: center; block-size: 100vh; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; block-size: 100vh; block-size: 100dvh; overflow: hidden; }
.sidebar { display: flex; flex-direction: column; gap: 4px; padding: 18px 12px 12px; border-inline-end: 1px solid var(--separator); background: var(--fill-2); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; font-weight: 700; font-size: var(--t-title3); letter-spacing: -0.01em; }
.brand-icon { border-radius: 8px; box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 28%, transparent); }
.nav-group { display: flex; flex-direction: column; gap: 1px; padding-block: 6px; }
.nav-group + .nav-group { border-block-start: 1px solid var(--separator); }
.nav-heading { font-size: var(--t-footnote); font-weight: 600; color: var(--muted); padding: 6px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--text); font-weight: 500; font-size: var(--t-callout); min-block-size: 36px; transition: background .12s; }
.nav-item .icon { color: var(--accent); }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--accent); color: var(--on-accent); }
.nav-item.active .icon, .nav-item.active .nav-count { color: var(--on-accent); }
.nav-label { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: var(--t-footnote); color: var(--muted); }
.nav-badge { font-size: var(--t-caption); font-weight: 700; color: #fff; background: var(--badge); border-radius: 99px; padding: 1px 7px; }
.dot { inline-size: 9px; block-size: 9px; border-radius: 50%; background: var(--c, var(--faint)); flex: none; display: inline-block; }
.dot.big { inline-size: 12px; block-size: 12px; }
.nav-item > .dot { margin-inline: 5px; }
.sidebar-foot { margin-block-start: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 6px 2px; border-block-start: 1px solid var(--separator); }
.conn { display: flex; align-items: center; gap: 6px; font-size: var(--t-footnote); color: var(--muted); }
.conn-dot { inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--faint); }
.conn.on .conn-dot { background: var(--success); }
.conn.off .conn-dot { background: var(--danger); }
.conn-sep { color: var(--faint); }
.foot-actions { display: flex; gap: 2px; }

.main { overflow-y: auto; overflow-x: hidden; position: relative; }
/* Functional layer: glass bar with a scroll-edge feel (HIG: layout › Visual hierarchy). */
.topbar { position: sticky; inset-block-start: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 28px; background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); border-block-end: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
/* The edge only appears once content actually scrolls under the bar. */
.topbar.scrolled { border-block-end-color: var(--glass-border); box-shadow: 0 6px 16px -12px rgb(0 0 0 / 30%); }
.search { flex: 1; max-inline-size: 460px; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-block-size: 38px; background: var(--fill); border-radius: 10px; color: var(--muted); }
.search:focus-within { box-shadow: 0 0 0 3px var(--accent-tint); }
.search kbd { opacity: .8; }
.search:focus-within kbd { display: none; }
.search-input { flex: 1; border: 0; background: transparent; padding: 8px 0; outline: none; color: var(--text); min-inline-size: 0; }
.search-input::placeholder { color: var(--faint); }
.topbar .btn.primary { margin-inline-start: auto; }
.icon-btn.menu-btn { display: none; }
.view-host { padding: 8px 28px 120px; }
.view { max-inline-size: 880px; margin-inline: auto; }
.view.wide { max-inline-size: none; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; background: var(--fill); color: var(--text); padding: 8px 15px; min-block-size: 36px; border-radius: 10px; font-weight: 600; font-size: var(--t-callout); transition: background .12s, transform .08s; white-space: nowrap; }
.btn:hover { background: var(--separator); }
.btn:active { transform: scale(.98); }
/* Press feedback lives on the press and is instant (Apple motion guidance §1). */
.btn, .icon-btn, .mini, .chip-btn, .status-chip, .status-tab, .seg, .day-pill, .day-next, .swipe-btn, .mnav, .dock-add, .check, .row-more, .link-btn, .project-row, .nav-item { -webkit-user-select: none; user-select: none; }
.icon-btn:active, .mini:active, .chip-btn:active, .status-chip:active, .status-tab:active, .seg:active, .day-next:active, .swipe-btn:active, .mnav:active, .row-more:active, .link-btn:active { transform: scale(.96); transition: transform 80ms ease-out; }
.check:active { transform: scale(.88); transition: transform 80ms ease-out; }
.project-row:active, .nav-item:active { background: var(--fill); transition: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-tint); }
.btn.success { background: var(--success-tint); color: var(--success); }
.btn.small { padding: 5px 11px; min-block-size: 32px; font-size: var(--t-subhead); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { position: relative; display: inline-grid; place-items: center; inline-size: 34px; block-size: 34px; border: 0; background: transparent; border-radius: 9px; color: var(--accent); transition: background .12s; }
.icon-btn:hover:not(:disabled) { background: var(--accent-tint); }
.icon-btn.small { inline-size: 28px; block-size: 28px; border-radius: 7px; font-size: 10px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: var(--t-subhead); padding: 6px 4px; }
.input, .select, .date-input { border: 0; background: var(--fill); border-radius: 10px; padding: 7px 12px; min-block-size: 38px; outline: none; transition: box-shadow .15s; min-inline-size: 0; }
.input:focus, .select:focus, .date-input:focus { box-shadow: 0 0 0 3px var(--accent-tint); background: var(--surface); }
.input::placeholder { color: var(--faint); }
.select { padding-inline-end: 30px; }
.date-input { font-variant-numeric: tabular-nums; }
.segmented { display: inline-flex; padding: 2px; background: var(--fill); border-radius: 9px; gap: 2px; }
.seg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; padding: 5px 12px; min-block-size: 30px; border-radius: 7px; color: var(--text); font-weight: 500; font-size: var(--t-subhead); }
.seg.on { background: var(--elevated); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); font-weight: 600; }
/* Dark: the thumb must be lighter than the track (both were #2C2C2E) — iOS uses #636366 on a dark fill. */
@media (prefers-color-scheme: dark) { .seg.on { background: #636366; box-shadow: 0 1px 3px rgb(0 0 0 / 40%); } }
.mini-group { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mini { border: 0; background: var(--fill); border-radius: 8px; padding: 4px 11px; min-block-size: 32px; font-size: var(--t-subhead); color: var(--text); display: inline-flex; align-items: center; gap: 4px; transition: background .12s; }
.mini:hover { background: var(--separator); }
.mini.on { background: var(--ct, var(--accent-tint)); color: var(--c, var(--accent)); font-weight: 600; }
.mini.ghost { background: transparent; color: var(--muted); }

/* ---------- Headers ---------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 14px 0 16px; flex-wrap: wrap; }
.view-head h1, .large-title h1 { font-size: var(--t-large); line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
.view-sub { margin: 4px 0 0; color: var(--muted); font-size: var(--t-callout); }
.view-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: var(--t-subhead); font-weight: 600; }
.large-title { margin: 14px 2px 14px; }

/* ---------- Today: the signature "today stack" (the icon's stack of cards, made of real data) ---------- */
.today { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; max-inline-size: 1180px; margin-inline: auto; }
.day-stack { position: relative; margin-block-end: 18px; }
.day-stack.peek-1 { padding-block-end: 9px; }
.day-stack.peek-2 { padding-block-end: 17px; }
/* the cards peeking beneath = what's still queued for today */
.day-stack.peek-1::before, .day-stack.peek-2::after { content: ''; position: absolute; inset-inline: 14px; inset-block-end: 8px; block-size: 30px; border-radius: 0 0 var(--radius-xl) var(--radius-xl); background: linear-gradient(135deg, #7FA3F7, #8FD6FB); opacity: .55; z-index: 0; }
.day-stack.peek-2::after { inset-inline: 28px; inset-block-end: 0; opacity: .3; }
.day-card { position: relative; z-index: 1; color: #fff; border-radius: var(--radius-xl); padding: 18px 20px 16px; background: radial-gradient(120% 140% at 100% 0%, #22D3F5 0%, transparent 55%), linear-gradient(160deg, #1D4FE0 0%, #0A2FD0 60%, #0726B8 100%); box-shadow: 0 12px 30px -10px rgb(13 52 220 / 55%); overflow: hidden; }
.day-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 1px 0 rgb(255 255 255 / 28%); pointer-events: none; }
.day-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.day-label { font-size: var(--t-subhead); font-weight: 600; opacity: .9; }
.day-count { font-size: var(--t-title3); font-weight: 600; margin-block-start: 2px; }
.day-count strong { font-size: var(--t-title1); font-weight: 700; }
.day-card .ring-track { stroke: rgb(255 255 255 / 22%); }
.day-card .ring-fill { stroke: #fff; }
.day-card .ring-label { color: #fff; }
.day-next { display: flex; align-items: center; gap: 10px; inline-size: 100%; margin-block-start: 14px; padding: 11px 14px; min-block-size: var(--hit); border: 0; border-radius: 14px; background: rgb(255 255 255 / 16%); color: #fff; font-size: var(--t-body); font-weight: 600; text-align: start; }
.day-next bdi { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-next.quiet { font-weight: 500; opacity: .95; }
.day-next-label { flex: none; font-size: var(--t-caption); font-weight: 700; background: #fff; color: #0A2FD0; border-radius: 99px; padding: 2px 9px; }
.day-next-chevron { flex: none; opacity: .8; }
.day-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-block-end: 18px; }
.day-pill { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--surface); color: var(--text); border-radius: 99px; padding: 6px 13px; min-block-size: 34px; font-size: var(--t-subhead); font-weight: 500; box-shadow: var(--shadow-sm); }
.day-pill .num { font-weight: 700; }
.day-pill.tone-danger .num { color: var(--danger); }
.day-pill.tone-accent .num { color: var(--accent); }
.day-pill.tone-success .num { color: var(--success); }
.ring { position: relative; inline-size: 60px; block-size: 60px; flex: none; }
.ring svg { display: block; inline-size: 60px; block-size: 60px; }
.ring-track { fill: none; stroke: var(--fill); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--success); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .6s cubic-bezier(.2,.8,.2,1); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--t-footnote); font-weight: 700; }
.today-aside { display: flex; flex-direction: column; gap: 16px; padding-block-start: 22px; position: sticky; inset-block-start: 64px; align-self: start; max-block-size: calc(100vh - 80px); overflow-y: auto; }
.panel { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 16px; }
.panel-title { display: flex; align-items: center; gap: 7px; font-size: var(--t-subhead); margin: 0 0 10px; color: var(--muted); font-weight: 600; }
.panel-title .icon { color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-item { display: grid; grid-template-columns: 50px 1fr; gap: 8px; padding: 7px 6px; border-radius: 9px; cursor: pointer; }
.tl-item:hover { background: var(--hover); }
.tl-time { font-weight: 700; font-size: var(--t-subhead); color: var(--accent); }
.tl-item.past .tl-time { color: var(--faint); }
.tl-item.failed .tl-time { color: var(--danger); }
.tl-title { font-weight: 500; font-size: var(--t-callout); line-height: 1.35; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; }
.feed-item + .feed-item { border-block-start: 1px solid var(--separator); }
.feed-icon { display: grid; place-items: center; inline-size: 26px; block-size: 26px; border-radius: 8px; background: var(--fill); color: var(--muted); flex: none; }
.feed-item.by-agent .feed-icon { background: var(--accent-tint); color: var(--accent); }
.feed-body { flex: 1; min-inline-size: 0; font-size: var(--t-subhead); line-height: 1.4; }
.feed-link { color: var(--text); font-weight: 500; }
.feed-link:hover { color: var(--accent); }
.feed-meta { color: var(--muted); font-size: var(--t-footnote); }
.feed.compact .feed-item { padding: 6px 0; }

/* ---------- Quick add ---------- */
.quick-add { margin-block-end: 20px; }
.qa-row { display: flex; align-items: center; gap: 10px; padding: 2px 14px; min-block-size: 48px; background: var(--surface); border-radius: var(--radius-lg); transition: box-shadow .15s; }
.qa-row:focus-within { box-shadow: 0 0 0 3px var(--accent-tint); }
.qa-plus { display: grid; place-items: center; inline-size: 24px; block-size: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); flex: none; }
.qa-plus .icon { inline-size: 16px; block-size: 16px; }
.qa-input { flex: 1; border: 0; outline: none; background: transparent; padding: 10px 0; font-size: var(--t-body); min-inline-size: 0; }
.qa-input::placeholder { color: var(--faint); }
.qa-hint { opacity: 0; transition: opacity .15s; }
.qa-row:focus-within .qa-hint { opacity: 1; }
.qa-preview { display: none; gap: 6px; flex-wrap: wrap; padding: 8px 4px 0; }
.qa-preview.show { display: flex; }

/* ---------- Inset grouped lists (HIG: lists and tables) ---------- */
.group { margin-block-end: 24px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block-end: 6px; padding-inline: 4px; }
.group-title { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 4px 2px; min-block-size: 32px; font-weight: 600; font-size: var(--t-footnote); color: var(--muted); }
.group-title:disabled { cursor: default; }
.group-title .count { font-weight: 500; }
.group-title .twist { color: var(--faint); }
.tone-danger .group-title, .tone-danger .group-title .icon { color: var(--danger); }
.tone-success .group-title, .tone-success .group-title .icon { color: var(--success); }
.tone-accent .group-title, .tone-accent .group-title .icon { color: var(--accent); }
.rows { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.row { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; min-block-size: 52px; cursor: pointer; background: var(--surface); transition: background .12s; outline: none; touch-action: pan-y; will-change: transform; }
/* feedback on press, not on release (Apple motion guidance §1) */
.row.pressed, .row:active { background: var(--fill); transition: none; }
/* swipe actions sit behind the row */
.swipe { position: relative; overflow: hidden; }
.swipe-actions { position: absolute; inset-block: 0; display: flex; visibility: hidden; }
.swipe-actions.lead { inset-inline-start: 0; }
.swipe-actions.trail { inset-inline-end: 0; }
.swipe.open-lead .swipe-actions.lead, .swipe.open-trail .swipe-actions.trail { visibility: visible; }
/* Armed long swipe: the primary date action fills the gap — "let go and it happens". */
.swipe.armed .swipe-actions.lead { inline-size: 100%; }
.swipe.armed .swipe-actions.lead .swipe-btn:first-child { flex: 1; inline-size: auto; transition: flex-grow .15s ease-out; }
.swipe.armed .swipe-actions.lead .swipe-btn:not(:first-child) { display: none; }
.swipe-btn { inline-size: 84px; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff; font-size: var(--t-footnote); font-weight: 600; background: var(--c-gray); }
.swipe-btn.tone-success { background: #1E7A36; } .swipe-btn.tone-accent { background: #1D4FE0; } .swipe-btn.tone-blue { background: #0B5CAD; }
.swipe-btn.tone-purple { background: #7B3FA8; } .swipe-btn.tone-orange { background: #B23B00; }
/* status colours on swipe buttons (white text ≥ 4.5:1 on each) */
.trail .swipe-btn { inline-size: 76px; }
.swipe-btn.tone-gray { background: #5F5F66; } .swipe-btn.tone-teal { background: #0B7380; } .swipe-btn.tone-green { background: #1E7A36; }
.swipe-btn.tone-amber { background: #8A5A00; } .swipe-btn.tone-red { background: #C4001A; } .swipe-btn.tone-pink { background: #A8215F; }
/* Date actions are neutral graphite: colour stays reserved for statuses (HIG: color › Best practices). */
.swipe-btn.tone-d-today { background: #2C2C30; } .swipe-btn.tone-d-move { background: #48484E; } .swipe-btn.tone-d-week { background: #636369; }
@media (prefers-color-scheme: dark) { .swipe-btn.tone-d-today { background: #48484A; } .swipe-btn.tone-d-move { background: #5A5A5F; } .swipe-btn.tone-d-week { background: #6C6C71; } }
.swipe-actions .swipe-btn { inline-size: 76px; }
.agenda-items .swipe { border-radius: 12px; }
.agenda-items .swipe .row::before { display: none; }
/* hairline separators inset to the text column, like iOS */
.swipe + .swipe .row::before, .row + .row::before { content: ''; position: absolute; inset-block-start: 0; inset-inline-start: 50px; inset-inline-end: 0; border-block-start: 1px solid var(--separator); }
.row:hover, .row:focus-visible { background: var(--hover); }
.row:active { background: var(--fill); }
.row.selected { background: var(--accent-tint); }
.row.fresh::after { content: ''; position: absolute; inset-block-start: 20px; inset-inline-start: 6px; inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--accent); }
.row-main { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: 5px; }
.row-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; font-size: var(--t-body); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.row.done .row-title bdi { color: var(--faint); text-decoration: line-through; }
.row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 14px; font-size: var(--t-subhead); color: var(--muted); line-height: 1.4; }
.meta-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.meta-item .icon { inline-size: 14px; block-size: 14px; opacity: .85; }
.meta-item .dot { inline-size: 8px; block-size: 8px; }
.meta-item.is-danger { color: var(--danger); font-weight: 600; }
.meta-item.is-strong { color: var(--text); font-weight: 600; }
.meta-item.is-warn { color: var(--warn); font-weight: 600; }
.meta-item.is-success { color: var(--success); }
.row-tags { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: var(--t-footnote); color: var(--faint); }
.meta-more { color: var(--faint); }
.meta-sep { color: var(--faint); }
.prio-mark { color: var(--c); font-weight: 800; letter-spacing: -0.05em; }
.row-meta:empty { display: none; }
.row-id { font-size: var(--t-footnote); color: var(--faint); flex: none; padding-block-start: 2px; }
.prio-flag { color: var(--c); display: grid; padding-block-start: 3px; }
.meta-icon { color: var(--faint); display: grid; }
.triage { display: flex; gap: 6px; flex-wrap: wrap; margin-block-start: 4px; opacity: 0; transition: opacity .12s; }
/* lighter than content: tinted text buttons, the first (today) is the suggested one */
.triage .mini { background: transparent; color: var(--accent); font-weight: 600; padding-inline: 10px; box-shadow: inset 0 0 0 1px var(--separator); }
.triage .mini:first-child { background: var(--accent-tint); box-shadow: none; }
/* In list rows the blue dot already says "new" (like Mail); keep the label for screen readers only. */
.row .badge-new { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.row:hover .triage, .row:focus-within .triage { opacity: 1; }
@media (hover: none) { .triage { display: none; } }
.swipe-hint { display: none; margin: 8px 4px 0; }
@media (hover: none) { .swipe-hint { display: block; } }
/* With a pointer, triage floats over the row's end on hover instead of reserving height in every row. */
@media (hover: hover) and (min-width: 821px) {
  .triage { position: absolute; inset-inline-end: 14px; inset-block-start: 50%; transform: translateY(-50%); margin: 0; padding: 4px; border-radius: 12px; background: var(--hover); }
  .row:hover .row-id { visibility: hidden; }
}
.row-more { display: block; inline-size: 100%; border: 0; border-block-start: 1px solid var(--separator); background: transparent; color: var(--accent); font-weight: 600; font-size: var(--t-callout); padding: 12px; min-block-size: var(--hit); cursor: pointer; }
.row-more:hover { background: var(--hover); }
.row-more { display: flex; align-items: center; justify-content: center; gap: 6px; }
.row-more.less { color: var(--muted); font-weight: 500; font-size: var(--t-subhead); }
.icon.flip { transform: rotate(180deg); }

/* the round "done" control — 22px visual, ≥ 44px hit area on touch */
.check { position: relative; flex: none; inline-size: 22px; block-size: 22px; margin-block-start: 1px; border-radius: 50%; border: 1.6px solid var(--separator-strong); background: transparent; color: transparent; display: grid; place-items: center; padding: 0; transition: background .15s, border-color .15s, color .15s; }
.check::before { content: ''; position: absolute; inset: -11px; }
.check.prio-red { border-color: var(--c-red); } .check.prio-orange { border-color: var(--c-orange); }
.check:hover { border-color: var(--success); color: var(--success); }
.check.is-done { background: var(--success); border-color: var(--success); color: #fff; }
.check.pop { animation: pop .3s ease; }
.check.big { inline-size: 28px; block-size: 28px; margin-block-start: 5px; }
@keyframes pop { 50% { transform: scale(1.2); } }

/* chips / pills / tags */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 7px; background: var(--fill); color: var(--muted); font-size: var(--t-footnote); font-weight: 500; line-height: 1.5; white-space: nowrap; }
.chip-key { color: var(--muted); }
.chip-soft { background: transparent; padding-inline: 0; }
.chip-accent { background: var(--accent-tint); color: var(--accent); }
.chip-warn { background: var(--warn-tint); color: var(--warn); }
.chip-danger { background: var(--danger-tint); color: var(--danger); }
.chip-project { background: var(--ct); color: var(--c); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: var(--t-footnote); font-weight: 600; background: var(--ct, var(--fill)); color: var(--c, var(--muted)); line-height: 1.5; white-space: nowrap; }
.tag { color: var(--muted); font-size: var(--t-footnote); font-weight: 500; }
.tag.removable { color: var(--accent); }
.badge-new { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: var(--t-caption); font-weight: 700; color: var(--accent); background: var(--accent-tint); padding: 1px 8px; border-radius: 99px; }

/* progress (fills from the reading start — right in RTL) */
.progress { display: inline-flex; align-items: center; gap: 7px; }
.progress-track { inline-size: 64px; block-size: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; display: block; }
.progress.compact .progress-track { inline-size: 40px; block-size: 5px; }
.progress-fill { display: block; block-size: 100%; border-radius: 99px; background: var(--accent); transition: inline-size .35s cubic-bezier(.2,.8,.2,1); }
.progress.complete .progress-fill { background: var(--success); }
.progress-label { font-size: var(--t-footnote); color: var(--muted); font-weight: 600; }
.progress.complete .progress-label { color: var(--success); }

/* ---------- Board ---------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-block-end: 16px; align-items: flex-start; min-block-size: 60vh; scroll-snap-type: x proximity; }
.column { flex: 0 0 290px; display: flex; flex-direction: column; background: var(--fill-2); border: 1px solid var(--separator); border-radius: var(--radius-lg); max-block-size: calc(100vh - 190px); scroll-snap-align: start; transition: background .15s, box-shadow .15s; }
.column.drop { background: var(--ct); box-shadow: inset 0 0 0 2px var(--c); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; font-weight: 600; font-size: var(--t-callout); }
.column-title { flex: 1; }
.column-head .count { color: var(--muted); font-weight: 500; font-size: var(--t-footnote); }
.column-add { display: none; padding: 0 8px; }
.column-add.show { display: block; }
.column-add .quick-add { margin-block-end: 8px; }
.column-add .qa-row { min-block-size: 40px; padding: 0 10px; }
.column-add .qa-input { padding: 7px 0; font-size: var(--t-callout); }
.column-body { display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 10px; overflow-y: auto; min-block-size: 60px; }
.column-empty { border: 1.5px dashed var(--separator-strong); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); font-size: var(--t-footnote); }
.column-more { text-align: center; font-size: var(--t-footnote); color: var(--accent); padding: 8px; }
.card { background: var(--surface); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, opacity .15s; position: relative; outline: none; border-inline-start: 3px solid transparent; }
.card.edge-red { border-inline-start-color: var(--c-red); } .card.edge-orange { border-inline-start-color: var(--c-orange); }
.card:hover, .card:focus-visible { box-shadow: var(--shadow); transform: translateY(-1px); }
.card.dragging { opacity: .45; transform: rotate(-1.5deg); }
.card.done { opacity: .7; }
.card.done .card-title bdi { text-decoration: line-through; color: var(--faint); }
.card.fresh { box-shadow: 0 0 0 2px var(--accent-tint), var(--shadow-sm); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.card-title { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: var(--t-callout); line-height: 1.4; overflow-wrap: anywhere; }
.card-title .check { inline-size: 20px; block-size: 20px; }
.card-next { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: var(--t-footnote); padding-inline-start: 30px; }
.card .progress { padding-inline-start: 30px; }
.card .progress-track { inline-size: 100%; flex: 1; }
.card .row-meta { padding-inline-start: 30px; }

/* ---------- Agenda ---------- */
.agenda { display: flex; flex-direction: column; gap: 2px; margin-block-end: 24px; }
.agenda-day { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px 0; border-block-end: 1px solid var(--separator); }
.agenda-date { display: flex; flex-direction: column; padding-block-start: 8px; }
.agenda-dow { font-weight: 600; font-size: var(--t-callout); }
.agenda-num { color: var(--muted); font-size: var(--t-footnote); }
.agenda-items { display: flex; flex-direction: column; gap: 8px; }
.agenda-items .row { border-radius: 12px; background: var(--surface); }
.agenda-rem { display: flex; gap: 8px; align-items: center; color: var(--accent); font-size: var(--t-subhead); cursor: pointer; padding: 4px; min-block-size: 32px; }
.empty-day { padding: 6px 0; }
.empty-day .agenda-date { flex-direction: row; gap: 8px; padding: 0; font-size: var(--t-footnote); }
.empty-day .agenda-dow { color: var(--muted); font-weight: 500; font-size: var(--t-footnote); }
.empty-day .agenda-items { justify-content: center; }
.weekend .agenda-dow { color: var(--muted); }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.project-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; transition: transform .15s, box-shadow .15s; }
a.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.project-stripe { position: absolute; inset-block-start: 0; inset-inline: 0; block-size: 4px; background: var(--c); }
.project-card h3 { margin: 0; font-size: var(--t-title3); display: flex; gap: 8px; align-items: center; }
.project-stats { display: flex; gap: 14px; color: var(--muted); font-size: var(--t-subhead); }
.project-stats strong { color: var(--text); font-size: var(--t-callout); }
.project-card .progress { display: flex; }
.project-card .progress-track { flex: 1; }
.project-card .progress-fill { background: var(--c); }
.project-card.new { border: 1.5px dashed var(--separator-strong); background: transparent; justify-content: center; }
.project-card.new h3 { color: var(--muted); font-size: var(--t-callout); display: flex; align-items: center; gap: 6px; }
.project-card.new input { border: 0; border-radius: 10px; padding: 9px 12px; background: var(--fill); outline: none; }
.project-title { display: flex; align-items: center; gap: 10px; }
.title-input { font-size: var(--t-large); font-weight: 700; letter-spacing: -0.02em; border: 0; background: transparent; border-radius: 10px; padding: 0 6px; margin-inline-start: -6px; min-inline-size: 0; inline-size: 100%; }
.title-input:hover { background: var(--fill); }
.title-input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 3px var(--accent-tint); }
.swatches { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.swatch { inline-size: 22px; block-size: 22px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--separator); padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--c); }
.color-pop { position: relative; }
.color-pop summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; min-block-size: 34px; border-radius: 10px; background: var(--fill); font-size: var(--t-subhead); font-weight: 600; color: var(--text); cursor: pointer; }
.color-pop summary::-webkit-details-marker { display: none; }
.swatches.pop { position: absolute; inset-block-start: calc(100% + 6px); inset-inline-end: 0; z-index: 6; background: var(--elevated); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-lg); inline-size: 172px; gap: 10px; }
.swatches.pop .swatch { inline-size: 26px; block-size: 26px; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { display: inline-grid; place-items: center; inline-size: 56px; block-size: 56px; border-radius: 16px; background: var(--accent-tint); color: var(--accent); margin-block-end: 12px; }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: var(--t-title3); }
.empty p { margin: 0 auto; max-inline-size: 380px; font-size: var(--t-callout); }

/* ---------- Task detail: side panel on desktop, bottom sheet on iPhone ---------- */
.drawer-host { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / calc(22% * var(--scrim, 1))); display: flex; justify-content: flex-end; }
@keyframes fade { from { background: transparent; } }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } }
.drawer { inline-size: var(--drawer); block-size: 100%; background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; will-change: transform; }
.drawer-head > .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-inline-size: 0; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); border-block-end: 1px solid var(--glass-border); position: relative; }
.grabber { display: none; }
.spacer { flex: 1; }
.drawer-scroll { flex: 1; overflow-y: auto; padding: 16px 20px 40px; }
.title-row { display: flex; gap: 10px; align-items: flex-start; }
.drawer-title { flex: 1; border: 0; border-radius: 10px; background: transparent; resize: none; font-size: var(--t-title2); font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; padding: 4px 8px; overflow: hidden; outline: none; }
.drawer-title:hover { background: var(--fill); }
.drawer-title:focus { background: var(--surface); box-shadow: 0 0 0 3px var(--accent-tint); }
.banner { display: flex; gap: 8px; align-items: center; background: var(--warn-tint); color: var(--warn); padding: 9px 12px; border-radius: 10px; margin: 10px 0; font-size: var(--t-subhead); font-weight: 600; }
/* properties as one inset grouped table */
.props { display: grid; grid-template-columns: 116px 1fr; margin: 16px 0 6px; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.prop { display: contents; }
.prop-label, .prop-value { padding: 8px 14px; min-block-size: var(--hit); border-block-end: 1px solid var(--separator); }
.prop:last-child .prop-label, .prop:last-child .prop-value { border-block-end: 0; }
.prop-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--t-subhead); }
.prop-label .icon { color: var(--accent); }
.prop-value { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-inline-size: 0; }
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--fill); border-radius: 99px; padding: 4px 12px 4px 11px; min-block-size: 32px; font-size: var(--t-subhead); color: var(--text); transition: background .12s; }
.status-chip:hover { background: var(--separator); }
.status-chip.on { background: var(--ct); color: var(--c); font-weight: 600; }
.date-control { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.date-control .date-input { min-block-size: 34px; padding: 4px 10px; }
.tags-control { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; }
.tag.removable { display: inline-flex; align-items: center; gap: 2px; background: var(--accent-tint); padding: 3px 4px 3px 9px; border-radius: 8px; }
.tag.removable button { border: 0; background: none; color: inherit; display: grid; padding: 3px; border-radius: 5px; opacity: .7; }
.tag-input { border: 0; outline: none; background: transparent; min-inline-size: 90px; flex: 1; padding: 6px 2px; }
.url-field { display: flex; gap: 4px; align-items: center; flex: 1; }
.url-field .input { flex: 1; }
.checkbox { inline-size: 20px; block-size: 20px; accent-color: var(--accent); }

.block { margin-block-start: 20px; }
.block-head { display: flex; align-items: center; gap: 12px; margin: 0 4px 8px; flex-wrap: wrap; }
.block-head h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: var(--t-footnote); font-weight: 600; color: var(--muted); }
.block-head h3 .icon { color: var(--accent); }
.block-head .progress { flex: 1; min-inline-size: 120px; }
.block-head .progress-track { flex: 1; inline-size: auto; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden; }
.steps:empty { display: none; }
.steps:empty + .step-new { border-radius: var(--radius-lg); }
.step { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 8px; min-block-size: var(--hit); transition: background .12s; }
.step + .step::before { content: ''; position: absolute; inset-block-start: 0; inset-inline-start: 56px; inset-inline-end: 0; border-block-start: 1px solid var(--separator); }
.step:hover { background: var(--hover); }
.steps.reordering .step:not(.lifted) { transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.steps.reordering .step::before { opacity: 0; }
.step.lifted { z-index: 2; background: var(--elevated); box-shadow: var(--shadow-lg); border-radius: 12px; will-change: transform; }
.grip { position: relative; z-index: 1; color: var(--faint); cursor: grab; opacity: 0; display: grid; place-items: center; min-inline-size: 28px; min-block-size: 36px; margin-inline: -6px -4px; touch-action: none; transition: opacity .12s; }
.step.lifted .grip { cursor: grabbing; opacity: 1; }
@media (hover: none) { .grip { opacity: .7; } }
.step:hover .grip { opacity: 1; }
.step-check { position: relative; display: grid; cursor: pointer; }
.step-check::before { content: ''; position: absolute; inset: -12px; }
.step-check input { position: absolute; opacity: 0; pointer-events: none; }
.step-check .box { inline-size: 22px; block-size: 22px; border-radius: 50%; border: 1.6px solid var(--separator-strong); display: grid; place-items: center; color: transparent; transition: all .15s; }
.step-check:hover .box { border-color: var(--accent); }
.step-check input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); animation: pop .25s ease; }
.step-check input:focus-visible + .box { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.step-text { flex: 1; border: 0; background: transparent; border-radius: 6px; padding: 6px; outline: none; min-inline-size: 0; }
.step-text:focus { background: var(--fill-2); }
.step.done .step-text { color: var(--faint); text-decoration: line-through; }
.step-actions { display: flex; opacity: 0; transition: opacity .12s; }
.step:hover .step-actions, .step:focus-within .step-actions { opacity: 1; }
.step-new { display: flex; align-items: center; gap: 10px; padding: 4px 14px; min-block-size: var(--hit); color: var(--accent); background: var(--surface); border-block-start: 1px solid var(--separator); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.step-add { flex: 1; border: 0; background: transparent; padding: 8px 2px; outline: none; }
.step-add::placeholder { color: var(--faint); }
.notes { inline-size: 100%; min-block-size: 96px; border: 0; border-radius: var(--radius-lg); padding: 12px 14px; background: var(--surface); resize: vertical; line-height: 1.55; outline: none; transition: box-shadow .15s; }
.notes:focus { box-shadow: 0 0 0 3px var(--accent-tint); }

.reminders { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.reminder { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; background: var(--surface); color: var(--accent); }
.reminder.sent { color: var(--faint); }
.reminder.failed { background: var(--danger-tint); color: var(--danger); }
.reminder-body { flex: 1; color: var(--text); font-size: var(--t-callout); }
.reminder.sent .reminder-body { color: var(--muted); }
.reminder-actions { display: flex; gap: 6px; align-items: center; }
.reminder-add { background: var(--surface); border-radius: var(--radius-lg); padding: 4px 14px 12px; }
.reminder-add summary { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--accent); font-weight: 600; font-size: var(--t-callout); list-style: none; min-block-size: var(--hit); }
.reminder-add summary::-webkit-details-marker { display: none; }
.preset-row, .custom-row { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 10px; align-items: center; }
.reminder-add > .input { inline-size: 100%; }
.chip-btn { border: 0; background: var(--accent-tint); color: var(--accent); padding: 6px 13px; min-block-size: 34px; border-radius: 99px; font-size: var(--t-subhead); font-weight: 600; transition: filter .12s; }
.chip-btn:hover { filter: brightness(.96); }
.file-hint { margin-block-start: 22px; text-align: center; color: var(--muted); }

/* ---------- Settings ---------- */
.settings .settings-card { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 20px; margin-block-end: 16px; }
.settings-card header { margin-block-end: 12px; }
.settings-card h2 { display: flex; align-items: center; gap: 8px; font-size: var(--t-title3); margin: 0 0 4px; }
.settings-card h2 .icon { color: var(--accent); }
.settings-card header p { margin: 0; }
.srows { display: flex; flex-direction: column; gap: 8px; margin-block-end: 12px; }
.srow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srow .input { flex: 1; min-inline-size: 140px; }
.srow .grow { flex: 2; }
.srow.wrap { padding: 10px; background: var(--fill-2); border-radius: 12px; }
.reorder { display: flex; flex-direction: column; }
.reorder .icon-btn.small { block-size: 16px; font-size: 8px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-subhead); color: var(--muted); }
.switch-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; min-block-size: var(--hit); cursor: pointer; }
.switch-row input { inline-size: 20px; block-size: 20px; accent-color: var(--accent); }
.connection { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-weight: 600; margin-block-end: 8px; }
.connection.ok { background: var(--success-tint); color: var(--success); }
.connection.bad { background: var(--warn-tint); color: var(--warn); }
.connection .btn { margin-inline-start: auto; }
.view-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; padding: 12px; background: var(--fill-2); border-radius: 12px; }
.agent-hint { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-tint); color: var(--text); padding: 14px 16px; border-radius: var(--radius-lg); margin-block-end: 18px; line-height: 1.6; font-size: var(--t-subhead); }
.agent-hint .icon { color: var(--accent); margin-block-start: 3px; }
.json { inline-size: 100%; min-block-size: 360px; font: var(--t-footnote)/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; border: 0; border-radius: 12px; padding: 12px; background: var(--fill-2); margin: 10px 0; text-align: left; }
details > summary { cursor: pointer; color: var(--muted); font-weight: 500; }
.log ol { margin: 8px 0 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; font-size: var(--t-footnote); }

/* ---------- Palette (popover) ---------- */
.palette-overlay { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 25%); display: flex; justify-content: center; align-items: flex-start; padding-block-start: 12vh; animation: fade .15s ease; }
.palette { inline-size: min(620px, calc(100vw - 24px)); background: var(--elevated); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: rise .18s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.palette-head { display: flex; align-items: center; gap: 10px; padding: 4px 16px; border-block-end: 1px solid var(--separator); color: var(--muted); }
.palette-input { flex: 1; border: 0; outline: none; background: transparent; padding: 14px 0; font-size: var(--t-title3); }
.palette-input::placeholder { color: var(--faint); }
.palette-list { list-style: none; margin: 0; padding: 6px; max-block-size: 50vh; overflow-y: auto; }
.palette-list:empty { display: none; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-block-size: var(--hit); border-radius: 10px; cursor: pointer; }
.palette-item .icon { color: var(--accent); }
.palette-item.on { background: var(--accent); color: var(--on-accent); }
.palette-item.on .icon, .palette-item.on .palette-hint { color: var(--on-accent); }
.palette-hint { margin-inline-start: auto; color: var(--muted); font-size: var(--t-footnote); white-space: nowrap; }
.palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-block-start: 1px solid var(--separator); color: var(--muted); font-size: var(--t-caption); }
.palette.help { padding: 16px 20px 20px; }
.help-head { display: flex; justify-content: space-between; align-items: center; }
.help-head h2 { margin: 0; font-size: var(--t-title3); }
.palette.help h3 { font-size: var(--t-subhead); color: var(--muted); margin: 16px 0 8px; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 12px 0 0; align-items: center; }
.help-grid dd { margin: 0; color: var(--muted); }

/* ---------- Toasts (feedback in the interface, not alerts — HIG: feedback) ---------- */
.toasts { position: fixed; inset-block-end: 20px; inset-inline-start: 50%; transform: translateX(50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: rgb(30 30 32 / 92%); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: #F2F2F7; padding: 8px 8px 8px 14px; min-block-size: var(--hit); border-radius: 16px; box-shadow: var(--shadow-lg); font-size: var(--t-callout); max-inline-size: min(520px, calc(100vw - 32px)); transform: translateY(12px); opacity: 0; transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .25s; }
.toast.in { transform: none; opacity: 1; }
.toast { touch-action: none; user-select: none; -webkit-user-select: none; }
.toast-text { flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.toast-success .icon { color: #4CD07D; }
.toast-error { background: rgb(90 20 20 / 94%); }
.toast-action { border: 0; background: rgb(255 255 255 / 16%); color: #fff; font-weight: 700; padding: 6px 12px; min-block-size: 32px; border-radius: 10px; font-size: var(--t-subhead); }
.toast-close { border: 0; background: none; color: rgb(255 255 255 / 65%); display: grid; place-items: center; inline-size: 32px; block-size: 32px; border-radius: 8px; }

.fatal { display: grid; place-items: center; align-content: center; gap: 8px; block-size: 100vh; text-align: center; grid-column: 1 / -1; }
.scrim, .mobile-dock { display: none; }
.degraded { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 28px 0; padding: 10px 14px; border-radius: 12px; background: var(--danger-tint); color: var(--danger); font-weight: 600; font-size: var(--t-subhead); }

/* ---------- Pairing ---------- */
.pair-icon { align-self: center; border-radius: 18px; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent); }
.pair-code { inline-size: 100%; min-inline-size: 0; font: 700 var(--t-title1)/1 var(--font); letter-spacing: .4em; text-align: center; padding: 12px; border: 0; border-radius: 14px; background: var(--fill); outline: none; }
.pair-code:focus { box-shadow: 0 0 0 3px var(--accent-tint); }
.pair-msg { min-block-size: 1.5em; margin: 0; color: var(--muted); font-size: var(--t-subhead); }


/* ---------- Timeline (Gantt) — time runs right → left ---------- */
.gantt { --g-label: 210px; --g-day: 34px; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.g-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.g-inner { position: relative; min-inline-size: 100%; }
.g-row { display: grid; align-items: center; min-block-size: 40px; position: relative; }
.g-label { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--surface); padding: 6px 12px; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; text-align: start; font-size: var(--t-subhead); color: var(--text); box-shadow: -1px 0 0 var(--separator); align-self: stretch; display: flex; align-items: center; gap: 6px; }
.g-label bdi { overflow: hidden; text-overflow: ellipsis; }
.g-corner { background: var(--surface); }
.g-months { min-block-size: 26px; }
.g-month { font-size: var(--t-caption); font-weight: 700; color: var(--muted); padding-inline: 6px; white-space: nowrap; }
.g-days { min-block-size: 44px; border-block-end: 1px solid var(--separator); }
.g-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; block-size: 100%; font-size: var(--t-caption); color: var(--muted); }
.g-day.weekend { background: var(--fill-2); }
.g-day.week-start { box-shadow: inset -1px 0 0 var(--separator); }
.g-day.is-today { color: var(--accent); font-weight: 700; }
.g-day.is-today .g-num { background: var(--accent); color: var(--on-accent); border-radius: 99px; padding: 0 6px; }
.g-num { font-size: var(--t-footnote); font-weight: 600; color: var(--text); }
.g-today-line { position: absolute; inset-block: 26px 0; inline-size: 2px; background: var(--accent); opacity: .5; z-index: 1; pointer-events: none; }
.g-group + .g-group { border-block-start: 1px solid var(--separator); }
.g-project { min-block-size: 44px; background: var(--fill-2); }
.g-project .g-label { background: var(--fill-2); font-weight: 700; color: var(--text); }
.g-plabel .g-count { margin-inline-start: auto; color: var(--muted); font-weight: 500; font-size: var(--t-footnote); }
.g-tlabel { cursor: pointer; color: var(--muted); }
.g-tlabel:hover { color: var(--text); }
.g-bar { position: relative; z-index: 1; block-size: 26px; margin: 0 2px; border: 0; border-radius: 8px; background: var(--ct); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); color: var(--c); font-size: var(--t-caption); font-weight: 600; text-align: start; padding: 0 8px; overflow: hidden; cursor: pointer; }
.g-bar-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-bar.single { border-radius: 50%; inline-size: 18px; block-size: 18px; justify-self: center; padding: 0; background: var(--c); }
.g-bar.single .g-bar-text { display: none; }
.g-bar.overdue { background: var(--danger-tint); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.g-bar.overdue.single { background: var(--danger); }
.g-bar.done { opacity: .45; }
.g-bar.cut-start { border-start-start-radius: 0; border-end-start-radius: 0; }
.g-bar.cut-end { border-start-end-radius: 0; border-end-end-radius: 0; }
.g-milestone { position: relative; z-index: 1; display: flex; align-items: center; gap: 4px; justify-self: start; border: 0; background: none; padding: 0; color: var(--c); font-size: var(--t-caption); font-weight: 700; white-space: nowrap; cursor: pointer; }
.g-mlabel { background: var(--surface); padding: 1px 6px; border-radius: 6px; box-shadow: var(--shadow-sm); }
.g-milestone.done { opacity: .5; }
.g-diamond { display: inline-block; flex: none; inline-size: 11px; block-size: 11px; background: var(--c, var(--accent)); transform: rotate(45deg); border-radius: 2px; margin-inline: 4px; }
.g-due { position: relative; z-index: 1; justify-self: center; color: var(--c); }
.g-undated { min-block-size: 0; padding-block: 6px; }
.g-ulabel { color: var(--muted); font-size: var(--t-footnote); }
.g-undated-list { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; padding-inline: 6px; }
.g-chip { flex: none; max-inline-size: 220px; border: 1px dashed var(--separator-strong); background: transparent; color: var(--muted); border-radius: 8px; padding: 3px 9px; font-size: var(--t-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.agenda-milestone { display: flex; align-items: center; gap: 6px; color: var(--c); font-weight: 600; font-size: var(--t-subhead); padding: 6px 4px; }

/* Single-line labels and titles keep the interface's alignment even when their text is English
   (HIG: right to left: consistent alignment for all items in a list); paragraphs (notes) follow their language. */
.title-input, .drawer-title, .goal-input, .step-text, .qa-input, .search-input, .palette-input, .input, .tag-input, .step-add { text-align: right; }
.view-head h1, .row-title, .card-title, .project-card h3 { text-align: right; }

/* ---------- Project goals ---------- */
.goal-card { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 16px; margin-block-end: 18px; border-inline-start: 4px solid var(--c); }
.goal-top { display: flex; align-items: center; gap: 10px; color: var(--c); }
.goal-input { flex: 1; border: 0; background: transparent; font-size: var(--t-title3); font-weight: 600; color: var(--text); padding: 4px 6px; border-radius: 8px; outline: none; min-inline-size: 0; }
.goal-input:focus { background: var(--fill-2); }
.goal-input::placeholder { color: var(--faint); font-weight: 500; }
.goal-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 10px 0 6px; font-size: var(--t-subhead); color: var(--muted); }
.goal-due { display: inline-flex; align-items: center; gap: 6px; }
.goal-due .date-input { min-block-size: 32px; padding: 3px 8px; }
.goal-progress { display: inline-flex; align-items: center; gap: 8px; flex: 1; min-inline-size: 160px; }
.goal-progress .progress-track { flex: 1; }
.goal-progress .progress-fill { background: var(--c); }
.milestones { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.milestone { display: flex; align-items: center; gap: 8px; min-block-size: var(--hit); border-block-start: 1px solid var(--separator); }
.milestone .g-diamond { background: var(--c); }
.milestone-title { flex: 1; min-inline-size: 0; }
.milestone-date { color: var(--muted); font-size: var(--t-footnote); }
.milestone.done .milestone-title { color: var(--faint); text-decoration: line-through; }
.milestone.late .milestone-date { color: var(--danger); font-weight: 600; }
.milestone-new { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-block-start: 10px; border-block-start: 1px solid var(--separator); }
.milestone-new .input { flex: 1; min-inline-size: 140px; }
.project-goal { display: flex; gap: 6px; align-items: center; font-size: var(--t-subhead); color: var(--text); }
.project-goal .icon { color: var(--c); }
.project-dates { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.project-dates > span { display: inline-flex; align-items: center; gap: 4px; }
.project-dates .g-diamond { inline-size: 8px; block-size: 8px; background: var(--c); }
@media (max-width: 820px) { .gantt { --g-label: 132px; --g-day: 30px; margin-inline: -16px; border-radius: 0; } }


/* ---------- Projects list ---------- */
.project-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-block-size: 64px; background: var(--surface); }
.project-row + .project-row::before { content: ''; position: absolute; inset-block-start: 0; inset-inline-start: 62px; inset-inline-end: 0; border-block-start: 1px solid var(--separator); }
.project-row:hover { background: var(--hover); }
.project-ring { flex: none; inline-size: 30px; block-size: 30px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--pct) * 1%), color-mix(in srgb, var(--c) 22%, transparent) 0); -webkit-mask: radial-gradient(circle, transparent 9px, #000 10px); mask: radial-gradient(circle, transparent 9px, #000 10px); }
.project-main { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: 3px; }
.project-name { font-weight: 600; font-size: var(--t-body); display: flex; align-items: center; gap: 8px; text-align: right; }
.project-row .project-goal { font-size: var(--t-subhead); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row .project-goal.muted { color: var(--muted); }
.project-chevron { color: var(--faint); transform: scaleX(1); }
.project-new { display: flex; align-items: center; gap: 10px; margin-block-start: 14px; padding: 6px 8px 6px 14px; background: var(--surface); border-radius: var(--radius-lg); color: var(--accent); }
.project-new input { flex: 1; border: 0; background: transparent; outline: none; padding: 8px 0; min-inline-size: 0; text-align: right; }
/* ---------- Phone board ---------- */
.status-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--surface); color: var(--text); border-radius: 99px; padding: 7px 14px; min-block-size: 38px; font-size: var(--t-subhead); font-weight: 500; }
.status-tab.on { background: var(--ct); color: var(--c); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--c); }
.status-tab-count { color: var(--muted); font-weight: 600; }
.status-tab.on .status-tab-count { color: var(--c); }
/* ---------- Sheet summary ---------- */
.props-wrap { margin: 14px 0 6px; }
.props-wrap > summary { list-style: none; }
.props-wrap > summary::-webkit-details-marker { display: none; }
.props-summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-block-size: var(--hit); background: var(--surface); border-radius: var(--radius-lg); cursor: pointer; }
.props-wrap[open] > .props-summary { display: none; }
.props-line { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--t-subhead); color: var(--muted); min-inline-size: 0; }
.props-edit { color: var(--accent); font-weight: 600; font-size: var(--t-subhead); }
.props-wrap .props { margin: 0; }
/* selected chips: tint + ring, readable in dark mode too */
.mini.on, .status-chip.on { box-shadow: inset 0 0 0 1.5px var(--c, var(--accent)); font-weight: 700; }
.icon.flip-x { transform: scaleX(-1); }
/* sections jumped to stay clear of the sticky top bar */
.group, .goal-card { scroll-margin-block-start: 80px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  /* minmax(0,…): a long single-line title must never widen the column past the screen */
  .today { grid-template-columns: minmax(0, 1fr); }
  .today-aside { position: static; max-block-size: none; padding-block-start: 0; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (min-width: 821px) { .large-title h1 { font-size: var(--t-title1); } }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .desk-only, .hide-sm { display: none !important; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; inline-size: 300px; z-index: 30; transform: translateX(100%); visibility: hidden; touch-action: pan-y; will-change: transform; padding-block-start: max(18px, env(safe-area-inset-top)); }
  /* The shadow only exists while open — off-screen it bled into the right edge of every page. */
  /* Position is driven by a spring in app.js (paintNav); CSS only supplies the resting states. */
  .nav-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgb(0 0 0 / 30%); touch-action: none; }
  .nav-item { min-block-size: var(--hit); font-size: var(--t-body); }
  .icon-btn.menu-btn { display: inline-grid; }
  .icon-btn { inline-size: var(--hit); block-size: var(--hit); }
  .icon-btn.small { inline-size: 36px; block-size: 36px; }
  /* Installed on iPhone: keep clear of the Dynamic Island and the home indicator. */
  .topbar { padding: max(8px, env(safe-area-inset-top)) 12px 8px; }
  .view-host { padding: 4px 16px calc(110px + env(safe-area-inset-bottom)); }
  /* iOS zooms into any focused field under 16px. */
  input, select, textarea { font-size: max(16px, 1rem); }
  .today-aside { grid-template-columns: 1fr; }
  .panel.is-empty { display: none; }
  .view-head h1 { font-size: var(--t-title1); }
  .row { padding: 12px 14px; }
  .row .row-id, .card .row-id { display: none; }
  .mini, .seg, .status-chip, .chip-btn { min-block-size: 38px; }
  .btn.small { min-block-size: 38px; }
  .column { flex-basis: 86vw; max-block-size: none; }
  .agenda-day { grid-template-columns: 1fr; gap: 6px; }
  .agenda-date { flex-direction: row; align-items: baseline; gap: 8px; padding-block-start: 0; }
  .step-actions, .grip { opacity: 1; }
  .srow .select { flex: 1; min-inline-size: 120px; }
  .settings .settings-card { padding: 16px 14px; }
  .degraded { margin: 10px 16px 0; }

  /* Task detail = bottom sheet with a grabber; swipe the header down to dismiss (HIG: sheets). */
  .drawer-host { align-items: flex-end; }
  .drawer { inline-size: 100vw; block-size: calc(100% - max(12px, env(safe-area-inset-top))); border-radius: 14px 14px 0 0; overflow: hidden; }
  .drawer-head { padding: 18px 10px 8px; touch-action: none; }
  .grabber { display: block; position: absolute; inset-block-start: 6px; inset-inline-start: 50%; transform: translateX(50%); inline-size: 36px; block-size: 5px; border-radius: 3px; background: var(--separator-strong); }
  .drawer-scroll { padding: 14px 16px calc(40px + env(safe-area-inset-bottom)); }
  .props { grid-template-columns: 1fr; }
  .prop { display: flex; flex-direction: column; border-block-end: 1px solid var(--separator); }
  .prop:last-child { border-block-end: 0; }
  .prop-label { min-block-size: 0; padding: 10px 14px 0; border: 0; }
  .prop-value { min-block-size: 0; padding: 8px 14px 12px; border: 0; }

  /* Tab bar: a floating glass capsule of four tabs; "new task" is its own round control beside it. */
  .mobile-dock { display: flex; align-items: center; gap: 10px; position: fixed; inset-inline: 12px; inset-block-end: max(10px, env(safe-area-inset-bottom)); z-index: 15; }
  .mobile-nav { flex: 1; display: flex; justify-content: space-around; padding: 6px; border-radius: 30px; background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
  .mnav { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-block-size: 50px; font-size: var(--t-caption); font-weight: 600; color: var(--text); border-radius: 24px; }
  .mnav .icon { color: var(--text); }
  .mnav.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .mnav.active .icon { color: var(--accent); }
  .mnav-count { position: absolute; inset-block-start: 2px; inset-inline-end: calc(50% - 22px); min-inline-size: 20px; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; background: var(--badge); color: #fff; border-radius: 99px; padding: 0 5px; }
  .dock-add { flex: none; display: grid; place-items: center; inline-size: 62px; block-size: 62px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px -6px color-mix(in srgb, var(--accent) 60%, transparent); }
  .dock-add:active { transform: scale(.95); }
  .toasts { inset-block-end: calc(92px + env(safe-area-inset-bottom)); }
}
/* Reduce Transparency / Increase Contrast: opaque bars instead of glass (HIG: liquid glass checklist 5). */
@media (prefers-reduced-transparency: reduce) {
  .topbar, .mobile-nav, .drawer-head, .toast { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
  .toast { background: #1E1E20; }
}
@media (prefers-contrast: more) {
  .topbar, .mobile-nav, .drawer-head { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); border-color: var(--separator); }
  .rows, .panel, .settings-card, .props, .steps, .qa-row { box-shadow: 0 0 0 1px var(--separator); }
}
/* Reduced motion keeps gentle, non-vestibular feedback (Apple motion guidance §14): fades and colour changes stay, movement goes. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-property: opacity, color, background-color, border-color, box-shadow !important; scroll-behavior: auto !important; } }

/* ---- Work type + "זמן פנוי" ---- */
.meta-item.kind { color: var(--muted); }
.meta-item.kind-solo { color: var(--accent); }
.focus-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; inline-size: 100%; margin-block-end: 22px; padding: 18px 20px; border: 0; border-radius: var(--radius-xl); background: linear-gradient(135deg, #2F6BF0, #5AA8F5); color: #fff; text-align: start; box-shadow: var(--shadow); }
.focus-hero:active { transform: scale(.99); transition: transform 80ms ease-out; }
.focus-hero-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-footnote); font-weight: 600; opacity: .9; }
.focus-hero-title { font-size: var(--t-title2); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.focus-hero-why { font-size: var(--t-subhead); opacity: .92; }
.focus-hero-step { margin-block-start: 4px; padding: 7px 11px; border-radius: 10px; background: rgb(255 255 255 / 16%); font-size: var(--t-subhead); }
.focus-item { position: relative; background: var(--surface); }
.focus-item + .focus-item { border-block-start: 1px solid var(--separator); }
.focus-why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 16px 12px; padding-inline-start: 50px; margin-block-start: -4px; }
.why-chip { padding: 2px 8px; border-radius: 99px; background: var(--fill); color: var(--muted); font-size: var(--t-caption); font-weight: 600; }
.focus-step { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--t-caption); min-inline-size: 0; }
.classify-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; background: var(--surface); }
.classify-row + .classify-row { border-block-start: 1px solid var(--separator); }
.classify-title { flex: 1 1 200px; min-inline-size: 0; border: 0; background: none; padding: 4px 0; text-align: start; color: var(--text); font-size: var(--t-callout); }
.classify-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.classify-kinds .chip-btn { display: inline-flex; align-items: center; gap: 4px; min-block-size: 32px; padding: 4px 10px; background: var(--fill); color: var(--text); }
@media (prefers-color-scheme: dark) { .focus-hero { background: linear-gradient(135deg, #1E4FC2, #2E7BD6); } }

/* ---- Date sub-headers inside lists and board columns ---- */
.subhead { display: flex; align-items: baseline; gap: 6px; padding: 10px 16px 4px; background: var(--fill-2); color: var(--muted); font-size: var(--t-footnote); font-weight: 600; letter-spacing: .01em; }
.subhead .num { font-weight: 500; opacity: .75; }
.subhead.tone-danger { color: var(--danger); }
.rows > .subhead:first-child { border-start-start-radius: var(--radius-lg); border-start-end-radius: var(--radius-lg); }
.column-body .subhead { background: transparent; padding: 8px 4px 2px; }
.column-body .subhead:first-child { padding-block-start: 0; }
.meta-item.people { gap: 2px; }
.person-link { position: relative; border: 0; background: none; padding: 0 3px; color: var(--accent); font: inherit; font-weight: 500; border-radius: 6px; }
.person-link::before { content: ''; position: absolute; inset: -10px -2px; } /* 44px-tall hit area without growing the row */
.person-link:active { background: var(--accent-tint); }

/* ---- "Next" with its reason; end-of-day close ---- */
.day-next-text { flex: 1; display: flex; flex-direction: column; min-inline-size: 0; }
.day-next-why { font-size: var(--t-footnote); font-weight: 500; opacity: .85; }
.close-day { margin-block-end: 18px; padding: 14px 16px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.close-day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 8px; }
.close-day-head h2 { margin: 0; font-size: var(--t-body); font-weight: 700; }
.close-day-head p { margin: 2px 0 0; }
.close-day-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; padding: 6px 0; border-block-start: 1px solid var(--separator); }
.close-day-title { flex: 1 1 180px; min-inline-size: 0; border: 0; background: none; padding: 6px 0; text-align: start; color: var(--text); font-size: var(--t-callout); }
.close-day-actions { display: flex; gap: 6px; }
.close-day-actions .mini { position: relative; min-block-size: 32px; padding: 3px 11px; font-size: var(--t-footnote); }
.close-day-actions .mini::before { content: ''; position: absolute; inset: -6px -2px; } /* 44px hit area */
.close-day .row-more { border-radius: 10px; margin-block-start: 4px; }
.panel-more { margin-inline-start: auto; font-size: var(--t-footnote); }
.feed-page { margin: 0; padding: 0 0 4px; list-style: none; background: var(--surface); border-radius: var(--radius-lg); }
.feed-page .feed-item { padding: 10px 16px; }
.feed-page .feed-item + .feed-item { border-block-start: 1px solid var(--separator); }

/* Touch targets ≥44px without changing the look: invisible hit areas (UX guidelines, HIG accessibility). */
.tag.removable button { position: relative; }
.tag.removable button::before { content: ''; position: absolute; inset: -14px; }
.toast-close, .toast-action { position: relative; min-block-size: var(--hit); }
.group-title { min-block-size: var(--hit); }
@media (pointer: coarse) { .notes { resize: none; } }
.today-modes { margin-block-end: 16px; }
.today-modes .seg { text-decoration: none; }
.focus-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-block-end: 16px; }
.focus-controls .view-sub { margin: 0; }

/* ---- Row actions: "⋯" button + action sheet ---- */
.row-menu { position: relative; flex: none; align-self: center; display: grid; place-items: center; inline-size: 30px; block-size: 30px; margin-inline-end: -6px; border: 0; border-radius: 8px; background: transparent; color: var(--faint); }
.row-menu::before { content: ''; position: absolute; inset: -7px; }
.row-menu:hover { background: var(--hover); color: var(--text); }
.row-menu:active { background: var(--fill); }
.as-host { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgb(0 0 0 / 28%); animation: fade .15s ease; }
.action-sheet { inline-size: min(380px, calc(100vw - 24px)); max-block-size: min(80vh, 640px); overflow-y: auto; padding: 8px 8px 12px; background: var(--elevated); border-radius: 16px; box-shadow: var(--shadow-lg); animation: rise .18s cubic-bezier(.2,.8,.2,1); }
.as-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px; }
.as-task { flex: 1; min-inline-size: 0; font-weight: 700; font-size: var(--t-callout); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.as-open { display: flex; align-items: center; gap: 8px; inline-size: 100%; min-block-size: var(--hit); padding: 0 12px; border: 0; border-radius: 10px; background: var(--fill); color: var(--accent); font-weight: 600; }
.as-group { margin-block-start: 10px; }
.as-title { padding: 0 10px 4px; color: var(--muted); font-size: var(--t-footnote); font-weight: 600; }
.as-group { display: flex; flex-direction: column; }
.as-item { position: relative; display: flex; align-items: center; gap: 10px; min-block-size: var(--hit); padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: start; font-size: var(--t-body); }
.as-item:hover, .as-item:focus-visible { background: var(--hover); }
.as-item .icon { color: var(--muted); }
.as-item.current { color: var(--muted); }
.as-item.current::after { content: '✓'; margin-inline-start: auto; color: var(--accent); }
.as-item.tone-success .icon { color: var(--success); }
.as-pick .as-date { position: absolute; inset: 0; opacity: 0; inline-size: 100%; cursor: pointer; }
@media (max-width: 820px) {
  .as-host { align-items: flex-end; }
  .action-sheet { inline-size: 100%; max-block-size: 82vh; border-radius: 20px 20px 0 0; padding-block-end: max(16px, env(safe-area-inset-bottom)); animation: sheet-up .28s cubic-bezier(.2,.8,.2,1); }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

/* ---- Task sheet as a work surface ---- */
.work-bar { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 16px; padding: 12px; background: var(--surface); border-radius: var(--radius-lg); }
.work-row { display: flex; align-items: center; gap: 10px; }
.work-btn { min-block-size: var(--hit); padding-inline: 18px; font-size: var(--t-body); }
.work-btn.done { background: var(--success); color: #fff; }
.next-step { display: flex; align-items: center; gap: 10px; inline-size: 100%; min-block-size: var(--hit); padding: 6px 10px; border: 0; border-radius: 10px; background: var(--fill); color: var(--text); text-align: start; }
.next-step-box { flex: none; display: grid; place-items: center; inline-size: 22px; block-size: 22px; border-radius: 50%; border: 1.6px solid var(--separator-strong); color: transparent; }
.next-step:hover .next-step-box { border-color: var(--accent); color: var(--accent); }
.next-step-text { min-inline-size: 0; }
.effort-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.time-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-block-end: 14px; }
.time-chip { background: var(--fill); color: var(--text); }
.time-chip.on { background: var(--accent); color: var(--on-accent); }

.as-chip-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px; }
.as-chips .as-item { flex: 0 0 auto; padding: 0 12px; background: var(--fill); border-radius: 99px; font-size: var(--t-callout); gap: 6px; }
.as-chips .as-item .icon { inline-size: 16px; block-size: 16px; }
.as-chips .as-item.current { background: var(--accent-tint); color: var(--accent); }
.as-chips .as-item.current::after { content: none; }
.mnav-count.neutral { background: var(--fill); color: var(--text); }
.time-bar .chip-btn { min-block-size: 34px; padding: 4px 11px; }

/* ---- Schedule (לו״ז) ---- */
.schedule { margin-block-end: 18px; padding: 12px 14px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.schedule-head { display: flex; align-items: center; justify-content: space-between; margin-block-end: 6px; }
.schedule-head h2 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: var(--t-body); font-weight: 700; }
.schedule-head .count { color: var(--muted); font-weight: 500; font-size: var(--t-footnote); }
.schedule.is-empty p { margin: 4px 0 2px; }
.ev-list, .work-schedule { display: flex; flex-direction: column; gap: 2px; }
.ev { display: flex; align-items: flex-start; gap: 12px; inline-size: 100%; padding: 8px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: start; }
.ev:hover { background: var(--hover); }
.ev-time { flex: none; display: flex; flex-direction: column; align-items: flex-end; min-inline-size: 46px; font-weight: 700; font-size: var(--t-callout); }
.ev-day { font-size: var(--t-caption); font-weight: 600; color: var(--muted); }
.ev-end { font-size: var(--t-caption); font-weight: 500; color: var(--muted); }
/* An item's colour is its space (work blue, personal violet, home teal) — fixed, whatever context you're in.
   A meeting is a solid bar; blocked work time is the same hue as a tinted block. */
.ev { --sp: #1D4FE0; --sp-tint: rgb(29 79 224 / 10%); }
.ev.ev-sp-personal { --sp: #6B35C9; --sp-tint: rgb(107 53 201 / 11%); }
.ev.ev-sp-home { --sp: #0A7266; --sp-tint: rgb(10 114 102 / 11%); }
@media (prefers-color-scheme: dark) {
  .ev { --sp: #6E95FF; --sp-tint: rgb(110 149 255 / 16%); }
  .ev.ev-sp-personal { --sp: #B794FF; --sp-tint: rgb(183 148 255 / 16%); }
  .ev.ev-sp-home { --sp: #4FD1BE; --sp-tint: rgb(79 209 190 / 16%); }
}
.ev-body { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; padding-inline-start: 10px; border-inline-start: 3px solid var(--sp); }
.ev-work .ev-body { background: var(--sp-tint); border-radius: 0 8px 8px 0; padding-block: 3px; padding-inline-end: 8px; }
.ev-other .ev-body { border-inline-start-style: dotted; }
.ev-title .icon { color: var(--sp) !important; }
.ev-title { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.ev-title .icon { color: var(--muted); flex: none; }
.ev-meta { color: var(--muted); font-size: var(--t-footnote); }
.ev.past { opacity: .55; }
.ev.live .ev-body { background: var(--sp-tint); border-radius: 0 8px 8px 0; padding-block: 2px; box-shadow: inset 0 0 0 1px var(--sp); }
.ev-now { padding: 1px 7px; border-radius: 99px; background: var(--sp); color: #fff; font-size: var(--t-caption); font-weight: 700; }
.ev-past-note { margin: 4px 6px 0; }
.agenda-items .ev { background: var(--surface); border-radius: 12px; }
.work-schedule .link-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; min-block-size: 36px; }
.ev-detail { display: flex; flex-direction: column; gap: 8px; padding: 4px 10px 12px; }
.ev-detail > div { display: flex; align-items: center; gap: 8px; }
.ev-detail .icon { color: var(--muted); }
.ev-actions { margin-block-start: 10px; }
.as-item.tone-danger, .as-item.tone-danger .icon { color: var(--danger); }
.ev-form { display: flex; flex-direction: column; gap: 10px; padding: 4px 8px 6px; }
.ev-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-inline-size: 0; font-size: var(--t-footnote); color: var(--muted); }
.ev-field .input, .ev-field .select, .ev-field .date-input { inline-size: 100%; color: var(--text); }
.ev-row { display: flex; gap: 8px; }

/* ---- Contexts (עבודה / אישי / בית / הכל): one colour per context, applied to the whole app ---- */
/* The accent is the context: work keeps the app blue; personal is violet; home is teal. Contrast ≥ 4.5:1 on white/black. */
body[data-ctx="personal"] { --accent: #6B35C9; --accent-hover: #5A2BAE; --accent-tint: #EFE7FC; --on-accent: #FFFFFF; }
body[data-ctx="home"] { --accent: #0A7266; --accent-hover: #085E54; --accent-tint: #E0F3EF; --on-accent: #FFFFFF; }
/* "הכל" is every context at once: Apple's indigo for controls (between work blue and personal violet), and a
   multicolour card — the three context colours together — instead of a neutral grey that reads as disabled. */
body[data-ctx="all"] { --accent: #5856D6; --accent-hover: #4846B8; --accent-tint: #ECEBFB; --on-accent: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  body[data-ctx="personal"] { --accent: #B794FF; --accent-hover: #C9AEFF; --accent-tint: #2F2645; --on-accent: #000000; }
  body[data-ctx="home"] { --accent: #4FD1BE; --accent-hover: #74DCCC; --accent-tint: #1B3532; --on-accent: #000000; }
  body[data-ctx="all"] { --accent: #7D7AFF; --accent-hover: #9A98FF; --accent-tint: #2A2A4A; --on-accent: #000000; }
}
/* Today's card takes the context's colour too. */
body[data-ctx="personal"] .day-card { background: linear-gradient(135deg, #8B5CF6 0%, #6B35C9 55%, #4C1D95 100%); }
body[data-ctx="home"] .day-card { background: linear-gradient(135deg, #14B8A6 0%, #0A7266 55%, #064E46 100%); }
body[data-ctx="all"] .day-card { background: radial-gradient(90% 120% at 100% 0%, rgb(20 184 166 / 75%) 0%, transparent 60%), radial-gradient(90% 120% at 0% 100%, rgb(139 92 246 / 85%) 0%, transparent 65%), linear-gradient(150deg, #1D4FE0 0%, #4338CA 55%, #3730A3 100%); }

.ctx-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-block-size: 40px; padding: 0 12px 0 10px; border: 0; border-radius: 99px; background: var(--accent-tint); color: var(--accent); font: 600 var(--t-subhead)/1 var(--font); cursor: pointer; }
.ctx-chip .ctx-caret { opacity: .7; }
.ctx-chip .ctx-auto { padding: 2px 6px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 16%, transparent); font-size: var(--t-caption); font-weight: 600; }
.ctx-chip:active { transform: scale(.97); }
.ctx-sheet { padding-block-end: max(10px, env(safe-area-inset-bottom)); }
.ctx-list { display: flex; flex-direction: column; padding: 2px 8px 6px; }
.ctx-row { display: flex; align-items: center; gap: 12px; min-block-size: 60px; padding: 8px 10px; border: 0; border-radius: 14px; background: transparent; color: var(--text); text-align: start; cursor: pointer; }
.ctx-row:hover { background: var(--hover); }
.ctx-row.on { background: var(--fill-2); }
.ctx-row-icon { flex: none; display: grid; place-items: center; inline-size: 38px; block-size: 38px; border-radius: 11px; color: #fff; background: #5F5F66; }
.ctx-row.ctx-work .ctx-row-icon { background: #1D4FE0; }
.ctx-row.ctx-personal .ctx-row-icon { background: #6B35C9; }
.ctx-row.ctx-home .ctx-row-icon { background: #0A7266; }
.ctx-row.ctx-all .ctx-row-icon { background: conic-gradient(from 200deg, #1D4FE0, #6B35C9, #0A7266, #1D4FE0); }
.ctx-row-text { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.ctx-row-label { font-size: var(--t-body); font-weight: 600; }
.ctx-row-desc { color: var(--muted); font-size: var(--t-footnote); }
.ctx-row-count { color: var(--muted); font-size: var(--t-subhead); }
.ctx-row-check { color: var(--text); }
.ctx-sep { block-size: 1px; margin: 6px 12px; background: var(--separator); }
.space-chip { font-weight: 600; }
.space-chip.space-home { color: #0A7266; }
.space-chip.space-personal { color: #6B35C9; }
.space-chip.space-work { color: var(--muted); }
@media (prefers-color-scheme: dark) { .space-chip.space-home { color: #4FD1BE; } .space-chip.space-personal { color: #B794FF; } }
@media (max-width: 820px) { .topbar .ctx-name { max-inline-size: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* ---- Shopping card on Today (home / personal) ---- */
.shop-card { display: flex; align-items: center; gap: 10px; margin-block-end: 18px; padding: 10px 12px 10px 14px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.shop-card-main { flex: 1; min-inline-size: 0; display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-block-size: 44px; }
.shop-card-icon { flex: none; display: grid; place-items: center; inline-size: 38px; block-size: 38px; border-radius: 11px; background: var(--accent-tint); color: var(--accent); }
.shop-card-text { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; }
.shop-card-title { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.shop-card-count { padding: 1px 7px; border-radius: 99px; background: var(--fill); font-size: var(--t-footnote); }
.shop-card-sub { color: var(--muted); font-size: var(--t-footnote); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-card-chevron { flex: none; color: var(--faint); }
.shop-card-go { flex: none; display: inline-flex; align-items: center; gap: 5px; min-block-size: 36px; border-radius: 99px; background: var(--accent); color: var(--on-accent); border: 0; padding-inline: 12px; font-weight: 600; }

/* ---- Pairing: full screen on the phone, one step at a time ---- */
.pair { position: fixed; inset: 0; overflow-y: auto; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); background: var(--bg); }
.pair-body { margin: auto; inline-size: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-block: 24px 10vh; }
@media (min-width: 821px) { .pair-body { background: var(--surface); border-radius: var(--radius-xl); padding: 36px 32px; box-shadow: var(--shadow-sm); } }
.pair h1 { margin: 8px 0 0; font-size: var(--t-title1); line-height: 1.2; }
.pair-lead { margin: 0 0 8px; color: var(--muted); font-size: var(--t-callout, 16px); line-height: 1.45; max-inline-size: 30ch; }
.pair-people { align-self: stretch; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); }
.pair-person { display: flex; align-items: center; gap: 14px; min-block-size: 64px; padding: 10px 16px; border: 0; background: transparent; color: var(--text); text-align: start; font: 600 var(--t-body)/1.2 var(--font); cursor: pointer; }
.pair-person + .pair-person { border-block-start: 1px solid var(--separator); }
.pair-person:active { background: var(--hover); }
.pair-name { flex: 1; }
.pair-chevron { color: var(--faint); }
.pair-avatar { display: grid; place-items: center; inline-size: 42px; block-size: 42px; border-radius: 50%; color: #fff; font-size: 18px; font-weight: 700; }
.pair-avatar.av-0 { background: #1D4FE0; } .pair-avatar.av-1 { background: #A8215F; } .pair-avatar.av-2 { background: #0A7266; } .pair-avatar.av-3 { background: #6B35C9; }
.pair-wa { display: grid; place-items: center; inline-size: 64px; block-size: 64px; border-radius: 18px; background: #1E7A36; color: #fff; }
.pair-send { align-self: stretch; min-block-size: 50px; font-size: var(--t-body); justify-content: center; gap: 8px; }
.pair-code { inline-size: 100%; font: 700 32px/1 var(--font); letter-spacing: .35em; text-indent: .35em; text-align: center; padding: 14px; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); outline: none; box-shadow: inset 0 0 0 1px var(--separator); }
.pair-code::placeholder { color: var(--faint); opacity: .5; }
.pair-code:focus { box-shadow: 0 0 0 3px var(--accent-tint), inset 0 0 0 1px var(--accent); }
.pair-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-block-size: 44px; }
.pair-msg.danger { color: var(--danger); }

/* ---- Shopping list ---- */
.shopping .shop-add { display: flex; align-items: center; gap: 10px; padding: 2px 14px; min-block-size: 48px; background: var(--surface); border-radius: var(--radius-lg); margin-block-end: 12px; color: var(--accent); }
.shopping .shop-add:focus-within { box-shadow: 0 0 0 3px var(--accent-tint); }
.shop-recent { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-block-end: 16px; }
.shop-recent .chip-btn { background: var(--fill); color: var(--text); font-weight: 500; min-block-size: 32px; padding: 4px 11px; }
.shop-group { margin-block-end: 12px; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.shop-dept { border-radius: 0; }
.shop-rows { display: flex; flex-direction: column; }
.shop-swipe + .shop-swipe .shop-row { border-block-start: 1px solid var(--separator); }
.shop-swipe .shop-row { background: var(--surface); }
.shop-row { display: flex; align-items: center; gap: 12px; min-block-size: var(--hit, 44px); padding: 4px 6px 4px 16px; padding-inline-start: 16px; border-block-start: 1px solid var(--separator); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.shop-rows .shop-row { border-block-start: 0; }
.shop-row:active { background: var(--hover); }
.shop-check { flex: none; display: grid; place-items: center; inline-size: 24px; block-size: 24px; border-radius: 50%; border: 1.8px solid var(--separator-strong); color: var(--on-accent); transition: background .15s, border-color .15s; }
.shop-row.done .shop-check { background: var(--success); border-color: var(--success); color: #fff; }
.shop-text { flex: 1; min-inline-size: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: var(--t-body); }
.shop-qty { padding: 1px 7px; border-radius: 99px; background: var(--fill); color: var(--text); font-size: var(--t-footnote); font-weight: 600; }
.shop-note { color: var(--muted); font-size: var(--t-footnote); }
.shop-row.done .shop-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--separator-strong); }
.shop-group.cart { opacity: .85; }
.shop-finish { position: sticky; inset-block-end: 12px; display: flex; justify-content: center; padding-block: 8px; z-index: 2; }
.shop-finish .btn { min-block-size: 48px; padding-inline: 22px; border-radius: 99px; box-shadow: var(--shadow); font-size: var(--t-body); }
@media (max-width: 820px) { .shop-finish { inset-block-end: calc(84px + env(safe-area-inset-bottom)); } }
/* In the store: bigger targets for one hand and a moving cart, nothing else on the way. */
.in-store .shop-row.big { min-block-size: 58px; gap: 14px; }
.in-store .shop-row.big .shop-check { inline-size: 30px; block-size: 30px; }
.in-store .shop-row.big .shop-text { font-size: calc(var(--t-body) + 2px); }
.in-store .shop-dept { font-size: var(--t-subhead); padding-block: 12px 6px; }
.shop-sheet .as-chip-row.wrap { padding: 4px 12px 10px; }
.shop-sheet .as-chip-row .chip-btn { background: var(--fill); color: var(--text); font-weight: 500; }
.shop-sheet .as-chip-row .chip-btn.on { background: var(--accent); color: var(--on-accent); }
.as-label { padding: 8px 18px 4px; color: var(--muted); font-size: var(--t-footnote); font-weight: 600; }
body[data-ctx="personal"] .day-card { box-shadow: 0 12px 30px -10px rgb(107 53 201 / 50%); }
body[data-ctx="home"] .day-card { box-shadow: 0 12px 30px -10px rgb(10 114 102 / 50%); }
body[data-ctx="all"] .day-card { box-shadow: 0 12px 30px -10px rgb(67 56 202 / 50%); }
body[data-ctx="personal"] .day-next-label { color: #5A2BAE; }
body[data-ctx="home"] .day-next-label { color: #085E54; }
body[data-ctx="all"] .day-next-label { color: #3730A3; }
.shop-swipe .shop-row { touch-action: pan-y; }
.shop-lists { display: flex; inline-size: 100%; margin-block-end: 12px; }
.shop-lists .seg { flex: 1; justify-content: center; gap: 6px; }
.seg-count { padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); font-size: var(--t-caption); font-weight: 600; }
.shop-gift { padding: 1px 7px; border-radius: 99px; background: #FCE7F3; color: #9D174D; font-size: var(--t-footnote); font-weight: 600; }
@media (prefers-color-scheme: dark) { .shop-gift { background: #4A1D33; color: #F9A8D4; } }
.gift-toggle { flex: none; min-block-size: 32px; padding: 4px 10px; background: var(--fill); color: var(--text); font-weight: 500; }
.gift-toggle.on { background: #FCE7F3; color: #9D174D; }
@media (prefers-color-scheme: dark) { .gift-toggle.on { background: #4A1D33; color: #F9A8D4; } }
.shop-dept-note { margin-inline-start: auto; font-weight: 500; opacity: .8; }
.wish-row { cursor: default; padding-inline-end: 12px; }
.claim-btn { flex: none; min-block-size: 36px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--accent-tint); color: var(--accent); font: 600 var(--t-subhead)/1 var(--font); cursor: pointer; }
.claim-btn.on { background: #FCE7F3; color: #9D174D; }
@media (prefers-color-scheme: dark) { .claim-btn.on { background: #4A1D33; color: #F9A8D4; } }
.claim-tag { flex: none; color: var(--muted); font-size: var(--t-footnote); }
.update-bar { position: fixed; z-index: 60; inset-inline: 12px; inset-block-start: max(10px, env(safe-area-inset-top)); margin-inline: auto; max-inline-size: 440px; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--elevated); color: var(--text); box-shadow: var(--shadow); font-size: var(--t-subhead); font-weight: 600; }
.update-bar span { flex: 1; }
.update-bar .icon { color: var(--accent); }
.update-bar .btn { min-block-size: 36px; border-radius: 99px; padding-inline: 16px; }

.by-tag { padding: 1px 7px; border-radius: 99px; background: var(--fill); color: var(--muted); font-size: var(--t-caption); font-weight: 600; }
.by-tag.me { background: var(--accent-tint); color: var(--accent); }
.shop-lists .seg { padding-inline: 6px; min-inline-size: 0; }
.shop-lists .seg-label { white-space: nowrap; }
@media (max-width: 420px) { .shop-lists .seg-count { display: none; } }
.shop-rows > .wish-row, .shop-rows > .wish-row + .shop-swipe .shop-row { border-block-start: 1px solid var(--separator); }
.shop-rows > .wish-row:first-child { border-block-start: 0; }

/* iOS zoom: the app behaves like a native app — no pinch or double-tap zoom (the owner's call; Dynamic Type still
   scales all text, since sizes are in rem off -apple-system-body).
   And every field is ≥ 16px: iOS zooms into smaller ones on focus. */
html, body { touch-action: pan-x pan-y; } /* no pinch-zoom or double-tap zoom; text size still follows iOS Dynamic Type */
@media (max-width: 820px) { input, select, textarea, .json { font-size: max(16px, 1em); } }
