:root {
  --bg: #eef2f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #3a5f91;
  --brand-d: #2d4a72;
  --brand-pale: #eaf1f9;
  --good: #16a34a;
  --bad: #dc2626;
  --warn: #b45309;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win over class `display` rules
   (e.g. .pill, .lobby, .active) — JS toggles visibility via el.hidden. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 80% -10%, var(--brand-pale) 0%, var(--bg) 55%);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px); }

h1, h2 { line-height: 1.15; margin: 0 0 .4em; }

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--brand); margin: 0 0 .3em; }

/* ---- buttons ---- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: .98rem; font-weight: 600; padding: 11px 18px;
  border-radius: 12px; cursor: pointer; transition: transform .06s ease, box-shadow .15s ease, background .15s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: #fecaca; }
.btn.small { padding: 6px 12px; font-size: .85rem; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- forms ---- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search],
input[type=number], select, textarea {
  width: 100%; margin-top: 6px; padding: 11px 13px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink);
  font-weight: 500; font-family: inherit; box-sizing: border-box;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }

/* ---- landing ---- */
.hero { text-align: center; padding: 28px 0 8px; }
.brand { font-size: clamp(2.4rem, 6vw, 3.6rem); letter-spacing: -.02em; margin-bottom: .1em; }
.tagline { color: var(--muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.center-card {
  max-width: 460px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); text-align: center;
}
.center-card .btn { margin-top: 10px; text-decoration: none; display: inline-block; }
.join-title { font-size: 1.6rem; }
.center-card form { text-align: left; margin-top: 18px; }

/* ---- about / how-it-works (landing) ---- */
.about { margin-top: 44px; display: flex; flex-direction: column; gap: 32px; }
.about-h { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
.about-lead { color: var(--muted); font-size: 1.08rem; max-width: 760px; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.feature-ic { font-size: 1.7rem; display: block; margin-bottom: 8px; }
.feature h3 { font-size: 1.05rem; margin: 0 0 .3em; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.about-list, .about-steps { color: var(--muted); padding-left: 1.15em; margin: 10px 0 0; display: flex; flex-direction: column; gap: 9px; }
.about-list li strong, .about-steps li strong { color: var(--ink); }
.about-sub { font-weight: 700; margin: 18px 0 0; color: var(--ink); }

/* ---- pills / topbar ---- */
.pill { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: .9rem; font-weight: 600; }
.code-pill { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.warn { background: #fffbeb; color: var(--warn); border-color: #fde68a; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.topbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.host-title { font-size: 1.5rem; margin: 0; }

/* ---- host layout ---- */
.host-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.stage { display: flex; flex-direction: column; gap: 18px; min-height: 60vh; }

.q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.q-item.is-live { border-color: var(--brand); background: var(--brand-pale); }
.q-item .q-meta { flex: 1; min-width: 0; }
.q-item .q-text { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .q-sub { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.q-badge { font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--brand-pale); color: var(--brand-d); }
.q-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 4px; }
.q-del:hover { color: var(--bad); }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-row input[type=text] { margin-top: 0; }
.opt-row input[type=radio] { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.opt-row .opt-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; flex: none; }

/* ---- lobby ---- */
.lobby { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px; box-shadow: var(--shadow); }
.join-url { font-size: 1.3rem; font-weight: 700; word-break: break-all; margin: 0 0 6px; }
.big-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 800; letter-spacing: .1em; margin: 8px 0 12px; color: var(--brand-d); }
.qr-box { width: clamp(180px, 26vw, 280px); background: #fff; padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.qr-box .qr { width: 100%; height: auto; display: block; }

/* ---- active question ---- */
.active { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); }
.active-prompt { font-size: clamp(1.5rem, 3.4vw, 2.4rem); margin: 4px 0 22px; }
.viz { min-height: 180px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

/* bars */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 1fr; gap: 4px; }
.bar-top { display: flex; justify-content: space-between; font-weight: 600; font-size: 1.05rem; gap: 12px; }
.bar-track { background: #eef2f7; border-radius: 10px; height: 34px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 10px; transition: width .5s cubic-bezier(.2,.8,.2,1); min-width: 2px; }
.bar-row.correct .bar-top { color: var(--good); }
.bar-row.correct .bar-pct::after { content: " ✓"; }
.bar-count { color: var(--muted); font-weight: 500; }

/* word cloud */
.cloud { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; justify-content: center; padding: 10px; }
.cloud-word { font-weight: 700; line-height: 1.1; color: var(--brand-d); }
.cloud-empty, .feed-empty { color: var(--muted); text-align: center; padding: 30px; }

/* feed */
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.feed-text { flex: 1; font-size: 1.05rem; white-space: pre-wrap; word-break: break-word; }
.upvote { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line);
  background: #fff; border-radius: 10px; padding: 4px 10px; cursor: pointer; font-weight: 700; min-width: 46px; }
.upvote .uv-count { font-size: 1.05rem; }
.upvote .uv-label { font-size: .65rem; color: var(--muted); text-transform: uppercase; }
.upvote.voted { background: var(--brand-pale); border-color: var(--brand); color: var(--brand-d); }

/* leaderboard */
.leaderboard h2 { margin-top: 0; }
.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: rank; }
.lb-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: #f8fafc; font-weight: 600; }
.lb-list li::before { counter-increment: rank; content: counter(rank); width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .85rem; }
.lb-list li:nth-child(1)::before { background: #f59e0b; }
.lb-list li:nth-child(2)::before { background: #94a3b8; }
.lb-list li:nth-child(3)::before { background: #b45309; }
.lb-list .lb-score { margin-left: auto; color: var(--brand-d); }

/* ---- lively results: animations + confetti ---- */
@keyframes lb-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.lb-list li { animation: lb-in .38s ease both; }

@keyframes pcount-pop { 0% { transform: scale(1); } 35% { transform: scale(1.4); color: var(--brand); } 100% { transform: scale(1); } }
#pcount.pop { display: inline-block; animation: pcount-pop .5s ease; }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti i { position: absolute; top: -12vh; width: 9px; height: 14px; border-radius: 2px; opacity: .92;
  animation-name: confetti-fall; animation-timing-function: cubic-bezier(.3,.6,.5,1); animation-fill-mode: forwards; }
@keyframes confetti-fall { to { transform: translate(var(--dx, 0), 115vh) rotate(720deg); opacity: 1; } }

/* ---- quiz countdown + tension ---- */
.countdown { position: relative; width: 130px; height: 130px; margin: 0 auto 14px; }
.cd-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.cd-bg { fill: none; stroke: var(--line); stroke-width: 8; }
.cd-fg { fill: none; stroke: var(--brand); stroke-width: 8; stroke-linecap: round; }
.cd-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; font-weight: 800; color: var(--brand-d); }
.countdown.cd-danger .cd-fg { stroke: var(--bad); }
.countdown.cd-danger .cd-num { color: var(--bad); animation: cd-pulse .6s ease infinite; }
@keyframes cd-pulse { 50% { transform: scale(1.13); } }
.countdown.cd-done .cd-num { color: var(--muted); }
.quiz-live { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; }
.quiz-answered-wrap { text-align: center; }
.quiz-answered { font-size: 2.6rem; font-weight: 800; color: var(--brand-d); line-height: 1; }
.quiz-answered-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.quiz-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.quiz-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 600; background: #fff; }
.quiz-chip .dot { width: 16px; height: 16px; border-radius: 5px; }

/* ---- live emoji reactions ---- */
.react-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 6px;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; box-shadow: var(--shadow); z-index: 50; }
.react-btn { border: none; background: none; font-size: 1.55rem; line-height: 1; cursor: pointer;
  padding: 4px; border-radius: 50%; transition: transform .1s ease; }
.react-btn:hover { transform: scale(1.18); }
.react-btn.tap { animation: react-pop .3s ease; }
@keyframes react-pop { 50% { transform: scale(1.55); } }
.float-emoji { position: fixed; bottom: 9vh; font-size: 2.4rem; pointer-events: none; z-index: 55;
  animation-name: emoji-rise; animation-timing-function: ease-out; animation-fill-mode: forwards; }
@keyframes emoji-rise {
  0% { opacity: 0; transform: translateY(0) scale(.5); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), -72vh) scale(1.25); }
}

/* ---- new question types: rating + numeric ---- */
.scale-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.scale-btn { width: 64px; height: 64px; border: 2px solid var(--line); border-radius: 14px; background: #fff;
  font-size: 1.5rem; font-weight: 800; color: var(--brand-d); cursor: pointer;
  transition: transform .08s ease, border-color .15s, background .15s; }
.scale-btn:hover { border-color: var(--brand); background: var(--brand-pale); transform: translateY(-2px); }
.stat-row { text-align: center; margin-bottom: 18px; }
.stat-big { font-size: 3rem; font-weight: 800; color: var(--brand-d); line-height: 1; text-align: center; }
.stat-label { text-align: center; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.stat-range { text-align: center; color: var(--muted); margin-top: 8px; font-weight: 600; }

/* ---- admin settings ---- */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
@media (max-width: 640px) { .admin-grid { grid-template-columns: 1fr; } }

/* ---- pricing ---- */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; align-items: start; }
.price-card { display: flex; flex-direction: column; }
.price-card h2 { font-size: 1.15rem; margin-bottom: 2px; }
.price-card .price { font-size: 2rem; font-weight: 800; color: var(--brand-d); margin: 4px 0 14px; }
.price-card .price span { font-size: .8rem; font-weight: 600; color: var(--muted); }
.price-feat { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: .9rem; flex: 1; }
.price-feat li::before { content: "✓ "; color: var(--good); font-weight: 700; }
.price-card.featured { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-pale), var(--shadow); }
.price-card .btn { text-decoration: none; text-align: center; }
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .pricing-grid { grid-template-columns: 1fr; } }

/* ---- student play ---- */
.play-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.play-stage { display: flex; flex-direction: column; gap: 16px; }
.waiting { text-align: center; padding: 16vh 0; color: var(--muted); }
.spinner { width: 38px; height: 38px; border: 4px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; margin: 0 auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.q-prompt { font-size: 1.5rem; font-weight: 700; margin: 4px 0 18px; }
.choices { display: flex; flex-direction: column; gap: 12px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 18px;
  font-size: 1.15rem; font-weight: 600; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.choice:hover { border-color: var(--brand); }
.choice .dot { width: 26px; height: 26px; border-radius: 8px; flex: none; }
.choice.selected { border-color: var(--brand); background: var(--brand-pale); }
.choice.correct { border-color: var(--good); background: #f0fdf4; }
.choice.wrong { border-color: var(--bad); background: #fef2f2; }
.choice:disabled { cursor: default; opacity: .95; }

.text-answer textarea { width: 100%; min-height: 110px; padding: 14px; font-size: 1.1rem; font-family: inherit;
  border: 2px solid var(--line); border-radius: 14px; resize: vertical; }
.text-answer textarea:focus { outline: none; border-color: var(--brand); }

.banner { padding: 16px 18px; border-radius: 14px; font-weight: 600; text-align: center; }
.banner.ok { background: var(--brand-pale); color: var(--brand-d); }
.banner.good { background: #f0fdf4; color: var(--good); }
.banner.bad { background: #fef2f2; color: var(--bad); }
.result-line { text-align: center; font-size: 1.1rem; margin-top: 4px; }
.score-big { font-size: 2.2rem; font-weight: 800; color: var(--brand-d); }

/* ---- footer ---- */
.site-nav { padding: 12px 0 4px; }
.site-nav-brand { font-weight: 800; font-size: 1.1rem; color: var(--brand); text-decoration: none; letter-spacing: -.01em; }
.site-nav-brand:hover { color: var(--brand-d); text-decoration: underline; }
.site-banner { background: var(--brand-pale); color: var(--brand-d); border-radius: 10px; padding: 10px 14px; margin: 8px 0 4px; font-weight: 600; text-align: center; font-size: .92rem; }
.site-banner.warn { background: #fef9c3; color: #854d0e; }
.testi-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.testi-meta { display: flex; gap: 8px; margin-top: 6px; }
.testi-meta input { flex: 1; min-width: 0; }
.logo-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.logo-row input[type=file] { font-size: .85rem; }
.logo-prev { max-height: 42px; max-width: 140px; border-radius: 6px; background: #fff; padding: 3px; border: 1px solid var(--line); object-fit: contain; }
.pro-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; margin-top: 8px; }
.pro-slot-label { display: flex; align-items: center; gap: 8px; }
.pro-num { color: #64748b; font-weight: 700; min-width: 18px; text-align: right; }
.pro-slot { flex: 1; min-width: 0; }
@media (max-width: 560px) { .pro-grid { grid-template-columns: 1fr; } }
.site-footer { margin-top: 40px; padding: 22px 0 6px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.site-footer .footer-logo { height: 30px; width: auto; opacity: .92; }
.footer-legal { color: var(--muted); }
.footer-legal a { color: var(--muted); text-decoration: none; }
.footer-legal a:hover { color: var(--brand); text-decoration: underline; }

/* ---- legal / policy pages ---- */
.legal { max-width: 760px; line-height: 1.6; }
.legal h2 { font-size: 1.05rem; margin: 22px 0 6px; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 20px; }
.legal li { margin: 4px 0; }

/* ---- admin subscribers ---- */
.billing-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mode-pill { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.mode-live { background: #dcfce7; color: #166534; }
.mode-test { background: #fef9c3; color: #854d0e; }
.mode-off  { background: #f1f5f9; color: #475569; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.stat-tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-align: center; }
.stat-num { font-size: 1.5rem; font-weight: 800; color: var(--brand-d); }
.stat-lbl { font-size: .72rem; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .03em; }
.badge-pro { background: #dcfce7 !important; color: #166534 !important; }
.dtable-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dtable th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.dtable td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.dtable tbody tr:hover { background: var(--brand-pale); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 700px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- homepage: medical positioning ---- */
.hero-by { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.usecase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.usecase { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.uc-ic { font-size: 1.5rem; line-height: 1; }
.usecase strong { display: block; font-size: .98rem; }
.usecase p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.shot { aspect-ratio: 4 / 3; border: 1px dashed var(--line); border-radius: 12px; background: var(--brand-pale); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot-ic { font-size: 2rem; }
.shot-cap { color: var(--brand-d); font-weight: 600; font-size: .85rem; text-align: center; padding: 0 6px; }
.proof { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 22px 0; }
.proof-badge { background: var(--brand-pale); color: var(--brand-d); border-radius: 999px; padding: 6px 14px; font-size: .85rem; font-weight: 600; }
.testimonials { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.tcard { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tcard blockquote { margin: 0 0 8px; font-style: italic; }
.tcard figcaption { color: var(--muted); font-size: .85rem; }
.cta-band { text-align: center; margin: 32px 0 8px; padding: 28px 16px; background: var(--brand-pale); border-radius: 16px; }
.cta-band h2 { margin: 0 0 14px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 12px; }
.tpl-card { display: flex; flex-direction: column; }
.tpl-head { display: flex; align-items: center; gap: 10px; }
.tpl-head h3 { margin: 0; font-size: 1.02rem; }
.tpl-ic { font-size: 1.6rem; line-height: 1; }
.tpl-desc { margin: 8px 0 0; }
.tpl-count { color: var(--muted); font-size: .8rem; margin: 8px 0 12px; }
.tpl-card .btn { margin-top: auto; }
.ai-card { border: 1px solid var(--brand); }
.ai-row { display: flex; gap: 10px; }
.ai-row label { flex: 1; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.hub-link { text-decoration: none; color: inherit; display: block; transition: border-color .15s; }
.hub-link:hover { border-color: var(--brand); }
.hub-link h3 { margin: 8px 0 4px; }
.hub-ic { font-size: 1.8rem; line-height: 1; }
.fac-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.fac-row input { flex: 1; min-width: 0; margin-top: 0; }
.fac-status { font-size: .72rem; color: var(--muted); min-width: 56px; text-align: center; }
.qtype-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.qtype-opt { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.qtype-opt input { width: auto; }
.video-wrap { position: relative; width: 100%; max-width: 720px; aspect-ratio: 16/9; margin-top: 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.video-wrap iframe, .video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder { max-width: 720px; aspect-ratio: 16/9; margin-top: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--brand-pale); display: flex; align-items: center; justify-content: center; color: var(--brand-d); font-weight: 600; }
.ask-box { margin-top: 18px; max-width: 600px; }
.ask-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#ask-form textarea { margin-top: 10px; }
#ask-form .btn { margin-top: 10px; }
@media (max-width: 520px) { .ask-row { grid-template-columns: 1fr; } }
#q-image-row { margin-top: 8px; }
#q-image-remove { margin-top: 6px; display: block; }
.q-image-preview { max-width: 220px; max-height: 160px; border-radius: 8px; display: block; object-fit: cover; }
.active-image { max-width: 100%; max-height: 320px; border-radius: 12px; margin: 4px auto 14px; display: block; }
.q-image { max-width: 100%; max-height: 40vh; border-radius: 12px; margin: 8px 0 14px; display: block; }
.brand-bar { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; }
.brand-bar span { font-weight: 700; color: var(--brand-d); font-size: 1.1rem; }
.brand-logo { max-height: 56px; max-width: 200px; object-fit: contain; }
.play-brand { margin: 0 0 10px; }
.play-brand .brand-logo { max-height: 40px; }
.play-brand span { font-size: .95rem; }
.run-guide { margin-top: 14px; font-size: .9rem; max-width: 420px; }
.run-guide summary { cursor: pointer; font-weight: 600; color: var(--brand-d); }
.run-guide ol { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.run-guide li { margin: 5px 0; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .host-grid { grid-template-columns: 1fr; }
  .lobby { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .cards { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .features { grid-template-columns: 1fr; }
}
