/* F.R.I.D.A.Y. web — "Glow" design (Design-Spec-Glow-2026-11-18.md), 1:1 with the SwiftUI app.
   Light lavender page, white cards on a soft purple glow, one deep-purple band, neon gradients as accents.
   Layout classes match Layout.swift: compact < 640 px, medium 640–999, wide ≥ 1000. */
:root {
  /* page + ink */
  --page: #F5F0FA; --panel: #FFFFFF; --ink: #1A0A2E; --ink2: #3D2D5C; --muted: #6B5B8A; --faint: #9B8BB0;
  --line: #DDD0F0; --soft: #F0EAF8; --hair: #E2D6F3;   /* v2: quiet/inset fill #F0EAF8 · row dividers #E2D6F3 */
  --card-edge: #ECE4F6; --sel-fill: #F3EDFA; --ring: #8A7AA6;
  --control: #8E7DAA; --hairline: var(--line); --divider: var(--hair);
  --action: #0063E5; --secondary: var(--soft); --selected-edge: var(--line);
  /* v2 surfaces: ONE card level (1px #ECE4F6 edge + a hairline shadow), one raised level (menus, popovers, sheets) */
  --shadow: 0 0 0 1px var(--card-edge), 0 1px 2px rgba(45, 27, 105, .06); --shadow-sm: var(--shadow);
  --shadow-raised: 0 8px 24px rgba(45, 27, 105, .14);
  /* semantics: done green, risk red, attention amber (fill / text / soft) */
  --danger: #E51937; --danger-text: #B5122B; --danger-tint: #FDECEF;
  --attention: #8A5200; --attention-icon: #C77700; --attention-tint: #FFF4E5;
  --warm: var(--attention); --warm-tint: var(--attention-tint); --warm-edge: #F5D9A8;
  --done: #0D9F6E; --done-icon: #0D9F6E; --done-text: #0A7A55; --done-tint: #E6F7F1;
  --switch-off: var(--soft);
  /* Friday: purple text, cyan→violet core */
  --friday: #4A2D8A; --friday-light: #00D4FF; --friday-tint: #EFDDFF; --friday-edge: #DDD0F0; --gold: #FFD700; --core: #00B8D9; --core2: #9D00FF;
  /* header band */
  --g-band: linear-gradient(135deg, #1A0A2E 0%, #2D1B69 55%, #4A2D8A 100%);
  --band-sub: #E8E0F5; --band-accent: #00D4FF;
  /* accent gradients (always 135°) */
  --g-brief: linear-gradient(135deg, #FFD700, #FF6B00);
  --g-calendar: linear-gradient(135deg, #00D4FF, #0063FF);
  --g-tasks: linear-gradient(135deg, #FF9F43, #FF6B00);
  --g-mail: linear-gradient(135deg, #FF0080, #9D00FF);
  --g-health: linear-gradient(135deg, #00FF88, #00D4FF);
  --g-friday: linear-gradient(135deg, #00D4FF, #9D00FF);
  --g-settings: linear-gradient(135deg, #6B4BB8, #2D1B69);
  /* Franklin roles, by position in the planner's roles list (wraps around): fill / text / soft */
  --role0: #FF0080; --role0-dark: #A0145F; --role0-tint: #FFE0EF;
  --role1: #00B8D9; --role1-dark: #0A6573; --role1-tint: #D6F5FA;
  --role2: #9D00FF; --role2-dark: #6A00B0; --role2-tint: #EFDDFF;
  --role3: #0063FF; --role3-dark: #0055C4; --role3-tint: #DCE8FF;
  --role4: #FF6B00; --role4-dark: #B35400; --role4-tint: #FFE6D3;
  --role5: #8AA600; --role5-dark: #4F6400; --role5-tint: #EAF2C2;
  --role6: #A2845E; --role6-dark: #694F2E; --role6-tint: #EDE1CF;
  --role7: #4A2D8A; --role7-dark: #4A2D8A; --role7-tint: #E8E0F5;
  /* Covey quadrants (text, soft) and A/B/C priority */
  --q1-text: var(--danger-text); --q1-tint: var(--danger-tint); --q2-text: var(--done-text); --q2-tint: var(--done-tint);
  --q3-text: var(--attention); --q3-tint: var(--attention-tint); --q4-text: #4A2D8A; --q4-tint: #E8E0F5;
  --pa: var(--g-brief); --pb: var(--g-calendar); --pc-text: #4A2D8A; --pc-tint: #E8E0F5;
  /* shapes */
  --r-card: 18px; --r-tile: 12px; --r-control: 12px; --r-inner: 9px; --r-pill: 999px; --r-chip: 8px;   /* strict atomic scale: pills only for bars and count badges */
  /* spacing scale (Layout.swift): every padding, margin and gap is one of these */
  --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-24: 24px; --sp-32: 32px; --sp-48: 48px;
  --gutter: 16px;            /* red line: 16 phone, 24 tablet, 32 sidebar layout (Design System v2 §2) */
  --frame: 100%;             /* content fills the window between the red lines (Jose 2026-11-18) */
  --card-gap: 12px; --section-gap: 24px; --btn-gap: 8px; --page-top: 16px;
  --sidebar: clamp(220px, 18vw, 264px);
  --tabbar: 73px;            /* the real bar: 8 + 56 + 8 + 1 (safe area added separately) */
  --font: "Avenir Next", "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light only;
}
@media (min-width: 640px) { :root { --gutter: 24px; --card-gap: 16px; --btn-gap: 12px; --page-top: 24px; } }
@media (min-width: 900px) { :root { --tabbar: 0px; --gutter: 32px; --page-top: 32px; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--font);
  background: var(--page);   /* v2 §4: flat page, no decorative glows */
  font-size: 15px; line-height: 1.35; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
p, h1, h2, h3 { margin: 0; }
a { color: var(--action); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(0, 99, 229, .45); outline-offset: 2px; }
.hidden { display: none !important; }

/* Section scope: --sec (solid) · --sec-grad (tile/selected fill) · --sec-dark (labels on white) · --sec-icon (glyph on white)
   · --sec-on (glyph/text on the gradient) · --sec-spark (the icon's accent on the gradient) · --sec-glow (glyph on the band) */
.sec-brief, .screen[data-tab=brief] { --sec-glyph: var(--ink); --sec: #FF6B00; --sec-grad: var(--g-brief); --sec-dark: #B35400; --sec-icon: #D97A00; --sec-on: var(--ink); --sec-spark: #FFFFFF; --sec-glow: #FFD700; --sec-tint: #FFF1D6; }
.sec-calendar, .screen[data-tab=calendar] { --sec-glyph: #FFFFFF; --sec: #0063FF; --sec-grad: var(--g-calendar); --sec-dark: #0055C4; --sec-icon: #0063FF; --sec-on: var(--ink); --sec-spark: #FFD700; --sec-glow: #00D4FF; --sec-tint: #DCEFFF; }
.sec-tasks, .screen[data-tab=tasks] { --sec-glyph: var(--ink); --sec: #FF6B00; --sec-grad: var(--g-tasks); --sec-dark: #B35400; --sec-icon: #E05A00; --sec-on: var(--ink); --sec-spark: #FFFFFF; --sec-glow: #FF9F43; --sec-tint: #FFE6D3; }
.sec-mail, .screen[data-tab=mail] { --sec-glyph: #FFFFFF; --sec: #FF0080; --sec-grad: var(--g-mail); --sec-dark: #A0145F; --sec-icon: #E0007A; --sec-on: #FFFFFF; --sec-spark: #FFD700; --sec-glow: #FF5FB0; --sec-tint: #FFE0EF; }
.sec-settings, dialog.sheet.settings { --sec-glyph: #FFFFFF; --sec: #4A2D8A; --sec-grad: var(--g-settings); --sec-dark: #4A2D8A; --sec-icon: #4A2D8A; --sec-on: #FFFFFF; --sec-spark: #FFD700; --sec-glow: #E8E0F5; --sec-tint: #E8E0F5; }
.sec-friday { --sec-glyph: #FFFFFF; --sec: #9D00FF; --sec-grad: var(--g-friday); --sec-dark: #4A2D8A; --sec-icon: #6A00B0; --sec-on: #FFFFFF; --sec-spark: #FFD700; --sec-glow: #00D4FF; --sec-tint: #EFDDFF; }
.sec-health { --sec-glyph: var(--ink); --sec: #0D9F6E; --sec-grad: var(--g-health); --sec-dark: #0A7A55; --sec-icon: #0A7A55; --sec-on: var(--ink); --sec-spark: #FFFFFF; --sec-glow: #00FF88; --sec-tint: #E6F7F1; }
/* Custom section icons: the accent ("spark") follows --spark */
svg .spk-f { fill: var(--spark, currentColor); stroke: none; }
svg .spk-s { stroke: var(--spark, currentColor); }
svg .spk-fs { fill: var(--spark, currentColor); }
/* SectionTile: section gradient, glyph in --sec-on, gold spark. 36px on cards */
.stile { width: 42px; height: 42px; flex: none; border-radius: var(--r-tile); background: var(--sec-grad, var(--g-settings)); color: var(--sec-glyph, #fff); --spark: var(--sec-spark, #FFD700);
  display: inline-grid; place-items: center;
  /* 2026-11-19: icons a bit larger, with a soft glow in the tile's own color */
  box-shadow: 0 3px 8px color-mix(in srgb, var(--sec, #4A2D8A) 32%, transparent); }
.stile svg { width: 25px; height: 25px; stroke-width: 1.8; }
/* Role scope: .rc0 … .rc7 set --role / --role-dark / --role-tint (F.roleIndex picks the number) */
.rc0 { --role: var(--role0); --role-dark: var(--role0-dark); --role-tint: var(--role0-tint); }
.rc1 { --role: var(--role1); --role-dark: var(--role1-dark); --role-tint: var(--role1-tint); }
.rc2 { --role: var(--role2); --role-dark: var(--role2-dark); --role-tint: var(--role2-tint); }
.rc3 { --role: var(--role3); --role-dark: var(--role3-dark); --role-tint: var(--role3-tint); }
.rc4 { --role: var(--role4); --role-dark: var(--role4-dark); --role-tint: var(--role4-tint); }
.rc5 { --role: var(--role5); --role-dark: var(--role5-dark); --role-tint: var(--role5-tint); }
.rc6 { --role: var(--role6); --role-dark: var(--role6-dark); --role-tint: var(--role6-tint); }
.rc7 { --role: var(--role7); --role-dark: var(--role7-dark); --role-tint: var(--role7-tint); }
.role-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; background: var(--role, var(--control)); }
/* a to-do with a role: a 4px rounded bar in the role color on the row's left edge */
.has-role { box-shadow: inset 4px 0 0 var(--role); }

/* Progress (spec "Charts and graphs"): 8px pill track, gradient fill; every bar has a text label with the real numbers */
.pbar { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--soft); overflow: hidden; min-width: 0; }
.pbar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-pill); background: var(--fill, var(--g-health)); min-width: 8px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.pbar > i.zero { display: none; }
.pbar.done-fill > i { background: linear-gradient(90deg, #0D9F6E, #00D4A0); }
.pbar.sm { height: 6px; }
.chart-l { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.chart-l .big { font-size: 22px; font-weight: 700; letter-spacing: -.4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.invite { font-size: 13px; color: var(--muted); }

/* type scale (Font.app): 11/12/13/15/16/17/20/24 */
.t11 { font-size: 11px; } .t12 { font-size: 12px; } .t13 { font-size: 13px; } .t15 { font-size: 15px; }
.t16 { font-size: 16px; } .t17 { font-size: 17px; } .t20 { font-size: 20px; } .t24 { font-size: 24px; }
.w5 { font-weight: 500; } .w6 { font-weight: 600; } .w7 { font-weight: 700; }
.ink { color: var(--ink); } .ink2 { color: var(--ink2); } .muted { color: var(--muted); } .faint { color: var(--faint); }
.c-friday { color: var(--friday); } .c-done { color: var(--done-text); } .c-danger { color: var(--danger-text); } .c-attention { color: var(--attention); } .c-warm { color: var(--attention); } .c-action { color: var(--action); }
.wrap { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* stacks (VStack / HStack) */
.v { display: flex; flex-direction: column; min-width: 0; }
.h { display: flex; align-items: center; min-width: 0; }
.h.top { align-items: flex-start; } .h.base { align-items: baseline; } .h.bottom { align-items: flex-end; }
.g2 { gap: 4px; } .g4 { gap: 4px; } .g8 { gap: 8px; } .g12 { gap: 12px; } .g16 { gap: 16px; } .g24 { gap: 24px; }
.flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.flow.g4 { gap: 4px; }
.grow { flex: 1; min-width: 0; }
.sp { flex: 1; }
.fill { width: 100%; }
.p16 { padding: 16px; } .px16 { padding-left: 16px; padding-right: 16px; }

/* ---------- v2 §5 type roles (one class per role; every screen uses these) ---------- */
.t-title { font-size: 28px; font-weight: 700; letter-spacing: -.3px; line-height: 1.15; color: var(--ink); }
.t-card-title { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.t-body { font-size: 15px; font-weight: 400; color: var(--ink); }
.t-secondary { font-size: 15px; font-weight: 400; color: var(--ink2); }
.t-meta { font-size: 13px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-stat { font-size: 30px; font-weight: 700; letter-spacing: -.5px; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .t-stat { font-size: 34px; } }
.t-chip { font-size: 12px; font-weight: 600; }
/* Card header lockup: tile 28 (r8, glyph 16) + 8 + EYEBROW, optional trailing meta/action */
.lockup { display: flex; align-items: center; gap: 8px; row-gap: 8px; min-width: 0; min-height: 34px; flex-wrap: wrap; }
.lockup > .stile { width: 34px; height: 34px; border-radius: 10px; }
.lockup > .stile svg { width: 20px; height: 20px; stroke-width: 2; }
.lockup > .label2 { flex: 1 0 auto; max-width: calc(100% - 42px); }   /* never cut the eyebrow: the trailing item wraps first */
.lockup > .lk-trail { flex: none; display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
/* Stat = eyebrow + big stat + one meta line */
.stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* Act As = eyebrow "ACT AS" + statement 15 Demi Bold */
.actas-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* Compass (mockup band line): COMPASS 12/600/+2 · "Today I act as " 14 regular · the phrase 14/600. One flowing line. */
.compass { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink2); overflow-wrap: anywhere; text-align: left; }
.compass .cp-tag { font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--sec-dark, var(--muted)); margin-right: 10px; }
.compass b { font-weight: 600; color: var(--ink); }
.compass .cp-empty { color: var(--muted); }
.compass.on-band { color: var(--band-sub); margin-top: -2px; }      /* band gap 16 − 2 = the mockup's 14 */
.compass.on-band .cp-tag { color: var(--band-accent); }
.compass.on-band b { color: #fff; }
.card.actas .compass { width: 100%; }
.actas-s { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.actas-s.empty { color: var(--muted); font-weight: 400; }
/* Action bar (v2 §6): related CTAs in ONE row. Phone: equal widths, primary last; wraps only when a label can't fit.
   Wide: content-width; cards align left, sheets/toolbars right (.end). */
.actbar { display: flex; flex-wrap: wrap; gap: var(--btn-gap); align-items: center; min-width: 0; }
.actbar > .btn { flex: 1 1 0; min-width: fit-content; }
.actbar > .btn.primary { order: 9; }
.actbar.end { justify-content: flex-end; }
.actbar.center { justify-content: center; }
@media (min-width: 640px) { .actbar > .btn { flex: 0 0 auto; } }

/* Section label: 11–12pt bold, tracking ~1.8, uppercase, in the section's dark shade */
.label2, .t-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; line-height: 1.3; text-transform: uppercase; color: var(--sec-dark, var(--muted)); white-space: nowrap;
  display: inline-block; max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.label2.friday { color: var(--friday); }
.label2.ink { color: var(--ink); } .label2.ink2 { color: var(--ink2); } .label2.muted { color: var(--muted); }
.label2.c-attention { color: var(--attention); } .label2.c-done { color: var(--done-text); } .label2.c-danger { color: var(--danger-text); }

/* .card(fill): white, floats on a soft purple glow, no border */
.card { background: var(--panel); border-radius: var(--r-card); min-width: 0; box-shadow: var(--shadow); }
.card.p16 { padding: 16px; }
.card.edge { box-shadow: var(--shadow); }
.card.friday { background: var(--panel); }
.card.friday-edge { box-shadow: var(--shadow); }
.card.attention { background: var(--attention-tint); box-shadow: 0 0 0 1px #F5D9A8; }
.card.done { background: var(--done-tint); box-shadow: 0 0 0 1px #BFE8D7; }
.card.danger { background: var(--danger-tint); box-shadow: 0 0 0 1px #F3C3CB; }
.card.secondary { background: var(--soft); box-shadow: none; }
.card.warm { background: var(--attention-tint); box-shadow: 0 0 0 1px #F5D9A8; }
/* Panel */
.panel { background: var(--panel); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 8px; min-height: 36px; flex-wrap: wrap; }
.panel-head .label2 { margin-right: auto; }

/* buttons — Primary (solid blue pill) / Secondary (white pill, lavender ring) / Destructive / Icon / Link */
.btn { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-control); min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: 600; white-space: nowrap;
  background: var(--panel); color: var(--ink2); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; transition: transform .12s ease-out; user-select: none; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--action); color: #fff; font-weight: 600; box-shadow: none; }
.btn.primary:hover:not(:disabled) { background: #0057CC; }
.btn:not(.primary):not(.link):not(.icon):hover:not(:disabled) { background: var(--sel-fill); }
.btn.tinted { background: var(--soft); color: #4A2D8A; box-shadow: none; }
.btn.ghost { background: none; box-shadow: none; color: var(--sec-dark, #4A2D8A); padding: 0 8px; }
.btn.primary:disabled { background: var(--soft); color: var(--faint); box-shadow: none; }
.btn:disabled { color: var(--faint); cursor: default; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 15px; font-weight: 600; }   /* Compact (rows/cards only) */
.btn.small svg { width: 17px; height: 17px; }
/* Compact buttons stay 36 to look, but take taps across 44 (spec: 44 pt targets); the invisible edge sits in the 8 px gap around them */
.btn.small { position: relative; }
.btn.small::after { content: ""; position: absolute; inset: -4px; }
.btn.destructive { background: var(--panel); color: var(--danger-text); font-weight: 600; min-width: 44px; box-shadow: inset 0 0 0 1px #F3C3CB; }
.btn.destructive.confirm { background: var(--danger); color: #fff; box-shadow: none; }
.btn.icon { background: none; box-shadow: none; padding: 0; min-width: 44px; width: 44px; color: var(--ink2); font-size: 17px; font-weight: 600; }
.btn.icon.small { min-width: 36px; width: 36px; }
.btn.icon.filled { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.btn.icon svg { width: 20px; height: 20px; }
.btn.icon.primary-ic { background: var(--action); color: #fff; }   /* the screen's main action as a 44 px icon beside a phone title */
.btn.icon.primary-ic:hover:not(:disabled) { background: #0057CC; }
.btn.link { background: none; box-shadow: none; padding: 0 4px; color: var(--action); font-weight: 600; }
.btn.link:active { opacity: .6; transform: none; }
.btn.wide { width: 100%; }
.press { cursor: pointer; transition: transform .12s ease-out; }
.press:active { transform: scale(.98); }
button.plain { appearance: none; background: none; border: 0; padding: 0; margin: 0; text-align: left; cursor: pointer; color: inherit; display: block; width: 100%; font: inherit; }

/* Tag / chip: pill */
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--r-chip);
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--soft); color: #4A2D8A; }
.tag.role { background: var(--role-tint, var(--soft)); color: var(--role-dark, #4A2D8A); }
.tag.q1 { background: var(--q1-tint); color: var(--q1-text); } .tag.q2 { background: var(--q2-tint); color: var(--q2-text); }
.tag.q3 { background: var(--q3-tint); color: var(--q3-text); } .tag.q4 { background: var(--q4-tint); color: var(--q4-text); }
.tag.danger { background: var(--danger-tint); color: var(--danger-text); }
.tag.done { background: var(--done-tint); color: var(--done-text); }
.tag.attention { background: var(--attention-tint); color: var(--attention); }
.tag.friday { background: var(--friday-tint); color: #6A00B0; }
.tag.warm { background: var(--attention-tint); color: var(--attention); }
.tag.ink { background: #4A2D8A; color: #fff; }
.tag.now { background: var(--action); color: #fff; }
.tag.acct { gap: 4px; }

/* colour dot (calendar, list, account) */
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot.d8 { width: 8px; height: 8px; }

/* Event block (calendar, Brief, Tasks schedule): a soft tint of the calendar color (~18%, less once past) and a 4px rounded bar */
.plain.press.evtint, .evtint { position: relative; overflow: hidden; background: var(--evt, var(--soft)); }
.evtint { padding-left: 16px !important; }   /* v2 §10: 3px left bar in the calendar color, square ends */
.evtint::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--evc, var(--control)); }

/* PriorityBadge — one shared definition for Brief, Planner and Organizer (modifiers: a|b|c, pb-A|pb-B|pb-C, A|B|C)
   A = gold→orange tile, B = cyan→blue tile (ink text, bold); C = soft lavender with purple text */
.pbadge { flex: none; min-width: 36px; min-height: 28px; padding: 0 8px; border-radius: var(--r-chip); display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--soft); color: var(--muted); }
.pbadge.unset { font-size: 12px; background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--line); }
.pbadge.a, .pbadge.pb-A, .pbadge.A { background: var(--pa); color: var(--ink); }
.pbadge.b, .pbadge.pb-B, .pbadge.B { background: var(--pb); color: var(--ink); }
.pbadge.c, .pbadge.pb-C, .pbadge.C { background: var(--pc-tint); color: var(--pc-text); }

/* CountBadge: pill, solid section color, white bold number */
.badge { position: absolute; top: -8px; left: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--sec, #4A2D8A); color: #fff; font: 700 11px/14px var(--font); border: 2px solid #fff; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge.urgent { background: var(--danger); }
.sec-tasks .badge:not(.urgent) { color: var(--ink); }   /* ink on orange (6.5:1); white is under 3:1 */

/* Segmented: soft pill track, the selected segment a white pill */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: var(--r-control); min-width: 0; }
.seg.fit { display: inline-flex; }
.seg button { flex: 1; appearance: none; border: 0; background: none; min-height: 44px;   /* 44 px tap target (UAT W22) */ border-radius: var(--r-inner); cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--ink2); white-space: nowrap; padding: 0 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 439px) { .seg button { font-size: 14px; padding: 0 2px; letter-spacing: -.2px; } }
@media (max-width: 359px) { .seg button { font-size: 13px; padding: 0 4px; } }
.seg button[aria-pressed=true] { background: #fff; color: var(--sec-dark, var(--ink)); font-weight: 600; box-shadow: 0 0 0 1px var(--card-edge), 0 1px 2px rgba(45, 27, 105, .08); }

/* SearchField */
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; background: var(--soft); border-radius: var(--r-control); }
.search:focus-within { box-shadow: 0 0 0 2px var(--action); }
.search svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; background: none; flex: 1; font-size: 16px; min-width: 0; min-height: 44px; }

/* inputs */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input { width: 100%; min-height: 44px; padding: 8px 12px; font-size: 16px; color: var(--ink); background: var(--soft);
  border: 0; border-radius: var(--r-control); }
.input::placeholder { color: var(--muted); }
textarea.input { resize: vertical; min-height: 88px; line-height: 1.4; }
.input:focus { outline: none; box-shadow: 0 0 0 2px var(--action); }
/* Form (insetGrouped) */
.form { display: flex; flex-direction: column; gap: 24px; }
.fsec { display: flex; flex-direction: column; gap: 8px; }
.fsec > .fhead { font-size: 11px; font-weight: 700; color: var(--sec-dark, var(--muted)); padding: 0 16px; text-transform: uppercase; letter-spacing: 1.5px; }
.fsec > .ffoot { font-size: 13px; color: var(--muted); padding: 0 16px; line-height: 1.35; }
.fgroup { background: var(--panel); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-sm); }
.frow { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 16px; position: relative; }
.frow + .frow::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; border-top: 1px solid var(--hair); }
.frow > label, .frow > .lbl { flex: 1; font-size: 16px; }
.frow .val { color: var(--muted); }
.frow input.bare, .frow textarea.bare, .frow select.bare { border: 0; outline: 0; background: none; font-size: 16px; flex: 1; min-width: 0; min-height: 40px; padding: 0; }
.frow input.bare::placeholder, .frow textarea.bare::placeholder { color: var(--muted); }
.frow select.bare { flex: none; text-align: right; color: var(--muted); }
.frow textarea.bare { min-height: 80px; padding: 8px 0; resize: vertical; }
.frow button.rowlink { appearance: none; border: 0; background: none; padding: 0; color: var(--action); font-size: 16px; font-weight: 600; cursor: pointer; min-height: 44px; text-align: left; flex: 1; }
.frow button.rowlink.destructive { color: var(--danger-text); }
/* FridaySwitch */
.switch { position: relative; width: 51px; height: 31px; flex: none; display: inline-block; }
.switch input { appearance: none; margin: 0; width: 51px; height: 31px; border-radius: 16px; background: var(--switch-off); cursor: pointer; transition: background .2s; display: block; }
.switch input:checked { background: var(--done); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(45, 27, 105, .18), 0 1px 1px rgba(45, 27, 105, .08); transition: transform .2s; }
.switch input:checked::after { transform: translateX(20px); }

/* Check: 2px lavender ring; done = green fill with a white check */
.check { width: 44px; height: 44px; display: grid; place-items: center; flex: none; cursor: pointer; background: none; border: 0; padding: 0; }
.check i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ring); background: var(--panel); display: grid; place-items: center; transition: background .2s, border-color .2s; }
.check.on i { background: var(--done); border-color: var(--done); }
.check.prog i, .check.dlg i { background: var(--soft); border-color: #4A2D8A; color: #4A2D8A; font: 700 13px/1 var(--font, inherit); }
.markrow { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 4px 0; }
.markrow .mk { width: 44px; height: 44px; flex: none; display: grid; place-items: center; position: relative; color: var(--muted); font-weight: 800; font-size: 13px; }
.markrow .mk::before { content: ""; position: absolute; width: 24px; height: 24px; border-radius: 50%; background: var(--soft); border: 2px solid #9B8BB0; box-sizing: border-box; z-index: -1; }
.markrow .mk { z-index: 0; }
.markrow .mkcode { min-width: 36px; height: 28px; padding: 0 4px; display: grid; place-items: center; border-radius: 8px; background: var(--soft); color: var(--muted); font-weight: 700; font-size: 13px; }
.markrow .mkt { color: var(--muted); }
.markrow.del .mkt { text-decoration: line-through; text-decoration-color: #9B8BB0; }
.check.prog i::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #4A2D8A; }
.check.on i::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.6px 2.6px 0; transform: translateY(-1px) rotate(45deg); }

/* ScreenHeader — one shared header for every tab (LY-2): section label + large ink title, a section tile beside it */
/* Screen header (v2 §5): section tile 36 to the left of eyebrow-over-title; trailing actions on the same row */
.screen-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; min-height: 44px; }
.screen-head .tb { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; max-width: 100%; }
.screen-head .tb > .stile { width: 44px; height: 44px; border-radius: 13px; }
.screen-head .tb > .stile svg { width: 26px; height: 26px; }
.screen-head .tb .tx { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.screen-head .tb h1 { font-size: 28px; font-weight: 700; letter-spacing: -.3px; line-height: 1.15; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.screen-head .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* LY-7: under 640 the secondary actions keep only their icon (the name stays for VoiceOver) */
@media (max-width: 639px) {
  .screen-head { flex-wrap: wrap; }   /* actions sit beside the title when they fit, else on their own row (never crush the title) */
  .screen-head .tb { flex: 1 1 auto; min-width: min(100%, 9em); }
  .screen-head .tb h1 { white-space: normal; overflow-wrap: break-word; }
  .screen-head .acts { flex-wrap: wrap; flex: 0 1 auto; max-width: 100%; }
  .screen-head .acts .btn:not(.primary):not(.icon):has(svg) { padding: 0; min-width: 44px; }
  .screen-head .acts .btn:not(.primary):not(.icon):has(svg) .btn-l,
  .screen-head .acts .calfilter .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 359px) {   /* the narrowest phones: the primary action keeps only its icon too */
  .screen-head .acts .btn.primary:has(svg) { padding: 0; min-width: 44px; }
  .screen-head .acts .btn.primary:has(svg) .btn-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- shell: band sidebar | screen  (≥ 900)   ·   screen above, tab bar below (< 900) ---------- */
.app { display: flex; flex-direction: column; height: calc(100vh / var(--zoom, 1)); height: calc(100dvh / var(--zoom, 1)); }   /* the text-size dial magnifies vh too */
.screen { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
/* ONE page container (v2 §2): red lines at the gutter, max 1200 wide, LEFT-aligned so every page starts at the same x */
.screen-inner { width: 100%; max-width: calc(var(--frame) + 2 * var(--gutter)); margin: 0; display: flex; flex-direction: column; gap: var(--section-gap);
  padding: var(--page-top) var(--gutter) var(--sp-32); }
@media (max-width: 639px) {   /* LY-15: keep clear of the notch in landscape */
  .screen-inner { padding-left: calc(var(--gutter) + env(safe-area-inset-left)); padding-right: calc(var(--gutter) + env(safe-area-inset-right)); }
}
/* Tab bar (phones): white, slightly translucent, top corners 22, soft upward shadow */
.tabbar { flex: none; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-radius: 22px 22px 0 0; box-shadow: 0 -1px 0 var(--card-edge); position: relative; z-index: 5;
  padding: 8px calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left)); }
.tabbar .tabs { display: flex; gap: 4px; max-width: var(--frame); margin: 0 auto; }
.tab { flex: 1; appearance: none; border: 0; background: none; min-height: 56px; border-radius: var(--r-control); cursor: pointer; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted);
  font: 600 11px/1 var(--font); transition: transform .12s ease-out; }
.tab:active { transform: scale(.96); }
.tab .ic { position: relative; width: 56px; max-width: 100%; height: 38px; border-radius: var(--r-control); display: grid; place-items: center; color: var(--sec-icon, var(--ink2)); --spark: var(--sec-icon); transition: background .2s; }
.tab .ic svg { width: 28px; height: 28px; }
.tab .badge { top: -4px; left: auto; right: 2px; }
.tab[aria-selected=true] { color: var(--sec-dark, var(--ink)); font-weight: 700; }
.tab[aria-selected=true] .ic { background: var(--sec-grad); color: var(--sec-glyph, #fff); --spark: var(--sec-spark); }

/* Sidebar (≥ 900): the header band's gradient, white text, gradient-pill selected rows */
.sidebar { display: none; }
@media (min-width: 900px) {
  .app { flex-direction: row; }
  .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 8px; flex: none; width: var(--sidebar); height: 100%; overflow-y: auto;
    background: var(--g-band); color: #fff; padding: 24px 16px; }
}
.sidebar :focus-visible { outline-color: rgba(255, 255, 255, .8); }
.side-brand { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; margin-bottom: 16px; color: #fff; }
.side-brand .fmark { flex: none; }
.side-brand b { font-size: 15px; font-weight: 700; letter-spacing: 2.4px; white-space: nowrap; }
.side-rows { display: flex; flex-direction: column; gap: 4px; }
.side-row { appearance: none; border: 0; background: none; width: 100%; min-height: 48px; padding: 0 12px; border-radius: var(--r-control); cursor: pointer;
  display: flex; align-items: center; gap: 12px; color: #fff; font-size: 15px; font-weight: 600; text-align: left; transition: transform .12s ease-out, background .2s; }
.side-row:hover { background: rgba(255, 255, 255, .09); }
.side-row:active { transform: scale(.98); }
.side-row svg { width: 26px; height: 26px; flex: none; color: var(--sec-glow, #fff); --spark: var(--sec-glow, #fff); }
.side-row[aria-current=page] { background: var(--sec-grad); color: var(--sec-on, #fff); font-weight: 700; }
.side-row[aria-current=page] svg { color: var(--sec-glyph, #fff); --spark: var(--sec-spark); }
.side-row .sl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-row .badge { position: static; border: 0; height: 18px; min-width: 18px; line-height: 18px; padding: 0 4px; }
.side-row .kbd { font-size: 12px; color: var(--band-sub); font-weight: 500; }
.side-row .sub { display: block; font-size: 12px; color: var(--band-sub); font-weight: 500; }
.side-row.is-syncing svg { animation: spin 1s linear infinite; }
.side-row:disabled { cursor: default; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .14); }
.side-foot .side-row svg { color: var(--band-sub); --spark: var(--band-accent); }

/* Split view helpers (Mail's list | message): each column scrolls on its own, the scrollbar never shifts content (LY-5) */
.split { display: grid; grid-template-columns: minmax(0, 1fr); height: 100%; min-height: 0; }
@media (min-width: 900px) { .split { grid-template-columns: clamp(400px, 46%, 500px) minmax(0, 1fr); } }   /* wider list so sender names fit at 1024–1280 (UAT W21) */
.split-col { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.split-col + .split-col { border-left: 1px solid var(--line); }

/* layout classes (Layout.swift) */
.cols { display: grid; gap: var(--card-gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 640px) { .cols.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 640px) { .only-compact { display: none !important; } }
@media (max-width: 639px) { .only-wide { display: none !important; } }

/* list rows */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; min-width: 0; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: var(--row-inset, 0); right: 0; border-top: 1px solid var(--hair); }
/* 12-column layout grid (v2 §3): wide = 12 cols, gutter 16 */
.g12c { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--card-gap); align-items: start; min-width: 0; }
@media (min-width: 1100px) {
  .g12c { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .g12c > .s12 { grid-column: span 12; } .g12c > .s8 { grid-column: span 8; } .g12c > .s6 { grid-column: span 6; }
  .g12c > .s4 { grid-column: span 4; } .g12c > .s3 { grid-column: span 3; } .g12c > .s7 { grid-column: span 7; } .g12c > .s5 { grid-column: span 5; }
}
.chev { color: var(--faint); width: 13px; height: 13px; flex: none; }

/* ---------- sheets (SheetBar): white bar with a centered title, top radius 22, lavender body ---------- */
/* LY-6: the sheet is sized, never the content inside it. Forms: 640. Hubs (.large: Organizer, Settings): 960. */
dialog.sheet { border: 0; padding: 0; background: var(--page); color: var(--ink); border-radius: 22px 22px 0 0;
  width: 100%; max-width: 100%; height: calc(100dvh / var(--zoom, 1) - 24px); max-height: none; margin: auto 0 0; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-raised); }
dialog.sheet[open] { display: flex; }
@media (min-width: 640px) {
  dialog.sheet { border-radius: 22px; width: min(640px, calc(100vw / var(--zoom, 1) - 48px)); height: min(880px, calc(100dvh / var(--zoom, 1) - 48px)); margin: auto; }
  dialog.sheet.large { width: min(960px, calc(100vw / var(--zoom, 1) - 48px)); }
}
dialog.sheet.full { width: 100%; max-width: 100%; height: calc(100dvh / var(--zoom, 1)); max-height: calc(100dvh / var(--zoom, 1)); border-radius: 0; margin: 0; }
dialog.sheet::backdrop { background: rgba(26, 10, 46, .38); }
/* LY-11: leading | title | trailing on a 1fr auto 1fr grid, so the title is centred and wraps instead of being cut at 320 */
.sheetbar { flex: none; display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr); align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--panel); box-shadow: 0 1px 0 var(--hair); min-height: 60px; position: relative; z-index: 1; }
@media (min-width: 640px) { .sheetbar { padding: 8px 24px; } }
.sheetbar .sb-l { display: flex; justify-content: flex-start; min-width: 0; }
.sheetbar .sb-r { display: flex; justify-content: flex-end; min-width: 0; }
.sheetbar .title { text-align: center; font-size: 17px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; min-width: 0; }
.sheetbody { flex: 1; overflow-y: auto; padding: 16px; scrollbar-gutter: stable; }
@media (min-width: 640px) { .sheetbody { padding: 24px; } }
.sheetbody .narrow { max-width: none; margin: 0; }   /* LY-6: kept as a hook; the sheet width does the work */
.sheetfoot { flex: none; padding: 16px; background: var(--panel); box-shadow: 0 -1px 0 var(--hair); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .sheetfoot { padding-left: 24px; padding-right: 24px; } }

/* confirmationDialog / alert */
dialog.alert { border: 0; border-radius: var(--r-card); padding: 0; width: min(320px, calc(100vw / var(--zoom, 1) - 48px)); background: var(--panel); text-align: center; box-shadow: var(--shadow-raised); }
dialog.alert::backdrop { background: rgba(26, 10, 46, .38); }
dialog.alert .ab { padding: 24px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
dialog.alert .ab h3 { font-size: 17px; font-weight: 700; }
dialog.alert .ab p { font-size: 13px; color: var(--ink2); }
dialog.alert .ab .input { margin-top: 8px; text-align: left; }
dialog.alert .aa { display: flex; flex-direction: column; border-top: 1px solid var(--hair); }
dialog.alert .aa button { appearance: none; border: 0; background: none; min-height: 44px; padding: 8px 16px; line-height: 1.3; font-size: 17px; color: var(--action); cursor: pointer; border-top: 1px solid var(--hair); }
dialog.alert .aa button:first-child { border-top: 0; }
dialog.alert .aa button.destructive { color: var(--danger-text); font-weight: 700; }
dialog.alert .aa button.cancel { font-weight: 700; }
/* the Keep/Discard question inside a sheet (Esc with something typed) — looks like the alert above */
.leave-scrim { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(26, 10, 46, .38); border-radius: inherit; animation: leave-in .18s ease-out; }
.leave-card { width: min(320px, calc(100% - 48px)); border-radius: var(--r-card); background: var(--panel); text-align: center; box-shadow: var(--shadow-raised); animation: leave-pop .22s cubic-bezier(.2, .8, .2, 1); }
.leave-card .ab { padding: 24px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.leave-card .ab h3 { font-size: 17px; font-weight: 700; color: var(--ink); }
.leave-card .ab p { font-size: 13px; color: var(--ink2); }
.leave-card .aa { display: flex; flex-direction: column; border-top: 1px solid var(--hair); }
.leave-card .aa button { appearance: none; border: 0; background: none; min-height: 44px; padding: 8px 16px; line-height: 1.3; font-size: 17px; color: var(--action); cursor: pointer; border-top: 1px solid var(--hair); font-family: inherit; }
.leave-card .aa button:first-child { border-top: 0; }
.leave-card .aa button.destructive { color: var(--danger-text); font-weight: 700; }
.leave-card .aa button.cancel { font-weight: 700; }
@keyframes leave-in { from { opacity: 0; } }
@keyframes leave-pop { from { opacity: 0; transform: scale(.94); } }
@media (prefers-reduced-motion: reduce) { .leave-card { animation: leave-in .15s ease-out; } }

/* AppToast */
#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); z-index: 1000;
  background: var(--panel); color: var(--ink); border-radius: var(--r-card); padding: 12px 16px; font-size: 15px; font-weight: 600;
  box-shadow: var(--shadow-raised); width: max-content; max-width: min(520px, calc(100vw / var(--zoom, 1) - 32px)); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.has-undo { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; }
#toast .btn.link { min-height: 44px; font-weight: 700; }

/* ProgressView */
.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } .btn, .tab, .press { transition: none; } }

/* auth */
.auth { min-height: calc(100dvh / var(--zoom, 1)); display: grid; place-items: center; padding: 16px; }
.auth .panel { width: 100%; max-width: 420px; padding: 24px; gap: 16px; }
.auth-band { margin: -24px -24px 0; padding: 24px; background: var(--g-band); color: #fff; border-radius: var(--r-card) var(--r-card) 0 0; }
.steps { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: var(--ink2); }
.err { color: var(--attention); font-size: 13px; font-weight: 600; }

/* Sync now: the arrows turn while it waits for the iPhone */
.btn.is-syncing svg { animation: spin 1s linear infinite; }

/* F.celebrate: a spring on the check, and for an A1 or Big Rock a quiet green ring (habit feedback) */
.celebrate { animation: cel-pop .42s cubic-bezier(.34, 1.56, .64, 1); position: relative; }
@keyframes cel-pop { 0% { transform: scale(1); } 35% { transform: scale(.82); } 100% { transform: scale(1); } }
.cel-ring { position: fixed; z-index: 1001; pointer-events: none; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--done); opacity: .9; animation: cel-ring .7s cubic-bezier(.2, .8, .2, 1) forwards; }
.cel-ring.r2 { animation-delay: .1s; opacity: 0; box-shadow: 0 0 0 1.5px var(--done); }
@keyframes cel-ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .celebrate { animation: none; } .cel-ring { animation: cel-fade .5s ease-out forwards; } .cel-ring.r2 { display: none; }
  @keyframes cel-fade { from { opacity: .8; } to { opacity: 0; } } }
.cgap { gap: var(--card-gap); }
.cols.eq { align-items: stretch; }

/* ── GRID-SNAP (spec v2 §6b): every control row spans red line to red line in equal columns ── */
.actbar { width: 100%; }
.actbar > .btn { flex: 1 1 0; min-width: fit-content; }   /* never narrower than its label + padding; a pair that cannot fit wraps to full-width rows */
.actbar > .btn.icon { flex: 0 0 44px; }
@media (max-width: 639px) {
  /* header actions: a full-width row under the title; labelled buttons share the width, icon buttons stay 44 square */
  .screen-head { flex-wrap: wrap; row-gap: 12px; }
  .screen-head .tb { flex: 1 1 100%; }
  .screen-head .acts { flex: 1 1 100%; max-width: 100%; display: flex; flex-wrap: nowrap; gap: 8px; }
  .screen-head .acts > * { flex: 1 1 0; min-width: 0; }
  .screen-head .acts > .btn.icon, .screen-head .acts > .icon { flex: 0 0 44px; }
  .screen-head .acts .btn:not(.primary):not(.icon):has(svg) { padding: 0 12px; }
  .screen-head .acts .btn:not(.primary):not(.icon):has(svg) .btn-l,
  .screen-head .acts .calfilter .lbl { position: static; width: auto; height: auto; overflow: hidden; clip: auto; text-overflow: ellipsis; }
}
@media (min-width: 640px) {
  /* wide: header actions right-aligned with equal widths */
  .screen-head .acts > .btn:not(.icon) { min-width: 128px; justify-content: center; }
}
/* header tools: icon-only buttons beside the title (all widths) */
.screen-head .tools { display: flex; gap: 8px; align-items: center; flex: none; }
.screen-head .tools > * { flex: none; }
@media (max-width: 639px) {
  .screen-head .tb { flex: 1 1 0; min-width: 0; }
  .screen-head .tools { align-self: center; }
  .screen-head .acts { order: 3; }
}
/* one gutter for every row of controls = the card gutter (12 phone / 16 wide), so column edges line up top to bottom */
.actbar, .screen-head .acts { gap: var(--card-gap, 12px); }
@media (max-width: 639px) {
  .screen-head .acts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .screen-head .acts > * { min-width: 0; }
}

/* Junk shield (top of the Junk box) */
.jshield .t-stat { line-height: 1; }
/* Reduce Motion: state still shows (Syncing… label, dimmed icon), but nothing spins, slides or grows */
@media (prefers-reduced-motion: reduce) {
  .is-syncing svg { animation: none !important; opacity: .55; }
  .pbar > i, .mrow, .org-dg-chev { transition: none; }
  #toast { transition: opacity .15s; transform: translate(-50%, 0); }
}
/* Phone header (.phc): the labelled action row steps aside for the same actions as 44 px icons beside the title,
   so the content starts one row (56 px) higher; ≥ 640 keeps the labelled buttons. */
.phc .ph-tools { display: none; }
@media (max-width: 639px) {
  .phc .screen-head .acts { display: none; }
  .phc .ph-tools { display: flex; gap: 8px; }
}

/* ---------- pick a day (1:1 with the app's DatePickSheet): quick picks, then a month card; sized to its content ---------- */
@media (min-width: 640px) { dialog.sheet.pick { width: min(440px, calc(100vw / var(--zoom, 1) - 48px)); height: fit-content; max-height: calc(100dvh / var(--zoom, 1) - 48px); } }
dialog.sheet.pick { height: fit-content; max-height: calc(100dvh / var(--zoom, 1) - 24px); }
dialog.sheet.pick .sheetbody { padding: 16px; flex: 0 1 auto; scrollbar-gutter: auto; }
.pk-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pk-quick .btn { width: 100%; min-width: 0; }
.pk-month { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pk-head { display: flex; align-items: center; gap: 8px; }
.pk-head h3 { flex: 1; margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.pk-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; }
.pk-wd { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; line-height: 24px; }
.pk-cell { min-height: 44px; display: flex; align-items: center; justify-content: center; }
.pk-day { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }
.pk-day span { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; transition: background .15s ease, color .15s ease; }
.pk-day:hover span { background: var(--soft); }
.pk-day.today span { color: var(--action, #0063E5); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--action, #0063E5); }
.pk-day.on span { background: var(--action, #0063E5); color: #fff; font-weight: 700; box-shadow: none; }
.pk-day:focus-visible span { outline: 2px solid var(--action, #0063E5); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pk-day span { transition: none; } }
