/* ---- tokens ------------------------------------------------------------------------------------ */

:root {
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-2: #f0f0f5;
  --surface-alt: #fafafc;
  --text: #1c1b22;
  --muted: #6b6a78;
  --border: #e3e2ea;
  --grid: #efeff4;
  --grid-hour: #e0dfe8;
  --accent: #5b4fe0;
  --accent-hover: #4c40d0;
  --accent-soft: #ecebfd;
  --accent-contrast: #ffffff;
  --danger: #d23f3f;
  --ok: #1f8a5b;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(20 20 40 / 0.04);
  --shadow-lg: 0 8px 24px rgb(20 20 40 / 0.10);
  --gutter: 56px;
  --slot: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111116;
    --surface: #1a1a21;
    --surface-2: #24242d;
    --surface-alt: #1e1e26;
    --text: #ececf1;
    --muted: #9b9aa9;
    --border: #2d2d38;
    --grid: #22222a;
    --grid-hour: #2e2e39;
    --accent: #8f85ff;
    --accent-hover: #a39bff;
    --accent-soft: #2a2752;
    --accent-contrast: #14131a;
    --danger: #ff6b6b;
    --ok: #4cc38a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 8px 24px rgb(0 0 0 / 0.45);
  }
}

/* ---- base -------------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
p { margin: 0; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.error { color: var(--danger); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- shell ------------------------------------------------------------------------------------- */

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.shell--fill { height: 100vh; min-height: 0; overflow: hidden; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.55rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 760;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

/* The matcha bowl (Meetcha = "meet you" + matcha); same drawing as the favicon. */
.brand-mark {
  width: 24px;
  height: 24px;
  background: url("/favicon.svg") center / contain no-repeat;
}

.brand--big { font-size: 1.7rem; }
.brand--big .brand-mark { transform: scale(1.35); margin-right: 0.3rem; }

.topnav { display: flex; gap: 0.2rem; flex-wrap: wrap; }

.topnav a, .account-link {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 560;
}

.topnav a:hover, .account-link:hover { background: var(--surface-2); color: var(--text); }
.topnav a.active { background: var(--accent-soft); color: var(--accent); }
.account-link.active { background: var(--surface-2); color: var(--text); }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }

.page { flex: 1; padding: 1.75rem 1.25rem 3rem; }
.shell--fill .page { display: flex; flex-direction: column; gap: 0.75rem; min-height: 0; padding: 1rem 1.25rem 1.25rem; }

.narrow { max-width: 760px; margin: 0 auto; width: 100%; }
.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.count {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0 0.5rem;
}

.badge {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  border-radius: 999px;
  padding: 0 0.5rem;
  line-height: 1.5;
}

/* ---- controls ---------------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.5rem 0.9rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--text); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn--small { padding: 0.3rem 0.65rem; font-size: 0.85rem; }

.btn--refresh svg { width: 15px; height: 15px; }
.btn--spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .btn--spinning svg { animation: none; } }

/* ---- loading & saving --------------------------------------------------------------------------
   Nothing looks empty while it loads, and nothing looks done while it's still being saved. */

.loading { display: flex; align-items: center; gap: 0.6rem; margin: 0; color: var(--muted); font-weight: 550; }
.loading::before, .btn[aria-busy="true"]::after, .week-head .week-loading::after {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.loading--page { min-height: 100vh; justify-content: center; }
.cal-host > .loading { margin: auto; }

/* A button whose action is in flight: a spinner after its label (the refresh button spins its own icon). */
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]:disabled { opacity: 0.8; }
.btn--refresh[aria-busy="true"]::after { content: none; }
/* Inputs and small controls being saved: dimmed and locked. */
input[aria-busy="true"], select[aria-busy="true"], fieldset[aria-busy="true"], .chip-x[aria-busy="true"] { opacity: 0.5; cursor: progress; }
/* Sections being reloaded: dimmed, and not clickable until fresh. */
.card[aria-busy="true"], .stack-lg[aria-busy="true"] { opacity: 0.6; pointer-events: none; transition: opacity 0.15s; }

@media (prefers-reduced-motion: reduce) {
  .month-day--loading::before, .week-days--loading .week-col::after, .week-stroke--pending { animation: none; }
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* A small panel that drops down from a toolbar button. */
.popover-wrap { position: relative; display: inline-flex; }
.popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
.popover-title { font-weight: 700; }
.range-row { display: flex; align-items: center; gap: 0.5rem; }
.range-row select { flex: 1; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 9px 0 0 9px; }
.btn-group .btn:last-child { border-radius: 0 9px 9px 0; }

input[type="text"], input[type="email"], select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.55rem 0.75rem;
  min-width: 0;
}

input[type="text"]:focus, input[type="email"]:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field > span { font-weight: 600; font-size: 0.9rem; }

.inline-form { display: flex; gap: 0.5rem; }
.inline-form input { flex: 1; }

.form-message { margin-top: 0.75rem; font-weight: 550; }
.form-message--ok { color: var(--ok); }
.form-message--error { color: var(--danger); }

.color-input {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 8px; }
.color-input::-moz-color-swatch { border: none; border-radius: 8px; }

.add-select {
  font-size: 0.82rem !important;
  padding: 0.15rem 0.5rem !important;
  border-radius: 999px !important;
  border-style: dashed !important;
  color: var(--muted) !important;
  cursor: pointer;
}

/* ---- lists & chips ----------------------------------------------------------------------------- */

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; }
.row-main { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; min-width: 0; }
.row-actions { display: flex; gap: 0.4rem; }
.subhead { font-size: 0.85rem; color: var(--muted); margin: 1rem 0 0.25rem; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }

.chip {
  --c: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 560;
  line-height: 1.5;
  color: var(--text);
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 40%, var(--surface));
}

.chip-x {
  border: 0;
  background: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
  margin-right: -0.2rem;
  opacity: 0.55;
  cursor: pointer;
}
.chip-x:hover { opacity: 1; }

.chip--pick { cursor: pointer; padding: 0.3rem 0.75rem; }
.chip--pick:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.chip--active {
  background: color-mix(in srgb, var(--c) 30%, var(--surface));
  border-color: var(--c);
  box-shadow: 0 0 0 2px var(--c);
  font-weight: 700;
}

.swatch { flex: none; width: 0.4rem; height: 0.9rem; border-radius: 2px; }

/* Find a time: names toggle their strips on and off. */
.chip--toggle { cursor: pointer; padding: 0.3rem 0.75rem; }
.chip--toggle:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.chip--off { background: transparent; border-style: dashed; color: var(--muted); text-decoration: line-through; }
.chip--off .swatch { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--c); }

/* ---- login ------------------------------------------------------------------------------------- */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 2rem 1rem;
  background: radial-gradient(60rem 30rem at 50% -10%, var(--accent-soft), transparent 70%);
}

.login-card { width: 100%; max-width: 410px; padding: 2rem; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 1.45rem; }
.login-card .btn--primary { padding: 0.65rem 1rem; }
.sent-icon { font-size: 2.6rem; line-height: 1; color: var(--accent); }

/* ---- menu -------------------------------------------------------------------------------------- */

.menu { max-width: 880px; margin: 1.5rem auto 0; display: flex; flex-direction: column; gap: 0.35rem; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }

.tile {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: start;
  column-gap: 1rem;
  row-gap: 0.2rem;
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.tile:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow-lg);
}

.tile-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tile-icon svg { width: 24px; height: 24px; }
.tile-title { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; }
.tile-text { color: var(--muted); font-size: 0.92rem; }

/* ---- settings ---------------------------------------------------------------------------------- */

.wide-select { width: 100%; }
.settings-email { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

.segmented { display: inline-flex; align-self: flex-start; margin: 0; padding: 0; min-width: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.segmented label { display: inline-flex; gap: 0.45rem; align-items: baseline; padding: 0.45rem 0.9rem; cursor: pointer; font-weight: 560; }
.segmented label + label { border-left: 1px solid var(--border); }
.segmented label:has(input:checked) { background: var(--accent-soft); color: var(--accent); font-weight: 680; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }

/* ---- groups ------------------------------------------------------------------------------------ */

.group-card { border-left: 5px solid var(--c); }
.group-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }

.title-input {
  flex: 1;
  font-size: 1.1rem !important;
  font-weight: 680;
  border-color: transparent !important;
  background: transparent !important;
  padding: 0.25rem 0.5rem !important;
  margin-left: -0.25rem;
}
.title-input:hover { border-color: var(--border) !important; }
.title-input:focus { border-color: var(--accent) !important; background: var(--surface) !important; }

/* ---- toasts ------------------------------------------------------------------------------------ */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  max-width: min(90vw, 520px);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 560;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}
.toast--error { background: var(--danger); color: #fff; }
.toast--leaving { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---- calendar pages ---------------------------------------------------------------------------- */

.cal-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cal-heading { display: flex; flex-direction: column; }
.cal-kicker { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cal-title { font-size: 1.5rem; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.cal-actions { display: flex; align-items: center; gap: 0.5rem; }

.cal-bar { display: flex; flex-direction: column; gap: 0.45rem; }
.palette { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
.palette-section { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.palette-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-right: 0.2rem; }
.hint { font-size: 0.85rem; color: var(--muted); }
.hint b { color: var(--text); font-weight: 650; }

.cal-host {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* month */

.month-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; }

.month-weekdays {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.month-weekdays div {
  padding: 0.45rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); height: 104px; }

.month-day {
  position: relative;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--grid-hour);
  border-bottom: 1px solid var(--grid-hour);
  overflow: hidden;
  cursor: pointer;
}
.month-day:last-child { border-right: 0; }
.month-day--alt { background: var(--surface-alt); }
.month-day::after { content: ""; position: absolute; inset: 0; background: var(--accent); opacity: 0; transition: opacity 0.1s; pointer-events: none; }
/* A day whose strips are still being fetched: grayed out, gently pulsing. */
.month-day--loading::before { content: ""; position: absolute; inset: 0; z-index: 1; background: color-mix(in srgb, var(--muted) 18%, transparent); animation: pulse 1.2s ease-in-out infinite; pointer-events: none; }
.month-day:hover::after { opacity: 0.07; }

.month-daynum {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 0.85rem;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  white-space: nowrap;
}
.month-day--first .month-daynum { font-weight: 800; color: var(--accent); }
.month-day--past .month-daynum { color: var(--muted); }
.month-day--past .month-strips { opacity: 0.5; }
.month-day--today .month-daynum { top: 5px; left: 5px; padding: 0 0.45rem; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); }

.month-strips { position: absolute; inset: 0 6px 0 48px; display: flex; justify-content: flex-end; gap: 3px; }
.month-strips i { flex: 0 1 7px; min-width: 2px; }

/* week */

.week-scroll { flex: 1; min-height: 0; overflow-y: auto; }

.week-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: var(--gutter) repeat(7, minmax(0, 1fr));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.week-dayhead { display: flex; align-items: baseline; gap: 0.4rem; padding: 0.45rem 0.6rem; border-left: 1px solid var(--grid-hour); }
.week-dow { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.week-date { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.week-dayhead--today .week-date { padding: 0 0.45rem; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); }

.week-body { display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr); }
.week-gutter { position: relative; }
.week-hour {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* The label at the very top edge sits just below its line, so the sticky header can't cover it. */
.week-hour--first { transform: translateY(2px); }

.week-days {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background-image:
    linear-gradient(to bottom, var(--grid-hour) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 100% calc(var(--slot) * 4), 100% var(--slot);
}
.week-days--editable { cursor: crosshair; user-select: none; -webkit-user-select: none; touch-action: none; }

/* Whole day in view: 15-minute rows are too thin for their own lines. */
.week-scroll--fit { overflow-y: hidden; }
.week-scroll--fit .week-days { background-image: linear-gradient(to bottom, var(--grid-hour) 1px, transparent 1px); background-size: 100% calc(var(--slot) * 4); }

.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent); }

/* The day's lanes exactly fill its column: lane width × lane count = day width. */
.week-col { position: relative; border-left: 1px solid var(--grid-hour); --lane-w: calc(100% / var(--lanes, 1)); }
.week-col--past { background: color-mix(in srgb, var(--text) 2.5%, transparent); }
.week-col--today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.week-layer { position: absolute; inset: 0; }

/* Transparent borders (inside the lane) keep neighbouring strips visually apart without changing lane sizes. */
.strip {
  position: absolute;
  border-radius: 4px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
/* A strip that carries on beyond the visible (awake) range gets a square end at the edge. */
.strip--cut-start { border-top-left-radius: 0; border-top-right-radius: 0; }
.strip--cut-end { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.week-hover, .week-stroke { position: absolute; pointer-events: none; }

.week-hover { z-index: 2; border: 1.5px dashed var(--paint); border-radius: 4px; }

/* Follows the pointer over the week grid (fixed, so the scroll container can't clip it). */
.week-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.week-tip-when { font-weight: 700; font-variant-numeric: tabular-nums; }
.week-tip-item { display: flex; align-items: center; gap: 0.4rem; }
.week-tip-range { opacity: 0.7; font-variant-numeric: tabular-nums; }

.week-stroke { z-index: 3; border-radius: 5px; }
.week-stroke--set { background: color-mix(in srgb, var(--paint) 35%, transparent); border: 2px solid var(--paint); }
.week-stroke--unset {
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--danger) 22%, transparent) 0 6px, transparent 6px 12px);
  border: 2px dashed var(--danger);
}
/* A stroke waiting for the server: labelled "Saving…"/"Erasing…" and pulsing until it's stored. */
.week-stroke--pending { animation: pulse 0.9s ease-in-out infinite; }

/* A week whose strips are still being fetched: every day grayed out, and a spinner in the header's corner. */
.week-days--loading .week-col::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--muted) 16%, transparent); animation: pulse 1.2s ease-in-out infinite; pointer-events: none; }
.week-head .week-loading { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.week-stroke span {
  position: absolute;
  top: 2px;
  left: 4px;
  padding: 0 0.3rem;
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.week-now { position: absolute; z-index: 4; width: calc(100% / 7); height: 2px; margin-top: -1px; background: var(--danger); pointer-events: none; }
.week-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
