/* do.not.omit.me — hand-rolled styles, no framework.
   Design rule: the grid is the only colored thing on the page; all chrome is
   monochrome. Type is Avenir Next (Apple platforms) with graceful fallback. */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #191919;
  --muted: #6e6e6e;
  --line: #dcdcdc;
  --off: #f0f0ee;
  /* The only color on the page lives in grid cells: */
  --paint-yes: #2f6f4f;
  --paint-maybe: #e0a63c;
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Header / footer */
.site-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  height: 1.9rem;
  width: auto;
  max-width: 100%;
  display: block;
}

.tagline { color: var(--muted); font-size: 0.9rem; }

.site-nav { margin-left: auto; display: flex; gap: 1rem; align-items: baseline; }
.site-nav a { color: var(--ink); font-size: 0.9rem; }

/* Auth & dashboard */
.auth-card { max-width: 30rem; }
.auth-links { margin-bottom: 0; }
.auth-links a { color: var(--ink); }

.poll-list { list-style: none; margin: 0; padding: 0; }
.poll-list li {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.poll-list li:last-child { border-bottom: none; }
.poll-list a { color: var(--ink); }
.poll-dates { margin-left: auto; color: var(--muted); font-size: 0.9rem; }
/* A poll whose last offered date has passed reads as done — mute the whole
   row, including the title link and its date. */
.poll-list li.past,
.poll-list li.past a,
.poll-list li.past .poll-dates { color: var(--muted); }

.site-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer a { color: var(--ink); }

/* Hero */
.hero { text-align: center; margin: 2.5rem auto 2rem; max-width: 40rem; }
.hero h1 { font-size: 2rem; margin: 0 0 0.5rem; }
.hero em { font-style: normal; text-decoration: underline; text-underline-offset: 0.2em; }
.hero p { color: var(--muted); margin: 0; }

/* Cards & forms */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 0 auto 1.5rem;
}

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.field .hint { color: var(--muted); font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
select, textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > .field { flex: 1 1 10rem; margin-bottom: 0; }

button, .btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

button:hover, .btn:hover { background: #3a3a3a; }

button:disabled, .btn:disabled {
  background: var(--off);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

/* Card heading with an action (e.g. the dashboard's create-poll button). */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.card-head h2 { margin: 0; }

.hero .cta { margin-top: 1.25rem; }

/* Prominent dashboard notice (e.g. the resume-emails control). */
.notice { border-color: var(--ink); }
.notice p { margin: 0 0 0.75rem; }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
}

.btn-secondary:hover { background: var(--off); }

.errors {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}

.errors ul { margin: 0; padding-left: 1.2rem; }

.notice {
  background: var(--off);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}

.muted { color: var(--muted); }
.form-actions { margin-top: 1.25rem; }

/* Create form */
.create-form { max-width: 60rem; }

/* Date picker */
.dp-nav { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }

.dp-nav button {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  padding: 0.25rem 0.7rem;
  font-weight: 500;
}

.dp-nav button:hover { background: var(--off); }
.dp-nav button:disabled { opacity: 0.4; cursor: default; background: var(--surface); }

.dp-months { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.month { border-collapse: collapse; }

.month caption { font-weight: 600; padding-bottom: 0.35rem; }

.month th {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
  padding: 0.15rem;
}

.month td { padding: 1px; }

.month button {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font-weight: 400;
}

.month button:hover:not(:disabled) { border-color: var(--ink); background: none; }

.month button:disabled { color: #c6c8cd; cursor: default; }

.month button.selected {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* Link boxes (admin page) */
.linkbox { display: flex; gap: 0.5rem; }
.linkbox input { flex: 1; color: var(--muted); }

/* Poll page */
.event-head { margin: 1rem 0 1.5rem; }
.event-head h1 { margin: 0 0 0.25rem; }
.event-head p { margin: 0.15rem 0; }
.join-card { max-width: 46rem; }

.tz-note { margin-top: 0.5rem; font-size: 0.9rem; }
.tz-note select { width: auto; max-width: 16rem; padding: 0.2rem 0.4rem; font-size: 0.85rem; }

/* Availability grid */
.grid-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; }
.grid-head h2 { margin: 0; }

.inline-form { display: inline; }

.linklike {
  background: none;
  border: none;
  color: var(--ink);
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.linklike:hover { background: none; color: var(--muted); }

.paint-controls { display: flex; align-items: center; gap: 1rem; margin: 0.75rem 0 0.25rem; }

.mode-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }

.mode-btn {
  border: none;
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  padding: 0.4rem 0.9rem;
}

.mode-btn:hover { background: var(--off); }
.mode-btn.active { background: var(--ink); color: #fff; }

#save-status { font-size: 0.85rem; }

.grid-scroll {
  overflow: auto;
  max-height: 70vh;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.slot-grid {
  border-collapse: separate;
  border-spacing: 0;
  user-select: none;
  -webkit-user-select: none;
}

.slot-grid th, .slot-grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }

.slot-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  white-space: nowrap;
}

/* Grid cells — the only colored pixels on the page. */
td.slot, td.heat {
  width: 5.5rem;
  min-width: 4.2rem;
  height: 1.4rem;
  background: var(--off);
  font-size: 0.7rem;
  text-align: center;
  color: var(--muted);
  white-space: nowrap;
  padding: 0 0.3rem;
}

td.slot { cursor: pointer; touch-action: none; }

td.slot.lvl-2 { background: var(--paint-yes); color: #fff; }
td.slot.lvl-1 { background: var(--paint-maybe); color: #fff; }

td.slot.off, td.heat.off {
  background: var(--surface);
  cursor: default;
  touch-action: auto;
}

.legend { font-size: 0.85rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

.swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--off);
  margin-left: 0.75rem;
}

.swatch:first-child { margin-left: 0; }
.swatch.lvl-2 { background: var(--paint-yes); }
.swatch.lvl-1 { background: var(--paint-maybe); }
.swatch.off { background: var(--surface); }

/* Heatmap */
.heatmap-card { margin-top: 1.5rem; }

td.heat-1 { background: #e8f2ec; }
td.heat-2 { background: #d2e6da; }
td.heat-3 { background: #bcdac9; }
td.heat-4 { background: #a5ceb7; }
td.heat-5 { background: #8bbfa2; }
td.heat-6 { background: #6fae8b; }
td.heat-7 { background: #4f9770; color: #fff; }
td.heat-8 { background: var(--paint-yes); color: #fff; }

.empty-state { padding: 1rem 0; }

.best-times { margin: 0.75rem 0 1rem; }
.best-times h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.best-times ol { margin: 0; padding-left: 1.4rem; }
.best-times li { margin-bottom: 0.15rem; }

.everyone {
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-left: 0.35rem;
}

/* Finalized poll */
.finalized-banner { border-width: 2px; border-color: var(--ink); }
.finalized-banner h2 { margin: 0 0 0.25rem; }
.finalized-banner a { color: var(--ink); }

table#paint-grid[data-finalized] td.slot { cursor: default; touch-action: auto; }

/* The chosen cell keeps its heat color; the ring is monochrome chrome. */
td.heat.chosen { outline: 3px solid var(--ink); outline-offset: -3px; }

/* Admin roster & finalize */
.roster { border-collapse: collapse; width: 100%; margin-top: 1rem; }
.roster th {
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  padding: 0.3rem 0.6rem 0.3rem 0;
}
.roster td { padding: 0.3rem 0.6rem 0.3rem 0; border-top: 1px solid var(--line); }

.finalize-form select { max-width: 32rem; }

/* Poll page layout: content column + participant panel on the right. */
.poll-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.poll-main { flex: 1; min-width: 0; }

.panel-card {
  flex: 0 0 14rem;
  position: sticky;
  top: 1rem;
  margin: 0;
  padding: 1.1rem 1.25rem;
}

.panel-card h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }

.participant-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

.participant-list li {
  padding: 0.15rem 0;
  color: var(--ink);
}

.participant-list li .org-tag { font-size: 0.75rem; }

/* Hover states — monochrome by design: */
.participant-list li.p-yes { font-weight: 700; }
.participant-list li.p-maybe { font-weight: 400; color: var(--ink); }
.participant-list li.p-no { color: #b5b5b5; }
.participant-list li.p-no .org-tag { color: #b5b5b5; }

.p-no-sample { color: #b5b5b5; }

@media (max-width: 900px) {
  .poll-layout { flex-direction: column; }
  .panel-card { position: static; flex: none; width: 100%; }
}
