/* Design tokens — single source of truth (docs/UI-DESIGN-SYSTEM.md §2) */
:root {
  --bg: #0B0D12; --sidebar: #10131B; --surface: #151923; --elevated: #1B2130;
  --border: #252B38; --border-subtle: #1E2430;
  --text: #F5F7FA; --text-2: #A1A9B8; --text-muted: #6B7280;
  --primary: #8B5CF6; --secondary: #3B82F6;
  --success: #22C55E; --warning: #F59E0B; --danger: #EF4444; --info: #38BDF8;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow-pop: 0 8px 24px rgb(0 0 0 / .45);
  --ease: cubic-bezier(.2,.8,.2,1); --dur-fast: 120ms; --dur: 180ms;
  --sidebar-w: 260px;
  --font: "Inter", "Pretendard", system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-sm); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-2); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sidebar); border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; padding: 20px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; font-weight: 600; font-size: 15px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: grid; place-items: center; font-size: 14px; }
.nav-group { margin-top: 18px; }
.nav-label { padding: 0 10px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text-2); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
a.nav-item:hover { background: var(--elevated); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--elevated); color: var(--text); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--primary); }
.nav-item[aria-disabled="true"] { color: var(--text-muted); cursor: not-allowed; }
.soon { white-space: nowrap; flex: none; margin-left: auto; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--elevated); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--text-2); }
.avatar.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; }
.user-meta { min-width: 0; flex: 1; }
.user-handle { font-size: 12px; color: var(--text-muted); }
.icon-btn { padding: 0 8px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
/* Bar widths in 5% steps (no inline styles: CSP style-src 'self') */
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}
.empty.tight { padding: 8px 0; }
.empty h1 { font-size: 20px; }
.user-name { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; grid-column: 2; }
/* The scrim is only for the mobile drawer. It must never take a grid cell on desktop,
   otherwise .main wraps to a second row below the sidebar. */
.scrim { display: none; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 14px 32px; background: rgb(11 13 18 / .85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-subtle); }
.breadcrumb ol { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--text-muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--border); }
.breadcrumb [aria-current="page"] { color: var(--text-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.btn.menu-btn { display: none; }
.content { padding: 28px 32px 48px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--text-2); margin-top: 4px; }

/* ---------------------------------------------------------------- components */
.card { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 20px; transition: border-color var(--dur-fast) var(--ease); }
.card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.card-title small { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.grid { display: grid; gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 24px; }

.stat { display: flex; flex-direction: column; gap: 10px; }
.stat-head { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: rgb(139 92 246 / .12); color: var(--primary); }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.stat-foot { display: flex; align-items: center; justify-content: space-between; min-height: 24px; font-size: 12px; color: var(--text-muted); }
.delta { font-weight: 600; }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); }
.spark { stroke: var(--primary); fill: none; stroke-width: 1.6; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { color: var(--success); background: rgb(34 197 94 / .12); }
.badge.warning { color: var(--warning); background: rgb(245 158 11 / .12); }
.badge.danger  { color: var(--danger);  background: rgb(239 68 68 / .12); }
.badge.info    { color: var(--info);    background: rgb(56 189 248 / .12); }
.badge.neutral { color: var(--text-2);  background: var(--elevated); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--elevated); color: var(--text); font: 500 13px var(--font); cursor: pointer; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.btn:hover { border-color: var(--text-muted); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #7C4DEB; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--elevated); }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn.block { width: 100%; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { font-size: 12px; color: var(--text-muted); }

.empty { display: grid; justify-items: center; gap: 8px; padding: 28px 12px; text-align: center; color: var(--text-2); }
.empty .icon { width: 28px; height: 28px; color: var(--text-muted); }
.empty p { font-size: 13px; max-width: 320px; }
.alert { padding: 12px 14px; border-radius: var(--r-md); border: 1px solid; font-size: 13px; }
.alert.danger { color: #FCA5A5; border-color: rgb(239 68 68 / .35); background: rgb(239 68 68 / .08); }
.alert.info { color: #BAE6FD; border-color: rgb(56 189 248 / .35); background: rgb(56 189 248 / .08); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0; font-size: 13px; }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; }

/* chart */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--border-subtle); stroke-width: 1; }
.chart .axis { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--primary); opacity: .85; transition: opacity var(--dur-fast) var(--ease); }
.chart .bar:hover { opacity: 1; }
.chart .bar.zero { fill: var(--border); opacity: 1; }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; gap: 6px; font-size: 13px; }
.bar-row .top { display: flex; justify-content: space-between; }
.bar-track { height: 6px; border-radius: 999px; background: var(--elevated); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--primary); }

/* servers */
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.input { height: 36px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 14px var(--font); min-width: 0; }
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgb(139 92 246 / .25); }
.search { flex: 1; max-width: 360px; }
.server-card { display: flex; flex-direction: column; gap: 16px; }
.server-card:hover { border-color: var(--border); }
.server-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.server-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-id { font-size: 12px; color: var(--text-muted); font-family: ui-monospace, monospace; }
.server-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.server-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); }

/* login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(800px 400px at 50% -10%, rgb(139 92 246 / .18), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; padding: 32px; display: grid; gap: 20px; text-align: center; }
.auth-card .brand { justify-content: center; padding: 0; font-size: 17px; }
.auth-card h1 { font-size: 22px; }
.auth-foot { font-size: 12px; color: var(--text-muted); }

/* tabs, table, pager, chat */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border-subtle); }
.tab { padding: 10px 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--primary); }
.tab-count { font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--elevated); color: var(--text-2); }
.table-card { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.table tbody tr:hover { background: rgb(255 255 255 / .02); }
.table tbody tr:last-child td { border-bottom: 0; }
.row-link { color: var(--text); font-weight: 600; }
.row-link:hover { color: var(--primary); }
.cell-title { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-card .empty { padding: 40px 12px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.chat-msg { display: flex; gap: 12px; }
.chat-body { min-width: 0; }
.chat-name { font-weight: 600; }
.chat-time { font-size: 12px; margin-left: 8px; }
.chat-text { white-space: pre-wrap; word-break: break-word; color: #E5E7EB; margin-top: 2px; }
@media (max-width: 767px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
  .table td { padding: 4px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; }
  .table td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; }
  .cell-title { max-width: none; white-space: normal; }
}

/* command guide */
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cmd-cat { border: 1px solid var(--border-subtle); border-radius: var(--r-md); padding: 14px 16px; }
.cmd-cat-title { font-size: 14px; margin-bottom: 8px; }
.cmd-cat-title small { font-weight: 400; font-size: 12px; margin-left: 4px; }
.cmd-cat .list li { padding: 8px 0; }

.pre-line { white-space: pre-line; }
.field { display: grid; gap: 6px; }
.field .title { font-weight: 500; font-size: 13px; }
.form-actions { gap: 8px; }

.logo-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.logo-form .grow { flex: 1; min-width: 200px; }
.logo-form input[type=file] { height: auto; padding: 8px; }
.banner-thumb { width: 96px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center;
  font-size: 12px; color: var(--text-muted); border: 1px solid var(--border);
  background: radial-gradient(60px 30px at 50% 0%, rgb(139 92 246 / .35), transparent 70%), #08090D; }
.consent-details { font-size: 13px; color: var(--text-2); }
.consent-details summary { cursor: pointer; color: var(--text-muted); }
.consent-details summary:hover { color: var(--text-2); }
.consent-details .kv { margin-top: 10px; }

/* automod form */
.automod-form { display: grid; gap: 16px; }
.am-block { border: 1px solid var(--border-subtle); border-radius: var(--r-md); padding: 14px; margin: 0; display: grid; gap: 10px; }
.am-head { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.am-head input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.am-head .title { display: block; font-weight: 500; }
.am-head .meta { display: block; font-size: 12px; color: var(--text-muted); }
.textarea { height: auto; padding: 10px 12px; resize: vertical; font-family: var(--font); line-height: 1.5; }
.am-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); }
.am-action select { width: 220px; }

/* retention form */
.retention-form { display: grid; gap: 4px; }
.retention-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.retention-row:first-of-type { border-top: 0; }
.retention-row .title { display: block; font-weight: 500; }
.retention-row .meta { display: block; font-size: 12px; color: var(--text-muted); }
.retention-row select { width: 120px; flex: none; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 12px; }

/* toggle switch */
.switch { position: relative; width: 44px; height: 24px; flex: none; border-radius: 999px; border: 1px solid var(--border); background: var(--elevated); cursor: pointer; padding: 0; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-muted); transition: transform var(--dur) var(--ease), background var(--dur) var(--ease); }
.switch.on { background: var(--primary); border-color: var(--primary); }
.switch.on .knob { transform: translateX(20px); background: #fff; }

/* verification */
/* Verification card: logo, server name, one button (verify.html / verify_result.html).
   Optional full-page banner (.vbg) under a dark veil; the card floats on top. */
.vwrap { position: relative; isolation: isolate; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px 16px 32px; overflow: hidden;
  background:
    radial-gradient(700px 380px at 50% -5%, rgb(139 92 246 / .22), transparent 70%),
    radial-gradient(500px 320px at 90% 110%, rgb(59 130 246 / .14), transparent 70%),
    #08090D; }
.vbg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.04); filter: saturate(1.05); }
.vwrap.has-bg::before { content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgb(8 9 13 / .35) 0%, rgb(8 9 13 / .55) 55%, rgb(8 9 13 / .85) 100%); }
.vcard { position: relative; width: 100%; max-width: 400px; padding: 60px 28px 28px; text-align: center; display: grid; gap: 10px;
  background: linear-gradient(180deg, rgb(20 22 30 / .92), rgb(10 11 16 / .94));
  border: 1px solid rgb(255 255 255 / .08); border-radius: 20px;
  box-shadow: 0 0 0 6px rgb(255 255 255 / .025), 0 0 0 7px rgb(255 255 255 / .06), 0 30px 80px rgb(0 0 0 / .55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: vrise .5s var(--ease) both; }
@keyframes vrise { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.vtab { position: absolute; top: -13px; left: 22px; padding: 4px 11px; border-radius: 8px 8px 8px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  color: #E9E3FF; background: rgb(139 92 246 / .28); border: 1px solid rgb(139 92 246 / .45); }
.vtab.ok { color: #D7FBE4; background: rgb(34 197 94 / .22); border-color: rgb(34 197 94 / .45); }
.vtab.fail { color: #FFE1E1; background: rgb(239 68 68 / .22); border-color: rgb(239 68 68 / .45); }
.vlogo { position: absolute; top: -46px; left: 50%; transform: translateX(-50%); width: 92px; height: 92px; }
.vlogo::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; z-index: -1;
  background: conic-gradient(from 210deg, var(--primary), var(--secondary), var(--primary)); opacity: .55; filter: blur(10px); }
.vlogo .vlogo-img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  background: #161924; border: 4px solid #0E1016; font-size: 36px; font-weight: 800; color: var(--text); }
.vbadge { position: absolute; right: -1px; bottom: -1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; border: 3px solid #0E1016; color: #fff; }
.vbadge.ok { background: var(--success); }
.vbadge.fail { background: var(--danger); }
.vname { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.vsub { font-size: 13px; color: var(--text-muted); }
.vintro { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.verr { color: #FCA5A5; }
.vcard form { margin-top: 10px; }
.vbtn { width: 100%; height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; cursor: pointer;
  font: 700 16px var(--font); color: #fff; letter-spacing: .01em;
  background: linear-gradient(135deg, #9B6BFF, #6D4AE0 55%, #4F46E5);
  box-shadow: 0 8px 24px rgb(109 74 224 / .45), inset 0 1px 0 rgb(255 255 255 / .2);
  transition: filter var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease); }
.vbtn:hover { filter: brightness(1.08); box-shadow: 0 10px 30px rgb(109 74 224 / .6), inset 0 1px 0 rgb(255 255 255 / .25); }
.vbtn:active { transform: translateY(1px); }
.vbtn:disabled { opacity: .7; cursor: default; }
.vbtn-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .vcard { animation: none; } }
.verify-card { max-width: 560px; text-align: left; }
.verify-head { display: flex; align-items: center; gap: 14px; }
.verify-head h1 { font-size: 20px; }
.verify-lead strong { color: var(--text); }
.consent-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.consent-table th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.consent-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-subtle); }
.consent-table td:last-child { color: var(--text-2); }
.consent-kv { font-size: 13px; }
.consent-form { display: grid; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--elevated); cursor: pointer; transition: border-color var(--dur-fast) var(--ease); }
.check:hover { border-color: var(--text-muted); }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.check:has(input:checked) { border-color: var(--primary); }
.result-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; font-size: 26px; font-weight: 700; }
.result-icon.ok { color: var(--success); background: rgb(34 197 94 / .12); }
.result-icon.fail { color: var(--danger); background: rgb(239 68 68 / .12); }
.link { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--text); }
code { font-family: ui-monospace, monospace; font-size: .92em; background: var(--elevated); padding: 1px 6px; border-radius: 4px; }
.doc { min-height: 100vh; padding: 40px 16px; }
.doc-card { max-width: 760px; margin: 0 auto; padding: 32px; }
.doc-card h1 { font-size: 24px; }
.doc-card h2 { font-size: 16px; margin: 28px 0 8px; }
.doc-card p, .doc-card li { color: var(--text-2); }
.doc-card ul { padding-left: 20px; margin: 0; }

/* ---------------------------------------------------------------- shop */
.shop .brand { align-items: center; }
.shop-name { display: block; font-weight: 700; }
.shop-sub { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); }
.shop-me { border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 14px; margin: 4px 0 16px; display: grid; gap: 12px; background: var(--surface); }
.shop-me-head { display: flex; gap: 10px; align-items: center; }
.shop-balance { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shop-balance .meta { display: block; font-size: 12px; color: var(--text-muted); }
.shop-balance strong { font-size: 20px; }
.shop-balance small, .stat-value small, .product-price small { font-size: .6em; font-weight: 500; margin-left: 2px; color: var(--text-2); }
.shop-kv { font-size: 12px; gap: 6px 12px; }
.shop-kv dd { text-align: right; }
.shop-hero { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 32px; color: #fff;
  background: radial-gradient(500px 240px at 95% 0%, rgb(255 255 255 / .18), transparent 70%), linear-gradient(135deg, #7C3AED, #8B5CF6 45%, #3B82F6); }
.shop-hero h1 { font-size: 28px; margin: 4px 0 8px; }
.shop-hero p { color: rgb(255 255 255 / .88); }
.shop-hero-kicker { font-size: 12px; font-weight: 700; letter-spacing: .04em; opacity: .85; }
.shop-hero-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.shop-hero .btn { background: #fff; color: #4C1D95; border-color: #fff; font-weight: 600; }
.shop-hero .btn.ghost-light { background: rgb(255 255 255 / .14); color: #fff; border-color: rgb(255 255 255 / .35); }
.shop-notice { color: var(--text-2); }
.shop-flash { margin-bottom: 16px; }
.stars { color: var(--warning); letter-spacing: 1px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.product-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--border); }
.product-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--elevated); }
.product-img.placeholder { display: grid; place-items: center; font-size: 40px; font-weight: 700; color: var(--text-muted);
  background: linear-gradient(135deg, rgb(139 92 246 / .25), rgb(59 130 246 / .18)); }
.product-body { padding: 16px; display: grid; gap: 10px; flex: 1; align-content: start; }
.product-name { font-size: 16px; }
.product-desc { font-size: 13px; color: var(--text-2); }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-price { font-size: 20px; font-weight: 700; }
.product-body form { margin-top: auto; }
.bank-kv dd strong { font-size: 18px; letter-spacing: .02em; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.order-card details { margin-top: 8px; font-size: 13px; }
.order-card summary { cursor: pointer; color: var(--text-2); }
.code-box { white-space: pre-wrap; word-break: break-all; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; margin: 10px 0 8px; font-family: ui-monospace, monospace; font-size: 13px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1279px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 767px) {
  .app { grid-template-columns: 1fr; }
  .main { grid-column: 1; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(var(--sidebar-w), 85vw); z-index: 40; transform: translateX(-100%); transition: transform var(--dur) var(--ease); }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / .5); }
  .btn.menu-btn { display: inline-flex; width: 44px; height: 44px; padding: 0; }
  .topbar { padding: 10px 16px; }
  .content { padding: 20px 16px 40px; }
  .grid { gap: 16px; }
  .grid-4 { grid-template-columns: 1fr; }
  .stat-value { font-size: 26px; }
  .input { font-size: 16px; height: 44px; }
  .btn { height: 44px; }
  .search { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
