:root {
  --bg: #faf6f1;
  --card: #ffffff;
  --ink: #1d1b2c;
  --muted: #6a6779;
  --line: #e9e3db;
  --accent: #ff5b2e;
  --accent-ink: #c73d16;
  --accent-soft: #fff0ea;
  --on: #0f9d58;
  --on-soft: #e8f7ef;
  --wait: #8a6cff;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(29, 27, 44, .06), 0 8px 28px rgba(29, 27, 44, .07);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 850; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 750; }
p { margin: 0 0 .8em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 620px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header / footer */
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; margin-left: 18px; font-size: .95rem; }
.top nav a:hover { color: var(--ink); }
footer.foot { border-top: 1px solid var(--line); margin-top: 56px; padding: 24px 0 40px; color: var(--muted); font-size: .9rem; }
footer.foot a { color: var(--muted); margin-right: 16px; }

/* Buttons and fields */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 750;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; text-decoration: none;
  background: var(--ink); color: #fff; transition: transform .06s ease, background .15s ease, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(255, 91, 46, .28); }
.btn.primary:hover { background: #f24e20; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: #cfc6ba; }
.btn.soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn.link { background: none; color: var(--muted); padding: 0 6px; min-height: 36px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn.danger { background: #fff; color: #c0262d; border: 1.5px solid #f1c9cb; }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 1.08rem; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
label.field > span em { font-style: normal; font-weight: 500; color: var(--muted); }
input[type=text], input[type=datetime-local], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
textarea { resize: vertical; min-height: 76px; }
input:focus, textarea:focus, select:focus, .btn:focus-visible, .chip:focus-visible { outline: 3px solid rgba(255, 91, 46, .35); outline-offset: 1px; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; margin: 4px 0 16px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.err { color: #c0262d; font-weight: 600; font-size: .92rem; min-height: 1.2em; margin: 6px 0 0; }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.stepper button { width: 48px; height: 48px; border: 0; background: none; font-size: 1.4rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--bg); }
.stepper output { min-width: 48px; text-align: center; font-weight: 850; font-size: 1.25rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none; font: inherit; font-size: .92rem; font-weight: 650; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.static { cursor: default; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 16px; }

/* Home */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: start; padding: 24px 0 8px; }
.hero .lede { font-size: 1.18rem; color: #3b3850; max-width: 32em; }
.hero .points { list-style: none; padding: 0; margin: 18px 0 0; }
.hero .points li { padding-left: 30px; position: relative; margin-bottom: 10px; color: #3b3850; }
.hero .points li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft); box-shadow: inset 0 0 0 5px var(--accent); }
.demo { margin-top: 26px; }
.create h2 { margin-bottom: 14px; }
.target-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.target-row .lbl { font-weight: 700; }
.section { padding: 48px 0 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
.steps .card h3::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .9rem; margin-right: 10px; }
.faq details { background: #fff; border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 10px 0 0; color: #3b3850; }
.mine a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 650; }
.mine a:last-child { border-bottom: 0; }

/* Meter: one dot per needed person */
.meter { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.dot { width: 30px; height: 30px; border-radius: 50%; border: 2.5px dashed #d7cfc4; background: #fff; display: grid; place-items: center; }
.dot.in { border: 0; background: var(--accent); box-shadow: 0 3px 10px rgba(255, 91, 46, .3); }
.dot.in::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .85); }
.dot.wait { border: 2.5px solid var(--wait); background: #f3efff; }
.dot.extra { border: 0; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 800; width: auto; padding: 0 8px; border-radius: 15px; }
.on .dot.in, .on .dot.extra { background: var(--on); box-shadow: 0 3px 10px rgba(15, 157, 88, .28); }
.count { font-size: 1.6rem; font-weight: 850; letter-spacing: -.02em; }
.count small { font-size: 1rem; font-weight: 650; color: var(--muted); }

/* Plan page */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .85rem; font-weight: 750; background: var(--accent-soft); color: var(--accent-ink); }
.pill.on { background: var(--on-soft); color: #08743f; }
.pill.off { background: #efedf2; color: var(--muted); }
.plan-head h1 { font-size: clamp(1.8rem, 7vw, 2.5rem); margin-top: 12px; }
.plan-meta { color: #3b3850; font-weight: 600; }
.plan-details { white-space: pre-wrap; color: #3b3850; margin-top: 8px; }
.sealed { display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: .9rem; color: #4a4760; margin-top: 12px; }
.sealed svg { flex: none; margin-top: 2px; }
.answer-btns { display: grid; gap: 10px; }
.answer-btns .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.only-if { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 4px; }
.only-if h3 { margin-bottom: 10px; }
.mine-answer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mine-answer strong { font-size: 1.1rem; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 750; }
.badge.in { background: var(--accent-soft); color: var(--accent-ink); }
.badge.wait { background: #f3efff; color: #5b3fd6; }
.badge.out { background: #efedf2; color: var(--muted); }
.badge.going { background: var(--on-soft); color: #08743f; }
.tip {
  background: linear-gradient(140deg, #0f9d58, #0b7d63 60%, #0a5f73);
  color: #fff; border-radius: var(--radius); padding: 26px 22px; box-shadow: 0 14px 34px rgba(11, 125, 99, .3);
}
.tip h2 { font-size: 2.1rem; margin-bottom: 4px; }
.tip .names { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tip .names span { background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 6px 12px; font-weight: 700; }
.tip .line { background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-weight: 600; }
.tip .btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tip .btn.white { background: #fff; color: #0b6a4c; }
.tip .btn.clear { background: rgba(255, 255, 255, .14); color: #fff; }
.expired-card { text-align: center; }
.cta { text-align: center; background: var(--ink); color: #fff; }
.cta p { color: #cfcde0; }
.cta .btn { margin-top: 6px; }
.people { margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 650; transition: transform .25s ease; z-index: 20; max-width: calc(100% - 32px); }
.toast.show { transform: translateX(-50%) translateY(0); }
dialog { border: 0; border-radius: 20px; padding: 22px; width: min(520px, calc(100% - 24px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); color: var(--ink); }
dialog::backdrop { background: rgba(29, 27, 44, .45); }
.dialog-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spinner { padding: 60px 0; text-align: center; color: var(--muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .card { padding: 18px; }
  .top nav a.hide-sm { display: none; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .dot { width: 26px; height: 26px; }
}
/* Layout spacing: stacked sections on the plan page, grid cards on the home page */
#app { display: grid; gap: 16px; }
#app > * { margin: 0; }
.steps .card + .card { margin-top: 0; }
