:root {
  --bg: #f1f3f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #0f1419;
  --text-2: #6b7480;
  --text-3: #9aa3ad;
  --line: #e4e7eb;
  --accent: #1d98dc;
  --accent-strong: #0e8ed4;
  --accent-hover: #0e8ed4;
  --accent-soft: #e8f5fd;
  --danger: #e5484d;
  --danger-strong: #d43a3f;
  --danger-soft: #fdecec;
  --success: #30a46c;
  --success-soft: #e9f6ef;
  --warn-soft: #fff6e0;
  --warn: #b97a00;
  --warn-callout-text: #483813;
  --danger-fg: var(--danger);
  --callout-text: var(--text-2);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #17212b;
  --surface: #232e3c;
  --surface-2: #2b3847;
  --text: #e9edf1;
  --text-2: #828d99;
  --text-3: #66717d;
  --line: rgba(255, 255, 255, .08);
  --accent: #3390ec;
  --accent-strong: #5eb0f3;
  --accent-hover: #5eb0f3;
  --accent-soft: rgba(51, 144, 236, .16);
  --danger-strong: #f06a6e;
  --danger-fg: #f27578;
  --danger-soft: #3a1d22;
  --success-soft: #16301f;
  --warn: #f0b54a;
  --warn-soft: rgba(240, 181, 74, .13);
  --callout-text: var(--text);
  --warn-callout-text: var(--text);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Roboto", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
code { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); font-family: var(--mono); font-size: .9em; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.my-hide { display: none !important; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: -.01em; }
.brand-logo {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(160deg, #37bbfe, #1d93d2);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.crumbs span { opacity: .55; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--accent-strong); }
.topbar .spacer { flex: 1; }
.account { display: flex; align-items: center; gap: 10px; padding: 4px 5px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(160deg, #37bbfe, #1d93d2); color: #fff; font-size: 11px; font-weight: 700; }
.account > span:not(.avatar) { padding-right: 2px; color: var(--text-2); }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); }
.icon-btn:hover { background: var(--line); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }
.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text-2); transition: color .15s, background .15s, transform .25s; }
.theme-toggle:hover { color: var(--text); }
.theme-toggle:active { transform: rotate(-20deg) scale(.94); }
.theme-toggle .icon { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
.page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; width: min(1040px, 100%); margin: 0 auto; padding: 40px 24px 96px; }
.page.narrow { grid-template-columns: 1fr; width: min(440px, 100%); padding-top: 72px; }
.side { position: sticky; top: 104px; display: flex; flex-direction: column; align-self: start; gap: 2px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.side a .icon { width: 19px; height: 19px; }
.side a:hover { background: var(--surface); color: var(--text); }
.side a.active { background: var(--accent-soft); color: var(--accent-strong); }
.side a.danger { color: var(--danger-fg); }
.side a.danger:hover { background: var(--danger-soft); color: var(--danger-fg); }
.side hr { margin: 10px 12px; border: 0; border-top: 1px solid var(--line); }
.content { min-width: 0; }
.mobile-nav { display: none; }
.head { margin-bottom: 28px; }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.head h1 { margin-bottom: 8px; font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.head p { max-width: 620px; color: var(--text-2); }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.card { padding: 28px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.card .sub { margin: 0 0 22px; color: var(--text-2); font-size: 14px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 0; }
.card__head h2 { margin-bottom: 4px; }
.card__head .sub { margin-bottom: 18px; }
.card__body { padding: 0 24px 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background .15s, transform .1s, box-shadow .15s, color .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { cursor: not-allowed; opacity: .55; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-strong); }
.btn.ghost { background: transparent; color: var(--accent-strong); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.outline { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.btn.outline:hover { background: var(--surface-2); }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.small .icon { width: 15px; height: 15px; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.field { position: relative; margin-bottom: 18px; }
.field > input, .field > textarea, .field > select { width: 100%; color: var(--text); background: var(--surface-2); border: 1.5px solid transparent; border-radius: 12px; padding: 24px 14px 8px; outline: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.field > textarea { min-height: 104px; padding-top: 26px; resize: vertical; }
.field > select { height: 52px; padding-top: 20px; }
.field label { position: absolute; left: 15px; top: 17.5px; color: var(--text-3); font-size: 15px; line-height: 22.5px; pointer-events: none; transition: top .2s cubic-bezier(.4, 0, .2, 1), font-size .2s cubic-bezier(.4, 0, .2, 1), color .2s; }
.field > input:focus, .field > textarea:focus, .field > select:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.field > input:focus + label, .field > input:not(:placeholder-shown) + label, .field > textarea:focus + label, .field > textarea:not(:placeholder-shown) + label { top: 7px; color: var(--text-2); font-size: 12px; line-height: 1.5; }
.field > input:focus + label, .field > textarea:focus + label { color: var(--accent-strong); }
.field .hint { display: flex; justify-content: space-between; gap: 12px; margin: 6px 4px 0; color: var(--text-3); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.form-field > span { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid transparent; border-radius: 12px; outline: none; background: var(--surface-2); color: var(--text); font-size: 14px; }
.form-field textarea { min-height: 96px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field--full { grid-column: 1 / -1; }
.form-hint { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar select, .toolbar input { height: 42px; padding: 0 12px; border: 1.5px solid transparent; border-radius: 10px; outline: none; background: var(--surface-2); color: var(--text); font-size: 13.5px; }
.toolbar select { min-width: 150px; }
.toolbar select:focus, .toolbar input:focus { border-color: var(--accent); background: var(--surface); }
.search-field { position: relative; flex: 1 1 220px; min-width: 160px; }
.search-field .icon { position: absolute; top: 50%; left: 11px; width: 17px; height: 17px; color: var(--text-3); transform: translateY(-50%); pointer-events: none; }
.search-field input { width: 100%; padding-left: 36px; }
.toolbar-spacer { flex: 1; }
.callout { display: flex; gap: 12px; margin-bottom: 22px; padding: 14px 16px; border-radius: 14px; font-size: 14px; }
.callout:last-child { margin-bottom: 0; }
.callout > .icon { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.callout div > b:first-child { display: block; margin-bottom: 2px; }
.callout p { margin: 0; color: var(--callout-text); }
.callout.danger { background: var(--danger-soft); color: var(--danger-fg); }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.info { background: var(--accent-soft); color: var(--accent-strong); }
.callout.success { background: var(--success-soft); color: var(--success); }
.callout.warn p { color: var(--warn-callout-text); }
.alert-slot:empty { display: none; }
.alert-slot .callout { margin-bottom: 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.grey { background: var(--surface-2); color: var(--text-2); }
.badge.blue { background: var(--accent-soft); color: var(--accent-strong); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger-fg); }
.table-wrap { overflow: auto; border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.table th:nth-child(1), .table td:nth-child(1) { width: auto; }
.table th:nth-child(2), .table td:nth-child(2) { width: 120px; }
.table th:nth-child(3), .table td:nth-child(3) { width: 80px; }
.table th:nth-child(4), .table td:nth-child(4) { width: 100px; }
.table th:nth-child(5), .table td:nth-child(5) { width: 250px; }
.table th { padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.table td { padding: 15px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.client-cell strong { display: block; font-size: 15px; font-weight: 600; }
.client-cell span { display: block; margin-top: 2px; color: var(--text-2); font-size: 12px; }
.client-error { display: block; max-width: 340px; margin-top: 3px; overflow: hidden; color: var(--danger-fg); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.table-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 4px; }
.table-actions .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }
.table-actions .btn .icon { width: 14px; height: 14px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; user-select: none; cursor: pointer; }
.switch input { position: absolute; width: 0; height: 0; opacity: 0; }
.switch .track { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .2); transition: left .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 21px; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--accent-soft); }
.settings-group + .settings-group { margin-top: 28px; }
.settings-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary small { color: var(--text-3); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.settings-group > summary::after { content: "▾"; margin-left: auto; color: var(--text-3); font-size: 12px; transition: transform .15s; }
.settings-group[open] > summary::after { transform: rotate(180deg); }
.settings-group > .group-hint { margin: 0 0 10px; color: var(--text-3); font-size: 12.5px; }
.setting { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.setting-copy label { display: block; color: var(--text); font-size: 14px; font-weight: 500; }
.setting-copy p { margin: 2px 0 0; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.setting-key { display: block; margin-top: 3px; color: var(--text-3); font-family: var(--mono); font-size: 10.5px; word-break: break-all; }
.setting-control input, .setting-control select, .setting-control textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1.5px solid transparent; border-radius: 10px; outline: none; background: var(--surface-2); color: var(--text); font-size: 13.5px; }
.setting-control textarea { min-height: 74px; resize: vertical; font-family: var(--mono); font-size: 12px; line-height: 1.45; }
.setting-control input:focus, .setting-control select:focus, .setting-control textarea:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.setting-control--switch { display: flex; justify-content: flex-end; padding-top: 7px; }
.setting-control .unit { display: block; margin-top: 4px; color: var(--text-3); font-size: 11.5px; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.settings-actions .spacer { flex: 1; }
.feature-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 15px 0; border-top: 1px solid var(--line); }
.feature-row:first-of-type { border-top: 0; }
.feature-copy label { color: var(--text); font-size: 14.5px; font-weight: 500; }
.feature-copy p { margin: 2px 0 0; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.feature-copy .state { display: block; margin-top: 3px; color: var(--text-3); font-size: 11.5px; }
.feature-row .switch { margin-top: 3px; }
.creds { display: grid; grid-template-columns: 1fr 3fr; gap: 16px; margin-bottom: 18px; }
.cred { min-width: 0; padding: 16px; border-radius: 14px; background: var(--surface-2); }
.cred .k { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.cred .v { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-family: var(--mono); font-size: 15px; word-break: break-all; }
.cred .v .vv { min-width: 0; flex: 1; }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); font-size: 14px; }
.meta-row:first-of-type { border-top: 0; }
.meta-row .l { min-width: 0; color: var(--text-2); }
.meta-row .r { min-width: 0; text-align: right; }
.meta-row .mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.meta-row .actions-inline { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 6px 16px; }
.link-danger { color: var(--danger-fg); }
.auth { text-align: center; }
.auth-logo { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; font-size: 30px; }
.auth h1 { margin-bottom: 8px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.auth > p { margin: 0 0 28px; color: var(--text-2); text-wrap: balance; }
.auth .card { text-align: left; }
.auth .actions { margin-top: 4px; }
.log-box { overflow: hidden; border-radius: 12px; background: var(--surface-2); }
.log-list { min-height: 320px; height: calc(100vh - 300px); overflow: auto; }
.log-row { display: grid; grid-template-columns: 62px 68px minmax(0, 1fr); gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; line-height: 1.45; }
.log-row:last-child { border-bottom: 0; }
.log-time { color: var(--text-3); font-size: 11px; }
.log-level { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; }
.log-level--DEBUG { color: var(--text-2); }
.log-level--INFO { color: var(--accent-strong); }
.log-level--SUCCESS { color: var(--success); }
.log-level--WARNING { color: var(--warn); }
.log-level--ERROR, .log-level--CRITICAL { color: var(--danger-fg); }
.log-message { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-source { grid-column: 3; margin-top: -3px; color: var(--text-3); font-size: 10.5px; }
.log-trace { grid-column: 3; margin: 4px 0; padding: 7px 9px; border-radius: 6px; background: var(--surface); color: var(--text-2); font-size: 10.5px; white-space: pre-wrap; }
.log-empty { padding: 48px 20px; color: var(--text-2); font-size: 13px; text-align: center; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { padding: 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.stat .title { margin-bottom: 10px; color: var(--text-2); font-size: 12px; font-weight: 500; }
.stat .value { margin-bottom: 8px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .value small { color: var(--text-2); font-size: 13px; font-weight: 400; }
.bar { height: 7px; margin: 8px 0 14px; overflow: hidden; border-radius: 4px; background: var(--line); }
.bar__fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width .3s; }
.bar__fill--warn { background: var(--warn); }
.bar__fill--danger { background: var(--danger); }
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.kv:first-of-type { border-top: 0; }
.kv span:first-child { color: var(--text-2); }
.kv span:last-child { font-weight: 500; text-align: right; }
.code-field { margin-bottom: 18px; }
.code-field .label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 8px; }
.code-field .label-row strong { color: var(--text-2); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.code-field .label-row span { color: var(--text-3); font-size: 12px; }
.code-area {
  width: 100%;
  min-height: 320px;
  padding: 14px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}
.code-area:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 20, 25, .48); }
.modal { width: min(580px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 6px rgba(16, 24, 40, .06), 0 18px 40px rgba(16, 24, 40, .18); }
.modal.wide { width: min(760px, 100%); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal__head h2 { margin-bottom: 4px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.modal__head p { color: var(--text-2); font-size: 13.5px; }
.modal__body { padding: 20px 24px; }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }
.dialog-tabs { display: flex; gap: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.dialog-tab { height: 40px; margin-bottom: -1px; padding: 0 1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; }
.dialog-tab:hover { color: var(--text); }
.dialog-tab.active { border-bottom-color: var(--accent); color: var(--accent-strong); }
.qr-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.qr-frame { display: grid; place-items: center; width: 220px; height: 220px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qr-frame svg { display: block; width: 100%; height: auto; }
.qr-placeholder { color: #5f6873; font-size: 12px; text-align: center; }
.qr-copy h4 { margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.qr-copy p, .qr-copy ol { color: var(--text-2); font-size: 13px; line-height: 1.5; }
.qr-copy ol { margin: 8px 0 0; padding-left: 18px; }
.qr-status { margin-top: 14px; color: var(--text-2); font-size: 12.5px; }
.credentials-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
}
.credentials-note button { padding: 0; border: 0; background: transparent; color: var(--accent-strong); font-size: 12.5px; font-weight: 500; }
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 22px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  text-align: center;
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { width: 26px; height: 26px; margin-bottom: 2px; color: var(--accent-strong); }
.dropzone strong { color: var(--text); font-size: 14px; font-weight: 600; }
.dropzone span { font-size: 12px; }
.file-list { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
.file-list li { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 8px; background: var(--surface-2); font-size: 12px; }
.file-list .icon { width: 14px; height: 14px; color: var(--text-2); }
.file-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-results { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.import-result { display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px; border-radius: 8px; background: var(--success-soft); color: var(--success); font-size: 12.5px; line-height: 1.45; }
.import-result--error { background: var(--danger-soft); color: var(--danger-fg); }
.import-result .icon { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.empty { padding: 48px 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.empty h2 { margin-bottom: 6px; font-size: 18px; font-weight: 600; }
.empty p { max-width: 460px; margin: 0 auto 20px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.empty .actions { justify-content: center; }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .15s, transform .15s;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { color: var(--danger-fg); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--line); }
*::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; gap: 20px; padding: 24px 16px 64px; }
  .page.narrow { padding-top: 40px; }
  .side { display: none; }
  .mobile-nav { display: flex; gap: 4px; margin-bottom: 20px; }
  .mobile-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 500;
  }
  .mobile-nav a.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
  .topbar { padding: 0 16px; }
  .crumbs { display: none; }
  .account > span:not(.avatar) { display: none; }
  .account { padding: 3px; }
  .head h1 { font-size: 24px; }
  .grid2, .creds { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log-list { height: calc(100vh - 340px); }
}
@media (max-width: 720px) {
  .card { padding: 20px; }
  .card__head, .card__body { padding-right: 18px; padding-left: 18px; }
  .card__head { padding-top: 18px; }
  .head-row { flex-direction: column; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .setting { grid-template-columns: 1fr; gap: 8px; }
  .setting-control--switch { justify-content: flex-start; }
  .settings-actions { flex-wrap: wrap; }
  .settings-actions .spacer { display: none; }
  .settings-actions .btn { flex: 1; }
  .table-wrap { overflow: visible; background: transparent; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table { table-layout: auto; }
  .table thead { display: none; }
  .table tr { margin-bottom: 10px; padding: 8px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
  .table td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; border: 0; }
  .table td::before { content: attr(data-label); color: var(--text-2); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
  .table td[data-label=""]::before { display: none; }
  .table td:first-child { display: block; padding-bottom: 8px; }
  .table td:first-child::before { display: none; }
  .table-actions { flex-wrap: wrap; justify-content: flex-start; }
  .table th:nth-child(n), .table td:nth-child(n) { width: auto; }
  .table-actions .btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .client-error { max-width: none; white-space: normal; }
  .toolbar .search-field { flex-basis: 100%; }
  .toolbar select { flex: 1; }
  .qr-layout { grid-template-columns: 1fr; }
  .qr-frame { margin: 0 auto; }
  .log-row { grid-template-columns: 52px 60px minmax(0, 1fr); gap: 7px; padding: 7px 10px; }
  .log-source, .log-trace { grid-column: 3; }
  .stats-grid { grid-template-columns: 1fr; }
  .modal__head { padding: 18px 18px 0; }
  .modal__body { padding: 16px 18px; }
  .modal__foot { padding: 0 18px 18px; }
  .mobile-nav a { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
