/* PusoPay demo — Apple-style type, soft light + dark themes, 3 columns */
:root {
  --acc: #e0393e; --acc2: #2456d6; --ok: #1d9e6b; --bad: #d64545;
  --r: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
}
[data-theme="light"] {
  --bg: #eef1f7; --card: #ffffff; --card2: #f3f5fa; --line: #dde3ef;
  --txt: #1c2333; --muted: #68718c; --out: #f2f4fa; --shadow: 0 10px 30px #2b35521a;
  --phone: #101828; --screen: #ffffff; --screen-txt: #1c2333;
}
[data-theme="dark"] {
  --bg: #2b3044; --card: #363d55; --card2: #414a68; --line: #4f5878;
  --txt: #f0f2fa; --muted: #b9c0d8; --out: #262c42; --shadow: 0 10px 30px #00000055;
  --phone: #141927; --screen: #343b54; --screen-txt: #f0f2fa;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--txt);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  letter-spacing: -0.011em;
}
h1, h2, h3 { letter-spacing: -0.02em; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-logo { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; box-shadow: var(--shadow); }
.brand h1 { margin: 0; font-size: 22px; font-weight: 700; }
.brand p { margin: 0; color: var(--muted); font-size: 12px; }
.pill { font-size: 10px; background: var(--card2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 20px; }
.theme-toggle { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.theme-toggle button { border: none; background: transparent; color: var(--txt); padding: 8px 14px; cursor: pointer; font-weight: 600; font-family: var(--font); }
.theme-toggle button.active { background: var(--txt); color: var(--bg); }

.layout { display: grid; grid-template-columns: 400px minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 0 22px 26px; max-width: 1560px; margin: 0 auto; align-items: start; }
@media (max-width: 1280px) {
  .layout { grid-template-columns: 400px minmax(0, 1fr); }
  .info-col { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
}
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } .info-col { grid-template-columns: 1fr; } }

/* ---- phone ---- */
.app-col { display: grid; gap: 10px; justify-items: center; position: sticky; top: 12px; }
@media (max-width: 860px) { .app-col { position: static; } }
.phone { width: 380px; max-width: 100%; background: var(--phone); border-radius: 44px; padding: 12px; box-shadow: var(--shadow); position: relative; }
.notch { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 130px; height: 26px; background: #000; border-radius: 14px; z-index: 5; }
.statusbar { display: flex; justify-content: space-between; color: #fff; font-size: 12px; padding: 6px 22px 10px; }
.screen { display: none; background: var(--screen); color: var(--screen-txt); border-radius: 34px; padding: 20px 18px 16px; height: 640px; overflow-y: auto; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.screen.active { display: flex; }
.screen h2 { margin: 4px 0; font-size: 21px; font-weight: 700; }
.back { align-self: flex-start; border: none; background: var(--card2); color: var(--txt); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 18px; }
[data-theme="dark"] .back { color: var(--screen-txt); }
.muted { color: var(--muted); font-size: 13px; }
.app-hero { text-align: center; margin-top: 24px; display: grid; gap: 8px; justify-items: center; }
.hero-logo { width: 172px; height: 172px; border-radius: 40px; object-fit: cover; box-shadow: var(--shadow); }
.tagline { color: var(--muted); margin: 0; }
.pbar { height: 6px; background: var(--card2); border-radius: 6px; overflow: hidden; }
.pfill { height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); border-radius: 6px; }
.stepcap { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.btn { border: 1px solid var(--line); background: var(--card2); color: var(--txt); padding: 11px 14px; border-radius: 12px; cursor: pointer; font-weight: 700; font-family: var(--font); font-size: 14px; }
.screen .btn { color: var(--screen-txt); }
.btn.big { width: 100%; padding: 13px; }
.btn.primary { background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #fff; border: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.busy { opacity: .75; cursor: wait; }
.fine { font-size: 11px; color: var(--muted); text-align: center; }
.field { display: flex; align-items: center; gap: 8px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; color: var(--screen-txt); }
.field input, .screen input, .screen select, .screen textarea { background: transparent; border: none; outline: none; color: inherit; font-size: 16px; padding: 10px 0; width: 100%; font-family: var(--font); }
.screen select { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.screen select option { color: #1c2333; }
.screen textarea { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.prefix { font-weight: 800; }
.otp-row { display: flex; gap: 8px; }
.otp-row input { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; text-align: center; font-size: 22px; font-weight: 800; padding: 10px 0; }
.checklist { display: grid; gap: 8px; }
.checklist div { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; font-size: 14px; }
.checklist span { color: var(--muted); font-size: 12px; }
.mini-out { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 11px; white-space: pre-wrap; word-break: break-word; }

/* camera */
.camwrap { display: grid; gap: 8px; }
.camvideo { width: 100%; max-height: 260px; border-radius: 18px; background: #000; display: none; object-fit: cover; }
.camvideo.show { display: block; }
.camvideo.mirror { transform: scaleX(-1); }
.row2 { display: flex; gap: 8px; }
.row2 .btn { flex: 1; }
.uploadlink { font-size: 12px; color: var(--muted); text-align: center; cursor: pointer; }
.id-prevs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.id-prevs .preview { max-height: 110px; }
.preview { width: 100%; max-height: 220px; object-fit: contain; border-radius: 12px; display: none; background: var(--card2); }
.preview.show { display: block; }

.chip { border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 700; background: var(--card2); border: 1px solid var(--line); }
.chip.ok { background: #dff5e9; color: #0c5c3c; border-color: #9adcb9; }
.chip.bad { background: #fde4e4; color: #8f1d1d; border-color: #f0a8a8; }
.tabs { display: flex; gap: 8px; }
.tab { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: inherit; cursor: pointer; font-family: var(--font); font-weight: 600; }
.tab.active { background: var(--screen-txt); color: var(--screen); }
.form { display: grid; gap: 8px; }
.form label { display: grid; gap: 4px; font-size: 11px; color: var(--muted); }
.form input { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font-size: 14px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.res-card { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 14px; }
.res-card.pass { background: #dff5e9; color: #0c5c3c; }
.res-card.pend { background: #fff3d6; color: #7a4d00; }
.w-head { display: flex; justify-content: space-between; align-items: center; }
.w-head h2 { margin: 0; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.kyc-banner { background: #dff5e9; color: #0c5c3c; border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.kyc-banner.pend { background: #fff3d6; color: #7a4d00; }
.tabbar span { cursor: pointer; }
.prof-head { display: flex; gap: 12px; align-items: center; }
.prof-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--card2); border: 2px solid var(--line); }
.prof-id h3 { margin: 0 0 2px; }
.prof-id p { margin: 0 0 6px; }
.prof-list { display: grid; gap: 6px; }
.prof-list .prow { display: flex; justify-content: space-between; gap: 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.prof-list .prow span:first-child { color: var(--muted); }
.balcard { background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #fff; border-radius: 18px; padding: 16px; display: grid; gap: 2px; }
.balcard strong { font-size: 32px; letter-spacing: -0.03em; }
.wnum { font-size: 12px; opacity: .85; }
.w-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.w-grid button { border: 1px solid var(--line); background: var(--card2); color: inherit; border-radius: 14px; padding: 12px 4px; font-size: 20px; cursor: pointer; display: grid; gap: 2px; font-family: var(--font); }
.w-grid span { font-size: 11px; }
.sheet { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.sheet input { background: var(--screen); border: 1px solid var(--line); color: inherit; border-radius: 10px; padding: 10px; font-size: 15px; width: 100%; font-family: var(--font); }
.history { display: grid; gap: 6px; max-height: 150px; overflow: auto; }
.hrow { display: flex; justify-content: space-between; gap: 8px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; }
.tabbar { display: flex; justify-content: space-around; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; color: var(--muted); font-size: 12px; }
.tabbar .on { color: inherit; font-weight: 800; }
.caption { font-size: 12px; color: var(--muted); text-align: center; max-width: 380px; }
.match-inputs { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.match-inputs figure { margin: 0; flex: 1; display: grid; gap: 4px; }
.match-inputs img { width: 100%; height: 110px; object-fit: cover; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.match-inputs img[src=""] { visibility: hidden; }
.match-inputs figcaption { font-size: 11px; color: var(--muted); text-align: center; }
.match-inputs .vs { font-weight: 800; color: var(--muted); }
.sessdata { display: grid; gap: 8px; font-size: 12px; }
.sess-thumbs { display: flex; gap: 8px; }
.sess-thumbs figure { margin: 0; flex: 1; display: grid; gap: 4px; }
.sess-thumbs img { width: 100%; height: 60px; object-fit: contain; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); }
.sess-thumbs figcaption { font-size: 10px; color: var(--muted); text-align: center; }
.detlist { display: grid; gap: 4px; font-size: 12px; }
.detlist div { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.hidden { display: none !important; }

/* ---- columns 2 + 3 ---- */
.console-col, .info-col { display: grid; gap: 14px; align-content: start; position: sticky; top: 12px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 4px; }
@media (max-width: 1280px) { .console-col { position: static; max-height: none; overflow: visible; } .info-col { position: static; max-height: none; overflow: visible; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.card h2 small { font-weight: 400; }
details.card summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::before { content: "▾"; color: var(--muted); font-size: 14px; transition: transform .15s; }
details.card:not([open]) summary::before { transform: rotate(-90deg); }
details.card summary h2 { margin: 0; flex: 1; }
details.card summary + * { margin-top: 10px; }
.card h3 { font-size: 13px; margin: 12px 0 6px; }
.kv { display: flex; gap: 8px; align-items: center; font-size: 12px; margin: 6px 0; flex-wrap: wrap; }
.kv span { width: 110px; color: var(--muted); }
code { background: var(--out); border: 1px solid var(--line); padding: 2px 8px; border-radius: 8px; font-size: 12px; word-break: break-all; }
.row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mini { border: 1px solid var(--line); background: var(--card2); color: var(--txt); border-radius: 8px; padding: 3px 10px; cursor: pointer; font-size: 11px; font-family: var(--font); }
.apilog { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }
.api-row { display: grid; gap: 4px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 12px; cursor: pointer; text-align: left; width: 100%; color: var(--txt); font-family: var(--font); }
.api-row:hover { border-color: var(--acc); }
.api-row .t { display: flex; justify-content: space-between; gap: 8px; }
.badge { font-weight: 800; padding: 1px 8px; border-radius: 12px; font-size: 11px; white-space: nowrap; }
.badge.ok { background: #dff5e9; color: #0c5c3c; }
.badge.bad { background: #fde4e4; color: #8f1d1d; }
.out { background: var(--out); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 80px; white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 300px; overflow: auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.map { display: grid; gap: 8px; margin-top: 6px; }
.map div { display: grid; gap: 2px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 12px; }
.map span { color: var(--muted); }
.tbl { display: grid; gap: 6px; font-size: 12px; }
.trow { display: flex; justify-content: space-between; background: var(--card2); border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; }
.sms { background: #e8f4ff; border: 1px solid #bcd8f5; color: #123; border-radius: 10px; padding: 7px 10px; font-size: 12px; display: grid; gap: 5px; }
[data-theme="dark"] .sms { background: #26314d; border-color: #4f5878; color: #e8ecff; }
.sms-code { font-size: 19px; font-weight: 800; letter-spacing: .25em; text-align: center; border: 1px dashed currentColor; background: transparent; color: inherit; border-radius: 10px; padding: 4px 4px 4px 12px; cursor: copy; font-family: var(--font); user-select: all; }
.sms-code:active { transform: scale(.98); }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }
.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: max-content; max-width: 92vw; }
.toast div { background: var(--txt); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-size: 13px; text-align: center; box-shadow: var(--shadow); }
