/* Bloc: a paper notebook under glass.
   Paper (a warm off-white), ink (warm near-black), persimmon (Bloc's colour), jade for done,
   marigold for highlights. Translucent glass over sunlit paper; a warm night desk in dark mode.
   System font (SF Pro on Apple devices), inset-grouped lists and sheets. Light + dark via tokens. */

/* ---------- tokens ---------- */
:root {
  --bg: #F4EFE6;
  --bg-solid: #EFE8DC;
  --blob-1: rgb(255 122 69 / .22);
  --blob-2: rgb(255 194 74 / .26);
  --blob-3: rgb(224 82 125 / .10);
  --blob-4: rgb(61 200 140 / .13);
  --blob-5: rgb(255 250 240 / .55);
  --grain: .045;

  --glass: rgb(255 252 246 / .60);
  --glass-thick: rgb(253 250 244 / .82);
  --glass-solid: #FBF8F2;
  --glass-line: rgb(255 255 255 / .78);
  --glass-hi: rgb(255 255 255 / .92);
  --glass-rim: rgb(255 255 255 / .95);
  --glass-shadow: 0 1px 1px rgb(60 40 20 / .04), 0 10px 30px rgb(90 60 30 / .09);
  --glass-shadow-lg: 0 30px 80px rgb(60 36 16 / .22), 0 2px 8px rgb(60 36 16 / .06);
  --blur: blur(28px) saturate(170%);
  --cell: rgb(255 253 248 / .68);
  --cell-hover: rgb(255 253 248 / .9);
  --sel: #FFFDF9;

  --label: #1F1A15;
  --label-2: rgb(74 62 50 / .70);
  --label-3: rgb(74 62 50 / .38);
  --separator: rgb(74 62 50 / .16);
  --fill: rgb(120 100 80 / .11);
  --fill-2: rgb(120 100 80 / .20);

  --accent: #D9501F;
  --on-accent: #FFFFFF;
  --red: #D2293F;
  --orange: #E8930C;
  --green: #1E9E6A;
  --gray: #8F8579;
  --hl: #FFC24A;

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

  --spring: cubic-bezier(.3, 1.3, .5, 1);
  --spring-soft: cubic-bezier(.2, .9, .3, 1);
  --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;
}
/* real springs where the browser can draw them */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1);
    --spring-soft: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13100D;
    --bg-solid: #0D0B09;
    --blob-1: rgb(255 122 69 / .17);
    --blob-2: rgb(255 194 74 / .09);
    --blob-3: rgb(224 82 125 / .08);
    --blob-4: rgb(61 220 151 / .08);
    --blob-5: rgb(255 238 214 / .03);
    --grain: .06;
    --glass: rgb(40 34 29 / .54);
    --glass-thick: rgb(36 31 27 / .82);
    --glass-solid: #211C18;
    --glass-line: rgb(255 236 214 / .10);
    --glass-hi: rgb(255 240 222 / .12);
    --glass-rim: rgb(255 236 214 / .28);
    --glass-shadow: 0 1px 1px rgb(0 0 0 / .3), 0 12px 32px rgb(0 0 0 / .38);
    --glass-shadow-lg: 0 30px 80px rgb(0 0 0 / .6);
    --cell: rgb(255 244 230 / .06);
    --cell-hover: rgb(255 244 230 / .11);
    --sel: rgb(255 244 230 / .17);
    --label: #F6F0E6;
    --label-2: rgb(240 228 212 / .62);
    --label-3: rgb(240 228 212 / .32);
    --separator: rgb(120 106 92 / .5);
    --fill: rgb(150 132 112 / .22);
    --fill-2: rgb(150 132 112 / .34);
    --accent: #FF7A45;
    --on-accent: #1A120C;
    --red: #FF6B6F;
    --orange: #FFB224;
    --green: #3DDC97;
    --gray: #A39787;
    --hl: #FFC24A;
    --tint: 26%;
    --tint-strong: 32%;
    --ink-mix: 55%;
    --ink-base: #FFFFFF;
    --sw-mix: 88%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13100D;
  --bg-solid: #0D0B09;
  --blob-1: rgb(255 122 69 / .17);
  --blob-2: rgb(255 194 74 / .09);
  --blob-3: rgb(224 82 125 / .08);
  --blob-4: rgb(61 220 151 / .08);
  --blob-5: rgb(255 238 214 / .03);
  --grain: .06;
  --glass: rgb(40 34 29 / .54);
  --glass-thick: rgb(36 31 27 / .82);
  --glass-solid: #211C18;
  --glass-line: rgb(255 236 214 / .10);
  --glass-hi: rgb(255 240 222 / .12);
  --glass-rim: rgb(255 236 214 / .28);
  --glass-shadow: 0 1px 1px rgb(0 0 0 / .3), 0 12px 32px rgb(0 0 0 / .38);
  --glass-shadow-lg: 0 30px 80px rgb(0 0 0 / .6);
  --cell: rgb(255 244 230 / .06);
  --cell-hover: rgb(255 244 230 / .11);
  --sel: rgb(255 244 230 / .17);
  --label: #F6F0E6;
  --label-2: rgb(240 228 212 / .62);
  --label-3: rgb(240 228 212 / .32);
  --separator: rgb(120 106 92 / .5);
  --fill: rgb(150 132 112 / .22);
  --fill-2: rgb(150 132 112 / .34);
  --accent: #FF7A45;
  --on-accent: #1A120C;
  --red: #FF6B6F;
  --orange: #FFB224;
  --green: #3DDC97;
  --gray: #A39787;
  --hl: #FFC24A;
  --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;
  overflow-x: clip;
  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: 22px; height: 22px; border-radius: 7px; background: url("icons/favicon.svg") center / cover no-repeat; box-shadow: 0 2px 6px rgb(217 80 31 / .3); }
.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: color-mix(in srgb, var(--hl) 26%, transparent); 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: color-mix(in srgb, var(--red) 12%, transparent); 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(--accent); 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(--accent); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); animation: pulse-dot 2.4s ease-in-out infinite; }
.heads-up.calm::before { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 22%, transparent); }
@keyframes pulse-dot { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 8%, transparent); } }
.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(--accent); 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: .55; }
.dl-row.past .dl-time { color: var(--label-3); }
.dl-row.now .dl-block { box-shadow: inset 0 0 0 2px var(--accent), 0 6px 18px color-mix(in srgb, var(--accent) 22%, transparent); }
.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(--accent); white-space: nowrap; }
.next-tag { font-size: 12px; font-weight: 600; color: var(--label-2); white-space: nowrap; }
/* A class's colour bar grows to the right while it's on and fills the block once it's over.
   It lies over the block with its own dark copy of the text, clipped to the bar's edge. */
.fill-bar {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; gap: 1px; padding: 8px 12px 8px 16px;
  background: var(--c, var(--gray)); color: var(--on, #141722); pointer-events: none;
  clip-path: inset(7px calc(100% - 9px - (100% - 14px) * var(--p, 0)) 7px 5px round 3px);
  transition: clip-path .9s linear;
}
.tt-cell > .fill-bar { gap: 2px; padding: 8px 10px 8px 15px; }
.fill-bar .dl-name, .fill-bar .dl-meta, .fill-bar .now-tag, .fill-bar .n, .fill-bar .m, .fill-bar .x { color: var(--on, #141722); }
.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(--accent); }
.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(--accent); }
.datechip.today .wd, .datechip.today b, .datechip.today .mo { color: var(--on-accent); }
.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; width: 0; 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: color-mix(in srgb, var(--green) 20%, transparent); color: var(--green); }
.round-btn.pause { background: color-mix(in srgb, var(--hl) 28%, transparent); 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(--accent); }
.tt-dayhead.today::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.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(--accent); }
.tt-cell.now::after { content: 'Now'; position: absolute; top: 7px; right: 9px; font-size: 11px; font-weight: 700; color: var(--accent); }
.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(--accent); }
.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(--accent); }
.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(--accent); color: var(--on-accent); font-weight: 600; box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.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: var(--on-accent); 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: color-mix(in srgb, var(--red) 12%, transparent); 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(#E4572E, #F28C28, #EDB21A, #5DAA3A, #1E9E6A, #1597A8, #3B6FD4, #8C3B72, #E0527D, #E4572E); }
.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: color-mix(in srgb, var(--accent) 6%, transparent); }
  .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; align-items: stretch; 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(6, 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; }
  .focus-controls .seg { width: 100%; grid-auto-columns: minmax(0, 1fr); }
  .focus-controls .seg button { padding: 0 4px; font-size: 12.5px; min-width: 0; }
}

@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; }

/* ---------- modes: splash, log in, app ---------- */
body:not(.mode-app) .app-header,
body:not(.mode-app) .view,
body:not(.mode-app) .tabbar,
body:not(.mode-app) .banner,
body:not(.mode-app) .skip { display: none !important; }
body.mode-app .auth { display: none; }
.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.auth-card {
  position: relative;
  width: min(440px, 100%);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 28px 22px 22px;
  border-radius: 32px;
  background: var(--glass);
  -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);
  animation: auth-in .38s cubic-bezier(.2, .9, .3, 1);
}
@keyframes auth-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.auth-card.splash { background: none; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; animation: none; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 1px; margin-bottom: 14px; }
.auth-logo { width: 64px; height: 64px; border-radius: 15px; margin-bottom: 8px; box-shadow: 0 6px 18px rgb(0 0 0 / .18); }
.auth-name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.auth-tag { font-size: 13px; font-weight: 500; color: var(--label-2); }
.auth-q { font-size: 24px; font-weight: 700; letter-spacing: .005em; margin: 6px 0 18px; text-wrap: balance; }
.auth-note { max-width: 34ch; margin: -6px 0 4px; font-size: 15px; color: var(--label-2); }
.auth-foot { max-width: 36ch; margin-top: 18px; font-size: 13px; color: var(--label-2); text-wrap: balance; }
.who { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 12px 6px; }
.who-btn { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 4px 8px; border: 0; border-radius: 20px; background: none; color: var(--label); }
.who-name { font-size: 15px; font-weight: 600; }
.who-new { position: absolute; top: 3px; left: calc(50% + 12px); padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 0 0 2px var(--glass-solid); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--c); font-size: 16px; font-weight: 700; line-height: 1; box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 2px 6px color-mix(in srgb, var(--c) 35%, transparent); }
.avatar.lg { width: 60px; height: 60px; font-size: 25px; }
.avatar.xl { width: 76px; height: 76px; margin-bottom: 12px; font-size: 32px; }
.auth-back { position: absolute; top: 14px; left: 10px; display: inline-flex; align-items: center; padding: 6px 10px 6px 2px; border: 0; border-radius: 12px; background: none; color: var(--accent); font-size: 16px; }
.auth-back svg { width: 22px; height: 22px; stroke-width: 2.2; }
.auth-hi { font-size: 26px; font-weight: 700; }
.auth-sub { max-width: 34ch; margin: 4px 0 18px; font-size: 15px; color: var(--label-2); text-wrap: balance; }
.auth-fields { width: 100%; margin-top: 0; text-align: left; }
.show-pw { flex: none; padding: 6px 2px 6px 8px; border: 0; background: none; color: var(--accent); font-size: 15px; font-weight: 500; }
.auth-err { width: 100%; margin: 10px 0 0; padding: 0 6px; font-size: 14px; font-weight: 500; color: var(--red); text-align: left; }
.auth-go { width: 100%; height: 50px; margin-top: 16px; border-radius: 16px; font-size: 17px; }
.auth-go.busy { opacity: .6; }
.spinner { display: inline-block; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--fill-2); border-top-color: var(--label-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sheet-loading { display: grid; place-items: center; padding: 34px 0; }

/* ---------- account, Plus, admin, papers ---------- */
.nav-btn.back { display: inline-flex; align-items: center; padding-left: 0; }
.nav-btn.back svg { width: 24px; height: 24px; stroke-width: 2.2; }
.row-btn.nav-row { color: var(--label); }
.row-btn.nav-row > svg:first-child, .row-btn.danger-text > svg, .link-row > svg:first-child { color: var(--accent); }
.nav-row .row-meta { margin-left: auto; font-size: 16px; color: var(--label-2); }
.chev { width: 16px; height: 16px; margin-left: auto; color: var(--label-3); stroke-width: 2.4; }
.row-meta + .chev { margin-left: 2px; }
.row-btn.danger-text { color: var(--red); }
.row-btn.danger-text > svg, .row-btn.danger-text .row-label { color: var(--red); }
.row-btn.strong { font-weight: 600; }
.row.wrap { flex-wrap: wrap; row-gap: 8px; padding-top: 9px; padding-bottom: 9px; }
.row-btn.flashed { color: var(--green); }
a.row-btn { text-decoration: none; }
.two-line { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; text-align: left; }
.two-line b { font-size: 17px; font-weight: 600; color: var(--label); }
.two-line span { font-size: 13.5px; color: var(--label-2); }
.row.acct { gap: 14px; padding-top: 12px; padding-bottom: 12px; }
.acct .avatar { width: 48px; height: 48px; font-size: 21px; }
.acct-row .two-line, .link-row .two-line, .paper-row .two-line { flex: 1; }
.row-value.reset-code { color: var(--label); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 20px; font-weight: 600; letter-spacing: .06em; }
.tag-plus { padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--hl) 26%, transparent); color: var(--orange); font-size: 12px; font-weight: 700; }
.plus-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 12px 4px; text-align: center; }
.plus-badge { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 18px; background: linear-gradient(135deg, #FFC24A, #F28C28 50%, #D9501F); color: #fff; box-shadow: 0 8px 22px rgb(217 80 31 / .32), inset 0 1px 0 rgb(255 255 255 / .4); }
.plus-badge svg { width: 34px; height: 34px; fill: currentColor; stroke-width: 1.2; }
.plus-badge.heart { background: linear-gradient(135deg, #FF8FAE, #E0527D 60%, #B8345E); box-shadow: 0 8px 22px rgb(224 82 125 / .32), inset 0 1px 0 rgb(255 255 255 / .4); }
.plus-hero h3 { font-size: 24px; font-weight: 700; }
.plus-hero p { max-width: 40ch; font-size: 15px; color: var(--label-2); text-wrap: balance; }
.perk { align-items: flex-start; gap: 14px; padding-top: 12px; padding-bottom: 12px; }
.perk + .perk::before { left: 64px; }
.perk-ic { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--c); color: #fff; }
.perk-ic svg { width: 20px; height: 20px; stroke-width: 2; }
.perk .two-line b { font-size: 16px; }
.perk .two-line span { font-size: 14px; }
.row-value.price { color: var(--label); text-align: right; font-weight: 500; }
.plus-fine { padding-top: 16px; text-align: center; }
.egg { cursor: text; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.egg-field { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.accents { gap: 14px; }
.accent-sw { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--c); color: #fff; }
.accent-sw svg { width: 17px; height: 17px; stroke-width: 3; opacity: 0; }
.accent-sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--glass-solid), 0 0 0 5.5px var(--c); }
.accent-sw[aria-pressed="true"] svg { opacity: 1; }
.paper-row { color: var(--label); }
.pct { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--label); }
.row .lbl { font-size: 17px; font-weight: 400; align-items: center; }

/* toast as a popover: sits above open sheets */
.toast[popover] { inset: auto; margin: 0; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); overflow: visible; color: var(--label); }
.toast[popover]:not(:popover-open) { display: none; }
@media (max-width: 760px) {
  .toast[popover] { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  body:not(.mode-app) .toast[popover] { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 420px) {
  .auth-card { padding: 26px 14px 18px; border-radius: 28px; }
  .who { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (hover: hover) {
  .who-btn:hover { background: var(--fill); }
  .auth-back:hover, .show-pw:hover { background: var(--fill); }
  .accent-sw:hover { filter: brightness(1.08); }
}

/* ---------- accent colours (MyIB Plus) ---------- */
:root[data-accent="indigo"] { --accent: #3D5591; }
:root[data-accent="purple"] { --accent: #8C3B72; }
:root[data-accent="pink"] { --accent: #C93A66; }
:root[data-accent="orange"] { --accent: #B7740A; }
:root[data-accent="green"] { --accent: #167F59; }
:root[data-accent="teal"] { --accent: #0A7684; }
:root[data-accent="graphite"] { --accent: #5B544C; }
@media (prefers-color-scheme: dark) {
  :root[data-accent="indigo"]:not([data-theme="light"]) { --accent: #9DB4E8; --on-accent: #0E1420; }
  :root[data-accent="purple"]:not([data-theme="light"]) { --accent: #E08AC4; --on-accent: #1E0B18; }
  :root[data-accent="pink"]:not([data-theme="light"]) { --accent: #FF7AA2; --on-accent: #1E0A10; }
  :root[data-accent="orange"]:not([data-theme="light"]) { --accent: #FFC24A; --on-accent: #1A1204; }
  :root[data-accent="green"]:not([data-theme="light"]) { --accent: #3DDC97; --on-accent: #06190F; }
  :root[data-accent="teal"]:not([data-theme="light"]) { --accent: #4FD1DC; --on-accent: #041719; }
  :root[data-accent="graphite"]:not([data-theme="light"]) { --accent: #C2B8AC; --on-accent: #15110D; }
}
:root[data-theme="dark"][data-accent="indigo"] { --accent: #9DB4E8; --on-accent: #0E1420; }
:root[data-theme="dark"][data-accent="purple"] { --accent: #E08AC4; --on-accent: #1E0B18; }
:root[data-theme="dark"][data-accent="pink"] { --accent: #FF7AA2; --on-accent: #1E0A10; }
:root[data-theme="dark"][data-accent="orange"] { --accent: #FFC24A; --on-accent: #1A1204; }
:root[data-theme="dark"][data-accent="green"] { --accent: #3DDC97; --on-accent: #06190F; }
:root[data-theme="dark"][data-accent="teal"] { --accent: #4FD1DC; --on-accent: #041719; }
:root[data-theme="dark"][data-accent="graphite"] { --accent: #C2B8AC; --on-accent: #15110D; }

/* ---------- students outside the class: log in, setup guide ---------- */
.auth-alt { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 20px; padding: 12px 14px 12px 18px; border: 0; border-radius: 18px; background: var(--fill); color: var(--label); text-align: left; }
.auth-alt .two-line { flex: 1; }
.auth-alt .two-line b { font-size: 16px; }
.auth-alt .two-line span { font-size: 13.5px; }
.auth-logo.small { width: 52px; height: 52px; border-radius: 13px; margin: 4px 0 10px; }
.auth-seg { display: grid; width: 100%; margin: 0 0 14px; }
.auth-seg button { height: 34px; font-size: 14px; }
.auth-hint { width: 100%; margin: 8px 0 0; padding: 0 6px; font-size: 13px; line-height: 1.35; color: var(--label-2); text-align: left; }
.auth-fields input[readonly] { color: var(--label-2); }
.tag-new { display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1.45; vertical-align: 2px; }
.btn .tag-new { margin-left: 1px; vertical-align: 0; }
.two-line .tag-new { font-size: 11px; color: var(--on-accent); }
.papers-intro { padding: 6px 16px 2px; font-size: 16px; line-height: 1.4; color: var(--label); }
/* the setup card sits in the hero: under the date and countdown on wide screens, between them on phones */
.hero > .c-guide { grid-column: 1 / -1; align-self: stretch; }
.c-guide .card-head { margin-bottom: 8px; }
.guide-progress { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.guide-count { flex: none; font-size: 13px; font-weight: 500; color: var(--label-2); font-variant-numeric: tabular-nums; }
.guide-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.guide-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .3s; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.guide-step { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 12px; border: 0; border-radius: 16px; background: var(--cell); color: var(--label); text-align: left; }
.guide-step .two-line { flex: 1; }
.guide-step .two-line b { font-size: 16px; }
.guide-step.done .two-line b { color: var(--label-2); }
.gs-num { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 700; }
.guide-step.done .gs-num { background: var(--green); color: #fff; }
.gs-num svg { width: 16px; height: 16px; stroke-width: 3; }
.tip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-bottom: 16px; }
.tip p { flex: 1 1 260px; font-size: 15px; line-height: 1.4; color: var(--label-2); }
.tip p b { color: var(--label); font-weight: 600; }
.tt-sparse .tt-cell.empty { color: var(--label-3); }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.pick-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 6px 14px; border: 0; border-radius: 17px; background: var(--fill); color: var(--label); font-size: 15px; font-weight: 500; line-height: 1.2; text-align: left; }
.pick-chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.pick-chip.have, .pick-chip.have:disabled { background: none; box-shadow: inset 0 0 0 1.5px var(--fill-2); color: var(--label-2); opacity: 1; }
.pick-chip svg { width: 15px; height: 15px; stroke-width: 2.6; color: var(--green); }
.perk-ic.num { font-size: 16px; font-weight: 700; }
.welcome-logo { width: 64px; height: 64px; margin-bottom: 6px; border-radius: 15px; box-shadow: 0 6px 18px rgb(0 0 0 / .18); }
.pe-url { font-size: 15px; }
.pe-tools { flex-wrap: wrap; gap: 8px; min-height: 52px; }
.pe-tools .btn svg { width: 15px; height: 15px; }
.pe-tools .btn.danger { margin-left: auto; }
.nav-btn.danger { color: var(--red); }
.adm-find .row-field { font-size: 16px; }
@media (hover: hover) {
  .auth-alt:hover { background: var(--fill-2); }
  .guide-step:hover { background: var(--cell-hover); }
  .pick-chip:not(:disabled):hover { filter: brightness(1.04); }
}
@media (hover: none) {
  .tt-sparse .tt-cell.empty svg { opacity: .9; }
}
@media (max-width: 760px) {
  .auth-alt .two-line b { font-size: 16px; }
  .guide-steps { grid-template-columns: minmax(0, 1fr); }
  .hero > .c-guide { order: 1; }
  .hero > .count { order: 2; }
}
/* a long back label shortens instead of running into the sheet title; narrow phones keep only the arrow */
.nav-btn.back { max-width: 100%; min-width: 0; overflow: hidden; }
.nav-btn.back span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) {
  .nav-btn.back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- school countdown (Today) ---------- */
.count-school { margin: 12px 0 0; padding: 12px 0 0; border-top: var(--hair) solid var(--separator); }
.count-cap.school { color: var(--accent); }
.count-school .count-mini { margin: 6px 0 0; padding: 0; border-top: 0; grid-template-columns: 1fr 1fr; }

/* ---------- profile pictures ---------- */
.avatar { position: relative; overflow: hidden; }
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar.xxl { width: 104px; height: 104px; font-size: 44px; }
.icon-btn.has-pfp { overflow: hidden; padding: 0; }
.head-pfp { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.row-btn.acct { color: var(--label); }
.acct-edit { margin-left: auto; font-size: 15px; color: var(--accent); white-space: nowrap; }
.acct-edit + .chev { margin-left: 2px; }
.pfp-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0 4px; }
.pfp-hero h3 { font-size: 22px; font-weight: 700; }
.crop { position: relative; width: min(300px, 72vw); aspect-ratio: 1; margin: 10px auto 6px; overflow: hidden; border-radius: 24px; background: #000;
  touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.crop:active { cursor: grabbing; }
.crop img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgb(0 0 0 / .5), inset 0 0 0 2px rgb(255 255 255 / .9); pointer-events: none; }
.crop-zoom { gap: 12px; }
.crop-zoom input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.zoom-ic { display: inline-grid; color: var(--label-2); }
.zoom-ic svg { width: 22px; height: 22px; }
.zoom-ic.small svg { width: 15px; height: 15px; }

/* ---------- chat ---------- */
:root { --bubble: #E9E9EB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bubble: #2C2C2E; } }
:root[data-theme="dark"] { --bubble: #2C2C2E; }
.icon-btn[aria-current="page"] { color: var(--accent); }
.chat-btn { position: relative; overflow: visible; }
.chat-badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px;
  text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--bg-solid); pointer-events: none;
}
.tag-dev { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1.45; vertical-align: 1px; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar.md { width: 48px; height: 48px; font-size: 20px; }
.chat-ic { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: linear-gradient(160deg, #FFB067, #E4572E); box-shadow: inset 0 1px 0 rgb(255 255 255 / .3); }
.chat-ic.channel { background: linear-gradient(160deg, #FFD36B, #F2A81D 55%, #E8930C); }
.chat-ic svg { width: 56%; height: 56%; stroke-width: 1.9; }
.chat-ic.sm { width: 30px; height: 30px; }
.chat-ic.md { width: 48px; height: 48px; }
.chat-ic.lg { width: 60px; height: 60px; }
.chat-ic.xl { width: 76px; height: 76px; }

.view[data-view="chat"] { padding-bottom: 20px; }
.chat { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); gap: 16px; height: 70vh; min-height: 440px; }
.chat-side, .chat-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: var(--r-xl); overflow: hidden; }
.chat-side-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 14px 8px 20px; }
.chat-side-head h1 { font-size: 26px; font-weight: 700; letter-spacing: .01em; }
.chat-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 8px 12px; }
.cl-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 8px 10px; border: 0; border-radius: 18px; background: none; color: var(--label); text-align: left; }
.cl-item[aria-current="true"] { background: var(--sel); box-shadow: 0 1px 4px rgb(0 0 0 / .08); }
.cl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.cl-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 16px; font-weight: 600; }
.cl-top .tag-dev { margin-left: 0; flex: none; }
.cl-time { margin-left: auto; flex: none; font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.cl-last { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14.5px; color: var(--label-2); }
.cl-last > span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cl-item.unread .cl-last > span { color: var(--label); font-weight: 500; }
.cl-item.unread .cl-time { color: var(--accent); font-weight: 600; }
.cl-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.cl-head { padding: 12px 12px 4px; font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; }
.cl-empty { display: grid; justify-items: center; gap: 6px; padding: 18px 14px; color: var(--label-2); font-size: 15px; text-align: center; }
.cl-empty b { color: var(--label); }
.cl-note { margin: 4px 6px 8px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--hl) 22%, transparent); font-size: 14px; }
.cl-alert { display: flex; align-items: center; gap: 10px; width: calc(100% - 4px); margin: 2px 2px 8px; padding: 12px 14px; border: 0; border-radius: 16px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); font-weight: 600; text-align: left; }
.cl-alert span { flex: 1; }
.cl-blocked { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; padding: 10px; border: 0; border-radius: 14px; background: none; color: var(--label-2); font-size: 14px; }
.cl-blocked svg { width: 16px; height: 16px; }

.cm-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 24px; color: var(--label-2); text-align: center; }
.cm-empty > svg { width: 44px; height: 44px; margin-bottom: 8px; color: var(--label-3); }
.cm-empty b { color: var(--label); font-size: 17px; }
.cm-head { flex: none; display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: var(--hair) solid var(--separator); }
.cm-back { display: none; }
.cm-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 6px; border: 0; border-radius: 14px; background: none; color: var(--label); text-align: left; }
.cm-title .two-line b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 16px; }
.cm-title .two-line span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cm-head .icon-btn { width: 40px; height: 40px; border: 0; background: none; box-shadow: none; color: var(--accent); -webkit-backdrop-filter: none; backdrop-filter: none; }
.cm-head .icon-btn svg { width: 24px; height: 24px; }
.cm-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 10px 14px 12px; outline: none; }
.cm-msgs > :first-child { margin-top: auto; }
.cm-hello { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 360px; margin: auto; padding: 24px 12px; color: var(--label-2); text-align: center; }
.cm-hello b { color: var(--label); font-size: 17px; }
.cm-hello .avatar, .cm-hello .chat-ic { margin-bottom: 4px; }
.cm-older { align-self: center; margin: 4px 0 8px; padding: 6px 14px; border: 0; border-radius: 999px; background: var(--fill); color: var(--accent); font-size: 14px; font-weight: 600; }
.msg-day { align-self: center; margin: 14px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--label-2); }
.msg-note { align-self: center; max-width: 85%; margin: 8px 0 4px; font-size: 12.5px; color: var(--label-2); text-align: center; }
.msg-who { margin: 8px 0 2px 44px; font-size: 12.5px; font-weight: 500; color: var(--label-2); }
.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; }
.msg.first { margin-top: 6px; }
.msg-who + .msg.first { margin-top: 0; }
.msg.mine { justify-content: flex-end; }
.msg-av { flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; }
.bubble {
  max-width: min(78%, 540px); padding: 8px 13px; border: 0; border-radius: 19px;
  background: var(--bubble); color: var(--label); font-size: 16px; line-height: 1.35; text-align: left;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; cursor: pointer;
}
.msg.mine .bubble { background: var(--accent); color: var(--on-accent); }
.msg:not(.mine):not(.last) .bubble { border-bottom-left-radius: 6px; }
.msg:not(.mine):not(.first) .bubble { border-top-left-radius: 6px; }
.msg.mine:not(.last) .bubble { border-bottom-right-radius: 6px; }
.msg.mine:not(.first) .bubble { border-top-right-radius: 6px; }
.msg.del .bubble { background: none; box-shadow: inset 0 0 0 1px var(--separator); color: var(--label-2); font-style: italic; cursor: default; }
.msg.pending .bubble { opacity: .6; }
.msg.failed .bubble { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--label); }
.msg-meta { margin: 3px 4px 2px; font-size: 11.5px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.msg-meta.mine { text-align: right; }
.msg-meta.indent { margin-left: 42px; }
.msg-meta.err { color: var(--red); font-weight: 500; }
.cm-jump { position: absolute; left: 50%; bottom: 76px; z-index: 2; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 17px; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 600; box-shadow: var(--glass-shadow); }
.cm-jump svg { width: 16px; height: 16px; stroke-width: 2.2; }
.cm-foot { flex: none; border-top: var(--hair) solid var(--separator); }
.cm-compose { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px 10px 12px; }
.cm-compose textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 140px; margin: 0; padding: 9px 14px; border: 0; border-radius: 20px; background: var(--fill); color: var(--label); font-size: 16px; line-height: 1.35; resize: none; outline: none; }
.cm-compose textarea:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.cm-compose textarea::placeholder { color: var(--label-3); }
.cm-send { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.cm-send svg { width: 20px; height: 20px; stroke-width: 2.6; }
.cm-bar { padding: 12px 14px 14px; font-size: 15px; text-align: center; }
.cm-bar p { color: var(--label-2); }
.cm-bar b { color: var(--label); }
.cm-bar-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.msg-quote { max-height: 40vh; overflow-y: auto; margin: 6px 4px 0; padding: 12px 14px; border-radius: 16px; background: var(--cell); font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-quote-time { padding: 6px 16px 0; font-size: 13px; color: var(--label-2); }
.hero-name { font-size: 20px; font-weight: 700; text-align: center; }
.hero-sub { margin-top: -6px; font-size: 14px; color: var(--label-2); }
.info-text { display: block; padding-top: 12px; padding-bottom: 12px; font-size: 15px; line-height: 1.4; }
.rep-body { display: block; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cn-find .btn { flex: none; }
.row.acct-row > .btn { margin-left: auto; }

@media (hover: hover) {
  .cl-item:not([aria-current="true"]):hover { background: var(--fill); }
  .cm-title:hover, .cm-head .icon-btn:hover { background: var(--fill); }
  .cm-older:hover { filter: brightness(1.05); }
  .cl-blocked:hover { color: var(--label); }
}

@media (max-width: 760px) {
  .view[data-view="chat"] { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .chat { display: block; height: auto !important; min-height: 0; }
  .chat-side { border-radius: 24px; }
  .chat-side-head { padding: 14px 12px 6px 18px; }
  .chat-list { overflow: visible; padding-bottom: 8px; }
  .chat-main { display: none; }
  .cm-back { display: inline-grid; }
  .bubble { max-width: 82%; }
  /* an open chat covers the screen, sized to what the keyboard leaves visible */
  body.chat-conv { overflow: hidden; }
  body.chat-conv .app-header, body.chat-conv .tabbar, body.chat-conv .banner, body.chat-conv .chat-side, body.chat-conv .skip { display: none; }
  body.chat-conv .chat-main {
    display: flex; position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); z-index: 45;
    height: 100vh; height: 100dvh; height: var(--vv-h, 100dvh);
    border: 0; border-radius: 0; box-shadow: none; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  body.chat-conv .cm-head {
    padding: calc(6px + env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) 8px max(4px, env(safe-area-inset-left, 0px));
    background: var(--glass-thick); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  }
  body.chat-conv .cm-msgs { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  body.chat-conv .cm-foot { padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--glass-thick); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
  body.chat-conv.kb-open .cm-foot { padding-bottom: 0; }
  .cm-jump { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- iPhone app extras, chat rules, legal links ---------- */
.plus-badge.bell { background: linear-gradient(135deg, #FFD36B, #F2A81D 55%, #D98A0B); box-shadow: 0 8px 22px rgb(217 138 11 / .32), inset 0 1px 0 rgb(255 255 255 / .45); }
.plus-badge.bell svg, .chat-rules .plus-badge svg { fill: none; stroke-width: 1.8; }
.remind-time .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; border-top: var(--hair) solid var(--separator); }
.auth-foot a { color: var(--accent); white-space: nowrap; }
.chat-rules { max-width: 560px; margin: 8px auto 0; padding: 26px 24px 22px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.chat-rules .plus-badge { background: linear-gradient(135deg, #6FD6DE, #1597A8 60%, #0E6F7C); box-shadow: 0 8px 22px rgb(21 151 168 / .3), inset 0 1px 0 rgb(255 255 255 / .4); }
.chat-rules h1 { font-size: 24px; font-weight: 700; margin: 6px 0 14px; }
.cr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; text-align: left; }
.cr-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.4; }
.cr-list li svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--green); stroke-width: 2.4; }
.cr-foot { margin-top: 16px; font-size: 14px; color: var(--label-2); }
.cr-go { margin-top: 18px; min-width: 180px; height: 44px; border-radius: 22px; font-size: 16px; }
.cr-more { margin-top: 10px; font-size: 14px; text-decoration: none; }

/* ---------- study pet ---------- */
svg.pet-svg, svg.pet-still, svg.pet-item { fill: #000; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; }
svg.pet-still { width: 100%; height: auto; }
.pet-card { padding: 10px 10px 14px; }
.pet-stage {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden;
  background: #BFE3FF; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; cursor: grab; outline: none;
}
.pet-stage:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.pet-stage.playing { touch-action: none; }
.pet-stage svg.pet-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pet-mood { margin: 12px 8px 2px; font-size: 17px; font-weight: 600; text-align: center; text-wrap: balance; }
.pet-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 4px 0; }
.pet-act {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 9px;
  border: 0; border-radius: 18px; background: rgb(120 120 128 / .1); background: color-mix(in oklab, var(--c) 14%, transparent);
  color: var(--c); font-size: 14px; font-weight: 600;
}
.pet-act svg { width: 26px; height: 26px; stroke-width: 2; }
.pet-act span { color: var(--label); }
.pet-act[aria-pressed="true"] { background: var(--c); color: #fff; }
.pet-act[aria-pressed="true"] span { color: #fff; }
.pet-count { position: absolute; top: 5px; left: calc(50% + 8px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--c); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; }
.pet-throw { display: flex; margin: 8px auto 0; }
.pet-throw[hidden] { display: none; }
.pet-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.need { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.need-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--c); color: #fff; flex: none; }
.need-ic svg { width: 21px; height: 21px; stroke-width: 2; }
.need-main { flex: 1; min-width: 0; }
.need-top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.need-top b { font-weight: 600; }
.need-val { color: var(--label-2); font-variant-numeric: tabular-nums; }
.need-bar { display: block; height: 10px; border-radius: 5px; background: var(--fill); overflow: hidden; }
.need-fill { display: block; height: 100%; border-radius: 5px; background: var(--c, var(--accent)); transition: width .5s ease; }
.need.low .need-val { color: var(--red); font-weight: 700; }
.pet-note { margin-top: 10px; font-size: 13.5px; color: var(--label-2); line-height: 1.4; }
.grow-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
.grow-stages span { padding: 5px 2px; border-radius: 9px; background: var(--fill); color: var(--label-2); font-size: 11.5px; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow-stages .on { background: color-mix(in srgb, var(--hl) 24%, transparent); color: var(--orange); }
.grow-stages .cur { background: var(--orange); color: #fff; }
.grow-bar { --c: var(--orange); height: 12px; border-radius: 6px; }
.grow-next { margin-top: 8px; font-size: 15px; font-weight: 600; }
.pet-focus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.pet-timer { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--label-2); }
.pet-timer b { color: var(--label); font-variant-numeric: tabular-nums; }
.pet-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 20%, transparent); flex: none; }
.pet-adopt { text-align: center; padding: 22px 20px 26px; }
.pet-adopt-art { display: flex; justify-content: center; align-items: flex-end; margin: 0 auto 8px; max-width: 420px; }
.pet-adopt-art svg { width: 33%; height: auto; }
.pet-adopt h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.pet-adopt p { color: var(--label-2); max-width: 440px; margin: 0 auto 18px; font-size: 15.5px; line-height: 1.45; }
.pet-adopt .btn { height: 44px; padding: 0 22px; border-radius: 22px; font-size: 16px; }
.pet-preview { display: grid; place-items: center; height: 172px; margin: 2px 0 8px; border-radius: 20px; background: linear-gradient(#CFEBFF, #EAF7FF 64%, #BFE6A8 64%, #A6DA8C); overflow: hidden; }
.pet-preview svg.pet-still { width: auto; height: 156px; }
.pet-breeds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pet-breed {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 9px;
  border: 0; border-radius: 16px; background: var(--cell); color: var(--label); font-size: 13px; font-weight: 600; line-height: 1.2;
}
.pet-breed[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--accent); }
.pb-art { display: block; width: 100%; }
.pb-art svg.pet-still { max-height: 84px; }
.pet-breed .tag-plus { position: absolute; top: 6px; right: 6px; font-size: 10.5px; padding: 1px 6px; }
.pet-coats { display: flex; flex-wrap: wrap; gap: 8px; }
.pet-coat { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 8px; border: 0; border-radius: 20px; background: var(--cell); color: var(--label); font-size: 15px; font-weight: 600; }
.pet-coat i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.pet-coat[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--accent); }
.wear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.wear-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 10px; border: 0; border-radius: 16px; background: var(--cell); color: var(--label); text-align: center; line-height: 1.25; }
.wear-item b { font-size: 13px; font-weight: 600; }
.wi-sub { font-size: 12px; color: var(--label-2); }
.wi-art { display: grid; place-items: center; height: 48px; }
.wi-art svg.pet-item { width: 62px; height: 46px; }
.wear-item[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--accent); }
.wear-item[aria-pressed="true"] .wi-sub { color: var(--accent); font-weight: 600; }
.wear-item.locked .wi-art { opacity: .35; filter: grayscale(1); }
.pet-howto { display: block; }
.pet-howto p { font-size: 14.5px; line-height: 1.45; margin: 4px 0 8px; color: var(--label); }
.pet-howto b { font-weight: 600; }
.pet-nudge { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 460px; margin-top: 14px; padding: 8px 14px 8px 8px; border: 0; border-radius: 20px; background: color-mix(in srgb, var(--hl) 22%, transparent); color: var(--label); text-align: left; }
.pet-nudge.sad { background: color-mix(in srgb, var(--red) 12%, transparent); }
.pet-nudge-art { display: grid; place-items: center; width: 58px; height: 50px; flex: none; border-radius: 14px; background: linear-gradient(#CFEBFF, #EAF7FF 62%, #BFE6A8 62%); overflow: hidden; }
.pet-nudge-art svg.pet-still { width: 58px; }
.pet-nudge .two-line b { font-size: 15.5px; }
.pet-nudge .chev { margin-left: auto; color: var(--label-3); }
@media (hover: hover) {
  .pet-act:hover, .pet-breed:hover, .pet-coat:hover, .wear-item:hover { filter: brightness(1.04); }
  .pet-nudge:hover { filter: brightness(1.03); }
}
.pet-head { flex-wrap: nowrap; align-items: flex-end; }
.pet-head > div:first-child { min-width: 0; flex: 1 1 auto; }
.pet-head .actions { flex-wrap: nowrap; }
@media (min-width: 1000px) {
  .pet-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
  .pet-layout .pet-cols { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
}
@media (max-width: 420px) {
  .pet-head .actions .btn { padding: 0 12px; }
}
@media (max-width: 760px) {
  .pet-cols { grid-template-columns: minmax(0, 1fr); }
  .pet-card { padding: 8px 8px 12px; }
  .pet-act { padding: 9px 2px 8px; font-size: 13px; }
}
/* ---------- study pet: exam season, ghosts, friends' gardens ---------- */
.pet-gardens { display: flex; justify-content: center; margin: 2px 0 10px; overflow-x: auto; scrollbar-width: none; }
.pet-gardens::-webkit-scrollbar { display: none; }
.pet-gardens .seg { flex: none; }
.pet-gardens .seg button { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.pet-season { margin: 2px 12px 0; font-size: 13.5px; color: var(--label-2); text-align: center; text-wrap: balance; line-height: 1.4; }
.pet-season.on { color: var(--label); }
.pet-season.on::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hl) 30%, transparent); vertical-align: 1px; }
.pet-revive { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 12px auto 0; max-width: 380px; padding: 0 8px; }
.revive-bar { --c: #8C3B72; width: 100%; height: 12px; border-radius: 6px; }
.revive-txt { font-size: 14px; font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
.pet-revive .btn { height: 44px; padding: 0 22px; border-radius: 22px; font-size: 16px; }
.pet-revive .pet-timer { justify-content: center; }
.pet-needs.paused .need { opacity: .45; }
.pet-friends .card-head .icon-btn { margin-left: auto; }
.friend-row, .pet-friends .row-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 0; border: 0; background: none; color: var(--label); text-align: left; }
.friend-row + .friend-row, .friend-gardens .row-btn + .row-btn { border-top: .5px solid var(--separator); }
.friend-row .chev, .friend-gardens .chev { margin-left: auto; color: var(--label-3); flex: none; }
.friend-art { display: grid; place-items: center; width: 52px; height: 46px; flex: none; border-radius: 13px; background: linear-gradient(#CFEBFF, #EAF7FF 62%, #BFE6A8 62%); overflow: hidden; }
.friend-art svg.pet-still { width: 52px; }
.friend-row .two-line { min-width: 0; }
.friend-row .two-line b, .friend-row .two-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.garden-invites { display: grid; gap: 8px; margin-bottom: 10px; }
.garden-invite { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 12%, transparent); flex-wrap: wrap; }
.gi-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; flex: none; }
.gi-ic svg { width: 20px; height: 20px; }
.garden-invite .two-line { flex: 1 1 140px; min-width: 0; }
.gi-btns { display: flex; gap: 6px; margin-left: auto; }
.garden-hero { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; background: linear-gradient(160deg, #5FE0A8, #1E9E6A); color: #fff; }
.garden-hero svg { width: 44px; height: 44px; }
.wear-item.ride .wi-art svg.pet-item { width: 84px; }
#top-nav [data-tab="pet"], #tabbar [data-tab="pet"] { position: relative; }
#top-nav [data-tab="pet"].has-dot::after, #tabbar [data-tab="pet"].has-dot::after {
  content: ''; position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg-solid);
}
#top-nav [data-tab="pet"].has-dot::after { top: 4px; right: 4px; }

/* ---------- big screens ----------
   On wide windows app.js sets --z (1 to 1.6) and the class "zoomed" on <html>: the header,
   page, sheets and toasts scale up together, and the page grows to 90% of the window,
   so the app fills a big screen at a comfortable size. Phones, tablets and laptops keep --z at 1.
   Browsers zoom vh and vw in different ways, so zoomed parts use --ih (the window height in px). */
:root { --z: 1; }
.app-header > .wrap, .view.wrap, .banner { max-width: max(1260px, min(90%, 1600px)); }
@media screen {
  html.zoomed .app-header, html.zoomed .banner, html.zoomed .view, html.zoomed .auth-card, html.zoomed dialog, html.zoomed .toast { zoom: var(--z); }
  html.zoomed .sheet { max-height: min(calc(var(--ih, 100vh) * .86 / var(--z)), 880px); }
  html.zoomed .chat { height: calc(var(--ih, 100vh) * .7 / var(--z)); }
  html.zoomed .msg-quote { max-height: calc(var(--ih, 100vh) * .4 / var(--z)); }
  html.zoomed .toast { max-width: 760px; }
}
/* the garden grows with the window, but never pushes the pet's buttons below it */
@media (min-width: 1000px) {
  .pet-layout { grid-template-columns: minmax(0, 1.7fr) minmax(max(300px, calc(100% - 18px - max(520px, (var(--ih, 100vh) / var(--z) - 376px) * 1.6 + 20px))), 1fr); }
}

/* ---------- the day's hourly plan (calendar) ---------- */
.dp-allday { margin: 0 -6px; padding: 0 6px; border-radius: 16px; transition: box-shadow .15s, background .15s; }
.dp-allday.drop { background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: inset 0 0 0 2px var(--accent); }
.tl-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 6px 10px; }
.tl-tools .btn { padding: 0 11px; }
.tl-tools .btn svg { width: 15px; height: 15px; }
.tl-study { background: color-mix(in srgb, var(--accent) 14%, transparent); cursor: grab; }
.tl-scroll {
  position: relative; max-height: max(300px, min(560px, calc(var(--ih, 100vh) / var(--z) - 330px)));
  overflow-y: auto; overscroll-behavior: contain; margin: 0 -8px; padding: 8px 8px 6px;
  border-top: var(--hair) solid var(--separator);
}
.tl { position: relative; margin-left: 42px; cursor: pointer; }
.tl-hr { position: absolute; left: -42px; right: 0; height: 0; border-top: var(--hair) solid var(--separator); pointer-events: none; }
.tl-hr span { position: absolute; left: 0; top: -7px; width: 36px; padding-right: 4px; font-size: 11px; font-weight: 500; line-height: 14px; color: var(--label-3); text-align: right; font-variant-numeric: tabular-nums; }
.tl-class {
  position: absolute; left: 0; right: 0; padding: 2px 8px; border-radius: 8px; overflow: hidden; pointer-events: none;
  background: color-mix(in srgb, var(--c, var(--gray)) 9%, transparent);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--c, var(--gray)) 40%, transparent);
  font-size: 11px; font-weight: 600; color: var(--label-3); white-space: nowrap; text-overflow: ellipsis;
}
.tl-item {
  position: absolute; z-index: 2; display: flex; align-items: flex-start; gap: 2px; padding-right: 2px; border-radius: 9px; overflow: hidden;
  background: var(--glass-solid);
  background: color-mix(in srgb, var(--c, var(--accent)) 24%, var(--glass-solid));
  box-shadow: inset 3px 0 0 var(--c, var(--accent)), 0 1px 3px rgb(0 0 0 / .08);
  border: 1px solid var(--glass-solid); cursor: grab; touch-action: pan-y;
}
.tl-item.k-task { background: color-mix(in srgb, var(--c, var(--gray)) 10%, var(--glass-solid)); box-shadow: inset 3px 0 0 var(--c, var(--label-3)), inset 0 0 0 1px var(--separator); }
.tl-item.k-plan { background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--glass-solid)); background-image: repeating-linear-gradient(135deg, transparent 0 9px, color-mix(in srgb, var(--c, var(--accent)) 9%, transparent) 9px 12px); }
.tl-item.live { box-shadow: inset 3px 0 0 var(--c, var(--accent)), 0 0 0 2px var(--accent); }
.tl-item.done { opacity: .5; }
.tl-item.done .tl-main b { text-decoration: line-through; }
.tl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-self: stretch; gap: 0; padding: 3px 4px 3px 9px; border: 0; background: none; color: var(--label); text-align: left; line-height: 1.25; cursor: inherit; }
.tl-main b { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; font-weight: 600; color: color-mix(in oklab, var(--c, var(--label)) var(--ink-mix), var(--ink-base)); }
.tl-main b svg { width: 13px; height: 13px; stroke-width: 2.2; }
.tl-t { font-size: 11px; color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-item.short .tl-main { flex-direction: row; align-items: center; gap: 6px; padding-top: 1px; padding-bottom: 1px; }
.tl-go { flex: none; height: 22px; margin: 5px 3px 0 0; padding: 0 10px; border: 0; border-radius: 11px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; }
.tl-item.short .tl-go { margin-top: 0; align-self: center; }
.tl-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.tl-grip::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: var(--label-3); opacity: 0; transition: opacity .15s; }
.tl-now { position: absolute; z-index: 3; left: -6px; right: 0; height: 0; border-top: 2px solid var(--accent); pointer-events: none; }
.tl-now::before { content: ''; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tl-drop { position: absolute; z-index: 4; left: 0; right: 0; padding: 2px 8px; border: 2px dashed var(--accent); border-radius: 9px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.tl-hint { margin: 8px 6px 0; font-size: 12px; line-height: 1.35; color: var(--label-2); }
.plan-seg { display: grid; width: 100%; margin: 4px 0 2px; }
.plan-seg button { height: 32px; font-size: 14px; }
.task-meta .tm { font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; }
.mp.plan { background: color-mix(in srgb, var(--c, var(--accent)) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--accent)) 45%, transparent); }
.mp.plan .t { font-weight: 500; }
/* dragging */
[data-drag] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mp[data-drag], .bar[data-drag] { cursor: grab; }
body.dragging, body.dragging * { cursor: grabbing !important; }
.is-dragging { opacity: .35; }
.mday.drop { background: color-mix(in srgb, var(--accent) 14%, transparent) !important; box-shadow: inset 0 0 0 2px var(--accent); }
.drag-ghost {
  position: fixed; z-index: 80; max-width: 240px; padding: 7px 12px; border-radius: 12px; pointer-events: none;
  transform: translate(12px, -50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  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); font-size: 13px; font-weight: 600; color: var(--label);
}
@media screen { html.zoomed .drag-ghost { zoom: var(--z); } }
@media (hover: hover) {
  .tl-item:hover .tl-grip::after { opacity: .8; }
  .tl-item:hover { filter: brightness(1.02); }
}
@media (max-width: 1080px) {
  .tl-scroll { max-height: 460px; }
}
@media (max-width: 760px) {
  .mp.plan { border-radius: 2px; background: none; box-shadow: inset 0 0 0 1.5px var(--c, var(--accent)); }
  .tl-scroll { max-height: 420px; }
  .tl-grip { height: 12px; }
}
.mstack { pointer-events: none; }
.mstack > * { pointer-events: auto; }
.seg-watch svg { width: 17px; height: 17px; vertical-align: -3px; }

/* ---------- repeating tasks ---------- */
.rep-chips { padding-top: 4px; padding-bottom: 4px; }
.rep-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; width: 100%; }
.rep-day { position: relative; display: grid; place-items: center; cursor: pointer; }
.rep-day input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rep-day span[aria-hidden] {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--fill); color: var(--label); font-size: 15px; font-weight: 600; pointer-events: none;
  transition: background .2s, color .2s, transform .25s var(--spring, cubic-bezier(.3,1.4,.5,1)), box-shadow .2s;
}
.rep-day input:checked + span { background: var(--accent); color: var(--on-accent); transform: scale(1.06); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.rep-day input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.rep-tools { min-height: 40px; padding-top: 2px; padding-bottom: 6px; }
.rep-presets { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.rep-presets .link { font-size: 14px; }
.rep-label { font-size: 15px; }
.task-meta .rep { color: var(--accent); font-weight: 500; }
.task-meta .rep svg { width: 13px; height: 13px; stroke-width: 2.2; }
.mp.task.rep .t::before { border-style: dashed; }

/* ---------- reminders ---------- */
.rem-row { padding-top: 14px; padding-bottom: 10px; }
.rem-track { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; }
/* the line the dots sit on: two weeks out on the left, the day itself on the right */
.rem-track::before {
  content: ''; position: absolute; top: 15px; left: calc(100% / 12); right: calc(100% / 12); height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--fill), color-mix(in srgb, var(--accent) 45%, var(--fill)));
}
.rem-dot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; }
.rem-dot input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.rem-pip {
  position: relative; width: 22px; height: 22px; margin-top: 5px; border-radius: 50%;
  background: var(--cell); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--label-2) 45%, transparent);
  transition: transform .3s var(--spring, cubic-bezier(.3,1.4,.5,1)), background .2s, box-shadow .2s;
}
.rem-dot.day .rem-pip { width: 30px; height: 30px; margin-top: 1px; }
.rem-cap { font-size: 12px; font-weight: 600; color: var(--label-2); transition: color .2s; }
.rem-dot input:checked ~ .rem-pip {
  background: var(--accent); transform: scale(1.12);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 4px 12px color-mix(in srgb, var(--accent) 45%, transparent);
}
.rem-dot input:checked ~ .rem-pip::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 34%; height: 34%; border-radius: 50%; background: var(--on-accent);
}
.rem-dot input:checked ~ .rem-cap { color: var(--accent); }
.rem-dot input:focus-visible ~ .rem-pip { outline: 2.5px solid var(--accent); outline-offset: 3px; }
.rem-dot:active .rem-pip { transform: scale(.9); }
.rem-next li { align-items: center; }
.rem-next .two-line b { font-weight: 600; }
.rem-next .muted { font-size: 14px; }
.ev-rem .rem-row { padding-top: 10px; }

/* ---------- calendar import ---------- */
.plus-badge.cal { background: linear-gradient(135deg, #5FE0A8, #1E9E6A 58%, #127F5B); box-shadow: 0 8px 22px rgb(30 158 106 / .3), inset 0 1px 0 rgb(255 255 255 / .4); }
.plus-badge.cal svg { fill: none; stroke-width: 1.8; }
.how-card .row:first-child { padding-top: 10px; padding-bottom: 10px; }
.how-seg { width: 100%; }
.how-body { display: block; padding-top: 4px; padding-bottom: 14px; }
.how-steps { margin: 0; padding: 0 0 0 4px; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.how-steps li { position: relative; padding-left: 34px; font-size: 15px; line-height: 1.4; counter-increment: step; }
.how-steps li::before {
  content: counter(step); position: absolute; left: 0; top: -1px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-size: 13px; font-weight: 700;
}
.how-steps b { font-weight: 600; }
.feed-row { gap: 8px; }
.feed-row .two-line { flex: 1; min-width: 0; }
.feed-row .btn.small { flex: none; }
.btn.danger-text { color: var(--red); }
.btn.armed { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.import-list li { align-items: center; }
.import-list .two-line { min-width: 0; }
.import-list .two-line b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.type-chip {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 12px; font-weight: 600; background: var(--fill); color: var(--label-2);
}
.type-chip svg { width: 13px; height: 13px; stroke-width: 2.2; }
.type-chip.t-exam, .type-chip.t-mock { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.type-chip.t-deadline { background: color-mix(in srgb, var(--orange) 18%, transparent); color: color-mix(in srgb, var(--orange) 80%, var(--label)); }
.type-chip.t-holiday { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.type-chip.t-task { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.row-btn.busy { opacity: .55; pointer-events: none; }

/* ---------- what do you study (log in) ---------- */
.levels { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 10px; }
.level-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px 12px 12px; border: 0; border-radius: 20px;
  background: var(--fill); color: var(--label); text-align: left; cursor: pointer;
  transition: transform .35s var(--spring, cubic-bezier(.3,1.4,.5,1)), background .2s, box-shadow .25s;
}
.level-btn .two-line { flex: 1; min-width: 0; }
.level-btn .two-line b { font-size: 17px; font-weight: 650; }
.level-btn .two-line span { font-size: 13.5px; }
.level-btn > svg { width: 18px; height: 18px; color: var(--label-3, var(--label-2)); }
.level-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.level-tile {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  color: #fff; font-size: 14px; font-weight: 800; letter-spacing: -.01em;
  background: linear-gradient(135deg, var(--l1), var(--l2));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--l2) 38%, transparent), inset 0 1px 0 rgb(255 255 255 / .35);
}
.level-tile.mini { width: 30px; height: 30px; border-radius: 9px; font-size: 10.5px; box-shadow: inset 0 1px 0 rgb(255 255 255 / .35); }
.lv-ib { --l1: #4F6595; --l2: #263557; }
.lv-bach { --l1: #FF8F57; --l2: #D9501F; }
.lv-eso { --l1: #4FD69C; --l2: #167F59; }
.lv-uni { --l1: #C46BA6; --l2: #7A2F63; }
.level-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 6px; padding: 4px 12px 4px 4px; border: 0; border-radius: 999px;
  background: var(--fill); color: var(--label); font-size: 14px; font-weight: 600; cursor: pointer;
}
.level-change { color: var(--accent); font-weight: 500; }
.level-row { gap: 12px; }
.level-row .two-line { flex: 1; }
.level-row > svg:last-child { color: var(--accent); }
@media (hover: hover) {
  .level-btn:hover { background: var(--fill-2, var(--fill)); }
}
.level-btn:active { transform: scale(.97); }

/* =========================================================
   Bloc: paper, light and motion
   ========================================================= */
/* paper grain over the sunlit page */
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .18  0 0 0 1 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
.display, .count-num, .hero .display { font-family: var(--font-round); }
.display { letter-spacing: -.01em; }

/* liquid glass: a bright rim where the light hits, softer on the far edge */
/* the rims need a positioned box; the day panel (sticky), tab bar and toast (fixed) already are */
.card, .count, .month, .brand, .top-nav, .sheet, .level-btn { position: relative; }
.card::before, .count::before, .month::before, .daypanel::before, .brand::before, .top-nav::before, .tabbar::before, .sheet::before, .toast::before, .auth-card:not(.splash)::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: linear-gradient(150deg, var(--glass-rim), transparent 34%, transparent 66%, color-mix(in srgb, var(--glass-rim) 55%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* a soft light that follows the pointer across glass */
@media (hover: hover) and (pointer: fine) {
  .card::after, .count::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
    background: radial-gradient(320px circle at var(--mx, -400px) var(--my, -400px), rgb(255 255 255 / .22), transparent 62%);
    opacity: 0; transition: opacity .35s;
  }
  .card.lit::after, .count.lit::after { opacity: 1; }
  :root[data-theme="dark"] .card::after, :root[data-theme="dark"] .count::after { background: radial-gradient(320px circle at var(--mx, -400px) var(--my, -400px), rgb(255 226 196 / .07), transparent 62%); }
}
@media (prefers-color-scheme: dark) and (hover: hover) and (pointer: fine) {
  :root:not([data-theme="light"]) .card::after, :root:not([data-theme="light"]) .count::after { background: radial-gradient(320px circle at var(--mx, -400px) var(--my, -400px), rgb(255 226 196 / .07), transparent 62%); }
}
/* the header glass thickens once the page scrolls under it */
.brand, .top-nav, .icon-btn { transition: box-shadow .3s, background .3s, transform .5s var(--spring); }
body.scrolled .brand, body.scrolled .top-nav, body.scrolled .icon-btn { box-shadow: 0 8px 28px rgb(60 36 16 / .14), inset 0 1px 0 var(--glass-hi); }

/* presses: everything you tap gives a little */
.btn, .icon-btn, .who-btn, .level-btn, .guide-step, .accent-sw, .pick-chip, .seg button, .top-nav button, .tabbar button, .round-btn, .pet-act, .heads-up, .win, .rep-day span[aria-hidden], .nav-btn, .row-btn {
  transition: transform .5s var(--spring), background-color .2s, color .2s, box-shadow .25s, opacity .2s;
}
.btn:active, .icon-btn:active, .who-btn:active, .guide-step:active, .accent-sw:active, .pick-chip:active, .round-btn:active, .pet-act:active, .heads-up:active, .win:active { transform: scale(.95); transition-duration: .12s; }
.seg button:active, .top-nav button:active, .tabbar button:active, .nav-btn:active { transform: scale(.92); transition-duration: .12s; }
.row-btn:active { transform: scale(.985); transition-duration: .12s; }
.btn.primary { box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 32%, transparent), inset 0 1px 0 rgb(255 255 255 / .25); }
.btn.primary:hover { filter: brightness(1.05); }

/* the tab pill slides to the section you pick */
.top-nav, .tabbar { isolation: isolate; }
.nav-pill {
  position: absolute; left: 0; top: 0; z-index: -1; width: 0; height: 0; border-radius: 20px; pointer-events: none;
  background: var(--sel); box-shadow: 0 1px 5px rgb(60 36 16 / .12), inset 0 1px 0 var(--glass-hi);
  transition: transform .6s var(--spring), width .6s var(--spring), height .6s var(--spring), opacity .2s;
}
.tabbar .nav-pill { border-radius: 27px; background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: none; }
.top-nav button[aria-current="page"] { background: none; box-shadow: none; }
.tabbar button[aria-current="page"] { background: none; }
.tabbar button[aria-current="page"] svg { animation: tab-hop .6s var(--spring); }
@keyframes tab-hop { 40% { transform: translateY(-3px) scale(1.12); } }

/* a section opening: the page drifts in, then its cards rise one after another */
.view.enter { animation: view-in .5s var(--spring-soft) both; }
@keyframes view-in { from { opacity: 0; transform: translateX(calc(var(--vt-dir, 0) * 14px)) translateY(6px); } }
.view.enter .rise { animation: rise .62s var(--spring-soft) both; animation-delay: calc(var(--i, 0) * 45ms + 40ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* sheets and toasts arrive on a spring */
dialog[open] .sheet { animation: sheet-in .5s var(--spring-soft); }
dialog::backdrop { background: rgb(30 18 8 / .26); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.toast[popover]:popover-open { animation: toast-in .55s var(--spring); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(18px) scale(.9); } to { transform: translateX(-50%); } }

/* switches bounce, checkboxes pop */
.switch input::after, .ios-switch::after { transition: transform .5s var(--spring), width .25s; }
.switch input:active::after, .ios-switch:active::after { width: 33px; }
.switch input:checked:active::after, .ios-switch:checked:active::after { transform: translateX(14px); }
.check .box { transition: background .2s, border-color .2s, transform .5s var(--spring); }
.check input:checked + .box { animation: check-pop .5s var(--spring); }
.check input:checked + .box svg { stroke-dasharray: 24; stroke-dashoffset: 0; animation: check-draw .35s .05s ease-out both; }
@keyframes check-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes check-draw { from { stroke-dashoffset: 24; } }
.task.pop .task-title { animation: done-slide .5s var(--spring-soft); }
@keyframes done-slide { 40% { transform: translateX(6px); color: var(--green); } }

/* confetti layer */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2147483000; }

/* today's wins: a ring for today's tasks, a streak for days in a row */
.wins { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.win {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; border: 0; border-radius: 22px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi); color: var(--label); text-align: left;
}
.win .two-line b { font-family: var(--font-round); font-size: 16px; font-weight: 700; line-height: 1.1; }
.win .two-line span { font-size: 12px; line-height: 1.2; }
.wring { width: 34px; height: 34px; transform: rotate(-90deg); fill: none; stroke-width: 4; flex: none; }
.wring-bg { stroke: var(--fill-2); }
.wring-fg { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: calc(97.4 * (1 - var(--p, 0))); transition: stroke-dashoffset 1s var(--spring-soft); }
.win.full .wring-fg { stroke: var(--green); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--green) 60%, transparent)); }
.win.full .two-line b { color: var(--green); }
.flame {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 70%, var(--hl), var(--accent) 75%); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent);
}
.flame svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.win.cold .flame { background: var(--fill-2); color: var(--label-2); box-shadow: none; }
.win.hot .flame { animation: flicker 2.6s ease-in-out infinite; }
@keyframes flicker { 50% { transform: scale(1.08) rotate(-4deg); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 55%, transparent); } }

/* the highlighter: a marker swipe behind important words */
.hl { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--hl) 55%, transparent) 58%, color-mix(in srgb, var(--hl) 55%, transparent) 92%, transparent 92%); padding: 0 .1em; }

@media (prefers-reduced-motion: reduce) {
  .view.enter, .view.enter .rise { animation: none; }
  .nav-pill { transition: none; }
}
@media (max-width: 1080px) { .daypanel { position: relative; } }
