/* IB Planner: iOS-style glass UI.
   System font (SF Pro on Apple devices), translucent materials over a soft colour field,
   iOS system colours, inset-grouped lists and sheets. Light + dark via tokens. */

/* ---------- tokens ---------- */
:root {
  --bg: #EDF0F6;
  --bg-solid: #F2F2F7;
  --blob-1: rgb(0 122 255 / .26);
  --blob-2: rgb(175 82 222 / .20);
  --blob-3: rgb(255 149 0 / .18);
  --blob-4: rgb(0 199 190 / .20);
  --blob-5: rgb(255 45 85 / .10);

  --glass: rgb(255 255 255 / .58);
  --glass-thick: rgb(250 250 252 / .80);
  --glass-solid: #F9F9FB;
  --glass-line: rgb(255 255 255 / .78);
  --glass-hi: rgb(255 255 255 / .9);
  --glass-shadow: 0 1px 1px rgb(0 0 0 / .03), 0 10px 30px rgb(30 40 80 / .08);
  --glass-shadow-lg: 0 30px 80px rgb(20 25 50 / .22), 0 2px 8px rgb(0 0 0 / .06);
  --blur: blur(28px) saturate(185%);
  --cell: rgb(255 255 255 / .66);
  --cell-hover: rgb(255 255 255 / .85);
  --sel: #FFFFFF;

  --label: #0B0B0F;
  --label-2: rgb(60 60 67 / .66);
  --label-3: rgb(60 60 67 / .36);
  --separator: rgb(60 60 67 / .17);
  --fill: rgb(120 120 128 / .12);
  --fill-2: rgb(120 120 128 / .22);

  --accent: #007AFF;
  --on-accent: #FFFFFF;
  --red: #FF3B30;
  --orange: #FF9500;
  --green: #34C759;
  --gray: #8E8E93;

  --tint: 18%;
  --tint-strong: 24%;
  --ink-mix: 58%;
  --ink-base: #000000;
  --sw-mix: 100%;

  --r-xl: 26px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --gutter: 24px;
  --num-h: 34px;
  --lane-h: 20px;
  --stack-h: 44px;
  --hair: 1px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #040507;
    --bg-solid: #000000;
    --blob-1: rgb(10 132 255 / .30);
    --blob-2: rgb(191 90 242 / .24);
    --blob-3: rgb(255 159 10 / .15);
    --blob-4: rgb(99 230 226 / .15);
    --blob-5: rgb(255 55 95 / .13);
    --glass: rgb(40 40 44 / .50);
    --glass-thick: rgb(38 38 42 / .80);
    --glass-solid: #1C1C1E;
    --glass-line: rgb(255 255 255 / .11);
    --glass-hi: rgb(255 255 255 / .12);
    --glass-shadow: 0 1px 1px rgb(0 0 0 / .3), 0 12px 32px rgb(0 0 0 / .35);
    --glass-shadow-lg: 0 30px 80px rgb(0 0 0 / .6);
    --cell: rgb(255 255 255 / .07);
    --cell-hover: rgb(255 255 255 / .12);
    --sel: rgb(255 255 255 / .22);
    --label: #FFFFFF;
    --label-2: rgb(235 235 245 / .62);
    --label-3: rgb(235 235 245 / .32);
    --separator: rgb(84 84 88 / .55);
    --fill: rgb(118 118 128 / .24);
    --fill-2: rgb(118 118 128 / .36);
    --accent: #0A84FF;
    --red: #FF453A;
    --orange: #FF9F0A;
    --green: #30D158;
    --gray: #98989D;
    --tint: 26%;
    --tint-strong: 32%;
    --ink-mix: 55%;
    --ink-base: #FFFFFF;
    --sw-mix: 88%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #040507;
  --bg-solid: #000000;
  --blob-1: rgb(10 132 255 / .30);
  --blob-2: rgb(191 90 242 / .24);
  --blob-3: rgb(255 159 10 / .15);
  --blob-4: rgb(99 230 226 / .15);
  --blob-5: rgb(255 55 95 / .13);
  --glass: rgb(40 40 44 / .50);
  --glass-thick: rgb(38 38 42 / .80);
  --glass-solid: #1C1C1E;
  --glass-line: rgb(255 255 255 / .11);
  --glass-hi: rgb(255 255 255 / .12);
  --glass-shadow: 0 1px 1px rgb(0 0 0 / .3), 0 12px 32px rgb(0 0 0 / .35);
  --glass-shadow-lg: 0 30px 80px rgb(0 0 0 / .6);
  --cell: rgb(255 255 255 / .07);
  --cell-hover: rgb(255 255 255 / .12);
  --sel: rgb(255 255 255 / .22);
  --label: #FFFFFF;
  --label-2: rgb(235 235 245 / .62);
  --label-3: rgb(235 235 245 / .32);
  --separator: rgb(84 84 88 / .55);
  --fill: rgb(118 118 128 / .24);
  --fill-2: rgb(118 118 128 / .36);
  --accent: #0A84FF;
  --red: #FF453A;
  --orange: #FF9F0A;
  --green: #30D158;
  --gray: #98989D;
  --tint: 26%;
  --tint-strong: 32%;
  --ink-mix: 55%;
  --ink-base: #FFFFFF;
  --sw-mix: 88%;
  color-scheme: dark;
}
@media (min-resolution: 2dppx) { :root { --hair: .5px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(44vmax 40vmax at 6% 4%, var(--blob-1), transparent 70%),
    radial-gradient(38vmax 34vmax at 94% 8%, var(--blob-2), transparent 70%),
    radial-gradient(42vmax 38vmax at 90% 94%, var(--blob-3), transparent 70%),
    radial-gradient(40vmax 36vmax at 4% 96%, var(--blob-4), transparent 70%),
    radial-gradient(30vmax 26vmax at 52% 48%, var(--blob-5), transparent 72%);
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--glass-solid); padding: 8px 14px; border-radius: 12px; }
.skip:focus { top: 12px; }
.wrap {
  width: 100%;
  max-width: 1260px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
}
.num { font-variant-numeric: tabular-nums; }

/* glass material */
.glass, .card, .count, .month, .daypanel, .ag-list, .scard, .tt-desktop, .task-add, .heads-up {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass, .card, .count, .month, .daypanel, .ag-list, .scard, .tt-desktop, .task-add, .heads-up, .brand, .top-nav, .icon-btn, .tabbar, .sheet, .toast { background: var(--glass-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .card, .count, .month, .daypanel, .ag-list, .scard, .tt-desktop, .task-add, .heads-up, .brand, .top-nav, .icon-btn, .tabbar, .sheet, .toast { background: var(--glass-solid); }
}

/* type (iOS text styles) */
.display { font-size: 34px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; text-wrap: balance; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--label-2); }
.sub { color: var(--label-2); margin-top: 4px; font-size: 15px; }

/* ---------- header + navigation ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-bottom: 6px;
  pointer-events: none;
}
.head-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.head-bar > * { pointer-events: auto; }
.brand, .top-nav, .icon-btn, .tabbar {
  background: var(--glass-thick);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
}
.brand {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px 0 14px; border-radius: 22px;
  color: var(--label); font-size: 16px; font-weight: 600; letter-spacing: -.01em;
}
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.brand-sub { font-size: 13px; color: var(--label-2); font-weight: 500; }
.top-nav { display: flex; gap: 2px; padding: 4px; border-radius: 26px; }
.top-nav button {
  display: flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 16px; border: 0; border-radius: 20px; background: none;
  color: var(--label); font-size: 15px; font-weight: 500;
}
.top-nav button svg { width: 19px; height: 19px; }
.top-nav button[aria-current="page"] { background: var(--sel); color: var(--accent); font-weight: 600; box-shadow: 0 1px 4px rgb(0 0 0 / .1), inset 0 1px 0 var(--glass-hi); }
.head-actions { justify-self: end; display: flex; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; color: var(--label); padding: 0; }
.icon-btn svg { width: 20px; height: 20px; }
.tabbar { display: none; }

.banner { max-width: 1260px; margin: 8px auto 0; padding: 0 var(--gutter); }
.banner .pillnote { display: inline-flex; padding: 10px 16px; border-radius: 16px; background: rgb(255 149 0 / .16); color: var(--label); font-size: 14px; font-weight: 500; }

/* ---------- buttons + controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border: 0; border-radius: 18px;
  background: var(--fill); color: var(--accent);
  font-size: 15px; font-weight: 600; white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; stroke-width: 2.2; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.quiet { background: none; }
.btn.danger { background: rgb(255 59 48 / .12); color: var(--red); }
.btn.danger.armed { background: var(--red); color: #fff; }
.btn.small { height: 30px; padding: 0 12px; font-size: 14px; border-radius: 15px; }
.link { background: none; border: 0; padding: 4px 2px; color: var(--accent); font-size: 15px; font-weight: 500; border-radius: 8px; }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 999px; background: var(--fill); max-width: 100%; }
.seg button { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--label); font-size: 13px; font-weight: 600; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--sel); box-shadow: 0 1px 4px rgb(0 0 0 / .12), 0 0 0 .5px rgb(0 0 0 / .04); }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--label); cursor: pointer; user-select: none; }
.switch input, .ios-switch {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: none; width: 51px; height: 31px; margin: 0;
  border-radius: 16px; background: var(--fill-2); cursor: pointer;
  transition: background .2s;
}
.switch input::after, .ios-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgb(0 0 0 / .15), 0 1px 1px rgb(0 0 0 / .16);
  transition: transform .2s cubic-bezier(.3, .7, .4, 1);
}
.switch input:checked, .ios-switch:checked { background: var(--green); }
.switch input:checked::after, .ios-switch:checked::after { transform: translateX(20px); }

/* subject swatch + labels */
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c, var(--gray)); background: color-mix(in oklab, var(--c, var(--gray)) var(--sw-mix), white); }
.sw.mock { background: var(--red); }
.sw.holiday { background: var(--gray); }
.sw.grades { background: none; box-shadow: inset 0 0 0 1.5px var(--label-2); }
.sw.none { background: none; box-shadow: inset 0 0 0 1.5px var(--label-3); }
.lbl { display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%; font-weight: 600; font-size: 15px; line-height: 1.3; }
.lbl .sw { transform: translateY(1px); }
.minipill { display: inline-block; max-width: 100%; padding: 2px 8px; border-radius: 999px; background: var(--label); color: var(--bg-solid); font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1.35; }
.detail { font-size: 13px; color: var(--label-2); }

/* ---------- views ---------- */
.view { padding-top: 18px; padding-bottom: 60px; outline: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card { border-radius: var(--r-xl); padding: 18px 20px 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.card-head h2 { font-size: 20px; font-weight: 700; letter-spacing: .01em; }
.card-head .hint { color: var(--label-2); font-size: 15px; font-weight: 400; margin-left: 8px; letter-spacing: 0; }
.empty { color: var(--label-2); font-size: 15px; padding: 6px 0; }
.empty b { color: var(--label); font-weight: 600; }

/* ---------- today ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: end; margin: 6px 0 22px; }
.hero-day { color: var(--red); font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.hero .display { font-size: clamp(34px, 5vw, 48px); margin-top: 2px; }
.hero .sub { font-size: 17px; }
.heads-up {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 9px 16px 9px 13px; border-radius: 22px;
  color: var(--label); font-weight: 600; font-size: 15px; text-align: left;
}
.heads-up::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; box-shadow: 0 0 0 4px rgb(255 59 48 / .18); }
.heads-up.calm::before { background: var(--green); box-shadow: 0 0 0 4px rgb(52 199 89 / .2); }
.count { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border-radius: var(--r-xl); padding: 16px 20px 16px; min-width: 330px; }
.count-cap { font-size: 13px; font-weight: 600; color: var(--red); text-transform: uppercase; letter-spacing: .04em; }
.count-row { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.count-num { font-family: var(--font-round); font-size: 60px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.count-label { font-size: 17px; font-weight: 600; }
.count-sub { color: var(--label-2); font-size: 14px; margin-top: 4px; }
.count-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 0; padding: 12px 0 0; border-top: var(--hair) solid var(--separator); list-style: none; font-size: 13px; }
.count-mini li { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.count-mini span { color: var(--label-2); }
.count-mini b { font-family: var(--font-round); font-size: 17px; font-weight: 700; }

.today-cols { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.today-cols .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.daylist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dl-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.dl-time { display: flex; flex-direction: column; padding-top: 8px; line-height: 1.2; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; }
.dl-time small { font-size: 13px; color: var(--label-2); font-weight: 400; margin-top: 2px; }
.dl-block {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 1px;
  width: 100%; min-height: 52px; padding: 8px 12px 8px 16px;
  border: 0; border-radius: 12px; text-align: left; color: var(--label);
  background: var(--fill);
  background: color-mix(in srgb, var(--c, var(--gray)) var(--tint), transparent);
}
.dl-block::before { content: ''; position: absolute; left: 5px; top: 7px; bottom: 7px; width: 4px; border-radius: 2px; background: var(--c, var(--gray)); }
.dl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dl-name { font-weight: 600; font-size: 16px; color: color-mix(in oklab, var(--c, var(--gray)) var(--ink-mix), var(--ink-base)); }
.dl-meta { font-size: 13px; color: var(--label-2); }
.dl-row.past .dl-block { opacity: .45; }
.dl-row.past .dl-time { color: var(--label-3); }
.dl-row.now .dl-block { box-shadow: inset 0 0 0 2px var(--red); }
.dl-row.free .dl-block { background: none; box-shadow: inset 0 0 0 1px var(--separator); min-height: 40px; justify-content: center; }
.dl-row.free .dl-block::before { display: none; }
.dl-row.brk .dl-time { padding-top: 5px; }
.dl-band { display: flex; align-items: center; justify-content: center; min-height: 30px; border-radius: 10px; background: var(--fill); color: var(--label-2); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.now-tag { font-size: 12px; font-weight: 700; color: var(--red); white-space: nowrap; }
.next-tag { font-size: 12px; font-weight: 600; color: var(--label-2); white-space: nowrap; }
.prog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--red); }
.day-note { font-size: 14px; color: var(--label-2); margin: -4px 0 12px; }

.uplist { list-style: none; margin: 0; padding: 0; }
.uplist li { position: relative; }
.uplist li + li::before, .ag-list li + li::before, .dp-list li + li::before { content: ''; position: absolute; top: 0; left: 64px; right: 0; border-top: var(--hair) solid var(--separator); }
.dp-list li + li::before { left: 6px; }
.up-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  width: 100%; padding: 10px 6px; border: 0; background: none; text-align: left; border-radius: 14px; color: var(--label);
}
.up-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.up-row.done .lbl { text-decoration: line-through; color: var(--label-2); }
.datechip { display: flex; flex-direction: column; align-items: center; line-height: 1.05; padding: 6px 0 7px; border-radius: 12px; background: var(--cell); font-variant-numeric: tabular-nums; }
.datechip .wd { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--red); }
.datechip b { font-size: 20px; font-weight: 600; margin: 1px 0; }
.datechip .mo { font-size: 10.5px; font-weight: 500; color: var(--label-2); text-transform: uppercase; letter-spacing: .04em; }
.datechip.today { background: var(--red); }
.datechip.today .wd, .datechip.today b, .datechip.today .mo { color: #fff; }
.when { font-size: 14px; font-weight: 500; color: var(--label-2); white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.when.urgent { color: var(--red); font-weight: 600; }
.when.soon { color: var(--orange); font-weight: 600; }
.when.live { color: var(--green); font-weight: 600; }
.more-link { margin-top: 10px; }

/* tasks (Reminders-style round checks) */
.tasklist { list-style: none; margin: 0; padding: 0; }
.task { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px 0; }
.tasklist .task + .task::before { content: ''; position: absolute; top: 0; left: 40px; right: 0; border-top: var(--hair) solid var(--separator); }
.check { position: relative; display: grid; place-items: center; width: 32px; height: 32px; cursor: pointer; }
.check input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.check .box { width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--c, var(--label-3)); display: grid; place-items: center; transition: background .15s, border-color .15s; pointer-events: none; }
.check .box svg { width: 13px; height: 13px; stroke-width: 3; opacity: 0; color: var(--on, #fff); }
.check input:checked + .box { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); }
.check input:checked + .box svg { opacity: 1; }
.check input:focus-visible + .box { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.task-main { border: 0; background: none; padding: 5px 0 3px; text-align: left; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--label); border-radius: 8px; }
.task-title { font-size: 16px; overflow-wrap: anywhere; }
.task.done .task-title { color: var(--label-2); }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 13px; color: var(--label-2); }
.task-meta .m { display: inline-flex; align-items: center; gap: 5px; }
.task-meta .sw { width: 8px; height: 8px; }
.task-meta .overdue { color: var(--red); font-weight: 600; }
.task-meta .today { color: var(--orange); font-weight: 600; }
.quick { display: flex; gap: 8px; margin-bottom: 6px; }
.quick input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 0; border-radius: 20px; background: var(--fill); font-size: 16px; }
.quick input::placeholder { color: var(--label-3); }
.quick .btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* focus timer (Clock-style) */
.focus-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
.ring { position: relative; width: 148px; height: 148px; }
.ring svg { width: 148px; height: 148px; transform: rotate(-90deg); }
.ring .trk { stroke: var(--fill-2); stroke-width: 7; }
.ring .arc { stroke: var(--orange); stroke-width: 7; transition: stroke-dashoffset .9s linear; }
.ring.paused .arc { stroke: var(--label-3); }
.ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-num b { font-size: 34px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.01em; }
.ring-num span { font-size: 13px; color: var(--label-2); margin-top: 6px; }
.focus-controls { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.focus-controls .seg { align-self: flex-start; }
.focus-controls .btns { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.round-btn {
  display: grid; place-items: center; width: 72px; height: 72px; padding: 0; border: 0; border-radius: 50%;
  font-size: 15px; font-weight: 500; position: relative;
}
.round-btn::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .35); pointer-events: none; }
.round-btn.go { background: rgb(52 199 89 / .2); color: var(--green); }
.round-btn.pause { background: rgb(255 149 0 / .2); color: var(--orange); }
.round-btn.stop { background: var(--fill-2); color: var(--label); }
.select-pill { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
.select-pill select { appearance: none; -webkit-appearance: none; height: 36px; max-width: 100%; padding: 0 34px 0 14px; border: 0; border-radius: 18px; background: var(--fill); color: var(--label); font-size: 15px; font-weight: 500; }
.select-pill svg { position: absolute; right: 12px; width: 14px; height: 14px; stroke-width: 2.2; color: var(--label-2); pointer-events: none; }
.focus-week { margin-top: 18px; padding-top: 14px; border-top: var(--hair) solid var(--separator); }
.fw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.fw-head h3 { font-size: 17px; font-weight: 600; }
.fw-head span { font-size: 14px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(84px, 128px) minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: 14px; }
.bar-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.bar-label .t { overflow-wrap: anywhere; line-height: 1.2; }
.bar-track { position: relative; height: 12px; }
.bar-track::before { content: ''; position: absolute; left: 0; top: -4px; bottom: -4px; width: 1px; background: var(--separator); }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; min-width: 2px; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-goal { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--label-2); border-radius: 1px; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--label-2); font-weight: 500; white-space: nowrap; }
.fw-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--label-2); }
.fw-legend i { display: inline-block; width: 2px; height: 12px; background: var(--label-2); border-radius: 1px; }

/* ---------- timetable ---------- */
.tt-desktop { border-radius: var(--r-xl); padding: 14px; overflow-x: auto; }
.tt { display: grid; grid-template-columns: 76px repeat(var(--days), minmax(104px, 1fr)); gap: 6px; min-width: 640px; }
.tt-dayhead { display: flex; align-items: center; gap: 7px; padding: 4px 10px 6px; font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--label-2); }
.tt-dayhead.today { color: var(--red); }
.tt-dayhead.today::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.tt-time { display: flex; flex-direction: column; justify-content: flex-start; padding: 8px 6px; border: 0; background: none; border-radius: 10px; text-align: left; color: var(--label); font-variant-numeric: tabular-nums; line-height: 1.25; }
.tt-time b { font-size: 15px; font-weight: 600; }
.tt-time span { font-size: 13px; color: var(--label-2); }
.tt-time em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--label-3); margin-top: 3px; overflow-wrap: anywhere; max-width: 100%; }
.tt-time.brk { justify-content: center; padding-block: 4px; }
.tt-cell {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  min-height: 66px; padding: 8px 10px 8px 15px; border: 0; border-radius: 12px; text-align: left; color: var(--label);
  background: var(--fill);
  background: color-mix(in srgb, var(--c, var(--gray)) var(--tint), transparent);
}
.tt-cell::before { content: ''; position: absolute; left: 5px; top: 7px; bottom: 7px; width: 4px; border-radius: 2px; background: var(--c, var(--gray)); }
.tt-cell .n { font-weight: 600; font-size: 14.5px; line-height: 1.2; overflow-wrap: anywhere; color: color-mix(in oklab, var(--c, var(--gray)) var(--ink-mix), var(--ink-base)); }
.tt-cell .m { font-size: 12.5px; color: var(--label-2); line-height: 1.25; overflow-wrap: anywhere; }
.tt-cell .x { font-size: 12px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.tt-cell.empty { background: rgb(120 120 128 / .06); align-items: center; justify-content: center; color: transparent; padding: 8px; }
.tt-cell.empty::before { display: none; }
.tt-cell.empty svg { width: 18px; height: 18px; }
.tt-cell.empty:focus-visible { color: var(--accent); background: var(--fill); }
.tt-cell.now { box-shadow: inset 0 0 0 2px var(--red); }
.tt-cell.now::after { content: 'Now'; position: absolute; top: 7px; right: 9px; font-size: 11px; font-weight: 700; color: var(--red); }
.tt-break { grid-column: 2 / -1; display: flex; align-items: center; justify-content: center; min-height: 30px; border-radius: 10px; background: var(--fill); color: var(--label-2); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.tt-mobile { display: none; }
.tt-days { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); width: 100%; margin-bottom: 14px; }
.tt-days button { padding: 0; }
.tt-days button.today { color: var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; font-size: 14px; color: var(--label-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend b { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--label); }
.tt-foot { margin-top: 10px; font-size: 13px; color: var(--label-2); }

/* ---------- calendar ---------- */
.cal-title .display span { color: var(--red); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 13px 0 11px; border: 0; border-radius: 16px;
  background: var(--cell); box-shadow: inset 0 0 0 1px var(--glass-line), 0 1px 2px rgb(0 0 0 / .04);
  font-size: 13.5px; font-weight: 600; color: var(--label);
}
.chip[aria-pressed="false"] { opacity: .45; }
.chip[aria-pressed="false"] .sw { background: none; box-shadow: inset 0 0 0 1.5px var(--c, var(--label-3)); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.month { border-radius: var(--r-xl); overflow: hidden; }
.mhead { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 10px 0 6px; }
.mhead span { padding: 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--label-2); text-align: right; }
.mhead span:nth-child(n+6) { color: var(--label-3); }
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 3px; padding-bottom: 6px; border-top: var(--hair) solid var(--separator); }
.mday { grid-row: 1 / -1; margin: 0 0 -6px; padding: 0; border: 0; border-left: var(--hair) solid var(--separator); background: none; min-height: 108px; border-radius: 0; }
.mday.c1 { border-left: 0; }
.mday.wknd { background: rgb(120 120 128 / .05); }
.mday:focus-visible { outline-offset: -3px; }
.mnum { grid-row: 1; justify-self: end; align-self: start; z-index: 1; pointer-events: none; margin: 5px 6px 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mnum.out { color: var(--label-3); }
.mnum.sel { background: var(--label); color: var(--bg-solid); font-weight: 600; }
.mnum.today { background: var(--red); color: #fff; font-weight: 600; }
.bar {
  z-index: 1; min-width: 0; height: var(--lane-h); margin: 0 5px; padding: 0 8px;
  border: 0; border-radius: 6px; text-align: left;
  font-size: 11.5px; font-weight: 600; line-height: var(--lane-h);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  --c: var(--gray);
  background: color-mix(in srgb, var(--c) var(--tint-strong), transparent);
  color: color-mix(in oklab, var(--c) var(--ink-mix), var(--ink-base));
}
.bar.cont-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bar.cont-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bar.mock { --c: var(--red); }
.bar.holiday { --c: var(--gray); }
.bar.done { opacity: .5; text-decoration: line-through; }
.mstack { z-index: 1; display: flex; flex-direction: column; gap: 3px; padding: 0 5px; min-width: 0; }
.mp {
  display: block; width: 100%; min-width: 0; padding: 3px 7px;
  border: 0; border-radius: 6px; text-align: left; color: var(--label);
  background: color-mix(in srgb, var(--c, var(--gray)) var(--tint-strong), transparent);
}
.mp .t { display: block; font-size: 12px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: color-mix(in oklab, var(--c, var(--gray)) var(--ink-mix), var(--ink-base)); }
.mp .d { display: block; font-size: 11px; color: var(--label-2); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp.exam .d { display: inline-block; max-width: 100%; margin-top: 2px; padding: 0 6px; border-radius: 999px; background: var(--label); color: var(--bg-solid); font-size: 10px; font-weight: 700; vertical-align: top; }
.mp.grades { background: none; box-shadow: inset 0 0 0 1.5px var(--label-2); }
.mp.grades .t { color: var(--label); text-align: center; }
.mp.grades .d { text-align: center; }
.mp.task { background: none; box-shadow: inset 0 0 0 1px var(--separator); }
.mp.task .t { font-weight: 500; color: var(--label); }
.mp.task .t::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border: 1.5px solid var(--c, var(--label-2)); border-radius: 50%; vertical-align: -.5px; }
.mp.done { opacity: .5; }
.mp.done .t { text-decoration: line-through; }
.mp.extra { display: none; }
.more { border: 0; background: none; padding: 0 7px; font-size: 12px; font-weight: 600; color: var(--label-2); text-align: left; }
.daypanel { border-radius: var(--r-xl); padding: 18px 16px 18px; position: sticky; top: calc(76px + env(safe-area-inset-top, 0px)); }
.daypanel h2 { font-size: 20px; font-weight: 700; padding: 0 6px; }
.dp-sub { font-size: 14px; color: var(--label-2); margin-top: 2px; padding: 0 6px; }
.dp-list { list-style: none; margin: 10px 0 0; padding: 0; }
.dp-list li { position: relative; }
.dp-list .up-row { grid-template-columns: minmax(0, 1fr) auto; }
.dp-list.dated .up-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
.dp-list.dated li + li::before { left: 64px; }
.dp-h { margin-top: 16px; padding: 0 6px; }
.daypanel .tasklist { padding: 0 6px; }
.dp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 0 6px; }
.dp-note { font-size: 13px; color: var(--label-2); margin: -4px 0 8px; padding: 0 6px; overflow-wrap: anywhere; }
.agenda { display: flex; flex-direction: column; gap: 22px; }
.ag-tools { display: flex; justify-content: flex-end; }
.ag-month h2 { margin: 0 0 8px 16px; }
.ag-list { list-style: none; margin: 0; padding: 4px 8px; border-radius: var(--r-lg); }
.ag-list li { position: relative; }
.ag-list .past { opacity: .5; }

/* ---------- tasks view ---------- */
.task-add { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; margin-bottom: 16px; border-radius: 26px; }
.task-add .ta-title { height: 40px; border: 0; background: none; padding: 0; font-size: 17px; min-width: 0; outline: none; }
.task-add .ta-title::placeholder { color: var(--label-3); }
.task-add .select-pill select { height: 36px; }
.task-add input[type="date"] { height: 36px; padding: 0 12px; border: 0; border-radius: 18px; background: var(--fill); color: var(--label); font-size: 15px; min-width: 0; }
.tfilters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.filters.flat { margin: 0; }
.chip.radio[aria-pressed="false"] { opacity: 1; }
.chip.radio[aria-pressed="false"] .sw { background: var(--c, var(--gray)); box-shadow: none; }
.chip.radio[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.chip.radio[aria-pressed="true"] .sw { box-shadow: 0 0 0 1.5px #fff; }
.tgroups { display: flex; flex-direction: column; gap: 18px; }
.tgroup h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px 16px; }
.tgroup h2 .n { font-size: 13px; font-weight: 500; color: var(--label-3); letter-spacing: 0; text-transform: none; }
.tgroup.over h2.eyebrow { color: var(--red); }
.tgroup .tasklist { padding: 4px 16px 4px 12px; border-radius: var(--r-lg); }
.suggest { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.suggest .btn { height: auto; min-height: 44px; justify-content: flex-start; white-space: normal; text-align: left; padding: 8px 16px; border-radius: 16px; }
.suggest .btn > span { text-align: left; }

/* ---------- subjects ---------- */
.sgroup { margin-bottom: 28px; }
.sgroup > h2 { margin: 0 0 10px 16px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.scard { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px 18px 18px; border-radius: var(--r-xl); color: var(--label); text-align: left; }
.sc-top { display: flex; align-items: center; gap: 12px; }
.sc-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--c); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em; box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 2px 6px color-mix(in srgb, var(--c) 35%, transparent); }
.sc-name { font-weight: 600; font-size: 18px; line-height: 1.2; }
.lvl { margin-left: auto; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--label); }
.sc-line { font-size: 14px; color: var(--label-2); }
.kv { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; font-size: 14px; line-height: 1.35; }
.kv .k { color: var(--label-2); font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding-top: 1px; }
.kv em { font-style: normal; color: var(--label-2); }
.sc-notes { font-size: 13px; color: var(--label-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meter { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

/* ---------- sheets (dialogs) ---------- */
dialog {
  width: min(580px, calc(100vw - 32px));
  max-width: none; max-height: none;
  margin: auto; padding: 0; border: 0;
  background: transparent; color: var(--label);
  overflow: visible;
}
dialog.wide { width: min(700px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / .26); }
.sheet {
  display: flex; flex-direction: column;
  max-height: min(86vh, 880px);
  max-height: min(86dvh, 880px);
  overflow: hidden;
  border-radius: 30px;
  background: var(--glass-thick);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
  backdrop-filter: blur(40px) saturate(190%);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow-lg), inset 0 1px 0 var(--glass-hi);
}
dialog[open] .sheet { animation: sheet-in .32s cubic-bezier(.2, .9, .3, 1); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.grabber { display: none; width: 36px; height: 5px; margin: 6px auto 0; border-radius: 3px; background: var(--label-3); flex: none; }
.sheet:focus { outline: none; }
.sheet-head { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 12px 14px 8px; }
.sheet-head h2 { font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(46vw, 320px); }
.nav-btn { justify-self: start; border: 0; background: none; padding: 8px 8px; border-radius: 12px; color: var(--accent); font-size: 17px; font-weight: 400; white-space: nowrap; }
.nav-btn.strong { justify-self: end; font-weight: 600; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 16px 22px; }
.group-head { padding: 18px 16px 6px; font-size: 13px; font-weight: 500; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; }
.group-head:first-child { padding-top: 6px; }
.group { position: relative; margin-top: 12px; border-radius: 18px; background: var(--cell); overflow: hidden; }
.group-head + .group { margin-top: 0; }
.group-foot { padding: 7px 16px 0; font-size: 13px; line-height: 1.35; color: var(--label-2); }
.group-foot.err { color: var(--red); font-weight: 500; }
.row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 50px; margin: 0; padding: 7px 16px; font-size: 17px; }
.row + .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: var(--hair) solid var(--separator); }
.row.invalid .row-label { color: var(--red); }
.row-label { flex: none; color: var(--label); }
.row-value { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; color: var(--label-2); }
.row-field { flex: 1; min-width: 0; padding: 6px 0; border: 0; background: none; color: var(--label); font-size: 17px; outline: none; }
.row-field::placeholder { color: var(--label-3); }
textarea.row-field { min-height: 96px; resize: vertical; line-height: 1.4; padding: 8px 0; }
.row:has(textarea) { align-items: stretch; }
.row-select-wrap { position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.row-select { appearance: none; -webkit-appearance: none; min-width: 0; max-width: 100%; padding: 6px 22px 6px 6px; border: 0; background: none; color: var(--label-2); font-size: 17px; text-align: right; text-align-last: right; border-radius: 8px; }
.row-select-wrap svg { position: absolute; right: 2px; width: 14px; height: 14px; stroke-width: 2.2; color: var(--label-3); pointer-events: none; }
.row-pill { margin-left: auto; min-width: 0; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--fill); color: var(--label); font-size: 17px; font-variant-numeric: tabular-nums; }
input[type="number"].row-pill { width: 96px; text-align: right; }
.row-btn { width: 100%; border: 0; background: none; color: var(--accent); text-align: left; cursor: pointer; }
.row-btn.center { justify-content: center; text-align: center; }
.row-btn.danger { color: var(--red); justify-content: center; }
.row-btn.danger.armed { background: rgb(255 59 48 / .12); font-weight: 600; }
.row-btn svg { width: 20px; height: 20px; }
.ios-switch { margin-left: auto; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick { cursor: pointer; }
.pick .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--label-3)); flex: none; }
.pick .dot.none { background: none; box-shadow: inset 0 0 0 1.5px var(--label-3); }
.pick .row-meta { color: var(--label-2); font-size: 15px; }
.pick .tick { margin-left: auto; color: var(--accent); opacity: 0; width: 20px; height: 20px; stroke-width: 2.4; }
.pick input:checked ~ .tick { opacity: 1; }
.pick:has(input:focus-visible) { box-shadow: inset 0 0 0 2.5px var(--accent); }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
.swatch { position: relative; width: 34px; height: 34px; }
.swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.swatch span { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c); pointer-events: none; }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--glass-solid), 0 0 0 5.5px var(--label-3); }
.swatch input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 5px; }
.swatch.custom { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.colorpick-wrap { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(#FF3B30, #FF9500, #FFCC00, #34C759, #00C7BE, #007AFF, #AF52DE, #FF2D55, #FF3B30); }
.colorpick { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.colorpick::-webkit-color-swatch-wrapper { padding: 0; }
.colorpick::-webkit-color-swatch { border: 0; border-radius: 50%; }
.colorpick::-moz-color-swatch { border: 0; border-radius: 50%; }
.swatches:has(input[value="custom"]:checked) .colorpick-wrap { box-shadow: 0 0 0 3px var(--glass-solid), 0 0 0 5.5px var(--label-3); }
.dlg-list { list-style: none; margin: 0; padding: 0; }
.dlg-list li { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; font-size: 16px; }
.dlg-list li + li::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: var(--hair) solid var(--separator); }
.dlg-list .muted { color: var(--label-2); white-space: nowrap; }
.group .tasklist { padding: 2px 16px 2px 12px; }
.kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; background: var(--fill-2); font-size: 12px; font-weight: 600; text-align: center; color: var(--label); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px); min-height: 48px; padding: 6px 8px 6px 20px;
  border-radius: 24px;
  background: var(--glass-thick);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow-lg), inset 0 1px 0 var(--glass-hi);
  font-size: 15px; font-weight: 600; color: var(--label);
}
.toast .btn { height: 34px; background: var(--fill); }

/* hover only where a real pointer can hover */
@media (hover: hover) {
  .top-nav button:not([aria-current]):hover { background: var(--fill); }
  .icon-btn:hover { color: var(--accent); }
  .btn:hover { filter: brightness(1.05); }
  .btn.quiet:hover { background: var(--fill); }
  .link:hover { text-decoration: underline; text-underline-offset: 3px; }
  .up-row:hover { background: var(--fill); }
  .tt-time:hover { background: var(--fill); }
  .tt-cell:hover { filter: saturate(1.2) brightness(.98); }
  .tt-cell.empty:hover { color: var(--accent); background: var(--fill); filter: none; }
  .mday:hover { background: rgb(0 122 255 / .06); }
  .mp:hover, .bar:hover { filter: saturate(1.25) brightness(.97); }
  .scard:hover { box-shadow: var(--glass-shadow-lg), inset 0 1px 0 var(--glass-hi); }
  .chip:hover { filter: brightness(1.03); }
  .row-btn:hover, .pick:hover { background: var(--cell-hover); }
  .nav-btn:hover { background: var(--fill); }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .daypanel { position: static; }
  .top-nav button { padding: 0 12px; }
}
@media (max-width: 960px) {
  .brand-sub { display: none; }
  .top-nav button span { display: none; }
  .top-nav button { width: 48px; justify-content: center; padding: 0; }
}
@media (max-width: 900px) {
  .today-cols { display: flex; flex-direction: column; gap: 14px; }
  .today-cols .col { display: contents; }
  .c-classes { order: 1; }
  .c-coming { order: 2; }
  .c-tasks { order: 3; }
  .c-focus { order: 4; }
  .task-add { grid-template-columns: minmax(0, 1fr) auto; border-radius: 22px; padding: 10px 10px 10px 16px; }
  .task-add .ta-title { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; --num-h: 30px; --lane-h: 5px; --stack-h: 14px; }
  body { font-size: 16px; }
  .head-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .top-nav { display: none; }
  .brand { height: 40px; padding: 0 14px 0 12px; font-size: 15px; }
  .icon-btn { width: 40px; height: 40px; }
  .view { padding-top: 10px; padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 40;
    height: 64px; padding: 5px; border-radius: 32px;
  }
  .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 2px; border: 0; border-radius: 27px; background: none; color: var(--label); font-size: 10.5px; font-weight: 600; min-width: 0; }
  .tabbar button svg { width: 24px; height: 24px; }
  .tabbar button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar button[aria-current="page"] { color: var(--accent); background: var(--fill); }
  .hero { grid-template-columns: minmax(0, 1fr); margin-bottom: 16px; }
  .count { min-width: 0; }
  .count-num { font-size: 56px; }
  .card { padding: 16px 16px 18px; border-radius: 24px; }
  .card-head h2 { font-size: 20px; }
  .focus-row { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .focus-controls { width: 100%; align-items: center; }
  .focus-controls .seg { align-self: center; }
  .focus-controls .btns { justify-content: center; }
  .tt-desktop { display: none; }
  .tt-mobile { display: block; }
  .tt-mobile .daylist { padding: 12px; border-radius: 24px; }
  .mday { min-height: 58px; }
  .mhead span { padding: 0; text-align: center; font-size: 11px; }
  .mnum { justify-self: center; margin: 4px 0 0; width: 28px; height: 28px; font-size: 16px; }
  .bar { margin: 0 2px; padding: 0; font-size: 0; line-height: 0; border-radius: 3px; background: var(--c); }
  .bar.cont-l { margin-left: 0; }
  .bar.cont-r { margin-right: 0; }
  .mstack { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; padding: 1px 2px; }
  .mp { width: 7px; height: 7px; padding: 0; border-radius: 50%; background: var(--c, var(--gray)); }
  .mp .t, .mp .d { display: none; }
  .mp.extra { display: block; }
  .mp.task { background: none; box-shadow: inset 0 0 0 1.5px var(--c, var(--label-2)); }
  .mp.grades { box-shadow: inset 0 0 0 1.5px var(--label-2); }
  .more { display: none; }
  .task-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .task-add .btn { grid-column: 1 / -1; }
  .task-add .select-pill, .task-add .select-pill select { width: 100%; }
  .bar-row { grid-template-columns: minmax(70px, 100px) minmax(0, 1fr) 56px; }
  dialog, dialog.wide { width: calc(100% - 16px); margin: auto 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .sheet { max-height: calc(100vh - 56px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); border-radius: 34px; }
  .grabber { display: block; }
  .sheet-head { padding-top: 6px; }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .quick input, .task-add .ta-title, .task-add input, .task-add select, .row-field, .row-select, .row-pill, .select-pill select { font-size: 17px; }
}
@media (max-width: 420px) {
  .count-mini { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  body::before, .app-header, .tabbar, .toast, .banner, .page-head .actions, .filters, .tt-mobile, .daypanel { display: none !important; }
  body { background: #fff; color: #000; }
  .view { padding: 0; }
  .tt-desktop { display: block !important; overflow: visible; box-shadow: none; }
  .cal-layout { display: block; }
}

/* sheet + list details */
.row-field.right { text-align: right; color: var(--label-2); }
.row-field.right:focus { color: var(--label); }
.pick .row-meta { margin-left: auto; color: var(--label-2); font-size: 15px; }
.pick .row-meta + .tick { margin-left: 6px; }
.tasklist + .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: var(--hair) solid var(--separator); }
.tgroup .tasklist.glass, .tt-mobile .daylist.glass { border-radius: var(--r-lg); }
.tt-mobile .daylist.glass { padding: 12px; }
.row .kbd + .kbd { margin-left: 2px; }
