/* Lapang Runner — dasar dari aplikasi ATF 2026 (kontras sudah diuji: teks #2A2B2A di #73B3DE 6,25:1; #1A5F8E di putih 6,84:1). */
:root {
  --bg: #f4f7fa; --card: #fff; --ink: #2a2b2a; --muted: #5f6b76; --line: #d9e1e8;
  --pri: #73b3de; --pri-ink: #2a2b2a; --pri-soft: #e8f2fa; --link: #1a5f8e; --focus: #1a5f8e;
  --warn: #9a4a00; --warn-bg: #fff4e5; --bad: #b3261e; --bad-bg: #fdecea; --ok: #1e6b3a;
  --sA-bg: #1e6b3a; --sA: #fff; --sB-bg: #bfe6c9; --sB: #14532d; --sC-bg: #fbe38e; --sC: #5a4500;
  --sD-bg: #e3e5e8; --sD: #3a3f45; --sE-bg: #f8d0da; --sE: #7a1f36;
  --r: 14px; --kb: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181c; --card: #1c2228; --ink: #e6eef5; --muted: #9aa5b1; --line: #2f3943;
    --pri: #73b3de; --pri-ink: #14181c; --pri-soft: #1f3445; --link: #8ec5ea; --focus: #8ec5ea;
    --warn: #f0a050; --warn-bg: #3a2a14; --bad: #ff8a80; --bad-bg: #3a1c1a; --ok: #6fd39a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 560px; margin: 0 auto; padding: 12px 16px 140px; }
h1 { font-size: 23px; line-height: 1.25; margin: 12px 0 6px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 0 8px; }
h3 { font-size: 19px; margin: 0 0 6px; }
p { margin: 6px 0; }
.sub { color: var(--muted); font-size: 15px; }
.center { text-align: center; }
a, .link { color: var(--link); }
.link { background: none; border: 0; padding: 12px 4px; min-height: 48px; text-decoration: underline; text-underline-offset: 3px; font-size: 16px; }

/* bilah atas */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 6px; background: var(--pri); color: var(--pri-ink);
  padding: calc(env(safe-area-inset-top) + 6px) 8px 6px; min-height: 58px; }
.bar .title { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; line-height: 1.2; padding-left: 6px; }
.bar .title small { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .icon { background: none; border: 0; color: inherit; font-size: 24px; min-width: 48px; height: 48px; border-radius: 12px; }
.bar .icon:active { background: rgba(0,0,0,.08); }
.syncpill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.75); color: #2a2b2a; border: 0;
  border-radius: 999px; padding: 6px 12px; min-height: 48px; font-size: 14px; font-weight: 600; max-width: 52%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; background: #1e8a4a; box-shadow: 0 0 0 2px #fff; }
.dot.pending { background: #e07b00; } .dot.error { background: #c62828; } .dot.off { background: #8a96a3; }
.latihan { background: var(--warn-bg); color: var(--warn); text-align: center; font-size: 14px; font-weight: 700; padding: 6px; border-bottom: 1px solid var(--warn); }
.prog { height: 5px; background: var(--line); }
.prog i { display: block; height: 100%; background: var(--link); transition: width .2s; }
.steplabel { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* kartu dan tombol */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-top: 12px; }
.card.task { display: flex; gap: 12px; align-items: center; border-left: 5px solid var(--pri); width: 100%; text-align: left; }
.card.task .t { flex: 1; }
.card.task b { display: block; }
.card.warn { border-color: var(--warn); background: var(--warn-bg); }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 12px 16px;
  border-radius: 12px; border: 0; background: var(--pri); color: var(--pri-ink); font-weight: 700; font-size: 17px; text-align: center; }
.btn:active { filter: brightness(.94); }
.btn.big { min-height: 68px; font-size: 20px; border-radius: 16px; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.btn.ghost { background: var(--card); color: var(--ink); border: 2px solid var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { min-height: 48px; font-size: 16px; padding: 8px 12px; }
.btn[disabled] { opacity: .5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack > * + * { margin-top: 10px; }

/* tombol bawah (tidak tertutup keyboard) */
.actions { position: fixed; left: 0; right: 0; bottom: var(--kb); z-index: 9; background: var(--bg); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.actions .in { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.actions .btn.ghost { flex: 0 0 34%; }
body.kb .actions { padding-bottom: 10px; }

/* pertanyaan */
.q { margin-top: 22px; scroll-margin-top: 80px; }
.q > .qt { display: block; font-weight: 700; font-size: 18px; line-height: 1.3; }
.q > .hint { color: var(--muted); font-size: 15px; margin: 4px 0 0; }
.q .opts { display: grid; gap: 8px; margin-top: 10px; }
.q .opts.cols2 { grid-template-columns: 1fr 1fr; }
.q .opts.cols3 { grid-template-columns: 1fr 1fr 1fr; }
.opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 14px; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: 12px; line-height: 1.25; }
.opt .box { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; }
.opt.multi .box { border-radius: 6px; }
.opt.on { border-color: var(--link); background: var(--pri-soft); }
.opt.on .box { border-color: var(--link); background: var(--link); }
.opt.on .box::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.opt.multi.on .box::after { content: "✓"; width: auto; height: auto; background: none; color: #fff; font-size: 14px; font-weight: 800; }
.opt .ol { flex: 1; min-width: 0; }
.opt .od { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.opt .prev { flex: none; font-size: 12px; font-weight: 700; color: var(--link); border: 1px solid var(--link); border-radius: 999px; padding: 2px 8px; }
.opt.tile { justify-content: center; text-align: center; min-height: 56px; font-weight: 600; padding: 8px 6px; }
.opt.tile .box { display: none; }
.opt.tile.on { box-shadow: inset 0 0 0 1px var(--link); }
.opt.meja { min-height: 64px; font-size: 18px; }
.opt.chip { min-height: 48px; justify-content: center; padding: 8px 12px; }
.opt.status { align-items: flex-start; }
.opt.status .box { display: none; }
input[type=text], input[type=tel], input[type=search], input[type=url], input[type=number], input[type=date], input[type=time], input:not([type]), textarea {
  width: 100%; margin-top: 10px; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-size: 17px; }
input:focus, textarea:focus { outline: none; border-color: var(--link); }
textarea { min-height: 96px; resize: vertical; }
.counter { text-align: right; color: var(--muted); font-size: 13px; }
.err { color: var(--bad); font-weight: 600; font-size: 15px; margin: 8px 0 0; }
.warnmsg { color: var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; font-size: 15px; margin: 8px 0 0; }
.warnmsg .btn { margin-top: 8px; }
.has-err .opt, .has-err input, .has-err textarea { border-color: var(--bad); }
.stepper { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.stepper button { width: 56px; height: 56px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-size: 26px; font-weight: 700; }
.stepper input { margin: 0; text-align: center; font-size: 22px; font-weight: 700; flex: 1; }
.scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.scale.s11 { grid-template-columns: repeat(6, 1fr); }
.scale .opt { min-height: 48px; padding: 4px; justify-content: center; font-weight: 700; }
.scale .opt .box { display: none; }
.ratingrow { margin-top: 14px; }
.ratingrow .rl { font-weight: 600; }
.scaleends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ringkasan baris (mitra · konten) */
.pickline { display: flex; align-items: center; gap: 10px; background: var(--pri-soft); border-radius: 12px; padding: 8px 8px 8px 14px; margin-top: 12px; }
.pickline .pl { flex: 1; min-width: 0; }
.pickline .pl b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickline .pl span { color: var(--muted); font-size: 14px; }
.pickline .btn { width: auto; min-width: 72px; }
.refnote { border-left: 4px solid var(--line); padding: 6px 10px; color: var(--muted); font-size: 15px; margin-top: 10px; }

/* status chip */
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 8px; font-weight: 800; font-size: 15px; }
.chip.sA { background: var(--sA-bg); color: var(--sA); } .chip.sB { background: var(--sB-bg); color: var(--sB); }
.chip.sC { background: var(--sC-bg); color: var(--sC); } .chip.sD { background: var(--sD-bg); color: var(--sD); }
.chip.sE { background: var(--sE-bg); color: var(--sE); } .chip.s_ { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.opt.status .chip { flex: none; margin-top: 1px; }

/* daftar mitra */
.search { position: relative; }
.list { margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; }
.item:first-child { border-top: 0; }
.item:active { background: var(--pri-soft); }
.item .il { flex: 1; min-width: 0; }
.item .il b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .il span { display: block; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .ir { text-align: right; font-size: 14px; color: var(--muted); flex: none; }
.item .ir .chip { margin-bottom: 2px; }
.item.add { color: var(--link); font-weight: 700; }
.item.add .plus { font-size: 24px; width: 30px; text-align: center; }
.empty { padding: 18px 14px; color: var(--muted); text-align: center; }
.suggest { background: var(--warn-bg); color: var(--warn); }
.stats { display: flex; gap: 8px; margin-top: 12px; }
.stats div { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stats b { display: block; font-size: 24px; line-height: 1.1; }
.stats span { font-size: 13px; color: var(--muted); }
.meter { height: 8px; background: var(--line); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--link); }
.footlinks { display: flex; justify-content: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }

/* halaman mitra / linimasa */
.deal { padding: 0; overflow: hidden; }
.deal .dh { padding: 14px; display: flex; gap: 10px; align-items: flex-start; }
.deal .dh .dt { flex: 1; min-width: 0; }
.deal .dh .dt b { display: block; font-size: 18px; }
.deal .dh .dt span { color: var(--muted); font-size: 14px; }
.deal .da { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 14px; }
.tl { border-top: 1px solid var(--line); padding: 4px 14px 10px; }
.tl summary { min-height: 48px; display: flex; align-items: center; color: var(--link); font-weight: 600; cursor: pointer; }
.ev { position: relative; padding: 10px 0 10px 22px; border-left: 2px solid var(--line); margin-left: 8px; }
.ev::before { content: ""; position: absolute; left: -7px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--pri); border: 2px solid var(--card); }
.ev.del { opacity: .6; }
.ev.del .evh { text-decoration: line-through; }
.ev .evh { font-weight: 600; }
.ev .evb { color: var(--muted); font-size: 15px; }
.ev .eva { display: flex; gap: 6px; margin-top: 4px; }
.ev .eva .link { min-height: 48px; padding: 8px 6px; }
.item .eva { display: flex; gap: 10px; margin-top: 2px; }
.item .eva .link { min-height: 48px; min-width: 48px; padding: 8px 4px; font-size: 16px; }
.item.del { opacity: .6; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 6px; background: var(--pri-soft); color: var(--link); margin-left: 4px; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0 0; }
dl.kv dt { color: var(--muted); font-size: 15px; }
dl.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.review .rs { padding: 12px 0; border-top: 1px solid var(--line); }
.review .rs:first-child { border-top: 0; }
.review .rq { color: var(--muted); font-size: 15px; }
.review .ra { font-weight: 600; overflow-wrap: anywhere; }
.codebox { font: 700 32px/1.2 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .08em; text-align: center; padding: 14px; background: var(--pri-soft); border-radius: 12px; margin-top: 8px; }
.steps { padding-left: 22px; } .steps li { margin: 8px 0; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.success { text-align: center; padding-top: 40px; }
.success .tick { width: 88px; height: 88px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 52px; line-height: 88px; margin: 0 auto 12px; animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* modal dan toast */
#modal { position: fixed; inset: 0; z-index: 50; display: none; background: rgba(0,0,0,.45); align-items: flex-end; justify-content: center; }
#modal.show { display: flex; }
#modal .sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; }
#modal .sheet p { color: var(--muted); }
#modal .sheet .row2, #modal .sheet .stack { margin-top: 16px; }
#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom) + var(--kb)); transform: translateX(-50%); z-index: 60; background: #2a2b2a; color: #fff;
  border-radius: 12px; padding: 12px 16px; font-size: 15px; width: max-content; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }

/* ===== tambahan Runner umum ===== */
h2.sect { margin-top: 28px; color: var(--link); }
.q.note .notetext { margin: 0; font-size: 17px; }
.q.note { background: var(--pri-soft); border-radius: 12px; padding: 12px 14px; }
.numrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.numrow input { margin: 0; flex: 1; }
.numrow .pre { font-size: 17px; }
.numrow .unit { color: var(--muted); font-size: 16px; min-width: 2ch; }

/* ubin kuesioner (mode enumerator) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 92px; padding: 14px 12px 12px;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px; text-align: left; }
.tile:active { border-color: var(--link); background: var(--pri-soft); }
.tile b { font-size: 17px; line-height: 1.25; padding-right: 30px; }
.tile small { color: var(--muted); font-size: 14px; }
.tile .lang { position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 800; color: var(--link); border: 1px solid var(--link); border-radius: 6px; padding: 1px 5px; }

/* tabel isian */
.table { margin-top: 10px; display: grid; gap: 10px; }
.trow { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tlabel { font-size: 16px; line-height: 1.3; }
.tcells { display: grid; gap: 8px; margin-top: 8px; }
.tcells.c2 { grid-template-columns: 1fr 1fr; }
.tcells.c3 { grid-template-columns: 1fr 1fr 1fr; }
.cell { display: block; }
.cell > span:first-child { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.cell .inp { display: flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--card); min-height: 48px; }
.cell .inp:focus-within { border-color: var(--link); }
.cell .inp b { font-size: 14px; color: var(--muted); }
.cell .inp i { font-style: normal; color: var(--muted); }
.cell input { border: 0; margin: 0; padding: 8px 0; min-height: 48px; width: 100%; min-width: 0; background: transparent; font-size: 17px; }
.cell input:focus { outline: none; }
.cell.off .inp { background: var(--bg); opacity: .7; }
.chk { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); font-size: 14px; text-align: left; margin-top: 18px; }
.chk .box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--muted); display: grid; place-items: center; }
.chk.on { border-color: var(--link); background: var(--pri-soft); }
.chk.on .box { background: var(--link); border-color: var(--link); }
.chk.on .box::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 800; }
.total { margin-top: 10px; text-align: right; font-size: 16px; }

/* rating per baris */
.rating { margin-top: 10px; display: grid; gap: 12px; }
.rrow { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.rrow.miss { border-color: var(--bad); }
.rbtns { display: grid; gap: 6px; margin-top: 8px; grid-template-columns: repeat(var(--n, 5), 1fr); }
.rbtns.n4 { --n: 4; } .rbtns.n5 { --n: 5; } .rbtns.n6 { --n: 3; } .rbtns.n3 { --n: 3; }
.rb { min-height: 48px; padding: 4px 6px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); font-size: 14px; line-height: 1.2; }
.rb.on { border-color: var(--link); background: var(--pri-soft); font-weight: 700; }
.scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.scale .opt { justify-content: center; padding: 4px; font-weight: 700; min-height: 48px; }

/* ringkasan total & daftar ringkasan */
.sumtbl { margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.sumtbl > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.sumtbl > div:first-child { border-top: 0; }
.sumtbl .grand { font-size: 18px; background: var(--pri-soft); border-radius: 0 0 12px 12px; }
.li { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 14px; min-height: 56px; }
.li:first-child { border-top: 0; }
.li:active { background: var(--pri-soft); }
.li .lq { display: block; color: var(--muted); font-size: 14px; }
.li .la { display: block; font-weight: 600; overflow-wrap: anywhere; }

/* chip status menurut urutan di daftar status (paling atas = paling maju) — berlaku untuk proyek apa pun */
.chip.r0 { background: var(--sA-bg); color: var(--sA); } .chip.r1 { background: var(--sB-bg); color: var(--sB); }
.chip.r2 { background: var(--sC-bg); color: var(--sC); } .chip.r3 { background: var(--sD-bg); color: var(--sD); }
.chip.r4, .chip.r5, .chip.r6 { background: var(--sE-bg); color: var(--sE); } .chip.rx { background: var(--sD-bg); color: var(--sD); }
.item.on { background: var(--pri-soft); }
