:root {
  --bg0: #f6f8f5;
  --bg1: #eaf3ec;
  --ink: #16241f;
  --muted: #4b5b54;
  --line: #dce6df;
  --panel: #ffffff;
  --brand: #1e8a6e;
  --brand-deep: #146b55;
  --accent: #ff6b4a;
  --accent-dark: #e5502f;
  --accent-soft: #fdeee6;
  --ok: #1e8a6e;
  --maybe: #f5a623;
  --no: #ff6b4a;
  --shadow: 0 20px 40px -20px rgba(22, 36, 31, 0.18);
  --radius: 16px;
  --font: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --display: "Sora", "Be Vietnam Pro", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  background: var(--bg0);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.page-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.container { width: min(100% - 32px, 1080px); margin: 0 auto; }
main.container {
  flex: 1;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(246, 248, 245, 0.85);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.lang-link {
  color: var(--muted);
  text-decoration: none;
}

.lang-link:hover {
  color: var(--brand);
}

.lang-link.is-active {
  color: var(--ink);
  font-weight: 700;
}

.lang-sep {
  opacity: 0.45;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-marks {
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--brand), #2aa884);
  box-shadow: 0 0 0 4px rgba(30, 138, 110, 0.12);
}

.site-footer {
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero {
  padding: 56px 0 40px;
  animation: rise 0.7s ease both;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background:
    radial-gradient(ellipse 60% 50% at 15% 20%, rgba(30, 138, 110, 0.12), transparent 70%),
    radial-gradient(ellipse 45% 40% at 90% 10%, rgba(255, 107, 74, 0.08), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg1);
  color: var(--brand-deep);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0 0 18px;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.12;
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero h1 .accent { color: var(--brand); }

.hero .sub {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 32rem;
  margin: 0 0 24px;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.trust {
  margin: 0;
  font-size: 0.85rem;
  color: #7a8a83;
}

.demo-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  max-width: 22rem;
  width: 100%;
  justify-self: end;
}

.demo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}

.demo-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
}

.demo-badge {
  font-size: 0.72rem;
  background: var(--bg1);
  color: var(--brand-deep);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}

.vote-row:last-of-type { border-bottom: none; }

.vote-name {
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--bg1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-deep);
}

.vote-marks { display: flex; gap: 5px; }

.mark-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  color: #7a8a83;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mark-btn:hover { transform: translateY(-1px); }
.mark-btn.tick.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.mark-btn.tri.active { background: var(--maybe); border-color: var(--maybe); color: #fff; }
.mark-btn.cross.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.demo-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #7a8a83;
  text-align: center;
}

.section { padding: 56px 0; }
.section-head { max-width: 38rem; margin-bottom: 32px; }
.section-eyebrow {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.section-head h2,
.section h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.section-desc {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.section-title {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 0 0 18px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.tool-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  min-height: 100%;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -18px rgba(22, 36, 31, 0.22);
  border-color: var(--brand);
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 14px;
}

.tool-card.i1 .tool-icon { background: #e4f3ec; }
.tool-card.i2 .tool-icon { background: #fdeee6; }
.tool-card.i3 .tool-icon { background: #fef3dd; }

.tool-tag {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
}

.tool-card h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.tool-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.tool-link {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-deep);
}

.timeline-wrap {
  background: var(--bg1);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 0;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 26px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--brand) 0 8px, transparent 8px 16px);
  opacity: 0.45;
}

.step {
  text-align: center;
  padding: 0 12px;
  position: relative;
}

.step-num {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--brand);
  color: var(--brand-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0 auto 14px;
  position: relative;
  z-index: 2;
}

.step h3 {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.step p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.faq-wrap { max-width: 720px; margin: 0 auto; }

.faq-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
}

.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink);
}

.faq-q .plus {
  font-size: 1.35rem;
  color: var(--brand);
  transition: transform 0.2s ease;
  line-height: 1;
}

.faq-item.open .plus { transform: rotate(45deg); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.faq-a p {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.cta-band {
  background: var(--ink);
  color: #fff;
  border-radius: 24px;
  padding: 48px 32px;
  text-align: center;
  margin: 8px 0 64px;
}

.cta-band h2 {
  color: #fff;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  margin: 0 0 10px;
}

.cta-band p {
  color: #b9c7c1;
  margin: 0 0 24px;
  font-size: 0.98rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: #dff0e9;
  color: var(--brand-deep);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 107, 74, 0.35);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 10px 20px rgba(255, 107, 74, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-secondary { background: #e7f2ed; color: var(--brand-deep); border-radius: 12px; }
.btn-danger { background: #fde8e6; color: var(--no); border-radius: 12px; }
.btn-large { padding: 14px 24px; font-size: 1rem; }
.btn-small { padding: 8px 12px; font-size: 0.92rem; border-radius: 12px; min-height: 36px; }
.full-width { width: 100%; }

.page { padding: 40px 0 72px; animation: rise 0.55s ease both; }
.narrow { max-width: 680px; margin: 0 auto; }

.create-page {
  max-width: 980px;
  margin: 0 auto;
  padding-top: 28px;
  padding-bottom: 48px;
}

.create-header h1 { margin-bottom: 6px; }
.create-header .muted { margin: 0 0 18px; }

.create-form { margin: 0; }

.create-top {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.create-note { margin: 0; }

.schedule-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.schedule-candidates,
.schedule-calendar {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.schedule-panel-head .field-label { margin-bottom: 4px; }
.schedule-panel-head .hint { margin-bottom: 8px; }

.schedule-candidates .candidates-input {
  flex: 1;
  min-height: 280px;
  height: 100%;
  margin: 0;
}

.schedule-candidates .empty-hint {
  margin: 8px 0 0;
}

.schedule-calendar .time-row {
  margin: 0 0 10px;
}

.schedule-calendar .calendar {
  flex: 1;
}

.create-actions {
  margin-top: 4px;
}

h1, h2 { font-family: var(--display); font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.1; margin: 8px 0 14px; }
h2 { font-size: 1.35rem; margin: 0 0 14px; }

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin: 0;
}

.muted { color: var(--muted); }

.field { margin: 20px 0; }
.field.compact { margin: 0 0 16px; }
.field label, .field-label { display: block; font-weight: 700; margin-bottom: 8px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; }
.hint.is-error { color: var(--no); font-weight: 600; }

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}
.mode-option input { position: absolute; opacity: 0; pointer-events: none; width: 0; }
.mode-option.is-active,
.mode-option:has(input:checked) {
  border-color: var(--brand);
  background: #e5f5ef;
  color: var(--brand-deep);
}

.candidates-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.45;
  min-height: 10rem;
  resize: vertical;
  white-space: pre;
}

.time-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.time-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
}

.time-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--brand);
}

.time-label-input {
  width: 8.5rem;
  padding: 10px 12px;
  font-variant-numeric: tabular-nums;
}

.time-label-input:disabled {
  opacity: 0.45;
}

.calendar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-weekdays span {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 4px;
}
.cal-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 12px;
  background: #f3faf7;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.cal-day.is-empty { background: transparent; cursor: default; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px rgba(15, 107, 87, 0.35); }
.cal-day.is-past { color: #8aa198; }
.cal-day.is-selected {
  background: var(--brand);
  color: #fff;
  transform: scale(1.04);
}
.cal-day:not(.is-empty):hover { background: #d8eee5; }
.cal-day.is-selected:hover { background: var(--brand-deep); }
.cal-day.is-flash {
  background: #fff4c8;
  border-color: #e2c76a;
  color: var(--ink);
}

.selected-slots { margin-top: 14px; }
.slot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.slot-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.slot-label { font-weight: 700; min-width: 6.5rem; }
.slot-chip .slot-time-input {
  width: auto;
  flex: 1;
  min-width: 5.5rem;
  max-width: 10rem;
  padding: 8px 10px;
  font-variant-numeric: tabular-nums;
}
.btn-tiny { padding: 6px 10px; font-size: 0.85rem; white-space: nowrap; }

.more-options {
  margin: 8px 0 20px;
  color: var(--muted);
}
.more-options summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}

.name-line { margin: 0 0 14px; }
.choice-mark { font-size: 1.15rem; line-height: 1; }
.choice-text { font-size: 0.82rem; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(15, 107, 87, 0.28);
  border-color: var(--brand);
}

textarea { resize: vertical; }

.date-row { display: flex; gap: 8px; margin-bottom: 8px; }
.remove-date {
  width: 44px;
  border: 0;
  border-radius: 12px;
  background: #e7f0eb;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
}

.flash {
  margin: 20px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  animation: rise 0.35s ease both;
}
.flash.success { background: #e5f7ef; color: #17663b; }
.flash.alert { background: #ffe8e4; color: #9f2d27; }

.poll-header { margin-bottom: 20px; }

.creator-banner,
.share-panel,
.panel,
.result-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}

.creator-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #e8f7f1, #fff7f2);
}

.creator-banner p { margin: 4px 0 0; color: var(--muted); }

.share-panel label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.share-hint { min-height: 1.4em; margin: 8px 0 0; }
.share-actions { margin-top: 10px; }

.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; }

.vote-list { display: grid; gap: 12px; margin-bottom: 18px; }

.vote-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #f4faf7;
  border-radius: 14px;
  border: 1px solid #d9ebe3;
}

.vote-date span { display: block; font-size: 0.9rem; }

.vote-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice.is-selected {
  border-color: var(--brand);
  background: #e5f5ef;
  color: var(--brand-deep);
  transform: translateY(-1px);
}

.edit-link-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid #e4efe9;
  text-align: center;
  white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; }

.vote-cell { font-size: 1.2rem; font-weight: 700; }
.status-available { color: var(--ok); }
.status-maybe { color: var(--maybe); }
.status-unavailable { color: var(--no); }

.result-table tr.is-best td { background: #e8f7f1; }
.best-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}

.result-row.is-best { border-color: #9fcebf; background: #eefaf5; }
.result-meta { display: flex; justify-content: space-between; gap: 16px; }
.bar { height: 10px; background: #dceee7; border-radius: 99px; margin-top: 12px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), #1ea88a); border-radius: 99px; }

.text-link { display: inline-block; margin-top: 8px; color: var(--brand); font-weight: 700; }
.text-link:hover { text-decoration: underline; }

.manage-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin: 6px 0; }

.status-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}
.status-pill.open { background: #e5f5ef; color: var(--brand-deep); }
.status-pill.closed { background: #fde8e6; color: var(--no); }

/* —— Poll show (compact, one screen) —— */
body.is-poll-page .site-header { border-bottom-color: transparent; }
body.is-poll-page .header-inner { height: 52px; }
body.is-poll-page .flash { margin: 8px 0 0; padding: 8px 12px; font-size: 0.9rem; }

.poll-page {
  padding: 8px 0 20px;
  max-width: 100%;
}

.poll-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.poll-top h1 {
  font-size: clamp(1.2rem, 3.5vw, 1.55rem);
  margin: 0;
  font-family: var(--font);
  font-weight: 800;
  line-height: 1.25;
}

.poll-desc {
  margin: 2px 0 0;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.poll-desc p {
  margin: 0 0 0.4em;
}

.poll-desc p:last-child {
  margin-bottom: 0;
}

.poll-top-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.poll-page .share-hint {
  min-height: 0;
  margin: 0 0 8px;
  font-size: 0.85rem;
}

.matrix-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
}

.matrix-wrap {
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.matrix-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.matrix-table th,
.matrix-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #e8f0ec;
  border-right: 1px solid #eef4f1;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.matrix-table thead th {
  background: #f3faf7;
  font-weight: 700;
  color: var(--brand-deep);
  position: sticky;
  top: 0;
  z-index: 2;
}

.matrix-table .col-slot {
  text-align: left;
  font-weight: 700;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  min-width: 8.5rem;
}

.matrix-table thead .col-slot {
  background: #f3faf7;
  z-index: 3;
}

.matrix-table .col-count {
  min-width: 2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.matrix-table .col-person {
  min-width: 2.8rem;
  max-width: 5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8rem;
}

.matrix-table .count-ok { color: var(--ok); }
.matrix-table .count-maybe { color: var(--maybe); }
.matrix-table .count-no { color: #98a29e; }

.matrix-table .vote-cell {
  font-size: 1.05rem;
  font-weight: 700;
}

.matrix-table .status-available { color: #1a9f5c; }
.matrix-table .status-maybe { color: #b0b7b3; }
.matrix-table .status-unavailable { color: #c5cbc8; }
.matrix-table .status-empty { color: #d5ddd9; }

.matrix-table tr.is-best > th,
.matrix-table tr.is-best > td,
.matrix-table th.is-best,
.matrix-table td.is-best {
  background: #e7f8ef;
}

.matrix-table tr.is-best > .col-slot,
.matrix-table thead th.col-slot.is-best {
  background: #d8f3e5;
  box-shadow: inset 3px 0 0 var(--ok);
}

.matrix-table td.is-best {
  background: #e7f8ef;
}

.best-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ok);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.matrix-table.is-vertical .col-person {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  min-width: 5.5rem;
  max-width: 8rem;
}

.matrix-table.is-vertical thead .col-person {
  background: #f3faf7;
  z-index: 3;
}

.matrix-table.is-vertical .col-slot {
  position: static;
  min-width: 5.5rem;
  max-width: 7.5rem;
  white-space: normal;
  line-height: 1.25;
  font-size: 0.78rem;
  text-align: center;
}

.matrix-table.is-vertical .best-badge {
  display: block;
  margin: 4px auto 0;
  width: fit-content;
}

.matrix-table.is-vertical .summary-row th,
.matrix-table.is-vertical .summary-row td {
  background: #f7fbf9;
  border-bottom-color: #dce8e2;
}

.matrix-table.is-vertical .summary-row .is-best {
  background: #e7f8ef;
}

.matrix-table.is-vertical tbody .col-person {
  background: #fff;
}

.vote-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.vote-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}

.vote-toolbar input {
  padding: 9px 12px;
}

.symbol-vote-list {
  display: grid;
  gap: 4px;
}

.symbol-vote-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 8px;
  background: #f7fbf9;
}

.symbol-vote-slot {
  font-weight: 700;
  font-size: 0.9rem;
}

.symbol-choices {
  display: flex;
  gap: 6px;
}

.symbol-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: #7a8a83;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.symbol-btn:hover { transform: translateY(-1px); }

.symbol-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
}

.symbol-btn .mark-char {
  line-height: 1;
  font-weight: 700;
}

/* Optical size: × scaled; ✓ and △ read naturally at base size */
.vote-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 700;
}

.vote-mark-available { font-size: 1.05em; color: var(--brand); }
.vote-mark-maybe {
  font-size: 1.15em;
  color: var(--maybe);
}
.vote-mark-unavailable { font-size: 1.15em; transform: scale(3); color: var(--accent); }
.vote-mark-empty { font-size: 1em; font-weight: 500; color: #7a8a83; }

.triangle-mark {
  display: block;
  width: 1.05em;
  height: 1.05em;
  overflow: visible;
}

.matrix-table .vote-mark,
.matrix-table .col-count .vote-mark { font-size: 0.65rem; }
.matrix-table .vote-mark-maybe { font-size: 0.95rem; }

.symbol-btn.is-selected {
  color: #fff;
}

.symbol-btn.symbol-available.is-selected {
  background: var(--brand);
  border-color: var(--brand);
}

.symbol-btn.symbol-maybe.is-selected {
  background: var(--maybe);
  border-color: var(--maybe);
}

.symbol-btn.symbol-unavailable.is-selected {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-vote {
  min-width: 96px;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.95rem;
}

.closed-note { margin: 8px 0; }

.recent-polls {
  margin: 0 auto 48px;
  max-width: 680px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise 0.7s ease 0.05s both;
}

.recent-polls .section-title { margin-bottom: 6px; }
.recent-polls-note { margin: 0 0 14px; font-size: 0.9rem; }

.recent-poll-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.recent-poll-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.recent-poll-link {
  font-weight: 700;
  color: var(--brand-deep);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-poll-link:hover { text-decoration: underline; }
.recent-poll-meta { font-size: 0.85rem; white-space: nowrap; }

.recent-poll-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #eef4f1;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.recent-poll-remove:hover {
  background: #fde8e6;
  color: var(--no);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* —— Responsive: tablet —— */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .demo-card { justify-self: stretch; max-width: none; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .timeline::before { display: none; }
  .tools-grid { grid-template-columns: 1fr; }
  .schedule-builder {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .schedule-calendar { order: 1; }
  .schedule-candidates { order: 2; }
  .schedule-candidates .candidates-input {
    min-height: 160px;
    max-height: 220px;
  }
}

/* —— Responsive: phone —— */
@media (max-width: 700px) {
  .container { width: min(100% - 20px, 1080px); }

  .header-inner {
    height: 56px;
    gap: 8px;
  }

  .brand {
    font-size: 1.15rem;
    gap: 8px;
    min-width: 0;
  }

  .brand-mark {
    width: 12px;
    height: 12px;
    box-shadow: 0 0 0 3px rgba(15, 107, 87, 0.12);
  }

  .header-actions {
    gap: 8px;
  }

  .lang-switch {
    font-size: 0.75rem;
    gap: 4px;
  }

  .header-actions .btn-small {
    padding: 7px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .hero {
    padding: 36px 0 24px;
  }

  .hero h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .hero-ctas .btn-large {
    width: 100%;
  }

  .hero-ctas .btn-ghost {
    width: 100%;
  }

  .timeline {
    grid-template-columns: 1fr;
    row-gap: 22px;
  }

  .cta-band {
    padding: 36px 20px;
    border-radius: 18px;
  }

  .recent-polls {
    margin-bottom: 28px;
    padding: 14px;
  }

  .recent-poll-list li {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "link remove"
      "meta remove";
    gap: 4px 8px;
    padding: 10px 12px;
  }

  .recent-poll-link { grid-area: link; }
  .recent-poll-meta {
    grid-area: meta;
    font-size: 0.8rem;
  }
  .recent-poll-remove { grid-area: remove; align-self: center; }

  .page { padding: 20px 0 40px; }
  .create-page {
    padding-top: 12px;
    padding-bottom: 32px;
  }
  .create-header h1 { font-size: 1.55rem; }
  .create-header .muted { margin-bottom: 12px; font-size: 0.9rem; }

  .time-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .time-label-input { width: 100%; }

  .calendar {
    padding: 10px;
    border-radius: 14px;
  }
  .calendar-weekdays,
  .calendar-grid { gap: 4px; }
  .calendar-weekdays span { font-size: 0.7rem; }
  .cal-day {
    border-radius: 10px;
    font-size: 0.9rem;
    min-height: 40px;
  }

  .candidates-input {
    font-size: 16px;
    min-height: 9rem;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .create-actions .btn-large {
    padding: 14px 16px;
  }

  /* Poll page */
  body.is-poll-page .header-inner { height: 48px; }
  body.is-poll-page .header-actions .btn-small { display: none; }

  .poll-page { padding: 6px 0 28px; }

  .poll-top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
  }

  .poll-top h1 {
    font-size: 1.2rem;
  }

  .poll-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .poll-top-actions .btn {
    flex: 1 1 calc(50% - 4px);
    width: auto;
    min-height: 40px;
  }

  .poll-top-actions .btn:only-child,
  .poll-top-actions .btn:last-child:nth-child(odd) {
    flex-basis: 100%;
  }

  .matrix-section {
    border-radius: 10px;
    margin-bottom: 8px;
  }

  .matrix-table {
    font-size: 0.8rem;
  }

  .matrix-table th,
  .matrix-table td {
    padding: 6px 6px;
  }

  .matrix-table .col-slot {
    min-width: 5.8rem;
    font-size: 0.75rem;
    max-width: 7.5rem;
    white-space: normal;
    line-height: 1.25;
  }

  .matrix-table .col-person {
    min-width: 2.4rem;
    max-width: 4rem;
    font-size: 0.72rem;
  }

  .matrix-table.is-vertical .col-person {
    min-width: 4.5rem;
    max-width: 6rem;
  }

  .matrix-table.is-vertical .col-slot {
    min-width: 4.5rem;
    max-width: 5.5rem;
    font-size: 0.7rem;
  }

  .vote-section {
    padding: 8px;
    border-radius: 10px;
  }

  .vote-toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .vote-toolbar input {
    min-height: 44px;
    font-size: 1rem;
  }

  .btn-vote {
    width: 100%;
    min-height: 44px;
    min-width: 0;
  }

  .symbol-vote-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px;
  }

  .symbol-vote-slot {
    font-size: 0.88rem;
  }

  .symbol-choices {
    justify-content: space-between;
    gap: 8px;
  }

  .symbol-btn {
    flex: 1;
    width: auto;
    height: 44px;
    max-width: none;
  }

  .creator-banner { flex-direction: column; align-items: stretch; }
  .share-row { grid-template-columns: 1fr auto; }
  .inline-form { flex-direction: column; }
  .vote-choices { grid-template-columns: 1fr; }
  .result-meta { flex-direction: column; gap: 2px; }

}

/* —— Responsive: small phone —— */
@media (max-width: 380px) {
  .container { width: min(100% - 16px, 960px); }

  .lang-switch .lang-sep { display: none; }
  .lang-switch {
    flex-direction: column;
    gap: 0;
    line-height: 1.2;
  }

  .header-actions .btn-small {
    padding: 6px 8px;
    font-size: 0.78rem;
  }

  .brand span:last-child {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .poll-top-actions {
    grid-template-columns: 1fr;
  }

  .poll-top-actions .btn {
    flex-basis: 100%;
  }
}

/* —— Tools: wheel + bill split —— */
.tool-page {
  padding: 36px 0 72px;
  animation: rise 0.65s ease both;
}

.tool-header {
  text-align: center;
  margin-bottom: 28px;
}

.tool-kicker {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.tool-header h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.tool-lead {
  margin: 0 auto;
  max-width: 36rem;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
}

.tool-layout-split {
  grid-template-columns: 0.9fr 1.1fr;
}

.tool-side,
.tool-main {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.field-label {
  display: block;
  font-weight: 700;
  margin: 0 0 6px;
}

.field-hint {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.tool-textarea,
.tool-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  margin-bottom: 14px;
}

.tool-textarea { resize: vertical; min-height: 180px; }

.tool-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.tool-inline .tool-input {
  margin-bottom: 0;
  max-width: 120px;
}

.tool-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.wheel-stage {
  position: relative;
  width: min(100%, 420px);
  margin: 0 auto;
}

.wheel-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  box-shadow: 0 12px 40px rgba(20, 48, 40, 0.16);
}

.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--accent);
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

.wheel-result {
  text-align: center;
  min-height: 1.6em;
  margin: 18px 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-deep);
}

.split-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.split-summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.split-summary-list li.is-highlight {
  border-bottom: none;
  margin-top: 4px;
  padding: 14px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--brand-deep);
}

.split-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

.split-table th,
.split-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.split-table th { color: var(--muted); font-weight: 600; }
.split-table .split-amount,
.split-table td.split-amount { text-align: right; font-variant-numeric: tabular-nums; }

.bill-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.bill-step {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 1.2rem;
}

.split-mode-fieldset {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}

/* .split-mode-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
}

.split-mode-option strong { display: block; }
.split-mode-option small { display: block; color: var(--muted); margin-top: 2px; } */

/* Container fieldset */
.split-mode-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.split-mode-fieldset .field-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main, #1e293b);
  margin-bottom: 0.75rem;
  padding: 0;
  float: none; /* Reset kiểu mặc định của legend */
  width: 100%;
}

/* Card Option Base Styles */
.split-mode-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line, #e2e8f0);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  background-color: #ffffff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

/* Nội dung Text bên trong Card */
.split-mode-option span {
  flex: 1;
}

.split-mode-option strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main, #0f172a);
  line-height: 1.3;
}

.split-mode-option small {
  display: block;
  font-size: 0.825rem;
  color: var(--muted, #64748b);
  margin-top: 3px;
  line-height: 1.4;
}

/* Tùy chỉnh Nút Radio */
.split-mode-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--line-dark, #cbd5e1);
  border-radius: 50%;
  outline: none;
  margin: 0;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.split-mode-option input[type="radio"]::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: scale(0);
  transition: 0.15s transform ease-in-out;
  background-color: #ffffff;
}

/* Hover effect */
.split-mode-option:hover {
  border-color: var(--primary-light, #93c5fd);
  background-color: var(--bg-hover, #f8fafc);
}

/* Active State (Trạng thái khi Radio được Active/Checked) */
.split-mode-option:has(input[type="radio"]:checked) {
  border-color: var(--primary, #2563eb);
  background-color: var(--primary-subtle, #eff6ff);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.split-mode-option input[type="radio"]:checked {
  border-color: var(--primary, #2563eb);
  background-color: var(--primary, #2563eb);
}

.split-mode-option input[type="radio"]:checked::before {
  transform: scale(1);
}

/* Fallback cho trình duyệt cũ không hỗ trợ CSS :has() */
.split-mode-option input[type="radio"]:checked + span,
.split-mode-option input[type="radio"]:checked ~ span {
  color: var(--primary-dark, #1e40af);
}

.bill-items-panel { margin-bottom: 18px; }

.bill-item-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}

.bill-item-fields {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 8px;
  align-items: start;
}

.bill-item-fields .tool-input { margin-bottom: 0; }

.bill-item-consumers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}

.bill-consumer {
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bill-share { margin-bottom: 22px; }

@media (max-width: 800px) {
  .tool-layout,
  .tool-layout-split,
  .tools-grid,
  .bill-form-grid {
    grid-template-columns: 1fr;
  }

  .bill-item-fields { grid-template-columns: 1fr; }

  .wheel-stage { width: min(100%, 340px); }
}
