:root {
  color-scheme: light only;
  --ink: #17212b; --muted: #56636f; --line: #dbe2e8; --bg: #e9eef3; --card: #ffffff;
  --blue: #1f74bf; --blue-ink: #175f9c; --green-bubble: #e2f7cf; --chat-bg: #dfe8ef;
  --good: #1e7a46; --good-ink: #1d6b3d; --bad: #c03636; --bad-ink: #a52b2b; --warn: #e0962b; --agent: #6a4bc9; --agent-ink: #5a3dbf; --gold: #d9a520; --gold-ink: #8f6400;
  --m-output: #2a8bd8; --m-morale: #e0962b; --m-trust: #2f9e5b; --m-control: #7b5cd6;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
/* Every control sets its own colours, so a phone or viewer in dark mode can't swap in light text. */
button, input, select, textarea { color: var(--ink); background-color: transparent; -webkit-text-fill-color: currentColor; caret-color: var(--ink); }
input::placeholder { color: #8a96a2; -webkit-text-fill-color: #8a96a2; opacity: 1; }
a { color: var(--blue-ink); }
body { -webkit-text-size-adjust: 100%; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: rgba(31,116,191,.15); }
input, select { font: inherit; }
.hidden { display: none !important; }

/* ---------- player shell ---------- */
.app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; background: var(--chat-bg); position: relative; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 14px 8px; }
.topline { display: flex; align-items: center; gap: 10px; }
.topline .title { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topline .sub { color: var(--muted); font-size: 12px; font-weight: 500; }
.langbtn { border: 1px solid #c9d3dc; background: #f5f7f9; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--ink); }
.langmenu { position: absolute; right: 12px; top: 44px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; z-index: 20; }
.langmenu button { display: block; width: 100%; text-align: left; border: 0; background: #fff; color: var(--ink); padding: 10px 18px; font-size: 15px; }
.langmenu button.on { background: #eef5fc; color: var(--blue-ink); font-weight: 700; }
.meters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.meter { min-width: 0; }
.meter .lab { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 4px; }
.meter .lab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.meter .lab b { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter .bar { height: 6px; background: #edf1f4; border-radius: 4px; overflow: hidden; margin-top: 3px; }
.meter .fill { height: 100%; border-radius: 4px; transition: width .9s ease; }
.meter.low .lab b { color: var(--bad); }
.qtimer { height: 3px; background: #edf1f4; margin: 8px -14px -8px; }
.qtimer .fill { height: 100%; background: var(--blue); transition: width 1s linear, background-color .3s; }
.qtimer .fill.late { background: var(--bad); }
.statusline { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

.main { flex: 1; display: flex; flex-direction: column; }
.screen { padding: 18px 16px 28px; }
.center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: stretch; padding: 24px 20px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.card + .card { margin-top: 12px; }
h1 { font-size: 24px; margin: 0 0 8px; line-height: 1.2; }
h2 { font-size: 19px; margin: 0 0 8px; line-height: 1.25; }
p { line-height: 1.45; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px 16px; font-size: 16px; font-weight: 700; background: var(--blue); color: #fff; margin-top: 14px; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #eef2f5; color: var(--ink); }
.btn:disabled { opacity: .5; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input { width: 100%; border: 1px solid #c9d3dc; border-radius: 12px; padding: 13px 14px; font-size: 17px; background: #fff; color: var(--ink); }
.field input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.err { color: var(--bad); font-size: 14px; margin-top: 8px; min-height: 1em; }
.langpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.langpick button { border: 1.5px solid #c9d3dc; background: #fff; color: var(--ink); border-radius: 12px; padding: 12px 6px; font-weight: 700; font-size: 15px; }
.langpick button.on { border-color: var(--blue); background: #e6f1fb; color: var(--blue-ink); box-shadow: 0 0 0 1px var(--blue) inset; }
.teampick { display: grid; gap: 8px; }
.teampick button { border: 1.5px solid #c9d3dc; background: #fff; color: var(--ink); border-radius: 12px; padding: 13px 14px; text-align: left; font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; }
.teampick button.on { border-color: var(--blue); background: #e6f1fb; color: var(--blue-ink); box-shadow: 0 0 0 1px var(--blue) inset; }
.teampick button.on::after { content: '\2713'; font-weight: 800; }
.teampick .cnt { color: var(--muted); font-weight: 500; font-size: 14px; }

/* ---------- level card ---------- */
.levelcard { text-align: left; }
.levelcard .lvl { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-ink); }
.levelcard h1 { font-size: 28px; margin-top: 4px; }
.teamicons { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0 6px; }
.ico-p { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); }
.ico-a { width: 18px; height: 18px; border-radius: 5px; background: var(--agent); }
.ico-more { font-size: 14px; font-weight: 700; color: var(--agent); margin-left: 2px; }
.teamcount { font-size: 13px; color: var(--muted); }
.steps { display: flex; gap: 6px; margin: 2px 0 14px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: #dfe6ec; }
.steps i.done { background: var(--blue); }
.steps i.now { background: #9cc9ef; }

/* ---------- chat ---------- */
.chat { padding: 14px 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.qhead { text-align: center; margin: 2px 0 8px; }
.pill { display: inline-block; background: rgba(23,33,43,.72); color: #fff; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.pill.light { background: rgba(255,255,255,.75); color: var(--ink); }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; animation: pop .25s ease-out; }
.msg.out { align-self: flex-end; flex-direction: row-reverse; }
.avatar { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.avatar.agent { border-radius: 10px; background: var(--agent) !important; font-size: 11px; letter-spacing: .02em; }
.bubble { background: var(--card); border-radius: 16px 16px 16px 6px; padding: 8px 12px 9px; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: 15.5px; line-height: 1.4; }
.msg.out .bubble { background: var(--green-bubble); border-radius: 16px 16px 6px 16px; }
.bubble .who { font-size: 13px; font-weight: 700; margin-bottom: 2px; display: flex; gap: 6px; align-items: center; }
.tag { font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 4px; background: #efe9fd; color: var(--agent-ink); letter-spacing: .04em; }
.tag.private { background: #fff2dc; color: #8a5408; }
.sysmsg { align-self: center; }
.typing .bubble { color: var(--muted); font-style: italic; font-size: 14px; }
.dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #7d8a97; margin-right: 3px; animation: blink 1s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.skiphint { text-align: center; font-size: 12px; color: var(--muted); margin: 4px 0; }

.choices { padding: 6px 12px 22px; }
.choices .prompt { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 8px 4px 8px; }
.choice { display: flex; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.07); font-size: 15.5px; line-height: 1.4; color: var(--ink); animation: pop .3s ease-out both; }
.choice:hover { border-color: #9cc4e8; }
.choice:active { background: #f2f8fd; }
.choice .letter { flex: 0 0 26px; height: 26px; border-radius: 50%; background: #e6f1fb; color: var(--blue-ink); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.choice.picked { border-color: var(--blue); background: #f0f7fd; }

.outcome { margin: 10px 12px 4px; background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.07); animation: pop .35s ease-out both; }
.outcome .h { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.outcome p { margin: 0 0 10px; font-size: 15.5px; }
.deltas { display: flex; flex-wrap: wrap; gap: 6px; }
.delta { font-size: 13px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: #f0f3f6; color: var(--muted); }
.delta.up { background: #e3f5ea; color: var(--good-ink); }
.delta.down { background: #fbe7e7; color: var(--bad-ink); }
.continue { margin: 6px 12px 24px; }

/* ---------- end screen ---------- */
.score-big { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.score-big small { font-size: 22px; color: var(--muted); font-weight: 700; }
.bigmeters { display: grid; gap: 10px; margin-top: 16px; }
.bigmeters .row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; }
.bigmeters .bar { height: 10px; border-radius: 6px; background: #edf1f4; overflow: hidden; }
.bigmeters .fill { height: 100%; border-radius: 6px; }
.bigmeters .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bigmeters .val.low { color: var(--bad); }
.stylebox { border-left: 4px solid var(--blue); padding: 4px 0 4px 14px; margin-top: 6px; }
.stylebox .name { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.rankbox { text-align: center; font-size: 20px; font-weight: 800; color: var(--blue-ink); }

/* ---------- maturity (player) ---------- */
.mq .pillar { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-ink); }
.mq h2 { font-size: 20px; margin-top: 6px; }
.manswer { display: block; width: 100%; text-align: left; background: var(--card); border: 1.5px solid #c9d3dc; border-radius: 14px; padding: 13px 14px; margin-top: 9px; font-size: 15.5px; line-height: 1.4; color: var(--ink); }
.manswer.picked { border-color: var(--blue); background: #eef6fd; }
.progress { height: 5px; background: #dfe6ec; border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.progress div { height: 100%; background: var(--blue); transition: width .4s; }
.reading .row { margin-top: 14px; }
.reading .row .lab { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; }
.reading .scale { position: relative; height: 12px; background: linear-gradient(90deg, #f3e3e3, #f6efdd, #e5f1e8, #dfeefa); border-radius: 6px; margin-top: 6px; }
.reading .scale i { position: absolute; top: -4px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.reading .ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(23,33,43,.88); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; z-index: 50; }

/* ---------- host / big screen ---------- */
body.host { background: #f4f6f8; overflow: hidden; }
.stage { position: fixed; inset: 0 0 64px 0; display: flex; flex-direction: column; padding: 3.2vh 4vw 2vh; }
.stage-top { display: flex; align-items: center; gap: 2vw; }
.stage-top .brand { font-size: 2.2vh; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-ink); }
.stage-top .grow { flex: 1; }
.stage-top .clock { font-size: 5vh; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.stage-top .clock.late { color: var(--bad); }
.stage-body { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.stage h1 { font-size: 7vh; margin: 0 0 1.5vh; letter-spacing: -.01em; }
.stage h2 { font-size: 4vh; margin: 0 0 1vh; }
.stage p { font-size: 3vh; line-height: 1.4; }
.stage .kicker { font-size: 2.4vh; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-ink); margin-bottom: 1vh; }
.lobby { display: grid; grid-template-columns: auto 1fr; gap: 5vw; align-items: center; }
.qrbox { background: #fff; padding: 2vh; border-radius: 2vh; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.qrbox svg { display: block; width: 46vh; height: 46vh; }
.joinurl { font-size: 5.5vh; font-weight: 800; color: var(--blue-ink); word-break: break-all; }
.joincode { font-size: 3vh; color: var(--muted); margin-top: 1vh; }
.joincode b { color: var(--ink); letter-spacing: .12em; font-size: 4.5vh; }
.teamgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(22vw, 1fr)); gap: 1.6vh 1.6vw; margin-top: 3vh; }
.teamcol { background: #fff; border-radius: 1.6vh; padding: 1.6vh 1.6vw; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.teamcol h3 { margin: 0 0 1vh; font-size: 2.8vh; }
.chips { display: flex; flex-wrap: wrap; gap: .8vh; }
.chip { background: #eef3f7; border-radius: 999px; padding: .6vh 1.2vh; font-size: 2.3vh; font-weight: 600; display: inline-flex; align-items: center; gap: .8vh; }
.chip .x { border: 0; background: none; color: var(--muted); -webkit-text-fill-color: currentColor; font-size: 2.2vh; padding: 0; }
.chip .pdots { display: inline-flex; gap: .4vh; }
.chip .pdots i { width: 1.2vh; height: 1.2vh; border-radius: 50%; background: #c2ccd6; }
.chip .pdots i.on { background: var(--good); }
.stage .teamicons .ico-p, .stage .teamicons .ico-a { width: 3vh; height: 3vh; }
.stage .teamicons .ico-a { border-radius: .8vh; }
.stage .teamicons .ico-more { font-size: 3vh; }
.levelsplit { display: grid; grid-template-columns: 1.2fr 1fr; gap: 4vw; align-items: center; }
.board { display: flex; flex-direction: column; gap: 1.4vh; margin-top: 2vh; }
.brow { display: grid; grid-template-columns: 7vh 1fr 22vw 12vw; gap: 2vw; align-items: center; background: #fff; border-radius: 1.6vh; padding: 1.8vh 2vw; box-shadow: 0 1px 3px rgba(0,0,0,.06); opacity: 0; transform: translateY(1.5vh); transition: opacity .6s, transform .6s; }
.brow.show { opacity: 1; transform: none; }
.brow .rank { font-size: 4.5vh; font-weight: 800; color: var(--muted); }
.brow .tname { font-size: 4vh; font-weight: 800; }
.brow .tstyle { font-size: 2.4vh; color: var(--muted); }
.brow .tscore { font-size: 5vh; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.brow .tscore small { font-size: 2.2vh; color: var(--muted); font-weight: 700; }
.brow.first { background: #fff8e3; box-shadow: 0 0 0 .4vh var(--gold) inset; }
.brow.first .rank { color: var(--gold-ink); }
.minimeters { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8vw; }
.minimeters div { font-size: 1.7vh; color: var(--muted); }
.minimeters .bar { height: .9vh; border-radius: .5vh; background: #edf1f4; overflow: hidden; margin-top: .4vh; }
.minimeters .bar i { display: block; height: 100%; }
.winner-label { font-size: 2vh; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.mchart svg { width: 100%; height: auto; display: block; }
.mres { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3vw; align-items: start; }
.overall { background: #fff; border-radius: 2vh; padding: 2.4vh 2vw; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.overall .lv { font-size: 5.5vh; font-weight: 800; color: var(--blue-ink); }
.dist { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1vw; margin-top: 5vh; align-items: end; height: 14vh; }
.dist div { background: var(--blue); border-radius: .8vh .8vh 0 0; position: relative; min-height: .6vh; }
.dist span { position: absolute; top: -3vh; left: 0; right: 0; text-align: center; font-weight: 800; font-size: 2.4vh; }
.distlab { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1vw; font-size: 1.8vh; color: var(--muted); text-align: center; margin-top: .6vh; }

.controls { position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: #17212b; color: #fff; display: flex; align-items: center; gap: 10px; padding: 0 14px; z-index: 30; }
.controls button { border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 14px; background: #2b3a48; color: #fff; }
.controls button.primary { background: var(--blue); }
.controls button.danger { background: #5a2b2b; }
.controls .info { font-size: 13px; color: #b6c2cd; }
.controls .grow { flex: 1; }
.controls .seg button { padding: 8px 10px; background: #2b3a48; }
.controls .seg button.on { background: #4b6175; }
.setup { max-width: 640px; margin: 0 auto; padding: 6vh 0; }
.setup .card { padding: 26px; }
.setup .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.setup .gamepick button { border: 1.5px solid #c9d3dc; background: #fff; color: var(--ink); border-radius: 12px; padding: 14px; text-align: left; }
.setup .gamepick button.on { border-color: var(--blue); background: #e6f1fb; box-shadow: 0 0 0 1px var(--blue) inset; }
.setup .gamepick b { display: block; font-size: 16px; }
.setup .gamepick span { font-size: 13px; color: var(--muted); }
.recent a { display: block; padding: 8px 0; color: var(--blue-ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
body.host.setup-mode { overflow: auto; }
.hostlink { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; background: #f2f5f8; padding: 8px; border-radius: 8px; }
.modal { position: fixed; inset: 0; background: rgba(10,16,22,.5); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal .card { max-width: 520px; width: 92%; }

@media (max-width: 380px) {
  .meters { grid-template-columns: 1fr 1fr; gap: 6px 14px; }
}

/* ---------- demo bar (solo play) ---------- */
.demobar { max-width: 560px; margin: 0 auto; background: #17212b; color: #fff; padding: 8px 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.demobar b { margin-right: 4px; }
.demobar .grow { flex: 1; }
.demobar button, .demobar a { border: 0; border-radius: 8px; padding: 6px 9px; font-size: 12.5px; font-weight: 700; background: #2b3a48; color: #fff; text-decoration: none; -webkit-text-fill-color: #fff; }
.demobar button.on { background: var(--blue); }

/* ---------- simulated players on the host screen ---------- */
.simtag { font-size: 1.5vh; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: #e3dcf7; color: #4a2fa8; border-radius: .5vh; padding: .1vh .6vh; }

/* ---------- start page ---------- */
.optcard { display: block; text-decoration: none; color: var(--ink); border: 1.5px solid #c9d3dc; border-radius: 12px; padding: 12px 14px; margin-top: 10px; background: #fff; }
.optcard b { display: block; font-size: 16px; color: var(--ink); }
.optcard span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.optcard.primary { border-color: var(--blue); background: #e6f1fb; box-shadow: 0 0 0 1px var(--blue) inset; }
.optcard.primary b { color: var(--blue-ink); }
.optcard:hover { border-color: var(--blue); }

/* ---------- presenter demo ---------- */
body.presenter { background: #1b2530; color: #fff; min-height: 100%; height: auto; }
.ptop { display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.ptitle { font-weight: 800; font-size: 16px; color: #fff; }
.ptitle span { font-weight: 600; color: #c9d3dc; margin-left: 8px; }
.pseg { display: flex; gap: 6px; }
.ptop .grow { flex: 1; }
.ptop button, .ptop a { border: 0; border-radius: 10px; padding: 9px 12px; font-weight: 700; font-size: 14px; background: #2f3f4e; color: #fff; -webkit-text-fill-color: #fff; text-decoration: none; }
.ptop .pseg button.on { background: var(--blue); }
.phint { padding: 0 16px 12px; color: #d5dde4; font-size: 14px; line-height: 1.45; max-width: 1200px; }
.pstage { display: flex; gap: 24px; justify-content: center; align-items: flex-start; padding: 0 16px 24px; }
.pstage.stacked { flex-direction: column; align-items: center; }
.pframe { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pframe iframe { border: 0; background: #f4f6f8; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: block; }
.pframe.phone iframe { border-radius: 30px; border: 10px solid #0b1015; background: #dfe8ef; }
.pframe figcaption { font-size: 13px; color: #c9d3dc; font-weight: 600; }

/* ---------- room report ---------- */
.rp-overlay { position: fixed; inset: 0; z-index: 80; background: #e9eef3; overflow: auto; color: #17212b; }
.rp-tools { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; background: #17212b; }
.rp-btn { border: 1px solid #c9d3dc; background: #ffffff; color: #17212b; border-radius: 10px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.rp-btn.rp-primary { background: #1f74bf; border-color: #1f74bf; color: #ffffff; }
.rp-grow { flex: 1; }
.rp-sheet { max-width: 860px; margin: 18px auto 40px; background: #ffffff; border-radius: 14px; padding: 34px 40px; box-shadow: 0 6px 24px rgba(0,0,0,.08); font-size: 14px; line-height: 1.45; }
.rp-sheet h1 { font-size: 26px; margin: 2px 0 4px; }
.rp-sheet h2 { font-size: 17px; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #dbe2e8; break-after: avoid; page-break-after: avoid; }
.rp-sheet h3 { font-size: 15px; margin: 2px 0 6px; }
.rp-sheet p { margin: 6px 0; }
.rp-kicker { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #56636f; }
.rp-muted { color: #56636f; }
.rp-lead { font-size: 15px; }
.rp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 6px; }
.rp-tile { border: 1px solid #dbe2e8; border-radius: 12px; padding: 12px 14px; }
.rp-value { font-size: 22px; font-weight: 800; margin: 4px 0 2px; }
.rp-card { border: 1px solid #dbe2e8; border-radius: 12px; padding: 12px 16px; margin: 0 0 10px; break-inside: avoid; page-break-inside: avoid; }
.rp-card.rp-first { border: 2px solid #1f74bf; background: #f3f8fd; }
.rp-focus .rp-card { margin-bottom: 10px; }
.rp-rows { display: grid; gap: 8px; }
.rp-row { display: grid; grid-template-columns: 250px 1fr; gap: 12px; align-items: center; break-inside: avoid; }
.rp-label { font-weight: 600; font-size: 13px; }
.rp-barwrap { display: flex; align-items: center; gap: 10px; }
.rp-bar { position: relative; flex: 1; height: 16px; background: #edf1f4; border-radius: 5px; overflow: hidden; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-barval { width: 150px; font-size: 12px; font-weight: 700; color: #17212b; }
.rp-scale { position: relative; height: 22px; background: linear-gradient(90deg, #f6dede, #fbeccf 33%, #e3f1e0 66%, #d4ecd8); border-radius: 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-range { position: absolute; top: 7px; height: 8px; background: rgba(23,33,43,.28); border-radius: 4px; }
.rp-dot { position: absolute; top: 3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #17212b; border: 2px solid #ffffff; }
.rp-ticks .rp-tickrow { position: relative; height: 16px; font-size: 11px; color: #56636f; font-weight: 600; }
.rp-tickrow span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.rp-tickrow span:first-child { transform: none; }
.rp-tickrow span:last-child { transform: translateX(-100%); }
.rp-list { margin: 6px 0; padding-left: 22px; }
.rp-list li { margin: 6px 0; break-inside: avoid; }
.rp-dist { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0; font-size: 13px; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rp-table th, .rp-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #dbe2e8; }
.rp-table th { color: #56636f; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.rp-foot { margin-top: 26px; font-size: 12px; color: #56636f; border-top: 1px solid #dbe2e8; padding-top: 10px; }
.btn-report { background: #ffffff !important; color: #17212b !important; }
@media (max-width: 640px) {
  .rp-sheet { padding: 20px 16px; margin: 0; border-radius: 0; }
  .rp-tiles { grid-template-columns: 1fr; }
  .rp-row { grid-template-columns: 1fr; gap: 4px; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  body.rp-open > *:not(.rp-overlay) { display: none !important; }
  html, body.rp-open { background: #ffffff !important; height: auto; overflow: visible; }
  .rp-overlay { position: static; overflow: visible; background: #ffffff; }
  .rp-tools { display: none; }
  .rp-sheet { max-width: none; margin: 0; padding: 0; box-shadow: none; border-radius: 0; font-size: 12px; }
  .rp-tiles { grid-template-columns: repeat(3, 1fr); }
  .rp-row { grid-template-columns: 230px 1fr; }
}
.rp-findings { margin: 18px 0 0; }
.rp-findings h2, .rp-actions h2 { border: 0; margin: 0 0 10px; padding: 0; }
.rp-findings ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rp-finding { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid #dbe2e8; border-left: 5px solid #1f74bf; border-radius: 10px; break-inside: avoid; page-break-inside: avoid; }
.rp-finding b { display: block; font-size: 16px; line-height: 1.3; }
.rp-finding p { margin: 4px 0 0; color: #3d4a56; }
.rp-num { width: 30px; height: 30px; border-radius: 50%; background: #1f74bf; color: #ffffff; font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-actions { margin: 18px 0 8px; padding: 14px 18px; background: #eef7f0; border: 1px solid #b9dcc4; border-radius: 12px; break-inside: avoid; page-break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-actions ul { margin: 0; padding-left: 20px; }
.rp-actions li { margin: 6px 0; font-size: 14.5px; }
.rp-small { font-size: 12px; }
.rp-answers { display: grid; gap: 6px; margin-top: 8px; }
.rp-ans { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-size: 13.5px; }
.rp-count { display: inline-flex; align-items: center; justify-content: center; height: 26px; border-radius: 6px; background: #edf1f4; font-weight: 800; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-mode .rp-count { background: #1f74bf; color: #ffffff; }
.rp-mode span:last-child { font-weight: 600; }
.rp-plan td { vertical-align: top; font-size: 12.5px; }
.rp-plan td:first-child { width: 120px; }
.rp-table tr { break-inside: avoid; }
.rp-keep { break-inside: avoid; page-break-inside: avoid; }
