:root {
  --bg: #080b12;
  --sidebar: #0b0f18;
  --panel: #101622;
  --panel-2: #151d2c;
  --panel-3: #192233;
  --line: #253044;
  --line-soft: rgba(255,255,255,.07);
  --text: #f2f5fb;
  --muted: #8f9bb0;
  --muted-2: #667189;
  --teal: #34d7c5;
  --teal-2: #0ea998;
  --teal-soft: rgba(52,215,197,.11);
  --red: #ff6b78;
  --red-soft: rgba(255,107,120,.12);
  --amber: #f7b955;
  --amber-soft: rgba(247,185,85,.12);
  --blue: #66a7ff;
  --blue-soft: rgba(102,167,255,.12);
  --green: #5bdd98;
  --radius: 14px;
  --shadow: 0 18px 55px rgba(0,0,0,.28);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; font-size: 15px; }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.boot { min-height: 100vh; display: grid; place-content: center; gap: 14px; color: var(--muted); text-align: center; }
.spinner { width: 28px; height: 28px; margin: auto; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(440px, .95fr); }
.auth-art { position: relative; overflow: hidden; padding: 52px; background: radial-gradient(circle at 20% 10%, rgba(52,215,197,.2), transparent 32%), radial-gradient(circle at 80% 80%, rgba(102,167,255,.13), transparent 34%), #0b1019; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.04) 1px,transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, black, transparent 82%); }
.auth-art > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg,var(--teal),#2389ff); color: #04110f; box-shadow: 0 8px 28px rgba(52,215,197,.18); }
.brand-mark svg { width: 21px; height: 21px; }
.auth-message { max-width: 580px; margin: auto 0; }
.eyebrow { color: var(--teal); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; }
.auth-message h1 { font-size: clamp(40px,5vw,70px); line-height: .99; letter-spacing: -.055em; margin: 20px 0; max-width: 670px; }
.auth-message p { color: #aab4c6; font-size: 17px; line-height: 1.65; max-width: 570px; }
.auth-metrics { display: flex; gap: 34px; color: var(--muted); font-size: 12px; }
.auth-metrics strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 4px; }
.auth-panel { display: grid; place-items: center; padding: 40px; background: #090c13; }
.auth-card { width: min(420px,100%); }
.auth-card h2 { font-size: 29px; letter-spacing: -.035em; margin: 0 0 8px; }
.auth-card > p { color: var(--muted); margin: 0 0 30px; line-height: 1.6; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 13px; font-weight: 700; color: #b8c1d1; }
.input, .select { width: 100%; height: 45px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: #0d131e; color: var(--text); outline: none; transition: border .2s, box-shadow .2s; }
.input:focus, .select:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(52,215,197,.09); }
.input::placeholder { color: #59657a; }
.help { font-size: 12px; color: var(--muted-2); line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
.span-2 { grid-column: span 2; }
.btn { border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 700; font-size: 13px; transition: transform .15s, background .15s, border .15s; }
.btn:hover { background: var(--panel-3); border-color: #34425b; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn-primary { border-color: transparent; background: var(--teal); color: #04110f; }
.btn-primary:hover { background: #5ce4d4; border-color: transparent; }
.btn-danger { background: var(--red-soft); border-color: rgba(255,107,120,.28); color: #ff97a1; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 11px; }
.btn-wide { width: 100%; min-height: 46px; }
.btn svg, .icon { width: 16px; height: 16px; stroke-width: 1.8; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 22px 14px 18px; overflow: hidden; background: var(--sidebar); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; z-index: 20; }
.sidebar-head { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sidebar .brand { padding: 0 8px 23px; }
.sidebar-head .brand { min-width: 0; flex: 1; }
.sidebar-close, .sidebar-backdrop { display: none; }
.nav-label { padding: 16px 12px 8px; color: #556278; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
.nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 3px; }
.nav-item { height: 42px; padding: 0 11px; border-radius: 9px; display: flex; align-items: center; gap: 11px; color: #7d899e; font-size: 13px; font-weight: 650; cursor: pointer; border: 0; background: transparent; text-align: left; }
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { color: #c9d1de; background: rgba(255,255,255,.035); }
.nav-item.active { color: var(--text); background: var(--teal-soft); }
.nav-item.active svg { color: var(--teal); }
.nav-badge { margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; background: var(--red-soft); color: #ff8d99; font-size: 9px; }
.sidebar-foot { flex: 0 0 auto; margin-top: auto; padding: 13px 8px 0; border-top: 1px solid var(--line-soft); background: var(--sidebar); }
.user-chip { display: flex; gap: 10px; align-items: center; }
.avatar { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #1f2b3d; color: var(--teal); font-size: 11px; font-weight: 800; }
.user-chip strong { display: block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.user-chip span { color: var(--muted-2); text-transform: capitalize; font-size: 10px; }
.logout { margin-left: auto; border: 0; background: transparent; color: var(--muted-2); cursor: pointer; padding: 5px; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; height: 68px; padding: 0 30px; background: rgba(8,11,18,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.topbar-title strong { display: block; font-size: 14px; }
.topbar-title span { color: var(--muted); font-size: 10px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.live { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; padding-right: 10px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(91,221,152,.08); }
.mobile-menu { display: none; }
.content { padding: 28px 30px 46px; max-width: 1550px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 18px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; width: 90px; height: 90px; top: -45px; right: -45px; border-radius: 50%; background: var(--accent-soft,var(--teal-soft)); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 650; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: var(--accent,var(--teal)); background: var(--accent-soft,var(--teal-soft)); }
.stat-icon svg { width: 15px; height: 15px; }
.stat-value { font-size: 28px; font-weight: 750; letter-spacing: -.04em; margin: 16px 0 4px; }
.stat-foot { color: var(--muted-2); font-size: 9px; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.75fr); gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.panel-head { min-height: 57px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 13px; }
.panel-head p { margin: 3px 0 0; color: var(--muted-2); font-size: 10px; }
.panel-body { padding: 17px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; color: #647087; font-size: 9px; text-transform: uppercase; letter-spacing: .09em; text-align: left; white-space: nowrap; background: rgba(255,255,255,.012); }
td { padding: 13px 14px; border-top: 1px solid var(--line-soft); font-size: 12px; color: #bcc5d4; vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,.02); }
.click-row { cursor: pointer; }
.primary-cell { color: var(--text); font-weight: 700; }
.sub-cell { color: var(--muted-2); font-size: 9px; margin-top: 3px; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; letter-spacing: -.02em; }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 8px; border-radius: 99px; font-size: 9px; font-weight: 750; text-transform: capitalize; border: 1px solid transparent; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-green { color: var(--green); background: rgba(91,221,152,.09); border-color: rgba(91,221,152,.14); }
.pill-red { color: var(--red); background: var(--red-soft); border-color: rgba(255,107,120,.15); }
.pill-amber { color: var(--amber); background: var(--amber-soft); border-color: rgba(247,185,85,.15); }
.pill-blue { color: var(--blue); background: var(--blue-soft); border-color: rgba(102,167,255,.15); }
.pill-muted { color: var(--muted); background: rgba(255,255,255,.04); border-color: var(--line-soft); }
.score { display: flex; align-items: center; gap: 8px; }
.score-bar { width: 52px; height: 4px; background: #232c3b; border-radius: 3px; overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: inherit; background: var(--amber); }
.score-bar.high i { background: var(--red); }

.router-list { display: grid; gap: 10px; }
.router-line { padding: 13px; border-radius: 10px; background: #0c111b; border: 1px solid var(--line-soft); }
.router-line-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.health-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.router-line strong { font-size: 11px; }
.router-line p { margin: 7px 0 0; color: var(--muted-2); font-size: 9px; }
.empty { min-height: 190px; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 25px; }
.empty-icon { width: 42px; height: 42px; margin: auto auto 12px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); }
.empty strong { color: #c7cfdb; font-size: 12px; }
.empty p { max-width: 330px; margin: 7px auto 0; color: var(--muted-2); font-size: 10px; line-height: 1.55; }

.cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.router-card { padding: 17px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.router-card-head { display: flex; justify-content: space-between; gap: 12px; }
.router-symbol { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); }
.router-card h3 { margin: 13px 0 4px; font-size: 14px; }
.router-card .ip { color: var(--muted); font-size: 10px; }
.router-meta { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.router-meta div { padding: 12px 0; }
.router-meta div + div { padding-left: 12px; border-left: 1px solid var(--line-soft); }
.router-meta span { display: block; color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.router-meta strong { display: block; margin-top: 4px; font-size: 11px; }
.router-actions { display: flex; justify-content: flex-end; gap: 7px; }

.policy-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 16px 0 24px; }
.policy-option { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #0c111b; cursor: pointer; position: relative; }
.policy-option input { position: absolute; opacity: 0; }
.policy-option.selected { border-color: var(--teal-2); background: var(--teal-soft); box-shadow: inset 0 0 0 1px rgba(52,215,197,.08); }
.policy-option strong { display: block; font-size: 11px; margin: 10px 0 5px; }
.policy-option p { margin: 0; color: var(--muted-2); font-size: 9px; line-height: 1.5; }
.policy-option .radio { position: absolute; right: 12px; top: 12px; width: 13px; height: 13px; border: 1px solid var(--line); border-radius: 50%; }
.policy-option.selected .radio { border: 4px solid var(--teal); }
.slider-row { display: grid; grid-template-columns: 180px 1fr 66px; gap: 16px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line-soft); }
.slider-row label strong { display: block; font-size: 11px; }
.slider-row label span { color: var(--muted-2); font-size: 9px; }
input[type=range] { accent-color: var(--teal); width: 100%; }
.value-box { padding: 8px; text-align: center; border: 1px solid var(--line); background: #0c111b; border-radius: 8px; font-size: 11px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; background: rgba(1,4,9,.72); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(650px,100%); max-height: calc(100dvh - 40px); overflow: auto; background: #101620; border: 1px solid #2a3548; border-radius: 16px; box-shadow: var(--shadow); }
.modal-lg { width: min(860px,100%); }
.modal-head { position: sticky; top: 0; z-index: 2; min-height: 65px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; background: rgba(16,22,32,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-head p { margin: 4px 0 0; color: var(--muted-2); font-size: 9px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; }
.modal-body { padding: 21px; }
.modal-foot { position: sticky; bottom: 0; z-index: 3; padding: 15px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line-soft); background: rgba(16,22,32,.97); backdrop-filter: blur(12px); }
.steps { display: grid; grid-template-columns: repeat(3,1fr); margin-bottom: 23px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 9px; position: relative; }
.step::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.step:last-child::after { display: none; }
.step-num { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font-size: 9px; }
.step.active { color: var(--teal); }
.step.active .step-num, .step.done .step-num { background: var(--teal); border-color: var(--teal); color: #03110f; }
.code-box { position: relative; background: #070b11; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.code-head { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; }
pre { margin: 0; padding: 15px; overflow: auto; color: #b9e9df; font: 10px/1.65 "SFMono-Regular",Consolas,monospace; white-space: pre; }
.notice { padding: 12px 13px; margin: 0 0 17px; display: flex; gap: 10px; border-radius: 9px; background: var(--amber-soft); border: 1px solid rgba(247,185,85,.15); color: #d9b16c; font-size: 10px; line-height: 1.5; }
.danger-notice { background: var(--red-soft); border-color: rgba(255,107,120,.22); color: #ffadb5; }
.router-search { margin-bottom: 2px; }
.router-picker { max-height: 210px; overflow: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #0d131e; }
.router-picker label { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line-soft); border-radius: 8px; background: #0a1019; cursor: pointer; }
.router-picker input { accent-color: var(--teal); }
.router-picker input:disabled + span { opacity: .45; }
.router-picker strong, .router-picker small { display: block; }
.router-picker strong { font-size: 10px; }
.router-picker small { margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.router-picker p { grid-column: 1 / -1; margin: 5px; color: var(--muted-2); font-size: 10px; }
.router-access.is-disabled .router-picker, .router-access.is-disabled .selected-router-block { opacity: .5; }
.router-access.is-disabled .selected-router-chip { pointer-events: none; }
.selected-router-block { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #0a1019; }
.selected-router-title { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.selected-router-list { display: flex; flex-wrap: wrap; gap: 7px; min-height: 27px; align-items: center; }
.selected-router-chip { min-height: 29px; max-width: 100%; padding: 0 8px 0 10px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(52,215,197,.24); border-radius: 99px; background: var(--teal-soft); color: #b8f5ed; cursor: pointer; font-family: inherit; font-size: 11px; font-weight: 700; line-height: 1; }
.selected-router-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-router-chip svg { width: 13px; height: 13px; flex: 0 0 auto; }
.selected-router-empty { color: var(--muted-2); font-size: 11px; }
.locked-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin: 18px 0; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--line-soft); }
.locked-grid div { min-width: 0; padding: 12px; background: #0c111b; }
.locked-grid span { display: block; margin-bottom: 5px; color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.locked-grid strong { display: block; color: #cbd3df; font-size: 10px; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.detail-grid div { padding: 13px; background: #0c111b; }
.detail-grid div + div { border-left: 1px solid var(--line-soft); }
.detail-grid span { display: block; color: var(--muted-2); font-size: 8px; text-transform: uppercase; }
.detail-grid strong { display: block; margin-top: 5px; font-size: 10px; word-break: break-all; }
.signals { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0; }
.signal { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #0c111b; font-size: 9px; }
.signal strong { color: var(--teal); }

.toast-root { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { min-width: 280px; max-width: 380px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: #151d29; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease-out; }
.toast.error { border-color: rgba(255,107,120,.28); color: #ffadb5; }
.toast.success { border-color: rgba(91,221,152,.25); color: #90edbc; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.skeleton { border-radius: 7px; min-height: 14px; background: linear-gradient(90deg,#121a26,#192334,#121a26); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.error-panel { padding: 20px; border: 1px solid rgba(255,107,120,.2); background: var(--red-soft); border-radius: var(--radius); color: #ffadb5; font-size: 11px; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2,1fr); }
  .cards { grid-template-columns: repeat(2,1fr); }
  .policy-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 820px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; width: min(86vw,268px); height: 100dvh; max-height: 100dvh; padding-bottom: max(14px,env(safe-area-inset-bottom)); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.menu-open .sidebar { transform: translateX(0); }
  .sidebar .brand { padding-bottom: 0; }
  .sidebar-head { min-height: 42px; margin: 0 2px 17px 0; }
  .sidebar-close { display: grid; flex: 0 0 auto; }
  .sidebar-close svg { transform: rotate(180deg); }
  .sidebar-backdrop { position: fixed; z-index: 19; inset: 0; display: block; visibility: hidden; opacity: 0; border: 0; padding: 0; background: rgba(1,4,9,.62); transition: opacity .2s,visibility .2s; }
  .shell.menu-open .sidebar-backdrop { visibility: visible; opacity: 1; }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 17px; }
  .content { padding: 21px 16px 40px; }
  .table-wrap { overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 720px; }
  .grid-2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: repeat(2,1fr); }
  .locked-grid { grid-template-columns: repeat(2,1fr); }
  .detail-grid div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .detail-grid div:nth-child(4) { border-top: 1px solid var(--line-soft); }
}
@media (max-width: 540px) {
  .auth-panel { padding: 24px 18px; }
  .topbar { height: 62px; padding: 0 12px; }
  .topbar-title span { display: none; }
  .content { padding: 18px 12px 32px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 23px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .policy-grid { grid-template-columns: 1fr; }
  .slider-row { grid-template-columns: 1fr 60px; }
  .slider-row input { grid-column: span 2; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head, .toolbar, .toolbar .btn, .toolbar .select { width: 100%; }
  .router-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .router-actions .btn { width: 100%; }
  .locked-grid { grid-template-columns: 1fr; }
  .router-picker { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; place-items: stretch; }
  .modal, .modal-lg { width: 100%; max-height: 100dvh; min-height: 100dvh; border: 0; border-radius: 0; }
  .modal-head { min-height: 62px; padding: 10px 14px; }
  .modal-head > div { min-width: 0; padding-right: 8px; }
  .modal-head p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .modal-body { padding: 16px 14px 22px; }
  .modal-foot { display: grid; grid-template-columns: 1fr; padding: 12px 14px max(12px,env(safe-area-inset-bottom)); }
  .modal-foot .btn { width: 100%; min-height: 44px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid div + div, .detail-grid div:nth-child(3), .detail-grid div:nth-child(4) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .steps { gap: 8px; }
  .step { font-size: 8px; }
  .step::after { display: none; }
  .code-head { align-items: flex-start; gap: 8px; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; width: 100%; }
  .live { display: none; }
}
