/* Material Design 3 — tokens, then components. See DESIGN.md. */

/* ---------------------------------------------------------------- tokens: light */
:root {
  --md-sys-color-primary: #6750a4;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #eaddff;
  --md-sys-color-on-primary-container: #21005d;
  --md-sys-color-secondary: #625b71;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #e8def8;
  --md-sys-color-on-secondary-container: #1d192b;
  --md-sys-color-tertiary: #7d5260;
  --md-sys-color-tertiary-container: #ffd8e4;
  --md-sys-color-on-tertiary-container: #31111d;
  --md-sys-color-error: #b3261e;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #f9dedc;
  --md-sys-color-on-error-container: #410e0b;
  --md-sys-color-surface: #fef7ff;
  --md-sys-color-on-surface: #1d1b20;
  --md-sys-color-surface-variant: #e7e0ec;
  --md-sys-color-on-surface-variant: #49454f;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f7f2fa;
  --md-sys-color-surface-container: #f3edf7;
  --md-sys-color-surface-container-high: #ece6f0;
  --md-sys-color-surface-container-highest: #e6e0e9;
  --md-sys-color-outline: #79747e;
  --md-sys-color-outline-variant: #cac4d0;
  --md-sys-color-inverse-surface: #322f35;
  --md-sys-color-inverse-on-surface: #f5eff7;
  --md-sys-color-inverse-primary: #d0bcff;
  --md-sys-color-scrim: #000000;
  /* extended colors: vote semantics */
  --md-ext-color-yes: #386a20;
  --md-ext-color-on-yes: #ffffff;
  --md-ext-color-yes-container: #b8f397;
  --md-ext-color-on-yes-container: #072100;
  --md-ext-color-maybe: #785900;
  --md-ext-color-on-maybe: #ffffff;
  --md-ext-color-maybe-container: #ffdf9e;
  --md-ext-color-on-maybe-container: #261a00;

  --md-sys-shape-xs: 4px;
  --md-sys-shape-sm: 8px;
  --md-sys-shape-md: 12px;
  --md-sys-shape-lg: 16px;
  --md-sys-shape-xl: 28px;
  --md-sys-shape-full: 999px;

  --md-sys-elevation-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-3: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.3);

  --md-ref-typeface: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --md-sys-motion-standard: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: light dark;
}

/* ---------------------------------------------------------------- tokens: dark */
@media (prefers-color-scheme: dark) {
  :root {
    --md-sys-color-primary: #d0bcff;
    --md-sys-color-on-primary: #381e72;
    --md-sys-color-primary-container: #4f378b;
    --md-sys-color-on-primary-container: #eaddff;
    --md-sys-color-secondary: #ccc2dc;
    --md-sys-color-on-secondary: #332d41;
    --md-sys-color-secondary-container: #4a4458;
    --md-sys-color-on-secondary-container: #e8def8;
    --md-sys-color-tertiary: #efb8c8;
    --md-sys-color-tertiary-container: #633b48;
    --md-sys-color-on-tertiary-container: #ffd8e4;
    --md-sys-color-error: #f2b8b5;
    --md-sys-color-on-error: #601410;
    --md-sys-color-error-container: #8c1d18;
    --md-sys-color-on-error-container: #f9dedc;
    --md-sys-color-surface: #141218;
    --md-sys-color-on-surface: #e6e0e9;
    --md-sys-color-surface-variant: #49454f;
    --md-sys-color-on-surface-variant: #cac4d0;
    --md-sys-color-surface-container-lowest: #0f0d13;
    --md-sys-color-surface-container-low: #1d1b20;
    --md-sys-color-surface-container: #211f26;
    --md-sys-color-surface-container-high: #2b2930;
    --md-sys-color-surface-container-highest: #36343b;
    --md-sys-color-outline: #938f99;
    --md-sys-color-outline-variant: #49454f;
    --md-sys-color-inverse-surface: #e6e0e9;
    --md-sys-color-inverse-on-surface: #322f35;
    --md-sys-color-inverse-primary: #6750a4;
    --md-ext-color-yes: #9dd67d;
    --md-ext-color-on-yes: #0f3900;
    --md-ext-color-yes-container: #205107;
    --md-ext-color-on-yes-container: #b8f397;
    --md-ext-color-maybe: #fabd00;
    --md-ext-color-on-maybe: #3f2e00;
    --md-ext-color-maybe-container: #5b4300;
    --md-ext-color-on-maybe-container: #ffdf9e;
  }
}

/* ---------------------------------------------------------------- type scale */
.md-display-small { font: 400 36px/44px var(--md-ref-typeface); }
.md-headline-large { font: 400 32px/40px var(--md-ref-typeface); }
.md-headline-medium { font: 400 28px/36px var(--md-ref-typeface); }
.md-headline-small { font: 400 24px/32px var(--md-ref-typeface); }
.md-title-large { font: 400 22px/28px var(--md-ref-typeface); }
.md-title-medium { font: 500 16px/24px var(--md-ref-typeface); letter-spacing: 0.15px; }
.md-title-small { font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px; }
.md-body-large { font: 400 16px/24px var(--md-ref-typeface); letter-spacing: 0.5px; }
.md-body-medium { font: 400 14px/20px var(--md-ref-typeface); letter-spacing: 0.25px; }
.md-body-small { font: 400 12px/16px var(--md-ref-typeface); letter-spacing: 0.4px; }
.md-label-large { font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px; }
.md-label-medium { font: 500 12px/16px var(--md-ref-typeface); letter-spacing: 0.5px; }
.md-label-small { font: 500 11px/16px var(--md-ref-typeface); letter-spacing: 0.5px; }
@media (max-width: 600px) {
  .md-headline-large { font-size: 28px; line-height: 36px; }
  .md-headline-medium { font-size: 24px; line-height: 32px; }
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
  font: 400 16px/24px var(--md-ref-typeface); letter-spacing: 0.5px; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--md-sys-color-primary); }
.on-variant { color: var(--md-sys-color-on-surface-variant); }
.primary-text { color: var(--md-sys-color-primary); }
.error-text { color: var(--md-sys-color-error); }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.page .stack > * + * { margin-top: 20px; }
.pre { white-space: pre-wrap; }

.ms {
  font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr;
  -webkit-font-feature-settings: "liga"; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20; width: 1em; overflow: hidden; flex: none;
}
.ms.fill { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20; }
.ms.lg { font-size: 24px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24; }

/* layout */
.page { max-width: 840px; margin: 0 auto; padding: 8px 16px 128px; }
.page.wide { max-width: 1120px; }
@media (min-width: 600px) { .page { padding: 8px 24px 128px; } }

/* ---------------------------------------------------------------- state layer */
.sl { position: relative; overflow: hidden; isolation: isolate; }
.sl::before {
  content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; pointer-events: none;
  transition: opacity 150ms var(--md-sys-motion-standard); z-index: -1; border-radius: inherit;
}
.sl:hover::before { opacity: 0.08; }
.sl:focus-visible::before { opacity: 0.1; }
.sl:active::before { opacity: 0.1; }
:focus-visible { outline: 3px solid var(--md-sys-color-secondary); outline-offset: 2px; }
.sl:disabled::before, .sl[aria-disabled=true]::before { opacity: 0 !important; }

/* ---------------------------------------------------------------- top app bar */
.md-topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px; height: 64px;
  padding: 0 4px 0 16px; background: var(--md-sys-color-surface); transition: background 200ms;
}
.md-topbar.scrolled { background: var(--md-sys-color-surface-container); }
.md-topbar .title { flex: 1; font: 400 22px/28px var(--md-ref-typeface); display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--md-sys-color-on-surface); text-decoration: none; }
.md-topbar .title .ms { color: var(--md-sys-color-primary); }
.md-topbar .title small { color: var(--md-sys-color-on-surface-variant); font: 400 14px/20px var(--md-ref-typeface); letter-spacing: 0.25px; }
.md-topbar .inner { max-width: 1120px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 4px; }

/* ---------------------------------------------------------------- buttons */
.md-btn {
  --c: var(--md-sys-color-primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 24px;
  border-radius: var(--md-sys-shape-full); border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px; color: var(--c); background: transparent;
  transition: box-shadow 150ms var(--md-sys-motion-standard);
}
.md-btn .ms { font-size: 18px; margin-left: -8px; }
.md-btn.filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.md-btn.filled:hover { box-shadow: var(--md-sys-elevation-1); }
.md-btn.tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.md-btn.tonal:hover { box-shadow: var(--md-sys-elevation-1); }
.md-btn.outlined { border: 1px solid var(--md-sys-color-outline); color: var(--md-sys-color-primary); }
.md-btn.text { padding: 0 12px; }
.md-btn.text .ms { margin-left: -4px; }
.md-btn.danger { --c: var(--md-sys-color-error); color: var(--md-sys-color-error); }
.md-btn.filled.danger { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }
.md-btn.sm { height: 32px; padding: 0 16px; }
.md-btn.text.sm { padding: 0 8px; }
.md-btn:disabled { background: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); box-shadow: none; cursor: default; }
.md-btn.text:disabled, .md-btn.outlined:disabled { background: transparent; }

.md-icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: transparent; color: var(--md-sys-color-on-surface-variant); text-decoration: none;
}
.md-icon-btn .ms { font-size: 24px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24; }
.md-icon-btn.sm { width: 32px; height: 32px; }
.md-icon-btn.sm .ms { font-size: 18px; }
.md-icon-btn.danger { color: var(--md-sys-color-error); }

.md-fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 8; display: inline-flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 20px 0 16px; border-radius: var(--md-sys-shape-lg); border: 0; cursor: pointer; text-decoration: none;
  background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); box-shadow: var(--md-sys-elevation-3);
  font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px;
}
.md-fab .ms { font-size: 24px; }
@media (min-width: 840px) { .md-fab { right: 24px; bottom: 24px; } }

/* ---------------------------------------------------------------- cards */
.md-card { border-radius: var(--md-sys-shape-md); padding: 16px; }
@media (min-width: 600px) { .md-card { padding: 24px; } }
.md-card.filled { background: var(--md-sys-color-surface-container-highest); }
.md-card.low { background: var(--md-sys-color-surface-container-low); }
.md-card.outlined { background: var(--md-sys-color-surface); border: 1px solid var(--md-sys-color-outline-variant); }
.md-card.elevated { background: var(--md-sys-color-surface-container-low); box-shadow: var(--md-sys-elevation-1); }
.md-card.primary { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.md-card.error { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.md-card + .md-card, .md-card + section, section + .md-card, section + section { margin-top: 16px; }

/* ---------------------------------------------------------------- chips */
.md-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 16px 0 8px; border-radius: var(--md-sys-shape-sm);
  border: 1px solid var(--md-sys-color-outline-variant); color: var(--md-sys-color-on-surface); background: transparent;
  font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px; white-space: nowrap;
}
.md-chip .ms { font-size: 18px; color: var(--md-sys-color-primary); }
.md-chip.input { padding: 0 4px 0 12px; font-variant-numeric: tabular-nums; }
.md-chip.input button { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--md-sys-color-on-surface-variant); cursor: pointer; padding: 0; }
.md-chip.input button .ms { color: inherit; }
.md-chip.input.off { opacity: 0.5; text-decoration: line-through; border-style: dashed; }
.md-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.md-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--md-sys-shape-sm);
  font: 500 12px/16px var(--md-ref-typeface); letter-spacing: 0.5px; vertical-align: middle;
}
.md-badge .ms { font-size: 16px; }
.md-badge.yes { background: var(--md-ext-color-yes-container); color: var(--md-ext-color-on-yes-container); }
.md-badge.primary { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.md-badge.neutral { background: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-on-surface-variant); }

/* ---------------------------------------------------------------- outlined text field */
.md-field { position: relative; display: block; margin-top: 8px; }
.md-field input, .md-field textarea, .md-field select {
  width: 100%; min-height: 56px; padding: 16px; border-radius: var(--md-sys-shape-xs); border: 1px solid var(--md-sys-color-outline);
  background: transparent; color: var(--md-sys-color-on-surface); font: 400 16px/24px var(--md-ref-typeface); letter-spacing: 0.5px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.md-field textarea { min-height: 112px; resize: vertical; display: block; }
.md-field select { padding-right: 44px; cursor: pointer; }
.md-field.select::after { content: "arrow_drop_down"; font-family: "Material Symbols Outlined"; font-size: 24px; position: absolute; right: 12px; top: 16px; pointer-events: none; color: var(--md-sys-color-on-surface-variant); }
.md-field select option { background: var(--md-sys-color-surface-container); color: var(--md-sys-color-on-surface); }
.md-field input:hover, .md-field textarea:hover, .md-field select:hover { border-color: var(--md-sys-color-on-surface); }
.md-field input:focus, .md-field textarea:focus, .md-field select:focus { border: 2px solid var(--md-sys-color-primary); padding: 15px; }
.md-field select:focus { padding-right: 43px; }
.md-field label {
  position: absolute; left: 12px; top: 16px; padding: 0 4px; pointer-events: none; color: var(--md-sys-color-on-surface-variant);
  font: 400 16px/24px var(--md-ref-typeface); letter-spacing: 0.5px; background: var(--field-bg, var(--md-sys-color-surface));
  transition: all 150ms var(--md-sys-motion-standard); max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.md-field :is(input, textarea):focus + label,
.md-field :is(input, textarea):not(:placeholder-shown) + label,
.md-field select + label,
.md-field input[type=time] + label { top: -8px; font: 400 12px/16px var(--md-ref-typeface); letter-spacing: 0.4px; }
.md-field :is(input, textarea, select):focus + label { color: var(--md-sys-color-primary); }
.md-field .support { display: block; padding: 4px 16px 0; font: 400 12px/16px var(--md-ref-typeface); letter-spacing: 0.4px; color: var(--md-sys-color-on-surface-variant); }
.md-field.dense input, .md-field.dense select { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.md-field.dense input:focus, .md-field.dense select:focus { padding-top: 7px; padding-bottom: 7px; }
.md-field.dense.select::after { top: 8px; }
.md-field.dense label { top: 8px; }
.md-field.dense select + label, .md-field.dense input[type=time] + label { top: -8px; }
.md-card.low .md-field { --field-bg: var(--md-sys-color-surface-container-low); }
.md-card.filled .md-field { --field-bg: var(--md-sys-color-surface-container-highest); }
.md-field input[type=time] { font-variant-numeric: tabular-nums; }
.md-field input[type=time]::-webkit-calendar-picker-indicator { filter: none; opacity: 0.7; cursor: pointer; }
@media (prefers-color-scheme: dark) { .md-field input[type=time]::-webkit-calendar-picker-indicator { filter: invert(1); } }

/* ---------------------------------------------------------------- segmented button */
.md-seg { display: inline-flex; height: 40px; border: 1px solid var(--md-sys-color-outline); border-radius: var(--md-sys-shape-full); overflow: hidden; }
.md-seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 48px; padding: 0 12px; border: 0; cursor: pointer;
  background: transparent; color: var(--md-sys-color-on-surface); font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px; white-space: nowrap;
}
.md-seg button + button { border-left: 1px solid var(--md-sys-color-outline); }
.md-seg button .ms { font-size: 18px; display: none; }
.md-seg button[aria-pressed=true] .ms { display: inline-block; }
.md-seg button.y[aria-pressed=true] { background: var(--md-ext-color-yes-container); color: var(--md-ext-color-on-yes-container); }
.md-seg button.m[aria-pressed=true] { background: var(--md-ext-color-maybe-container); color: var(--md-ext-color-on-maybe-container); }
.md-seg button.n[aria-pressed=true] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
@media (max-width: 600px) {
  .md-seg { display: flex; width: 100%; height: 48px; }
  .md-seg button { flex: 1; padding: 0 6px; }
}

/* ---------------------------------------------------------------- list */
.md-list { list-style: none; margin: 0; padding: 8px 0; }
.md-list li { display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 8px 12px 8px 16px; }
.md-list li + li { border-top: 1px solid var(--md-sys-color-outline-variant); }
.md-list .lead { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); flex: none; }
.md-list .lead.done { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.md-list .body { flex: 1; min-width: 0; }
.md-list a.headline { color: var(--md-sys-color-on-surface); text-decoration: none; font: 400 16px/24px var(--md-ref-typeface); letter-spacing: 0.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-list a.headline::after { content: ""; position: absolute; inset: 0; }
.md-list li { position: relative; }
.md-list li > .md-icon-btn, .md-list li > .md-btn { position: relative; z-index: 1; }
.md-list .supporting { font: 400 14px/20px var(--md-ref-typeface); letter-spacing: 0.25px; color: var(--md-sys-color-on-surface-variant); }

/* ---------------------------------------------------------------- slots (voter page) */
.day { margin-top: 24px; }
.day h3 { font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px; color: var(--md-sys-color-primary); margin: 0 4px 8px; }
.slot {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; align-items: center; padding: 12px 12px 12px 16px;
  border-radius: var(--md-sys-shape-md); border: 1px solid var(--md-sys-color-outline-variant); background: var(--md-sys-color-surface);
}
.slot + .slot { margin-top: 8px; }
.slot.best { border-color: var(--md-ext-color-yes); background: color-mix(in srgb, var(--md-ext-color-yes-container) 25%, var(--md-sys-color-surface)); }
.slot.final { border: 2px solid var(--md-sys-color-primary); background: color-mix(in srgb, var(--md-sys-color-primary-container) 35%, var(--md-sys-color-surface)); }
.slot .time { font: 500 16px/24px var(--md-ref-typeface); letter-spacing: 0.15px; font-variant-numeric: tabular-nums; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.slot .who { font: 400 14px/20px var(--md-ref-typeface); letter-spacing: 0.25px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 0 12px; }
.slot .who .y, .slot .who .m { display: inline-flex; align-items: center; gap: 4px; }
.slot .who .y .ms { color: var(--md-ext-color-yes); font-size: 16px; }
.slot .who .m .ms { color: var(--md-ext-color-maybe); font-size: 16px; }
@media (max-width: 600px) { .slot { grid-template-columns: 1fr; padding: 12px; } }

.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------------------------------------------------------------- bottom app bar */
.md-bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--md-sys-color-surface-container);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--md-sys-color-outline-variant);
}
.md-bottombar .inner { max-width: 808px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.md-bottombar .status { flex: 1; font: 400 14px/20px var(--md-ref-typeface); letter-spacing: 0.25px; color: var(--md-sys-color-on-surface-variant); }

/* ---------------------------------------------------------------- data table */
.md-table-wrap { overflow-x: auto; border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-md); background: var(--md-sys-color-surface); }
table.md-table { border-collapse: collapse; min-width: 100%; font: 400 14px/20px var(--md-ref-typeface); letter-spacing: 0.25px; }
.md-table th, .md-table td { padding: 0 12px; height: 52px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.md-table thead th { height: auto; padding: 12px; font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px; vertical-align: bottom; color: var(--md-sys-color-on-surface); }
.md-table thead .d { display: block; font: 500 12px/16px var(--md-ref-typeface); letter-spacing: 0.5px; color: var(--md-sys-color-on-surface-variant); }
.md-table th:first-child, .md-table td:first-child { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--md-sys-color-surface); border-right: 1px solid var(--md-sys-color-outline-variant); max-width: 200px; overflow: hidden; text-overflow: ellipsis; padding-left: 16px; }
.md-table td.y { background: var(--md-ext-color-yes-container); color: var(--md-ext-color-on-yes-container); }
.md-table td.m { background: var(--md-ext-color-maybe-container); color: var(--md-ext-color-on-maybe-container); }
.md-table td.n { color: var(--md-sys-color-outline); }
.md-table td .ms { font-size: 20px; vertical-align: middle; }
.md-table tr.tot td { font-weight: 500; border-bottom: 0; background: var(--md-sys-color-surface-container-low); }
.md-table tr.tot td:first-child { background: var(--md-sys-color-surface-container-low); }
.md-table th.best { color: var(--md-ext-color-yes); }
.md-table th.final { box-shadow: inset 0 -3px 0 var(--md-sys-color-primary); }
.md-table tr.you td:first-child { font-weight: 500; }
.md-table td:first-child .md-icon-btn { vertical-align: middle; margin-left: 4px; }

details.all { margin-top: 32px; }
details.all summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin: 0 0 12px -12px; border-radius: var(--md-sys-shape-full); color: var(--md-sys-color-primary); font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px; }
details.all summary::-webkit-details-marker { display: none; }
details.all summary .ms { transition: transform 200ms var(--md-sys-motion-standard); }
details.all[open] summary .ms { transform: rotate(180deg); }

/* ---------------------------------------------------------------- snackbar */
.md-snackbar {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 30;
  min-width: 288px; max-width: min(560px, calc(100vw - 32px)); padding: 14px 16px; border-radius: var(--md-sys-shape-xs);
  background: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-on-surface); box-shadow: var(--md-sys-elevation-3);
  font: 400 14px/20px var(--md-ref-typeface); letter-spacing: 0.25px; transition: opacity 150ms, transform 250ms var(--md-sys-motion-standard);
}
.md-snackbar.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- date picker */
.md-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.md-cal-head b { font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px; color: var(--md-sys-color-on-surface-variant); }
.md-cal { display: grid; grid-template-columns: repeat(7, 48px); justify-content: space-between; row-gap: 4px; user-select: none; }
.md-cal .dow { height: 40px; display: grid; place-items: center; font: 400 16px/24px var(--md-ref-typeface); color: var(--md-sys-color-on-surface); }
.md-cal button {
  width: 40px; height: 40px; margin: 0 auto; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: transparent;
  color: var(--md-sys-color-on-surface); font: 400 16px/24px var(--md-ref-typeface); letter-spacing: 0.5px; font-variant-numeric: tabular-nums;
}
.md-cal button.today { border: 1px solid var(--md-sys-color-primary); color: var(--md-sys-color-primary); }
.md-cal button.on { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border: 0; }
.md-cal button:disabled { color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); cursor: default; }
@media (max-width: 420px) { .md-cal { grid-template-columns: repeat(7, 1fr); } }

/* ---------------------------------------------------------------- tabs (primary) */
.md-tabs { display: flex; margin-top: 16px; border-bottom: 1px solid var(--md-sys-color-surface-variant); }
.md-tabs button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border: 0; background: transparent; cursor: pointer;
  color: var(--md-sys-color-on-surface-variant); font: 500 14px/20px var(--md-ref-typeface); letter-spacing: 0.1px; position: relative;
}
.md-tabs button[aria-selected=true] { color: var(--md-sys-color-primary); }
.md-tabs button[aria-selected=true]::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--md-sys-color-primary); }

/* ---------------------------------------------------------------- results */
.results { display: flex; flex-direction: column; gap: 8px; }
.result { padding: 12px 16px; border-radius: var(--md-sys-shape-md); border: 1px solid var(--md-sys-color-outline-variant); }
.result.best { border-color: var(--md-ext-color-yes); }
.result.final { border: 2px solid var(--md-sys-color-primary); }
.result-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result .bar { display: flex; height: 8px; border-radius: 4px; background: var(--md-sys-color-surface-container-highest); overflow: hidden; margin: 10px 0 6px; }
.result .bar .y { background: var(--md-ext-color-yes); }
.result .bar .m { background: var(--md-ext-color-maybe); }
.result .who { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--md-sys-color-on-surface-variant); }
.result .who span { display: inline-flex; align-items: center; gap: 4px; }
.result .who .y .ms { color: var(--md-ext-color-yes); font-size: 16px; }
.result .who .m .ms { color: var(--md-ext-color-maybe); font-size: 16px; }

/* ---------------------------------------------------------------- theme swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 3px; background: transparent; }
.swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; }
.swatch[aria-pressed=true] { border-color: var(--md-sys-color-on-surface); }
.swatch.custom { position: relative; overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.embed-box { border-radius: var(--md-sys-shape-md); padding: 16px; background: #ffffff; margin-top: 16px; overflow-x: auto; color-scheme: light; border: 1px solid var(--md-sys-color-outline-variant); }

/* ---------------------------------------------------------------- misc */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 840px) { .two { grid-template-columns: 1fr; gap: 24px; } }
.times { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.times .md-field { width: 168px; margin: 0; }
.preview-day { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 8px 0; align-items: center; }
.preview-day + .preview-day { border-top: 1px solid var(--md-sys-color-outline-variant); }
@media (max-width: 600px) { .preview-day { grid-template-columns: 1fr; gap: 6px; } }
.gmail-preview { border: 1px dashed var(--md-sys-color-outline); border-radius: var(--md-sys-shape-md); padding: 16px; background: #ffffff; margin-top: 16px; overflow-x: auto; color-scheme: light; }
.login { max-width: 400px; margin: 10vh auto 0; }
.mono { font-family: ui-monospace, "Roboto Mono", SFMono-Regular, Menlo, monospace; font-size: 14px; }
.section-head { display: flex; align-items: center; gap: 8px; margin: 32px 0 12px; flex-wrap: wrap; }
.md-divider { height: 1px; background: var(--md-sys-color-outline-variant); margin: 16px 0; border: 0; }
.final-when { font: 400 24px/32px var(--md-ref-typeface); margin: 4px 0 16px; }
