/* Truce
   Layout: a printed holiday card. One patterned colour field in the holiday's own colour carries the
   verdict in a heavy serif, a ribbon stripe closes it, and the schedule hangs below as gift tags.
   Every holiday sets the same handful of tokens; nothing else in this file names a colour. */

/* ---------- holidays ---------- */
:root, :root[data-holiday="christmas"] {
  --field: #0f5a36; --on-field: #fff9ec; --on-field-soft: #cfe8d6;
  --ink: #12241a; --tint: #f1f6ef; --night: #0a1710; --night-surface: #13271b;
  --accent: #b3122d; --accent-night: #ff8696;
  --stripe-a: #c8102e; --stripe-b: #ffffff;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' fill='%23fff' fill-opacity='.13'%3E%3Cpath d='M30 12l3 15 15 3-15 3-3 15-3-15-15-3 15-3z'/%3E%3Cpath d='M92 74l2 9 9 2-9 2-2 9-2-9-9-2 9-2z'/%3E%3Ccircle cx='78' cy='24' r='3'/%3E%3Ccircle cx='22' cy='92' r='2.5'/%3E%3Ccircle cx='58' cy='62' r='1.8'/%3E%3C/svg%3E");
}
:root[data-holiday="thanksgiving"] {
  --field: #b8440f; --on-field: #fff7ea; --on-field-soft: #ffdfc8;
  --ink: #2a160a; --tint: #faf3e8; --night: #1a100a; --night-surface: #2b1b11;
  --accent: #8a2a0b; --accent-night: #ffab6b;
  --stripe-a: #6b1d1d; --stripe-b: #f2b705;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' fill='%23fff' fill-opacity='.14'%3E%3Cpath d='M22 52Q20 22 50 14Q54 44 22 52z'/%3E%3Cpath d='M100 108Q72 104 68 76Q98 78 100 108z'/%3E%3Ccircle cx='86' cy='30' r='3'/%3E%3Ccircle cx='30' cy='96' r='2.5'/%3E%3C/svg%3E");
}
:root[data-holiday="hanukkah"] {
  --field: #143a8f; --on-field: #f5f8ff; --on-field-soft: #cbd8f8;
  --ink: #0f1a33; --tint: #f1f4fb; --night: #0a1022; --night-surface: #141d3a;
  --accent: #8a6400; --accent-night: #f0c95a;
  --stripe-a: #e8b93e; --stripe-b: #f5f8ff;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' fill='none' stroke='%23fff' stroke-opacity='.2' stroke-width='2'%3E%3Cpath d='M30 12l15.6 27H14.4zM30 48L14.4 21h31.2z'/%3E%3Cpath d='M90 72l15.6 27H74.4zM90 108L74.4 81h31.2z'/%3E%3C/svg%3E");
}
:root[data-holiday="easter"] {
  --field: #d9c8ff; --on-field: #26124d; --on-field-soft: #473274;
  --ink: #23143f; --tint: #faf8ff; --night: #151026; --night-surface: #221a3b;
  --accent: #6a35c9; --accent-night: #cbb6ff;
  --stripe-a: #ffcf33; --stripe-b: #ff9ec4;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cellipse cx='30' cy='32' rx='13' ry='17' fill='%23fff' fill-opacity='.5'/%3E%3Cellipse cx='92' cy='90' rx='11' ry='15' fill='none' stroke='%23fff' stroke-opacity='.7' stroke-width='2.5'/%3E%3Ccircle cx='84' cy='26' r='3' fill='%23fff' fill-opacity='.6'/%3E%3Ccircle cx='28' cy='94' r='2.5' fill='%23fff' fill-opacity='.6'/%3E%3C/svg%3E");
}
:root[data-holiday="newyear"] {
  --field: #16130f; --on-field: #ffffff; --on-field-soft: #ddd6c8;
  --ink: #16130f; --tint: #f6f3ec; --night: #0b0a08; --night-surface: #1d1a15;
  --accent: #8a5d00; --accent-night: #f5c542;
  --stripe-a: #f5c542; --stripe-b: #16130f;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Crect x='20' y='18' width='12' height='5' fill='%23f5c542' fill-opacity='.7' transform='rotate(28 26 20)'/%3E%3Crect x='84' y='40' width='10' height='4' fill='%23ff6fa3' fill-opacity='.7' transform='rotate(-35 89 42)'/%3E%3Crect x='44' y='88' width='12' height='5' fill='%23fff' fill-opacity='.45' transform='rotate(60 50 90)'/%3E%3Ccircle cx='98' cy='98' r='3' fill='%23f5c542' fill-opacity='.7'/%3E%3Ccircle cx='60' cy='48' r='2' fill='%23fff' fill-opacity='.5'/%3E%3C/svg%3E");
}
:root[data-holiday="any"] {
  --field: #ffd23f; --on-field: #241a00; --on-field-soft: #4d3b00;
  --ink: #221b08; --tint: #fffbee; --night: #171305; --night-surface: #26200c;
  --accent: #b0245c; --accent-night: #ff8fb8;
  --stripe-a: #e0457b; --stripe-b: #ffffff;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' fill='%23241a00' fill-opacity='.1'%3E%3Ccircle cx='28' cy='30' r='10'/%3E%3Cpath d='M84 20l10 18H74z'/%3E%3Crect x='24' y='84' width='16' height='16' transform='rotate(20 32 92)'/%3E%3Ccircle cx='92' cy='92' r='5'/%3E%3C/svg%3E");
}

/* ---------- shared tokens, light then dark ---------- */
:root {
  color-scheme: light;
  --bg: var(--tint);
  --surface: #ffffff;
  --fg: var(--ink);
  --muted: color-mix(in srgb, var(--ink) 68%, var(--tint));
  --line: color-mix(in srgb, var(--ink) 18%, var(--tint));
  --raise: color-mix(in srgb, var(--ink) 7%, var(--tint));
  --mark: var(--accent);
  --flex-bg: #ffd166; --flex-fg: #3a2800;
  --no-bg: #b81d43; --no-fg: #ffffff;
  --danger: #a3143a;
  --open-bg: #d9f3df; --open-fg: #0d4a26;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: var(--night);
    --surface: var(--night-surface);
    --fg: #f7f3ea;
    --muted: color-mix(in srgb, #f7f3ea 66%, var(--night));
    --line: color-mix(in srgb, #f7f3ea 20%, var(--night));
    --raise: color-mix(in srgb, #f7f3ea 10%, var(--night));
    --mark: var(--accent-night);
    --flex-bg: #ffc857; --flex-fg: #2a1c00;
    --no-bg: #ff6d88; --no-fg: #2b0010;
    --danger: #ff9bb0;
    --open-bg: #1c5334; --open-fg: #e4ffec;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--body); }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
.field :focus-visible { outline-color: var(--on-field); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: 60rem; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.body { padding-block: 2rem 4rem; display: grid; gap: 2rem; }

/* type */
.mega { font: 900 clamp(2.75rem, 10vw, 6rem)/0.95 var(--display); letter-spacing: -0.025em; text-wrap: balance; }
.mega i { font-style: italic; }
.eyebrow { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.lede { font-size: 1.125rem; max-width: 34rem; }
.intro h1 { font: 900 clamp(2rem, 6vw, 3rem)/1 var(--display); letter-spacing: -0.02em; }
.intro p { color: var(--muted); max-width: 38rem; margin-top: 0.5rem; }
.hint { color: var(--muted); font-size: 0.9375rem; }

/* buttons */
.btn { border: 1.5px solid var(--line); background: transparent; color: var(--fg); border-radius: 999px; padding: 0.7rem 1.25rem; font-weight: 600; min-height: 44px; }
.btn:hover { background: var(--raise); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary:hover { opacity: 0.86; background: var(--fg); }
.btn.small { padding: 0.4rem 0.9rem; min-height: 36px; font-size: 0.875rem; }
.btn.danger { color: var(--danger); }
.field .btn.primary { background: var(--on-field); color: var(--field); border-color: var(--on-field); }
.field .btn.primary:hover { background: var(--on-field); }
.btn.onfield { color: var(--on-field); border-color: var(--on-field); }
.btn.onfield:hover { background: color-mix(in srgb, var(--on-field) 14%, transparent); }

/* the holiday field, closed by a ribbon */
.field { background-color: var(--field); background-image: var(--pattern); color: var(--on-field); position: relative; }
.field::after { content: ""; display: block; height: 14px; background: repeating-linear-gradient(-45deg, var(--stripe-a) 0 14px, var(--stripe-b) 14px 28px); }
.field .lede { color: var(--on-field-soft); }
.landing .field .wrap { padding-block: clamp(2.5rem, 8vw, 5rem); display: grid; gap: 1.5rem; justify-items: start; }
.landing .mega { font-size: clamp(2.5rem, 11.5vw, 8.5rem); line-height: 0.9; max-width: 100%; }
.warn { background: var(--on-field); color: var(--field); padding: 0.6rem 0.9rem; border-radius: 10px; font-weight: 600; }
.pickers { display: grid; gap: 0.5rem; }
.pick-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pick { border: 1.5px solid var(--on-field); background: transparent; color: var(--on-field); border-radius: 999px; padding: 0.45rem 0.95rem; min-height: 40px; font-weight: 600; }
.pick[aria-pressed="true"] { background: var(--on-field); color: var(--field); }
.pick-dates { font-size: 0.9375rem; color: var(--on-field-soft); }
.start { display: grid; gap: 0.4rem; width: 100%; max-width: 30rem; }
.start-label { font-size: 0.875rem; font-weight: 700; }
.start > input { border: 1.5px solid var(--on-field); border-radius: 999px; padding: 0.7rem 1.1rem; background: var(--field); color: var(--on-field); min-height: 44px; margin-bottom: 0.5rem; }
.start input::placeholder { color: var(--on-field-soft); }
.start-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.landing .start input { flex: 1 1 12rem; min-width: 0; border: 1.5px solid var(--on-field); border-radius: 999px; padding: 0.7rem 1.1rem; background: var(--field); color: var(--on-field); min-height: 44px; }
.how { padding-block: 3rem 4rem; }
.how ol { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); counter-reset: s; }
.how li { counter-increment: s; }
.how li::before { content: counter(s); font: italic 900 3.25rem/1 var(--display); color: var(--mark); }
.how h2 { font: 900 1.375rem/1.2 var(--display); margin-block: 0.5rem 0.25rem; }
.how p { color: var(--muted); }

/* top bar */
.top { background: var(--bg); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; flex-wrap: wrap; padding-block: 0.75rem 0.25rem; }
.mark { font: italic 900 1.5rem/1 var(--display); letter-spacing: -0.02em; color: var(--mark); text-decoration: none; }
.top-r { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.me { font-size: 0.875rem; color: var(--muted); }
select, input[type="text"], input:not([type]), input[type="number"], input[type="date"] { background: var(--surface); color: var(--fg); border: 1.5px solid var(--line); border-radius: 10px; padding: 0.45rem 0.6rem; min-height: 40px; max-width: 100%; }
.tabs { display: flex; gap: 0.25rem; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 0.7rem 0.75rem; font-weight: 600; color: var(--muted); white-space: nowrap; min-height: 44px; }
.tabs button[aria-current] { color: var(--fg); border-bottom-color: var(--mark); }
.count { font-variant-numeric: tabular-nums; font-weight: 500; }

/* verdict */
.verdict-in { padding-block: clamp(2rem, 6vw, 3.5rem); display: grid; gap: 2rem; }
.verdict-text { display: grid; gap: 1rem; min-width: 0; }
.flexbox { display: flex; gap: 1rem; align-items: center; background: var(--field); border: 1.5px dashed var(--on-field); border-radius: 14px; padding: 1rem; max-width: 30rem; }
.flex-title { font: 900 1.1875rem/1.2 var(--display); }
.flex-note { font-size: 0.9375rem; color: var(--on-field-soft); }
.switch { flex: none; width: 76px; height: 44px; border-radius: 999px; border: 2px solid var(--on-field); background: transparent; padding: 0; position: relative; }
.switch .knob { position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%; background: var(--on-field); transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1); }
.switch[aria-checked="true"] { background: var(--on-field); }
.switch[aria-checked="true"] .knob { transform: translateX(32px); background: var(--field); }
@media (min-width: 52rem) {
  .verdict-in { grid-template-columns: 1fr auto; align-items: end; }
  .flexbox { max-width: 21rem; }
}

.nudge { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--flex-bg); color: var(--flex-fg); border-radius: 14px; padding: 0.85rem 1rem; font-weight: 600; }
.nudge .btn { border-color: var(--flex-fg); color: var(--flex-fg); }
.nudge .btn:hover { background: rgba(0, 0, 0, 0.1); }

.notes { display: grid; gap: 0.5rem; }
.notes h2 { font: 900 1.5rem/1.2 var(--display); letter-spacing: -0.015em; }
.lines li { display: flex; gap: 0.6rem; align-items: baseline; padding-block: 0.6rem; border-top: 1px solid var(--line); }
.dot { flex: none; width: 0.7rem; height: 0.7rem; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 25%, transparent); }

/* schedule: a date, then gift tags */
.schedule { display: grid; }
.day { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; padding-block: 1.1rem; border-top: 1px solid var(--line); align-items: start; }
.date { display: grid; }
.num { font: 900 3rem/0.9 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--mark); }
.dow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 0.35rem; }
.day.quiet .num { color: var(--line); }
.rest { color: var(--muted); padding-top: 0.6rem; font-style: italic; }
.day-list { display: grid; gap: 0.75rem; min-width: 0; filter: drop-shadow(0 1px 0 var(--line)) drop-shadow(0 0 1px var(--line)); }
.gath { background: var(--surface); padding: 1rem 1rem 1rem 2.6rem; display: grid; gap: 0.25rem; min-width: 0; position: relative;
  clip-path: polygon(20px 0, 100% 0, 100% 100%, 20px 100%, 0 calc(100% - 20px), 0 20px); }
.gath::before { content: ""; position: absolute; left: 0.8rem; top: 50%; width: 0.8rem; height: 0.8rem; margin-top: -0.4rem; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); }
.when { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mark); }
.gath h3 { font: 900 1.5rem/1.15 var(--display); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.where { color: var(--muted); font-style: italic; }
.who { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.875rem; max-width: 100%; }
.chip span { overflow-wrap: anywhere; }
.chip em { font-style: normal; font-weight: 600; }
.chip.ask { background: var(--flex-bg); color: var(--flex-fg); border-color: var(--flex-bg); }
.chip.miss { border-style: dashed; border-color: var(--no-bg); }
.chip.miss span { text-decoration: line-through; color: var(--muted); }
.chip.miss em { color: var(--danger); }

.tag-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: space-between; margin-top: 0.75rem; padding-top: 0.6rem; border-top: 1px dashed var(--line); }
.state { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.state.stone { color: var(--fg); background: var(--raise); border: 1.5px solid var(--fg); border-radius: 6px; padding: 0.1rem 0.5rem; }
.stone-note { background: var(--raise); border-radius: 10px; padding: 0.7rem 0.9rem; font-weight: 600; }

.goal { font: italic 600 1.125rem/1.35 var(--display); max-width: 34rem; }
.sched-h { font: 900 1.5rem/1.2 var(--display); letter-spacing: -0.015em; margin-bottom: 0.75rem; }
.ov { min-height: 46px; display: grid; place-items: center; text-align: center; padding: 0.3rem; border-radius: 10px; font-size: 0.8125rem; line-height: 1.2; overflow-wrap: anywhere; min-width: 0; }
.ov.busy { border: 1.5px dashed var(--line); color: var(--muted); }
.ov.together { background: var(--field); color: var(--on-field); font-weight: 700; }
.ov.open { background: var(--open-bg); color: var(--open-fg); border: 1.5px solid var(--open-fg); font-weight: 700; font-size: 0.875rem; }
.ov.open:hover { filter: brightness(1.06); }
.ownplans { display: grid; gap: 0.5rem; border-left: 3px solid var(--line); padding-left: 1rem; }
.ownplans h2 { font: 900 1.125rem/1.2 var(--display); }
.ownplans .item { border-top: 1px dashed var(--line); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.5rem; counter-reset: st; }
.steps li { counter-increment: st; min-width: 0; }
.steps button { width: 100%; height: 100%; text-align: left; display: grid; gap: 0.15rem; align-content: start; background: transparent; border: 1.5px dashed var(--line); border-radius: 12px; padding: 0.7rem 0.8rem; color: var(--fg); }
.steps button::before { content: counter(st); font: italic 900 1.5rem/1 var(--display); color: var(--mark); }
.steps b { font-size: 0.9375rem; line-height: 1.25; }
.steps span { font-size: 0.8125rem; color: var(--muted); }
.steps .ok button { border-style: solid; border-color: var(--fg); background: var(--raise); }
.ov.none { min-height: 0; }
button.ov { cursor: pointer; border: 0; font-family: inherit; }
button.ov.open { border: 1.5px solid var(--open-fg); }
.ov.soft { background: var(--flex-bg); color: var(--flex-fg); font-weight: 600; }
.cell small { display: block; font-size: 0.6875rem; font-weight: 600; }
.sect { display: grid; gap: 0.6rem; padding-top: 0.75rem; border-top: 1px dashed var(--line); }
.sect h2 { font: 900 1.1875rem/1.2 var(--display); }
.sect .item { border-top: 1px dashed var(--line); }
.plan-name { font-size: 1.125rem; }
.tag.wait { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.switch:disabled { opacity: 0.6; cursor: default; }

.field.slim .slim-in { padding-block: 1.25rem 1.5rem; display: grid; gap: 0.4rem; }
.status { font: 900 clamp(1.75rem, 6vw, 3rem)/1 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.field.slim .lede { font-size: 1rem; }
.cal { display: grid; gap: 0.75rem; }
.cal .ov { min-height: 60px; }
.cal .grid-row { align-items: stretch; }
.cal .gd { align-self: center; }
.cal-cell { display: grid; gap: 0.25rem; min-width: 0; }
.ov small { display: block; font-size: 0.6875rem; font-weight: 600; opacity: 0.9; }
.ov.plan { font-weight: 700; align-content: center; font-size: 0.78rem; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; padding-inline: 0.2rem; }
.ov.plan.official, .key.official { background: var(--field); color: var(--on-field); border: 1.5px solid var(--field); }
.ov.plan.pencil, .key.pencil { background: transparent; color: var(--fg); border: 2px dashed var(--mark); }
.key.open { background: var(--open-bg); color: var(--open-fg); border-color: var(--open-fg); }
.key.busy { border-style: dashed; }
.flexbox.solo { color: var(--on-field); }
.item-head.static { cursor: default; }
.settings { margin-top: 1rem; }

.thread { display: grid; gap: 0.6rem; margin: 0 0 1.1rem 0.3rem; padding-left: 1rem; border-left: 2px solid var(--line); }
.thread li { display: grid; gap: 0.1rem; position: relative; }
.thread li::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: 0.45em; width: 10px; height: 10px; border-radius: 50%; background: var(--mark); }
.thread b { font-size: 1rem; }
.thread span, .thread.none { font-size: 0.875rem; color: var(--muted); }
.thread.none { border-left-style: dashed; padding-block: 0.1rem; }

/* slide-up panel: a bottom sheet on phones, a centred dialog on wider screens */
.sheet { border: 0; padding: 0; background: var(--bg); color: var(--fg); width: min(100%, 36rem); max-width: 100%; max-height: 90dvh; top: auto; bottom: 0; margin: 0 auto; border-radius: 22px 22px 0 0; overflow-y: auto; box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35); }
.sheet::backdrop { background: rgba(0, 0, 0, 0.55); }
@media (min-width: 44rem) { .sheet { top: 0; margin: auto; border-radius: 22px; max-height: 86dvh; } }
.sheet-in { display: grid; gap: 1.1rem; padding: 1.25rem max(16px, env(safe-area-inset-right, 0px)) calc(1.5rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet-top { display: flex; justify-content: space-between; align-items: start; gap: 0.75rem; }
.sheet-top h2 { font: 900 1.625rem/1.1 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.sheet-top .hint { margin-top: 0.25rem; }
.plan-form { display: grid; gap: 1rem; }
.plan-form .f input { font-size: 1.0625rem; }
.quick { display: grid; gap: 0.6rem; }
.quick .f input { font-size: 1.0625rem; min-height: 48px; }
.sheet .actions { padding-top: 0.75rem; border-top: 1px dashed var(--line); }
.sheet .actions .btn.primary { margin-left: auto; }

/* calendar cells */
.cal-how { font-weight: 600; }
button.ov { font: inherit; font-size: 0.8125rem; }
.ov.open { border-style: dashed; }
.ov.self, .key.self { background: repeating-linear-gradient(-45deg, var(--raise) 0 6px, transparent 6px 12px); border: 1.5px solid var(--fg); color: var(--fg); font-weight: 700; }
button.ov.busy { background: transparent; }
button.ov.busy, button.ov.soft { cursor: pointer; }
button.ov:hover { filter: brightness(1.08); }

/* our schedule */
.planlist { display: grid; }
.planrow { width: 100%; display: grid; gap: 0.2rem; justify-items: start; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 0.85rem 0; color: var(--fg); }
.planrow b { font: 900 1.25rem/1.2 var(--display); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.planrow .item-sum { margin-left: 0; }
.planrow:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pill { font: 700 0.6875rem/1 var(--body); letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 0.25rem 0.55rem; }
.pill.official { background: var(--field); color: var(--on-field); }
.pill.pencil { border: 1.5px dashed var(--mark); color: var(--fg); }
.busychip[data-s="flex"] { background: var(--flex-bg); color: var(--flex-fg); border-color: var(--flex-bg); font-weight: 600; }
.busychip[data-s="no"] { background: var(--no-bg); color: var(--no-fg); border-color: var(--no-bg); font-weight: 600; }
.details summary { font: 900 1.1875rem/1.2 var(--display); cursor: pointer; padding-block: 0.25rem; }
.details[open] summary { margin-bottom: 0.5rem; }
.donebar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; background: var(--raise); border-radius: 14px; padding: 1rem; }
.donebar p { flex: 1 1 14rem; }

/* editors */
.blank { color: var(--muted); border: 1.5px dashed var(--line); border-radius: 14px; padding: 1.25rem; }
.item { border-top: 1px solid var(--line); }
.item-head { width: 100%; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; background: none; border: 0; padding: 1rem 0; text-align: left; min-height: 44px; }
.item-name { font: 900 1.375rem/1.2 var(--display); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.item-sum { color: var(--muted); font-size: 0.875rem; margin-left: auto; }
.tag { font: 700 0.6875rem/1 var(--body); letter-spacing: 0.06em; text-transform: uppercase; background: var(--fg); color: var(--bg); border-radius: 999px; padding: 0.2rem 0.5rem; vertical-align: middle; }
.item-body { display: grid; gap: 1rem; padding-block: 0.25rem 1.5rem; }
.item.open:not(:has(.item-head)) .item-body { padding-top: 1.25rem; }
.fields { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.f { display: grid; gap: 0.3rem; font-size: 0.8125rem; font-weight: 600; color: var(--muted); min-width: 0; }
.f.grow { flex: 1 1 14rem; }
.f input, .f select { font-size: 1rem; font-weight: 400; width: 100%; }
.f input[type="number"] { width: 5.5rem; }
.f-label { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin-bottom: -0.5rem; }
.check { display: flex; gap: 0.5rem; align-items: center; min-height: 32px; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--mark); }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.placed { color: var(--muted); font-size: 0.9375rem; margin-right: auto; }
.linkrow { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.linkrow input { flex: 1 1 14rem; min-width: 0; }

.toggles { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tog { display: inline-flex; align-items: center; gap: 0.4rem; border: 1.5px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 0.4rem 0.85rem; min-height: 40px; }
.tog[aria-pressed="true"] { background: var(--raise); color: var(--fg); border-color: var(--fg); font-weight: 600; }
.tog:disabled { cursor: default; opacity: 0.75; }
.tog.all { border-style: dashed; }

/* availability grid */
.grid { display: grid; gap: 0.35rem; }
.grid-row { display: grid; grid-template-columns: 4.6rem repeat(3, minmax(0, 1fr)); gap: 0.35rem; align-items: center; }
.grid-head { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); text-align: center; }
.gd { font-size: 0.875rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.gd b { color: var(--fg); display: block; }
.cell, .key { border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 10px; font-size: 0.875rem; }
.cell { min-height: 46px; padding: 0.25rem; font-weight: 500; transition: background 0.12s, transform 0.12s; }
.cell:active { transform: scale(0.96); }
.cell[data-s="flex"], .key[data-s="flex"] { background: var(--flex-bg); color: var(--flex-fg); border-color: var(--flex-bg); font-weight: 700; }
.cell[data-s="no"], .key[data-s="no"] { background: var(--no-bg); color: var(--no-fg); border-color: var(--no-bg); font-weight: 700; }
.legend { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.key { padding: 0.15rem 0.6rem; font-size: 0.8125rem; }

#toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 0.7rem 1.1rem; border-radius: 999px; font-weight: 600; max-width: calc(100vw - 32px); z-index: 20; }
[hidden] { display: none !important; }

::view-transition-group(*) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.2, 0.9, 0.3, 1); }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
