/* ============================================================================
   WhenFinder - "Almanac" design system
   Warm parchment + ink, vermilion brand, teal availability-heat, marigold for
   consensus. Display: Fraunces. Body: Hanken Grotesk. Mono: Space Mono.
   ========================================================================== */

:root {
  /* paper & ink */
  --paper:      #f2ebdb;
  --paper-2:    #ece2cd;   /* card insets / wells */
  --card:       #fbf7ec;   /* raised surfaces */
  --ink:        #221d16;
  --ink-soft:   #6f6453;
  --ink-faint:  #6c6150;   /* 4.5:1 even on paper-2 (WCAG text contrast); lighter weight / size sets it apart */
  --line:       #ddd0b4;
  --line-soft:  #e7dcc4;
  --field-line: #8a7d68;   /* the edge of a box you type in: 3:1 against the page (WCAG 1.4.11) */

  /* brand + signals */
  --ember:      #c33d1c;   /* primary action / brand (light text on it: 4.9:1) */
  --ember-deep: #a8330f;
  --ember-tint: #f6d8c8;
  --spruce:     #1f5d56;   /* availability heat (max) */
  --unmarked:   #f3e7e0;   /* a time not marked on your own grid: counts as busy */
  --spruce-ink: #123b36;
  --marigold:   #e0a13a;   /* "works for everyone" */
  --marigold-deep:#b97c16;   /* borders and marks */
  --marigold-ink: #865a0e;   /* marigold TEXT: 4.5:1 on paper */

  /* heat scale (none → everyone), teal-on-parchment */
  --heat-0: #ece3cf;
  /* even steps in lightness (each about 1.43:1 from the next), so neighbouring shades can be told apart */
  --heat-1: #b7c4b2;
  --heat-2: #89a798;
  --heat-3: #598e81;
  --heat-4: #32766c;
  --heat-5: #1f5d56;

  /* surfaces and marks with a meaning of their own (dark values: [data-theme="dark"] below) */
  --on-ember:     #fff6ef;   /* text on an ember fill */
  --on-spruce:    #f2fbf7;   /* text on a spruce fill */
  --on-marigold:  #221d16;   /* text and icons on a marigold fill - dark in both themes */
  --ember-strong: #a8330f;   /* ember fill, pressed / danger */
  --danger-hover: #8f2a0c;
  --spruce-strong:#123b36;   /* spruce fill, hovered */
  --spruce-wash:  #dcebe4;   /* a calm "it's settled" panel */
  --spruce-wash-2:#eef4e6;
  --spruce-edge:  #bcd8cc;
  --spruce-halo:  rgba(31,93,86,.3);
  --marigold-wash:#fcf4e3;   /* a "worth knowing" panel */
  --marigold-edge:#ecd3a3;
  --maybe-stripe: var(--maybe-stripe);   /* the light stripe of "free if needed" */
  --unmarked-edge:#d9c4b8;
  --pad:          #ebe6da;   /* a day that isn't one of the event's */
  --pad-edge:     #e2dccf;
  --busy-a:       #5a5143;   /* your own calendar's busy block (stripes) */
  --busy-b:       #6f6453;
  --busy-ink:     #f7f1e3;   /* its title */
  --hatch-hard:   #7d705c;   /* someone who must attend is busy (your grid) */
  --hatch-soft:   #8f826c;   /* an optional guest is busy (your grid) */
  --hatch-must:   #8a7d68;   /* a must-attend clash (group grid): lines … */
  --hatch-must-bg:#efe7d6;   /* … on this */
  --hatch-edge:   #ddd0c0;
  --heat-all:     #17463f;   /* everyone can make it */
  --all-mark:     #e0a13a;   /* … and its check mark (4.7:1 on --heat-all) */
  --blocked-paint:#6f9d94;   /* your "free" under someone else's clash */
  --blocked-stripe:#d6e0dc;
  --blocked-line: rgba(34,29,22,.28);
  --cancelled-bg: #e7ddca;
  --cancelled-ink:#5f5546;
  --busy-edge:    #cfc3aa;
  --scrim:        rgba(34,29,22,.45);   /* behind a sheet */
  --scrim-strong: var(--scrim-strong);   /* behind the guide */
  --glass:        rgba(242,235,219,.72);   /* the header's fade */
  --glow-a:       rgba(224,161,58,.16);   /* the page's corner glows */
  --glow-b:       rgba(31,93,86,.10);
  --brand-when:   #071f4a;
  --brand-finder: #00876b;
  --theme-color:  #f2ebdb;   /* the browser's own chrome (mirrors <meta name="theme-color">) */

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 0 #fffaf0 inset, 0 18px 40px -24px rgba(40,28,12,.45);
  --shadow-lift: 0 1px 0 #fffaf0 inset, 0 28px 60px -28px rgba(40,28,12,.55);
  --ring: 0 0 0 3px rgba(195,61,28,.22);

  --maxw: 1040px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/*
 * Dark: a warm almanac at night - brown-black paper, parchment ink, the same ember, teal and
 * marigold brightened to keep 4.5:1 text and 3:1 edges. js/theme-boot.js sets data-theme on
 * <html> before the first paint (the person's choice, else the system's).
 */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper:      #1a1611;
  --paper-2:    #231e17;
  --card:       #29231b;
  --ink:        #f1e8d6;
  --ink-soft:   #c4b8a1;
  --ink-faint:  #ab9f88;
  --line:       #4a4034;
  --line-soft:  #3a3229;
  --field-line: #8c7f69;

  --ember:      #c33d1c;
  --ember-deep: #f2896a;   /* ember TEXT and links: light on dark */
  --ember-tint: #4a2318;
  --spruce:     #3f9c8d;
  --unmarked:   #332a22;
  --spruce-ink: #bfe6dc;
  --marigold:   #e0a13a;
  --marigold-deep:#c98d2a;
  --marigold-ink: #f0c26e;

  /* none → everyone: dark to bright teal, even steps (about 1.53:1 each) */
  --heat-0: #2c2720;
  --heat-1: #39483f;
  --heat-2: #44675b;
  --heat-3: #518879;
  --heat-4: #5fac9b;
  --heat-5: #6fd6c2;
  --heat-all: #a6f0e1;
  --all-mark: #865a0e;   /* marigold is 1.7:1 on the light mint; this deep gold is 4.6:1 */

  --on-ember:     #fff6ef;
  --on-spruce:    #0e1f1c;
  --ember-strong: #a8330f;
  --danger-hover: #8f2a0c;
  --spruce-strong:#5cb8a8;
  --spruce-wash:  #173833;
  --spruce-wash-2:#1d3a2c;
  --spruce-edge:  #2e5a52;
  --spruce-halo:  rgba(111,214,194,.35);
  --marigold-wash:#3a2e17;
  --marigold-edge:#6b5527;
  --maybe-stripe: #1f4a43;
  --unmarked-edge:#4e4036;
  --pad:          #201c16;
  --pad-edge:     #2c261e;
  --busy-a:       #8a7d68;
  --busy-b:       #9a8d77;
  --busy-ink:     #14110d;
  --hatch-hard:   #a3967f;
  --hatch-soft:   #8c7f69;
  --hatch-must:   #9a8d77;
  --hatch-must-bg:#2c2720;
  --hatch-edge:   #4a4034;
  --blocked-paint:#2e6c62;
  --blocked-stripe:#20302c;
  --blocked-line: rgba(0,0,0,.4);
  --cancelled-bg: #3a3229;
  --cancelled-ink:#d6cab3;
  --busy-edge:    #6b5f4c;
  --scrim:        rgba(0,0,0,.6);
  --scrim-strong: rgba(0,0,0,.7);
  --glass:        rgba(26,22,17,.72);
  --glow-a:       rgba(224,161,58,.07);
  --glow-b:       rgba(63,156,141,.08);
  --brand-when:   #c9d6f2;
  --brand-finder: #3fc3a2;
  --theme-color:  #1a1611;

  --shadow:      0 1px 0 rgba(255,255,255,.04) inset, 0 18px 40px -24px rgba(0,0,0,.75);
  --shadow-lift: 0 1px 0 rgba(255,255,255,.05) inset, 0 28px 60px -28px rgba(0,0,0,.85);
  --ring: 0 0 0 3px rgba(242,137,106,.3);
}
:root:not([data-theme="dark"]) { color-scheme: light; }

* { box-sizing: border-box; }

/* min-height, not height: a body pinned to the viewport's height stops position:sticky after one screen. */
html { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(120% 80% at 100% -10%, var(--glow-a), transparent 55%),
    radial-gradient(90% 70% at -10% 0%, var(--glow-b), transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  font-size: 100%;   /* the reader's own default size (16px unless they changed it) */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* film-grain overlay for warmth/texture */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ---------- typography ---------- */
h1,h2,h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.04; margin: 0; letter-spacing: -.015em; }
/* A long unbroken word (a German compound, a pasted link) breaks instead of widening the page on a phone. */
h1, h2, h3, .ev-name, .chip, .iv-name, .desc, .details-body, .win-list, .rank-row { overflow-wrap: anywhere; }
.mono { font-family: "Space Mono", ui-monospace, monospace; }
a { color: var(--ember-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
/* A link inside a sentence is underlined: its colour alone is too close to the text round it (WCAG 1.4.1). */
p a:not(.btn), li a:not(.btn), .hint a, .footnav a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- accessibility basics ---------- */
/* Read by screen readers, not shown. */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* "Skip to content": the first Tab stop, shown only when it has the focus. */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 10001; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 10px; }
/* One focus ring everywhere a keyboard can land - ink, offset from the control so it shows on any fill. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* A heading or the page body focused by the app (a new page, "Skip to content") needs no ring. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, main[tabindex="-1"]:focus { outline: none; }
/* Keyboard focus is never hidden under the sticky header or the bars pinned to the bottom (WCAG 2.4.11). */
html { scroll-padding-top: 80px; scroll-padding-bottom: 90px; }
h2.h3 { font-size: 1.17em; }
h2.eyebrow { font-weight: 400; line-height: 1.55; letter-spacing: .22em; }

/* ---------- chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(18px, 5vw, 40px);
  background: linear-gradient(var(--paper), var(--glass));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 34px; width: auto; display: block; }
/* Wordmark, matching the logo: bold lowercase sans, "when" in navy, "finder" in the logo's spruce. */
.brand-word { font-family: "Hanken Grotesk", system-ui, sans-serif; font-weight: 800; font-size: 1.42rem; letter-spacing: -.045em; line-height: 1; }
.brand-word .w-when { color: var(--brand-when); }
.brand-word .w-finder { color: var(--brand-finder); }
.brand-word-sm { font-size: .95rem; }
.topnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.topnav .who { color: var(--ink-soft); font-size: .9rem; margin-right: 4px; }
/* Phones: the header scrolls away with the page (screen height is precious) and the nav
   collapses to the one main action + a Menu button that opens a sheet with the rest. */
.topnav .nav-menu { display: none; }
@media (max-width: 640px) {
  .topbar { position: relative; padding: 10px 16px; gap: 10px; }
  html { scroll-padding-top: 12px; }   /* the header scrolls away here, so nothing covers the top */
  .topnav { gap: 6px; flex-wrap: nowrap; }
  .topnav .who, .topnav .nav-wide { display: none; }
  .topnav .nav-menu { display: inline-flex; }
  .topnav .btn-sm { padding: 7px 12px; font-size: .82rem; }
}
@media (max-width: 360px) { .brand-word { font-size: 1.2rem; } .brand-logo { height: 28px; } }
.menu-list { display: grid; gap: 8px; }
.menu-list .btn { width: 100%; justify-content: flex-start; }

main { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: clamp(22px, 4vw, 48px) clamp(18px, 5vw, 40px); flex: 1 0 auto; }

.sitefoot {
  flex-shrink: 0;
  text-align: center; color: var(--ink-faint); font-size: .85rem;
  padding: 28px; border-top: 1px solid var(--line-soft); margin-top: 40px;
}
.sitefoot .dot { margin: 0 8px; }
/* Appearance (light / dark / automatic) in the footer: a small inline select. */
.theme-foot { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; }
.theme-foot label { font-size: .82rem; }
.theme-foot .theme-select { width: auto; padding: 4px 8px; font-size: .82rem; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; line-height: 1;
  padding: 12px 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--bg); color: var(--fg); cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn:hover { text-decoration: none; }
@media (hover: hover) { .btn:hover { transform: translateY(-1px); } }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { --bg: var(--ember); --fg: var(--on-ember); box-shadow: 0 12px 24px -14px rgba(206,68,33,.85); }
.btn-primary:hover { --bg: var(--ember-strong); }
.btn-ghost { --bg: transparent; --fg: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-spruce { --bg: var(--spruce); --fg: var(--on-spruce); }
.btn-spruce:hover { --bg: var(--spruce-strong); }
.btn-danger { --bg: var(--ember-strong); --fg: var(--on-ember); }
.btn-danger:hover { --bg: var(--danger-hover); }
.btn-sm { padding: 8px 13px; font-size: .85rem; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  color: var(--fg); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cards / surfaces ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow);
}
.well { background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.eyebrow { font-family: "Space Mono", monospace; text-transform: uppercase; letter-spacing: .22em; font-size: .72rem; color: var(--ember-deep); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field[hidden] { display: none; }
.field > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field > label.tier { display: inline-flex; }   /* the create form's "must attend" / "optional" tags stay pills */
.field .hint { font-size: .8rem; color: var(--ink-soft); margin-top: 5px; }
.input, .textarea, select.input {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--field-line); border-radius: var(--radius-sm);
  padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, select.input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ember); box-shadow: var(--ring); }
.textarea { min-height: 84px; resize: vertical; }

/* WYSIWYG Markdown editor (js/md-editor.js): toolbar + contenteditable box styled like an input */
.mde { border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--paper); overflow: hidden; }
.mde:focus-within { border-color: var(--ember); box-shadow: var(--ring); }
.mde-bar { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); background: var(--paper-2); flex-wrap: wrap; }
.mde-btn { font: inherit; font-size: .82rem; font-weight: 700; min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.mde-btn.i { font-style: italic; font-family: "Fraunces", serif; }
.mde-btn.ol::before { content: "1."; }
.mde-btn:hover { background: var(--card); border-color: var(--line); color: var(--ink); }
.mde-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mde-box { padding: 10px 12px; font: inherit; line-height: 1.55; outline: none; position: relative; color: var(--ink); }
.mde:focus-within { outline: 2px solid var(--ink); outline-offset: 1px; }
.mde-box p { margin: 0 0 .6em; } .mde-box p:last-child { margin-bottom: 0; }
.mde-box h1, .mde-box h2, .mde-box h3, .mde-box h4 { font-size: 1.05rem; margin: .6em 0 .3em; }
.mde-box ul, .mde-box ol { margin: 0 0 .6em 1.2em; }
.mde-box a { color: var(--ember-deep); text-decoration: underline; }
.mde.empty .mde-box::before { content: attr(data-placeholder); color: var(--ink-faint); position: absolute; pointer-events: none; }
.field.invalid .input, .field.invalid .textarea { border-color: var(--ember); }
.field .err { color: var(--ember-deep); font-size: .82rem; margin-top: 5px; display: none; }
.field.invalid .err { display: block; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 10px; width: min(92vw, 420px); }
.toast {
  background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 12px;
  box-shadow: var(--shadow-lift); font-size: .92rem; animation: toast-in .35s var(--ease);
  border-left: 4px solid var(--marigold);
}
.toast.error { border-left-color: var(--ember); display: flex; align-items: flex-start; gap: 10px; }
.toast .toast-msg { flex: 1; }
.toast-x { flex: none; min-width: 24px; min-height: 24px; margin: -3px -6px -3px 0; border: 0; background: none; color: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.toast-x:focus-visible { outline-color: var(--paper); }
.toast.success { border-left-color: var(--heat-4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- staggered entrance ---------- */
.enter > * { opacity: 0; transform: translateY(14px); animation: rise .6s var(--ease) forwards; }
.enter > *:nth-child(1){ animation-delay: .02s }
.enter > *:nth-child(2){ animation-delay: .09s }
.enter > *:nth-child(3){ animation-delay: .16s }
.enter > *:nth-child(4){ animation-delay: .23s }
.enter > *:nth-child(5){ animation-delay: .30s }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .enter > * { animation: none; opacity: 1; transform: none; } }

/* ============================================================================
   Landing / hero
   ========================================================================== */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 5vw, 60px); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.hero h1 .swash { font-style: italic; color: var(--ember); }
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--ink-soft); max-width: 46ch; margin: 20px 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.codejump { display: flex; gap: 8px; margin-top: 26px; max-width: 360px; }
.codejump .input { font-family: "Space Mono", monospace; text-transform: lowercase; letter-spacing: .04em; }

/* hero illustration: a living availability heat strip */
.hero-art { position: relative; }
.hero-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lift); transform: rotate(-1.4deg); }
.hero-cell { aspect-ratio: 1; border-radius: 8px; background: var(--heat-0); animation: heatpulse 5s var(--ease) infinite; }
@keyframes heatpulse { 0%,100%{ filter: none } 50%{ filter: saturate(1.25) } }
.hero-tag { position: absolute; right: -8px; bottom: -14px; transform: rotate(3deg); background: var(--marigold); color: var(--on-marigold); font-family: "Space Mono", monospace; font-weight: 700; font-size: .8rem; padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow); }

.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: clamp(40px, 7vw, 80px); }
.feature { padding: 20px; }
.feature h2 { font-size: 1.15rem; margin-bottom: 6px; }
.feature .ix { font-size: 1.6rem; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .feature-row { grid-template-columns: 1fr; }
}

/* ============================================================================
   Auth pages
   ========================================================================== */
.authwrap { max-width: 440px; margin: 4vh auto 0; }
.authwrap h1 { font-size: 2.2rem; margin-bottom: 6px; }
.authwrap .sub { color: var(--ink-soft); margin-bottom: 24px; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--ink-soft); font-size: .92rem; }

/* ============================================================================
   Dashboard
   ========================================================================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.evlist { display: grid; gap: 14px; }
a.evcard { color: inherit; text-decoration: none; }
.evcard { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; }
@media (hover: hover) { .evcard:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); transition: .2s var(--ease); } }
.evcard .ev-main { min-width: 0; }
.evcard .ev-name { font-family: "Fraunces", serif; font-size: 1.25rem; font-weight: 600; }
.evcard .ev-meta { color: var(--ink-soft); font-size: .85rem; margin-top: 3px; }
.evcard .ev-code { font-family: "Space Mono", monospace; color: var(--ember-deep); white-space: nowrap; }
.evcard .ev-responses { color: var(--spruce); font-weight: 600; }
.evcard .ev-responses.none { color: var(--ink-faint); font-weight: 400; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.active   { background: var(--ember-tint);  color: var(--ember-deep); }
.badge.scheduled{ background: var(--spruce-wash);             color: var(--spruce-ink); }
.badge.cancelled{ background: var(--cancelled-bg); color: var(--cancelled-ink); }

/* (Not plain ".empty": the editor and the week strip use "empty" as a state class.) */
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state .ix { font-size: 3rem; opacity: .5; }

/* ============================================================================
   Create event
   ========================================================================== */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; gap: 0; } }
.grid-host { margin-top: 8px; }
.lvl-row { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; }
.lvl-row .hint { margin: 0; }

/* share / success panel */
.share { text-align: center; }
.share .code-ticket {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 14px auto 22px; padding: 22px 40px; background: var(--ink); color: var(--paper);
  border-radius: 16px; position: relative; box-shadow: var(--shadow-lift);
}
.share .code-ticket::before, .share .code-ticket::after { content: ""; position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); transform: translateY(-50%); }
.share .code-ticket::before { left: -11px; } .share .code-ticket::after { right: -11px; }
.share .code-ticket .lbl { font-family: "Space Mono", monospace; font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; color: var(--marigold); }
.share .code-ticket .code { font-family: "Space Mono", monospace; font-size: 2rem; font-weight: 700; letter-spacing: .08em; }
@media (max-width: 480px) { .share .code-ticket { padding: 16px 22px; } .share .code-ticket .code { font-size: 1.45rem; letter-spacing: .06em; } }
.next-steps p:not(.eyebrow) { max-width: 30rem; margin: 0 auto 12px; }
.next-steps .share-actions { margin: 20px 0 4px; }
.share-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.qr-box { background: #fff; padding: 14px; border-radius: 14px; display: inline-block; border: 1px solid var(--line); }
.qr-box img, .qr-box svg { display: block; width: 180px; height: 180px; }
.no-email { margin-top: 20px; padding: 14px 18px; background: var(--ember-tint); border-radius: var(--radius-sm); color: var(--ember-deep); font-size: .9rem; }

/* ============================================================================
   Event view - heatmap + responses
   ========================================================================== */
.ev-hero { margin-bottom: 26px; }
.ev-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.ev-hero .desc { color: var(--ink-soft); margin-top: 10px; max-width: 60ch; }
/* Wraps on a narrow screen: a non-wrapping pill here once made every event page wider than a phone. */
/* Which clock the page's times are on: a line of text, and ✎ (a sheet) to pick another. */
.tz-line { margin: 14px 0 0; max-width: 100%; min-width: 0; font-size: .85rem; line-height: 1.5; color: var(--spruce-ink); background: var(--spruce-wash); padding: 6px 6px 6px 13px; border-radius: 18px; }
.tz-line .tz-name { font-weight: 600; overflow-wrap: anywhere; }
.tz-edit { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; width: 28px; height: 28px; margin-left: 4px; padding: 0; border: 1px solid var(--spruce-halo); border-radius: 50%; background: var(--card); color: var(--spruce-ink); cursor: pointer; }
@media (hover: hover) { .tz-edit:hover { border-color: var(--spruce-ink); } }
@media (pointer: coarse) { .tz-edit { width: 34px; height: 34px; } }
.zone-list { display: grid; gap: 4px; margin-top: 10px; max-height: 55vh; overflow-y: auto; }
.zone-opt { font: inherit; text-align: left; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.zone-opt.cur { border-color: var(--ink); font-weight: 600; }
@media (hover: hover) { .zone-opt:hover { border-color: var(--ink-soft); } }

.cancelled-box { border-color: var(--line); margin-bottom: 28px; }
.cancelled-box h2 { margin-bottom: 6px; }
.cancelled-box .cb-actions { margin: 12px 0 0; }
.scheduled-banner { display: flex; align-items: center; gap: 16px; padding: 22px 26px; background: linear-gradient(100deg, var(--spruce-wash), var(--spruce-wash-2)); border: 1px solid var(--spruce-edge); border-radius: var(--radius); margin-bottom: 24px; }
.scheduled-banner .big { font-family: "Fraunces", serif; font-size: 1.5rem; color: var(--spruce-ink); }
.scheduled-banner .ix { font-size: 2.2rem; }
.scheduled-banner .sb-main { min-width: 0; flex: 1; }
.scheduled-banner { align-items: flex-start; }
.sb-cal { margin-top: 12px; }
/* the meeting link (the calendar entries' link) under "from the organiser"; edited with the information */
.sb-info .sb-join { margin: 8px 0 0; overflow-wrap: anywhere; }
.sb-info .sb-join .eyebrow { margin-right: 4px; }
.sb-info .sb-join.hint { color: var(--ink-soft); font-size: .86rem; }
.details-form .meeting-field { margin-top: 12px; }
.meeting-field .hint { margin: 6px 0 0; }
/* "from the organiser" inside the box; the host's inline editor swaps in under the eyebrow */
.sb-info { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--spruce-edge); }
.sb-info .details-body { margin-top: 4px; }
.sb-info .sb-edit { margin-top: 8px; }
.sb-info .details-form { margin-top: 6px; }
.details-form .details-input { width: 100%; }
.details-form .hint { margin: 6px 0 0; }
.details-form-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sb-tools { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--spruce-edge); }
.sb-tools .win-list { margin-top: 0; }
.sb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sb-actions .btn[disabled] { opacity: .55; cursor: not-allowed; }

/* "From the organiser" */
.details-card { margin-bottom: 22px; }
.details-body { margin-top: 8px; font-size: .95rem; line-height: 1.55; }
.details-body p { margin: 0 0 .6em; } .details-body p:last-child { margin-bottom: 0; }
.details-body a { color: var(--ember-deep); text-decoration: underline; word-break: break-word; }
.details-body ul, .details-body ol { margin: 0 0 .6em 1.2em; }
.details-body code { font-family: "Space Mono", monospace; font-size: .85em; background: var(--paper-2); padding: 1px 4px; border-radius: 4px; }
.details-body h1, .details-body h2, .details-body h3 { font-size: 1.05rem; margin: .6em 0 .3em; }
.details-edit { margin-top: 10px; font-size: .9rem; }
.details-edit summary { cursor: pointer; color: var(--ember-deep); font-weight: 600; }
.details-edit .details-form { margin-top: 10px; }


.heat-legend { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--ink-soft); margin-top: 4px; }
.heat-legend .scale { display: flex; gap: 3px; }
.heat-legend .scale i { width: 16px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- availability panel (event page) ---------- */
.ev-when { color: var(--ink-soft); margin-top: 8px; font-size: .95rem; }
.avail-card { margin-bottom: 18px; }
.avail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.avail-head h2 { font-size: 1.4rem; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; user-select: none; }
.switch input { width: 18px; height: 18px; accent-color: var(--spruce); margin: 0; }
.closed-note { font-size: .95rem; color: var(--ink-soft); }
.tab-wrap { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tab-note { font-size: .8rem; color: var(--ink-soft); text-align: right; max-width: 24em; line-height: 1.3; }
.tab-note[hidden] { display: none; }
.seg { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px; }
.seg button { font: inherit; font-weight: 600; font-size: .86rem; border: none; background: transparent; color: var(--ink-soft); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.pane-hint { font-size: .88rem; margin: 0 0 10px; }
.composer .field { margin-bottom: 12px; }

/* paint level picker */
.levels { display: inline-flex; gap: 6px; }
.levels .lv { font: inherit; font-size: .82rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.levels .lv::before { content: ""; width: 12px; height: 12px; border-radius: 3px; }
.levels .lv.free::before { background: var(--spruce); }
.levels .lv.maybe::before { background: repeating-linear-gradient(135deg, var(--spruce) 0 3px, var(--maybe-stripe) 3px 6px); }
.levels .lv.nofree::before { background: var(--unmarked); box-shadow: inset 0 0 0 1px var(--unmarked-edge); }
.levels .lv.must::before { background: var(--marigold); }
.levels .lv.opt::before { background: var(--heat-2); }
.levels .lv[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); background: var(--card); box-shadow: 0 0 0 1px var(--ink); }

/* quick fill */
.qf { background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.qf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qf-row .input { width: auto; padding: 8px 10px; font-size: .9rem; }
.qf-w { font-size: .9rem; color: var(--ink-soft); }
.qf-lead { margin: 0 0 8px; font-size: .88rem; color: var(--ink); }

/* the grid */
.ag { --ag-row: 22px; --ag-gutter: 34px; user-select: none; -webkit-user-select: none; }
.ag-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ag-pager { display: inline-flex; align-items: center; gap: 6px; }
.ag-pager.single .ag-nav { display: none; }
.ag-page { font-family: "Space Mono", monospace; font-size: .8rem; color: var(--ink); min-width: 120px; text-align: center; }
.ag-nav { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--ink); }
.ag-nav:disabled { opacity: .35; cursor: default; }
.ag-tools { display: inline-flex; align-items: center; gap: 6px; }
.ag-zone { font: inherit; font-size: .8rem; max-width: 190px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
/* All 24 hours ⇄ the usual day: a raised marigold button in the grid's top-left corner. */
.ag-corner { display: flex; }
.ag-allday { flex: 1; display: flex; align-items: center; justify-content: center; margin: 4px 3px; padding: 0; border: 1px solid var(--marigold-deep); border-radius: 7px; background: var(--marigold); color: var(--on-marigold); cursor: pointer; box-shadow: 0 2px 0 var(--marigold-deep); }
.ag-allday:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--marigold-deep); }
.ag-allday[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
@media (hover: hover) { .ag-allday:hover { filter: brightness(1.06); } }
/* Show / hide the others' answers (guests): at the end of the Save row, on the right. */
.others-pill { font: inherit; font-size: .8rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.others-pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.others-pill[hidden] { display: none; }

/* Whole-range thumbnail above a multi-week edit grid: a tiny column per day, grouped by week. */
.ag-ov { margin: 0 0 10px; padding: 8px 10px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.ag-ov-cap { display: block; font-size: .8rem; color: var(--ink-soft); margin-bottom: 7px; }
.ag-ov-cap strong { color: var(--ink); }
/* "2 weeks have nothing marked yet": the part of the caption to act on */
.ag-ov-todo { display: inline-block; margin-top: 2px; padding: 2px 9px 2px 8px; border-radius: 6px; background: var(--ember-tint); color: var(--ember-deep); font-weight: 700; }
.ag-ov-todo::before { content: "⚠ "; }
.ag-ov-wks { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-ov-remind { margin-left: 8px; align-self: center; display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--marigold-wash); border: 1px solid var(--marigold-edge); font-size: .84rem; font-weight: 600; color: var(--ink); }
.ag-ov-remind-ic { font-size: 1.15rem; line-height: 1; flex-shrink: 0; }
.ag-ov-remind-txt > span { display: block; white-space: nowrap; }
.ag-ov-remind.nofit { visibility: hidden; position: absolute; }
@media (max-width: 640px) { .ag-ov-remind { display: none; } }
.ag-ov-wk { font: inherit; display: inline-flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 5px 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); cursor: pointer; color: var(--ink-soft); }
.ag-ov-wk:hover { border-color: var(--ink-soft); }
.ag-ov-wk.cur { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); color: var(--ink); }
.ag-ov-wk.empty { border-style: dashed; }
.ag-ov-cols { display: inline-flex; gap: 1px; }
.ag-ov-day { position: relative; width: 7px; height: 32px; background: var(--paper); border-radius: 1px; overflow: hidden; }
.ag-ov-day i { position: absolute; left: 0; width: 100%; display: block; }
.ag-ov-day i.p2 { background: var(--spruce); }
.ag-ov-day i.p1 { background: repeating-linear-gradient(135deg, var(--spruce) 0 2px, var(--maybe-stripe) 2px 4px); }
.ag-ov-day i.busy { background: var(--busy-b); opacity: .5; }
.ag-ov-day i.off { background: repeating-linear-gradient(135deg, var(--paper-2) 0 2px, var(--paper) 2px 4px); }
.ag-ov-day i.pad { background: var(--pad); }
/* heat grid's strip: the group gradient per day */
.ag-ov-day i.h1 { background: var(--heat-1); } .ag-ov-day i.h2 { background: var(--heat-2); } .ag-ov-day i.h3 { background: var(--heat-3); }
.ag-ov-day i.h4 { background: var(--heat-4); } .ag-ov-day i.h5 { background: var(--heat-5); }
.ag-ov-day i.hb { background: repeating-linear-gradient(135deg, var(--hatch-must) 0 1px, var(--hatch-must-bg) 1px 3px); }
.ag-ov-day i.blocked { background: repeating-linear-gradient(45deg, var(--hatch-soft) 0 1px, var(--unmarked) 1px 3px); }
/* a remembered calendar in the import sheet: the row plus a forget button */
.saved-list { display: grid; gap: 8px; margin-bottom: 14px; }
.saved-row { display: flex; align-items: center; gap: 6px; }
.saved-row .prov-btn { flex: 1; }
.saved-head { margin: 0 0 6px; }
.remember-row { margin-top: 10px; }
.remember-row .hint { margin: 4px 0 0 26px; }
.ag-ov-lbl { font-family: "Space Mono", monospace; font-size: .6rem; line-height: 1; white-space: nowrap; }

.ag-grid {
  display: grid;
  grid-template-columns: var(--ag-gutter) repeat(var(--ag-cols, 7), minmax(0, 1fr));
  /* The day headers' row grows with larger text (two time rows tall at least); the time rows don't. */
  grid-template-rows: minmax(calc(var(--ag-row) * 2), auto);
  grid-auto-rows: var(--ag-row);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card);
}
.ag-corner { background: var(--paper-2); }
.ag-day { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; background: var(--paper-2); border-left: 1px solid var(--line-soft); padding: 4px 0; font-size: .74rem; }
/* Rows are for screen readers only (role="row"): the CSS grid places their cells directly. */
.ag-row { display: contents; }
.ag-day .wd { font-weight: 700; }
.ag-day .dm { color: var(--ink-soft); font-size: .68rem; }
.ag-time { font-family: "Space Mono", monospace; font-size: .66rem; color: var(--ink-soft); text-align: right; padding-right: 5px; line-height: 1; transform: translateY(-4px); background: var(--paper-2); }
.ag-time.hr { color: var(--ink-soft); }
/* The heat grid scrolls under a finger (taps pick a time). The paintable cells of an edit grid
   don't: a finger paints there, and press-and-hold then move scrolls (avail.js) - the times down
   the left and the greyed-out days scroll as usual. */
.ag-cell { position: relative; border-left: 1px solid var(--line-soft); border-top: 1px dotted var(--line-soft); background: var(--card); touch-action: manipulation; cursor: pointer; }
/* An unmarked time on the grid you paint counts as busy, so it isn't white: a pale clay. */
.ag-edit .ag-cell { -webkit-touch-callout: none; background: var(--unmarked); }
.ag-edit .ag-cell:not(.off) { touch-action: none; }
/* a press-and-hold has switched this touch to scrolling: say so on the grid */
.ag-grid.ag-scrolling { box-shadow: 0 0 0 2px var(--spruce); }
/* Title of an imported-calendar block, drawn in its first cell and sized to the block. */
.ag-cell .busy-lbl { position: absolute; left: 0; top: 0; width: 100%; box-sizing: border-box; padding: 1px 2px; font-size: .7rem; line-height: 1.15; font-weight: 600; color: var(--busy-ink); text-shadow: 0 1px 0 rgba(0,0,0,.35); overflow: hidden; overflow-wrap: break-word; pointer-events: none; z-index: 1; }
.ag-cell.hr { border-top: 1px solid var(--line); }
.ag-cell:focus { outline: none; }
.ag-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; z-index: 2; }
.ag-cell:focus-visible::before { content: ""; position: absolute; inset: 2px; border: 2px solid #fff; pointer-events: none; z-index: 3; }
/* The grid's keyboard help: for screen readers always, on screen from the moment the grid is first
   used from a keyboard (.ag-kb, avail.js) - and then it stays. Hiding it again as focus left made
   everything below jump up under the pointer, so a click on Save landed on the note below it. */
.ag-keys { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ag-kb .ag-keys { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; margin: 6px 0 0; font-size: .78rem; color: var(--ink-soft); }
/* Diagonal patterns (hatches, stripes) line up across neighbouring cells: each cell shows its part of
   one big pattern anchored at the grid's corner, not a fresh copy starting at its own corner, so a
   block of hatched cells reads as one surface. --d / --r are the cell's column and row (avail.js);
   a column is (grid width - gutter) / columns wide, measured against the grid (100cqw). */
.ag-grid { container-type: inline-size; }
.ag-cell { --at: calc(var(--d, 0) * (var(--ag-gutter) - 100cqw) / var(--ag-cols, 7)) calc(var(--r, 0) * -1 * var(--ag-row)) / 4000px 4000px; }
/* Without container units the patterns just start at each cell's corner, as before. */
@supports not (width: 1cqw) { .ag-cell { --at: 0 0; } }
.ag-cell.off { background: repeating-linear-gradient(135deg, var(--paper-2) 0 4px, var(--paper) 4px 8px) var(--at); cursor: default; }
/* Days before the first / after the last date: flat grey, never markable, so the week reads as a calendar week. */
.ag-cell.pad { background: var(--pad); border-top-color: var(--pad-edge); }
.ag-day.pad { color: var(--ink-faint); }
.ag-day.pad .wd { font-weight: 500; }
/* edit mode */
.ag-edit .ag-cell.p2 { background: var(--spruce); border-top-color: rgba(255,255,255,.18); }
.ag-edit .ag-cell.p1 { background: repeating-linear-gradient(135deg, var(--spruce) 0 3px, var(--maybe-stripe) 3px 6px) var(--at); }
/* this person's own imported calendar - hard-blocked, tap to inspect */
.ag-edit .ag-cell.busy { background: repeating-linear-gradient(135deg, var(--busy-a) 0 4px, var(--busy-b) 4px 8px) var(--at); border-top-color: rgba(255,255,255,.12); cursor: pointer; }
@media (hover: hover) { .ag-edit .ag-cell.busy:hover { box-shadow: inset 0 0 0 2px var(--marigold); } }
/* A calendar event covers PART of this half hour: still paintable, but the group won't count it as free. */
.ag-edit .ag-cell.busy-part { box-shadow: inset 4px 0 0 var(--busy-a); }
.busy-legend .sw { width: 16px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.busy-legend .sw.busy { background: repeating-linear-gradient(135deg, var(--busy-a) 0 4px, var(--busy-b) 4px 8px); }
/* someone ELSE can't make this cell - still paintable, but it won't be picked */
/* A MUST-ATTEND person is busy: warm graphite hatch - "closed", not "danger". Lighter than
   your own imported-calendar cells (.busy) so the two stay distinct; still paintable. */
/* On your own grid a must-attend clash is a light hatch over the unmarked colour - information,
   not a wall: you can still paint over it (the heat grid keeps the strong hatch). */
.ag-edit .ag-cell.hard { background: repeating-linear-gradient(135deg, var(--hatch-hard) 0 2px, var(--unmarked) 2px 7px) var(--at); border-top-color: rgba(255,255,255,.14); }
/* ...and your own paint over it reads as your paint, with just a trace of the hatch. */
.ag-edit .ag-cell.hard.p2 { background: repeating-linear-gradient(135deg, rgba(255,255,255,.2) 0 2px, transparent 2px 8px) var(--at), var(--spruce); }
.ag-edit .ag-cell.hard.p1 { background: repeating-linear-gradient(135deg, var(--spruce) 0 3px, var(--maybe-stripe) 3px 6px) var(--at); }
.ag-edit .ag-cell.blocked { background: repeating-linear-gradient(45deg, var(--hatch-soft) 0 1.5px, var(--unmarked) 1.5px 7px) var(--at); }
/* Guest's "show others' availability": the group gradient under unpainted cells. */
.ag-edit .ag-cell.h1:not(.p1):not(.p2) { background: var(--heat-1); }
.ag-edit .ag-cell.h2:not(.p1):not(.p2) { background: var(--heat-2); }
.ag-edit .ag-cell.h3:not(.p1):not(.p2) { background: var(--heat-3); }
.ag-edit .ag-cell.h4:not(.p1):not(.p2) { background: var(--heat-4); }
.ag-edit .ag-cell.h5:not(.p1):not(.p2) { background: var(--heat-5); }
.ag-edit .ag-cell.blocked.p2 { background: repeating-linear-gradient(45deg, var(--blocked-line) 0 2px, transparent 2px 6px) var(--at), var(--blocked-paint); }
.ag-edit .ag-cell.blocked.p1 { background: repeating-linear-gradient(45deg, var(--blocked-line) 0 2px, transparent 2px 6px) var(--at), repeating-linear-gradient(135deg, var(--blocked-paint) 0 3px, var(--blocked-stripe) 3px 6px) var(--at); }
.blocked-legend .sw { width: 16px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.blocked-legend .sw.blocked { background: repeating-linear-gradient(45deg, var(--hatch-soft) 0 1.5px, var(--unmarked) 1.5px 7px); border: 1px solid var(--line); }
.heat-legend .sw.hard { width: 16px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; background: repeating-linear-gradient(135deg, var(--hatch-must) 0 1.5px, var(--hatch-must-bg) 1.5px 7px); }
.heat-legend .sw.hard.soft { background: repeating-linear-gradient(135deg, var(--hatch-hard) 0 2px, var(--unmarked) 2px 7px); box-shadow: inset 0 0 0 1px var(--hatch-edge); }
@media (hover: hover) { .ag-edit .ag-cell:not(.off):hover { box-shadow: inset 0 0 0 2px var(--marigold); } }
/* heat mode */
.ag-heat .ag-cell.h0 { background: var(--heat-0); }
.ag-heat .ag-cell.h1 { background: var(--heat-1); }
.ag-heat .ag-cell.h2 { background: var(--heat-2); }
.ag-heat .ag-cell.h3 { background: var(--heat-3); }
.ag-heat .ag-cell.h4 { background: var(--heat-4); }
.ag-heat .ag-cell.h5 { background: var(--heat-5); }
.ag-heat .ag-cell.all { background: var(--heat-all); }
/* "Everyone can make it": a check mark, not just a shade darker than the step below. */
.ag-heat .ag-cell.all::after, .heat-legend .scale i.all::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 8px;
  border: solid var(--all-mark); border-width: 0 2.5px 2.5px 0;
  transform: translate(-50%, -62%) rotate(45deg);
}
/* A must-attend clash: dark lines on light, a texture no shade of green has. */
.ag-heat .ag-cell.hb { background: repeating-linear-gradient(135deg, var(--hatch-must) 0 1.5px, var(--hatch-must-bg) 1.5px 7px) var(--at); }
/* The chosen time: ember edges with a light line inside, so they show on pale and dark cells alike. */
.ag-heat .ag-cell.sel { box-shadow: inset 3px 0 0 var(--ember), inset -3px 0 0 var(--ember), inset 4px 0 0 #fff, inset -4px 0 0 #fff; }
.ag-heat .ag-cell.sel-start { box-shadow: inset 3px 3px 0 var(--ember), inset -3px 0 0 var(--ember), inset 4px 4px 0 #fff, inset -4px 0 0 #fff; }
@media (hover: hover) { .ag-heat .ag-cell:not(.off):hover { filter: brightness(.93); } }
.heat-legend { margin-top: 8px; }
.heat-legend .scale i.h0 { background: var(--heat-0); } .heat-legend .scale i.h1 { background: var(--heat-1); } .heat-legend .scale i.h2 { background: var(--heat-2); }
.heat-legend .scale i.h3 { background: var(--heat-3); } .heat-legend .scale i.h4 { background: var(--heat-4); } .heat-legend .scale i.h5 { background: var(--heat-5); }
/* The far end: the grid's "everyone can make it" cell, with its check mark (the .all rule above). */
.heat-legend .scale i.all { position: relative; background: var(--heat-all); }
@media (max-width: 600px) {
  .ag { --ag-row: 19px; --ag-gutter: 28px; }
  .ag-day { font-size: .68rem; }
  .ag-day .dm { font-size: .6rem; }
  .ag-time { font-size: .6rem; }
  .ag-zone { max-width: 150px; }
  .avail-card { padding: 14px; }
}

/* ---------- imported calendars (Me tab) ---------- */
.cal-block { margin: 2px 0 14px; padding: 12px 14px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cal-list { display: grid; gap: 8px; margin-top: 10px; }
.cal-empty { margin: 8px 0 0; }
.cal-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: start; padding: 10px 12px; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.cal-row .cal-items-wrap { grid-column: 1 / -1; font-size: .84rem; }
.cal-row .cal-items-wrap summary { cursor: pointer; color: var(--ember-deep); font-weight: 600; font-size: .82rem; }
.cal-row.err { border-color: var(--ember); }
.cal-glyph { width: 32px; height: 32px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; }
.cal-main { min-width: 0; }
.cal-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-meta { font-size: .78rem; color: var(--ink-soft); }
.cal-privacy { margin: 8px 0 0; font-size: .8rem; line-height: 1.4; }
.cal-readonly { margin: 10px 0 0; font-size: .8rem; line-height: 1.4; }
.cal-items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.ci-nohint { color: var(--ink-faint); font-weight: 400; font-size: .78rem; }
.cal-item { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; font-size: .84rem; padding: 4px 0; border-top: 1px dotted var(--line-soft); }
.cal-item .ci-when { font-family: "Space Mono", monospace; font-size: .74rem; color: var(--ink-soft); white-space: nowrap; }
.cal-item .ci-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.cal-item.tentative .ci-title { font-weight: 500; font-style: italic; }
.cal-item .chip-x { font-size: 1.05rem; min-width: 24px; min-height: 24px; }
.cal-actions { display: inline-flex; gap: 6px; }
@media (max-width: 480px) { .cal-actions .btn { padding-left: 8px; padding-right: 8px; } }
.others-toggle { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 6px; font-size: .86rem; color: var(--ink-soft); }
.others-toggle .others-count { font-weight: 600; }

/* Loud "you haven't sent this yet" bar: fixed to the bottom of the viewport while the grid
   (or name) differs from what was last sent. */
.unsaved-bar { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); width: min(calc(100% - 24px), 520px); z-index: 8000; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: var(--radius); background: var(--ember); color: #fff; box-shadow: 0 18px 40px -14px rgba(206,68,33,.6), var(--shadow); animation: unsaved-in .25s var(--ease); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.unsaved-bar.dragging { cursor: grabbing; animation: none; box-shadow: 0 24px 48px -16px rgba(40,28,12,.6); }
.unsaved-bar[hidden] { display: none; }
.unsaved-bar .ub-grip { font-size: 1rem; line-height: 1; opacity: .7; letter-spacing: -2px; flex-shrink: 0; }
.unsaved-bar .ub-text { flex: 1; }
.unsaved-bar .btn { cursor: pointer; }
.unsaved-bar .ub-text { font-size: .92rem; line-height: 1.3; }
.unsaved-bar .ub-text strong { font-family: "Space Mono", monospace; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
.unsaved-bar .btn-primary { background: #fff; color: var(--ember-strong); border-color: #fff; white-space: nowrap; }
.composer.is-dirty button[type="submit"] { box-shadow: 0 0 0 4px var(--ember-tint); animation: unsaved-pulse 1.6s ease-in-out infinite; }
@keyframes unsaved-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes unsaved-pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--ember-tint); } 50% { box-shadow: 0 0 0 8px rgba(206,68,33,.18); } }
@media (prefers-reduced-motion: reduce) { .unsaved-bar, .composer.is-dirty button[type="submit"] { animation: none; } }
.cal-removed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .84rem; }
.cal-removed .hint { margin: 0; }
.chip .chip-x { border: none; background: transparent; cursor: pointer; font-size: .95rem; line-height: 1; color: var(--ember-deep); padding: 0 2px; min-width: 24px; min-height: 24px; }
.busy-detail { border-color: var(--busy-edge); }
.cal-safe { margin: 8px 0 0; padding: 8px 10px; background: var(--spruce-wash); border-radius: 8px; font-size: .86rem; color: var(--spruce-ink); }

/* bottom sheet (phone) / centred dialog (desktop) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 9000; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: var(--card); width: 100%; max-width: 560px; max-height: 88vh; max-height: 88dvh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 18px calc(24px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-lift); animation: sheet-up .25s var(--ease); }
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: var(--radius); padding: 22px 24px; } }
.sheet:focus { outline: none; }   /* focused so keyboard and screen-reader users start inside it; the box needs no ring */
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h3 { font-size: 1.3rem; }
.sheet-x { border: none; background: var(--paper-2); width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.prov-list { display: grid; gap: 8px; }
.prov-btn { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; padding: 11px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); }
.prov-btn:hover { border-color: var(--ink); }
a.prov-btn { text-decoration: none; box-sizing: border-box; }
.prov-btn[disabled] { opacity: .55; cursor: not-allowed; }
.prov-sub { font-weight: 400; color: var(--ink-soft); font-size: .86rem; }
.prov-glyph { width: 34px; height: 34px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.prov-name { font-weight: 600; }
.prov-arrow { color: var(--ink-faint); font-size: 1.2rem; }
.prov-title { font-size: 1.1rem; margin: 10px 0 6px; }
.steps { margin: 0 0 8px; padding-left: 20px; font-size: .92rem; display: grid; gap: 4px; }
.sheet-err { color: var(--ember-deep); font-size: .86rem; margin: 6px 0 10px; }

/* tapped window detail */
.win-detail { margin-top: 12px; padding: 12px 14px; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); font-size: .9rem; }
.win-when .alt { color: var(--ink-soft); font-size: .82rem; }
.win-count { margin-top: 4px; font-family: "Space Mono", monospace; font-size: .82rem; color: var(--ink-soft); }
.win-count.everyone { color: var(--marigold-ink); }
.win-count.hard-note { color: var(--ink); font-family: inherit; font-size: .88rem; }
.win-list { margin-top: 8px; display: grid; gap: 4px; font-size: .86rem; }
.win-list .k { display: inline-block; min-width: 76px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }
.win-list .k.free { color: var(--spruce); } .win-list .k.maybe { color: var(--marigold-ink); } .win-list .k.busy { color: var(--ink-faint); }

.attendee-block { margin-bottom: 18px; }
.attendee-block.top { margin: 14px 0 6px; }   /* the copy in the organiser's page header */
.attendees { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line-soft); font-size: .84rem; }
.chip .st { width: 7px; height: 7px; border-radius: 50%; }
.chip .st.ready { background: var(--spruce); } .chip .st.touched { background: var(--marigold); } .chip .st.pending { background: var(--ink-faint); }

/* finalize panel (creator) */
.finalize { border: 1.5px dashed var(--marigold); background: var(--marigold-wash); }
.finalize h2 { color: var(--marigold-ink); }
.rank { display: grid; gap: 8px; margin: 12px 0; }
.rank-row:hover { border-color: var(--ink-soft); }
.rank-row.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-color: var(--ink-soft); }
.rank-detail { padding: 10px 12px 12px; border: 1px solid var(--ink-soft); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--paper-2); }
.rank-who .out { font-weight: 600; color: var(--ember-deep); }
.rank-who .out .k.busy { color: var(--ember-deep); }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 0 12px 0 0; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line-soft); }
.rank-toggle { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0 10px 12px; font: inherit; color: inherit; text-align: left; background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.rank-row .pos { font-family: "Space Mono", monospace; font-weight: 700; color: var(--ember-deep); }
.rank-row .sc { font-family: "Space Mono", monospace; font-size: .85rem; color: var(--ink-soft); }
.rank-row .when { display: flex; flex-direction: column; }
.rank-row .when .sub { font-size: .76rem; color: var(--ink-soft); font-weight: 400; }
.rank-row.everyone { border-color: var(--marigold); }
.rank-row .star { color: var(--marigold-ink); }
@media (max-width: 520px) { .rank-toggle { grid-template-columns: auto 1fr; } .rank-toggle .sc { grid-column: 2; font-size: .78rem; } }
.range-edit { margin: 12px 0 4px; font-size: .9rem; }
.range-edit summary { cursor: pointer; color: var(--ember-deep); font-weight: 600; }
.range-edit .field-row { margin-top: 10px; }
.owner { margin-top: 4px; }

/* Organiser's share + named-guest block (top of the event page, and the post-create screen). */
.share-block { margin-bottom: 22px; }
.link-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--paper-2); border: 1px solid var(--line-soft); margin-top: 8px; }
.link-row .lk-main { min-width: 0; }
.link-row .lk-title { font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.link-row .lk-sub { color: var(--ink-soft); font-size: .78rem; margin-top: 2px; }
.link-row .lk-url, .qr-sheet .lk-url { font-family: "Space Mono", monospace; font-size: .74rem; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row .lk-actions { display: flex; gap: 6px; }
.qr-sheet { text-align: center; }
.qr-sheet .sheet-head { text-align: left; }
.qr-sheet .qr-box img { width: 220px; height: 220px; }
.qr-sheet .btn { margin: 0 auto; }
.qr-sheet > div:last-child { justify-content: center; }
.tier { display: inline-flex; align-items: center; gap: 5px; line-height: 1; font-family: "Space Mono", monospace; font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); background: var(--card); vertical-align: middle; }
.tier.must { border-color: var(--marigold-deep); color: var(--marigold-ink); }
/* The star is a pseudo-element with its own metrics so it centres on the pill regardless of the
   monospace font's glyph baseline (a literal ★ in the text sat visibly low). */
.tier.must::before { content: "★"; font-family: system-ui, sans-serif; font-size: 1.15em; line-height: 1; display: inline-block; transform: translateY(-.04em); }
.tier.dot { width: 16px; height: 16px; padding: 0; justify-content: center; gap: 0; letter-spacing: 0; box-sizing: border-box; }
.tier.dot::before { font-size: .62rem; transform: none; letter-spacing: 0; }
.invite-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.invite-form .textarea { min-height: 72px; }
.invite-form .lvl-row { margin: 8px 0 10px; }
.invite-list { display: grid; gap: 6px; margin-top: 10px; }
/* password protection (organiser block) */
.pw-block { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.pw-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pw-row .input { flex: 1 1 200px; max-width: 320px; }
.tier.pw-on { background: var(--spruce); color: var(--on-spruce); border-color: var(--spruce); margin-left: 8px; }
.lock-wrap { max-width: 440px; }
.invite-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line-soft); font-size: .9rem; }
.invite-row .iv-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.invite-row .iv-meta { color: var(--ink-soft); font-size: .78rem; margin-top: 2px; }
.invite-row .iv-actions { display: flex; gap: 6px; }
.chip .tier { margin-left: 2px; }
@media (max-width: 480px) {
  .link-row, .invite-row { grid-template-columns: 1fr; }
  .invite-row .iv-actions { justify-content: flex-start; }
}

.loading { text-align: center; padding: 80px 20px; color: var(--ink-faint); }
.loading .ring { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--ember); border-radius: 50%; margin: 0 auto 14px; animation: spin .8s linear infinite; }

/* ============================================================================
   Pricing + legal pages
   ========================================================================== */
.sitefoot .footnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 10px; }
.sitefoot .footnav a { color: var(--ink-soft); display: inline-block; min-height: 24px; padding: 2px 0; }
/* "Report a bug" (js/app.js): a button, as it opens a new tab, that reads like the links beside it. */
.sitefoot .footnav .footlink { color: var(--ink-soft); min-height: 24px; padding: 2px 0; background: none; border: 0; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.pricing-head { margin-bottom: clamp(22px, 4vw, 36px); }
.pricing-head h1, .pricing-head .lede { max-width: 640px; }
.pricing-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.pricing-head h1 .swash { font-style: italic; color: var(--ember); }
.pricing-head .lede { color: var(--ink-soft); font-size: 1.08rem; margin: 14px 0 0; max-width: 52ch; }
.beta-ribbon { display: inline-block; max-width: 100%; margin-top: 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--marigold-wash); border: 1.5px dashed var(--marigold); color: var(--ink); font-size: .92rem; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: stretch; }
.plan-head { display: flex; flex-direction: column; gap: 8px; }
.plan-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }   /* the wide cards' right-hand side; stacked like the others when narrow */
/* Desktop: Free across the top, Basic / Pro / Max in a row, Unlimited across the bottom -
   the two wide cards laid out sideways: name and price | limits | features | button. */
@media (min-width: 900px) {
  .plan-grid { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }   /* room for the "yours during the beta" flag */
  .plan.plan-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(200px, 1fr) 2.2fr; gap: 0 28px; align-items: stretch; }
  .plan-wide .plan-tag { min-height: 0; }
  .plan-wide .plan-body { display: flex; flex-direction: column; gap: 12px; padding-left: 28px; border-left: 1px solid var(--line-soft); }
  .plan-wide .plan-caps { display: flex; flex-wrap: wrap; gap: 0; padding: 0 0 10px; border-top: none; }
  .plan-wide .plan-caps li + li::before { content: "·"; margin: 0 10px; color: var(--ink-faint); }
  .plan-wide .plan-features { display: flex; flex-wrap: wrap; gap: 6px 22px; flex: 0 0 auto; }
  .plan-wide .plan-btn { margin-top: auto; align-self: flex-end; }
}
.plan { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 20px; }
.plan-beta { border-color: var(--spruce); box-shadow: 0 0 0 3px var(--spruce-wash), var(--shadow-lift); }
.plan-flag { position: absolute; top: -11px; left: 16px; background: var(--spruce); color: var(--on-spruce); font-family: "Space Mono", monospace; font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.plan-name { font-family: "Fraunces", serif; font-size: 1.5rem; font-weight: 600; }
.plan-tag { font-size: .86rem; margin: 0; min-height: 2.6em; }
.plan-price { position: relative; display: flex; align-items: baseline; gap: 3px; margin: 4px 0 6px; }
.plan-price .amt { font-family: "Fraunces", serif; font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.plan-price .per { color: var(--ink-soft); font-size: .9rem; }
/* "paid annually": tucked just under the amount, in the gap above the limits - it takes no room of its own,
   so the card lines up with the others */
.plan-price .plan-note { position: absolute; left: 0; top: 100%; margin-top: -5px; line-height: 1.2; white-space: nowrap; font-size: .72rem; letter-spacing: .02em; color: var(--ink-soft); }
.plan-caps { list-style: none; margin: 0; padding: 10px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-weight: 600; font-size: .9rem; display: grid; gap: 4px; }
.plan-features { list-style: none; margin: 0; padding: 0; font-size: .86rem; color: var(--ink-soft); display: grid; gap: 6px; flex: 1; align-content: start; }   /* packed at the top; the space goes under them */
.plan-features li::before { content: "✓ "; color: var(--spruce); font-weight: 700; }
.plan-btn { margin-top: 8px; align-self: flex-start; }
.pricing-faq { margin-top: 28px; }
.pricing-faq h2 { font-size: 1.4rem; margin-bottom: 8px; }
.faq { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; font-size: .92rem; }
.pricing-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 26px; }
.legal { max-width: 720px; margin: 0 auto; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 4px 0 6px; }
.legal-updated { font-size: .88rem; margin-bottom: 18px; }
.legal-body section + section { margin-top: 22px; }
.legal-body h2 { font-size: 1.2rem; margin-bottom: 6px; }
.legal-body p { margin: 0 0 .7em; font-size: .95rem; line-height: 1.6; }
.legal-body p:last-child { margin-bottom: 0; }
.legal-foot { margin-top: 18px; font-size: .9rem; }

/* ============================================================================
   Beta: sign-up gate, invitations
   ========================================================================== */
.beta-wrap { max-width: 480px; }
.beta-card { margin-top: 4px; }
.beta-lede { margin: 0 0 16px; font-size: 1.02rem; line-height: 1.5; }
.beta-form .field { margin-bottom: 12px; }
.beta-thanks { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--spruce-wash); color: var(--spruce-ink); font-weight: 600; }
.beta-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--ink-faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; }
.beta-or::before, .beta-or::after { content: ""; flex: 1; border-top: 1px solid var(--line-soft); }
.beta-have { width: 100%; }
.beta-code { margin-top: 14px; }
.beta-code .lk-title { font-weight: 600; margin: 0; }
.beta-code .hint { margin: 2px 0 10px; font-size: .84rem; color: var(--ink-soft); }
.beta-code .codejump { margin-top: 0; max-width: none; }
.beta-code .codejump .btn { white-space: nowrap; }
.beta-code .codejump .input { text-transform: none; }
.invite-note { margin: 0 0 24px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--marigold-wash); border: 1.5px dashed var(--marigold); font-size: .95rem; }
.invite-card { margin-top: 18px; margin-bottom: 18px; }
.invite-card.compact { margin-top: 24px; }
.invite-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.invite-sub { font-size: .88rem; margin: 6px 0 0; max-width: 56ch; }
.invite-count { font-family: "Space Mono", monospace; font-size: .74rem; color: var(--spruce-ink); background: var(--spruce-wash); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.invite-card .link-row { margin-top: 10px; }
.invite-card .hint { font-size: .8rem; color: var(--ink-soft); margin: 8px 0 0; }

/* ============================================================================
   Live updates
   ========================================================================== */
.ev-banners { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* connection indicator at the far right of the header: green = socket open, grey = not */
/* pinned to the header's right edge, outside the nav's own padding; half the size of a nav glyph */
.ws-dot { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--ink-faint); cursor: help; transition: background .3s; }
.ws-dot.connecting { animation: live-blink 1.2s ease-in-out infinite; }
.ws-dot.on { background: var(--spruce); box-shadow: 0 0 0 2px var(--spruce-halo); }
@media (max-width: 600px) { .ws-dot { right: 6px; } }
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ws-dot.connecting { animation: none; } }

/* ---------- browser notifications (event header) ---------- */
.notify-ctl { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.notify-ctl[hidden] { display: none; }
.notify-btn { font: inherit; font-size: .8rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer; }
.notify-btn:hover { border-color: var(--ink); color: var(--ink); }
.notify-btn.on { background: var(--marigold-wash); border-color: var(--marigold); color: var(--marigold-ink); }
.notify-every { font-size: .8rem; }


/* ---- data retention: what every visitor is told, the organiser's card, guest actions ---- */
.keep-note { font-size: .82rem; color: var(--ink-soft); margin: 8px 0 0; }
.keep-note a { color: inherit; text-decoration: underline; }
.retention-card { margin-top: 14px; }
.retention-card > summary { cursor: pointer; list-style: none; }
.retention-card > summary::-webkit-details-marker { display: none; }
.retention-card[open] > summary .muted { display: none; }
.retention-card .btn { margin-top: 8px; }
/* [Save] ... [Show others]; wrap-reverse puts Show others ABOVE Save when the row is too narrow. */
.composer-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap-reverse; align-items: center; }
.composer-actions .btn-primary { min-width: 120px; }
.composer-actions .others-pill { margin-left: auto; }
.next-note { margin: 8px 0 0; font-size: .86rem; color: var(--ink-soft); }
.remove-row { margin-top: 10px; }
.btn.remove-mine { --fg: var(--ember-deep); }

/* ============================================================================
   Phones and touch screens
   ========================================================================== */
/* A finger needs room, and iOS Safari zooms into any control under 16px (and stays zoomed). */
@media (pointer: coarse) {
  .input, .textarea, select.input, .ag-zone, .qf-row .input, .mde-box { font-size: 16px; }
  .btn-sm, .notify-btn, .levels .lv, .seg button, .others-pill { min-height: 40px; }
  .switch { min-height: 40px; }   /* the label is the target, not the 18px box inside it */
  .ag-nav, .sheet-x { width: 40px; height: 40px; }
  .mde-btn { min-width: 36px; height: 36px; }
  .chip .chip-x, .cal-item .chip-x { min-width: 32px; min-height: 32px; }
  .sitefoot .footnav a, .sitefoot .footnav .footlink { padding: 8px 4px; }
}

/* The "Unsaved changes" bar on a phone: docked along the bottom edge, one line, not draggable
   (a finger dragging it fights the page). Toasts and the page's end make room for it. */
@media (max-width: 640px) {
  .unsaved-bar { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; transform: none !important; padding: 8px 8px 8px 14px; cursor: default; touch-action: auto; }
  .unsaved-bar .ub-grip, .unsaved-bar .ub-long { display: none; }
  body.has-unsaved .toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  body.has-unsaved .sitefoot { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
}

/* Calendar import and quick fill: <details> that start closed on a phone, open on a wide screen. */
.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: .92rem; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "▾"; margin-left: auto; color: var(--ink-soft); transition: transform .2s; }
.fold[open] > summary::after { transform: rotate(180deg); }
.fold > summary .fold-sub { font-weight: 400; color: var(--ink-soft); font-size: .84rem; }
.fold[open] > summary { margin-bottom: 10px; }
.qf.fold > summary { color: var(--ink); }

/* "Coming back to this?" - a guest's way back to their answer: this browser, the private link, email */
.return-card { margin-top: 14px; }
.return-card > p { margin: 6px 0 0; }
.return-card .eyebrow { margin: 0; }
.return-card .lk-title { font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.return-card .rc-field { margin-top: 12px; }
.return-card .rc-field label { display: flex; align-items: center; gap: 6px; }
.rc-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.rc-row .input { flex: 1 1 200px; min-width: 0; }
.rc-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--paper-2); border: 1px solid var(--line-soft); }
.rc-link .lk-url { font-family: "Space Mono", monospace; font-size: .74rem; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-link .lk-actions, .tier-link .lk-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rc-email { margin-top: 4px; }
.rc-sent { margin: 14px 0 0; }
.rc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.rc-elsewhere { margin-top: 12px; }
.rc-lookup { margin-top: 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--paper-2); }
.rc-lookup > .hint:first-child { margin-top: 0; }
.rc-done { color: var(--spruce-ink); font-weight: 600; }
@media (max-width: 640px) { .rc-link { grid-template-columns: 1fr; } }
/* the organiser's copy of one person's private link (the people list's sheet) */
.tier-link { margin-top: 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--paper-2); }
.tier-link .lk-title { font-weight: 600; font-size: .9rem; }
.tier-link .hint { margin: 2px 0 8px; }

/* "📅 My events (N)" - every page but an event page, while this browser remembers an answer */
.my-events-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 900;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--spruce); color: var(--on-spruce); font-weight: 600; font-size: .92rem; text-decoration: none; box-shadow: var(--shadow); }
.my-events-fab .fab-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--on-spruce); color: var(--spruce); font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; }
.my-events-fab:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; }
body.has-fab .sitefoot { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 640px) { body.has-fab .toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* #/my */
.my-events { max-width: 640px; margin: 4vh auto 0; }
.my-events h1 { margin: 2px 0 4px; }
.me-list { display: grid; gap: 8px; margin-top: 16px; }
.me-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.me-row .me-main { min-width: 0; display: grid; gap: 2px; }
.me-row .me-name { overflow-wrap: anywhere; }
.me-row .me-meta { color: var(--ink-soft); font-size: .84rem; }
.me-state { font-size: .74rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; background: var(--paper-2); color: var(--ink-soft); }
.me-state.done, .me-state.picked { background: color-mix(in srgb, var(--spruce) 14%, transparent); color: var(--spruce-ink); }
.me-state.todo { background: color-mix(in srgb, var(--ember) 16%, transparent); color: var(--ember-deep); }
@media (hover: hover) { .me-row:hover { border-color: var(--spruce); } }
.me-earlier { margin-top: 16px; }
.me-earlier > summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.me-only-here { margin-top: 14px; }
.me-email { margin-top: 18px; }
.me-email h2 { margin: 0 0 4px; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
/* "Report a bug" (views/bug-report-sheet.js). */
.bug-intro { color: var(--ink-soft); font-size: .92rem; margin: 0 0 14px; }
.shot-field .label-like { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.shot-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.shot-list:empty { display: none; }
.shot-list li { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.shot-list img { width: 96px; height: 72px; object-fit: cover; border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--paper-2); }
.shot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bug-details { margin: 4px 0 12px; font-size: .86rem; color: var(--ink-soft); }
.bug-details summary { cursor: pointer; min-height: 24px; }
.bug-details pre { max-height: 220px; overflow: auto; margin: 8px 0 0; padding: 10px; background: var(--paper-2); border-radius: var(--radius-sm); font: .74rem/1.4 "Space Mono", monospace; white-space: pre-wrap; word-break: break-word; }
/* Out of the picture while "Capture this tab" takes its frame. */
.sheet-backdrop.is-capturing { visibility: hidden; }

/* The beta welcome (views/beta-welcome.js): meant to be noticed - a striped band, an ember edge, a big heading. */
.beta-welcome-sheet { display: flex; flex-direction: column; border-top: 6px solid var(--ember); }
.beta-welcome-sheet .bw-band { order: -1; margin: -16px -18px 14px; padding: 14px 18px; background: repeating-linear-gradient(-45deg, var(--marigold) 0 14px, var(--marigold-deep) 14px 28px); }
@media (min-width: 640px) { .beta-welcome-sheet .bw-band { margin: -22px -24px 16px; padding: 16px 24px; } }
.bw-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); font-family: "Space Mono", monospace; font-size: .8rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.beta-welcome-sheet .sheet-head h3 { font-size: 1.65rem; }
.bw-lede { font-size: 1.05rem; margin: 0 0 12px; }
.bw-ask { margin: 0 0 12px; padding: 12px 14px; background: var(--marigold-wash); border: 1px solid var(--marigold-edge); border-left: 4px solid var(--marigold-deep); border-radius: var(--radius-sm); }
.bw-thanks { color: var(--ink-soft); margin: 0 0 14px; }
.beta-welcome-sheet .sheet-actions .btn { min-width: 8rem; }
/* Phones: the week strip keeps only its actionable sentence. */
@media (max-width: 640px) { .ag-ov-cap strong { display: none; } }
/* Phones: the timezone line takes the full width, as a box rather than a pill. */
@media (max-width: 640px) {
  .ev-banners { min-width: 0; }
  .ev-banners > * { min-width: 0; max-width: 100%; }
  .tz-line { width: 100%; border-radius: var(--radius-sm); padding: 6px 6px 6px 10px; font-size: .8rem; }
  .guide-btn { padding: 6px 10px; }
  .guide-btn-text { display: none; }   /* just the 📖 */
}

/* ============================================================================
   Step-by-step guides (js/guide.js) and the 📖 button that opens them
   ========================================================================== */
.page-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page-title-row .eyebrow { margin: 0; }
.guide-btn { font: inherit; font-size: .82rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer; flex-shrink: 0; }
@media (hover: hover) { .guide-btn:hover { border-color: var(--ink); color: var(--ink); } }
@media (pointer: coarse) { .guide-btn { min-height: 40px; } }

.guide { position: fixed; inset: 0; z-index: 9500; }
.guide-catch { position: absolute; inset: 0; }
.guide.guide-nospot .guide-catch { background: var(--scrim-strong); }
/* The highlighted part: a clear window in the dimmed page, ringed in marigold. */
.guide-spot { position: fixed; border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 9999px var(--scrim-strong), 0 0 0 3px var(--marigold); transition: top .2s var(--ease), left .2s var(--ease), width .2s var(--ease), height .2s var(--ease); }
.guide-spot[hidden] { display: none; }
.guide-card { position: fixed; width: min(380px, calc(100vw - 24px)); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 12px; box-shadow: var(--shadow-lift); outline: none; animation: fade .2s; }
.guide-card.guide-center { top: 50% !important; left: 50% !important; transform: translate(-50%, -50%); }
.guide-head { display: flex; align-items: center; justify-content: space-between; }
.guide-count { font-family: "Space Mono", monospace; font-size: .72rem; color: var(--ink-faint); }
.guide-x { width: 30px; height: 30px; font-size: 1.1rem; }
.guide-title { font-size: 1.2rem; margin: 2px 0 6px; }
.guide-text p { margin: 0 0 .55em; font-size: .93rem; line-height: 1.5; }
.guide-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.guide-never { font: inherit; font-size: .8rem; background: none; border: none; padding: 10px 0 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
/* Phones: the explanation along the bottom, the part it talks about above it. */
.guide-phone .guide-card, .guide-phone .guide-card.guide-center { top: auto !important; left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; transform: none; max-height: 48vh; overflow: auto; }
@media (prefers-reduced-motion: reduce) { .guide-spot { transition: none; } .guide-card { animation: none; } }

/* The touch-screen painting tip (js/paint-hint.js): a card along the bottom, over nothing modal: under
   sheets (9000) and the guide, above the unsaved bar (8000). */
.paint-hint { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 8500; max-width: 460px; margin: 0 auto; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--marigold); border-radius: var(--radius); padding: 12px 16px 10px; box-shadow: var(--shadow-lift); animation: fade .2s; }
.paint-hint p { margin: 0 0 .5em; font-size: .93rem; line-height: 1.45; }
.paint-hint .ph-title { font-weight: 700; font-size: 1.02rem; }
.ph-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ph-actions .guide-never { padding: 0; }
body.has-unsaved .paint-hint { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
@media (prefers-reduced-motion: reduce) { .paint-hint { animation: none; } }

/* Phones: folded boxes (calendar, quick fill) stay one slim line. */
@media (max-width: 640px) {
  .fold:not([open]) { padding-top: 9px; padding-bottom: 9px; }
}
.page-title-row .eyebrow { min-width: 0; overflow-wrap: anywhere; }

/* Privacy / terms: the pre-launch draft notice */
.legal-draft { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--marigold); border-left-width: 4px; border-radius: var(--radius-sm); background: var(--marigold-wash); color: var(--ink); font-weight: 600; font-size: .92rem; }

/* A short message by a grid cell ("Already marked as busy", "outside the dates") */
.ag-tip { position: fixed; z-index: 9600; max-width: min(300px, calc(100vw - 16px)); padding: 7px 11px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: .84rem; line-height: 1.35; box-shadow: var(--shadow-lift); pointer-events: none; animation: fade .15s; }
/* Over a week where no time works for every other respondent */
.ag-week-note { margin: 0 0 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--marigold-wash); border: 1px solid var(--marigold-edge); font-size: .86rem; color: var(--ink); }
.ag-week-note[hidden] { display: none; }
/* Phones: Paint as + three choices on one line */
@media (max-width: 640px) {
  .lvl-row { gap: 6px; }
  .levels { gap: 4px; }
  .levels .lv { padding: 6px 9px; gap: 5px; font-size: .8rem; }
  .levels .lv::before { width: 10px; height: 10px; }
}
/* "Learn more" and other links that are buttons */
.link-btn { font: inherit; padding: 0; border: none; background: none; color: var(--ember-deep); font-weight: 600; text-decoration: underline; cursor: pointer; }
.tier.opt-tag { font-size: .6rem; padding: 3px 6px; margin-left: 4px; }
.help-sheet h4 { margin: 4px 0 6px; font-size: 1rem; }
.help-sheet h4 + p { margin-top: 0; }
.help-sheet p { margin: 0 0 10px; font-size: .93rem; line-height: 1.5; }
.sb-organiser p:not(.eyebrow) { margin: 4px 0 8px; font-size: .92rem; }
/* After creating an event: one big way in, and the two general links to copy */
.next-steps .ns-open { font-size: 1.1rem; padding: 14px 34px; min-width: min(100%, 260px); box-shadow: 0 6px 18px rgba(200,70,30,.35); }
.next-steps .no-email { text-align: left; }
.next-steps .no-email p { margin: 0 0 10px; max-width: none; }
/* Create form: how many people the plan lets the event hold. */
.cap-note { margin: 8px 0 12px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--spruce); border-radius: var(--radius-sm); font-size: .88rem; color: var(--ink-soft); max-width: none; }
.cap-note strong { color: var(--ink); }
.cap-note.over { border-left-color: var(--ember); }
.cap-note .cap-over { color: var(--ember-deep); font-weight: 600; }
.ns-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; margin-top: 6px; background: var(--card); border-radius: 8px; color: var(--ink); }
.ns-link-main { min-width: 0; flex: 1 1 220px; }
.ns-link-actions { display: flex; gap: 6px; margin-left: auto; }
.ns-link .lk-title { font-weight: 600; font-size: .86rem; }
.ns-link .lk-sub { color: var(--ink-soft); font-size: .78rem; margin-top: 1px; }
.ns-link .lk-url { font-family: "Space Mono", monospace; font-size: .74rem; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The organiser's read on the answers (views/insights.js) */
.insights { margin-top: 14px; }
.insights[hidden] { display: none; }
.insights section + section { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ins-warn ul { margin: 6px 0 6px; padding-left: 20px; }
.ins-warn li { margin: 0 0 4px; font-size: .92rem; }
.ins-warn .hint { margin: 0; }
.ins-lead { margin: 6px 0 10px; font-size: .9rem; color: var(--ink-soft); }
.ins-rows { display: grid; gap: 8px; }
.ins-row { display: grid; grid-template-columns: minmax(80px, 9rem) 1fr; gap: 2px 10px; align-items: center; }
.ins-name { font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.ins-bar { display: flex; height: 10px; border-radius: 5px; background: var(--unmarked); overflow: hidden; }
.ins-bar i { display: block; height: 100%; }
.ins-bar i.f { background: var(--spruce); }
.ins-bar i.m { background: repeating-linear-gradient(135deg, var(--spruce) 0 3px, var(--maybe-stripe) 3px 6px); }
.ins-num { grid-column: 2; font-size: .8rem; color: var(--ink-soft); }
/* the week strip over your own grid: the same light must-attend hatch as the cells */
.ag-edit .ag-ov-day i.hb { background: repeating-linear-gradient(135deg, var(--hatch-hard) 0 1px, var(--unmarked) 1px 4px); }
.ins-warn .hint { font-size: .84rem; color: var(--ink-soft); }
/* Under a grid you paint: free / if needed / busy (unmarked) / outside the dates */
.paint-legend { flex-wrap: wrap; gap: 4px 14px; }
.paint-legend .pl-item { display: inline-flex; align-items: center; gap: 6px; }
.paint-legend .sw { width: 16px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.paint-legend .sw.free { background: var(--spruce); }
.paint-legend .sw.maybe { background: repeating-linear-gradient(135deg, var(--spruce) 0 3px, var(--maybe-stripe) 3px 6px); }
.paint-legend .sw.unmarked { background: var(--unmarked); box-shadow: inset 0 0 0 1px var(--unmarked-edge); }
.paint-legend .sw.off { background: var(--pad); box-shadow: inset 0 0 0 1px var(--pad-edge); }
/* The ‹ dates › pager is hidden on every screen for now (phones already hid it): the week strip
   above the grid picks the week. Kept in the markup (avail.js) so it can come back. A toolbar
   left with nothing to show goes too; the create form's zone picker keeps its. */
.ag .ag-pager { display: none; }
.ag-toolbar:not(:has(.ag-tools > :not([hidden]))) { display: none; }
.ag-tools { margin-left: auto; }
/* Responses: each name is a button that opens the must attend / optional sheet */
.chip.chip-btn { font: inherit; cursor: pointer; }
@media (hover: hover) { .chip.chip-btn:hover { border-color: var(--ink-soft); } }
.chips-hint { margin: 8px 0 0; font-size: .8rem; }
.tier-sheet { display: grid; gap: 8px; }
/* Organiser: choose a start within a "start any time" block. */
.start-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 4px 0 14px; }
.start-opts .start-day { grid-column: 1 / -1; margin: 6px 0 0; font-weight: 600; font-size: .86rem; color: var(--ink-soft); }
.start-opt { font: inherit; text-align: left; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer; }
.start-opt strong { font-size: 1.02rem; }
.start-opt span { font-size: .78rem; color: var(--ink-soft); }
.start-opt[aria-pressed="true"] { border-color: var(--spruce); box-shadow: 0 0 0 1px var(--spruce); background: color-mix(in srgb, var(--spruce) 8%, var(--card)); }
.tier-opt { font: inherit; text-align: left; display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer; }
.tier-opt span { font-size: .86rem; color: var(--ink-soft); }
.tier-opt.cur { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.tier-sheet .hint { margin: 4px 0 0; }
.tier-sheet .tier-remove { justify-self: start; margin-top: 6px; color: var(--ember-deep); }

/* "Please respond by" - the organiser's request, under the event's dates (never enforced) */
.respond-by { margin: 6px 0 0; font-weight: 600; color: var(--spruce-ink); }
.respond-by.past { color: var(--ink-soft); font-weight: 500; }
.respond-edit { margin-top: 8px; }

/* The organiser's invitation email: a button beside the links, and the sheet */
.invite-email-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.invite-email-row .hint { margin: 0; }
.invite-email .field { margin-top: 10px; }
.invite-email .lvl-row { margin-top: 6px; }
.levels.plain .lv::before { content: none; }   /* a plain choice: no colour swatch, so no gap before the label */
.invite-email-body { font-size: .92rem; line-height: 1.45; }

/* Home: "Lost the link to an event?" */
.home-lost { max-width: 640px; margin: 28px auto 0; }

/* ---------- less motion (the person's system setting) ----------
   Sheets, toasts, tips and hover lifts just appear; the hero grid holds still; the save
   button stops pulsing. Spinners keep turning - they say something is happening. */
@media (prefers-reduced-motion: reduce) {
  .toast, .sheet, .sheet-backdrop, .ag-tip, .hero-cell, .unsaved-bar, .composer.is-dirty button[type="submit"] { animation: none !important; }
  .btn, .evcard, .fold > summary::after, .guide-spot, .ws-dot { transition: none !important; }
  .evcard:hover, .btn:hover { transform: none !important; }
}

/* ---------- Windows High Contrast / forced colours ----------
   The system replaces backgrounds and drops shadows, which would make every grid state the
   same. The grid, its legends and the status dots keep their own colours (with a visible
   edge), and pressed / selected / focused states use the system's own Highlight. */
@media (forced-colors: active) {
  .ag-grid .ag-cell, .ag-ov-day i, .heat-legend .scale i, .sw, .chip .st, .ins-bar i, .tier.dot, .ws-dot {
    forced-color-adjust: none;
  }
  .ag-grid .ag-cell { border-color: CanvasText; }
  .ag-cell:focus-visible { outline: 3px solid Highlight; }
  .ag-heat .ag-cell.sel, .ag-heat .ag-cell.sel-start { outline: 3px solid Highlight; outline-offset: -3px; }
  .lv[aria-pressed="true"], .seg [aria-selected="true"], .tier-opt.cur, .start-opt[aria-pressed="true"], .mde-btn[aria-pressed="true"], .ag-ov-wk[aria-pressed="true"], .zone-opt[aria-current="true"] {
    outline: 2px solid Highlight; outline-offset: 1px;
  }
  .input:focus, .textarea:focus, select.input:focus, .mde:focus-within, :focus-visible { outline: 2px solid Highlight; }
  .btn, .lv, .seg button, .chip, .notify-btn, .others-pill, .guide-btn, .tier-opt, .start-opt, .prov-btn { border: 1px solid ButtonText; }
}
