/* ───────────────────────── Tokens ───────────────────────── */
:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #fdfdfc;
  --surface-2: #f1f0ec;
  --surface-3: #e9e8e3;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e7e6e0;
  --axis: #c3c2b7;
  --line: rgba(11, 11, 11, 0.08);
  --line-strong: rgba(11, 11, 11, 0.14);
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --k-annual: #2a78d6;
  --k-sick: #eb6834;
  --k-family: #1baf7a;
  --k-other: #898781;
  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --shadow-sm: 0 1px 2px rgba(20, 20, 15, 0.05);
  --shadow: 0 1px 2px rgba(20, 20, 15, 0.04), 0 6px 24px -8px rgba(20, 20, 15, 0.1);
  --shadow-lg: 0 24px 60px -12px rgba(20, 20, 15, 0.28), 0 2px 6px rgba(20, 20, 15, 0.06);
  --hero-a: #2f80e0;
  --hero-b: #1a4f99;
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.36, 0.5, 1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --surface-3: #2c2c2a;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --accent: #3987e5;
    --accent-ink: #86b6ef;
    --k-annual: #3987e5;
    --k-sick: #d95926;
    --k-family: #199e70;
    --k-other: #6f6e69;
    --good-ink: #0ca30c;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 30px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 80px -10px rgba(0, 0, 0, 0.75);
    --hero-a: #2b6fc4;
    --hero-b: #123a73;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --surface-3: #2c2c2a;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #3987e5;
  --accent-ink: #86b6ef;
  --k-annual: #3987e5;
  --k-sick: #d95926;
  --k-family: #199e70;
  --k-other: #6f6e69;
  --good-ink: #0ca30c;
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -10px rgba(0, 0, 0, 0.75);
  --hero-a: #2b6fc4;
  --hero-b: #123a73;
}

/* ───────────────────────── Base ───────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.015em;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
.icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.hidden {
  display: none;
}
.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.pad {
  padding: 32px 0;
}
.small-pad {
  padding: 4px 0 2px;
  margin: 0;
}

/* Boot screen while WebAssembly loads */
#boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 100;
}
.boot-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
  animation: breathe 1.2s var(--ease) infinite alternate;
}
@keyframes breathe {
  from {
    transform: scale(0.88);
    opacity: 0.6;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ───────────────────────── Shell ───────────────────────── */
.shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px 64px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.02em;
  flex: 1;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
  box-shadow: 0 4px 12px -4px color-mix(in oklab, var(--accent) 60%, transparent);
}
.brand-mark .icon {
  width: 18px;
  height: 18px;
}
.topbar-actions {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.tabs {
  --n: 5;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.tab-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / var(--n));
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  transform: translateX(calc(var(--tab) * 100%));
  transition: transform 0.42s var(--spring);
  will-change: transform;
}
.tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 550;
  color: var(--ink-2);
  transition: color 0.2s;
  white-space: nowrap;
}
.tab .icon {
  width: 16px;
  height: 16px;
}
.tab:hover {
  color: var(--ink);
}
.tab.active {
  color: var(--ink);
}

.content {
  padding-top: 12px;
}
.page {
  animation: page-in 0.45s var(--ease) both;
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.reveal {
  animation: rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
}

.fab {
  display: none;
}

/* ───────────────────────── Buttons ───────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  font-weight: 560;
  font-size: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-sm);
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--accent) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn.primary:hover {
  background: color-mix(in oklab, var(--accent) 88%, #000);
}
.btn.ghost {
  background: transparent;
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--surface-2);
}
.btn.danger {
  color: var(--critical);
}
.btn.small {
  height: 32px;
  padding: 0 11px;
  font-size: 13px;
}
.btn.big {
  height: 48px;
  font-size: 16px;
  border-radius: 14px;
  width: 100%;
}
.btn .icon {
  width: 16px;
  height: 16px;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s, transform 0.15s var(--ease);
  flex: none;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.icon-btn:active {
  transform: scale(0.92);
}
.link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--accent-ink);
  font-weight: 560;
  font-size: 13.5px;
}
.link .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.2s var(--ease);
}
.link:hover .icon {
  transform: translateX(2px);
}
.link.center {
  display: block;
  margin: 14px auto 0;
}

/* ───────────────────────── Cards & layout ───────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
  padding: 18px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head h3 {
  font-size: 15px;
  font-weight: 640;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-sub {
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.card-head .card-sub {
  margin: 2px 0 0;
}
.grid-2 {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-content: start;
  min-width: 0;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 18px;
}
.page-head h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.page-head .sub {
  margin: 4px 0 0;
  color: var(--ink-2);
}

/* ───────────────────────── Hero ───────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 24px;
  padding: 28px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.18), transparent 50%),
    radial-gradient(90% 120% at 100% 100%, rgba(98, 80, 214, 0.45), transparent 60%),
    linear-gradient(135deg, var(--hero-a), var(--hero-b));
  box-shadow: 0 24px 50px -24px color-mix(in oklab, var(--hero-b) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.hero.neg {
  --hero-a: #c74242;
  --hero-b: #7a1f1f;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -60% 30%;
  height: 120%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}
.hero-label {
  font-size: 14px;
  font-weight: 560;
  opacity: 0.85;
}
.hero-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 2px 0 14px;
}
.counter {
  font-size: clamp(56px, 9vw, 84px);
  line-height: 1;
  font-weight: 680;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.hero-unit {
  font-size: 20px;
  font-weight: 560;
  opacity: 0.8;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 540;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.pill .icon {
  width: 14px;
  height: 14px;
}
.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: center;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 15px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  min-width: 0;
}
.stat-label {
  font-size: 12px;
  font-weight: 560;
  opacity: 0.78;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.stat-value small {
  font-size: 13px;
  font-weight: 520;
  opacity: 0.8;
  letter-spacing: 0;
}
.stat-sub {
  font-size: 12.5px;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ───────────────────────── Alerts ───────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  margin-top: 12px;
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
  --tone: var(--accent);
}
.alert.tone-warning {
  --tone: var(--warning);
}
.alert.tone-serious {
  --tone: var(--serious);
}
.alert.tone-critical {
  --tone: var(--critical);
}
.alert-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
  color: var(--tone);
  background: color-mix(in oklab, var(--tone) 14%, transparent);
}
.alert-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
  color: var(--ink-2);
  min-width: 0;
}
.badge.warn {
  background: color-mix(in oklab, var(--serious) 16%, transparent);
  color: var(--critical);
}
.alert-text strong {
  color: var(--ink);
  font-weight: 620;
}

/* ───────────────────────── Chart ───────────────────────── */
.chart-card {
  min-width: 0;
}
.chart {
  position: relative;
  height: 230px;
  touch-action: pan-y;
  border-radius: 10px;
}
.chart-svg {
  display: block;
  overflow: visible;
}
.grid line {
  stroke: var(--grid);
  stroke-width: 1;
}
.grid text,
.x-axis text,
.today-mark text {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.baseline {
  stroke: var(--axis);
  stroke-width: 1;
}
.grad-top {
  stop-color: var(--accent);
  stop-opacity: 0.22;
}
.grad-bottom {
  stop-color: var(--accent);
  stop-opacity: 0;
}
.area {
  fill: url(#area-grad);
  animation: fade 0.9s var(--ease) 0.25s both;
}
.line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.line.past {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.1s var(--ease) forwards;
}
.line.future {
  stroke-dasharray: 4 5;
  opacity: 0.7;
  animation: fade 0.6s var(--ease) 0.75s both;
}
.today-mark line {
  stroke: var(--ink-2);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.adj-mark {
  fill: var(--surface);
  stroke: var(--ink-2);
  stroke-width: 1.5;
  animation: fade 0.4s var(--ease) 0.9s both;
}
.tooltip em {
  font-style: normal;
  color: var(--accent-ink);
}
.crosshair line {
  stroke: var(--ink-2);
  stroke-width: 1;
}
.crosshair circle {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2.5;
}
.tooltip {
  position: absolute;
  top: -6px;
  transform: translate(-50%, -100%);
  padding: 7px 11px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-lg);
  display: flex;
  flex-direction: column;
  pointer-events: none;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink-2);
  z-index: 2;
}
.tooltip strong {
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}

/* ───────────────────────── Segmented ───────────────────────── */
.segmented {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  padding: 3px;
  border-radius: 11px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  flex: none;
}
.seg-pill {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / var(--n));
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform 0.4s var(--spring);
}
.seg {
  position: relative;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 560;
  color: var(--ink-2);
  border-radius: 8px;
  transition: color 0.2s;
  white-space: nowrap;
}
.seg.active {
  color: var(--ink);
}

/* ───────────────────────── Cycle card ───────────────────────── */
.meter {
  display: flex;
  gap: 3px;
  height: 12px;
  margin: 2px 0 14px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-2);
}
.meter .seg {
  padding: 0;
  height: 100%;
  width: var(--w);
  border-radius: 99px;
  animation: grow 1s var(--ease) 0.3s both;
}
@keyframes grow {
  from {
    width: 0;
  }
}
.seg.taken,
.key.taken {
  background: var(--k-annual);
}
.seg.booked,
.key.booked {
  background: color-mix(in oklab, var(--k-annual) 45%, var(--surface));
}
.seg.left,
.key.left {
  background: var(--k-family);
}
.key {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 8px;
}
.sum-rows {
  margin: 0;
  display: grid;
  gap: 2px;
}
.sum-rows div {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 14px;
}
.sum-rows dt {
  color: var(--ink-2);
  display: flex;
  align-items: center;
}
.sum-rows dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 560;
}
.sum-rows .total {
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.sum-rows .total dt,
.sum-rows .total dd {
  color: var(--ink);
  font-weight: 650;
}

/* ───────────────────────── Plan ahead ───────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 560;
  color: var(--ink-2);
  min-width: 0;
  flex: 1;
}
.field input,
.search {
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  border: 0;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 450;
  transition: box-shadow 0.2s, background 0.2s;
  width: 100%;
  min-width: 0;
}
.field input:focus,
.search:focus {
  outline: none;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-soft);
}
.field.inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.field.inline span {
  white-space: nowrap;
}
.input-suffix {
  position: relative;
  display: flex;
}
.input-suffix em {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  color: var(--muted);
  font-weight: 450;
  pointer-events: none;
}
.plan-result {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--accent-soft);
}
.plan-num {
  font-size: 34px;
  font-weight: 680;
  letter-spacing: -0.03em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.plan-num.neg {
  color: var(--critical);
}
.plan-text {
  display: flex;
  flex-direction: column;
  font-weight: 560;
  font-size: 14px;
}
.plan-text small {
  color: var(--ink-2);
  font-weight: 450;
  font-size: 12.5px;
}

/* ───────────────────────── Lists ───────────────────────── */
.list {
  display: flex;
  flex-direction: column;
  padding: 6px;
}
.list.compact {
  padding: 0;
  margin: 0 -8px;
}
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 13px;
  transition: background 0.18s, transform 0.15s var(--ease);
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 32ms);
}
button.row:hover {
  background: var(--surface-2);
}
button.row:active {
  transform: scale(0.985);
}
.row.static {
  animation: none;
}
.row-bar {
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  background: var(--k);
  flex: none;
}
.row-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.row-title {
  font-weight: 580;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-note {
  color: var(--ink-2);
}
.row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: none;
}
.row-days {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
}
.row-days small {
  font-weight: 450;
  color: var(--muted);
  font-size: 12px;
}
.badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge.info {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.badge.good {
  background: color-mix(in oklab, var(--good) 15%, transparent);
  color: var(--good-ink);
}

.k-annual {
  --k: var(--k-annual);
}
.k-sick {
  --k: var(--k-sick);
}
.k-family {
  --k: var(--k-family);
}
.k-study,
.k-unpaid,
.k-other {
  --k: var(--k-other);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 560;
  color: var(--ink-2);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s var(--ease);
}
.chip:active {
  transform: scale(0.95);
}
.chip.active {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--k, var(--muted));
}
.search {
  max-width: 240px;
  height: 36px;
  font-size: 14px;
}
.year-group {
  margin-bottom: 22px;
}
.year-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 4px 8px;
}
.year-head h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.year-sum {
  font-size: 13px;
  color: var(--muted);
}
.card.list {
  padding: 6px;
}
.empty {
  text-align: center;
  padding: 44px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty p {
  max-width: 420px;
  margin: 0 0 8px;
  color: var(--ink-2);
}
.empty-art {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 4px;
}
.empty-art .icon {
  width: 30px;
  height: 30px;
}

/* ───────────────────────── Sheet ───────────────────────── */
.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 8, 0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade 0.25s var(--ease) both;
}
.sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
  animation: sheet-in 0.42s var(--spring) both;
  outline: none;
}
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.965);
  }
}
.sheet-root.closing .sheet {
  animation: sheet-out 0.22s var(--ease) forwards;
}
.sheet-root.closing .sheet-backdrop {
  animation: fade-out 0.22s var(--ease) forwards;
}
@keyframes sheet-out {
  to {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}
@keyframes fade-out {
  to {
    opacity: 0;
  }
}
.sheet-grip {
  display: none;
}
.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 8px 22px;
  background: var(--surface);
}
.sheet-head h2 {
  font-size: 20px;
  font-weight: 680;
}
.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 22px 22px;
}
.kind-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.kind-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 560;
  font-size: 14px;
  color: var(--ink-2);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s var(--ease);
}
.kind-chip:active {
  transform: scale(0.96);
}
.kind-chip.active {
  color: var(--ink);
  background: color-mix(in oklab, var(--k) 14%, var(--surface));
  box-shadow: inset 0 0 0 1.5px var(--k);
}
.date-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.date-arrow {
  color: var(--muted);
  padding-bottom: 11px;
}
.preview {
  padding: 16px;
  border-radius: 16px;
  background: color-mix(in oklab, var(--accent) 9%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 20%, transparent);
  transition: background 0.3s, box-shadow 0.3s;
}
.preview.muted {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.preview-empty {
  color: var(--muted);
  font-size: 14px;
}
.preview-main {
  display: flex;
  align-items: center;
  gap: 16px;
}
.preview-num {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.preview-num .big {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.preview-num .unit {
  font-weight: 560;
  color: var(--ink-2);
}
.preview-meta {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--ink-2);
}
.preview-meta .after {
  font-weight: 620;
  color: var(--accent-ink);
}
.preview-meta .after.neg {
  color: var(--critical);
}
.preview-notes {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-2);
}
.preview-notes:empty {
  display: none;
}
.preview-notes li {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: rise 0.35s var(--ease) both;
}
.preview-notes .hol::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--critical);
  margin: 0 2px;
}
.preview-notes .warn {
  color: var(--critical);
  font-weight: 560;
}
.preview-notes .icon {
  width: 15px;
  height: 15px;
}
.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: opacity 0.2s;
}
.opt-row.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.opt-title {
  font-weight: 580;
  font-size: 14.5px;
}
.opt-sub {
  font-size: 13px;
  color: var(--muted);
}
.form-error {
  margin: 0;
  color: var(--critical);
  font-size: 13.5px;
  font-weight: 560;
}
.sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.spacer {
  flex: 1;
}

/* Switch */
.switch {
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 99px;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.25s var(--ease);
  flex: none;
}
.switch .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s var(--spring);
}
.switch.on {
  background: var(--accent);
}
.switch.on .knob {
  transform: translateX(18px);
}

/* ───────────────────────── Toast ───────────────────────── */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px 11px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 540;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.45s var(--spring) both;
  white-space: nowrap;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
}
.toast-action {
  padding: 5px 11px;
  border-radius: 9px;
  font-weight: 650;
  color: var(--accent-ink);
  background: color-mix(in oklab, var(--bg) 12%, transparent);
}
:root:not([data-theme="dark"]) .toast-action {
  color: #86b6ef;
}

/* ───────────────────────── Calendar ───────────────────────── */
.year-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.year-label {
  min-width: 56px;
  text-align: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ink-2);
}
.lg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.lg .sw {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--k);
}
.lg.hol .sw {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--critical);
}
.lg-sum {
  margin-left: auto;
  color: var(--muted);
}
.months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  user-select: none;
  -webkit-user-select: none;
}
.month {
  padding: 14px 14px 12px;
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}
.month h4 {
  font-size: 14px;
  font-weight: 650;
  margin: 0 0 8px 4px;
}
.dow,
.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.dow span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 3px;
}
.day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 520;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s var(--ease), color 0.15s;
}
.day:not(.blank):hover {
  background: var(--surface-2);
  transform: scale(1.08);
}
.day.blank {
  cursor: default;
}
.day.off {
  color: var(--muted);
}
.day.hol {
  color: var(--critical);
  font-weight: 650;
  box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--critical) 55%, transparent);
}
.day.leave {
  background: var(--k);
  color: #fff;
  font-weight: 620;
  box-shadow: none;
}
.day.leave:hover {
  background: color-mix(in oklab, var(--k) 85%, #000);
}
.day.leave-off {
  background: color-mix(in oklab, var(--k) 18%, transparent);
}
.day.today {
  box-shadow: inset 0 0 0 2px var(--ink);
}
.day.sel {
  background: color-mix(in oklab, var(--accent) 30%, transparent);
  color: var(--ink);
  transform: scale(0.94);
}

/* ───────────────────────── Statement ───────────────────────── */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 540;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.toggle-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.statement-grid {
  margin-top: 0;
}
.cycle {
  padding: 0;
  overflow: hidden;
}
.cycle-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  flex-wrap: wrap;
  transition: background 0.2s;
}
.cycle-head:hover {
  background: var(--surface-2);
}
.cycle-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 1 1 220px;
}
.cycle-figs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.cycle-figs span {
  display: flex;
  flex-direction: column;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.cycle-figs small {
  font-size: 11px;
  font-weight: 560;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cycle-figs .closing {
  color: var(--accent-ink);
}
.cycle-figs .lost {
  color: var(--critical);
}
.chev {
  color: var(--muted);
  transition: transform 0.35s var(--spring);
}
.cycle.expanded .chev {
  transform: rotate(180deg);
}
.collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s var(--ease);
}
.cycle.expanded .collapse {
  grid-template-rows: 1fr;
}
.collapse-inner {
  overflow: hidden;
}
.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ledger th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 10px 12px 8px;
  white-space: nowrap;
}
.ledger td {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}
.ledger .num {
  text-align: right;
}
.ledger .strong {
  font-weight: 650;
}
.ledger .pos {
  color: var(--good-ink);
}
.ledger tr.now td {
  background: var(--accent-soft);
}
.ledger tr.future td {
  color: var(--muted);
  font-style: italic;
}
.form-row {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}
.compare {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cmp {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--surface-2);
}
.cmp small {
  font-size: 12.5px;
  color: var(--ink-2);
}
.cmp strong {
  font-size: 28px;
  font-weight: 680;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.cmp-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  animation: rise 0.35s var(--ease) both;
}
.cmp-result.ok {
  color: var(--good-ink);
  background: color-mix(in oklab, var(--good) 13%, transparent);
}
.cmp-result.off {
  color: var(--critical);
  background: color-mix(in oklab, var(--critical) 11%, transparent);
}
.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 0;
}
.adj-list {
  margin-top: 12px;
}

/* ───────────────────────── Settings ───────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.settings-grid .card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-grid .card-head {
  margin-bottom: 0;
}
.settings-grid .card-sub,
.settings-grid .hint {
  margin: 0;
}
.settings-grid .form-row {
  margin: 0;
}
.setting {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.setting .segmented {
  align-self: flex-start;
  max-width: 100%;
}
.ladder {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.rung {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: 11px;
  background: var(--surface-2);
  transition: background 0.3s, color 0.3s;
}
.rung small {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.rung strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.rung.now {
  background: var(--accent);
  color: #fff;
}
.rung.now small {
  color: rgba(255, 255, 255, 0.8);
}
.weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.danger-zone {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.keys {
  margin: 0;
  display: grid;
  gap: 8px;
}
.keys div {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--ink-2);
}
.keys dt {
  display: flex;
  gap: 4px;
  align-items: center;
}
.keys dd {
  margin: 0;
}
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  font: 600 12px var(--font);
  background: var(--surface-2);
  box-shadow: inset 0 -1.5px 0 var(--line-strong), inset 0 0 0 1px var(--line);
  color: var(--ink);
}

/* ───────────────────────── Onboarding ───────────────────────── */
.onboard {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(60% 50% at 20% 10%, color-mix(in oklab, var(--accent) 16%, transparent), transparent),
    radial-gradient(50% 50% at 90% 90%, rgba(98, 80, 214, 0.14), transparent),
    var(--bg);
}
.onboard-card {
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
  animation: sheet-in 0.7s var(--spring) both;
}
.onboard-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
  box-shadow: 0 10px 24px -8px color-mix(in oklab, var(--accent) 70%, transparent);
}
.onboard-mark .icon {
  width: 28px;
  height: 28px;
}
.onboard h1 {
  font-size: 30px;
  font-weight: 720;
  letter-spacing: -0.035em;
}
.lede {
  margin: -8px 0 4px;
  color: var(--ink-2);
}
.opt-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-weight: 580;
  font-size: 14px;
  color: var(--accent-ink);
}
.opt-details summary::-webkit-details-marker {
  display: none;
}
.opt-details summary .icon {
  transition: transform 0.3s var(--spring);
}
.opt-details[open] summary .icon {
  transform: rotate(180deg);
}
.opt-details[open] > :not(summary) {
  animation: rise 0.4s var(--ease) both;
}
.fineprint {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.crash {
  position: fixed;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 18px;
  border-radius: 14px;
  background: var(--critical);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
}
.crash button {
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 650;
}

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .grid-2,
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .tab span {
    display: none;
  }
  .tab {
    padding: 8px 14px;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 0 16px calc(96px + env(safe-area-inset-bottom));
  }
  .topbar {
    padding: 10px 0;
    padding-top: max(10px, env(safe-area-inset-top));
    /* backdrop-filter would trap the fixed bottom nav inside the header */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg);
  }
  .add-btn {
    display: none;
  }
  .tabs {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 30;
    padding: 5px;
    border-radius: 20px;
    background: color-mix(in oklab, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
  }
  .tab-pill {
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc((100% - 10px) / var(--n));
    border-radius: 15px;
    background: var(--accent-soft);
    box-shadow: none;
  }
  .tab {
    flex-direction: column;
    gap: 2px;
    padding: 7px 0 6px;
    font-size: 10.5px;
  }
  .tab span {
    display: block;
  }
  .tab .icon {
    width: 21px;
    height: 21px;
  }
  .tab.active {
    color: var(--accent-ink);
  }
  .fab {
    position: fixed;
    right: 18px;
    bottom: calc(90px + env(safe-area-inset-bottom));
    z-index: 29;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 12px 28px -8px color-mix(in oklab, var(--accent) 80%, transparent);
    transition: transform 0.2s var(--spring);
    animation: sheet-in 0.5s var(--spring) 0.2s both;
  }
  .fab:active {
    transform: scale(0.92);
  }
  .fab .icon {
    width: 26px;
    height: 26px;
  }
  .hero {
    padding: 22px 18px;
    gap: 18px;
    border-radius: 22px;
  }
  .stat {
    padding: 11px 12px;
  }
  .stat-value {
    font-size: 20px;
  }
  .page-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .page-head h1 {
    font-size: 24px;
  }
  .search {
    max-width: none;
  }
  .card {
    padding: 16px;
  }
  .card-head {
    flex-wrap: wrap;
  }
  .form-row {
    flex-direction: column;
  }
  .settings-grid .form-row {
    flex-direction: column;
  }
  .ladder {
    grid-template-columns: repeat(3, 1fr);
  }
  .toast-host {
    bottom: calc(160px + env(safe-area-inset-bottom));
    width: calc(100% - 32px);
    display: flex;
    justify-content: center;
  }
  .lg-sum {
    margin-left: 0;
    width: 100%;
  }

  /* Bottom sheet on phones */
  .sheet-root {
    place-items: end stretch;
    padding: 0;
  }
  .sheet {
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-up 0.45s var(--spring) both;
  }
  .sheet-root.closing .sheet {
    animation: sheet-down 0.24s var(--ease) forwards;
  }
  .sheet-grip {
    display: block;
    width: 38px;
    height: 5px;
    border-radius: 9px;
    margin: 8px auto -6px;
    background: var(--surface-3);
  }
  .sheet-body {
    padding: 6px 18px 20px;
  }
  .sheet-head {
    padding: 14px 14px 6px 18px;
  }
  .kind-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .sheet-actions .btn.primary {
    flex: 1;
  }
  .onboard-card {
    padding: 24px 20px;
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}
@keyframes sheet-down {
  to {
    transform: translateY(100%);
  }
}

@media (max-width: 420px) {
  .hero-stats {
    gap: 8px;
  }
  .kind-chip {
    padding: 0 9px;
    font-size: 13px;
  }
  .date-row {
    flex-direction: column;
    align-items: stretch;
  }
  .date-arrow {
    display: none;
  }
}

@media (hover: none) {
  .day:not(.blank):hover {
    transform: none;
    background: inherit;
  }
  .day.leave:hover {
    background: var(--k);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .line.past {
    stroke-dashoffset: 0;
  }
}

@media (forced-colors: active) {
  .day.leave {
    forced-color-adjust: none;
    outline: 2px solid CanvasText;
  }
}
