:root {
  --paper: #f3eee4;
  --paper-2: #fffaf3;
  --ink: #1a241c;
  --muted: #3e4a40;
  --line: #d8d0c2;
  --pine: #1b4d3b;
  --pine-deep: #10281f;
  --gold: #8d6430;
  --gold-soft: #f4e7d0;
  --rust: #8a3324;
  --red-soft: #f8e4de;
  --green: #14613d;
  --green-soft: #e4f2ea;
  --amber: #7a4e0d;
  --amber-soft: #f8efd8;
  --shadow: 0 18px 40px rgba(16, 40, 31, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Palatino, serif;
  --sans: "Public Sans", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --hero-ink: #f6f1e6;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #101c17;
  --paper-2: #182820;
  --ink: #f4efe4;
  --muted: #d2cbbd;
  --line: #31443a;
  --pine: #8fbfa4;
  --pine-deep: #d7efe2;
  --gold: #e4c48a;
  --gold-soft: #3a3122;
  --rust: #f0b0a4;
  --red-soft: #3a2420;
  --green: #b7e0c8;
  --green-soft: #1c3328;
  --amber: #f0d7a4;
  --amber-soft: #3a3120;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --hero-ink: #f6f1e6;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101c17;
    --paper-2: #182820;
    --ink: #f4efe4;
    --muted: #d2cbbd;
    --line: #31443a;
    --pine: #8fbfa4;
    --pine-deep: #d7efe2;
    --gold: #e4c48a;
    --gold-soft: #3a3122;
    --rust: #f0b0a4;
    --red-soft: #3a2420;
    --green: #b7e0c8;
    --green-soft: #1c3328;
    --amber: #f0d7a4;
    --amber-soft: #3a3120;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(820px 320px at 100% -8%, color-mix(in srgb, var(--gold) 16%, transparent) 0%, transparent 58%),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.45;
}
a { color: var(--pine-deep); }
a:hover { color: var(--gold); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--paper-2);
  color: var(--ink);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  z-index: 20;
}
.skip:focus { top: 0.6rem; }

.wrap { width: min(1100px, calc(100% - 1.5rem)); margin: 0 auto; }
.top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.brand { text-decoration: none; color: inherit; }
.brand strong {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  display: block;
  line-height: 1;
}
.brand span { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.header-tools { display: flex; align-items: center; gap: 0.4rem; }
.primary-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
}
.primary-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}
.primary-nav a:hover { background: color-mix(in srgb, var(--pine) 12%, transparent); }
.primary-nav a[aria-current="page"] { background: var(--pine); color: #f7f3ea; }
.menu { position: relative; }
.menu summary {
  cursor: pointer;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  background: var(--paper-2);
}
.menu summary::-webkit-details-marker { display: none; }
.menu div {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  min-width: 12rem;
  padding: 0.35rem;
  z-index: 12;
}
.menu a { text-decoration: none; padding: 0.5rem 0.65rem; border-radius: 10px; }
.menu a:hover { background: color-mix(in srgb, var(--pine) 10%, transparent); }
button.compact, .button.compact { min-height: 36px; padding: 0.32rem 0.75rem; font-size: 0.85rem; }
main { padding: 1.4rem 0 3rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; }
h1 { font-size: clamp(2rem, 4vw, 2.7rem); margin: 0 0 0.35rem; line-height: 1.05; }
h2 { font-size: 1.4rem; margin: 0 0 0.55rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.3rem; text-transform: capitalize; }
.lede { color: var(--muted); max-width: 42rem; margin-top: 0; }
.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
}

.banner, .flash, .callout {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  margin: 0.8rem 0 1rem;
  background: var(--paper-2);
}
.flash { position: sticky; top: 0.5rem; z-index: 6; }
.flash.ok { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
.flash.bad, .banner.stop { background: var(--red-soft); border-color: color-mix(in srgb, var(--rust) 35%, var(--line)); }
.callout.warn { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.spread { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }

button, .button {
  font: inherit;
  background: var(--pine-deep);
  color: var(--hero-ink);
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1.05rem;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
:root[data-theme="dark"] button:not(.secondary):not(.danger):not(.tab),
:root[data-theme="dark"] .button:not(.secondary) { color: #10281f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) button:not(.secondary):not(.danger):not(.tab),
  :root:not([data-theme="light"]) .button:not(.secondary) { color: #10281f; }
}
button.secondary, .button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
button.danger { background: #8a3324; color: #fffaf3; }
button:hover, .button:hover { filter: brightness(1.06); }
label { display: grid; gap: 0.28rem; font-size: 0.92rem; }
input, select, textarea {
  font: inherit;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  width: 100%;
  min-height: 44px;
}
textarea { min-height: 6rem; resize: vertical; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 0;
  padding: 0.8rem 1rem 1rem;
}
legend { padding: 0 0.35rem; font-family: var(--serif); }
.grid { display: grid; gap: 0.85rem; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.tight { gap: 0.45rem; }
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}
.stack { display: grid; gap: 1rem; }
.mono, time, .time { font-family: var(--mono); font-size: 0.86rem; }
.muted { color: var(--muted); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.78rem;
  background: color-mix(in srgb, var(--line) 55%, var(--paper-2));
  border: 1px solid var(--line);
  color: var(--ink);
}
.pill::before {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pill.confirmed::before, .pill.scheduled::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M6.2 11.3 2.9 8l1.2-1.2 2.1 2.1 4.8-4.8 1.2 1.2z'/%3E%3C/svg%3E");
}
.pill.preparing::before, .pill.attempting::before, .pill.awaiting-approval::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 1.5a6.5 6.5 0 1 0 .01 13.01A6.5 6.5 0 0 0 8 1.5zM7.2 4h1.6v4.1l2.6 1.5-.8 1.3L7.2 9z'/%3E%3C/svg%3E");
}
.pill.failed::before, .pill.needs-human-action::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 1.4 15 14H1zM7.2 6h1.6v4H7.2zm0 5h1.6v1.6H7.2z'/%3E%3C/svg%3E");
}
.pill.scheduled, .pill.confirmed { background: var(--green-soft); color: var(--green); }
.pill.preparing, .pill.attempting, .pill.awaiting-approval { background: var(--amber-soft); color: var(--amber); }
.pill.failed, .pill.needs-human-action { background: var(--red-soft); color: var(--rust); }
.pill.cancelled { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.login-card { width: min(440px, 100%); margin: 6vh auto; }
.checks { display: flex; gap: 0.55rem; align-items: center; }
.checks input { width: auto; min-height: 1.1rem; }
footer { color: var(--muted); font-size: 0.85rem; padding-bottom: 2.5rem; }
.error { color: var(--rust); }

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  background: linear-gradient(145deg, #10281f 0%, #1b4d3b 62%, #3d6b4f 100%);
  color: var(--hero-ink);
  border-color: transparent;
}
.hero .muted, .hero h2, .hero a:not(.button) { color: inherit; }
.hero .eyebrow { color: #e4c48a; }
.countdown {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0;
  letter-spacing: -0.03em;
}

.calendar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 6.2rem;
  gap: 0.6rem;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 0.2rem 0.1rem 0.7rem;
  scroll-snap-type: x mandatory;
}
.day {
  scroll-snap-align: start;
  display: grid;
  align-content: space-between;
  min-height: 7rem;
  padding: 0.75rem;
  border-radius: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
.day strong { font-family: var(--serif); font-size: 1.6rem; line-height: 1; }
.day-name { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.day span:last-child { font-size: 0.78rem; color: var(--muted); }
.day.is-unavailable { opacity: 0.62; }
.day.is-flagged { border-color: var(--gold); background: var(--gold-soft); }

.strategy-grid { display: grid; gap: 0.8rem; }
.strategy-grid article {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}
.pick { margin-bottom: 0; }
.choice { grid-template-columns: auto 1fr; align-items: start; }
.choice input { margin-top: 0.35rem; }

.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.rank-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 0.9rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.9rem;
  box-shadow: var(--shadow);
}
.rank-item.is-dragging { opacity: 0.55; }
.rank-item:focus-visible { outline-offset: 4px; }
.swatch {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fffaf3;
  font-family: var(--serif);
  overflow: hidden;
}
.swatch img { width: 100%; height: 100%; object-fit: cover; }
.rank-copy p { margin: 0.2rem 0 0.55rem; }
.rank-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; grid-column: 1 / -1; }

.range-card { display: grid; gap: 0.7rem; }
.range-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.range-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20%;
  width: 40%;
  background: linear-gradient(90deg, var(--pine), var(--gold));
  border-radius: inherit;
}

.timeline { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.timeline li, .skeleton-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
  align-items: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
}
.skeleton {
  display: block;
  height: 0.85rem;
  width: min(16rem, 70%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--line), var(--paper), var(--line));
  background-size: 200% 100%;
  animation: sheen 1.2s linear infinite;
}
.skeleton.short { width: 5rem; }
.celebrate { border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); }

@keyframes sheen {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (min-width: 800px) {
  .strategy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strategy-grid article { border-top: 0; padding-top: 0; }
  .rank-item { grid-template-columns: auto 1fr auto; align-items: start; }
  .rank-actions { grid-column: auto; flex-direction: column; align-items: stretch; }
}

@media (max-width: 800px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .top { align-items: flex-start; flex-direction: column; }
  .top-actions, nav { justify-items: start; justify-content: flex-start; }
  .more div { left: 0; right: auto; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    margin: 0.6rem 0;
    padding: 0.45rem 0.75rem;
    background: var(--paper-2);
  }
  td { border: 0; padding: 0.25rem 0; }
  td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

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

.fairway {
  position: relative;
  overflow: hidden;
  color: #f6f1e6;
  border-radius: 28px;
  padding: 1.35rem 1.3rem 1.1rem;
  margin: 0.2rem 0 1rem;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.045) 0 12px, rgba(0,0,0,0.06) 12px 24px),
    radial-gradient(420px 160px at 100% 0%, rgba(228,196,138,0.22), transparent 70%),
    linear-gradient(155deg, #0d241c 0%, #1a4636 52%, #245c45 100%);
}
.fairway h1, .fairway p, .fairway a:not(.button) { color: inherit; }
.fairway .eyebrow { color: #e4c48a; }
.fairway .secondary {
  color: #f6f1e6;
  border-color: rgba(246, 241, 230, 0.4);
  background: transparent;
}
.button.gold { background: #e4c48a; color: #1c1608; }
.hero-layout {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.2rem 2rem;
  align-items: flex-end;
}
.hero-copy { margin: 0.2rem 0 0.9rem; max-width: 36rem; }
.quick { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.clock-block { text-align: right; }
.clock-face {
  display: flex;
  gap: 0.35rem;
}
.clock-face > span {
  min-width: 3.4rem;
  text-align: center;
}
.clock-face > span[hidden] { display: none; }
.clock-face b {
  display: block;
  font-family: var(--serif);
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.clock-face small {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.78;
}
.fairway .learn summary { color: #e4c48a; }
.fairway .pill {
  background: rgba(255,255,255,0.12);
  color: inherit;
  border-color: transparent;
}

.feature {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
}
.feature-time {
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0;
  line-height: 1;
}
.feature-mark {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--pine-deep);
}
.feature-mark svg, .strategy-art svg, .empty-art { width: 100%; height: 100%; }
.empty { display: flex; gap: 0.8rem; align-items: center; }
.empty-art { width: 5.5rem; height: 3.4rem; color: var(--pine); flex: none; }
.feature .empty { grid-column: 1 / -1; }

.learn { margin-top: 0.8rem; }
.learn summary { cursor: pointer; font-weight: 600; color: var(--pine-deep); }
.learn p { margin: 0.4rem 0 0; color: var(--muted); }

.field-label { margin: 0 0 0.28rem; font-size: 0.92rem; }
.opens {
  display: inline-block;
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
  background: var(--gold-soft);
  color: #6d5420;
}
:root[data-theme="dark"] .opens { color: #f0e2c2; }
button.day { font: inherit; text-align: left; cursor: pointer; }
button.day.is-selected { outline: 2px solid var(--gold); outline-offset: 2px; }

.stepper { display: grid; grid-template-columns: 2.7rem 1fr 2.7rem; gap: 0.35rem; }
.stepper input { text-align: center; font-variant-numeric: tabular-nums; }
.party-faces { display: flex; gap: 0.35rem; margin-top: 0.45rem; }
.avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pine);
  color: #f7f3ea;
  font-size: 0.75rem;
  font-weight: 600;
}
.avatar.is-you {
  width: auto;
  min-width: 2rem;
  padding: 0 0.45rem;
  border-radius: 999px;
}
.partner-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.partner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.75rem 0.2rem 0.2rem;
  cursor: pointer;
}
.partner input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  min-height: 0;
}
.partner:has(input:checked) {
  border-color: var(--pine);
  background: var(--green-soft);
}
.partner:has(input:focus-visible) { outline: 3px solid var(--gold); }

.range-stack { position: relative; height: 2.5rem; margin-top: 0.2rem; max-width: 100%; min-width: 0; }
.range-stack .range-track {
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  top: 1.05rem;
  overflow: visible;
}
#range-fill { background: var(--pine); }
#range-mark {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--paper-2);
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.range-stack input[type="range"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  min-height: 0;
  background: transparent;
  border: 0;
  pointer-events: none;
  appearance: none;
}
.range-stack input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 0.4rem; }
.range-stack input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: -0.38rem;
  border-radius: 50%;
  background: var(--pine);
  border: 2px solid var(--paper-2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.28);
}
.range-stack input.target::-webkit-slider-thumb { background: var(--gold); }
.range-stack input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--pine);
  border: 2px solid var(--paper-2);
}
.range-stack input.target::-moz-range-thumb { background: var(--gold); }
.range-stack input[type="range"]::-moz-range-track { background: transparent; border: 0; }

.strategy-card, .choice-grid .choice {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.85rem;
}
.strategy-art {
  width: 2.4rem;
  height: 2.4rem;
  color: var(--pine);
  margin-bottom: 0.35rem;
}
.strategy-card h3 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.strategy-card .muted, .choice .muted { display: block; font-size: 0.86rem; }
.choice-grid {
  display: grid;
  gap: 0.7rem;
  border: 0;
  padding: 0;
}
.choice-grid legend { padding: 0; }
.choice-grid .choice {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  position: relative;
  cursor: pointer;
}
.choice-grid .choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  min-height: 0;
}
.choice-grid .choice:has(input:checked) {
  border-color: var(--pine);
  box-shadow: inset 0 0 0 1px var(--pine);
  background: color-mix(in srgb, var(--green-soft) 70%, var(--paper-2));
}
.choice-grid .choice:has(input:focus-visible) { outline: 3px solid var(--gold); }

.rank-list .rank-item {
  grid-template-columns: auto auto 1fr;
  grid-template-areas:
    "handle badge copy"
    "actions actions actions"
    "adjust adjust adjust";
  align-items: center;
}
.handle {
  grid-area: handle;
  color: var(--muted);
  letter-spacing: -0.2em;
  cursor: grab;
  font-size: 1.1rem;
  padding-right: 0.15rem;
}
.rank-badge {
  grid-area: badge;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--pine);
  color: #f7f3ea;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}
.rank-list .rank-copy {
  grid-area: copy;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
}
.rank-list .rank-copy p {
  margin: 0.1rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rank-list .rank-actions { grid-area: actions; }
.adjust { grid-area: adjust; }
details:not([open]) > *:not(summary) { display: none; }
.adjust summary { cursor: pointer; font-weight: 600; color: var(--pine-deep); }
.adjust .grid { margin-top: 0.55rem; }
.savebar {
  position: sticky;
  bottom: 0.75rem;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  background: color-mix(in srgb, var(--paper-2) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.55rem 0.65rem 0.55rem 0.9rem;
  box-shadow: var(--shadow);
}

.tabbar { display: none; }
.sheet[hidden] { display: none !important; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: rgba(12, 22, 18, 0.46);
  display: grid;
  align-items: end;
}
.sheet-card {
  background: var(--paper-2);
  border-radius: 22px 22px 0 0;
  padding: 0.9rem 1rem 5.6rem;
  display: grid;
  gap: 0.15rem;
  max-height: 78vh;
  overflow: auto;
}
.sheet-card a {
  text-decoration: none;
  padding: 0.7rem 0.15rem;
  border-bottom: 1px solid var(--line);
}
.tabbar a, .tabbar button.tab {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 12px;
  min-height: 3.15rem;
  padding: 0.2rem 0.1rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.05rem;
  text-decoration: none;
  box-shadow: none;
}
.tabbar svg { width: 1.25rem; height: 1.25rem; }
.tabbar a[aria-current="page"], .tabbar button.tab[aria-expanded="true"] { color: var(--pine-deep); }

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  max-width: min(24rem, calc(100% - 2rem));
  margin: 0;
  box-shadow: var(--shadow);
}
.table-wrap { overflow-x: auto; }

@media (min-width: 801px) {
  .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice-grid legend { grid-column: 1 / -1; }
  .rank-list .rank-item {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      "handle badge copy actions"
      "adjust adjust adjust adjust";
  }
}

@media (max-width: 800px) {
  .primary-nav, .desktop-more { display: none; }
  .top { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .header-tools { margin-left: auto; }
  .tabbar {
    display: grid;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    grid-template-columns: repeat(6, 1fr);
    background: color-mix(in srgb, var(--paper-2) 92%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 0.2rem 0.15rem calc(0.25rem + env(safe-area-inset-bottom));
  }
  body.has-nav { padding-bottom: 4.8rem; }
  .savebar { bottom: 4.8rem; }
  .toast { bottom: 5.1rem; }
  .feature { grid-template-columns: 1fr; }
  .clock-block { text-align: left; }
  .clock-face > span { min-width: 2.8rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .card, .rank-item, .strategy-card, .choice, .day { transition: transform 160ms ease, box-shadow 160ms ease; }
  .toast { animation: rise 220ms ease; }
  .sheet-card { animation: rise 200ms ease; }
}
@keyframes rise {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
