:root {
  --ink: #202124;
  --muted: #6b6f76;
  --page: #f6f7f8;
  --card: #ffffff;
  --line: #d9dde3;
  --line-dark: #b8bec7;
  --blue: #315f9b;
  --blue-dark: #254a7b;
  --blue-soft: #eaf1f9;
  --yes: #dcefe3;
  --maybe: #fff0c7;
  --no: #f6dddd;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

button, input, textarea, select { font: inherit; }

.topbar {
  height: 62px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 7px;
  border: 1px solid #244c7d;
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
}

.top-actions { display: flex; align-items: center; gap: 16px; }
.tagline { color: var(--muted); font-size: 13px; }

.language select {
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}

.language select:focus,
.field input:focus,
.field textarea:focus,
.share input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(49, 95, 155, .15);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

main { max-width: 1060px; margin: 0 auto; padding: 58px 24px 72px; }

.hero {
  display: block;
  max-width: 680px;
  margin: 0 auto;
}

.hero-copy { margin-bottom: 26px; }
.hero .eyebrow { display: none; }
.eyebrow { color: var(--blue); font-size: 13px; font-weight: 700; }

h1, h2, h3 { margin-top: 0; line-height: 1.2; }
h1 { max-width: 620px; margin: 0 0 10px; font-size: clamp(30px, 4vw, 38px); letter-spacing: -.025em; }
.accent { color: var(--blue); }
.lead { max-width: 620px; margin: 0; color: #555a61; font-size: 16px; line-height: 1.55; }

.perks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 15px;
}

.perk { color: #51565d; font-size: 13px; }
.perk i { margin-right: 4px; color: #397052; font-style: normal; font-weight: 700; }

.card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(20, 28, 38, .04);
}

.card-title { margin-bottom: 6px; font-size: 21px; }
.subtle { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.field { margin-bottom: 17px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }

.field input,
.field textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field textarea { min-height: 68px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.slot-list { display: grid; gap: 8px; }
.slot-row { display: grid; grid-template-columns: 1fr 36px; gap: 7px; }

.icon-btn {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f8f9;
  color: #686d73;
  cursor: pointer;
  font-size: 18px;
}

.icon-btn:hover { background: #eef0f2; }

.add-slot {
  width: 100%;
  margin: 0 0 18px;
  padding: 9px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  background: #fff;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
}

.add-slot:hover { background: #f6f8fb; }

.primary, .secondary {
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
}

.primary { width: 100%; border-color: var(--blue-dark); background: var(--blue); color: #fff; }
.primary:hover { background: var(--blue-dark); }
.primary:disabled { opacity: .55; cursor: wait; }
.secondary { border-color: var(--line-dark); background: #fff; color: var(--ink); }
.secondary:hover { background: #f3f4f5; }
.privacy { margin: 11px 0 0; color: var(--muted); text-align: center; font-size: 11px; }
.privacy:before { content: "•"; margin-right: 5px; }

.poll-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin: 4px 0 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.poll-head h1 { margin: 8px 0 8px; font-size: clamp(30px, 4vw, 42px); }
.meta { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.status { display: inline-flex; padding: 6px 9px; border: 1px solid #a9c9b4; border-radius: 4px; background: #edf7f0; color: #315d40; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status.closed { border-color: var(--line); background: #f1f2f3; color: #666b71; }
.layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
.sticky { position: sticky; top: 18px; }
.vote-grid { display: grid; gap: 8px; }
.vote-option { padding: 11px; border: 1px solid var(--line); border-radius: 5px; }
.vote-date { font-size: 14px; font-weight: 700; }
.vote-time { margin-top: 1px; color: var(--muted); font-size: 12px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 9px; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 6px 3px; border: 1px solid var(--line); border-radius: 4px; background: #fafafa; text-align: center; font-size: 11px; font-weight: 700; cursor: pointer; }
.choice input:checked + span.yes { border-color: #8fbea0; background: var(--yes); color: #28583a; }
.choice input:checked + span.maybe { border-color: #dbbe67; background: var(--maybe); color: #755b12; }
.choice input:checked + span.no { border-color: #d7a0a0; background: var(--no); color: #853c3c; }

.results-card { overflow: hidden; padding: 0; }
.results-top { display: flex; justify-content: space-between; align-items: center; padding: 23px 24px 14px; border-bottom: 1px solid #eceef0; }
.results-top h2 { margin-bottom: 3px; font-size: 19px; }
.counter { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; padding: 12px 16px 20px; }
.results { width: 100%; min-width: 580px; border-collapse: collapse; }
.results th { padding: 9px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: bottom; font-size: 11px; font-weight: 600; }
.results th:first-child { position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left; }
.results td { padding: 9px; border-bottom: 1px solid #eceef0; background: #fff; text-align: center; }
.results td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; font-weight: 600; }
.dot { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 4px; font-weight: 700; }
.dot.yes { background: var(--yes); color: #28583a; }
.dot.maybe { background: var(--maybe); color: #755b12; }
.dot.no { background: var(--no); color: #853c3c; }
.score-row td { padding-top: 13px; border-bottom: 0; background: #f8f9fa; }
.score { font-size: 16px; font-weight: 700; }
.best { box-shadow: inset 0 -3px #6e91bf; }
.empty { padding: 42px 24px; color: var(--muted); text-align: center; }
.share { display: flex; gap: 7px; margin-top: 17px; }
.share input { flex: 1; min-width: 0; padding: 8px 9px; border: 1px solid var(--line-dark); border-radius: 5px; outline: none; }
.admin-box { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.admin-box .secondary { width: 100%; }

#toast { position: fixed; bottom: 20px; left: 50%; z-index: 10; padding: 10px 15px; border: 1px solid #1c2734; border-radius: 5px; background: #263443; color: #fff; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .18s; box-shadow: 0 3px 10px rgba(0,0,0,.12); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
footer { padding: 0 20px 28px; color: var(--muted); text-align: center; font-size: 12px; }

[dir="rtl"] .brand-mark { margin-right: 0; margin-left: 7px; }
[dir="rtl"] .results th:first-child, [dir="rtl"] .results td:first-child { right: 0; left: auto; text-align: right; }

@media (max-width: 860px) {
  main { padding-top: 36px; }
  .hero-copy { max-width: 680px; }
  .layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .poll-head { flex-direction: column; gap: 12px; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 16px; }
  main { padding: 28px 16px 55px; }
  .tagline { display: none; }
  .language select { max-width: 130px; }
  .card { padding: 20px; }
  .row { grid-template-columns: 1fr; gap: 0; }
  h1 { font-size: 30px; }
  .poll-head h1 { font-size: 31px; }
  .results-top { padding: 20px; }
  .share { flex-direction: column; }
}
