/* Takar Opname — staff app mockup. Hanya token dari ../tokens.css (var(--c-*)). Tidak ada hex di file ini.
   Token tambahan (usulan untuk DESIGN.md) didefinisikan di :root di bawah, semuanya turunan token yang ada. */
:root {
  --on-dark: var(--c-surface);                       /* teks putih di panggung */
  --on-dark-muted: rgb(var(--c-surface-rgb) / 0.68); /* teks sekunder di panggung */
  --on-dark-faint: rgb(var(--c-surface-rgb) / 0.14); /* track/garis di panggung */
  --key-h: 56px;                                     /* tombol keypad kerja cepat */
  --app-w: 430px;                                    /* kolom HP */
  --bar-h: 76px;                                     /* bar aksi bawah (tanpa safe area) */
  --safe-b: max(16px, calc(env(safe-area-inset-bottom) + 8px)); /* jarak bawah minimum 16px */
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-size: 15px; line-height: 1.45; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* iOS: strip 4px opaque sebagai anak pertama body (IOS-STATUSBAR.md) */
.top-strip { position: sticky; top: 0; z-index: 100; width: 100%; height: max(env(safe-area-inset-top), 4px);
  margin-bottom: calc(-1 * max(env(safe-area-inset-top), 4px)); background-color: var(--top-color, var(--c-primary-deep)); }
.reach-up { position: relative; }
.reach-up::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 120vh; background: var(--c-primary-deep); pointer-events: none; }

/* ── Presentasi: kolom HP di tengah kanvas ── */
.app { position: relative; width: 100%; max-width: var(--app-w); min-height: 100dvh; margin: 0 auto; background: var(--c-canvas); }
@media (min-width: 431px) {
  .app { box-shadow: 0 0 0 1px rgb(var(--c-line-rgb) / 0.8), var(--shadow-pop); }
}
@media (max-width: 430px) { html, html body { background: var(--c-primary-deep); } }
.fixed-col { position: fixed; left: 0; right: 0; margin: 0 auto; width: 100%; max-width: var(--app-w); }

/* panel demo di desktop lebar (di luar app) */
.demo-panel { display: none; }
@media (min-width: 1000px) {
  .demo-panel { display: block; position: fixed; top: 32px; left: max(24px, calc(50% - var(--app-w) / 2 - 300px)); width: 252px; z-index: var(--z-nav); }
}
.demo-panel .card { padding: 16px; }
.demo-panel h2 { font-size: 17px; color: var(--c-primary); }
.demo-panel p { font-size: 13px; color: var(--c-muted); margin-top: 4px; }
.demo-nav { display: grid; gap: 4px; margin-top: 12px; }
.demo-nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-field); font-weight: 600; font-size: 14px; color: var(--c-muted); }
.demo-nav a:hover { background: var(--c-surface-2); color: var(--c-ink); }
.demo-nav a[aria-current="page"] { background: var(--c-primary-soft); color: var(--c-primary); }
.demo-nav .n { width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: var(--c-tint); color: var(--c-primary); font-size: 12px; font-weight: 700; }

/* ── Kit: kartu, tombol, badge ── */
.card { background: var(--c-surface); border-radius: var(--radius-card); border: 1px solid rgb(var(--c-line-rgb) / 0.6); box-shadow: var(--shadow-lift); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--c-muted); }
.stage .eyebrow { color: var(--on-dark-muted); }
.muted { color: var(--c-muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--radius-field);
  font-weight: 600; font-size: 15px; white-space: nowrap; }
.btn-primary { color: var(--on-dark); box-shadow: var(--shadow-dark-lift); }
.btn-primary[disabled] { background-image: none; background-color: var(--c-surface-2); color: var(--c-muted); box-shadow: none; cursor: not-allowed; }
.btn-secondary { background: var(--c-surface-2); color: var(--c-primary); }
.btn-outline { background: var(--c-surface); color: var(--c-primary); border: 1px solid var(--c-line); }
.btn-ghost { color: var(--c-primary); min-height: 44px; padding: 0 12px; }
.btn-accent { background: var(--c-accent); color: var(--c-accent-ink); box-shadow: var(--shadow-dark-lift); }
.btn-glass { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--on-dark); min-height: 44px; padding: 0 14px; border-radius: 999px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; display: inline-grid; place-items: center; }
.icon-btn.glass { color: var(--on-dark); }
.icon-btn.plain { background: var(--c-surface-2); color: var(--c-primary); }
.icon-circle { width: 40px; height: 40px; border-radius: 999px; background: var(--c-tint); color: var(--c-primary); display: grid; place-items: center; flex: none; }
.icon-circle.sm { width: 32px; height: 32px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.badge.kritis { background: var(--c-danger-soft); color: var(--c-danger); }
.badge.waspada { background: var(--c-warn-soft); color: var(--c-warn); }
.badge.aman, .badge.ok { background: var(--c-ok-soft); color: var(--c-ok); }
.badge.info { background: var(--c-info-soft); color: var(--c-info); }
.badge.brand { background: var(--c-primary-soft); color: var(--c-primary); }
.badge.plain { background: var(--c-surface-2); color: var(--c-muted); }
.badge.plain::before { display: none; }

/* progress bar: isi digeser pakai transform di track overflow hidden (PLAYBOOK §9) */
.bar { height: 6px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--c-primary); transform: translateX(calc((var(--p) - 1) * 100%)); transition: transform 640ms var(--spring-soft); }
/* satu sistem: isi selalu primary; selesai ditandai ikon cek hijau */
.stage .bar { background: var(--on-dark-faint); }
.stage .bar > i { background: var(--c-accent); }

/* ── Panggung ── */
.stage { position: relative; color: var(--on-dark); border-radius: 0 0 var(--radius-hero) var(--radius-hero); padding: calc(env(safe-area-inset-top) + 14px) 20px 22px; }
.stage-top { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.stage-top .grow { flex: 1; min-width: 0; }
.wordmark { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; font-size: 22px; color: var(--on-dark); }
.wordmark i { font-style: normal; color: var(--c-primary-2); }
.stage .wordmark i { color: var(--c-accent); }
.avatar { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: var(--c-accent); color: var(--c-accent-ink); font-weight: 700; }
.glass-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--on-dark); white-space: nowrap; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }

main.pad { padding: 16px 16px calc(env(safe-area-inset-bottom) + 40px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 4px 0; }
.section-title h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 18px; color: var(--c-primary); }

/* ── Offline banner (kalem) ── */
.offline { display: none; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-field); background: var(--c-surface-2); color: var(--c-ink); font-size: 13.5px; }
.offline b { font-weight: 600; }
html[data-offline] .offline { display: flex; animation: fade 200ms var(--ease-out) both; }
.offline .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--c-warn); flex: none; }
@keyframes fade { from { opacity: 0; } }

/* ═════════ 1. Masuk ═════════ */
.login { min-height: 100dvh; border-radius: 0; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 20px) 24px max(24px, calc(env(safe-area-inset-bottom) + 12px)); }
.login .brandrow { display: flex; align-items: center; justify-content: space-between; }
.login .outlet { font-size: 13px; color: var(--on-dark-muted); }
.login .hello { margin-top: auto; padding-top: 24px; }
.login .hello h1 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 32px; line-height: 1.1; }
.login .hello p { color: var(--on-dark-muted); margin-top: 6px; }
.who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.who button { min-height: 56px; border-radius: var(--radius-field); text-align: left; padding: 8px 12px; display: grid; gap: 0; color: var(--on-dark); }
.who button b { font-weight: 600; font-size: 15px; }
.who button span { font-size: 12px; color: rgb(var(--c-surface-rgb) / 0.78); }
.who button[aria-checked="true"] { background: var(--c-accent); color: var(--c-accent-ink); border-color: transparent; }
.who button[aria-checked="true"] span { color: rgb(var(--c-primary-rgb) / 0.7); }
.resume { margin-top: 12px; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-field); font-size: 13.5px; color: var(--on-dark-muted); }
.resume b { color: var(--on-dark); font-weight: 600; }
.resume .icon-circle { background: rgb(var(--c-accent-rgb) / 0.14); color: var(--c-accent); }
.pin-area { margin-top: auto; padding-top: 24px; }
.pin-label { text-align: center; font-size: 15px; color: var(--on-dark-muted); }
.dots { display: flex; justify-content: center; gap: 22px; margin: 16px 0 8px; }
.dots i { width: 20px; height: 20px; border-radius: 999px; border: 2px solid rgb(var(--c-surface-rgb) / 0.55); transition: transform 300ms var(--spring); }
.dots i.on { background: var(--c-accent); border-color: var(--c-accent); box-shadow: 0 0 14px rgb(var(--c-accent-rgb) / 0.55); transform: scale(1.12); }
.dots.shake { animation: shake 360ms var(--ease-out); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-msg { height: 20px; text-align: center; font-size: 13px; color: var(--on-dark-muted); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
/* tombol PIN = glass ringan (bukan slab gelap) */
.pinpad button { height: 64px; border-radius: var(--radius-field); font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--on-dark); display: grid; place-items: center; }
.pinpad button.glass { background-color: rgb(var(--c-accent-rgb) / 0.1); border-color: rgb(var(--c-accent-rgb) / 0.18); box-shadow: inset 0 1px 0 rgb(var(--c-accent-rgb) / 0.16); }
.pinpad button.glass:active { background-color: rgb(var(--c-surface-rgb) / 0.16); }
.pinpad button.txt { font-family: var(--font-body); font-size: 14px; font-weight: 600; background: none; border: 0; box-shadow: none; color: var(--on-dark-muted); }

/* ═════════ 2. Beranda ═════════ */
.hero-row { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring .trk { stroke: var(--on-dark-faint); }
.ring .val { stroke: var(--c-accent); stroke-linecap: round; }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; color: var(--c-accent); }
.hero-num { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; font-size: 44px; line-height: 1; color: var(--c-accent); white-space: nowrap; }
.hero-num small { font-size: 55%; color: var(--on-dark-muted); font-weight: 700; margin-left: 2px; }
.hero-sub { color: var(--on-dark-muted); font-size: 14px; margin-top: 6px; }
.hero-cta { margin-top: 18px; width: 100%; justify-content: space-between; min-height: 56px; padding: 0 8px 0 18px; }
.hero-cta .t { display: grid; text-align: left; line-height: 1.2; min-width: 0; }
.hero-cta .t small { font-size: 12px; font-weight: 500; opacity: 0.72; }
.hero-cta .t b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.hero-cta .go { width: 40px; height: 40px; border-radius: 999px; background: var(--c-primary); color: var(--c-accent); display: grid; place-items: center; }

.areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.area { padding: 14px; display: grid; gap: 8px; text-align: left; }
.area .top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.area .top .check, .area .top .todo { margin-left: auto; flex: none; }
.area h3 { font-size: 15px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area .cnt { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 20px; line-height: 1.2; color: var(--c-primary); font-variant-numeric: tabular-nums; }
.area .cnt span { font-size: 14px; color: var(--c-muted); font-weight: 700; }
.check { width: 24px; height: 24px; border-radius: 999px; background: var(--c-ok-soft); color: var(--c-ok); display: grid; place-items: center; }
.todo { width: 10px; height: 10px; border-radius: 999px; background: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-soft); margin-right: 7px; }

.list-card { padding: 4px 0; }
.list-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; }
.list-head h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 17px; color: var(--c-primary); }
.list-head p { font-size: 13px; color: var(--c-muted); }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; width: 100%; text-align: left; border-top: 1px solid rgb(var(--c-line-rgb) / 0.6); }
.row .grow { flex: 1; min-width: 0; }
.row .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 12.5px; color: var(--c-muted); }
.row .chev { color: var(--c-muted); }

.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 64px; width: 100%; text-align: left; }
.switch { position: relative; width: 48px; height: 28px; border-radius: 999px; background: var(--c-surface-2); border: 1px solid var(--c-line); flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 999px; background: var(--c-surface); box-shadow: var(--shadow-lift); transition: transform 300ms var(--spring); }
.switch[aria-checked="true"] { background: var(--c-primary); border-color: var(--c-primary); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* ═════════ 3. Hitung item ═════════ */
.count-stage { padding-bottom: 14px; }
.count-stage .nm { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 24px; line-height: 1.15; margin-top: 10px; }
.count-stage .meta { color: var(--on-dark-muted); font-size: 13.5px; margin-top: 2px; }
.total-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 14px; }
.total .eyebrow { margin-bottom: 4px; }
.total .hero-num { font-size: var(--fit, 44px); }
.total .approx { color: var(--on-dark-muted); font-size: 13.5px; margin-top: 4px; }
.stage-actions { display: flex; gap: 8px; flex: none; }
.stage-actions .act { display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
.act-ai { background: var(--c-accent); color: var(--c-accent-ink); box-shadow: var(--shadow-dark-lift); }
.stage-actions .act, .stage-actions .btn-glass { flex-direction: column; width: 72px !important; gap: 2px; width: 64px; height: 64px; padding: 0; border-radius: var(--radius-field); font-size: 12px; font-weight: 600; }

.counter { padding: 14px; display: grid; gap: 10px; }
.fieldrow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.fieldrow .lab { font-size: 13px; font-weight: 600; color: var(--c-muted); grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.lab { min-height: 22px; align-items: center; }
.fill-tag { display: none; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--c-primary); color: var(--on-dark); font-size: 11.5px; font-weight: 600; }
.fill-tag.on { display: inline-flex; }
.numfield { min-width: 0; height: 56px; border-radius: var(--radius-field); border: 1.5px solid var(--c-line); background: var(--c-surface); display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 14px; text-align: left; }
.numfield .v { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 26px; color: var(--c-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.numfield .u { font-size: 13px; color: var(--c-muted); font-weight: 600; white-space: nowrap; }
.numfield.active { border: 2px solid var(--c-primary); padding: 0 13.5px; background: var(--c-primary-soft); box-shadow: 0 0 0 3px rgb(var(--c-primary-rgb) / 0.1); }
.numfield .caret { display: inline-block; width: 2px; height: 26px; background: var(--c-primary); margin-left: 2px; vertical-align: -4px; opacity: 0; }
.numfield.active .caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 1; } }
.times { font-size: 13px; color: var(--c-muted); white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 2px; margin-top: -4px; }
.times b { color: var(--c-ink); font-weight: 600; }
.fieldrow.main { grid-template-columns: minmax(0, 1fr); gap: 8px; }

.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 999px; background: var(--c-surface-2); }
.seg .pill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n)); border-radius: 999px; background: var(--c-surface); box-shadow: var(--shadow-lift); transform: translateX(calc(var(--i) * 100%)); transition: transform 300ms var(--spring); }
.seg button { position: relative; height: 40px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--c-muted); }
.seg button[aria-checked="true"] { color: var(--c-primary); }
.fracs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fracs button { height: 48px; border-radius: var(--radius-field); border: 1.5px solid var(--c-line); font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--c-ink); display: grid; place-items: center; line-height: 1; }
.fracs button small { font-family: var(--font-body); font-weight: 500; font-size: 11px; color: var(--c-muted); }
.fracs button[aria-checked="true"] { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary); }
.hint { font-size: 12.5px; color: var(--c-muted); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 2px; }
.keypad button { height: 52px; border-radius: var(--radius-field); background: var(--c-surface); border: 1px solid rgb(var(--c-line-rgb) / 0.8);
  font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--c-ink); display: grid; place-items: center; box-shadow: 0 1px 0 rgb(var(--c-line-rgb) / 0.9); }
.keypad button.fn { background: var(--c-surface-2); color: var(--c-primary); border-color: transparent; box-shadow: none; }
.keypad button[disabled] { opacity: 0.35; }

.actionbar { bottom: 0; z-index: var(--z-header); background: var(--c-surface); box-shadow: var(--shadow-bar); padding: 12px 16px var(--safe-b);
  display: flex; gap: 8px; align-items: center; border-top: 1px solid rgb(var(--c-line-rgb) / 0.6); }
.actionbar.dock { display: grid; grid-template-columns: 52px 1fr 52px; gap: 6px 8px; padding-top: 10px; border-radius: var(--radius-hero) var(--radius-hero) 0 0; }
.actionbar.dock .keypad { grid-column: 1 / -1; padding: 0; margin-bottom: 4px; }
.dock-spacer { height: calc(var(--dock-h, 360px) - 24px); }
.actionbar .btn-primary { flex: 1; min-height: 52px; min-width: 0; }
.actionbar .btn-primary span { overflow: hidden; text-overflow: ellipsis; }
.actionbar .icon-btn { width: 52px; height: 52px; border-radius: var(--radius-field); }
.bar-spacer { height: calc(var(--bar-h) + env(safe-area-inset-bottom) + 12px); }

/* ═════════ 4. Sheet suara ═════════ */
.scrim { position: fixed; inset: 0; z-index: var(--z-overlay); background: rgb(var(--c-primary-deep-rgb) / 0.8); opacity: 0; transition: opacity 220ms var(--ease-out); pointer-events: none; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { bottom: 0; z-index: var(--z-sheet); background: var(--c-surface); border-radius: var(--radius-hero) var(--radius-hero) 0 0; box-shadow: var(--shadow-pop);
  padding: 0 16px var(--safe-b); transform: translateY(105%); transition: transform 420ms var(--spring-soft); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; }
.sheet.on { transform: none; }
/* tepi atas sheet jatuh tepat di bawah panggung hitung → tidak memotong field di belakang */
.sheet { display: flex; flex-direction: column; min-height: min(92dvh, calc(100dvh - 222px)); }
.sheet > .note { margin-top: auto; }
.sheet .parse { margin-bottom: 16px; }
.sheet .sheet-actions { padding-top: 14px; }
.sheet.closing { transition: transform 220ms var(--ease-out); }
.sheet .grab { display: grid; place-items: center; height: 28px; cursor: grab; touch-action: none; }
.sheet .grab i { width: 40px; height: 5px; border-radius: 999px; background: var(--c-line); }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; touch-action: none; }
.sheet-head .grow { flex: 1; min-width: 0; }
.sheet-head h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 20px; color: var(--c-primary); }
.listen-card { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px; border-radius: var(--radius-field); background: var(--c-surface-2); }
.listen-card q { font-style: italic; font-size: 15px; color: var(--c-ink); }
.listen-card q::before { content: "“"; } .listen-card q::after { content: "”"; }
.wave { display: flex; gap: 3px; align-items: center; height: 24px; flex: none; }
.wave i { width: 3px; height: 100%; border-radius: 999px; background: var(--c-primary); transform: scaleY(0.35); animation: wave 900ms var(--ease-out) 3; }
.wave i:nth-child(2) { animation-delay: 120ms; } .wave i:nth-child(3) { animation-delay: 240ms; } .wave i:nth-child(4) { animation-delay: 360ms; }
@keyframes wave { 50% { transform: scaleY(1); } }
.parse { margin-top: 12px; display: grid; }
.pr { display: grid; grid-template-columns: 1fr auto; align-items: baseline; row-gap: 2px; column-gap: 12px; padding: 10px 2px; border-top: 1px solid rgb(var(--c-line-rgb) / 0.6); }
.pr span { font-size: 13.5px; color: var(--c-muted); }
.pr b { font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pr em { grid-column: 2; font-style: normal; font-size: 12.5px; color: var(--c-muted); text-align: right; white-space: nowrap; }
.pr.tot b { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 26px; color: var(--c-primary); }
.sheet .note { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-field); background: var(--c-accent-soft); font-size: 13px; display: flex; gap: 8px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pr .chg { grid-column: 1 / -1; justify-self: end; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--c-primary); color: var(--on-dark); font-size: 12.5px; font-weight: 600; white-space: nowrap; margin-top: 6px; gap: 4px; }
.pr .chg b { font-family: inherit; font-size: inherit; color: var(--c-accent); letter-spacing: 0; }
html.sheet-open .actionbar.dock { visibility: hidden; }
.sheet-actions .btn { min-height: 52px; }

/* ═════════ 5. Cek sebelum kirim ═════════ */
.qcard { padding: 16px; display: grid; gap: 12px; }
.qcard .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.qcard h3 { font-size: 16px; font-weight: 600; }
.qmeta { font-size: 12.5px; color: var(--c-muted); }
.usage { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.usage > div { padding: 10px 12px; border-radius: var(--radius-field); background: var(--c-surface-2); min-width: 0; }
.usage .k { font-size: 12px; color: var(--c-muted); }
.usage .v { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage .over .v { color: var(--c-danger); }
.vbar { display: grid; gap: 6px; }
.vbar .line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.vbar .line b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vtrack { position: relative; height: 10px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; }
.vtrack i { position: absolute; inset: 0; border-radius: 999px; transform: translateX(calc((var(--p) - 1) * 100%)); }
.vtrack .th { background: var(--c-muted); }
.vtrack .ac { background: var(--c-danger); }
.vtrack.warn .ac { background: var(--c-warn); }
.vtrack .th { z-index: 1; }
.vtrack .tol { position: absolute; z-index: 2; top: 0; bottom: 0; width: 3px; margin-left: -1px; border-radius: 999px; background: var(--c-surface); box-shadow: 0 0 0 1px var(--c-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--c-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.sw.th { background: var(--c-muted); } .sw.tl { width: 2px; border-radius: 0; height: 12px; background: var(--c-ink); }
.sw.ac.kritis { background: var(--c-danger); } .sw.ac.waspada { background: var(--c-warn); }
.ask { font-size: 13.5px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--c-line); background: var(--c-surface); font-size: 13.5px; font-weight: 500; color: var(--c-ink); }
.chip[aria-checked="true"] { background: var(--c-primary); border-color: var(--c-primary); color: var(--on-dark); }
.chip.re { color: var(--c-primary); border-style: dashed; display: inline-flex; align-items: center; gap: 6px; }
/* chip tinggi 40 + gap 8 → area sentuh efektif 44+ via padding vertikal tak terlihat */
.chip { position: relative; } .chip::after { content: ""; position: absolute; inset: -4px 0; }
.answered { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-field); background: var(--c-ok-soft); color: var(--c-ok); font-size: 14px; }
.answered b { font-weight: 600; color: var(--c-ink); }
.answered .grow { flex: 1; min-width: 0; }
.answered button { min-height: 44px; padding: 0 8px; color: var(--c-primary); font-weight: 600; font-size: 13.5px; }
.qcard.done { animation: none; }

/* ═════════ 6. Selesai ═════════ */
.done-mark { width: 64px; height: 64px; border-radius: 999px; background: var(--c-accent); color: var(--c-accent-ink); display: grid; place-items: center; margin-top: 16px; animation: pop 520ms var(--spring) both; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 14px; display: grid; gap: 4px; }
.stat .k { font-size: 13px; color: var(--c-muted); font-weight: 500; display: flex; justify-content: space-between; gap: 6px; }
.stat .v { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; font-size: 26px; color: var(--c-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .v small { font-size: 15px; color: var(--c-muted); }
.delta { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--c-ok-soft); color: var(--c-ok); width: max-content; }
.steps { display: grid; }
.steps .row { min-height: 60px; }

/* press: turun 0.97 lalu mantul (transisi dari tokens.css [class*="active:scale"]) */
.press:active { transform: scale(0.97); }
.press-card:active { transform: scale(0.995); }
.icon-btn.press:active { transform: scale(0.94); }

/* ── Toast ── */
.toasts { bottom: var(--safe-b); z-index: var(--z-toast); display: grid; justify-items: stretch; gap: 8px; padding: 0 16px; pointer-events: none; }
.toasts.above-bar { bottom: calc(env(safe-area-inset-bottom) + var(--bar-h) + 12px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px 0 14px; border-radius: 999px; background: var(--c-primary-deep); color: var(--on-dark); box-shadow: var(--shadow-pop); font-size: 14.5px; font-weight: 500; max-width: 100%; animation: toast-in 420ms var(--spring) both; }
.toast .ic { width: 26px; height: 26px; border-radius: 999px; background: var(--c-accent); color: var(--c-accent-ink); display: grid; place-items: center; flex: none; }
.toast.out { animation: toast-out 200ms var(--ease-out) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ── Transisi halaman (View Transitions, push/pop ala iOS) ── */
html[data-vt="mobile"]::view-transition-old(root) { animation: 220ms cubic-bezier(.3,.7,.2,1) both vt-push-out; }
html[data-vt="mobile"]::view-transition-new(root) { animation: 300ms var(--spring-soft) both vt-push-in; }
html[data-vt="mobile"][data-vt-dir="back"]::view-transition-old(root) { animation-name: vt-pop-out; }
html[data-vt="mobile"][data-vt-dir="back"]::view-transition-new(root) { animation-name: vt-pop-in; }
@keyframes vt-push-out { to { opacity: 0; transform: translateX(-18%); } }
@keyframes vt-push-in { from { opacity: 0; transform: translateX(30%); } }
@keyframes vt-pop-out { to { opacity: 0; transform: translateX(30%); } }
@keyframes vt-pop-in { from { opacity: 0; transform: translateX(-18%); } }

@media (max-width: 370px) {
  .hero-num { font-size: 38px; }
  .ring, .ring svg { width: 92px; height: 92px; }
  .stage-actions .act { width: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .wave i, .numfield.active .caret { animation: none; }
  .numfield.active .caret { opacity: 1; }
}

/* skala selisih: 0% → max(2× batas, selisih), garis = batas wajar */
.tolrow { position: relative; height: 16px; font-size: 11.5px; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.tolrow span { position: absolute; top: 0; white-space: nowrap; }
.tolrow .z { left: 0; }
.tolrow .t { transform: translateX(-50%); }

/* Cek: rumus ringkas + penjelasan lewat tombol "?" */
.formula { padding: 6px 6px 6px 14px; font-size: 13px; }
.formula .ln { display: flex; align-items: center; gap: 10px; }
.formula .ln > span { flex: 1; min-width: 0; color: var(--c-muted); }
.formula .ln b { color: var(--c-ink); font-weight: 600; }
.formula .q { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; flex: none; }
.formula .q i { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; background: var(--c-tint); color: var(--c-primary); font-style: normal; font-weight: 700; font-size: 14px; }
.formula .more { display: none; padding: 2px 8px 10px 0; color: var(--c-ink); }
.formula.open .more { display: block; }
.qpos { font-size: 12px; font-weight: 600; color: var(--c-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qcard .tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
/* Selesai: baris ESB = judul satu baris, kode & waktu di baris kedua, pill rata atas */
.steps .row.top { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.steps .row.top .icon-circle, .steps .row.top .badge { margin-top: 1px; }
