/* EcommDataHub Console — design tokens and components (ported 1:1 from the design handoff) */

html, body { margin: 0; padding: 0; }
body {
  font-family: 'Open Sans', 'Public Sans', sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
  --bg: #f4f6f2; --surface: #ffffff; --surface2: #eef1ea; --ink: #141a15; --muted: #63705f; --line: #e0e5da;
  --accent: oklch(0.72 0.18 130); --accent-soft: oklch(0.95 0.05 130); --accent-ink: #0d1f0c;
  --danger: #c2452d; --danger-soft: #fbeae5; --ok: #2c7a3f; --ok-soft: #e4f3e5; --warn: #9a6b12; --warn-soft: #faf0d8;
  --shadow: 0 1px 2px rgba(20,26,21,.05), 0 8px 24px -12px rgba(20,26,21,.12);
  --display: 'Bricolage Grotesque', sans-serif; --mono: 'JetBrains Mono', monospace;
}
body.dark {
  --bg: #0e130f; --surface: #161c16; --surface2: #1e261e; --ink: #e9efe6; --muted: #8fa08c; --line: #283226;
  --accent: oklch(0.78 0.19 130); --accent-soft: oklch(0.32 0.07 130); --accent-ink: #0d1f0c;
  --danger: #e06a4f; --danger-soft: #3a221b; --ok: #6cc47e; --ok-soft: #1d2f20; --warn: #d9a83f; --warn-soft: #332a15;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
}
a { color: var(--accent); text-decoration: none; } a:hover { color: var(--ink); }
input, select, button, textarea { font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { color: inherit; }
code, pre { font-family: var(--mono); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.dd .chev { transition: transform .15s; }
.dd.open .chev { transform: scaleY(-1); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
::selection { background: var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { height: 5px; width: 8px; } ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; } ::-webkit-scrollbar-track { background: transparent; }
pre::-webkit-scrollbar-thumb { background: #2e3b2e; }

.fade { animation: fadeUp .35s ease both; }
.fade-slow { animation: fadeUp .4s ease both; }
.display { font-family: var(--display); font-weight: 700; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.tnum { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; } .mt-18 { margin-top: 18px; }
.mb-8 { margin-bottom: 8px; } .mb-14 { margin-bottom: 14px; } .mb-16 { margin-bottom: 16px; }
.text-12 { font-size: 12px; } .text-13 { font-size: 13px; } .text-14 { font-size: 14px; }
.spin { animation: spin .7s linear infinite; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 48px; background: linear-gradient(160deg, oklch(0.25 0.06 140), oklch(0.16 0.04 150)); color: #e9efe6; }
.auth-brand .logo-row { display: flex; align-items: center; gap: 10px; }
.auth-brand .logo-row img { width: 34px; height: 34px; display: block; }
.auth-brand .wordmark { font-family: var(--display); font-weight: 700; font-size: 18px; }
.auth-brand .wordmark span { color: #8fd14f; }
.auth-headline { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1.1; max-width: 420px; text-wrap: pretty; }
.auth-sub { margin-top: 16px; color: #a9bba5; font-size: 15px; max-width: 400px; line-height: 1.6; }
.auth-stats { display: flex; gap: 24px; font-size: 13px; color: #a9bba5; }
.auth-side { display: grid; place-items: center; padding: 48px; }
.auth-form { width: 100%; max-width: 360px; animation: fadeUp .4s ease both; }
.auth-title { font-family: var(--display); font-size: 26px; font-weight: 700; }
.auth-lead { color: var(--muted); font-size: 14px; margin: 6px 0 28px; }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.label-sm { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.label-xs { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.input { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px; }
.input-card { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 13px; }
.input-modal { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 14px; }
.input-error { border-color: var(--danger) !important; }
.auth-meta { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 22px; font-size: 13px; }
.check-btn { display: flex; gap: 8px; align-items: center; color: var(--muted); background: none; border: none; padding: 0; cursor: pointer; font-size: 13px; }
.check-btn:hover { color: var(--ink); }
.check-box { width: 16px; height: 16px; box-sizing: border-box; border-radius: 5px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; flex-shrink: 0; border: 2px solid var(--muted); background: var(--surface); color: transparent; }
.check-box.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.captcha { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface2); margin-bottom: 18px; min-height: 62px; }
.captcha-widget { min-height: 78px; margin-bottom: 18px; display: flex; justify-content: flex-start; }
.captcha-widget.off { display: none; }
.btn-auth { width: 100%; padding: 12px; border: none; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px; cursor: pointer; }
.btn-auth:hover { filter: brightness(1.06); }
.btn-auth:disabled { opacity: .6; cursor: default; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth-success { width: 100%; max-width: 360px; animation: fadeUp .4s ease both; text-align: center; }
.ok-circle { width: 52px; height: 52px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 18px; font-size: 22px; font-weight: 800; }
.auth-success .title { font-family: var(--display); font-size: 22px; font-weight: 700; }
.auth-success .sub { color: var(--muted); font-size: 14px; margin: 8px 0 24px; line-height: 1.6; }
.form-error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 14px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; background: var(--bg); }
.side { width: 232px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; box-sizing: border-box; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 20px 18px; }
.side-logo img { width: 30px; height: 30px; display: block; }
.side-logo .wordmark { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1; }
.side-logo .wordmark span { color: var(--accent); }
.side-logo .sub { font-size: 10px; letter-spacing: .14em; color: var(--muted); margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1; }
.nav-btn { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: none; border-radius: 8px; font-size: 13.5px; text-align: left; cursor: pointer; width: 100%; font-weight: 600; background: none; color: var(--muted); }
.nav-btn:hover { background: var(--surface2); }
.nav-btn.active { background: var(--accent-soft); color: var(--ink); }
.side-foot { padding: 8px 10px; }
.side-link { display: flex; align-items: center; gap: 11px; width: 100%; box-sizing: border-box; padding: 9px 12px; border: none; border-radius: 8px; background: none; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; text-align: left; text-decoration: none; }
.side-link:hover { background: var(--surface2); color: var(--ink); }
.side-user { padding: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--accent); border: 1px solid var(--line); flex-shrink: 0; }
.side-user .name { font-size: 13px; font-weight: 600; }
.side-user .email { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { border: none; background: none; color: var(--muted); cursor: pointer; padding: 4px; display: grid; place-items: center; }
.icon-btn:hover { color: var(--ink); }
.icon-btn.danger:hover { color: var(--danger); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.page-title { font-family: var(--display); font-size: 20px; font-weight: 700; }
.top-right { display: flex; align-items: center; gap: 12px; }
.pill-ok { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); background: var(--ok-soft); padding: 5px 10px; border-radius: 99px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.pill-subs { font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--ink); padding: 5px 10px; border-radius: 99px; }
.wallet-chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); cursor: pointer; color: var(--ink); flex-shrink: 0; }
.wallet-chip:hover { background: var(--surface2); }
.wallet-chip .cr { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.wallet-chip .usd { font-size: 12px; color: var(--muted); white-space: nowrap; }
.top-icon { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 8px; cursor: pointer; display: grid; place-items: center; position: relative; }
.top-icon:hover { background: var(--surface2); }
.badge-count { position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 800; display: grid; place-items: center; padding: 0 3px; box-sizing: border-box; }
.backdrop { position: fixed; inset: 0; z-index: 39; }
.notif-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 330px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 40; overflow: hidden; animation: fadeUp .18s ease both; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-head .t { font-size: 13px; font-weight: 700; }
.link-btn { border: none; background: none; color: var(--accent); font-size: 11.5px; font-weight: 700; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--ink); }
.notif-row { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.notif-row.unread { background: var(--accent-soft); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--line); }
.notif-row.unread .notif-dot { background: var(--accent); }
.notif-row .t { display: block; font-size: 12.5px; font-weight: 600; }
.notif-row .s { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.notif-row .time { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.notif-empty { padding: 22px 14px; font-size: 12.5px; color: var(--muted); text-align: center; }
.content { padding: 28px 32px; max-width: 1280px; width: 100%; box-sizing: border-box; }

/* ---------- primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card-p { padding: 22px; }
.card-p20 { padding: 20px; }
.card-title { font-family: var(--display); font-size: 17px; font-weight: 700; }
.card-title-16 { font-family: var(--display); font-size: 16px; font-weight: 700; }
.card-title-15 { font-family: var(--display); font-size: 15px; font-weight: 700; }
.btn { padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.btn:hover { background: var(--surface2); }
.btn-primary { border: none; background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn-danger { background: none; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-xs { padding: 8px 14px; font-size: 12px; }
.btn-secondary-muted { color: var(--muted); font-weight: 600; }
.btn-ghost { border: none; background: none; color: var(--muted); font-weight: 500; }
.btn-ghost:hover { color: var(--ink); background: none; }
.btn:disabled { opacity: .7; cursor: default; }
.btn-block { width: 100%; box-sizing: border-box; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.muted { background: var(--surface2); color: var(--muted); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { padding: 8px 14px; border: none; font-size: 12.5px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--muted); }
.seg button.active { background: var(--accent); color: var(--accent-ink); }
.seg.full button { flex: 1; padding: 9px 0; }
.dd { position: relative; }
.dd-btn { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.dd-btn:hover { background: var(--surface2); }
.dd-btn.block { width: 100%; box-sizing: border-box; justify-content: space-between; padding: 9px 12px; background: var(--bg); }
.dd-btn.block:hover { background: var(--surface2); }
.dd-btn.modal { width: 100%; box-sizing: border-box; justify-content: space-between; padding: 10px 12px; background: var(--bg); font-size: 14px; font-weight: 500; }
.dd-btn.card-bg { background: var(--bg); }
.dd-btn.sm { padding: 6px 12px; font-size: 12.5px; font-weight: 700; }
.dd-btn.sm2 { padding: 7px 12px; font-size: 12.5px; }
.dd-menu { position: absolute; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; z-index: 30; animation: fadeUp .18s ease both; }
.dd-menu.right { right: 0; } .dd-menu.left { left: 0; } .dd-menu.block { left: 0; right: 0; min-width: 0; top: calc(100% + 4px); } .dd-menu.up { top: auto; bottom: calc(100% + 4px); }
.dd-menu.scroll { max-height: 180px; overflow-y: auto; }
.dd-menu.searchable { display: flex; flex-direction: column; max-height: 260px; overflow: hidden; }
.dd-menu.searchable .dd-items { overflow-y: auto; min-height: 0; }
.dd-menu.up.searchable { flex-direction: column; }
.dd-search { padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface); flex-shrink: 0; }
.dd-search input { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); font-size: 12.5px; }
.dd-empty { padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.dd-menu.sm { min-width: 140px; top: calc(100% + 4px); }
.dd-item { display: block; width: 100%; box-sizing: border-box; text-align: left; padding: 9px 14px; border: none; font-size: 13px; cursor: pointer; background: var(--surface); color: var(--ink); }
.dd-item:hover { background: var(--surface2); }
.dd-item.active { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.dd-item.p12 { padding: 9px 12px; }
.dd-item.sm { padding: 8px 12px; font-size: 12.5px; }
.dd-item.tile { display: flex; align-items: center; gap: 8px; padding: 9px 12px; }
.chev { width: 12px; height: 12px; flex-shrink: 0; }
.toggle { width: 42px; height: 24px; border-radius: 99px; border: none; cursor: pointer; position: relative; transition: background .2s; background: var(--line); padding: 0; flex-shrink: 0; }
.toggle.on { background: var(--accent); }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); display: block; }
.toggle.on .knob { left: 21px; }
.tile { border-radius: 6px; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.tile-sm { width: 20px; height: 20px; font-size: 10.5px; }
.tile-lg { width: 44px; height: 44px; border-radius: 10px; font-family: var(--display); font-size: 18px; }
.tile.dim { opacity: .55; }
.table-head { display: grid; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.table-row { display: grid; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: center; font-size: 13px; }
.table-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-side .loading { display: flex; align-items: center; gap: 10px; }
.auth-side .loading[hidden] { display: none; }
.auth-home { position: fixed; top: 18px; right: 18px; z-index: 10; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.auth-home:hover { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }
.table-scroll { overflow: hidden; }
.table-inner.is-refreshing, .is-refreshing { opacity: .35; pointer-events: none; transition: opacity .15s; }
.table-refreshing { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 72px; gap: 8px; z-index: 3; font-size: 13px; color: var(--muted); }
.code-block { font-family: var(--mono); font-size: 12px; background: #101710; color: #c9e4b4; border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 0; line-height: 1.6; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.eyebrow-sm { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.eyebrow-xs { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.copy-btn { display: flex; align-items: center; gap: 5px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--muted); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.copy-btn:hover { color: var(--ink); border-color: var(--accent); }
.tab-pill { padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 11.5px; font-weight: 700; cursor: pointer; background: var(--surface); color: var(--muted); }
.tab-pill.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab-pill:hover { filter: brightness(1.04); }
.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; margin-right: 8px; }

/* ---------- overview ---------- */
.ov-scope { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; animation: fadeUp .3s ease both; position: relative; z-index: 20; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; animation: fadeUp .35s ease both; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--display); font-size: 27px; font-weight: 700; margin-top: 8px; }
.stat .d { font-size: 12px; margin-top: 6px; color: var(--muted); }
.stat .d.ok { color: var(--ok); font-weight: 600; }
.chart-card { padding: 22px; margin-top: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.chart-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.chart { display: flex; gap: 10px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font-size: 10.5px; color: var(--muted); text-align: right; min-width: 36px; font-variant-numeric: tabular-nums; }
.chart-area { flex: 1; position: relative; }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.gridline.base { border-top-style: solid; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; position: relative; }
.bar { flex: 1; background: var(--accent); opacity: .55; border-radius: 3px 3px 0 0; transition: opacity .15s; cursor: default; position: relative; z-index: 1; }
.bar:hover { opacity: 1; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 8px; }
.usage-rows { display: flex; flex-direction: column; gap: 16px; }
.usage-row .h { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.usage-row .h .n { font-weight: 600; }
.usage-row .track { height: 8px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.usage-row .fill { height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- keys ---------- */
.keys-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; animation: fadeUp .35s ease both; }
.keys-intro { font-size: 14px; color: var(--muted); max-width: 520px; line-height: 1.6; }
.keys-usage { font-size: 12px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.fresh-key { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.fresh-key .t { font-weight: 700; font-size: 14px; }
.fresh-key .s { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.fresh-key code { font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; flex: 1; overflow-x: auto; white-space: nowrap; }
.keys-grid { grid-template-columns: 1.2fr 1.6fr .8fr .8fr .7fr 40px; }
.key-name { display: block; font-weight: 600; }
.key-scopes { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-code { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-code.revealed { color: var(--ink); }
.tiny-btn { border: none; background: none; color: var(--muted); cursor: pointer; padding: 2px; flex-shrink: 0; display: grid; place-items: center; }
.tiny-btn:hover { color: var(--ink); }
.chip { padding: 7px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.chip:hover { filter: brightness(1.03); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }

/* ---------- logs ---------- */
.logs-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; animation: fadeUp .35s ease both; position: relative; z-index: 20; }
.logs-grid { grid-template-columns: .9fr 2fr 1fr .6fr .6fr .6fr .9fr; }
.logs-grid.table-row { padding: 11px 18px; }
.log-ep { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-ep .m { color: var(--accent); font-weight: 600; }
.log-key { font-family: var(--mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-more { padding: 12px; text-align: center; }

/* ---------- plans ---------- */
.topup-card { padding: 22px; margin: 0 0 16px; }
.topup-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.topup-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pack-btn { padding: 10px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13px; cursor: pointer; }
.pack-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.svc-list { display: flex; flex-direction: column; gap: 12px; animation: fadeUp .35s ease both; }
.svc-card { overflow: hidden; }
.svc-row { display: grid; grid-template-columns: 44px 1.7fr 1fr 1fr .7fr auto; gap: 14px; align-items: center; padding: 15px 18px; }
.svc-row .n { font-size: 14.5px; font-weight: 700; }
.svc-row .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.svc-row .renew { font-size: 11px; color: var(--muted); margin-top: 5px; }
.svc-row .usage { font-size: 12.5px; color: var(--muted); }
.svc-row .cost { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.svc-btn { padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.svc-btn:hover { filter: brightness(1.04); }
.svc-btn.open { border: 1px solid var(--line); background: var(--surface2); color: var(--ink); }
.svc-btn.manage { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.svc-btn.subscribe { border: none; background: var(--accent); color: var(--accent-ink); }
.badge-plan { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.badge-plan.on { background: var(--ok-soft); color: var(--ok); }
.badge-plan.off { background: var(--surface2); color: var(--muted); }
.svc-panel { border-top: 1px solid var(--line); background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
/* plan cards — horizontal snap slider */
.plan-slider { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.plan-card { flex: 0 0 300px; box-sizing: border-box; display: flex; flex-direction: column; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; scroll-snap-align: start; }
.plan-card.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-card.invited { border: 1.5px dashed var(--warn); background: linear-gradient(160deg, var(--warn-soft), var(--surface) 45%); }
.plan-card.custom { border: 1.5px dashed var(--accent); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 45%); }
.pc-name { font-weight: 800; font-size: 15px; }
.pc-price { font-family: var(--display); font-size: 24px; font-weight: 700; }
.pc-per { font-size: 12px; color: var(--muted); font-weight: 600; }
.pc-meta { font-size: 12.5px; color: var(--muted); }
.pc-feat { font-size: 12px; color: var(--muted); line-height: 1.6; }
.pc-lims { display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.pc-lim b { color: var(--ink); font-weight: 600; }
.pc-bar { height: 4px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.pc-bar span { display: block; height: 100%; }
.pc-used { font-size: 10.5px; margin-top: 2px; }
.pc-btn { margin-top: auto; width: 100%; text-align: center; }
.pc-custom-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 14px 18px; border: 1.5px dashed var(--accent); border-radius: 12px; background: linear-gradient(120deg, var(--accent-soft), var(--surface) 55%); cursor: pointer; text-align: left; font-family: inherit; color: var(--ink); }
.pc-custom-cta:hover { filter: brightness(1.03); }
.pc-custom-cta b { font-size: 13.5px; }
.pc-custom-cta .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pc-custom-cta .go { flex-shrink: 0; font-weight: 800; font-size: 13px; color: var(--accent-ink); background: var(--accent); padding: 9px 16px; border-radius: 9px; white-space: nowrap; }
/* plan policies — spreadsheet layout, merged layer cells */
.ptx { display: grid; grid-template-columns: minmax(170px, 1.1fr) repeat(3, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 12px; min-width: 640px; }
.ptx > div { background: var(--surface); padding: 9px 12px; }
.ptx-h { font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--bg); padding: 7px 12px; }
.ptx-ep { display: flex; flex-direction: column; justify-content: center; }
.ptx-ep .t { display: block; font-weight: 700; font-size: 12.5px; }
.ptx-ep .p { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptx-c { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.ptx-s { color: var(--ink); line-height: 1.55; }
.ptx-u .pc-used { font-size: 10px; }

.mx-grp { display: block; font-size: 9.5px; color: var(--muted); margin-top: 2px; cursor: help; }
.mx-grp.mx-hard { color: var(--warn); }
.pc-sec-t { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.pc-more { border: none; background: none; padding: 0; text-align: left; font-size: 12px; font-weight: 700; color: var(--accent-ink); cursor: pointer; align-self: flex-start; }
body.dark .pc-more { color: var(--accent); }
.plan-tag.gf { background: var(--accent-soft); color: var(--accent-ink); cursor: help; }
body.dark .plan-tag.gf { color: var(--accent); }
.pc-more:hover { text-decoration: underline; }
.key-scopes-btn { border: none; background: none; padding: 0; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 4px; }
.key-scopes-btn:hover { color: var(--ink); text-decoration: underline; }
.units-note { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg); font-size: 11px; color: var(--muted); line-height: 1.6; }
.pt-panel { background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 16px 18px; animation: fadeUp .2s ease both; }
.pt-x { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 7px; width: 26px; height: 26px; cursor: pointer; flex-shrink: 0; }
.pt-x:hover { color: var(--danger); border-color: var(--danger); }
.pt-cols { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.pt-list { flex: 0 1 300px; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.pt-ep { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 11px; cursor: pointer; color: var(--ink); font-family: inherit; }
.pt-ep:hover { background: var(--surface2); }
.pt-ep.sel { border-color: var(--accent); background: var(--accent-soft); }
.pt-ep .t { display: block; font-size: 12.5px; font-weight: 700; }
.pt-ep .p, .pt-detail .p { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-rate { font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pt-detail { flex: 1 1 340px; min-width: 280px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; align-self: flex-start; }
.pt-fact { display: flex; align-items: baseline; gap: 12px; font-size: 12.5px; }
.pt-fact .k { flex: 0 0 92px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pt-fact .v { min-width: 0; line-height: 1.6; }
.pt-src { font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px; white-space: nowrap; vertical-align: 1px; }
.pt-eps { font-size: 12.5px; font-weight: 700; }

.plan-row { display: grid; grid-template-columns: 1.1fr .6fr .9fr 1.8fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px; }
.plan-row.current { border-color: var(--accent); }
.plan-row.invited { background: linear-gradient(100deg, var(--warn-soft), var(--surface) 55%); border: 1.5px dashed var(--warn); }
.plan-row.custom { background: linear-gradient(100deg, var(--accent-soft), var(--surface) 55%); border: 1.5px dashed var(--accent); }
.plan-name { font-family: var(--display); font-size: 15px; font-weight: 700; white-space: nowrap; }
.plan-tag { font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 3px 8px; border-radius: 99px; white-space: nowrap; background: var(--accent); color: var(--accent-ink); }
.plan-tag.invited { background: var(--warn-soft); color: var(--warn); }
.plan-tag.black { background: var(--ink); color: var(--bg); }
.plan-price { font-family: var(--display); font-size: 17px; font-weight: 700; }
.plan-per { font-size: 12px; color: var(--muted); }
.plan-quota { font-size: 12.5px; color: var(--muted); }
.plan-rps { font-size: 11px; color: var(--muted); opacity: .8; margin-top: 2px; }
.plan-feat { font-size: 12px; color: var(--muted); line-height: 1.55; }
.plan-btn { padding: 9px 14px; border-radius: 8px; font-weight: 700; font-size: 12.5px; white-space: nowrap; justify-self: end; cursor: pointer; }
.plan-btn.current { border: 1px solid var(--line); background: var(--surface2); color: var(--muted); cursor: default; }
.plan-btn.primary { border: none; background: var(--accent); color: var(--accent-ink); }
.plan-btn.primary:hover { filter: brightness(1.06); }
.plan-btn.secondary { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.plan-btn.secondary:hover { background: var(--surface2); }
.plan-btn.amber { border: none; background: var(--warn); color: #fff; }
.plan-btn.amber:hover { filter: brightness(1.06); }
.plan-btn.outline { border: 1px solid var(--accent); background: none; color: var(--ink); }
.plan-btn.outline:hover { background: var(--accent-soft); }
.rates { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rates-title { padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 700; }
.rates-title span { color: var(--muted); font-weight: 500; }
.rates-head { display: grid; gap: 12px; padding: 8px 16px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.rates-head .c { text-align: right; color: var(--muted); padding: 0 10px; box-sizing: border-box; }
.rates-head .c.hi { color: var(--ink); background: var(--accent-soft); display: block; margin: -8px 0; padding: 8px 10px; }
.rates-row { display: grid; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); align-items: center; font-size: 12.5px; }
.rates-row:last-child { border-bottom: none; }
.rates-row .ep { min-width: 0; overflow: hidden; }
.rates-row .ep .t { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rates-row .ep .p { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rates-row .c { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); padding: 0 10px; box-sizing: border-box; }
.rates-row .c.hi { font-weight: 700; color: var(--ink); background: var(--accent-soft); align-self: stretch; display: flex; flex-direction: column; justify-content: center; margin: -9px 0; padding: 9px 10px; }

.rates-row .c .v { display: block; white-space: nowrap; }
.rates-row .c .cap { display: block; font-size: 10.5px; opacity: .7; margin-top: 1px; font-weight: 500; white-space: nowrap; }
.cancel-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; padding: 0 2px; }
.cancel-foot .n { font-size: 12px; color: var(--muted); line-height: 1.6; }
.cancel-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; padding: 10px 14px; background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 10px; }
.cancel-banner .n { font-size: 12px; color: var(--ink); line-height: 1.6; }

/* ---------- checkout ---------- */
.co { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; animation: fadeUp .35s ease both; max-width: 1000px; }
.co-summary { order: 2; flex: 1 1 300px; min-width: 280px; padding: 24px; }
.co-pay { flex: 1.2 1 360px; padding: 22px; }
.co-title { font-family: var(--display); font-size: 24px; font-weight: 700; margin-top: 6px; }
.co-chips { display: flex; align-items: center; gap: 10px; margin: 14px 0 18px; font-size: 13px; }
.co-chips .from { padding: 4px 10px; border-radius: 99px; background: var(--surface2); color: var(--muted); font-weight: 600; }
.co-chips .to { padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--ink); font-weight: 700; white-space: nowrap; }
.co-chips .q { color: var(--muted); font-size: 12px; }
.co-feats { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.co-feats div { display: flex; gap: 8px; align-items: baseline; }
.co-feats .tick { color: var(--accent); font-weight: 700; }
.co-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.7; }
.pay-opts { display: flex; flex-direction: column; gap: 8px; }
.pay-opt { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); }
.pay-opt:hover { border-color: var(--accent); }
.pay-opt.active { border-color: var(--accent); background: var(--accent-soft); }
.radio { width: 14px; height: 14px; border-radius: 50%; box-sizing: border-box; flex-shrink: 0; border: 2px solid var(--muted); }
.pay-opt.active .radio { border: 4.5px solid var(--accent); }
.pay-opt .l { display: block; font-size: 13px; font-weight: 600; }
.pay-opt .s { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.new-card { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.new-card .input-card, .new-card .stripe-el { margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-num-wrap { position: relative; }
.card-num-wrap input { padding-right: 86px; }
.card-brand-tag { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 9.5px; font-weight: 800; letter-spacing: .08em; color: var(--muted); background: var(--surface2); padding: 3px 7px; border-radius: 5px; pointer-events: none; }
.card-brand-tag.ok { color: var(--ok); background: var(--ok-soft); }
.new-card .card-num-wrap { margin-bottom: 10px; }
.grid-2.addr { grid-template-columns: 1.2fr .8fr; }
.stripe-el { box-sizing: border-box; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-height: 38px; }
.stripe-el.modal { padding: 11px 12px; min-height: 40px; }
.topup-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.topup-chip { padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.topup-chip:hover { border-color: var(--accent); }
.topup-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.topup-input { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 14px; font-family: var(--mono); border: 1px solid var(--line); }
.topup-hint { font-size: 11.5px; margin-top: 6px; color: var(--muted); }
.topup-hint.err { color: var(--danger); font-weight: 700; }
.co-lines { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.co-lines div { display: flex; justify-content: space-between; }
.co-lines .due { padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.co-confirm { width: 100%; margin-top: 16px; padding: 12px; border: none; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.co-confirm:hover { filter: brightness(1.06); }
.co-confirm:disabled { opacity: .7; cursor: default; }
.co-cancel { width: 100%; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.co-cancel:hover { background: var(--surface2); }

/* ---------- playground ---------- */
.pg { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; animation: fadeUp .35s ease both; }
.pg-index { padding: 10px; position: sticky; top: 86px; }
.pg-svc-btn { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.pg-svc-btn:hover { background: var(--surface2); }
.pg-svc-btn .n { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-search { width: 100%; box-sizing: border-box; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 12.5px; margin-bottom: 8px; }
.pg-list { display: flex; flex-direction: column; gap: 1px; }
.pg-ep { display: block; width: 100%; box-sizing: border-box; text-align: left; padding: 8px 10px; border: none; border-radius: 7px; cursor: pointer; background: none; }
.pg-ep:hover { background: var(--surface2); }
.pg-ep.active { background: var(--accent-soft); }
.pg-ep .t { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.pg-ep .p { display: block; font-size: 11px; font-family: var(--mono); margin-top: 2px; color: var(--muted); }
.pg-ep.active .p { color: var(--ink); opacity: .75; }
.pg-foot { font-size: 11px; color: var(--muted); padding: 8px 10px 2px; }
.pg-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.verb { font-size: 11px; font-weight: 800; letter-spacing: .06em; background: var(--accent-soft); color: var(--ink); padding: 4px 9px; border-radius: 6px; }
.doc-path { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.doc-rate { font-size: 12px; color: var(--muted); margin-left: auto; }
.doc-desc { font-size: 13.5px; color: var(--muted); margin: 10px 0 16px; line-height: 1.6; }
.snip-bar { display: flex; align-items: center; gap: 9px; width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); color: var(--ink); font-size: 12.5px; font-weight: 700; cursor: pointer; text-align: left; }
.snip-bar:hover { background: var(--surface); }
.snip-bar .sym { font-family: var(--mono); font-size: 11px; color: var(--accent); font-weight: 700; }
.snip-bar .langs { font-size: 11px; color: var(--muted); font-weight: 500; }
.auth-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.auth-note code { font-size: 11.5px; }
.params-row { display: grid; grid-template-columns: 1fr .8fr 2fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; font-size: 13px; }
.params-row code { font-size: 12.5px; font-weight: 600; }
.req-pill { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--surface2); color: var(--muted); }
.req-pill.req { background: var(--warn-soft); color: var(--warn); }
.play-bar { display: flex; gap: 8px; align-items: stretch; margin-bottom: 16px; }
.play-verb { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.play-url { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-family: var(--mono); font-size: 12px; overflow-x: auto; white-space: nowrap; color: var(--muted); }
.play-send { padding: 10px 20px; border: none; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.play-send:hover { filter: brightness(1.06); }
.play-send:disabled { opacity: .7; }
.auth-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); }
.auth-row .k { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.auth-row .v { font-family: var(--mono); font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-row .dd-btn { background: var(--surface); }
.auth-row .dd-btn:hover { background: var(--bg); }
.play-param { display: grid; grid-template-columns: 150px 1fr 72px; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.play-param code { font-size: 12.5px; font-weight: 600; }
.play-param input { width: 100%; box-sizing: border-box; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 12.5px; font-family: var(--mono); }
.resp-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ok); }
.resp-meta.bad { color: var(--danger); } .resp-meta.bad .dot { background: var(--danger); }
.resp-meta.warn { color: var(--warn); } .resp-meta.warn .dot { background: var(--warn); }

/* ---------- billing ---------- */
.billing { display: grid; grid-template-columns: 1fr 300px; gap: 16px; animation: fadeUp .35s ease both; align-items: start; }
.inv-grid { grid-template-columns: 1fr 1.4fr .8fr .8fr .6fr; }
.inv-grid.table-row { padding: 13px 18px; }
.billing-col { display: flex; flex-direction: column; gap: 16px; }
.pm-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.pm-card.primary { background: var(--surface2); }
.pm-card .h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.pm-card .slot { font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.pm-card.primary .slot { color: var(--accent); }
.pm-card .act { border: none; background: none; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; color: var(--muted); }
.pm-card.primary .act { color: var(--accent); }
.pm-card .act:hover { color: var(--ink); }
.pm-card .act.danger { color: var(--danger); }
.pm-card .body { display: flex; align-items: center; gap: 12px; }
.card-brand { width: 38px; height: 26px; border-radius: 5px; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: 700; background: linear-gradient(135deg, #2a3f8f, #1a2a6a); flex-shrink: 0; }
.card-brand.secondary { background: linear-gradient(135deg, #3a3f47, #22252b); font-size: 8.5px; }
.pm-card .num { font-size: 13px; font-weight: 600; font-family: var(--mono); }
.pm-card .exp { font-size: 11px; color: var(--muted); }
.dashed-btn { width: 100%; box-sizing: border-box; padding: 11px; border: 1.5px dashed var(--line); border-radius: 10px; background: none; color: var(--muted); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.dashed-btn.lg { padding: 14px; font-size: 13px; }
.dashed-btn:hover { border-color: var(--accent); color: var(--ink); }
.next-inv { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.7; }
.next-inv b { color: var(--ink); }
.access-rows { display: flex; flex-direction: column; gap: 11px; }
.access-rows .r { display: flex; justify-content: space-between; align-items: center; }
.access-rows .n { font-size: 13px; font-weight: 600; }

/* ---------- settings ---------- */
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 640px; animation: fadeUp .35s ease both; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: 1 / -1; }
.settings-row { display: flex; justify-content: space-between; align-items: center; }
.settings-row .t { font-size: 13.5px; font-weight: 600; }
.settings-row .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sep-top { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger-card { background: var(--surface); border: 1px solid var(--danger); border-radius: 12px; padding: 22px; }
.danger-card .t { font-family: var(--display); font-size: 16px; font-weight: 700; color: var(--danger); }
.danger-card .s { font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.twofa-box { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.twofa-box .secret { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; word-break: break-all; margin: 8px 0; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.recovery-grid code { font-size: 13px; letter-spacing: .06em; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; text-align: center; }
.device-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.device-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.qr { display: inline-block; width: 168px; height: 168px; margin: 10px 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; overflow: hidden; } .qr svg { width: 100%; height: 100%; display: block; }

/* ---------- modals ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10,14,10,.5); display: grid; place-items: center; z-index: 50; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px; width: 380px; max-width: calc(100vw - 40px); box-sizing: border-box; box-shadow: var(--shadow); animation: fadeUp .25s ease both; position: relative; max-height: calc(100vh - 40px); overflow-y: auto; }
.modal.w440 { width: 440px; } .modal.w540 { width: 540px; }
.modal-title { font-family: var(--display); font-size: 18px; font-weight: 700; }
.modal-title.danger { color: var(--danger); }
.modal-sub { font-size: 13px; color: var(--muted); margin: 6px 0 18px; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; }
.modal-actions .btn { flex: 1; padding: 10px; }
.modal-actions .btn-primary.wide { flex: 1.2; }
.modal-close { position: absolute; top: 14px; right: 14px; border: none; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.modal-close:hover { background: var(--surface2); color: var(--ink); }
.scope-hint { font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.warn-box { background: var(--danger-soft); border: 1px solid var(--danger); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--ink); line-height: 1.6; margin-bottom: 16px; }
.textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 13.5px; font-family: inherit; resize: vertical; }
.textarea.code { background: #101710; color: #c9e4b4; font-size: 12px; font-family: var(--mono); line-height: 1.6; white-space: pre; }
.attach-btn { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; padding: 8px 14px; border: 1.5px dashed var(--line); border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.attach-btn:hover { border-color: var(--accent); color: var(--ink); }
.sent { text-align: center; padding: 26px 10px; }
.sent .ok-circle { width: 54px; height: 54px; font-size: 24px; margin-bottom: 16px; }
.sent .t { font-family: var(--display); font-size: 20px; font-weight: 700; }
.sent .s { font-size: 13.5px; color: var(--muted); margin: 8px 0 4px; line-height: 1.6; }
.sent .ref { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.modal .grid-2 { gap: 12px; }

/* invoice viewer */
.inv-overlay { position: fixed; inset: 0; background: rgba(10,14,10,.6); overflow-y: auto; z-index: 50; }
.inv-wrap { max-width: 640px; margin: 32px auto; padding: 0 16px; }
.inv-paper { background: #fff; color: #141a15; border-radius: 10px 10px 0 0; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); overflow: hidden; }
.inv-paper table { font-family: 'Open Sans', 'Public Sans', sans-serif; }
.inv-foot { display: flex; justify-content: flex-end; gap: 8px; background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding: 14px 20px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: 10px; font-size: 13.5px; font-weight: 600; z-index: 60; animation: toastIn .25s ease both; box-shadow: var(--shadow); max-width: calc(100vw - 40px); box-sizing: border-box; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hide-sm { display: none !important; }
  .hide-xs { display: none !important; }
  .billing, .pg { grid-template-columns: 1fr !important; }
  .pg-index { position: static; }
  .top { padding: 14px 20px; gap: 10px; flex-wrap: wrap; }
  .plan-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: start; }
  .plan-row > div:nth-child(3), .plan-row > div:nth-child(4) { grid-column: 1 / -1; }
  .plan-row > button { grid-column: 1 / -1; justify-self: stretch; margin-top: 4px; }
  .svc-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px 12px; align-items: center; }
  .svc-row > div:nth-child(1) { grid-row: 1; grid-column: 1; }
  .svc-row > div:nth-child(2) { grid-row: 1; grid-column: 2; }
  .svc-row > div:nth-child(5) { grid-row: 1; grid-column: 3; }
  .svc-row > div:nth-child(3) { grid-row: 2; grid-column: 2 / -1; }
  .svc-row > div:nth-child(4) { grid-row: 3; grid-column: 2 / -1; }
  .svc-row > button { grid-row: 4; grid-column: 1 / -1; justify-self: stretch; }
  .table-scroll { overflow-x: auto; overflow-y: hidden; min-width: 0; max-width: 100%; }
  .table-scroll > .table-inner { min-width: 720px; }
  .rates { overflow-x: auto; }
  .rates > .table-inner { min-width: 720px; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; overflow-x: auto; padding: 4px 10px 10px; gap: 4px; }
  .nav-btn { width: auto; white-space: nowrap; padding: 8px 12px; }
  .side-foot, .side-user { display: none; }
  .top { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .content { padding: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .inv-paper > div { padding: 24px 20px !important; }
}

/* --- Aug 27 design: Open Sans + plan-detail page --- */
@font-face { font-family: 'Open Sans'; src: url('/assets/fonts/OpenSans-Variable.ttf') format('truetype-variations'); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Open Sans'; src: url('/assets/fonts/OpenSans-Italic-Variable.ttf') format('truetype-variations'); font-weight: 300 800; font-style: italic; font-display: swap; }
.back-link { background: none; border: none; padding: 0; margin-bottom: 14px; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; font-family: inherit; }
.back-link:hover { color: var(--ink); }
.eyebrow-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin: 0 0 10px; }
.svc-panel.detail { border-top: none; padding: 0; background: none; }
.svc-panel.detail .rates { margin-top: 18px; }
