/* ROS LD Partners. Same look as the beta registration page (rld-website site/beta): the RLD logo's warm near-black
   and red, the launcher chip's gold-to-orange as the one accent, heavy italic condensed titles. */

@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-style: italic; font-display: swap; src: url("/fonts/barlow-condensed-latin-800-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Kantumruy Pro"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/kantumruy-pro-khmer-400-normal.woff2") format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/kantumruy-pro-khmer-600-normal.woff2") format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Kantumruy Pro"; font-weight: 700 800; font-style: normal; font-display: swap; src: url("/fonts/kantumruy-pro-khmer-700-normal.woff2") format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Koulen"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("/fonts/koulen-khmer-400-normal.woff2") format("woff2"); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }

:root {
  color-scheme: dark;
  --bg: #050404;
  --surface: #0e0b0a;
  --line: rgb(255 180 130 / 0.09);
  --line-strong: rgb(255 180 130 / 0.18);
  --text: #f7f0ea;
  --muted: #b5a397;
  --accent: #ff8a1f;
  --accent-hi: #ffb347;
  --gold: #ffc23a;
  --on-accent: #1a0f0a;
  --glow: 255 122 26;
  --fire: linear-gradient(180deg, #ffc23a 0%, #ff8a1f 52%, #e8531a 100%);
  --fire-hi: linear-gradient(180deg, #ffd25e 0%, #ff9a33 52%, #f2611f 100%);
  --fire-text: linear-gradient(180deg, #ffd25e 10%, #ff8a1f 60%, #ef5a1c 100%);
  --hot: #f93d4e;
  --red: #de1b21;
  --danger: #ff6b6b;
  --ok: #7fd49b;
  --display: "Barlow Condensed", "Koulen", "Kantumruy Pro", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", "Kantumruy Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; overflow-x: clip; color: var(--text); background: var(--bg);
  font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(55% 40% at 88% 0%, rgb(222 27 33 / 0.13), transparent 70%),
    radial-gradient(45% 35% at 0% 100%, rgb(255 122 26 / 0.08), transparent 70%),
    linear-gradient(180deg, rgb(5 4 4 / 0.93), rgb(5 4 4 / 0.97)),
    url("/img/lobby-blur.jpg") center / cover no-repeat;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
p, h1, h2, h3, h4, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }
.sprite { position: absolute; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 16px; }
.wrap--narrow { max-width: 52rem; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.num { font-variant-numeric: tabular-nums; }

.display { font-family: var(--display); font-style: italic; font-weight: 800; text-transform: uppercase; }
:lang(km) body { line-height: 1.7; }
:lang(km) .display { font-style: normal; text-transform: none; letter-spacing: 0 !important; line-height: 1.35 !important; font-weight: 400; }
.lang button[data-lang="km"] { font-family: "Koulen", var(--body); font-weight: 400; font-size: 15px; }
.fire-text { color: var(--accent); }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .fire-text { background: var(--fire-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
}

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(180deg, rgb(4 3 3 / 0.92), rgb(10 5 5 / 0.86));
  box-shadow: inset 0 -1px 0 rgb(222 27 33 / 0.45), 0 8px 24px rgb(0 0 0 / 0.5);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.topbar__in { display: flex; align-items: center; gap: 14px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__logo { height: 28px; width: auto; }
@media (max-width: 420px) { .brand__logo { height: 22px; } }
.chip {
  display: inline-block; padding: 6px 10px; line-height: 1; background: linear-gradient(180deg, var(--gold), #ff7a1a);
  color: #1a0f0a; font-size: 11px; font-weight: 800; letter-spacing: 0.28em; text-transform: uppercase;
}
.chip--sm { font-size: 10px; padding: 5px 7px; letter-spacing: 0.2em; }
.topbar__links { display: none; margin-left: auto; align-items: center; gap: 24px; }
@media (min-width: 768px) { .topbar__links { display: flex; } }
.toplink { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #b9a89c; }
.toplink:hover { color: var(--gold); }
:lang(km) .toplink { letter-spacing: 0; text-transform: none; font-size: 14px; }
.lang { display: flex; height: 34px; margin-left: auto; padding: 2px; border: 1px solid rgb(255 122 26 / 0.45); background: #0b0809; flex: none; }
@media (min-width: 768px) { .lang { margin-left: 8px; } }
.lang button { min-width: 40px; padding: 0 8px; font-size: 13px; font-weight: 700; color: var(--gold); }
.lang button[aria-pressed="true"] { background: linear-gradient(180deg, #ffad2b, #f57a1f, #d9541a); color: #1a0f0a; }
.who-mini { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--muted); }
.who-mini img, .who-mini .pic { width: 30px; height: 30px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px var(--accent); flex: none; }
.who-mini .pic { display: grid; place-items: center; background: linear-gradient(135deg, #8a1c14, #3a120e); color: var(--gold); font-weight: 800; }
.who-mini span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .who-mini span { display: none; } }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px;
  border-radius: 4px; white-space: nowrap; font-size: 19px; letter-spacing: 0.03em;
  transition: transform 0.2s var(--ease), background-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.98); }
.btn--lg { height: 54px; padding: 0 28px; font-size: 22px; }
.btn--sm { height: 36px; padding: 0 14px; font-size: 15px; }
.btn--block { width: 100%; }
.btn-go { background: var(--fire); color: var(--on-accent); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45), inset 0 -2px 0 rgb(150 40 10 / 0.35), 0 6px 22px rgb(var(--glow) / 0.4); }
.btn-go:hover { background: var(--fire-hi); color: var(--on-accent); }
.btn-steel { background: rgb(20 14 12 / 0.7); color: var(--gold); box-shadow: inset 0 0 0 1px rgb(255 194 58 / 0.45); }
.btn-steel:hover { background: rgb(255 194 58 / 0.1); color: var(--gold); }
.btn-danger { background: rgb(249 61 78 / 0.12); color: #ff9aa4; box-shadow: inset 0 0 0 1px rgb(249 61 78 / 0.5); }
.btn-flat { height: 34px; padding: 0 12px; font-size: 14px; font-weight: 600; color: var(--gold); background: rgb(255 194 58 / 0.08); box-shadow: inset 0 0 0 1px rgb(255 194 58 / 0.3); border-radius: 3px; flex: none; }
.btn-flat:hover { background: rgb(255 194 58 / 0.16); transform: none; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.55; pointer-events: none; transform: none; }
.tg-badge { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #1a0f0a; color: var(--gold); }
.tg-badge .ic { width: 15px; height: 15px; margin-left: -1px; }
.link-btn { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.link-btn:hover { color: var(--accent); }

/* ---- panels ---- */
.panel {
  background: linear-gradient(180deg, rgb(17 13 12 / 0.92), rgb(7 5 5 / 0.95));
  box-shadow: inset 0 1px 0 rgb(255 180 130 / 0.06), 0 18px 40px rgb(0 0 0 / 0.55);
  border: 1px solid var(--line); border-radius: 4px;
}
.panel__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #170f0d, #0c0807); box-shadow: inset 0 -1px 0 rgb(222 27 33 / 0.35); border-radius: 4px 4px 0 0; }
.panel__title { display: flex; align-items: center; gap: 10px; font-size: 22px; letter-spacing: 0.02em; }
.panel__head .spacer { flex: 1; }
.panel__body { padding: 18px; }
.slant-bar { display: inline-block; flex: none; width: 8px; height: 0.8em; background: var(--fire); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }

/* ---- landing ---- */
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: calc(100dvh - 60px); display: flex; align-items: center; }
.hero__pic { position: absolute; inset: 0; z-index: -2; }
.hero__pic img { width: 100%; height: 100%; object-fit: cover; object-position: 75% center; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to right, rgb(5 4 4 / 0.92), rgb(5 4 4 / 0.55) 50%, rgb(5 4 4 / 0.15)); }
@media (max-width: 767px) { .hero { align-items: flex-end; } .hero::after { background: linear-gradient(to top, rgb(5 4 4 / 0.96) 35%, rgb(5 4 4 / 0.35)); } .hero__pic img { object-position: 80% top; } }
.hero__copy { padding: 72px 0 56px; max-width: 38rem; }
.hero__title { margin-top: 18px; font-size: 46px; line-height: 0.95; text-shadow: 0 2px 0 rgb(0 0 0 / 0.45); }
.hero__title span { display: block; }
@media (min-width: 768px) { .hero__title { font-size: 70px; } }
.hero__sub { margin-top: 18px; max-width: 46ch; font-size: 18px; color: rgb(244 240 236 / 0.9); }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: 14px; color: var(--muted); }
.hero__facts li { display: flex; align-items: center; gap: 6px; }
.hero__facts .ic { color: var(--ok); width: 16px; height: 16px; }

.section { padding: 72px 0; }
.sec-title { display: flex; align-items: center; gap: 12px; font-size: 34px; line-height: 1.05; }
@media (min-width: 768px) { .sec-title { font-size: 44px; } }
.sec-lead { margin-top: 10px; max-width: 60ch; color: var(--muted); }
.steps { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.stepcard { position: relative; padding: 22px 20px 20px; }
.stepcard__n { display: grid; place-items: center; width: 42px; height: 36px; background: var(--fire); color: var(--on-accent); font-size: 22px; clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%); }
.stepcard h3 { margin-top: 14px; font-size: 24px; }
.stepcard p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.features { display: grid; gap: 14px; margin-top: 28px; }
@media (min-width: 700px) { .features { grid-template-columns: 1fr 1fr; } }
.feature { display: flex; gap: 14px; padding: 16px 18px; }
.feature .ic { width: 26px; height: 26px; color: var(--accent-hi); margin-top: 2px; }
.feature h4 { font-size: 17px; font-weight: 600; }
.feature p { margin-top: 4px; font-size: 14px; color: var(--muted); }
.codebox { margin-top: 28px; overflow-x: auto; padding: 16px 18px; border-radius: 4px; border: 1px solid var(--line-strong); background: rgb(4 3 3 / 0.92); font-family: var(--mono); font-size: 13px; line-height: 1.6; color: #f0dccb; white-space: pre; }
.codebox .c { color: #8f7f74; }
.codebox .k { color: var(--gold); }
.footer { padding: 32px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer__in { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }

/* Telegram's in-app browser */
.inapp { margin-top: 18px; padding: 14px 16px; max-width: 46ch; border-left: 3px solid var(--accent); background: rgb(var(--glow) / 0.08); font-size: 15px; }
.inapp__row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---- dashboard ---- */
.page { padding: 28px 0 72px; }
.page__head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 22px; }
.page__title { font-size: 38px; line-height: 1; }
@media (min-width: 768px) { .page__title { font-size: 48px; } }
.page__head .spacer { flex: 1; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 3px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: rgb(255 255 255 / 0.05); border: 1px solid var(--line-strong); }
:lang(km) .state-pill { letter-spacing: 0; text-transform: none; }
.state-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.state-pill.is-approved .dot { background: var(--ok); }
.state-pill.is-pending .dot { background: var(--gold); }
.state-pill.is-rejected .dot, .state-pill.is-suspended .dot { background: var(--hot); }
.grid { display: grid; gap: 18px; }
@media (min-width: 980px) { .grid--2 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 4px; border: 1px solid var(--line-strong); background: rgb(4 3 3 / 0.8); }
.notice .ic { width: 22px; height: 22px; margin-top: 1px; }
.notice--warn { border-color: rgb(255 194 58 / 0.4); }
.notice--warn .ic { color: var(--gold); }
.notice--bad { border-color: rgb(249 61 78 / 0.45); }
.notice--bad .ic { color: var(--hot); }
.notice--ok { border-color: rgb(127 212 155 / 0.4); }
.notice--ok .ic { color: var(--ok); }
.notice h3 { font-size: 18px; font-weight: 600; }
.notice p { margin-top: 4px; color: var(--muted); font-size: 15px; }

/* forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: 14px; font-weight: 600; color: #e9dccf; }
.field__label small { font-weight: 400; color: var(--muted); }
.field__hint { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-width: 0; padding: 11px 12px; border-radius: 3px; border: 1px solid var(--line-strong); background: rgb(4 3 3 / 0.92);
  color: var(--text); font-size: 16px; transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--glow) / 0.2); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.form__row { display: grid; gap: 16px; }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }
.form__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form__error { color: var(--danger); font-size: 14px; min-height: 0; }
.money-input { position: relative; }
.money-input::before { content: "$"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money-input .input { padding-left: 24px; }

/* facts list (what they sent) */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }

/* balance */
.balance { display: grid; gap: 16px; }
.balance__big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.balance__owed { font-size: 52px; line-height: 1; font-variant-numeric: tabular-nums; }
.balance__label { color: var(--muted); font-size: 14px; }
.meter { height: 10px; border-radius: 5px; background: rgb(255 255 255 / 0.07); overflow: hidden; }
.meter__fill { height: 100%; width: 0; background: var(--fire); border-radius: 5px; transition: width 0.6s var(--ease); }
.meter__fill.is-hot { background: linear-gradient(90deg, #ff8a1f, var(--hot)); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 10px 12px; border-radius: 3px; background: rgb(255 255 255 / 0.03); border: 1px solid var(--line); min-width: 0; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { display: block; margin-top: 2px; font-size: 18px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
:lang(km) .table th { letter-spacing: 0; text-transform: none; font-size: 13px; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td.wrap-ok { white-space: normal; overflow-wrap: anywhere; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table .gold { color: var(--gold); font-weight: 600; }
.empty { padding: 18px; color: var(--muted); font-size: 14px; text-align: center; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; background: rgb(255 255 255 / 0.06); }
.tag--ok { background: rgb(127 212 155 / 0.14); color: var(--ok); }
.tag--warn { background: rgb(255 194 58 / 0.14); color: var(--gold); }
.tag--bad { background: rgb(249 61 78 / 0.14); color: #ff9aa4; }

/* keys */
.keys { display: grid; gap: 8px; }
.keyrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 3px; border: 1px solid var(--line); background: rgb(255 255 255 / 0.02); min-width: 0; }
.keyrow__main { flex: 1; min-width: 0; }
.keyrow__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keyrow__meta { font-size: 13px; color: var(--muted); }
.keyrow.is-revoked { opacity: 0.5; }
.newkey { padding: 14px; border-radius: 4px; border: 1px solid rgb(127 212 155 / 0.45); background: rgb(127 212 155 / 0.06); }
.newkey__val { display: flex; gap: 8px; margin-top: 10px; }
.newkey__val code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 3px; background: rgb(0 0 0 / 0.6); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 160px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); overflow-y: auto; }
.modal__box { width: 100%; max-width: 640px; animation: pop 0.35s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.pay { display: flex; gap: 24px; align-items: center; }
.pay__side { flex: 1; display: grid; gap: 12px; min-width: 0; }
.pay__amount { font-size: 40px; line-height: 1; }
.pay__state { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pay__steps { display: grid; gap: 6px; font-size: 14px; color: var(--muted); counter-reset: s; }
.pay__steps li { counter-increment: s; padding-left: 26px; position: relative; }
.pay__steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 194 58 / 0.15); color: var(--gold); font-size: 12px; font-weight: 700; }
@media (max-width: 640px) { .pay { flex-direction: column; align-items: center; text-align: center; } .pay__side { justify-items: center; } .pay__steps { text-align: left; } }

/* ABA KHQR card (frame 600x840: card 26..574 x 26..814, red head to y 129, dash at y 302; same as the beta page) */
.khqr { position: relative; flex: none; width: 260px; max-width: 100%; aspect-ratio: 600 / 840; color: #111;
  font-family: "Barlow", system-ui, sans-serif; background: url("/img/khqr-frame.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 14px 28px rgb(0 0 0 / 0.45)); }
.khqr__head { position: absolute; left: 4.33%; right: 4.33%; top: 3.1%; height: 12.26%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 22px; letter-spacing: 0.12em; }
.khqr__name { position: absolute; left: 11.5%; right: 11.5%; top: 18.6%; text-align: left; }
.khqr__name span { display: block; font-weight: 600; letter-spacing: 0.04em; font-size: 12px; color: #333; text-transform: uppercase; }
.khqr__name p { margin-top: 4px; display: flex; align-items: baseline; gap: 6px; }
.khqr__name strong { font-size: 26px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.khqr__name small { font-size: 12px; color: #555; font-weight: 600; }
.khqr__code { position: absolute; left: 19%; right: 19%; top: 40%; aspect-ratio: 1; display: grid; place-items: center; }
.khqr__code img { width: 100%; height: 100%; image-rendering: pixelated; }
.khqr__logo { position: absolute; left: 50%; top: 50%; width: 17%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; background: #e1232e; color: #fff; box-shadow: 0 0 0 3px #fff, 0 1px 3px rgb(0 0 0 / 0.25); }
.khqr__logo svg { width: 62%; height: 62%; }
.khqr__cover { z-index: 1; position: absolute; inset: -4%; display: grid; place-items: center; align-content: center; gap: 8px; background: rgb(255 255 255 / 0.95); font-weight: 600; font-size: 17px; color: #138a4a; }
.khqr__cover .ic { width: 56px; height: 56px; }
.khqr__cover.is-over { color: #777; }
.khqr__timer { position: absolute; left: 4.33%; right: 4.33%; bottom: 5.2%; display: flex; align-items: center; justify-content: center; gap: 5px; color: #666; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; }
.khqr__timer .ic { width: 14px; height: 14px; }
.khqr__timer.is-low { color: #b3261e; }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgb(255 255 255 / 0.2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 64px 16px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 4px; background: #1a120f; border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgb(0 0 0 / 0.6); font-size: 15px; animation: pop 0.3s var(--ease) both; }
.toast.is-bad { border-color: rgb(249 61 78 / 0.6); }

/* ---- docs ---- */
.docs { display: grid; gap: 28px; padding: 28px 0 72px; }
@media (min-width: 1000px) { .docs { grid-template-columns: 220px minmax(0, 1fr); } }
.toc { position: sticky; top: 80px; align-self: start; display: none; font-size: 14px; }
@media (min-width: 1000px) { .toc { display: grid; gap: 6px; } }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--gold); }
.toc .toc__h { margin-top: 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #8f7f74; }
.doc { min-width: 0; }
.doc h1 { font-size: 44px; line-height: 1; }
.doc h2 { margin-top: 44px; padding-top: 8px; font-size: 30px; display: flex; align-items: center; gap: 10px; }
.doc h3 { margin-top: 26px; font-size: 18px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.doc p, .doc ul.list, .doc ol.list { margin-top: 10px; max-width: 72ch; color: #e6d9cd; }
.doc ul.list { list-style: disc; padding-left: 22px; }
.doc ol.list { list-style: decimal; padding-left: 22px; }
.doc ul.list li, .doc ol.list li { margin-top: 4px; }
.doc code { font-family: var(--mono); font-size: 0.88em; padding: 1px 5px; border-radius: 3px; background: rgb(255 255 255 / 0.07); color: #ffd9b0; }
.doc pre { margin-top: 12px; overflow-x: auto; padding: 14px 16px; border-radius: 4px; border: 1px solid var(--line-strong); background: rgb(4 3 3 / 0.92); font-family: var(--mono); font-size: 13px; line-height: 1.55; color: #f0dccb; }
.doc pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.method { display: inline-block; padding: 2px 8px; border-radius: 3px; font-family: var(--mono); font-size: 12px; font-weight: 700; }
.method--get { background: rgb(127 212 155 / 0.16); color: var(--ok); }
.method--post { background: rgb(255 194 58 / 0.16); color: var(--gold); }
.endpoint { font-family: var(--mono); font-size: 15px; }
.doc .table { margin-top: 12px; }
.doc .table td { white-space: normal; }
.tabs { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.tabs button { padding: 6px 12px; border-radius: 3px; font-size: 13px; font-weight: 600; color: var(--muted); background: rgb(255 255 255 / 0.04); border: 1px solid var(--line); }
.tabs button[aria-selected="true"] { color: var(--on-accent); background: var(--fire); border-color: transparent; }
.tabpane pre { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
.hero__notice { margin-top: 18px; max-width: 46ch; }
.section--tight { padding-top: 0; }
.code-title { margin-top: 40px; font-size: 24px; }
.stack { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 979px) { .grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .who-mini { display: none !important; } .topbar__in { gap: 10px; } }
#s-status { margin-bottom: 18px; }
@media (max-width: 560px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: 10px; } }

/* ================= partner app shell (sidebar + pages) ================= */
.app-body { min-height: 100dvh; }
.login-card { margin-top: 24px; }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px;
  background: linear-gradient(180deg, rgb(12 8 7 / 0.97), rgb(6 4 4 / 0.98)); border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgb(222 27 33 / 0.25); overflow-y: auto; z-index: 50;
}
.side__brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 6px; }
.side__close { display: none; width: 36px; height: 36px; place-items: center; border-radius: 3px; color: var(--muted); }
.side__close:hover { color: var(--gold); background: rgb(255 255 255 / 0.05); }
.nav { display: grid; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 3px;
  color: #cdbcae; font-size: 15px; font-weight: 600; transition: background-color 0.2s, color 0.2s;
}
.nav a .ic { width: 20px; height: 20px; color: #8f7f74; transition: color 0.2s; }
.nav a:hover { color: var(--text); background: rgb(255 255 255 / 0.04); }
.nav a:hover .ic { color: var(--accent-hi); }
.nav a[aria-current="page"] {
  color: var(--on-accent); background: var(--fire);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 4px 16px rgb(var(--glow) / 0.35);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.nav a[aria-current="page"] .ic { color: var(--on-accent); }
:lang(km) .nav a { font-family: "Kantumruy Pro", var(--body); font-weight: 600; }
.nav__sep { height: 1px; margin: 8px 6px; background: var(--line); }
.sbal { display: grid; gap: 8px; padding: 12px; border-radius: 4px; border: 1px solid rgb(255 194 58 / 0.25); background: radial-gradient(120% 80% at 0% 0%, rgb(255 122 26 / 0.12), transparent 70%), rgb(4 3 3 / 0.7); }
.sbal__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.sbal__row strong { font-size: 20px; color: var(--text); font-family: var(--display); font-style: italic; font-weight: 800; }
.sbal__row--muted span:last-child { color: #e6d9cd; }
.meter--sm { height: 6px; }
.side__foot { margin-top: auto; display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.side__who { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 4px; }
.side__who img, .side__who .pic { width: 34px; height: 34px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px var(--accent); flex: none; }
.side__who .pic { display: grid; place-items: center; background: linear-gradient(135deg, #8a1c14, #3a120e); color: var(--gold); font-weight: 800; }
.side__who div { min-width: 0; line-height: 1.25; }
.side__who strong, .side__who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__who strong { font-size: 14px; }
.side__who span { font-size: 12px; color: var(--muted); }
.side__tools { display: flex; align-items: center; gap: 6px; }
.side__tools .lang { margin-left: 0; margin-right: auto; }
.side__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 3px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.side__icon:hover { color: var(--gold); box-shadow: inset 0 0 0 1px rgb(255 194 58 / 0.5); }

.main { min-width: 0; padding: 24px 32px 64px; outline: none; }
.pagebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 20px; }
.pagebar__title { font-size: 40px; line-height: 1; }
.pagebar .spacer { flex: 1; }
.pagebar__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.page-note { margin-bottom: 18px; }
.pg { display: grid; gap: 18px; align-content: start; }
.pg > * { min-width: 0; }
.page-foot { margin-top: 2px; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.card { display: grid; gap: 6px; align-content: start; padding: 14px 16px; border-radius: 4px; border: 1px solid var(--line); background: linear-gradient(180deg, rgb(17 13 12 / 0.92), rgb(7 5 5 / 0.95)); min-width: 0; }
.card--hot { border-color: rgb(255 194 58 / 0.35); background: radial-gradient(120% 90% at 0% 0%, rgb(255 122 26 / 0.16), transparent 70%), linear-gradient(180deg, rgb(17 13 12 / 0.92), rgb(7 5 5 / 0.95)); }
.card__label { font-size: 13px; color: var(--muted); }
.card__val { font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist { display: grid; gap: 2px; padding: 8px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 3px; }
.checklist .tick { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; border: 2px solid var(--line-strong); color: transparent; font-weight: 800; font-size: 14px; }
.checklist li.is-done .tick { background: var(--ok); border-color: var(--ok); color: #0b1a10; }
.checklist li.is-done .checklist__t { color: var(--muted); text-decoration: line-through; }
.checklist__t { font-weight: 600; }
.checklist__d { font-size: 13px; color: var(--muted); }
.checklist li > div { flex: 1; min-width: 0; }
.search { position: relative; flex: 1; max-width: 360px; min-width: 0; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search .input { padding: 8px 10px 8px 32px; font-size: 15px; }
.tips { display: grid; gap: 10px; font-size: 15px; color: #e6d9cd; }
.tips li { position: relative; padding-left: 18px; }
.tips li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 7px; height: 7px; background: var(--accent); clip-path: polygon(2px 0, 100% 0, calc(100% - 2px) 100%, 0 100%); }
.profile { display: flex; align-items: center; gap: 14px; }
.profile img, .profile .pic { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 2px var(--accent); flex: none; }
.profile .pic { display: grid; place-items: center; background: linear-gradient(135deg, #8a1c14, #3a120e); color: var(--gold); font-weight: 800; font-size: 24px; }
.profile strong { display: block; font-size: 20px; }
.profile span { color: var(--muted); }
.app-form { margin: 0; }
.appdocs .doc h1 { display: none; }
.appdocs .doc > p:first-of-type { margin-top: 0; }

.mbar { display: none; }
.scrim { position: fixed; inset: 0; z-index: 45; background: rgb(0 0 0 / 0.6); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }

@media (max-width: 899px) {
  .shell { display: block; }
  .mbar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px;
    background: linear-gradient(180deg, rgb(4 3 3 / 0.94), rgb(10 5 5 / 0.9)); box-shadow: inset 0 -1px 0 rgb(222 27 33 / 0.45);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .mbar__menu { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 3px; color: var(--gold); }
  .mbar__menu .ic { width: 24px; height: 24px; }
  .mbar .brand__logo { height: 24px; }
  .mbar__owed { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
  .mbar__owed strong { color: var(--text); font-size: 16px; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-104%); transition: transform 0.3s var(--ease); visibility: hidden; }
  .side.is-open { transform: none; visibility: visible; }
  .side__close { display: grid; }
  .main { padding: 18px 16px 56px; }
  .pagebar__title { font-size: 32px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card__val { font-size: 24px; }
  .search { max-width: none; }
}
@media (min-width: 900px) { .scrim { display: none !important; } }
.table .ok { color: var(--ok); }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } .card__val { font-size: 28px; } }
.doc :not(pre) > code { overflow-wrap: anywhere; word-break: break-word; }
@media (min-width: 1280px) { .card__label { min-height: 2.6em; } }
