/* El Gallinero: limewashed henhouse walls, egg-yolk yellow, gaffer-tape bookings. */

@font-face { font-family: "Stencil"; src: url("/fonts/stencil-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Shoulders"; src: url("/fonts/shoulders-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Shoulders"; src: url("/fonts/shoulders-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #F3F4EE;          /* limewash */
  --surface: #FFFFFF;
  --surface-2: #E7EADF;
  --ink: #1F3B2D;         /* henhouse green */
  --ink-2: #56665C;
  --line: #D3D8CA;
  --line-soft: #E4E7DC;
  --accent: #1F3B2D;
  --on-accent: #FFFFFF;
  --yolk: #F5B700;
  --on-yolk: #1E1A08;
  --danger: #B3261E;
  --ok: #2E7D4F;
  --now: #D8342C;         /* comb red */
  --shadow: 0 10px 30px rgba(20, 40, 28, .18);
  --scrim: rgba(18, 30, 22, .42);

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-stencil: "Stencil", "Arial Narrow", Impact, sans-serif;
  --font-tape: "Shoulders", "Arial Narrow", "Roboto Condensed", sans-serif;

  --hour: 56px;
  --gutter: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1712; --surface: #17221B; --surface-2: #1F2C24; --ink: #E9EDE4; --ink-2: #9DAAA1;
    --line: #2D3B32; --line-soft: #1F2B24; --accent: #F5B700; --on-accent: #1E1A08; --danger: #FF8A80; --ok: #7CD69C; --now: #FF6B5E;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1712; --surface: #17221B; --surface-2: #1F2C24; --ink: #E9EDE4; --ink-2: #9DAAA1;
  --line: #2D3B32; --line-soft: #1F2B24; --accent: #F5B700; --on-accent: #1E1A08; --danger: #FF8A80; --ok: #7CD69C; --now: #FF6B5E;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .6); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yolk); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.boot { position: fixed; inset: 0; background: var(--bg); }

/* ---------------------------------------------------------- buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 10px; border: 1.5px solid transparent;
  background: var(--surface-2); color: var(--ink); font-weight: 600; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-yolk { background: var(--yolk); color: var(--on-yolk); }
.btn-go { background: var(--ink); color: var(--bg); }
.btn-big { min-height: 58px; font-size: 18px; }
.btn-quiet { background: transparent; border-color: var(--line); }
.btn-danger { background: transparent; color: var(--danger); border-color: currentColor; }
.btn-danger.solid { background: var(--danger); color: var(--bg); border-color: var(--danger); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 auto; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { background: var(--surface-2); }

.stack { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 15px; }
.field small, .hint { color: var(--ink-2); font-size: 14px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; font-size: 16px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink);
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yolk) 55%, transparent); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { margin: 0; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-weight: 600; }

/* chips: band picker, durations, repeat */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 21px; background: var(--surface); font-weight: 600; font-size: 15px;
}
.chip input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.chip input:focus-visible + span { outline: 3px solid var(--yolk); outline-offset: 2px; }
.chip .swatch { width: 14px; height: 14px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
button.chip-btn { border: 1.5px solid var(--line); background: var(--surface); border-radius: 21px; min-height: 38px; padding: 0 14px; font-weight: 600; font-size: 15px; }

/* switches */
.switch { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.switch:last-of-type { border-bottom: 1px solid var(--line-soft); }
.switch strong { display: block; font-size: 16px; }
.switch small { display: block; color: var(--ink-2); font-size: 14px; }
.switch input { appearance: none; width: 52px; height: 32px; border-radius: 16px; background: var(--line); position: relative; margin: 0; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }

/* ---------------------------------------------------------- sign-in gate */
.gate { min-height: 100dvh; display: grid; place-items: start center; padding: max(32px, env(safe-area-inset-top)) 20px 40px; }
.gate-inner { width: 100%; max-width: 420px; }
.gate-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.gate-mark { width: 84px; height: 84px; flex: none; }
.gate-mark.small { width: 56px; height: 56px; }
.gate-mark svg, .brand-mark svg { width: 100%; height: 100%; display: block; }
.wordmark {
  font-family: var(--font-stencil); font-weight: 800; text-transform: uppercase;
  font-size: clamp(56px, 19vw, 92px); line-height: .86; letter-spacing: .01em; margin: 0 0 10px;
  overflow-wrap: anywhere;
}
.gate-tape { margin: 0 0 32px; }
.gate-tape span {
  display: inline-block; background: var(--yolk); color: var(--on-yolk); padding: 8px 18px 8px 14px;
  font-family: var(--font-tape); font-weight: 700; font-size: 22px; letter-spacing: .01em; transform: rotate(-1.5deg);
  clip-path: polygon(0 6%, 3% 0, 100% 4%, 98% 30%, 100% 55%, 97% 80%, 100% 100%, 2% 96%, 0 70%, 2% 45%);
}
.gate-title { font-family: var(--font-stencil); font-weight: 800; font-size: 40px; text-transform: uppercase; line-height: .95; margin-bottom: 10px; }
.gate-lede { margin: 0 0 26px; color: var(--ink-2); font-size: 17px; }

/* ---------------------------------------------------------- app shell (phone first) */
.shell { height: 100dvh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: max(6px, env(safe-area-inset-top)) 8px 0 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 4px; }
.brand-mark { width: 34px; height: 34px; }
.brand-name { font-family: var(--font-stencil); font-weight: 800; font-size: 24px; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 0; margin-left: 2px;
  background: var(--c, var(--yolk)); color: var(--on-c, var(--on-yolk)); font-family: var(--font-tape); font-weight: 700; font-size: 18px;
}

.side { padding: 0 12px; }
.side-actions, .side-blocks { display: none; }
.datebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0 2px; }
.month-btn {
  border: 0; background: none; padding: 6px 4px; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-stencil); font-weight: 800; font-size: 28px; text-transform: uppercase; line-height: 1;
}
.month-btn svg { width: 18px; height: 18px; transition: transform .2s; }
.month-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.datenav { display: flex; align-items: center; gap: 2px; }

.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 6px 0 8px; touch-action: pan-y; }
.day-btn {
  border: 0; background: none; padding: 6px 0 8px; border-radius: 12px; display: grid; justify-items: center; gap: 2px;
  min-height: 70px; position: relative;
}
.day-btn .dow { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.day-btn .num { font-family: var(--font-stencil); font-weight: 800; font-size: 24px; line-height: 1.05; }
.day-btn.today .num { box-shadow: inset 0 -4px 0 var(--yolk); }
.day-btn.today[aria-pressed="true"] .num, .mg-day.today[aria-pressed="true"] { box-shadow: none; }
.day-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.day-btn[aria-pressed="true"] .dow { color: inherit; opacity: .8; }
.marks { display: flex; gap: 2px; height: 6px; }
.marks i { width: 9px; height: 6px; background: var(--c); border-radius: 1px; }

.monthgrid { padding: 4px 0 10px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.monthgrid .mg-dow { text-align: center; font-size: 12px; color: var(--ink-2); font-weight: 600; padding: 4px 0; }
.mg-day { border: 0; background: none; min-height: 44px; border-radius: 10px; display: grid; justify-items: center; align-content: center; gap: 3px; font-weight: 600; }
.mg-day.other { color: var(--ink-2); opacity: .55; }
.mg-day.today { box-shadow: inset 0 -3px 0 var(--yolk); }
.mg-day[aria-pressed="true"] { background: var(--ink); color: var(--bg); opacity: 1; }
.mg-day .marks { height: 4px; }
.mg-day .marks i { width: 6px; height: 4px; }

.main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; border: 0; background: none; padding: 12px 4px 10px; font-weight: 600; font-size: 15px; color: var(--ink-2);
  box-shadow: inset 0 -3px 0 transparent;
}
.tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); }
.view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; outline: none; }

.fabs {
  position: fixed; left: 12px; right: 12px; bottom: calc(16px + var(--safe-b)); z-index: 5;
  display: flex; justify-content: flex-end; gap: 10px; pointer-events: none;
}
.fab {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 20px 0 16px; border: 0; border-radius: 28px;
  background: var(--yolk); color: var(--on-yolk); font-family: var(--font-tape); font-weight: 700; font-size: 23px; letter-spacing: .02em;
  box-shadow: var(--shadow); white-space: nowrap;
}
.fab-go { background: var(--ink); color: var(--bg); }
.go-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--now); box-shadow: 0 0 0 3px color-mix(in srgb, var(--now) 35%, transparent); }
.fab-plus { width: 22px; height: 22px; position: relative; }
.fab-plus::before, .fab-plus::after { content: ""; position: absolute; background: currentColor; border-radius: 2px; }
.fab-plus::before { left: 9px; top: 0; width: 4px; height: 22px; }
.fab-plus::after { top: 9px; left: 0; height: 4px; width: 22px; }

/* ---------------------------------------------------------- timeline */
.timeline {
  position: relative; height: calc(24 * var(--hour)); margin: 8px 0 120px;
  background-image:
    linear-gradient(to bottom, var(--line) 1px, transparent 1px),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) / 2), var(--line-soft) calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour));
  background-size: 100% var(--hour), 100% var(--hour);
  background-position: var(--gutter) 0, var(--gutter) 0;
  background-repeat: repeat-y;
}
.timeline::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--gutter); background: var(--bg); }
.hour-label { position: absolute; left: 0; width: calc(var(--gutter) - 10px); text-align: right; font-size: 13px; color: var(--ink-2); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.hour-label:first-of-type { transform: none; }
.lane { position: absolute; top: 0; bottom: 0; left: var(--gutter); right: 10px; }
.slot-hint { position: absolute; left: 0; right: 0; border-radius: 8px; border: 2px dashed var(--ink-2); opacity: .6; pointer-events: none; }
.now-line { position: absolute; left: calc(var(--gutter) - 6px); right: 0; height: 2px; margin-top: -1px; background: var(--now); box-shadow: 0 0 0 1px var(--bg); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -2px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--now); box-shadow: 0 0 0 2px var(--bg); }

/* a booking is a strip of coloured gaffer tape, torn at both ends */
.tape {
  position: absolute; left: 0; right: 0; z-index: 2; border: 0; text-align: left; padding: 7px 10px 6px; overflow: hidden;
  background-color: var(--c); color: var(--on-c);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 4px), linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(0, 0, 0, .06));
  clip-path: polygon(0 3px, 5% 0, 11% 4px, 18% 1px, 26% 4px, 33% 0, 41% 3px, 49% 1px, 57% 4px, 64% 0, 72% 3px, 80% 1px, 87% 4px, 94% 0, 100% 3px,
    100% calc(100% - 2px), 95% 100%, 89% calc(100% - 4px), 81% calc(100% - 1px), 74% calc(100% - 4px), 66% 100%, 58% calc(100% - 3px), 50% calc(100% - 1px), 42% calc(100% - 4px), 34% 100%, 27% calc(100% - 3px), 19% calc(100% - 1px), 11% calc(100% - 4px), 5% 100%, 0 calc(100% - 3px));
  display: flex; flex-direction: column; gap: 1px; min-height: 24px;
}
.tape:focus-visible { outline: none; filter: brightness(1.08); box-shadow: inset 0 0 0 3px var(--on-c); }
.tape .t-band { font-family: var(--font-tape); font-weight: 700; font-size: 20px; line-height: 1.05; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape .t-meta { font-family: var(--font-tape); font-weight: 500; font-size: 16px; line-height: 1.15; display: flex; gap: 8px; align-items: center; white-space: nowrap; overflow: hidden; }
.tape .t-meta svg { width: 14px; height: 14px; flex: none; }
.tape .t-note { font-size: 13px; line-height: 1.3; opacity: .9; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tape.short { flex-direction: row; align-items: center; gap: 8px; padding-top: 3px; padding-bottom: 2px; }
.tape.short .t-band { font-size: 17px; }
.tape.short .t-meta { font-size: 14px; }
.tape.past { filter: saturate(.55); opacity: .7; }
.tape.cont-top { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2px), 95% 100%, 89% calc(100% - 4px), 81% calc(100% - 1px), 74% calc(100% - 4px), 66% 100%, 58% calc(100% - 3px), 50% calc(100% - 1px), 42% calc(100% - 4px), 34% 100%, 27% calc(100% - 3px), 19% calc(100% - 1px), 11% calc(100% - 4px), 5% 100%, 0 calc(100% - 3px)); }
.tape.cont-bottom { clip-path: polygon(0 3px, 5% 0, 11% 4px, 18% 1px, 26% 4px, 33% 0, 41% 3px, 49% 1px, 57% 4px, 64% 0, 72% 3px, 80% 1px, 87% 4px, 94% 0, 100% 3px, 100% 100%, 0 100%); }
.tape.cont-top.cont-bottom { clip-path: none; }

/* week grid */
.week { --hour: 46px; position: relative; }
.week-head { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: var(--gutter) repeat(7, 1fr); background: var(--bg); border-bottom: 1px solid var(--line); }
.week-head button { border: 0; background: none; padding: 8px 0 6px; display: grid; justify-items: center; gap: 0; border-radius: 10px; }
.week-head .dow { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.week-head .num { font-family: var(--font-stencil); font-weight: 800; font-size: 22px; line-height: 1.1; }
.week-head .today .num { box-shadow: inset 0 -3px 0 var(--yolk); }
.week .timeline { margin-top: 0; background-position: var(--gutter) 0, var(--gutter) 0; }
.week .cols { position: absolute; top: 0; bottom: 0; left: var(--gutter); right: 4px; display: grid; grid-template-columns: repeat(7, 1fr); }
.week .col { position: relative; border-left: 1px solid var(--line-soft); }
.week .col.today { background: color-mix(in srgb, var(--yolk) 7%, transparent); }
.week .tape { left: 2px; right: 2px; padding: 5px 4px 4px; }
.week .tape .t-band { font-size: 14px; line-height: 1.02; white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: none; }
.week .tape.tiny .t-meta { display: none; }
.week .tape.tiny .t-band { white-space: nowrap; text-overflow: clip; }
.week .tape .t-meta { font-size: 13px; }
.week .tape .t-note { display: none; }
.week .now-line { left: 0; }

/* ---------------------------------------------------------- lists */
.list { padding: 6px 12px 120px; }
.list-day { margin: 18px 0 6px; font-family: var(--font-tape); font-weight: 700; font-size: 22px; letter-spacing: .01em; }
.list-day small { font-family: var(--font-ui); font-weight: 500; font-size: 14px; color: var(--ink-2); margin-left: 6px; }
.row {
  width: 100%; display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; text-align: left;
  padding: 12px 12px 12px 0; border: 0; border-bottom: 1px solid var(--line-soft); background: none;
}
.row .bar { align-self: stretch; background: var(--c); clip-path: polygon(0 0, 100% 3px, 80% 50%, 100% calc(100% - 2px), 0 100%); min-height: 42px; }
.row strong { display: block; font-size: 17px; }
.row .sub { display: block; color: var(--ink-2); font-size: 14px; }
.row .time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; text-align: right; }
.row .time small { display: block; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pill svg { width: 14px; height: 14px; }
.you { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 9px; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--ink-2); vertical-align: 2px; }

.empty { padding: 48px 20px 120px; text-align: center; color: var(--ink-2); }
.empty h3 { font-family: var(--font-stencil); font-weight: 800; font-size: 30px; text-transform: uppercase; color: var(--ink); margin-bottom: 8px; }
.empty p { margin: 0 auto 20px; max-width: 30ch; }
.loading { padding: 40px; text-align: center; color: var(--ink-2); }

.block-card { padding: 16px 0; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 14px 1fr; gap: 14px; }
.block-card .bar { background: var(--c); clip-path: polygon(0 0, 100% 3px, 80% 50%, 100% calc(100% - 2px), 0 100%); }
.block-card h3 { font-family: var(--font-tape); font-weight: 700; font-size: 24px; letter-spacing: .01em; }
.block-card p { margin: 2px 0; }
.block-card .muted { color: var(--ink-2); font-size: 15px; }
.block-card .btn-row { margin-top: 10px; }

/* ---------------------------------------------------------- sheet (bottom sheet on phones, dialog on desktop) */
.sheet {
  border: 0; padding: 0; margin: auto 0 0; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 92dvh;
  background: var(--bg); color: var(--ink); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { animation: sheet-up .22s cubic-bezier(.2, .8, .3, 1); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 4px 20px; flex: none; }
.sheet-head h2 { font-family: var(--font-stencil); font-weight: 800; font-size: 28px; text-transform: uppercase; line-height: 1; padding-top: 4px; }
.sheet-body { overflow-y: auto; padding: 8px 20px calc(24px + var(--safe-b)); overscroll-behavior: contain; }

.detail-tape {
  margin: 4px 0 18px; padding: 16px 16px 14px; background-color: var(--c); color: var(--on-c);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 4px);
  clip-path: polygon(0 4px, 6% 0, 14% 5px, 23% 1px, 33% 5px, 44% 0, 55% 4px, 66% 1px, 77% 5px, 88% 0, 100% 4px, 100% calc(100% - 3px), 92% 100%, 82% calc(100% - 5px), 71% calc(100% - 1px), 60% calc(100% - 5px), 48% 100%, 37% calc(100% - 4px), 25% calc(100% - 1px), 13% calc(100% - 5px), 4% 100%, 0 calc(100% - 4px));
}
.detail-tape .d-band { font-family: var(--font-tape); font-weight: 700; font-size: 30px; line-height: 1; }
.detail-tape .d-when { font-family: var(--font-tape); font-weight: 500; font-size: 22px; margin-top: 4px; }
.kv { display: grid; gap: 14px; margin-bottom: 20px; }
.kv > div > span { display: block; font-size: 14px; color: var(--ink-2); }
.kv > div > strong { font-size: 17px; }
.contact { display: flex; gap: 10px; margin-top: 8px; }
.series-list { margin: 8px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line-soft); }
.series-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.series-list li.past { color: var(--ink-2); text-decoration: line-through; }
.series-list li.current { font-weight: 700; }
.series-list li.plain { padding: 0; border: 0; display: block; }
.series-list li.plain.past .row { opacity: .55; }
.mt-8 { margin-top: 8px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.actions { display: grid; gap: 10px; margin-top: 22px; }
.confirm-box { padding: 14px; border-radius: 12px; border: 1.5px solid var(--danger); display: grid; gap: 10px; }
.confirm-box p { margin: 0; font-weight: 600; }
.conflicts { padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 10%, transparent); display: grid; gap: 8px; }
.conflicts p { margin: 0; }
.conflicts ul { margin: 0; padding-left: 18px; }
.summary { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 15px; }
.section-title { font-weight: 700; font-size: 15px; margin: 10px 0 0; }
.member { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.member .sub { color: var(--ink-2); font-size: 14px; }
.activity li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); list-style: none; }
.activity { margin: 0; padding: 0; }
.activity time { display: block; color: var(--ink-2); font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; z-index: 50;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600;
  pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* plain server pages (unsubscribe) */
.plain-page main { max-width: 480px; margin: 12vh auto; padding: 0 20px; }
.plain-page h1 { font-family: var(--font-stencil); font-weight: 800; font-size: 40px; text-transform: uppercase; margin-bottom: 12px; }

/* ---------------------------------------------------------- bigger screens */
@media (min-width: 600px) {
  .sheet { margin: auto; inset: 0; width: min(520px, calc(100% - 32px)); max-height: 88dvh; border-radius: 16px; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 14px; }
}

@media (min-width: 960px) {
  :root { --hour: 52px; --gutter: 60px; }
  .shell { display: grid; grid-template-columns: 320px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; padding: 10px 20px 8px; border-bottom: 1px solid var(--line); }
  .side { grid-row: 2; padding: 16px 20px; border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
  .monthgrid[hidden] { display: grid !important; }
  .month-btn { pointer-events: none; }
  .month-btn svg { display: none; }
  .weekstrip { display: none; }
  .side-actions { display: grid; gap: 10px; margin: 10px 0 14px; }
  .side-blocks { display: block; }
  .side-blocks h3 { font-weight: 700; font-size: 15px; margin: 8px 0 4px; }
  .side-blocks .row { padding-top: 8px; padding-bottom: 8px; }
  .main { grid-row: 2; }
  .tabs { padding: 0 20px; justify-content: flex-start; }
  .tabs button { flex: 0 0 auto; padding: 14px 16px 12px; }
  .fabs { display: none; }
  .list { padding: 6px 28px 60px; max-width: 760px; }
  .timeline { margin-bottom: 40px; }
  .lane { right: 24px; max-width: 760px; }
  .week .cols { right: 12px; }
  .week .tape .t-band { font-size: 17px; }
  .toast { bottom: 32px; }
}

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

/* hen: parts that take the page colour */
.hen .hb { fill: var(--bg); }
.hen .hs { stroke: var(--bg); }

/* language switcher */
.lang-switch { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; padding: 2px; gap: 2px; background: var(--surface); }
.lang-btn { border: 0; background: none; border-radius: 7px; min-height: 36px; padding: 0 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.lang-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lang-switch.wide { display: flex; }
.lang-switch.wide .lang-btn { flex: 1; min-height: 42px; font-size: 15px; }

/* "on now" */
.live-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 1px 8px 1px 6px; border-radius: 9px; background: var(--now); color: #fff; font-family: var(--font-ui); font-size: 12px; font-weight: 700; vertical-align: 3px; letter-spacing: 0; }
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.detail-tape .live-badge { vertical-align: 6px; }
.tape.live::after { content: ""; position: absolute; top: 9px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); box-shadow: 0 0 0 2px var(--c); }
.week .tape.live::after { top: 6px; right: 5px; width: 8px; height: 8px; }

.notice { padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--yolk) 22%, var(--bg)); font-weight: 600; }
.hint.center { text-align: center; margin: -6px 0 0; }
.day-head { padding-bottom: 0; }
.field input[type="time"], .field input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 50px; }
