@font-face { font-family: 'Unbounded'; src: url('/fonts/unbounded-latin-wght-normal.woff2') format('woff2'); font-weight: 200 900; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree-latin-wght-normal.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
  --bg: #F6F7F4; --ink: #1E3B2F; --muted: #56645C; --accent: #C2470A; --accent-hover: #A63C08;
  --panel: #E8ECE5; --line: rgb(30 59 47 / 0.12); --control-line: #737F77;
  --radius: 12px; --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 'Figtree', system-ui, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2 { font-family: 'Unbounded', 'Figtree', sans-serif; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); margin-top: 1.5rem; }
h2 { font-size: 1.15rem; letter-spacing: 0; margin-bottom: 1rem; }
p { margin: 0; }
.muted { color: var(--muted); }
button, input { font: inherit; color: inherit; }

.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.head { border-bottom: 1px solid var(--line); padding-block: 0.9rem; }
.brand { font-family: 'Unbounded', sans-serif; font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }
.lede { margin: 0.6rem 0 1.5rem; color: var(--muted); }
main { padding-bottom: 3rem; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
main > h1, main > .lede { grid-column: 1 / -1; }
@media (min-width: 960px) {
  main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  main > .card:first-of-type { grid-column: 1 / -1; }
}

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.card[hidden] { display: none; }

/* Name chips: ASOS-style filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { border: 1px solid var(--control-line); background: #fff; border-radius: 999px; padding: 0.55rem 1.1rem; min-height: 44px; cursor: pointer; transition: background-color 180ms var(--ease), color 180ms var(--ease); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.other { display: grid; gap: 0.35rem; margin-top: 1rem; max-width: 20rem; font-weight: 500; }
.other[hidden] { display: none; }
.other input { border: 1px solid var(--control-line); border-radius: 8px; padding: 0.6rem 0.75rem; min-height: 44px; background: #fff; }

/* Date grid: When2meet-style tap cells, one row per weekend */
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); margin-bottom: 0.9rem; }
.key::before { content: ''; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.4em; vertical-align: -0.1em; border-radius: 3px; border: 1px solid var(--control-line); background: #fff; }
.key-free::before { background: var(--ink); border-color: var(--ink); }
.key-maybe::before { background: repeating-linear-gradient(135deg, #F3D9C9 0 4px, #fff 4px 8px); border-color: var(--accent); }
.grid { display: grid; gap: 0.4rem; }
.wk { display: grid; grid-template-columns: 5rem 1fr 1fr; gap: 0.4rem; align-items: center; }
.wk-label { font-size: 0.9rem; color: var(--muted); }
@media (min-width: 600px) { .wk { grid-template-columns: 7.5rem 1fr 1fr; } }
.day { display: grid; gap: 0; text-align: left; padding: 0.45rem 0.75rem; min-height: 52px; border: 1px solid var(--control-line); border-radius: 8px; background: #fff; cursor: pointer; transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease); }
.day-name { font-weight: 600; line-height: 1.25; }
.day-state { font-size: 0.85rem; line-height: 1.25; color: var(--muted); }
.day[data-state="free"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.day[data-state="free"] .day-state { color: rgb(255 255 255 / 0.85); }
.day[data-state="maybe"] { background: repeating-linear-gradient(135deg, #F3D9C9 0 6px, #FBF0E9 6px 12px); border-color: var(--accent); }
.day[data-state="maybe"] .day-state { color: var(--accent-hover); font-weight: 600; }
.day:active { transform: scale(0.98); }

.savebar { position: sticky; bottom: 0; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: 1rem -1.25rem -1.25rem; padding: 0.9rem 1.25rem; background: rgb(255 255 255 / 0.95); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.save { background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 0.7rem 1.4rem; min-height: 44px; font-weight: 600; cursor: pointer; transition: background-color 160ms var(--ease); }
.save:hover { background: var(--accent-hover); }
.save:disabled { opacity: 0.6; cursor: default; }
.status { font-size: 0.9rem; color: var(--muted); }

/* Results: Doodle-style participant table */
.best { margin-bottom: 1rem; }
.tkey { margin-top: 0.75rem; font-size: 0.85rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.4rem 0.35rem; text-align: center; border-bottom: 1px solid var(--line); }
thead th { font-weight: 600; font-size: 0.85rem; overflow-wrap: anywhere; }
tbody th { text-align: left; font-weight: 500; white-space: nowrap; }
tr.sat > * { border-top: 2px solid var(--line); }
.c-free { color: var(--ink); font-weight: 700; background: rgb(30 59 47 / 0.08); }
.c-maybe { color: var(--accent-hover); font-weight: 700; }
.c-no { color: var(--muted); opacity: 0.6; }
.tot { font-weight: 600; white-space: nowrap; }
tr.all > * { background: rgb(30 59 47 / 0.16); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .day:active { transform: none; } }
