/* The Institute of Love, live questions and polls. Tokens copied from the signup site (not imported). */
@font-face {
  font-family: 'Figtree Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url(/fonts/figtree-latin-wght-normal.woff2) format('woff2-variations');
}
@font-face {
  font-family: 'Source Serif 4 Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(/fonts/source-serif-4-latin-opsz-normal.woff2) format('woff2-variations');
}

:root {
  --night: #121a3a;
  --night-2: #1b2550;
  --paper: #fdfcfa;
  --card: #ffffff;
  --gold: #7a5c26;
  --gold-hover: #5e461c;
  --gold-night: #c8a86e;
  --gold-tint: #f3ede0;
  --wine: #8b1e2f;
  --text: #1e1d1b;
  --text-2: #4a4740;
  --text-3: #6b665d;
  --line: #e7e3da;
  --serif: 'Source Serif 4 Variable', Georgia, serif;
  --sans: 'Figtree Variable', Arial, sans-serif;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--paper); line-height: 1.5; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Public ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.brand { background: var(--night); color: var(--paper); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; }
.brand__name { font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .01em; }
.brand__event { color: var(--gold-night); font-size: 14px; }
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 20px 16px 32px; flex: 1; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; }
.card.calm { text-align: center; padding: 40px 18px; }
.title { font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.15; margin: 0 0 6px; color: var(--night); }
.lead { margin: 0 0 18px; color: var(--text-2); font-size: 17px; }
textarea, .input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 14px; font-size: 17px; background: var(--paper);
  resize: vertical; min-height: 140px;
}
.input { min-height: 0; resize: none; }
textarea:focus, .input:focus { border-color: var(--gold); outline: none; }
.row { display: flex; justify-content: flex-end; margin-top: 6px; }
.counter { font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.counter.is-low { color: var(--wine); }
.hint { font-size: 14px; color: var(--text-2); margin: 10px 0 16px; }
.error { color: var(--wine); font-weight: 600; margin: 0 0 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; width: 100%;
  border: 0; border-radius: 999px; background: var(--gold); color: #fff; font-weight: 600; font-size: 17px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--gold-hover); }
.btn:disabled { opacity: .55; cursor: default; }
.done { text-align: center; padding: 12px 0 4px; }
.done__text { font-family: var(--serif); font-size: 24px; color: var(--night); margin: 0 0 12px; }
.link { color: var(--gold); font-weight: 600; text-underline-offset: 3px; }
.foot { padding: 16px; text-align: center; font-size: 13px; color: var(--text-3); max-width: 560px; margin: 0 auto; }
.foot a { color: var(--text-2); }

/* Poll card on the public page */
.poll { background: var(--night); color: var(--paper); border-radius: var(--radius); padding: 22px 18px; }
.poll__label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-night); margin: 0 0 6px; }
.poll__q { font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.2; margin: 0 0 16px; }
.poll__hint { font-size: 14px; color: #cfd3e3; margin: -8px 0 14px; }
.opts { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; padding: 0; border: 0; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1.5px solid #3a4470; border-radius: 12px; cursor: pointer; font-size: 17px; }
.opt input { width: 22px; height: 22px; accent-color: var(--gold-night); flex: none; margin: 0; }
.opt:has(input:checked) { border-color: var(--gold-night); background: var(--night-2); }
.scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 8px; margin: 0 0 8px; }
.scale button { min-height: 56px; border-radius: 12px; border: 1.5px solid #3a4470; background: transparent; color: var(--paper); font-size: 20px; font-weight: 600; cursor: pointer; }
.scale button[aria-pressed='true'] { border-color: var(--gold-night); background: var(--gold-night); color: var(--night); }
.scale__labels { display: flex; justify-content: space-between; font-size: 13px; color: #cfd3e3; margin: 0 0 16px; gap: 12px; }
.poll .input { background: var(--night-2); border-color: #3a4470; color: var(--paper); margin-bottom: 16px; }
.poll .btn { background: var(--gold-night); color: var(--night); }
.poll .btn:hover { background: #d8bd88; }
.poll .error { color: #ffb4bf; }
.poll__done { font-family: var(--serif); font-size: 22px; margin: 0; }

/* Result bars (public, admin, screen) */
.bars { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bar__top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.bar__n { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bar__track { height: 10px; border-radius: 6px; background: rgba(127, 127, 127, .18); overflow: hidden; margin-top: 4px; }
.bar__fill { height: 100%; width: 0; background: var(--gold-night); border-radius: 6px; transition: width .4s ease; }
.admin .bar__fill { background: var(--gold); }
.total { font-size: 14px; color: var(--text-3); margin-top: 10px; }
.poll .total { color: #cfd3e3; }

/* ---------- Admin ---------- */
.admin { background: var(--paper); }
.bar { position: sticky; top: 0; z-index: 5; background: var(--night); color: var(--paper); padding: 12px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.bar__event, .bar__new { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bar select, .bar input { min-height: 40px; border-radius: 8px; border: 1px solid #3a4470; background: var(--night-2); color: var(--paper); padding: 0 10px; }
.bar select { max-width: 100%; }
.bar input { flex: 1; min-width: 200px; }
.pill { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: #2a3463; color: #cfd3e3; }
.pill.is-live { background: var(--wine); color: #fff; }
.btn--small { min-height: 40px; width: auto; padding: 0 16px; font-size: 15px; }
.btn--ghost { background: transparent; border: 1.5px solid var(--gold-night); color: var(--gold-night); }
.btn--ghost:hover { background: rgba(200, 168, 110, .12); }
.panel .btn--ghost { border-color: var(--gold); color: var(--gold); }
.panel .btn--ghost:hover { background: var(--gold-tint); }
.btn--danger { background: var(--wine); }
.btn--danger:hover { background: #6d1724; }
.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tab { background: none; border: 0; color: #cfd3e3; padding: 10px 14px; border-bottom: 3px solid transparent; cursor: pointer; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tab.is-on { color: var(--paper); border-color: var(--gold-night); }
.badge:not(:empty) { background: var(--gold-night); color: var(--night); border-radius: 999px; padding: 0 7px; font-size: 13px; margin-left: 4px; }
.admin__main { max-width: 900px; margin: 0 auto; padding: 16px; }
.tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.tools__right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 15px; }
.chip.is-on { background: var(--night); border-color: var(--night); color: var(--paper); }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--text-2); }
.empty { color: var(--text-3); text-align: center; padding: 30px 0; }
.qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.q { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.q.is-new { border-left-color: var(--gold-night); }
.q.is-starred { border-left-color: var(--gold); background: #fffaf0; }
.q.is-answered { opacity: .6; }
.q.is-hidden { opacity: .45; }
.q__text { font-size: 19px; line-height: 1.45; margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.q__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--text-3); }
.q__meta time { margin-right: auto; font-variant-numeric: tabular-nums; }
.act { min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: 14px; }
.act:hover { border-color: var(--gold); }
.act.is-on { background: var(--gold-tint); border-color: var(--gold); color: var(--gold-hover); font-weight: 600; }
.danger { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 16px; color: var(--text-2); font-size: 15px; }
.danger summary { cursor: pointer; color: var(--wine); font-weight: 600; }
.danger input { display: block; margin: 6px 0 10px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.note { font-size: 14px; color: var(--text-2); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--night); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 15px; display: flex; gap: 12px; align-items: center; z-index: 10; }
.toast button { background: none; border: 0; color: var(--gold-night); font-weight: 700; cursor: pointer; }

/* Admin polls */
.pform { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; display: grid; gap: 12px; }
.pform h2, .plist h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0; color: var(--night); }
.pform label { font-size: 14px; color: var(--text-2); display: grid; gap: 4px; }
.pform input, .pform select { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--paper); }
.pform .inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.pform .inline label { flex: 1; min-width: 120px; }
.optrow { display: flex; gap: 8px; }
.optrow input { flex: 1; }
.templates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--text-2); }
.plist { display: grid; gap: 12px; }
.p { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.p.is-live { border-color: var(--wine); box-shadow: 0 0 0 2px rgba(139, 30, 47, .15); }
.p__head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.p__q { font-family: var(--serif); font-size: 20px; margin: 0; overflow-wrap: anywhere; }
.p__type { font-size: 13px; color: var(--text-3); }
.p__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.p .bar__fill { background: var(--gold); }
.shortlist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.shortlist li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; overflow-wrap: anywhere; }
.shortlist li.is-hidden span:first-child { text-decoration: line-through; color: var(--text-3); }

/* ---------- Big screen ---------- */
.screen { background: var(--night); color: var(--paper); min-height: 100vh; margin: 0; }
.screen__main { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 5vh 6vw; }
.screen__idle { font-family: var(--serif); font-size: clamp(28px, 5vw, 64px); color: var(--gold-night); text-align: center; margin: 0; }
.screen__label { font-size: clamp(14px, 1.8vw, 24px); letter-spacing: .1em; text-transform: uppercase; color: var(--gold-night); margin: 0 0 1.5vh; }
.screen__q { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 5.2vw, 76px); line-height: 1.12; margin: 0 0 4vh; }
.screen .bars { gap: 2.4vh; }
.screen .bar__top { font-size: clamp(20px, 3vw, 44px); }
.screen .bar__track { height: clamp(16px, 2.6vh, 34px); border-radius: 10px; margin-top: 1vh; background: rgba(255, 255, 255, .1); }
.screen .bar__fill { border-radius: 10px; }
.screen .total { color: #cfd3e3; font-size: clamp(16px, 2vw, 28px); margin-top: 3vh; }
.screen__avg { font-family: var(--serif); font-size: clamp(40px, 8vw, 120px); color: var(--gold-night); margin: 0 0 2vh; }

/* fixes */
.pform label.check { display: inline-flex; gap: 8px; align-items: center; }
.pform input[type='checkbox'], .p input[type='checkbox'], .check input { min-height: 0; width: 18px; height: 18px; accent-color: var(--gold); }
a.act { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
.nw { white-space: nowrap; }
