:root {
  --navy: #1c2541;
  --navy-2: #2b3658;
  --ivory: #f7f3ea;
  --paper: #fffdf8;
  --brass: #a8824a;
  --brass-soft: #efe4d0;
  --ink: #1c2541;
  --muted: #6b7083;
  --line: #e4ddcf;
  --ok: #3d7a5a;
  --bad: #a4443b;
  --radius: 14px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; margin: 0 0 .4em; }
h1 { font-size: 2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.25rem; }
a { color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

.btn { appearance: none; border: 1px solid var(--navy); background: var(--navy); color: var(--ivory); font: 600 1rem var(--sans); padding: .8em 1.2em; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4em; }
.btn:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--brass-soft); }
.btn.small { font-size: .85rem; padding: .45em .9em; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

input, textarea, select { font: inherit; color: inherit; width: 100%; padding: .7em .85em; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brass); outline-offset: 1px; border-color: transparent; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .9em 0 .3em; }
.check { display: flex; align-items: center; gap: .6em; font-weight: 500; margin: .5em 0; }
.check input { width: 1.2em; height: 1.2em; accent-color: var(--navy); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.card + .card { margin-top: .9rem; }
.error { color: var(--bad); font-weight: 600; margin-top: .6em; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: var(--ivory); padding: .7em 1.2em; border-radius: 999px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.18); z-index: 50; transition: opacity .3s; }

/* ---------- attendee (phone) ---------- */
.phone { max-width: 520px; margin: 0 auto; min-height: 100vh; padding: 0 16px 96px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; }
.topbar img { height: 34px; }
.hello { margin: 8px 0 16px; }
.hello h1 { font-size: 1.9rem; margin: 0; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--navy); display: flex; justify-content: center; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
.tabs button { flex: 1; max-width: 130px; background: none; border: 0; color: #b8bdcc; font: 600 .8rem var(--sans); padding: 8px 4px; border-radius: 10px; cursor: pointer; }
.tabs button .ico { display: block; font-size: 1.25rem; line-height: 1.2; }
.tabs button.on { color: var(--ivory); background: rgba(255,255,255,.08); }
.tabs .badge { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 999px; background: var(--brass); color: #fff; font-size: .7rem; margin-left: 2px; }

.q { padding: 1.1rem 1.1rem 1.2rem; }
.q h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
.q .state { font-size: .8rem; color: var(--ok); font-weight: 600; float: right; margin-left: 8px; }
.choices { display: grid; gap: 8px; margin-top: 10px; }
.choice { text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: .85em 1em; font: 500 1rem var(--sans); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.choice.on { border-color: var(--navy); background: var(--navy); color: var(--ivory); }
.scale { display: flex; gap: 6px; margin-top: 12px; }
.scale .choice { flex: 1; text-align: center; padding: .9em 0; font-weight: 700; }
.scale-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 6px; }

.person { display: flex; gap: 12px; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: var(--ivory); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.person .who { min-width: 0; }
.person .who b { display: block; }
.person .who span { display: block; font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }

.hero { text-align: center; padding: 48px 8px 24px; }
.hero img { width: min(260px, 80%); margin-bottom: 28px; }
.hero .big { font-size: 3.4rem; line-height: 1; margin-bottom: 12px; }
.met-burst { text-align: center; padding: 28px 10px; }
.met-burst .avatar { width: 84px; height: 84px; font-size: 2.2rem; margin: 0 auto 14px; }

/* ---------- admin ---------- */
.admin-top { background: var(--navy); color: var(--ivory); }
.admin-top .inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.admin-top img { height: 30px; }
.admin-top .event { font-family: var(--serif); font-size: 1.35rem; margin-right: auto; }
.admin-top .live { font-size: .85rem; color: #c9cede; }
.admin-top .live b { color: #fff; }
.admin-nav { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.admin-nav .inner { max-width: 1200px; margin: 0 auto; padding: 0 12px; display: flex; overflow-x: auto; }
.admin-nav button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 14px 11px; font: 600 .95rem var(--sans); color: var(--muted); cursor: pointer; white-space: nowrap; }
.admin-nav button.on { color: var(--navy); border-color: var(--brass); }
.admin-main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 80px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.stat { display: inline-block; margin-right: 26px; }
.stat b { display: block; font-family: var(--serif); font-size: 2.2rem; line-height: 1; }
.stat span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.result h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.bar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 64px; gap: 10px; align-items: center; margin: 7px 0; font-size: .9rem; }
.bar .track { background: var(--brass-soft); border-radius: 6px; height: 22px; overflow: hidden; }
.bar .fill { background: var(--navy); height: 100%; border-radius: 6px; transition: width .5s ease; min-width: 2px; }
.bar .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: .2em .65em; border-radius: 999px; background: var(--brass-soft); color: var(--navy); }
.pill.open { background: #dcebe2; color: var(--ok); }

table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
table.list td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list input { padding: .4em .55em; }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; }

.group { padding: 1rem; }
.group h3 { display: flex; justify-content: space-between; align-items: baseline; }
.group ul { list-style: none; margin: 0; padding: 0; }
.group li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.group li select { width: auto; padding: .2em .3em; font-size: .8rem; }
.group .traits { font-size: .8rem; color: var(--muted); margin-top: 8px; }

.modal-back { position: fixed; inset: 0; background: rgba(28,37,65,.45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: var(--paper); border-radius: var(--radius); padding: 1.4rem; width: min(560px, 100%); max-height: 90vh; overflow: auto; }

@media (max-width: 600px) {
  .grid2 { grid-template-columns: 1fr; }
  .admin-main { padding: 16px 16px 60px; }
  .bar { grid-template-columns: 1fr 1.2fr 52px; }
}
