/*
  Design tokens. This app is deliberately light only. color-scheme on the root stops the browser
  from auto darkening form controls and scrollbars, which is what produces the half dark look when
  a light page is opened on a device set to dark.
*/

:root {
  color-scheme: light;

  --bg: #f5f7f9;
  --bg-accent: #eef2f5;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #111a24;
  --muted: #5c6b7a;
  --line: #e2e8ef;
  --line-strong: #cfd8e3;

  --accent: #12583a;
  --accent-hover: #17703f;
  --accent-ink: #ffffff;
  --accent-soft: #eaf4ee;

  --yes: #1c8a4e;
  --yes-bg: #e6f5ec;
  --maybe: #a86a12;
  --maybe-bg: #fdf3e0;
  --no: #b03636;
  --no-bg: #fbeaea;
  --best-bg: #eaf6f0;
  --best-line: #b9dfc9;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 32, 43, .05), 0 6px 20px rgba(16, 32, 43, .05);
  --shadow-lg: 0 2px 4px rgba(16, 32, 43, .06), 0 16px 40px rgba(16, 32, 43, .09);
  --header-h: 58px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* Site chrome */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

/* Falls back to the solid background above where backdrop-filter is unsupported. */
@supports (backdrop-filter: blur(8px)) {
  .site-header {
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: saturate(1.6) blur(8px);
  }
}

.site-header-inner,
.site-footer-inner {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.2px;
  color: var(--ink);
  text-decoration: none;
}

.wordmark svg { display: block; color: var(--accent); }
.wordmark:hover { color: var(--accent); }

.wordmark-sub {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  padding-left: 12px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}

.site-nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.site-nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
}

.site-nav a:hover { color: var(--ink); background: var(--surface-2); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding: 22px 0 40px;
  background: var(--bg-accent);
}

.site-footer-inner {
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer strong { color: var(--ink); font-size: 13px; }
.site-footer .spacer { margin-left: auto; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 16px 8px;
}

/* Kept for any markup still using the old brand block. */
.brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.brand strong { font-size: 18px; letter-spacing: -.2px; }
.brand span { color: var(--muted); font-size: 13px; }

/* Hero */

.hero { margin: 4px 0 26px; }

.hero h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -.8px;
  margin: 0 0 10px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 60ch;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 11px;
  margin-bottom: 14px;
}

/* Cards and type */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}

h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: -.5px; }
h2 { font-size: 13px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
p.lede { margin: 0 0 18px; color: var(--muted); }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }

input[type=text], input[type=date], input[type=time], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  color: inherit;
  background: var(--surface);
}

input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }

input:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

textarea { resize: vertical; min-height: 74px; }

.field { margin-bottom: 15px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }

button {
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 15px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

button:hover { border-color: var(--muted); background: var(--surface-2); }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(16, 32, 43, .12);
}

button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--no); border-color: var(--line-strong); }
button.danger:hover { border-color: var(--no); background: var(--no-bg); }
button.link { border: 0; background: none; padding: 5px 7px; color: var(--muted); font-weight: 500; }
button.link:hover { color: var(--accent); background: none; text-decoration: underline; }
button[disabled] { opacity: .5; cursor: not-allowed; }

.option-row {
  display: grid;
  grid-template-columns: 1fr 150px 40px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }

.notice {
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.notice.error { background: var(--no-bg); color: var(--no); border-color: var(--no); }
.notice.info { background: var(--accent-soft); color: var(--accent); border-color: var(--best-line); }

/* Grid */

.grid-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table.grid { border-collapse: separate; border-spacing: 0; width: 100%; }

table.grid th, table.grid td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: center;
  white-space: nowrap;
}

table.grid tbody tr:last-child td { border-bottom: 0; }

table.grid thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-size: 13px;
  z-index: 2;
}

.name-col {
  position: sticky;
  left: 0;
  background: var(--surface);
  text-align: left !important;
  min-width: 170px;
  z-index: 1;
  font-weight: 600;
}

thead .name-col { background: var(--surface-2); z-index: 3; }

.col-date { font-weight: 700; }
.col-dow, .col-time { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }

th.best { background: var(--best-bg) !important; box-shadow: inset 0 2px 0 var(--accent); }
td.best { background: var(--best-bg); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.pill.yes { background: var(--yes-bg); color: var(--yes); }
.pill.maybe { background: var(--maybe-bg); color: var(--maybe); }
.pill.no { background: var(--no-bg); color: var(--no); }
.pill.none { color: var(--line-strong); }

button.cell {
  width: 40px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  font-size: 15px;
}

button.cell.yes { background: var(--yes-bg); border-color: var(--yes); color: var(--yes); }
button.cell.maybe { background: var(--maybe-bg); border-color: var(--maybe); color: var(--maybe); }
button.cell.no { background: var(--no-bg); border-color: var(--no); color: var(--no); }

tr.editing td { background: var(--accent-soft); }
tr.mine .name-col::after { content: " (you)"; color: var(--muted); font-weight: 400; font-size: 12px; }

tfoot td { font-weight: 700; background: var(--surface-2); }
tfoot .tally-sub { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }

.row-tools { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.winner {
  background: var(--best-bg);
  border: 1px solid var(--best-line);
  border-radius: var(--radius);
  padding: 15px 17px;
  margin-bottom: 20px;
}

.winner strong { color: var(--accent); }

.comment { border-top: 1px solid var(--line); padding: 13px 0; }
.comment:first-of-type { border-top: 0; }
.comment .meta { font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.comment .meta b { color: var(--ink); font-size: 14px; }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; }

.share { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }

.share input {
  flex: 1 1 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--surface-2);
}

.muted { color: var(--muted); font-size: 13px; }
.closed-banner { background: var(--maybe-bg) !important; color: var(--maybe) !important; border-color: var(--maybe) !important; }

@media (max-width: 620px) {
  .hero h1 { font-size: 27px; }
  .hero p { font-size: 16px; }
  .option-row { grid-template-columns: 1fr 120px 36px; }
  .name-col { min-width: 130px; }
  .wordmark-sub { display: none; }
  .card { padding: 18px; }
}

/* Respect a reduced motion preference. The transitions here are decorative only. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
