/* WIFI Arena — sistem desain akademik. Mobile-first, mode terang & gelap. */
:root {
  --navy: #1F3A5F; --navy-2: #2B4C77; --navy-soft: #E8EEF5;
  --green: #18753F; --green-soft: #E3F3E9; /* GEMINI-09: kontras ≥ 4,5:1 di latar lunak & putih */
  --amber: #8F5C10; --amber-soft: #FBF1DE;
  --red: #C0392B; --red-soft: #FBE7E4;
  --bg: #F4F6F9; --surface: #FFFFFF; --surface-2: #F8FAFC; --line: #DDE3EA;
  --text: #14202E; --muted: #5A6B7F; --focus: #3B82F6;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(16,32,52,.06), 0 4px 16px rgba(16,32,52,.05);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #8DB3E2; --navy-2: #A9C6EA; --navy-soft: #1A2A3E;
    --green: #4CC27F; --green-soft: #133024; --amber: #E3B25A; --amber-soft: #33270F; --red: #F07464; --red-soft: #3A1B17;
    --bg: #0E1621; --surface: #152131; --surface-2: #1A283A; --line: #263850; --text: #E6EDF5; --muted: #9DB0C5;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #8DB3E2; --navy-2: #A9C6EA; --navy-soft: #1A2A3E;
  --green: #4CC27F; --green-soft: #133024; --amber: #E3B25A; --amber-soft: #33270F; --red: #F07464; --red-soft: #3A1B17;
  --bg: #0E1621; --surface: #152131; --surface-2: #1A283A; --line: #263850; --text: #E6EDF5; --muted: #9DB0C5;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: max(.9em, 12px); overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout mahasiswa ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--navy); letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
:root[data-theme="dark"] .brand-mark { color: #0E1621; }
.topnav { display: none; gap: 4px; margin-left: 12px; }
.topnav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.topnav a.active, .topnav a:hover { background: var(--navy-soft); color: var(--navy); text-decoration: none; }
.spacer { flex: 1; }
.icon-btn { flex: none; position: relative; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; background: #C0392B; color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 5px; font-weight: 700; }
.container { max-width: 1080px; margin: 0 auto; padding: 16px 16px 96px; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 9px; font-size: 12px; min-height: 44px; font-weight: 600; color: var(--muted); }
.bottomnav a.active { color: var(--navy); }
.bottomnav svg, .icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 900px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  .container { padding-bottom: 40px; }
}

/* ---------- komponen ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .label { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.up { color: var(--green); } .down { color: var(--red); }
.hero { background-color: var(--navy); background-image: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; border-radius: var(--radius); padding: 18px; }
:root[data-theme="dark"] .hero { color: #0E1621; }
.hero h1 { color: inherit; margin-bottom: 4px; }
.hero .meta { opacity: .85; font-size: .9rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: .92rem; cursor: pointer; font-family: inherit; text-decoration: none !important; line-height: 1.2; }
.btn-primary { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0E1621; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-green { background: var(--green); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn-sm { padding: 6px 10px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--navy-soft); color: var(--navy); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.yellow, .badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.grey { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip { display: inline-flex; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .84rem; font-weight: 600; color: var(--muted); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .chip.active { color: #0E1621; }
.progress { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--navy); border-radius: 999px; }
.progress.red > span { background: var(--red); } .progress.yellow > span { background: var(--amber); } .progress.green > span { background: var(--green); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list-item { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; }
.alert { border-radius: var(--radius-sm); padding: 10px 12px; font-size: .92rem; border: 1px solid transparent; margin-bottom: 12px; }
.alert.ok { background: var(--green-soft); color: var(--green); }
.alert.error { background: var(--red-soft); color: var(--red); }
.alert.warn { background: var(--amber-soft); color: var(--amber); }
.alert.info { background: var(--navy-soft); color: var(--navy); }
.paybar { background: var(--amber-soft); border: 1px solid var(--amber); color: var(--text); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.paybar strong { color: var(--amber); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
.table tr.me td { background: var(--navy-soft); font-weight: 700; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
form .field { margin-bottom: 12px; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }
input:not([type]), input[type=text], input[type=time], input[type=tel], input[type=url], input[type=email], input[type=password], input[type=number], input[type=search], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; font: inherit; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox], input[type=radio] { flex: none; width: 24px; height: 24px; accent-color: var(--navy); vertical-align: -3px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
details.card summary { cursor: pointer; font-weight: 700; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }
.chart-box { position: relative; height: 220px; }
.chart-box.tall { height: 280px; }

/* ---------- autentikasi ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 10% -10%, var(--navy-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; font-size: 1.2rem; margin-bottom: 14px; }

/* ---------- pengerjaan kuis ---------- */
.focusbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.focusbar .inner { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 10px; align-items: center; }
.focusbar .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; padding: 6px 10px; border-radius: 8px; background: var(--navy-soft); color: var(--navy); }
.timer.low { background: var(--red-soft); color: var(--red); }
.save-state { font-size: .78rem; color: var(--muted); }
.quiz-wrap { max-width: 960px; margin: 0 auto; padding: 16px 16px 120px; position: relative; }
.stem { font-size: 1.02rem; }
.stem table, .expl table { border-collapse: collapse; margin: 8px 0; }
.stem td, .expl td { border: 1px solid var(--line); padding: 4px 8px; }
.options { display: grid; gap: 10px; margin-top: 14px; }
.option { width: 100%; text-align: left; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: border-color .12s, background .12s; }
.option:hover:not([disabled]) { border-color: var(--navy); }
.option .key { flex: 0 0 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line); }
.option .opt-html p { margin: 0; }
.option.selected { border-color: var(--navy); background: var(--navy-soft); }
.option.selected .key { background: var(--navy); color: #fff; border-color: var(--navy); }
.option.correct { border-color: var(--green); background: var(--green-soft); }
.option.correct .key { background: var(--green); color: #fff; border-color: var(--green); }
.option.wrong { border-color: var(--red); background: var(--red-soft); }
.option.wrong .key { background: var(--red); color: #fff; border-color: var(--red); }
.option.hidden-opt { opacity: .25; pointer-events: none; text-decoration: line-through; }
.option[disabled] { cursor: default; }
.opt-dist { margin-left: auto; text-align: right; min-width: 90px; font-size: .8rem; color: var(--muted); }
.opt-dist .bar { height: 6px; border-radius: 99px; background: var(--surface-2); margin-top: 4px; overflow: hidden; }
.opt-dist .bar span { display: block; height: 100%; background: var(--navy); }
.voters { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.order-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.order-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: grab; touch-action: none; }
.order-item.dragging { opacity: .6; border-color: var(--navy); }
.order-item .pos { width: 28px; height: 28px; border-radius: 8px; background: var(--navy-soft); color: var(--navy); font-weight: 800; display: grid; place-items: center; flex: 0 0 28px; }
.order-item .moves { margin-left: auto; display: flex; gap: 4px; }
.order-item .moves button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; color: var(--text); }
.order-item p { margin: 0; }
.order-list.locked .order-item { cursor: default; }
.confidence { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.confidence .btn.active { background: var(--navy); color: #fff; }
.quiz-actions { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 25; }
.quiz-actions .inner { max-width: 960px; margin: 0 auto; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; }
.navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.navgrid button { height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; font-family: inherit; }
.navgrid button.answered { background: var(--navy); color: #fff; border-color: var(--navy); }
.navgrid button.flagged { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.navgrid button.current { outline: 2px solid var(--focus); outline-offset: 1px; }
.expl { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 14px; }
.expl .verdict { font-weight: 800; margin-bottom: 8px; }
.expl .verdict.ok { color: var(--green); } .expl .verdict.bad { color: var(--red); }
.expl-block { margin-top: 10px; }
.expl-block h4 { margin: 0 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.expl-block.anchor { background: var(--amber-soft); border-radius: 10px; padding: 10px 12px; font-weight: 700; }
.expl audio, .expl video, .expl iframe { width: 100%; border-radius: 10px; margin-top: 6px; border: 0; }
.expl iframe { aspect-ratio: 16 / 9; height: auto; }
.speed { display: inline-flex; gap: 4px; margin-top: 6px; }
.note-box textarea { min-height: 70px; }
.watermark { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.watermark span { position: absolute; font-size: 13px; font-weight: 700; color: var(--text); opacity: .07; white-space: nowrap; transform: rotate(-18deg); user-select: none; } /* v1.7.8: tanpa animasi geser */
.drawer-btn { position: fixed; right: 14px; bottom: 84px; z-index: 26; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); background: var(--surface); border-left: 1px solid var(--line); z-index: 40; transform: translateX(105%); transition: transform .2s; padding: 16px; overflow-y: auto; box-shadow: -8px 0 24px rgba(0,0,0,.12); }
.drawer.open { transform: none; }
.modal-back { position: fixed; inset: 0; background: rgba(10,20,35,.5); z-index: 50; display: none; place-items: center; padding: 16px; }
.modal-back.open { display: grid; }
.modal { background: var(--surface); border-radius: 16px; max-width: 460px; width: 100%; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 9px 14px; border-radius: 10px; font-size: .9rem; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.confetti { position: fixed; top: -10px; width: 8px; height: 12px; z-index: 70; pointer-events: none; animation: fall 1.4s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .8; } }

/* ---------- live ---------- */
.live-pin { font-size: 3rem; font-weight: 800; letter-spacing: .12em; color: var(--navy); }
.live-q { font-size: 1.25rem; font-weight: 700; }
.live-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.live-opts .option { min-height: 72px; font-weight: 700; }
.live-count { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 16px 0; }
.podium .step { width: 30%; max-width: 160px; text-align: center; border-radius: 12px 12px 0 0; background: var(--navy-soft); padding: 10px 6px; }
.podium .p1 { height: 170px; background: var(--amber-soft); } .podium .p2 { height: 130px; } .podium .p3 { height: 100px; }
.powerups { display: flex; gap: 8px; flex-wrap: wrap; }
.host-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .host-grid { grid-template-columns: 2fr 1fr; } }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 14px; display: none; }
.sidebar nav a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.sidebar nav a.active, .sidebar nav a:hover { background: var(--navy-soft); color: var(--navy); text-decoration: none; }
.sidebar .group { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 10px 4px; font-weight: 700; }
.admin-main { min-width: 0; }
.admin-top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.admin-content { padding: 16px; max-width: 1280px; }
.admin-mobile-nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-mobile-nav a { white-space: nowrap; }
@media (min-width: 1000px) {
  .admin { grid-template-columns: 240px 1fr; }
  .sidebar { display: block; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .admin-mobile-nav { display: none; }
}
.issue-list { margin: 4px 0 0; padding-left: 18px; font-size: .86rem; }
.issue-list.err { color: var(--red); } .issue-list.warn { color: var(--amber); }
.qpreview { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); }
.sortable li { cursor: grab; }
.footer-note { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 24px; }
@media print { .topbar, .bottomnav, .no-print { display: none !important; } .container { padding: 0; } }

/* v1.2: preserve full content and readable reflow, even for long clinical cases. */
*, *::before, *::after { box-sizing: border-box; }
main, .card, .stack, .grid-2 > *, .grid-3 > *, .grid-4 > *, .option, .opt-html { min-width: 0; }
.stem, .opt-html, .expl-block { overflow-wrap: anywhere; word-break: normal; white-space: normal; line-height: 1.7; }
.stem, .opt-html { max-height: none; -webkit-line-clamp: unset; text-overflow: clip; }
.option { align-items: flex-start; height: auto; white-space: normal; text-align: left; }
.option .key { flex: 0 0 2rem; margin-top: .1rem; }
.opt-html { display: block; flex: 1; }
.stem img, .opt-html img, .expl img { max-width: 100%; height: auto; }
.stem table, .opt-html table, .expl table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.stem td, .stem th, .opt-html td, .opt-html th { white-space: normal; padding: .45rem; border: 1px solid var(--line); }
textarea { min-height: 7rem; resize: vertical; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.table-wrap { max-width: 100%; }
@media(max-width:640px) { .grid-3 { grid-template-columns: 1fr; } .row { flex-wrap: wrap; } .card { padding: 16px; } h1 { font-size: 1.6rem; } }
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation-duration: .01ms!important; transition-duration: .01ms!important; scroll-behavior: auto!important; } }
/* Visual authoring: no arbitrary character limit, no clipped long options. */
.rich-shell{border:1px solid var(--line,#d9e1ea);border-radius:12px;overflow:hidden;background:var(--surface);margin-top:6px}
.rich-tools{display:flex;flex-wrap:wrap;gap:4px;padding:6px;border-bottom:1px solid var(--line,#d9e1ea);background:var(--bg,#f4f6fa)}
.rich-content{min-height:110px;padding:14px;font-weight:400;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;outline:none}
.rich-content:focus{box-shadow:inset 0 0 0 2px var(--navy,#1f3a5f)}
.rich-content img{max-width:100%;height:auto}.rich-content table{max-width:100%;border-collapse:collapse}.rich-content td,.rich-content th{border:1px solid #d9e1ea;padding:6px}

/* KD per kuis (format LMS) */
.kd-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); margin: 16px 0 6px; font-weight: 700; }
.kd-table td.wrap, .wrap { word-break: break-word; overflow-wrap: anywhere; }
.kd-table td.mono { font-size: .86rem; max-width: 520px; }
.issues { list-style: none; padding: 0; margin: 8px 0; }
.issues li { padding: 6px 10px; margin: 4px 0; border-left: 4px solid; border-radius: 4px; font-size: .9rem; }
.issues .err { background: var(--red-soft); border-color: var(--red); }
.issues .warn { background: var(--amber-soft); border-color: var(--amber); }
.pre-wrap { white-space: pre-wrap; word-break: break-word; background: var(--surface-2, #f4f6fa); padding: 10px; border-radius: var(--radius-sm); max-height: 340px; overflow: auto; font-size: .85rem; }
.kd-pass { color: var(--green); font-weight: 700; }
.kd-fail { color: var(--red); font-weight: 700; }
.kd-list { list-style: none; padding: 0; margin: 0 0 6px; }
.kd-list li { padding: 10px 2px; border-bottom: 1px solid var(--line, #e6e9ef); }
.kd-row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.kd-name { font-weight: 600; overflow-wrap: anywhere; }
.kd-bar { position: relative; height: 8px; background: var(--line, #e6e9ef); border-radius: 6px; margin: 6px 0 4px; overflow: visible; }
.kd-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--green); }
.kd-bar i.low { background: var(--amber); }
.kd-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--navy); }
.kd-meta { font-size: .85rem; color: var(--muted); }
/* halaman pilih kelas */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.class-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.class-card .btn { margin-top: 8px; width: 100%; justify-content: center; }
.chips { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--navy-soft); color: var(--navy); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 600; }
.pre-line { white-space: pre-line; }
.hero-soft h1 { font-size: 1.35rem; margin: 0 0 6px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 14px; max-height: 360px; overflow: auto; padding: 4px; }
.check-grid .check { align-items: flex-start; }
.kd-meta .up { color: var(--green); font-weight: 700; }
.kd-meta .down { color: var(--red); font-weight: 700; }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; }
.price { font-size: 1.25rem; font-weight: 800; color: var(--navy); margin: 6px 0 0; }
.pay-amount { font-size: 2rem; font-weight: 800; letter-spacing: .01em; color: var(--navy); }
.pay-amount b { color: var(--red); }

/* ---------- Arena Belajar: Studio Game HTML (diadaptasi dari ASTRA v1.3) & Misi 5 Menit ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin: 12px 0 18px; }
.game-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.game-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.game-card p { flex: 1; }
.game-card .game-meta { font-size: .82rem; color: var(--muted); }
.game-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.game-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.game-tools h1, .game-tools h2 { margin: 0; flex: 1; }
.game-frame { width: 100%; height: 620px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); }
.game-frame.player { height: 72vh; min-height: 420px; }
.game-code { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; tab-size: 2; white-space: pre; overflow: auto; resize: vertical; min-height: 320px; }
.game-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; }
.game-check input { width: auto; margin-top: 4px; }
.game-status { padding: 8px 0; min-height: 30px; overflow-wrap: anywhere; color: var(--muted); }
.game-status.error { color: var(--red); font-weight: 600; }
#htmlGameForm label { display: block; margin: 12px 0 5px; font-weight: 600; }
#htmlGameForm input, #htmlGameForm select, #htmlGameForm textarea { width: 100%; }
.streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--amber); }
.mission-step { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.mission-opt { display: block; width: 100%; text-align: left; margin: 6px 0; }
.mission-opt[aria-pressed="true"] { border-color: var(--navy); background: var(--navy-soft); }
.mission-opt.is-right { border-color: var(--green); background: var(--green-soft); }
.mission-opt.is-wrong { border-color: var(--red); background: var(--red-soft); }
.mission-focus li { margin: 4px 0; }
.week-dots { display: flex; gap: 6px; margin: 8px 0 0; }
.week-dots span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.week-dots span.on { background: var(--green-soft); border-color: var(--green); color: var(--green); font-weight: 700; }
.week-dots span.freeze { background: var(--navy-soft); border-color: var(--navy); color: var(--navy); }
@media (max-width: 650px) { .game-grid.two { grid-template-columns: 1fr; } .game-frame { height: 66vh; } .game-tools .btn { flex: 1; text-align: center; } .game-tools h1 { flex-basis: 100%; } }
label.option:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
label.option:has(input:checked) .key { background: var(--navy); color: #fff; border-color: var(--navy); }
label.option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
label.chip:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); color: var(--navy); font-weight: 700; }
label.chip input { margin: 0 4px 0 0; }
/* ---------- OSCE Lab ---------- */
.osce-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.osce-head h1 { margin: 0; }
/* v1.7.10 kerapian: target sentuh OSCE minimal 44px di HP */
@media (max-width: 600px) { #osceSound, #retryOsceSave, .osce-catalog .btn, form[action^="/osce/"] .btn, a.btn[href^="/osce/"] { min-height: 44px; display: inline-flex; align-items: center; } }
.osce-timer { text-align: right; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; }
.osce-timer span { display: block; font: 700 1.9rem/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--navy); font-variant-numeric: tabular-nums; }
.osce-timer small { color: var(--muted); font-size: .75rem; }
.osce-timer.warn span { color: var(--red); }
.osce-strip { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)); gap: 6px; padding: 0; margin: 8px 0 12px; }
.osce-strip li { text-align: center; border-radius: 10px; padding: 6px 0; font-size: .78rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.osce-strip li.done { background: var(--green-soft); border-color: var(--green); color: var(--text); }
.osce-strip li.done span::after { content: "✓"; margin-left: 2px; color: var(--green); }
.osce-strip li.now { background: var(--navy); border-color: var(--navy); color: #fff; }
.osce-door summary { cursor: pointer; }
.osce-door p { margin: 8px 0 0; }
.osce-frame { height: 78vh; min-height: 560px; }
.osce-rest { text-align: center; padding: 40px 20px; }
.osce-room-form { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 8px; }
.osce-room-form li { display: flex; align-items: center; gap: 8px; }
.osce-room-form .mono { min-width: 34px; font-weight: 700; }
.osce-room-form select { flex: 1; }
@media (max-width: 650px) { .osce-frame { height: 82vh; min-height: 520px; } .osce-timer span { font-size: 1.5rem; } }
.topnav a { white-space: nowrap; }
@media (min-width: 900px) and (max-width: 1360px) { .topnav { gap: 0; margin-left: 6px; } .topnav a { padding: 6px 7px; font-size: .86rem; } }
.osce-rest h2 { text-align: center; }

/* v1.6.2: consistent navigation, reading order and keyboard targets. */
.skip-link{position:fixed;left:12px;top:-80px;z-index:10000;background:var(--surface);color:var(--ink);padding:12px 18px;border:2px solid var(--navy);border-radius:8px}
.skip-link:focus{top:12px}
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #cf8500;outline-offset:3px}
.topnav a,.icon-btn{min-height:44px;display:inline-flex;align-items:center}
/* GEMINI-20 (R127): menu samping tetap satu baris per tautan di laptop */
.sidebar nav a{min-height:44px;display:flex;align-items:center}
.start-here{margin-top:16px;border-left:4px solid var(--navy)}
.guide-list{list-style:none;padding:0;margin:0}.guide-list li+li{border-top:1px solid var(--line)}
.guide-list a{display:block;padding:14px 2px;color:inherit}.guide-list span{display:block;color:var(--muted);font-size:.9rem;margin-top:5px;line-height:1.6}
summary{cursor:pointer;min-height:44px;padding:12px 0;font-weight:600}
.admin-menu-mobile{padding:0 18px;background:var(--surface);border-bottom:1px solid var(--line)}
.admin-menu-mobile nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding-bottom:16px}
.admin-menu-mobile nav a{padding:12px;border:1px solid var(--line);border-radius:8px;color:inherit}
.admin-menu-mobile .group{grid-column:1/-1;margin-top:12px;color:var(--muted)}
.admin-menu-mobile [aria-current=page]{background:var(--navy-soft);font-weight:700}
.chart-data{margin-top:8px}.chart-data table{width:100%}.chart-data td,.chart-data th{padding:8px;text-align:left}
@media(min-width:1000px){.admin-menu-mobile{display:none}}
@media(max-width:500px){.guide-list a{padding:16px 0}.start-here .btn{width:100%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
.admin-main,.admin-content,.grid-2>*{min-width:0}
.guide-list a{overflow-wrap:anywhere}

/* v1.6.3: CBT status is expressed by text and symbols, not colour alone. */
.question-map { margin-top:16px; }
.navgrid { grid-template-columns: repeat(auto-fill,minmax(48px,1fr)); margin:12px 0; }
.navgrid button { height:52px; }
.navgrid button[hidden] { display:none; }
.navgrid button small { display:block; font-size:12px; }
.navgrid button.pending { border:2px dashed var(--red); }
.nav-filters { flex-wrap:wrap; }
.nav-filters [aria-pressed="true"] { outline:2px solid var(--focus); }
.focusbar .save-state { max-width:240px; font-size:12px; white-space:normal; }
@media(max-width:600px) { .focusbar .inner { flex-wrap:wrap; gap:6px; } .focusbar .title { max-width:55%; } .focusbar .save-state { flex-basis:75%; order:4; max-width:none; } .focusbar .timer { margin-left:auto; } }
.profile-avatar { width:96px; height:96px; object-fit:cover; border-radius:50%; border:2px solid var(--line); }
.topbar .icon-btn .profile-avatar { width:30px; height:30px; }
/* v1.7.0: kepala ruangan OSCE ringkas & menempel di HP agar animasi stasiun langsung terlihat */
.osce-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.osce-sound { white-space: nowrap; }
@media (max-width: 650px) {
  .osce-head { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 6px 0; margin: 0 0 6px; }
  .osce-head h1 { font-size: 1.15rem; }
  .osce-head .mission-step { display: none; }
  .osce-timer { padding: 4px 10px; }
  .osce-timer span { font-size: 1.3rem; }
  .osce-sound { padding: 6px 10px; font-size: .8rem; }
  .osce-door p { max-height: 30vh; overflow: auto; }
}
input[type=file] { font: inherit; max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 700; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--navy); padding: 8px 14px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--navy-soft); }

/* ---------- v1.7.0: Pusat Timer & Peta Risiko Kampus ---------- */
.chip-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.chip-row .chip{text-decoration:none}
.timer-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 12px;margin:0 0 12px;border:1px dashed var(--line);border-radius:12px;background:var(--surface-2)}
.timer-bulk input:not([type=number]),.timer-bulk select{flex:1 1 180px;min-width:0}
.row-inline{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.row-inline input:not([type=number]){flex:1 1 120px;min-width:0}
input.w-num{width:6.5em;max-width:100%}
input.w-id{width:10em;max-width:100%}
td.down{color:var(--red)}
.timer.low{color:var(--red)}
.game-tools .timer{margin-left:auto;font-variant-numeric:tabular-nums;font-weight:700;padding:4px 10px;border-radius:999px;background:var(--surface-2)}
.risk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}
.risk-card{border:1px solid var(--line);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:6px;background:var(--surface)}
.risk-card h3{margin:0;font-size:1rem}
.risk-card .meter{height:8px;border-radius:999px;background:var(--surface-2);overflow:hidden}
.risk-card .meter span{display:block;height:100%;border-radius:inherit}
.risk-high{border-left:5px solid #d64545}.risk-high .meter span{background:#d64545}
.risk-mid{border-left:5px solid #e0a100}.risk-mid .meter span{background:#e0a100}
.risk-low{border-left:5px solid #2e9d6a}.risk-low .meter span{background:#2e9d6a}
.risk-none{border-left:5px solid #98a2b3}.risk-none .meter span{background:#98a2b3}
.risk-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 10px;font-size:.88rem}
.risk-stats b{font-variant-numeric:tabular-nums}
.badge.risk-high,.badge.risk-mid,.badge.risk-low{border-left:0}
.badge.risk-high{background:#fde8e8;color:#9b1c1c}.badge.risk-mid{background:#fff4d6;color:#8a5a00}.badge.risk-low{background:#e3f6ec;color:#1c6b47}
@media (prefers-color-scheme: dark){.badge.risk-high{background:#4a1d1d;color:#fbb}.badge.risk-mid{background:#463a12;color:#ffd97a}.badge.risk-low{background:#173d2b;color:#9fe3c0}}
:root[data-theme=dark] .badge.risk-high{background:#4a1d1d;color:#fbb}:root[data-theme=dark] .badge.risk-mid{background:#463a12;color:#ffd97a}:root[data-theme=dark] .badge.risk-low{background:#173d2b;color:#9fe3c0}
.focus-list{margin:6px 0 0;padding-left:1.2em}.focus-list li{margin:6px 0;line-height:1.5}

.manual-intro progress {display:block;width:min(28rem,100%);height:.8rem;margin-top:.55rem;accent-color:var(--primary)}
.manual-index ul,.manual-lesson ol {padding-inline-start:1.5rem}
.manual-index li,.manual-lesson li {margin:.45rem 0}
.manual-lesson {scroll-margin-top:5rem}
.manual-check fieldset {min-width:0;border:0;margin:0 0 .65rem;padding:0}
.manual-check label {display:flex;gap:.55rem;margin:.45rem 0;align-items:baseline}
.manual-check input[type=radio] {width:24px;height:24px;flex:none}
@media print {.manual-check,.manual-index{display:none}.manual-lesson{break-inside:avoid}}

@media print {
  body:has(.manual-intro) .sidebar, body:has(.manual-intro) .admin-top,
  body:has(.manual-intro) .admin-menu-mobile, body:has(.manual-intro) #kamus-menu {display:none}
  body:has(.manual-intro) .admin {display:block}
  body:has(.manual-intro) .admin-main,body:has(.manual-intro) .admin-content {margin:0;padding:0}
}

/* v1.7.7 — uji mandiri HP: target sentuh minimal 40px pada layar sentuh,
   dan label panjang di daftar tidak lagi mendorong tombol keluar layar. */
.list-item > div { min-width: 0; }
.list-item .badge { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.list-item > .btn, .list-item > a.btn { flex: 0 0 auto; }
@media (pointer: coarse) {
  .btn-sm { min-height: 40px; min-width: 40px; padding: 8px 12px; }
  .order-item .moves button { width: 40px; height: 40px; }
  .nav-filters .btn-sm { min-height: 40px; }
}
/* v1.7.7 — saat ruangan OSCE berjalan, menu bawah disembunyikan agar tidak tersentuh dan keluar dari ujian
   (waktu tetap berjalan di server). Tombol "Daftar sirkuit" tetap tersedia. */
body:has(#osceHost[data-mode="live"]) .bottomnav { display: none; }
body:has(#osceHost[data-mode="live"]) main { padding-bottom: 16px; }
/* v1.7.7 — Live Battle di HP: teks opsi tidak lagi terpotong di tengah kata ("Sulfonilure-a").
   Jumlah pemilih dipindah ke pojok, kata panjang hanya dipatahkan bila memang tidak muat satu baris. */
.live-opts .option { position: relative; gap: 8px; padding: 12px 12px 12px 10px; }
.live-opts .option .key { flex-basis: 26px; height: 26px; }
.live-opts .option .opt-html { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.live-opts .option small { position: absolute; top: 4px; right: 8px; font-size: .72rem; color: var(--muted); }
@media (max-width: 480px) { .live-opts { grid-template-columns: 1fr; gap: 8px; } .live-opts .option { min-height: 56px; } }

/* Isi <details> yang tertutup tidak ikut ditata (sama dengan perilaku peramban; mencegah tumpang-tindih semu). */
details:not([open]) > :not(summary) { display: none; }

/* ===== B2 (R103): kerapian global di HP 360 px — target sentuh ≥ 44 px, huruf ≥ 12 px, tabel jadi kartu =====
   Dijaga test/41 Humaniora-15..17. Jangan turunkan angka di bawah tanpa audit ulang crawl 360 px. */
.brand { min-height: 44px; }
.admin-menu-mobile .group { font-size: .78rem; }
@media (max-width: 600px) {
  .btn, .btn-sm, a.chip, .chip, a.badge, select,
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=file]),
  input[type=file], button:not(.icon-btn) { min-height: 44px; }
  .btn-sm { padding: 10px 12px; font-size: .86rem; }
  a.chip, .chip, a.badge { display: inline-flex; align-items: center; }
  a.badge { padding: 0 12px; }
  label.check, .manual-check label, label.chip { min-height: 44px; align-items: center; }
  input.w-num { width: 7.5em; }
  .sidebar a, .admin-menu-mobile a { min-height: 44px; display: flex; align-items: center; }
  /* Kepala halaman staf: judul satu baris sendiri, lalu nama akun & tombol ikon (tidak meluber ke kanan). */
  select { max-width: 100%; }
  .admin-top { flex-wrap: wrap; row-gap: 6px; padding: 8px 12px; }
  .admin-top > strong { flex: 1 0 100%; }
  .admin-top a.badge { flex: 1 1 auto; min-width: 0; white-space: normal; }
  /* Tabel → kartu: label kolom diisi app.js (data-label) dari judul kolom. */
  .table.table-cards thead { display: none; } /* judul kolom dibacakan lewat data-label tiap sel */
  .table.table-cards td a:not(.btn):not(.badge):not(.chip) { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }
  .tabs { flex-wrap: wrap; overflow-x: visible; }
  /* Kotak centang tanpa label di kartu tabel (pilih soal/token): area ketuk 44 px. Yang berlabel diketuk lewat barisnya (≥ 44 px). */
  .table.table-cards td > input[type=checkbox], .table.table-cards td > input[type=radio] { width: 44px; height: 44px; margin: 0; }
  .table.table-cards, .table.table-cards tbody, .table.table-cards tr, .table.table-cards td { display: block; width: 100%; }
  .table.table-cards tr { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin: 0 0 10px; background: var(--surface); }
  .table.table-cards td { border: 0; padding: 7px 0; display: flex; gap: 10px; justify-content: space-between; align-items: center; text-align: right; overflow-wrap: anywhere; min-width: 0; }
  .table.table-cards td + td { border-top: 1px dashed var(--line); }
  .table.table-cards td::before { content: attr(data-label); font-weight: 700; font-size: .8rem; color: var(--muted); text-align: left; flex: 0 0 40%; }
  .table.table-cards td[data-label=""]::before { content: none; }
  .table.table-cards td[data-label=""] { justify-content: flex-start; text-align: left; }
  .table.table-cards td > * { max-width: 60%; }
  .table.table-cards td[data-label=""] > * { max-width: 100%; }
  .table-wrap:has(.table-cards) { overflow-x: visible; }
}
