@font-face { font-family: "Inter var"; src: url("/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* ---------- themes: every colour on screen comes from these tokens ---------- */
:root, [data-theme="midnight"] {
  --bg: #000; --surface: #0f1014; --surface-2: #181a20; --surface-3: #22252d;
  --line: rgba(255,255,255,.075); --line-2: rgba(255,255,255,.14);
  --text: #f3f4f7; --muted: #9299a6; --faint: #5d6470;
  --accent: #8f7dff; --accent-ink: #0b0a14;
  --hero: linear-gradient(135deg, #2c2378 0%, #6b3fd0 55%, #b845a8 100%); --hero-ink: #fff;
  --shadow: 0 18px 50px rgba(0,0,0,.6); color-scheme: dark;
}
[data-theme="aurora"] {
  --bg: #050912; --surface: #0c1322; --surface-2: #131d31; --surface-3: #1b2842;
  --line: rgba(160,200,255,.09); --line-2: rgba(160,200,255,.18);
  --text: #eef4ff; --muted: #8b9bb8; --faint: #556380;
  --accent: #46d6c4; --accent-ink: #03110f;
  --hero: linear-gradient(135deg, #0b3a5c 0%, #136f7c 50%, #2aa88f 100%); --hero-ink: #fff;
}
[data-theme="ember"] {
  --bg: #0b0807; --surface: #15100e; --surface-2: #1f1815; --surface-3: #2a211d;
  --line: rgba(255,210,180,.08); --line-2: rgba(255,210,180,.16);
  --text: #fbf3ee; --muted: #a8978c; --faint: #6e6058;
  --accent: #ff8a4c; --accent-ink: #1a0a02;
  --hero: linear-gradient(135deg, #7a2a12 0%, #c8501f 55%, #e0a13a 100%); --hero-ink: #fff;
}
[data-theme="forest"] {
  --bg: #050806; --surface: #0d1410; --surface-2: #141e18; --surface-3: #1c2a21;
  --line: rgba(190,255,215,.08); --line-2: rgba(190,255,215,.16);
  --text: #eef7f1; --muted: #8ba396; --faint: #56695e;
  --accent: #5fd68f; --accent-ink: #04130a;
  --hero: linear-gradient(135deg, #0f4a2e 0%, #1f7d4f 55%, #6fae3f 100%); --hero-ink: #fff;
}
[data-theme="linen"] {
  --bg: #f4efe6; --surface: #fffdf8; --surface-2: #f0e9dc; --surface-3: #e6dccb;
  --line: rgba(70,45,20,.10); --line-2: rgba(70,45,20,.2);
  --text: #2a241d; --muted: #645a4d; --faint: #8d8170;
  --accent: #bf5330; --accent-ink: #fff;
  --hero: linear-gradient(135deg, #c8603a 0%, #d98a4a 60%, #e3b467 100%); --hero-ink: #fff;
  --shadow: 0 18px 50px rgba(80,50,20,.18); color-scheme: light;
}
[data-theme="daylight"] {
  --bg: #f1f4f9; --surface: #ffffff; --surface-2: #e9eef6; --surface-3: #dbe3ef;
  --line: rgba(20,35,70,.09); --line-2: rgba(20,35,70,.18);
  --text: #131824; --muted: #525c6f; --faint: #7a8496;
  --accent: #3d5cff; --accent-ink: #fff;
  --hero: linear-gradient(135deg, #2f49d8 0%, #5b6bff 55%, #9b7bff 100%); --hero-ink: #fff;
  --shadow: 0 18px 50px rgba(20,35,70,.16); color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none;
  font: 15px/1.4 "Inter var", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01", "calt"; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
#app { height: 100dvh; display: grid; grid-template: "main" 1fr "tabs" auto / 1fr; }
#side, #panel { display: none; }
#main { grid-area: main; min-height: 0; display: flex; flex-direction: column; }
#view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }

#tabs {
  grid-area: tabs; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line);
}
.tab { display: grid; justify-items: center; gap: 2px; padding: 7px 0 5px; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 550; letter-spacing: .01em; transition: color .15s, background .15s; }
.tab.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.tab:active { transform: scale(.96); }

#fab {
  position: fixed; right: 14px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 5;
  width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent), 0 2px 6px rgba(0,0,0,.35);
  transition: transform .15s;
}
#fab:active { transform: scale(.93); }
#fab svg { width: 24px; height: 24px; stroke-width: 2.2; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 6px; padding: calc(10px + env(safe-area-inset-top)) 12px 8px 18px; }
.top h1 { margin: 0; font-size: 22px; font-weight: 680; letter-spacing: -.025em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top h1 small { font-size: inherit; font-weight: 400; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:active { background: var(--surface-2); }
.who { width: 30px; height: 30px; border-radius: 50%; padding: 0; margin: 0 2px; box-shadow: 0 0 0 2px var(--c); transition: opacity .15s, filter .15s; overflow: hidden; }
.who img, .av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.who.off { opacity: .32; filter: grayscale(1); box-shadow: 0 0 0 2px var(--line-2); }

.seg { display: flex; margin: 0 14px 8px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.seg button { flex: 1; padding: 7px 0; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .18s, color .18s; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* ---------- month ---------- */
.dow { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 4px 5px; font-size: 10.5px; font-weight: 650; letter-spacing: .08em; color: var(--faint); text-align: center; }
.dow span.we { color: color-mix(in srgb, var(--accent) 70%, var(--muted)); }
.stage { flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; }
.track { display: flex; width: 300%; height: 100%; transform: translate3d(-33.3333%, 0, 0); will-change: transform; }
.track.settle { transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.month { width: 33.3333%; height: 100%; display: grid; padding: 0 4px 4px; }
.week { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); min-height: 0; }
.cell { min-width: 0; min-height: 0; padding: calc(25px + var(--lanes, 0) * 19px) 1.5px 2px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; position: relative; border-radius: 10px; }
.cell + .cell::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--line); opacity: .6; }
.cell.sel { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.cell .d { position: absolute; top: 3px; left: 0; right: 0; height: 20px; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.cell.out .d { color: var(--faint); opacity: .55; }
.cell.out .chip, .bar.out { opacity: .55; }
.cell.today .d b { background: var(--accent); color: var(--accent-ink); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; font-weight: 750; }
.cell .d b { font-weight: inherit; }
.chip, .bar {
  --c: var(--accent); font-size: 10.5px; line-height: 13px; font-weight: 560; letter-spacing: -.005em; color: var(--text);
  background: color-mix(in srgb, var(--c) 24%, var(--surface)); border-radius: 5px;
}
.chip { padding: 2px 3px 2px 5px; box-shadow: inset 2.5px 0 0 var(--c); flex: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 2); overflow: hidden; overflow-wrap: break-word; hyphens: auto; }
.chip.priv, .bar.priv { background: color-mix(in srgb, var(--c) 9%, var(--surface)); outline: 1px dashed color-mix(in srgb, var(--c) 60%, transparent); outline-offset: -1px; color: var(--muted); }
.chip.two { box-shadow: none; border-left: 2.5px solid; border-image: linear-gradient(var(--c), var(--c2)) 1; border-radius: 0 5px 5px 0; }
.chip.hide { display: none; }
.chip time { display: none; }
.more { font-size: 10px; line-height: 12px; font-weight: 650; color: var(--muted); padding-left: 4px; flex: none; }
.bar { position: absolute; height: 17px; top: calc(25px + var(--lane) * 19px); left: calc(var(--col) / 7 * 100% + 2px); width: calc(var(--span) / 7 * 100% - 4px); padding: 2px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; background: color-mix(in srgb, var(--c) 62%, var(--surface)); color: #fff; font-weight: 620; }
[data-theme="linen"] .bar, [data-theme="daylight"] .bar { background: color-mix(in srgb, var(--c) 85%, #fff); }
.bar.two { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 62%, var(--surface)), color-mix(in srgb, var(--c2) 62%, var(--surface))); }
.bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; left: calc(var(--col) / 7 * 100%); width: calc(var(--span) / 7 * 100% - 2px); }
.bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; width: calc(var(--span) / 7 * 100% - 2px); }
.bar.cl.cr { width: calc(var(--span) / 7 * 100%); }

/* ---------- schedule (week strip + running list) ---------- */
.strip { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 8px 6px; }
.strip button { display: grid; justify-items: center; gap: 3px; padding: 5px 0 6px; border-radius: 14px; color: var(--muted); }
.strip .w { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; color: var(--faint); }
.strip .n { font-size: 16px; font-weight: 620; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; }
.strip .today .n { color: var(--accent); }
.strip .sel .n { background: var(--accent); color: var(--accent-ink); font-weight: 750; }
.strip .dots { height: 5px; display: flex; gap: 2.5px; }
.strip .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--accent)); }
.strip.mini { row-gap: 0; }
.strip.mini button { padding: 2px 0 3px; }
.strip.mini .n { font-size: 14px; width: 30px; height: 30px; }
.strip.mini .out { opacity: .35; }
.grab { height: 16px; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.grab::after { content: ""; width: 34px; height: 4px; border-radius: 2px; background: var(--line-2); }

.agenda { padding: 4px 14px 120px; }
.dayhead { position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; gap: 8px; padding: 14px 4px 7px; background: linear-gradient(var(--bg) 78%, transparent); }
.dayhead b { font-size: 15px; font-weight: 680; letter-spacing: -.01em; }
.dayhead span { font-size: 13px; color: var(--muted); }
.dayhead.today b { color: var(--accent); }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.row { --c: var(--accent); display: grid; grid-template-columns: 52px 4px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px 12px 12px; width: 100%; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
.row:active { background: var(--surface-2); }
.row .t { font-size: 12.5px; font-weight: 600; text-align: right; line-height: 1.25; }
.row .t small { display: block; font-size: 11.5px; font-weight: 450; color: var(--muted); }
.row .edge { align-self: stretch; border-radius: 2px; background: linear-gradient(var(--c), var(--c2, var(--c))); min-height: 34px; }
.row .ti { font-size: 15px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.row .me { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-top: 1px; }
.row .me svg { width: 13px; height: 13px; }
.row.past { opacity: .5; }
.empty { padding: 16px; color: var(--muted); font-size: 14px; }
.avs { display: flex; }
.av { flex: none; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--surface); background: var(--c); }
.av + .av { margin-left: -7px; }
.av, .who { display: grid; place-items: center; }
.av b, .who b { font-size: 11px; font-weight: 750; color: #fff; }
.who { background: var(--c); }
.line.dev { padding-left: 60px; min-height: 46px; }
.line form, form.line { margin: 0; }
.locked { height: 100dvh; display: grid; place-content: center; justify-items: center; text-align: center; padding: 30px; gap: 6px; grid-column: 1 / -1; }
.locked img { width: 76px; border-radius: 22px; margin-bottom: 14px; }
.locked h1 { font-size: 25px; letter-spacing: -.03em; margin: 0; }
.locked p { color: var(--muted); max-width: 300px; margin: 6px 0 0; }

/* ---------- today ---------- */
.today-wrap { padding: calc(14px + env(safe-area-inset-top)) 16px 120px; max-width: 760px; margin: 0 auto; width: 100%; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hello { font-size: 30px; font-weight: 700; letter-spacing: -.035em; line-height: 1.12; margin: 4px 0 18px; }
.hello span { color: var(--muted); font-weight: 500; }
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px 20px 18px; background: var(--hero); color: var(--hero-ink); box-shadow: var(--shadow); width: 100%; text-align: left; display: block; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.28), transparent); pointer-events: none; }
.hero .k { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .8; display: flex; align-items: center; gap: 7px; }
.hero .k i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(255,255,255,.22); }
.hero .ti { font-size: 27px; font-weight: 720; letter-spacing: -.03em; line-height: 1.14; margin: 10px 0 6px; overflow-wrap: anywhere; }
.hero .me { font-size: 14.5px; opacity: .88; }
.hero .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.pill { font-size: 13px; font-weight: 650; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); }
.hero .av { box-shadow: 0 0 0 2px rgba(255,255,255,.55); width: 28px; height: 28px; }
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 10px; }
.sec h2 { margin: 0; font-size: 17px; font-weight: 680; letter-spacing: -.02em; }
.sec button { font-size: 13px; font-weight: 600; color: var(--accent); }
.weekbar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.weekbar button { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 9px 0 8px; display: grid; justify-items: center; gap: 4px; }
.weekbar .w { font-size: 10.5px; font-weight: 650; letter-spacing: .07em; color: var(--faint); }
.weekbar .n { font-size: 17px; font-weight: 660; }
.weekbar .on { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.weekbar .on .n { color: var(--accent); }
.weekbar .dots { height: 5px; display: flex; gap: 2.5px; }
.weekbar .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--accent)); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duo button { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px; text-align: left; position: relative; overflow: hidden; }
.duo button::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); }
.duo .hd { display: flex; align-items: center; gap: 9px; font-weight: 660; margin-bottom: 10px; }
.duo .av { width: 32px; height: 32px; box-shadow: 0 0 0 2px var(--c); }
.duo .nx { font-size: 14px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.duo .wh { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------- tasks ---------- */
.tasks { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.task { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.task + .task, .tasks form { border-top: 1px solid var(--line); }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; transition: all .18s; }
.tick svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.task.done .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.task.done .tick svg { opacity: 1; }
.task .tt { flex: 1; min-width: 0; font-weight: 560; overflow-wrap: anywhere; }
.task.done .tt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.task .due { font-size: 12.5px; color: var(--muted); display: block; font-weight: 450; }
.task .due.late { color: #ff6b6b; }
.task .del { color: var(--faint); width: 32px; height: 32px; display: grid; place-items: center; }
.task .del svg { width: 17px; height: 17px; }
.tasks form { display: flex; align-items: center; gap: 12px; padding: 6px 14px; }
.tasks form svg { color: var(--accent); }
.tasks input { flex: 1; background: none; border: 0; outline: 0; padding: 9px 0; min-width: 0; }
.tasks input::placeholder { color: var(--faint); }
.page { padding: 6px 16px 120px; max-width: 760px; margin: 0 auto; width: 100%; }
.page h3 { font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 22px 4px 9px; }

/* ---------- settings ---------- */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme { border-radius: 18px; padding: 10px; background: var(--surface); border: 1.5px solid var(--line); text-align: left; font-size: 13px; font-weight: 620; }
.theme.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.theme .pv { height: 62px; border-radius: 11px; margin-bottom: 8px; background: var(--bg); border: 1px solid var(--line-2); padding: 8px; display: grid; gap: 4px; align-content: start; }
.theme .pv i { height: 16px; border-radius: 6px; background: var(--hero); }
.theme .pv u { height: 7px; border-radius: 4px; background: var(--surface-3); width: 70%; }
.theme .pv u + u { width: 45%; background: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 52px; }
.line + .line { border-top: 1px solid var(--line); }
.line > span:not(.av) { flex: 1; font-weight: 560; min-width: 0; }
.line .av { width: 34px; height: 34px; box-shadow: 0 0 0 2px var(--c); }
.line small { display: block; font-weight: 450; color: var(--muted); font-size: 12.5px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 28px; height: 28px; border-radius: 50%; background: var(--c); position: relative; flex: none; }
.sw.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c); }
.sw.auto { background: conic-gradient(#ff7aa8, #ffb454, #5fd68f, #46d6c4, #6c8cff, #b07cff, #ff7aa8); }
input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; border-radius: 50%; flex: none; cursor: pointer; -webkit-appearance: none; appearance: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--line-2); }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }

/* ---------- sheets ---------- */
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .22s; display: flex; align-items: flex-end; justify-content: center; }
.backdrop.in { opacity: 1; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: 28px 28px 0 0; border: 1px solid var(--line-2); border-bottom: 0; box-shadow: var(--shadow); transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.85,.25,1); padding-bottom: env(safe-area-inset-bottom); }
.backdrop.in .sheet { transform: none; }
.sheet .handle { padding: 9px 0 3px; display: grid; place-items: center; touch-action: none; }
.sheet .handle::after { content: ""; width: 38px; height: 4.5px; border-radius: 3px; background: var(--line-2); }
.sheet .body { overflow-y: auto; padding: 6px 20px 22px; scrollbar-width: none; }
.sheet h2 { font-size: 23px; font-weight: 700; letter-spacing: -.03em; line-height: 1.18; margin: 4px 0 4px; overflow-wrap: anywhere; }
.sheet .sub { color: var(--muted); font-size: 14px; }
.band { height: 5px; border-radius: 3px; width: 44px; margin: 8px 0 12px; background: linear-gradient(90deg, var(--c), var(--c2, var(--c))); }
.fact { display: flex; gap: 14px; padding: 11px 0; align-items: flex-start; }
.fact svg { color: var(--muted); margin-top: 1px; width: 20px; height: 20px; }
.fact div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fact small { display: block; color: var(--muted); font-size: 13px; }
.fact a { color: var(--accent); text-decoration: none; }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.form .actions { position: sticky; bottom: -22px; margin: 16px -20px -22px; padding: 12px 20px 22px; background: linear-gradient(transparent, var(--surface) 14px); z-index: 2; }
.btn { flex: 1; padding: 13px 16px; border-radius: 15px; font-weight: 650; background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.btn.pri { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { color: #ff6b6b; flex: 0 0 auto; }
.btn:active { transform: scale(.98); }
.people { display: flex; gap: 8px; flex-wrap: wrap; }
.person { display: flex; align-items: center; gap: 8px; padding: 5px 13px 5px 5px; border-radius: 99px; border: 1.5px solid var(--line-2); font-weight: 600; font-size: 14px; color: var(--muted); }
.person .av { box-shadow: none; filter: grayscale(1); opacity: .6; width: 26px; height: 26px; }
.person.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--text); }
.person.on .av { filter: none; opacity: 1; }

.form label { display: block; font-size: 11.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 16px 2px 7px; }
.form .title { width: 100%; background: none; border: 0; outline: 0; font-size: 24px; font-weight: 700; letter-spacing: -.03em; padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.form .title::placeholder { color: var(--faint); }
.field { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; outline: 0; min-width: 0; -webkit-appearance: none; appearance: none; }
.field:focus { border-color: var(--accent); }
textarea.field { resize: none; min-height: 74px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
[hidden] { display: none !important; }
.switch { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; font-weight: 600; }
.switch small { display: block; font-weight: 450; font-size: 12.5px; color: var(--muted); }
.quick { display: flex; gap: 7px; margin-top: 9px; }
.quick button { flex: 1; padding: 7px 0; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.quick button:active { background: var(--surface-3); color: var(--text); }
.switch input { appearance: none; width: 48px; height: 28px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background .18s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); }
.chooser { display: grid; gap: 12px; padding: 10px 0 6px; }
.chooser button { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); font-size: 18px; font-weight: 660; }
.chooser .av { width: 48px; height: 48px; box-shadow: 0 0 0 2.5px var(--c); }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; margin-bottom: 12px; }
.search input { flex: 1; background: none; border: 0; outline: 0; padding: 12px 0; min-width: 0; }
.search svg { color: var(--muted); }

/* ---------- desktop ---------- */
@media (min-width: 1000px) {
  body { font-size: 14.5px; }
  #app { grid-template: "side main panel" 1fr / 272px 1fr 0; }
  #tabs, #fab { display: none; }
  #side { grid-area: side; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; scrollbar-width: none; }
  .brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 720; letter-spacing: -.03em; padding: 2px 8px 16px; }
  .brand img { width: 30px; height: 30px; border-radius: 9px; }
  .new { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; margin: 0 4px 14px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 680; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
  .new svg { width: 19px; height: 19px; stroke-width: 2.4; }
  .nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; text-align: left; }
  .nav:hover { background: var(--surface-2); color: var(--text); }
  .nav.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
  .nav svg { width: 20px; height: 20px; }
  #side h4 { font-size: 11px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 22px 12px 8px; }
  .mini-h { display: flex; align-items: center; padding: 0 4px 2px 12px; font-weight: 660; font-size: 13.5px; }
  .mini-h span { flex: 1; }
  .mini-h .icon-btn { width: 28px; height: 28px; }
  .mini-h svg { width: 16px; height: 16px; }
  #side .dow { padding: 6px 0 2px; font-size: 9.5px; }
  #side .strip.mini { padding: 0; }
  #side .strip.mini .n { width: 27px; height: 27px; font-size: 12.5px; }
  #side .strip.mini .dots { height: 4px; }
  #side .strip.mini .dots i { width: 4px; height: 4px; }
  .flt { display: flex; align-items: center; gap: 11px; padding: 7px 12px; border-radius: 12px; font-weight: 600; text-align: left; }
  .flt:hover { background: var(--surface-2); }
  .flt .av { width: 26px; height: 26px; box-shadow: 0 0 0 2px var(--c); }
  .flt.off { color: var(--faint); }
  .flt.off .av { filter: grayscale(1); opacity: .4; box-shadow: 0 0 0 2px var(--line-2); }
  .flt i { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
  .flt.off i { background: var(--line-2); }

  .top { padding: 18px 22px 12px 28px; }
  .top h1 { font-size: 26px; }
  .top .who { display: none; }
  .seg { margin: 0; width: 230px; flex: none; }
  .top .seg { order: 5; margin-left: 8px; }
  .dow { padding: 0 20px 6px; font-size: 11px; }
  .month { padding: 0 20px 18px; }
  .week { border-top: 0; }
  .week .cell { border-top: 1px solid var(--line); border-radius: 0; padding: calc(30px + var(--lanes, 0) * 22px) 4px 4px; gap: 3px; cursor: pointer; }
  .week .cell:hover { background: color-mix(in srgb, var(--text) 3.5%, transparent); }
  .cell.sel { background: color-mix(in srgb, var(--accent) 8%, transparent) !important; }
  .cell .d { place-items: center start; padding-left: 8px; top: 6px; font-size: 13px; }
  .chip, .bar { font-size: 12px; line-height: 16px; border-radius: 6px; cursor: pointer; }
  .chip { padding: 2px 6px 2px 8px; box-shadow: inset 3px 0 0 var(--c); }
  .chip:hover, .bar:hover { filter: brightness(1.18); }
  .chip time { display: inline; color: var(--muted); font-weight: 500; margin-right: 5px; font-variant-numeric: tabular-nums; }
  .bar { height: 20px; top: calc(30px + var(--lane) * 22px); padding: 2px 9px; }
  .agenda { padding: 4px 28px 60px; max-width: 860px; }
  .today-wrap { padding-top: 34px; padding-bottom: 60px; }
  .hello { font-size: 36px; }
  .page { padding-top: 10px; }
  .backdrop { align-items: center; }
  .sheet { border-radius: 26px; border-bottom: 1px solid var(--line-2); max-height: 86dvh; transform: translateY(18px) scale(.97); opacity: 0; transition: transform .22s, opacity .22s; }
  .backdrop.in .sheet { opacity: 1; }
  .sheet .handle { visibility: hidden; padding: 6px; }
  .themes { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 1280px) {
  #app { grid-template-columns: 272px 1fr 348px; }
  #panel { grid-area: panel; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); min-height: 0; }
  #panel .ph { padding: 22px 22px 6px; }
  #panel .ph .eyebrow { margin-bottom: 2px; }
  #panel .ph b { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
  #panel .agenda { padding: 8px 14px 30px; }
  #panel .rows { background: var(--surface-2); }
  #panel .dayhead { background: linear-gradient(var(--surface) 78%, transparent); }
  #panel .btn { margin: 14px 4px 0; display: block; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
