/* Huddle design system v2: light blue, built in OKLCH so equal lightness looks equal. */
:root {
  --ink: oklch(0.27 0.05 262);
  --ink-2: oklch(0.44 0.035 262);
  --ink-3: oklch(0.54 0.03 262);
  --blue: oklch(0.53 0.13 248);
  --blue-press: oklch(0.47 0.13 248);
  --blue-ink: oklch(0.42 0.12 250);
  --blue-2: oklch(0.92 0.045 238);
  --blue-3: oklch(0.965 0.02 238);
  --bg: oklch(0.99 0.005 238);
  --paper: oklch(1 0 0);
  --stage: oklch(0.93 0.035 238);
  --line: oklch(0.3 0.05 260 / 0.11);
  --line-2: oklch(0.3 0.05 260 / 0.2);
  --fill: oklch(0.3 0.05 260 / 0.055);
  --warn: oklch(0.55 0.15 38);
  --warn-tint: oklch(0.955 0.03 45);
  --ok: oklch(0.5 0.11 155);
  --ok-tint: oklch(0.955 0.035 155);
  --lav-tint: oklch(0.955 0.03 300);
  --hatch: repeating-linear-gradient(135deg, oklch(0.3 0.05 260 / 0.09) 0 5px, oklch(0.3 0.05 260 / 0.035) 5px 10px);
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; }

.stage { min-height: 100dvh; }
.panel { display: none; }
.device { height: 100dvh; }

.app {
  position: relative;
  height: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.statusbar { display: none; }

main {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 20px 32px;
  padding-top: max(18px, env(safe-area-inset-top));
}

/* Desktop: phone frame + side panel */
@media (min-width: 900px) {
  body { background: var(--stage); }
  .stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 72px;
    padding: 32px;
  }
  .panel { display: block; width: 360px; max-height: calc(100dvh - 64px); overflow-y: auto; padding: 4px 8px 4px 4px; margin: -4px -8px -4px -4px; }
  .device {
    width: 400px;
    height: min(860px, calc(100dvh - 64px));
    padding: 11px;
    border-radius: 54px;
    background: oklch(0.22 0.04 262);
    box-shadow: 0 40px 80px -40px oklch(0.27 0.05 262 / 0.6), inset 0 0 0 2px oklch(0.36 0.04 262);
    flex-shrink: 0;
  }
  /* nested corners: 54 outer - 11 padding */
  .app { border-radius: 43px; max-width: none; }
  .statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    padding: 0 34px 0 38px;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
    font-variant-numeric: tabular-nums;
  }
  .statusbar .island {
    position: absolute;
    left: 50%;
    top: 11px;
    width: 120px;
    height: 34px;
    border-radius: 20px;
    background: oklch(0.22 0.04 262);
    transform: translateX(-50%);
  }
  .statusbar .sig { display: flex; gap: 5px; align-items: center; }
  main { padding-top: 8px; }
}

/* Panel */
.panel .brand { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.panel h1 { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.panel .by { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.panel .lede { font-size: 16px; line-height: 1.55; margin: 0 0 20px; }
.panel h2 { font-size: 15px; font-weight: 600; margin: 22px 0 10px; }
.panel .note { font-size: 13px; color: var(--ink-2); margin-top: 22px; line-height: 1.55; }
.panel .row { margin-top: 12px; }
.panel .qr { display: flex; gap: 16px; align-items: center; padding: 12px; border-radius: var(--r-lg); background: oklch(1 0 0 / 0.6); }
/* nested corners: 22 outer - 12 padding */
.panel .qr img { width: 108px; height: 108px; background: var(--paper); border-radius: 10px; display: block; }
.panel .qr p { font-size: 14px; }
.panel .qr b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.panel .qr p { font-size: 13px; color: var(--ink-2); }
.panel .qr a { font-weight: 600; color: var(--blue-ink); }
.phase-list { display: grid; gap: 8px; }
.phase-btn {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 2px 12px;
  text-align: left;
  padding: 10px 14px;
  border: 0;
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  border-radius: var(--r-md);
  background: oklch(1 0 0 / 0.6);
}
.phase-btn:hover { background: var(--paper); }
.phase-btn.on { background: var(--ink); color: #fff; box-shadow: none; }
.phase-btn b { font-weight: 600; grid-row: span 2; font-size: 14px; padding-top: 1px; }
.phase-btn span { font-weight: 600; font-size: 15px; }
.phase-btn small { font-size: 13px; opacity: 0.82; }

/* Top of each tab */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.top .date { font-size: 14px; color: var(--ink-2); }
.top h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; margin-top: 2px; }
@media (min-width: 900px) { .demo-btn { display: none !important; } }
.top.big { margin-bottom: 20px; }
.top.big h1 { font-size: 40px; letter-spacing: -0.025em; line-height: 1.05; margin-top: 4px; }

/* Today's welcome mat: a soft wash of blue that fades into the page */
.welcome {
  margin: calc(-1 * max(18px, env(safe-area-inset-top))) -20px 0;
  padding: max(18px, env(safe-area-inset-top)) 20px 28px;
  background: linear-gradient(180deg in oklch, var(--blue-2), oklch(0.955 0.028 238) 55%, var(--bg));
}
.welcome .pipline { margin-bottom: 0; }
.welcome .bubble { background: var(--paper); box-shadow: 0 1px 2px oklch(0.3 0.05 260 / 0.06); }
@media (min-width: 900px) {
  .welcome { margin-top: -8px; padding-top: 8px; }
  .app[data-tab="today"] .statusbar { background: var(--blue-2); }
}
.sub { color: var(--ink-2); font-size: 14px; }

/* Buttons: filled pill for the main action, hollow pill for the rest */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  min-height: 44px;
  font-weight: 600;
  font-size: 15px;
  background: var(--blue);
  color: #fff;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--blue-press); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.ghost:hover { background: var(--fill); }
.btn.sm { min-height: 36px; padding: 0 15px; font-size: 14px; }
.btn.full { width: 100%; }
.btn .ic { width: 18px; height: 18px; stroke-width: 2; }
.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--blue-ink);
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--blue-3); }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm .ic { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Choice chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 0;
  box-shadow: inset 0 0 0 1.5px var(--blue);
  color: var(--blue-ink);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
  text-align: left;
}
.chip:hover { background: var(--blue-3); }
.chip.on { background: var(--blue); color: #fff; font-weight: 600; }

/* Info pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.pill .ic { width: 15px; height: 15px; stroke-width: 2; margin-left: -2px; }
.pill.tint { background: var(--blue-2); color: var(--blue-ink); }
.pill.warn { background: var(--warn-tint); color: var(--warn); }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex-shrink: 0; box-shadow: inset 0 0 0 1px oklch(0.3 0.05 260 / 0.15); }

/* Pip speaking */
.pipline { display: flex; gap: 10px; align-items: flex-end; margin: 0 0 22px; }
.pipline .pip { flex-shrink: 0; }
.bubble { background: var(--blue-3); border-radius: 20px 20px 20px 6px; padding: 10px 14px; font-size: 15px; }

/* Energy check-in */
.checkin { margin: 0 0 22px; }
.checkin h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.checkin .chips { display: grid; grid-template-columns: 1fr 1fr; }
.checkin .chip, .scale .chip { text-align: center; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.scale .chip { padding: 8px 0; }

/* The next step: the biggest thing on Today */
.hero { background: var(--blue-2); border-radius: var(--r-lg); padding: 20px; margin: 0 0 22px; }
.hero .label { font-size: 13px; font-weight: 600; color: var(--blue-ink); }
.hero h2 { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; margin: 4px 0 6px; }
.for { font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.hero .pill { background: oklch(1 0 0 / 0.72); }
.hero .pill.warn { background: oklch(1 0 0 / 0.72); }
.hero .row { margin-top: 18px; }
.hero .row .btn:first-child { flex: 1; }
.progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.segs { display: flex; gap: 4px; flex: 1; max-width: 170px; }
.segs i { flex: 1; height: 6px; border-radius: 3px; background: oklch(1 0 0 / 0.85); }
.segs i.done { background: var(--blue); }
.segs i.now { background: oklch(0.53 0.13 248 / 0.38); }

/* Pip noticed */
.nudge { border-radius: var(--r-lg); padding: 16px; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--paper); margin: 0 0 26px; }
.nudge-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.nudge-head .pip { flex-shrink: 0; }
.nudge-head p { font-size: 15px; }
.nudge-head b { font-weight: 600; }
.nudge .found-time { font-size: 14px; color: var(--ink-2); margin-top: 12px; }
.nudge .found-time b { color: var(--ink); font-weight: 600; }
.nudge .row { margin-top: 14px; }

.risk { background: var(--warn-tint); border-radius: var(--r-md); padding: 14px 16px; margin: 0 0 22px; font-size: 14px; }
.risk .btn { margin-top: 10px; }

/* Section heads */
.sec { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 10px; }
.sec h2 { font-size: 19px; font-weight: 700; }
.sec .sub { font-size: 13px; }

/* Today list */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: start; padding: 5px 0; }
.timeline .t { font-size: 13px; color: var(--ink-3); padding-top: 9px; font-variant-numeric: tabular-nums; }
.timeline .what { font-size: 14px; min-width: 0; padding: 8px 0; }
.timeline .what b { font-weight: 600; display: block; }
.timeline .what small { display: block; color: var(--ink-2); font-size: 13px; }
.timeline .ev-class .what b, .timeline .ev-club .what b, .timeline .ev-work .what b { font-weight: 500; color: var(--ink-2); }
.timeline .ev-exam .what b { color: var(--warn); }
.timeline .ev-study .what { background: var(--blue-3); padding: 9px 12px; border-radius: var(--r-sm); }
.timeline .ev-study.is-next .what { background: var(--blue-2); }
.timeline .ev-resource .what { background: var(--ok-tint); padding: 9px 12px; border-radius: var(--r-sm); }
.timeline .ev-social .what { background: var(--lav-tint); padding: 9px 12px; border-radius: var(--r-sm); }
.timeline .ev-busy .what { background: var(--hatch); padding: 9px 12px; border-radius: var(--r-sm); }
.timeline .stop .t, .timeline .stop .what { color: var(--blue-ink); font-weight: 600; }
.timeline .done .t { display: flex; align-items: center; color: var(--ok); }
.timeline .done .t .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.timeline .done .what b { text-decoration: line-through; color: var(--ink-3); font-weight: 500; }
.flag { font-size: 12px; font-weight: 600; color: var(--warn); margin-left: 4px; }

/* Weeks tab */
.forecast { list-style: none; padding: 0; margin: 14px -12px 18px; display: grid; gap: 2px; }
.wk {
  width: 100%;
  border: 0;
  background: none;
  display: grid;
  grid-template-columns: 80px 1fr 56px;
  gap: 4px 12px;
  align-items: center;
  text-align: left;
  padding: 11px 12px;
  border-radius: var(--r-md);
}
.wk:hover { background: var(--fill); }
.wk.sel { background: var(--blue-3); box-shadow: inset 0 0 0 1.5px var(--blue-2); }
.wk .when { font-size: 14px; font-weight: 600; }
.wk .bar { height: 10px; background: var(--fill); border-radius: 5px; overflow: hidden; }
.wk .bar i { display: block; height: 100%; border-radius: 5px; }
.wk .bar i.light { background: oklch(0.8 0.07 238); }
.wk .bar i.steady { background: var(--blue); }
.wk .bar i.heavy { background: linear-gradient(90deg in oklch, oklch(0.8 0.12 75), var(--warn)); }
.wk .lvl { font-size: 13px; font-weight: 600; text-align: right; color: var(--ink-2); }
.wk .lvl.heavy { color: var(--warn); }
.wk .why { grid-column: 2 / 4; font-size: 13px; color: var(--ink-2); }

.pipnote { display: flex; gap: 10px; align-items: flex-end; margin: 0 0 18px; }
.pipnote .pip { flex-shrink: 0; }
.pipnote .bubble { font-size: 14px; }

.due-list { list-style: none; padding: 0; margin: 0 0 18px; }
.due-list li { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.due-list .d { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.due-list .n { display: flex; align-items: center; gap: 8px; min-width: 0; }
.due-list li.done .n { color: var(--ink-3); text-decoration: line-through; }
.empty { color: var(--ink-3); font-size: 14px; padding: 6px 0 14px; }

/* Help tab */
.res { background: var(--paper); border-radius: var(--r-lg); padding: 18px; box-shadow: inset 0 0 0 1.5px var(--line); margin-bottom: 12px; }
.res h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.res .tag { font-size: 14px; color: var(--ink-2); margin: 4px 0 12px; }
.res-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.res-actions .icons { display: flex; gap: 8px; margin-left: auto; }
.added { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ok); }
.added .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.help-sec { margin-top: 28px; }
.crisis { margin-top: 26px; padding: 18px; border-radius: var(--r-lg); background: var(--blue-3); }
.crisis h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.crisis p { font-size: 14px; }
.crisis .row { margin-top: 14px; }
.crisis .fine { font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.privacy { margin-top: 16px; font-size: 13px; color: var(--ink-2); }

/* Chat */
.chat { display: flex; flex-direction: column; min-height: 100%; }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.chat-head h1 { font-size: 20px; font-weight: 700; line-height: 1.2; }
.chat-head p { font-size: 13px; color: var(--ink-2); }
.msgs { display: flex; flex-direction: column; gap: 8px; padding: 16px 0 6px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 20px; font-size: 15px; }
.msg.pip { background: var(--blue-3); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.me { background: var(--blue); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.msg-card { align-self: stretch; margin: 2px 0 4px; }
.msg-card .hero, .msg-card .res { margin: 0; }
.msg-card .hero h2 { font-size: 20px; }
.msgs .chips { padding: 4px 0 6px; }
.typing { align-self: flex-start; background: var(--blue-3); border-radius: 20px 20px 20px 6px; padding: 14px 16px; display: flex; gap: 5px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: bob 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
.compose { display: flex; gap: 8px; align-items: center; padding: 10px 16px 6px; border-top: 1px solid var(--line); background: var(--bg); }
.compose input {
  flex: 1;
  font: inherit;
  font-size: 16px;
  border: 0;
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  border-radius: 999px;
  padding: 0 18px;
  min-height: 44px;
  background: var(--paper);
  color: var(--ink);
}
.compose input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.compose .send { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.compose .send .ic { stroke-width: 2.2; }

.diff { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.diff h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.diff ul { margin: 0; padding: 0; list-style: none; }
.diff li { font-size: 13px; padding: 7px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.diff li:first-child { border-top: 0; }
.diff .to { font-weight: 600; white-space: nowrap; color: var(--blue-ink); font-variant-numeric: tabular-nums; }
.diff .from { color: var(--ink-3); text-decoration: line-through; font-size: 12px; display: block; font-variant-numeric: tabular-nums; }
.diff .sub { margin-top: 8px; font-size: 13px; }

.spark { display: block; margin: 8px 0 4px; }

/* Calendar */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.cal-bar .seg { flex: 0 1 190px; }
.cal-bar .nav { display: flex; gap: 6px; }
.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin: 0 -4px 18px; }
.daystrip button { border: 0; background: none; border-radius: var(--r-md); padding: 4px 0 6px; display: grid; justify-items: center; gap: 3px; }
.daystrip span { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.daystrip b { font-size: 16px; font-weight: 600; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; font-variant-numeric: tabular-nums; }
.daystrip .today b { color: var(--blue-ink); box-shadow: inset 0 0 0 1.5px var(--blue); }
.daystrip .on b { background: var(--blue); color: #fff; box-shadow: none; }
.daystrip .load { width: 22px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--blue) calc(var(--l) * 100%), var(--line) 0); }
.daystrip .load.exam { background: linear-gradient(90deg, var(--warn) calc(var(--l) * 100%), oklch(0.55 0.15 38 / 0.25) 0); }
.cal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 2px; }
.cal-head h2 { font-size: 19px; font-weight: 700; }
.cal-head .sub { font-size: 13px; font-variant-numeric: tabular-nums; }
.cal-hint { font-size: 13px; color: var(--ink-2); margin: 0 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); margin: 0 0 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
.legend .study { background: var(--blue-2); box-shadow: inset 0 0 0 1.5px var(--blue); }
.legend .class { background: oklch(0.3 0.05 260 / 0.1); }
.legend .work { background: var(--hatch); box-shadow: inset 0 0 0 1px var(--line); }
.legend .exam { background: var(--warn-tint); box-shadow: inset 0 0 0 1.5px var(--warn); }

.cal-grid { --gutter: 46px; display: grid; grid-template-columns: var(--gutter) 1fr; padding-top: 8px; }
.cal-grid.compact { --gutter: 34px; }
.cal-gutter { position: relative; }
.cal-gutter span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.compact .cal-gutter span { font-size: 9.5px; right: 5px; }
.cal-cols {
  position: relative;
  display: grid;
  background-image: linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% var(--px);
  border-bottom: 1px solid var(--line);
}
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-col.past { background: oklch(0.3 0.05 260 / 0.03); }
.cal-col.past .cal-block { opacity: 0.55; }
.cal-col.off { background: oklch(0.53 0.13 248 / 0.035); }
.off-label { position: absolute; left: 0; right: 0; top: 8px; text-align: center; font-size: 12px; font-weight: 600; color: var(--blue-ink); pointer-events: none; }
.slot { position: absolute; left: 0; right: 0; border: 0; background: transparent; padding: 0; z-index: 0; }
.slot:hover { background: oklch(0.53 0.13 248 / 0.07); }
.after-stop {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(135deg, oklch(0.53 0.13 248 / 0.07) 0 6px, transparent 6px 12px);
  border-top: 1.5px dashed oklch(0.53 0.13 248 / 0.7);
  pointer-events: none;
  z-index: 0;
}
.after-stop span { position: absolute; right: 6px; top: 6px; font-size: 11px; font-weight: 600; color: var(--blue-ink); background: var(--bg); padding: 1px 8px; border-radius: 999px; }
.now-line { position: absolute; left: -4px; right: 0; height: 2px; background: var(--warn); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

.cal-block {
  position: absolute;
  z-index: 1;
  border: 0;
  text-align: left;
  border-radius: 8px;
  padding: 4px 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.25;
  color: var(--ink-2);
  background: oklch(0.3 0.05 260 / 0.08);
}
.cal-block b { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12.5px; min-width: 0; }
.cal-block b em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block > span { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; opacity: 0.9; }
.cal-block.short { flex-direction: row; align-items: center; gap: 6px; padding-block: 0; }
.cal-block.short > span { flex-shrink: 0; }
.cal-block.study { background: var(--blue-2); color: var(--blue-ink); }
.cal-block.study.next { background: var(--blue); color: #fff; }
.cal-block.study.next .swatch { box-shadow: 0 0 0 1.5px oklch(1 0 0 / 0.8); }
.cal-block.work, .cal-block.busy { background: var(--hatch); box-shadow: inset 0 0 0 1px var(--line); }
.cal-block.busy { color: var(--blue-ink); }
.cal-block.exam { background: var(--warn-tint); color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn); }
.cal-block.club, .cal-block.social { background: var(--lav-tint); }
.cal-block.resource { background: var(--ok-tint); color: oklch(0.4 0.1 155); }
.cal-block.moved { animation: moved 1s ease 2; }
.compact .cal-block { padding: 2px 3px; border-radius: 5px; }
.compact .cal-block b { font-size: 9.5px; gap: 3px; }
.compact .cal-block .swatch { width: 6px; height: 6px; border-radius: 2px; }
.week-head { display: grid; grid-template-columns: 34px repeat(7, 1fr); margin-bottom: 4px; }
.week-head button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 4px 0; border-radius: var(--r-sm); }
.week-head button:hover { background: var(--fill); }
.week-head span { font-size: 11px; color: var(--ink-3); }
.week-head b { font-size: 15px; font-weight: 600; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; font-variant-numeric: tabular-nums; }
.week-head .today b { background: var(--blue); color: #fff; }

/* Tab bar */
.tabbar {
  display: flex;
  border-top: 1px solid var(--line);
  background: oklch(1 0 0 / 0.94);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  flex-shrink: 0;
}
@media (min-width: 900px) { .tabbar { padding-bottom: 22px; } }
.tabbar button {
  flex: 1;
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  min-height: 50px;
  --icon-face: #fff;
}
.tabbar button.on { color: var(--blue-ink); font-weight: 600; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar button.on .ic { stroke-width: 2.1; }

/* Overlays */
.scrim { position: absolute; inset: 0; background: oklch(0.22 0.04 262 / 0.4); z-index: 20; }
.scrim.enter { animation: fade 0.2s ease; }
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  background: var(--paper);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 88%;
  overflow-y: auto;
}
@media (min-width: 900px) { .sheet { padding-bottom: 30px; } }
.sheet.enter { animation: up 0.25s ease; }
.sheet .grab { width: 40px; height: 5px; background: var(--line-2); border-radius: 3px; margin: 0 auto 16px; }
.sheet h2 { font-size: 21px; font-weight: 700; margin-bottom: 6px; line-height: 1.25; }
.sheet .pills { margin-top: 10px; }
.sheet .note { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.sheet .acts { margin-top: 18px; }
.sheet .acts .btn:first-child { flex: 1; }
.sheet .opts { display: grid; gap: 8px; margin: 16px 0 4px; }
.sheet .opt {
  text-align: left;
  border: 0;
  box-shadow: inset 0 0 0 1.5px var(--line);
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 12px 16px;
  min-height: 52px;
}
.sheet .opt b { display: block; font-weight: 600; font-size: 15px; }
.sheet .opt small { color: var(--ink-2); font-size: 13px; }
.sheet .opt:hover { box-shadow: inset 0 0 0 1.5px var(--blue); background: var(--blue-3); }
.sheet .pipline { margin: 0 0 14px; }
.loading { display: flex; align-items: center; gap: 12px; padding: 10px 0 18px; color: var(--ink-2); font-size: 15px; }
.loading i { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--blue-2); border-top-color: var(--blue); animation: spin 0.7s linear infinite; }

.notice {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 30;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  background: oklch(1 0 0 / 0.97);
  border-radius: 22px;
  padding: 11px 12px;
  box-shadow: 0 12px 30px -10px oklch(0.22 0.04 262 / 0.45), 0 0 0 1px var(--line);
  text-align: left;
  border: 0;
}
.notice.enter { animation: drop 0.35s cubic-bezier(.2, .9, .3, 1.2); }
@media (min-width: 900px) { .notice { top: 54px; } }
/* nested corners: 22 outer - 11 padding */
.notice .appicon { width: 38px; height: 38px; border-radius: 11px; background: var(--blue-2); display: grid; place-items: center; overflow: hidden; }
.notice .head { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.notice .head b { color: var(--ink); font-weight: 600; }
.notice p { font-size: 14px; line-height: 1.35; }

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 80px;
  z-index: 25;
  background: var(--ink);
  color: #fff;
  border-radius: 20px;
  padding: 10px 16px 10px 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}
.toast.enter { animation: up 0.25s ease; }
@media (min-width: 900px) { .toast { bottom: 98px; } }

/* Focus */
.focus {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: linear-gradient(180deg in oklch, var(--blue-2), var(--bg) 75%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 28px;
}
.focus.enter { animation: fade 0.25s ease; }
.focus .ring { position: relative; width: 236px; height: 236px; margin: 18px 0 20px; }
.focus .ring svg.track { position: absolute; inset: 0; transform: rotate(-90deg); }
.focus .ring .inner { position: absolute; inset: 0; display: grid; place-items: center; }
.focus .clock { font-size: 48px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.focus h2 { font-size: 22px; font-weight: 700; margin-top: 6px; }
.focus .for { justify-content: center; margin: 4px 0 0; }
.focus .row { justify-content: center; }
.focus .hint { font-size: 13px; color: var(--ink-2); margin-top: 18px; max-width: 280px; }

/* Onboarding */
.onboard {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 26px 24px calc(22px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { .onboard { padding-top: 64px; padding-bottom: 30px; } }
.onboard .steps { display: flex; gap: 6px; margin-bottom: 26px; }
.onboard .steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line-2); }
.onboard .steps i.on { background: var(--blue); }
.onboard .body { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.onboard h1 { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; margin: 14px 0 10px; }
.onboard p.lead { font-size: 16px; color: var(--ink-2); }
.onboard .hero-art { display: grid; place-items: center; padding: 18px 0 4px; }
.onboard .art-bg { width: 190px; height: 190px; border-radius: 50%; background: var(--blue-2); display: grid; place-items: center; }
.onboard .foot { display: flex; gap: 8px; padding-top: 14px; }
.onboard .foot .btn:last-child { flex: 1; }
.onboard .fine { font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.onboard .promise { margin-top: 24px; padding: 16px; border-radius: var(--r-md); background: var(--blue-3); font-size: 14px; }
.connect { display: grid; gap: 10px; margin-top: 22px; }
.connect .src {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.connect .src b { font-weight: 600; }
.connect .src small { color: var(--ink-2); font-size: 13px; grid-column: 1; }
.connect .src .btn { grid-row: 1 / 3; grid-column: 2; }
.connect .src .ok { grid-row: 1 / 3; grid-column: 2; font-weight: 600; font-size: 14px; color: var(--ok); display: inline-flex; align-items: center; gap: 4px; }
.connect .src .ok .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.found { list-style: none; padding: 0; margin: 8px 0 0; grid-column: 1 / 3; }
.found li { font-size: 13px; display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.found.anim li { animation: fade 0.3s ease both; }
.field { margin-top: 22px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.field .hint { font-size: 13px; color: var(--ink-2); margin-top: 8px; }

/* Segmented control: pill track, pill thumb (radius stays fully round inside and out) */
.seg { display: flex; padding: 4px; gap: 4px; background: var(--fill); border-radius: 999px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 0 6px; font-size: 14px; font-weight: 500; min-height: 38px; border-radius: 999px; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px oklch(0.3 0.05 260 / 0.2); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drop { from { transform: translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { 0% { transform: scale(0.97); } 60% { transform: scale(1.015); } 100% { transform: scale(1); } }
@keyframes moved { 0%, 100% { box-shadow: 0 0 0 0 oklch(0.53 0.13 248 / 0); } 40% { box-shadow: 0 0 0 4px oklch(0.53 0.13 248 / 0.45); } }
@keyframes bob { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.pop { animation: pop 0.4s ease; }

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

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
