/* WhenWorks - design tokens, layout, components. No purple. Mobile-first. */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f4f0e8;
  --ink: #1a1a1a;
  --ink-2: #4a4a4a;
  --ink-3: #7a7a7a;
  --line: #e7e2d6;
  --line-strong: #d4cdb9;
  --accent: #c8531a;     /* warm orange (no purple) */
  --accent-ink: #ffffff;
  --yes: #2e7d52;        /* forest green */
  --maybe: #b07a14;      /* amber */
  --no: #b04b3a;         /* clay red */
  --shadow-sm: 0 1px 2px rgba(20,16,8,.06), 0 2px 6px rgba(20,16,8,.04);
  --shadow-md: 0 6px 20px rgba(20,16,8,.08);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --pad: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--surface-2);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 18px 100px; }
.wrap.narrow { max-width: 520px; }

header.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0 20px;
  font-weight: 700; letter-spacing: -0.01em; font-size: 18px;
}
header.brand .dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-ink); font-size: 14px; font-weight: 800;
}
header.brand .brand-home { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 700; }
header.brand small { color: var(--ink-3); font-weight: 500; margin-left: 6px; }
header.brand .voting-as {
  margin-left: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0;
}

h1 {
  font-size: 28px; line-height: 1.15; margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.subtitle { color: var(--ink-2); margin: 0 0 24px; font-size: 16px; }
h2 { font-size: 20px; margin: 28px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 20px 0 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card.flat { box-shadow: none; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.help { font-size: 13px; color: var(--ink-3); margin-top: 6px; }

input[type=text], input[type=email], input[type=date], input[type=time], input[type=datetime-local], textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,83,26,.18);
}
textarea { min-height: 76px; resize: vertical; }

.mode-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--surface-2);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.mode-toggle button {
  appearance: none;
  border: none; background: transparent;
  padding: 10px 12px; font: inherit; font-weight: 600;
  border-radius: 10px; color: var(--ink-2);
  cursor: pointer;
}
.mode-toggle button.active {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn {
  appearance: none; border: none; cursor: pointer;
  font: inherit; font-weight: 600;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  transition: transform .04s ease, opacity .15s ease;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.saved { background: var(--ink-3); opacity: 1; cursor: default; }
.btn.saved:hover { opacity: 1; }
.btn.saved:active { transform: none; }
.btn.primary { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn.danger { background: transparent; color: var(--no); }
.btn.full { width: 100%; }
.btn.small { min-height: 36px; padding: 8px 12px; font-size: 14px; border-radius: 8px; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--ink-2);
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.choice {
  appearance: none; cursor: pointer;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 6px;
  font: inherit; font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  min-height: 46px;
  transition: all .12s ease;
  user-select: none;
}
.choice.yes.active { background: #e7f1ea; border-color: var(--yes); color: var(--yes); }
.choice.maybe.active { background: #f6ecd9; border-color: var(--maybe); color: var(--maybe); }
.choice.no.active { background: #f3dfd9; border-color: var(--no); color: var(--no); }

.option-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}
.option-card .when {
  font-weight: 600;
  font-size: 15px;
  flex: 0 0 70px;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
}
.option-card .when .wk { font-size: 16px; font-weight: 700; color: var(--ink); }
.option-card .when .mo { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.option-card .when .time { color: var(--ink-3); font-weight: 500; font-size: 13px; margin-top: 2px; }
.option-card .choices { flex: 1; margin-top: 0; }

.parse-result {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.parse-result .chip {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 10px;
}
.calendar .dow {
  text-align: center; font-size: 11px; color: var(--ink-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 0;
}
.calendar .day {
  appearance: none; border: 1px solid transparent; background: transparent;
  font: inherit; padding: 0;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  transition: background .1s ease;
  min-height: 42px;
}
.calendar .day.out { color: var(--ink-3); opacity: .4; cursor: default; }
.calendar .day.today { border-color: var(--line-strong); }
.calendar .day.past { color: var(--ink-3); opacity: .55; cursor: not-allowed; }
.calendar .day.selected { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.calendar .day:hover:not(.out):not(.past):not(.selected) { background: var(--surface-2); }

.cal-head {
  display: flex; align-items: center; justify-content: space-between; margin-top: 12px;
}
.cal-head button { appearance: none; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
.cal-head .month-label { font-weight: 600; }

/* Bulk action bar */
.bulkbar {
  display: flex; gap: 6px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 12px;
}
.bulkbar button {
  flex: 1; appearance: none; border: none; background: transparent; font: inherit; font-weight: 600;
  padding: 8px 6px; border-radius: 8px; cursor: pointer;
  color: var(--ink-2);
}
.bulkbar button.active { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); }

/* Result grid */
.results { width: 100%; border-collapse: separate; border-spacing: 0; }
.results th, .results td {
  text-align: center; padding: 10px 6px; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.results th { color: var(--ink-2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.results td.when { text-align: left; font-weight: 600; }
.results td.when small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.results td.best { background: linear-gradient(180deg, #f7f0e0 0%, transparent 100%); position: relative; }
.results td.best::after { content: '★'; position: absolute; top: 4px; right: 6px; color: var(--accent); font-size: 12px; }
.results td.counts { font-variant-numeric: tabular-nums; vertical-align: top; }
.resp-avatars { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; margin-top: 5px; }
.resp-avatar { position: relative; width: 20px; height: 20px; border-radius: 50%; background: #d4ead9; color: var(--yes); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: default; }
.resp-avatar::after { content: attr(data-name); position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 10; }
.resp-avatar:hover::after { opacity: 1; }
.results .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.results .dot.yes { background: var(--yes); }
.results .dot.maybe { background: var(--maybe); }
.results .dot.no { background: var(--no); }

.best-line {
  background: linear-gradient(180deg, #f6efe0 0%, #faf3e2 100%);
  border: 1px solid #ead9a6;
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  font-size: 15px;
}
.best-line strong { color: var(--ink); }

.share-box {
  display: flex; gap: 8px; align-items: stretch; margin-top: 10px;
}
.share-box input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.notice {
  background: #f3ecd9;
  border: 1px solid #e0d2a5;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.notice.warn { background: #f7e1d7; border-color: #e8b8a8; }
.notice.ok { background: #e3efe6; border-color: #b5d6c0; }

.empty {
  text-align: center; padding: 40px 18px; color: var(--ink-3);
}

.invite-row { display: flex; gap: 8px; }
.invite-row input { flex: 1; }

.tabs {
  display: flex; gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.tabs button {
  flex: 1; appearance: none; border: none; background: transparent; font: inherit; font-weight: 600;
  padding: 10px 12px; border-radius: 9px; cursor: pointer; color: var(--ink-2);
}
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

footer.foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 24px 0; }

@media (min-width: 720px) {
  h1 { font-size: 34px; }
  .wrap { padding: 40px 24px 100px; }
}

/* ---- Wizard ---- */
.wizard-steps {
  display: flex; align-items: center;
  margin-bottom: 32px;
}
.wstep {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  color: var(--ink-3);
  font-weight: 700; font-size: 14px;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.wstep.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.wstep.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.wstep.done span { display: none; }
.wstep.done::after { content: '\2713'; font-size: 14px; font-weight: 800; }
.wstep-line { flex: 1; height: 2px; background: var(--line); transition: background .2s ease; }
.wstep-line.done { background: var(--accent); }

.step-view { animation: fadeIn .18s ease; }

.big-input {
  display: block; width: 100%;
  font: inherit; font-size: 20px; font-weight: 600;
  padding: 16px 18px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  margin-bottom: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.big-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,83,26,.18);
}

.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.quick-chip {
  appearance: none;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 8px 16px;
  font: inherit; font-size: 14px; color: var(--ink-2);
  cursor: pointer; transition: border-color .1s ease, color .1s ease;
}
.quick-chip:hover { border-color: var(--accent); color: var(--accent); }

.cal-count {
  text-align: center; color: var(--ink-3); font-size: 14px;
  margin: 10px 0 16px; min-height: 20px;
}

.mode-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.mode-card {
  appearance: none; width: 100%;
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: var(--surface); border: 2px solid var(--line-strong);
  border-radius: var(--radius); padding: 18px;
  font: inherit; cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.mode-card strong { font-size: 17px; color: var(--ink); }
.mode-card span { font-size: 14px; color: var(--ink-2); }
.mode-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,83,26,.12); }
.mode-card.selected { border-color: var(--accent); background: #fff8f5; }

.close-note {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 14px; color: var(--ink-2);
}
.link-btn {
  appearance: none; border: none; background: transparent;
  color: var(--accent); font: inherit; font-size: 14px;
  cursor: pointer; padding: 0; margin-left: 4px;
  text-decoration: underline;
}

.done-banner {
  background: var(--accent); border-radius: var(--radius-lg);
  padding: 36px 24px; text-align: center; color: #fff;
}
.done-banner h2 { color: #fff; margin: 10px 0 6px; font-size: 22px; letter-spacing: -.01em; }
.done-banner p { margin: 0; opacity: .9; font-size: 15px; }
.done-check {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; margin: 0 auto 8px;
}

.share-actions {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px; margin-top: 10px;
}

/* ---- Profile icon + dropdown ---- */
.profile-wrap {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; letter-spacing: 0;
  cursor: pointer; border: none; appearance: none;
  transition: opacity .15s ease;
  flex-shrink: 0;
}
.profile-avatar:hover { opacity: .88; }
.profile-signin-link {
  display: inline-flex; align-items: center;
  font-size: 14px; font-weight: 600; color: var(--ink);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 18px;
  white-space: nowrap;
  transition: border-color .15s;
}
.profile-signin-link:hover { border-color: var(--ink); text-decoration: none; }
.profile-dropdown {
  display: none;
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  min-width: 160px; z-index: 200;
  overflow: hidden;
}
.profile-dropdown.open { display: block; }
.profile-dropdown a,
.profile-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 12px 16px; font: inherit; font-size: 14px;
  color: var(--ink); background: transparent; border: none;
  cursor: pointer; text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.profile-dropdown a:last-child,
.profile-dropdown button:last-child { border-bottom: none; }
.profile-dropdown a:hover,
.profile-dropdown button:hover { background: var(--surface-2); }

/* ---- Landing page ---- */
.landing-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 28px 40px;
}

#profile-header .profile-wrap { margin-left: auto; }

.your-polls-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}
.your-polls-link:hover { color: var(--ink); text-decoration: none; }

.hero-hint {
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
  margin: 4px 0 14px;
}

.hero { padding: 0; }

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 48px 0 60px;
}
.hero-left { display: flex; flex-direction: column; }
.hero-right { position: relative; }

.hero-heading {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 60px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--ink);
}

.hero-sub {
  font-size: 17px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0 0 28px;
}

.hero-input-row {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  padding: 6px 6px 6px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.hero-input-row input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  outline: none;
  padding: 8px 0;
  min-width: 0;
}
.hero-input-row input::placeholder { color: var(--ink-3); font-weight: 400; }
.hero-start {
  border-radius: 999px !important;
  padding: 13px 32px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 16px;
}

/* ---- How It Works ---- */
#step-1 { display: flex; flex-direction: column; min-height: 100dvh; }
.hiw-section {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  padding: 40px 28px 60px;
  flex: 1;
}
.hiw-inner {
  max-width: 1000px;
  margin: 0 auto;
}
.hiw-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 28px;
}
.hiw-steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}
.hiw-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hiw-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  margin-bottom: 8px;
}
.hiw-step strong { color: var(--ink); font-size: 18px; line-height: 1.3; }
.hiw-step p { color: var(--ink-2); font-size: 14px; line-height: 1.5; margin: 0; }

@media (max-width: 720px) {
  .hero-layout { grid-template-columns: 1fr; gap: 0; padding: 32px 0 40px; }
  .hero-right { display: none; }
}

.hero-cal-mobile-wrap { display: none; }

@media (max-width: 720px) {
  .hiw-section { flex: none; }
  .hero-cal-mobile-wrap {
    display: block;
    padding: 32px 18px 48px;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .landing-inner { padding: 12px 18px 8px; }
  header.brand { padding: 4px 0 10px; }
  .hero-heading { font-size: 36px; margin: 0 0 14px; }
  .hero-sub { font-size: 15px; margin: 0 0 18px; }
  .hero-hint { margin: 2px 0 10px; }
  .quick-chips { margin-bottom: 0; gap: 6px; }
  .hiw-section { padding: 28px 18px 32px; }
  .hiw-label { margin: 0 0 14px; }
  .hiw-steps { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .hiw-step { gap: 4px; }
  .hiw-num { width: 32px; height: 32px; font-size: 14px; margin-bottom: 4px; }
  .hiw-step strong { font-size: 13px; }
  .hiw-step p { font-size: 11px; }
}

/* ---- Hero calendar widget ---- */
.hero-cal-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  padding-bottom: 32px;
}

.hcw-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.hcw-month-title { font-weight: 700; font-size: 18px; color: var(--ink); }
.hcw-nav { display: flex; gap: 6px; }
.hcw-nav-btn {
  appearance: none; background: transparent;
  border: 1px solid var(--line-strong); border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: default; font-size: 15px; color: var(--ink-2);
}

.hcw-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px; margin-bottom: 20px;
}
.hcw-dow {
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--ink-3); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em;
}
.hcw-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; color: var(--ink);
  border-radius: 50%; min-height: 34px;
}
.hcw-blank { visibility: hidden; }
.hcw-sel-strong { background: var(--accent); color: #fff; font-weight: 700; }
.hcw-sel-winner { background: var(--ink); color: #fff; font-weight: 700; }
.hcw-sel-soft {
  background: #f5ece6; color: var(--accent);
  border: 1.5px solid var(--accent); font-weight: 600;
}

.hcw-footer { border-top: 1px solid var(--line); padding-top: 14px; }
.hcw-resp-label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--ink-3);
  text-transform: uppercase; margin-bottom: 10px;
}
.hcw-resp-row { display: flex; align-items: center; gap: 10px; }
.hcw-avatars { display: flex; }
.hcw-av {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  margin-right: -6px; border: 2px solid var(--surface);
  flex-shrink: 0;
}
.hcw-av-more { background: var(--surface-2); color: var(--ink-2); font-size: 11px; }
.hcw-resp-count { font-size: 14px; color: var(--ink-2); margin-left: 14px; }

.hcw-toast {
  position: absolute; bottom: -18px; right: 16px;
  background: var(--ink); color: #fff;
  border-radius: 999px; padding: 10px 18px;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-md); white-space: nowrap;
}
.hcw-toast-dot { width: 8px; height: 8px; border-radius: 50%; background: #2e7d52; flex-shrink: 0; }

/* Admin report (single-tenant, pwilhoit@gmail.com). Minimal additions — reuse existing tokens. */

.admin-section { padding-top: 22px; padding-bottom: 22px; }
.admin-section h2 { margin-top: 0; }

.admin-count {
  font-size: 13px; font-weight: 500; color: var(--ink-3);
  margin-left: 6px; letter-spacing: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.admin-grid-3 { grid-template-columns: repeat(3, 1fr); }

.metric {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.metric-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.metric-label {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
  font-weight: 600;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.admin-table th {
  font-weight: 600;
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: transparent;
  border-bottom: 1px solid var(--line-strong);
}
.admin-table td.num, .admin-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table tr:last-child td { border-bottom: none; }

.admin-table code {
  font-size: 11px;
  background: var(--surface-2);
  padding: 1px 4px;
  border-radius: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.badge-open { background: #eef6f1; color: #2e7d52; }
.badge-closed { background: var(--surface-2); color: var(--ink-3); }

@media (max-width: 520px) {
  .admin-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-3 { grid-template-columns: 1fr; }
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 5px 6px; }
}

/* ---- Dashboard poll cards ---- */
.pc-card { padding: var(--pad); }

.pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.pc-title { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; flex: 1; min-width: 0; word-break: break-word; }
.pc-responded { font-size: 13px; color: var(--ink-3); white-space: nowrap; flex-shrink: 0; padding-top: 2px; }

.pc-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.pc-status { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pc-status-open { background: #eef6f1; color: var(--yes); }
.pc-status-closed { background: var(--surface-2); color: var(--ink-3); }
.pc-date-range { font-size: 13px; color: var(--ink-3); }

/* Best date banner */
.pc-best {
  background: #edf5f0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.pc-best-inner { display: flex; justify-content: space-between; align-items: center; }
.pc-best-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--yes); text-transform: uppercase; margin-bottom: 4px; }
.pc-best-date-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-best-name { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.pc-best-count { text-align: right; flex-shrink: 0; }
.pc-best-num { display: block; font-size: 36px; font-weight: 800; color: var(--yes); line-height: 1; }
.pc-best-sub { font-size: 12px; color: var(--ink-3); }
.pc-best-avs { display: flex; flex-wrap: wrap; gap: 4px; }

/* Participant avatar circles */
.pc-av {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  cursor: default; flex-shrink: 0;
}
.pc-av-sm { width: 32px; height: 32px; font-size: 12px; }
.pc-av-more { background: var(--surface-2) !important; color: var(--ink-3); font-size: 11px; font-weight: 600; }
.pc-av[data-name]::after {
  content: attr(data-name);
  position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 10;
}
.pc-av[data-name]:hover::after { opacity: 1; }

/* Other dates grid */
.pc-others { margin-bottom: 12px; }
.pc-section-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 10px; }
.pc-grid { overflow: visible; }
.pc-grid-row { display: flex; align-items: center; min-height: 34px; }
.pc-grid-head { margin-bottom: 4px; }

.pc-date-cell {
  width: 68px; min-width: 68px; flex-shrink: 0;
  display: flex; flex-direction: column; line-height: 1.3;
}
.pc-date-dow { font-size: 14px; font-weight: 600; color: var(--ink); }
.pc-date-mo { font-size: 12px; color: var(--ink-3); }

.pc-col-head { width: 44px; min-width: 44px; display: flex; justify-content: center; align-items: center; }
.pc-grid-cell { width: 44px; min-width: 44px; display: flex; justify-content: center; align-items: center; }
.pc-ellipsis { color: var(--ink-3); font-size: 14px; letter-spacing: -1px; }

.pc-grid-cell[data-tip] { position: relative; cursor: default; }
.pc-grid-cell[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 10;
}
.pc-grid-cell[data-tip]:hover::after { opacity: 1; }

/* Response dots */
.pc-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.pc-dot-yes { background: var(--yes); }
.pc-dot-maybe { background: var(--maybe); }
.pc-dot-no { background: var(--no); }
.pc-dot-none { background: transparent; }
.pc-no-resp-dash { color: var(--line-strong); font-size: 14px; line-height: 1; }

/* Legend and footer */
.pc-legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; align-items: center; }
.pc-legend .pc-dot { margin-right: 3px; vertical-align: middle; }
.pc-expand-note { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.pc-no-resp { font-size: 13px; color: var(--ink-3); margin: 0 0 12px; }

/* Action buttons */
.pc-actions { display: flex; gap: 8px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.pc-actions .btn { flex: 1; }

/* Admin poll modal */
.admin-modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,16,8,.45);
  align-items: center; justify-content: center;
  padding: 20px;
}
.admin-modal-box {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
}
.admin-modal-close {
  position: sticky; top: 12px; float: right; margin: 12px 12px 0 0;
  background: var(--surface-2); border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 18px; line-height: 1;
  cursor: pointer; color: var(--ink-2); display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.admin-modal-close:hover { background: var(--line); }
.admin-poll-creator { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }
.admin-poll-link { color: var(--accent); text-decoration: none; }
.admin-poll-link:hover { text-decoration: underline; }
