/* questions — Notion-flavoured, vibrant-but-serious */
:root {
  --text: rgb(55, 53, 47);
  --text-2: rgba(55, 53, 47, 0.65);
  --text-3: rgba(55, 53, 47, 0.45);
  --bg: #ffffff;
  --bg-2: rgb(251, 251, 250);
  --hover: rgba(55, 53, 47, 0.06);
  --border: rgba(55, 53, 47, 0.09);
  --border-2: rgba(55, 53, 47, 0.16);
  --shadow: rgba(15, 15, 15, 0.04) 0 0 0 1px, rgba(15, 15, 15, 0.03) 0 3px 6px, rgba(15, 15, 15, 0.06) 0 9px 24px;
  --blue: #2383e2; --blue-bg: rgba(35, 131, 226, 0.1);
  --green: #0f7b6c; --green-bg: rgba(15, 123, 108, 0.1);
  --orange: #d9730d; --orange-bg: rgba(217, 115, 13, 0.1);
  --red: #e03e3e; --red-bg: rgba(224, 62, 62, 0.1);
  --purple: #6940a5; --purple-bg: rgba(105, 64, 165, 0.1);
  --pink: #ad1a72;
  --yellow: #dfab01;
  --cover: linear-gradient(120deg, #2383e2 0%, #6940a5 45%, #ad1a72 75%, #d9730d 100%);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
  --serif: Lyon-Text, Georgia, ui-serif, serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--text); }
button, input, textarea, select { font: inherit; color: inherit; }

/* ---------- layout ---------- */
.topbar { position: sticky; top: 0; z-index: 10; height: 45px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); font-size: 14px; }
.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; }
.crumb { padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.crumb:hover { background: var(--hover); }
.crumb-sep { color: var(--text-3); }
.topbar-actions { display: flex; gap: 4px; align-items: center; }

.cover { height: 180px; background: var(--cover); position: relative; overflow: hidden; }
.cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.25), transparent 50%), radial-gradient(circle at 10% 90%, rgba(0,0,0,.12), transparent 50%); }
.cover.small { height: 110px; }
.page { max-width: 760px; margin: 0 auto; padding: 0 24px 96px; }
.page.wide { max-width: 1000px; }
.page-icon { font-size: 72px; line-height: 1; margin-top: -40px; position: relative; z-index: 1; user-select: none; }
.page-title { font-size: 40px; font-weight: 700; line-height: 1.2; margin: 16px 0 4px; letter-spacing: -0.01em; }
.page-sub { color: var(--text-2); margin: 0 0 20px; }

/* properties (Notion page properties) */
.props { display: grid; grid-template-columns: 160px 1fr; gap: 2px 8px; font-size: 14px; margin: 12px 0 20px; }
.prop-k { color: var(--text-2); padding: 5px 6px; display: flex; gap: 6px; align-items: center; }
.prop-v { padding: 5px 6px; border-radius: 4px; min-width: 0; overflow-wrap: anywhere; }
hr.div { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--bg); cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: background .12s; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #0077d4; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 13px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 15px; }

.input, .textarea, .select { width: 100%; border: 1px solid var(--border-2); border-radius: 6px; padding: 8px 10px; background: var(--bg-2); outline: none; transition: box-shadow .12s, border-color .12s, background .12s; }
.input:focus, .textarea:focus, .select:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.label { font-size: 12px; font-weight: 500; color: var(--text-2); margin: 12px 0 4px; display: block; }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.error { color: var(--red); font-size: 14px; margin-top: 8px; min-height: 1em; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 3px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.orange { background: var(--orange-bg); color: var(--orange); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }
.tag.gray { background: var(--hover); color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.live .dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.callout { display: flex; gap: 12px; padding: 16px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); }
.callout.blue { background: var(--blue-bg); border-color: transparent; }
.callout.orange { background: var(--orange-bg); border-color: transparent; }
.callout-icon { font-size: 20px; line-height: 1.3; }

.card { border: 1px solid var(--border); border-radius: 8px; padding: 16px; background: var(--bg); }
.box-shadow { box-shadow: var(--shadow); border: 0; }

/* segmented tabs */
.tabs { display: inline-flex; gap: 2px; padding: 2px; border-radius: 6px; background: var(--hover); }
.tab { border: 0; background: transparent; height: 26px; padding: 0 10px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); }
.tab.active { background: #fff; color: var(--text); box-shadow: rgba(15,15,15,.1) 0 0 0 1px, rgba(15,15,15,.1) 0 2px 4px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 8px; flex-wrap: wrap; }
.h2 { font-size: 20px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.count { color: var(--text-3); font-weight: 400; font-size: 16px; }

/* ---------- questions list ---------- */
.qlist { display: flex; flex-direction: column; }
.q { display: flex; gap: 14px; padding: 14px 8px; border-bottom: 1px solid var(--border); border-radius: 4px; transition: background .15s; animation: fadein .25s ease; }
.q:hover { background: rgba(55,53,47,.025); }
.q.answered { opacity: .6; }
.q.pinned { background: var(--blue-bg); }
.q.hidden-q { opacity: .45; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.vote { flex: none; width: 52px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--border-2); border-radius: 8px; background: #fff; cursor: pointer; transition: all .12s; }
.vote:hover { border-color: var(--blue); color: var(--blue); }
.vote.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.vote:disabled { cursor: default; opacity: .6; }
.vote .arrow { font-size: 14px; line-height: 1; }
.vote .n { font-size: 16px; font-weight: 700; line-height: 1.3; }
.q-body { flex: 1; min-width: 0; }
.q-text { font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); margin-top: 6px; }
.q-actions { display: flex; gap: 2px; margin-left: auto; opacity: 0; transition: opacity .12s; }
.q:hover .q-actions, .q:focus-within .q-actions { opacity: 1; }
@media (hover: none) { .q-actions { opacity: 1; } }
.empty { padding: 40px 16px; text-align: center; color: var(--text-3); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ask box */
.ask { margin-top: 8px; }
.ask-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ask-foot .input { max-width: 240px; height: 32px; padding: 4px 10px; }
.charcount { font-size: 12px; color: var(--text-3); margin-left: auto; }

/* sessions table (admin) */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--text-2); padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: rgba(55,53,47,.025); }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.mono { font-family: var(--mono); font-size: 13px; background: rgba(135,131,120,.15); color: #eb5757; padding: 1px 5px; border-radius: 4px; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,15,15,.45); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px; z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 10px; box-shadow: var(--shadow); width: 100%; max-width: 520px; padding: 24px; animation: pop .15s ease; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: rgb(47,52,55); color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 14px; box-shadow: var(--shadow); z-index: 60; animation: pop .15s; }

/* landing */
.hero { text-align: center; padding: 72px 24px 24px; }
.hero h1 { font-size: 56px; letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 16px; }
.grad { background: var(--cover); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-2); font-size: 19px; max-width: 520px; margin: 0 auto 32px; }
.join { display: flex; gap: 8px; max-width: 440px; margin: 0 auto; }
.join .input { height: 40px; font-size: 16px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 760px; margin: 56px auto 0; padding: 0 24px; }
.feature { padding: 16px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); }
.feature .ic { font-size: 22px; }
.feature b { display: block; margin: 6px 0 2px; font-size: 15px; }
.feature span { color: var(--text-2); font-size: 14px; }

/* ---------- presenter ---------- */
.present { min-height: 100vh; display: grid; grid-template-columns: 1fr 360px; background: var(--bg); }
.present-main { display: flex; flex-direction: column; padding: 40px 56px; min-width: 0; position: relative; }
.present-main::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--cover); }
.present-head { display: flex; align-items: center; gap: 14px; }
.present-head .emoji { font-size: 40px; }
.present-title { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; margin: 0; line-height: 1.2; }
.present-url { color: var(--text-2); font-size: 18px; margin-top: 2px; }
.present-url b { color: var(--blue); font-weight: 600; }
.stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; }
.stage-label { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.stage-q { font-size: clamp(32px, 4.6vw, 72px); font-weight: 700; line-height: 1.18; letter-spacing: -0.02em; overflow-wrap: anywhere; animation: rise .45s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.stage-meta { display: flex; align-items: center; gap: 16px; margin-top: 28px; font-size: 22px; color: var(--text-2); }
.stage-votes { display: inline-flex; align-items: center; gap: 8px; background: var(--blue-bg); color: var(--blue); font-weight: 700; padding: 6px 14px; border-radius: 999px; }
.stage-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.present-side { border-left: 1px solid var(--border); background: var(--bg-2); padding: 28px 24px; display: flex; flex-direction: column; gap: 20px; overflow: hidden; max-height: 100vh; }
.qr-box { background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--shadow); text-align: center; }
.qr-box canvas, .qr-box img, .qr-box svg { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.qr-cap { font-size: 14px; color: var(--text-2); margin-top: 10px; }
.qr-cap b { color: var(--text); display: block; font-size: 15px; overflow-wrap: anywhere; }
.next-list { display: flex; flex-direction: column; gap: 6px; overflow: auto; min-height: 0; }
.next-item { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; animation: fadein .25s; }
.next-item .v { flex: none; min-width: 34px; text-align: center; font-weight: 700; color: var(--blue); background: var(--blue-bg); border-radius: 4px; padding: 1px 4px; font-size: 13px; }
.next-item .t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.side-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); display: flex; justify-content: space-between; }
.present-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-3); font-size: 14px; }

/* share block on participant page */
.share { display: flex; gap: 16px; align-items: center; }
.share .qr-mini { width: 96px; flex: none; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border); }
.share .qr-mini svg { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .present { grid-template-columns: 1fr; }
  .present-side { border-left: 0; border-top: 1px solid var(--border); max-height: none; }
  .present-main { padding: 28px 24px; }
}
@media (max-width: 640px) {
  .page-title { font-size: 30px; }
  .hero h1 { font-size: 40px; }
  .features { grid-template-columns: 1fr; }
  .props { grid-template-columns: 110px 1fr; }
  .field-row { flex-direction: column; gap: 0; }
  .cover { height: 120px; }
  .page-icon { font-size: 56px; margin-top: -32px; }
  .table .hide-sm { display: none; }
  .ask-foot { flex-wrap: wrap; }
  .ask-foot .input { max-width: none; }
}
