:root {
  --brand: #2970ff;
  --brand-hover: #1a5fe8;
  --brand-active: #0d4ecc;
  --brand-light: #e8f3ff;
  --brand-soft: rgba(41, 112, 255, 0.08);
  --bg-page: #f3f3f3;
  --bg-container: #fff;
  --bg-sidebar: #f9f9f9;
  --bg-subtle: #fafafa;
  --bg-hover: #f3f3f3;
  --bg-active: #ebebeb;
  --fg-1: rgba(0, 0, 0, 0.9);
  --fg-2: rgba(0, 0, 0, 0.6);
  --fg-3: rgba(0, 0, 0, 0.4);
  --fg-4: rgba(0, 0, 0, 0.26);
  --line: #e7e7e7;
  --line-strong: #dcdcdc;
  --success: #2ba471;
  --success-bg: #e3f9e9;
  --warning: #b25a08;
  --warning-bg: #fff1e9;
  --danger: #d54941;
  --danger-bg: #fff0ed;
  --info: #0052d9;
  --info-bg: #ecf2fe;
  --sys: #7a4bd6;
  --sys-bg: #f3eefc;
  --sys-line: #e0d3f8;
  --radius-sm: 2px;
  --radius: 3px;
  --radius-lg: 6px;
  --radius-xl: 9px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-3: 0 12px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 60px;
  --topbar-h: 48px;
  --content-max: 880px;
  --content-max-wide: 1080px;
}

[data-theme="dark"] {
  --bg-page: #181818;
  --bg-container: #242424;
  --bg-sidebar: #181818;
  --bg-subtle: #2c2c2c;
  --bg-hover: #2c2c2c;
  --bg-active: #383838;
  --fg-1: rgba(255, 255, 255, 0.9);
  --fg-2: rgba(255, 255, 255, 0.6);
  --fg-3: rgba(255, 255, 255, 0.4);
  --fg-4: rgba(255, 255, 255, 0.26);
  --line: #333;
  --line-strong: #454545;
  --brand: #4d98ff;
  --brand-hover: #2970ff;
  --brand-active: #1a5fe8;
  --brand-light: rgba(41, 112, 255, 0.16);
  --brand-soft: rgba(41, 112, 255, 0.14);
  --success: #3fb37f;
  --success-bg: rgba(43, 164, 113, 0.16);
  --warning: #e8935c;
  --warning-bg: rgba(237, 123, 47, 0.16);
  --danger: #e8736c;
  --danger-bg: rgba(213, 73, 65, 0.16);
  --info: #69b1ff;
  --info-bg: rgba(77, 145, 255, 0.16);
  --sys: #b79bff;
  --sys-bg: rgba(122, 75, 214, 0.2);
  --sys-line: rgba(122, 75, 214, 0.4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg-page); color: var(--fg-1); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
code, pre, kbd { font-family: var(--mono); }
code { padding: 1px 5px; border-radius: var(--radius-sm); background: var(--bg-hover); font-size: 12px; word-break: break-all; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-light); }

.i { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.app { display: flex; height: 100vh; overflow: hidden; }
.aside { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--line); background: var(--bg-sidebar); transition: width .22s ease, flex-basis .22s ease; }
.side-top { padding: 10px 10px 6px; flex: 0 0 auto; }
.logo-row { height: 38px; padding: 0 6px 0 4px; display: flex; align-items: center; gap: 8px; }
.logo { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--fg-1); font-weight: 650; white-space: nowrap; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(135deg, #2970ff, #69b1ff); box-shadow: 0 2px 6px rgba(41, 112, 255, .28); }
.logo-text { display: flex; flex-direction: column; overflow: hidden; line-height: 1.15; min-width: 0; }
.logo-text b { font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-text span { color: var(--fg-3); font-size: 10px; letter-spacing: .4px; }
.spacer, .topbar-spacer { flex: 1 1 auto; }
.icon-btn { width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius); display: inline-grid; place-items: center; flex: 0 0 auto; color: var(--fg-2); background: transparent; cursor: pointer; }
.icon-btn:hover { color: var(--fg-1); background: var(--bg-hover); }
.tenant { margin-top: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; align-items: center; gap: 8px; background: var(--bg-container); }
.tenant-avatar { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; color: var(--brand); background: var(--brand-light); font-size: 12px; font-weight: 700; }
.tenant-body { min-width: 0; flex: 1 1 auto; line-height: 1.2; }
.tenant-body b, .tenant-body span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-body b { font-size: 13px; font-weight: 600; }
.tenant-body span { margin-top: 3px; color: var(--fg-3); font-size: 11px; }
#side-nav { min-height: 0; display: flex; flex: 1 1 auto; }
.side-scroll { width: 100%; flex: 1 1 auto; overflow: auto; padding: 4px 8px 12px; }
.nav-section { margin: 10px 0 2px; padding: 0 8px; color: var(--fg-3); font-size: 11px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
.nav-section:first-child { margin-top: 2px; }
.nav-item { height: 32px; padding: 0 8px; border-radius: var(--radius-lg); display: flex; align-items: center; gap: 8px; color: var(--fg-1); font-weight: 500; white-space: nowrap; font-size: 13px; }
.nav-item .i { color: var(--fg-2); }
.nav-item:hover { color: var(--fg-1); background: var(--bg-hover); }
.nav-item.is-active { color: var(--brand); background: var(--bg-active); font-weight: 600; }
.nav-item.is-active .i { color: var(--brand); }
.nav-item.is-disabled { color: var(--fg-3); cursor: not-allowed; }
.nav-item.is-disabled:hover { color: var(--fg-3); background: transparent; }
.nav-label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; color: var(--warning); background: rgba(237, 123, 47, .16); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.nav-sys { width: 16px; height: 16px; border-radius: 4px; display: inline-grid; place-items: center; flex: 0 0 auto; color: var(--sys); background: var(--sys-bg); }
.nav-sys .i { width: 11px; height: 11px; color: inherit; }
.side-bottom { padding: 8px; border-top: 1px solid var(--line); }
.side-bottom .nav-item { width: 100%; }
.logout-form { margin: 0; }
.logout-form button { border: 0; background: transparent; font: inherit; text-align: left; }
.side-foot-user { padding: 6px 8px; border-radius: var(--radius-lg); display: flex; align-items: center; gap: 9px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(135deg, #4d98ff, #2970ff); font-size: 12px; font-weight: 600; }
.u-meta { min-width: 0; line-height: 1.25; }
.u-meta b, .u-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-meta b { font-size: 13px; }
.u-meta span { color: var(--fg-3); font-size: 11px; }

body.side-collapsed .aside { width: var(--sidebar-w-collapsed); flex-basis: var(--sidebar-w-collapsed); }
body.side-collapsed .logo-text, body.side-collapsed .tenant, body.side-collapsed .nav-section, body.side-collapsed .nav-label, body.side-collapsed .u-meta { display: none; }
body.side-collapsed .nav-item, body.side-collapsed .logo-row, body.side-collapsed .side-foot-user { justify-content: center; padding-left: 0; padding-right: 0; }

.main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; background: var(--bg-page); }
.topbar { height: var(--topbar-h); padding: 0 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex: 0 0 var(--topbar-h); background: var(--bg-container); }
.crumbs { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--fg-2); font-size: 13px; }
.crumbs .sep { color: var(--fg-4); }
.crumbs b { color: var(--fg-1); font-weight: 600; }
.crumbs a { color: var(--fg-2); }
.search-trigger { min-width: 220px; height: 32px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; align-items: center; gap: 8px; color: var(--fg-3); background: var(--bg-subtle); cursor: pointer; }
.search-trigger:hover { color: var(--fg-2); border-color: var(--line-strong); }
.search-trigger .grow { flex: 1 1 auto; text-align: left; }
kbd { padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--radius); color: var(--fg-2); background: var(--bg-container); font-size: 11px; }
.mobile-menu { display: none; }
.content { flex: 1 1 auto; overflow-y: auto; padding: 14px 18px 32px; }
.content.legacy > h1, .content.legacy > .row:first-child h1 { margin-bottom: 12px; font-size: 18px; font-weight: 650; }

/* Card system (ported from prototypes; was missing so forms looked sparse). */
.card {
  background: var(--bg-container);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
form.card,
section.card,
div.card {
  padding: 14px 16px;
}
.card.media-table-wrap,
.media-table-wrap.card {
  padding: 0;
  overflow: auto;
}
.card:has(> .td-table),
.card:has(> table.td-table) {
  padding: 0;
  overflow: hidden;
}
.card:has(> .td-table) > .td-table,
.card:has(> table.td-table) > .td-table {
  border: 0;
  border-radius: 0;
}
.card-pad { padding: 14px 16px; }
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14px; font-weight: 650; }
.card-body { padding: 12px 14px; }
.card + .card { margin-top: 0; }

.btn, .legacy button:not(.icon-btn):not(.search-trigger) { min-height: 32px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--fg-1); background: var(--bg-container); font-weight: 500; cursor: pointer; }
.btn:hover, .legacy button:not(.icon-btn):not(.search-trigger):hover { border-color: var(--brand); color: var(--brand); }
.btn--primary, .legacy button[type="submit"]:not(.ghost):not(.danger) { color: #fff; border-color: var(--brand); background: var(--brand); }
.btn--primary:hover, .legacy button[type="submit"]:not(.ghost):not(.danger):hover { color: #fff; border-color: var(--brand-hover); background: var(--brand-hover); }
.legacy .ghost { background: var(--bg-container); }
.legacy .danger { color: var(--danger); border-color: var(--danger); background: var(--bg-container); }
.legacy .row { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.legacy .card { margin-bottom: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-container); }
.muted { color: var(--fg-3); font-size: 13px; }
.field-hint {
  margin: -6px 0 12px;
  color: var(--fg-3);
  font-size: 12.5px;
  line-height: 1.55;
}
.field-hint.is-ok { color: var(--success); }
.field-hint.is-bad { color: var(--danger); }
.field-hint code {
  font-size: 12px;
}
.legacy label + .field-hint { margin-top: -4px; }
.legacy input + .field-hint,
.legacy select + .field-hint,
.legacy textarea + .field-hint { margin-top: 6px; }
.legacy table { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-lg); border-collapse: collapse; overflow: hidden; background: var(--bg-container); }
.legacy th, .legacy td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legacy th { color: var(--fg-2); background: var(--bg-subtle); font-size: 12px; font-weight: 600; }
.legacy tr:last-child td { border-bottom: 0; }

/* td-* : TDesign-inspired utilities (SSR; not Vue TDesign) */
.td-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-container);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.td-table th,
.td-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.td-table th {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-subtle);
  white-space: nowrap;
}
.td-table tr:last-child td { border-bottom: 0; }
.td-table tr.is-selected td { background: var(--brand-light); }
.td-table--compact th,
.td-table--compact td { padding: 8px 12px; }

.td-form { display: grid; gap: 2px; }
.td-form > label,
.td-form .td-label {
  margin: 8px 0 4px;
  display: block;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--fg-2);
}
.td-form > label:first-child,
.td-form .td-label:first-child { margin-top: 0; }
.td-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.td-form textarea,
.td-form select {
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  color: var(--fg-1);
  background: var(--bg-container);
  font: inherit;
}
.td-form textarea { min-height: 120px; resize: vertical; }
.td-form input:focus,
.td-form textarea:focus,
.td-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.td-form--inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.td-form--inline input:not([type="checkbox"]):not([type="radio"]),
.td-form--inline select {
  width: auto;
  min-height: 32px;
}

.td-batch-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 12px;
  z-index: 5;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--bg-container) 92%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-1);
}
.td-batch-bar .danger[disabled],
.td-batch-bar button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.td-batch-bar .danger {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: #fff;
  background: var(--danger);
  font-weight: 600;
}
.td-batch-bar .danger:hover:not([disabled]) {
  filter: brightness(0.95);
}

.td-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--fg-3);
  font-size: 13px;
}
.legacy td form, .legacy .card form { margin: 0; }
.legacy label { margin: 12px 0 6px; display: block; font-size: 13px; font-weight: 500; }
.legacy input, .legacy textarea, .legacy select { width: 100%; min-height: 32px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); outline: none; color: var(--fg-1); background: var(--bg-container); }
.legacy textarea { min-height: 280px; resize: vertical; font-family: var(--mono); }
.legacy input:focus, .legacy textarea:focus, .legacy select:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.legacy pre { padding: 12px 14px; overflow: auto; white-space: pre-wrap; border-radius: var(--radius-lg); background: var(--bg-subtle); }

.upload-page { width: 100%; }
.upload-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.18fr);
  gap: 16px;
  align-items: start;
}
.upload-panel,
.upload-sample,
.upload-report {
  min-width: 0;
}
.upload-panel .muted,
.upload-sample .muted { margin-bottom: 14px; }
.upload-form { display: grid; gap: 14px; }
.upload-drop {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  text-align: center;
  cursor: pointer;
  color: var(--fg-1);
}
.upload-drop:hover,
.upload-drop:focus-within {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.upload-drop-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--bg-container);
  box-shadow: var(--shadow-1);
}
.upload-drop-icon .i { width: 20px; height: 20px; }
.upload-drop strong { font-size: 14px; font-weight: 650; }
.upload-drop input[type="file"] {
  width: min(100%, 280px);
  margin-top: 4px;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  color: var(--fg-2);
}
.upload-actions { display: flex; align-items: center; gap: 8px; }
.upload-checklist {
  margin: 0 0 14px;
  padding-left: 1.1rem;
  display: grid;
  gap: 6px;
  color: var(--fg-2);
  font-size: 13px;
}
.upload-checklist strong { color: var(--fg-1); font-weight: 600; }
.upload-sample-path { margin-bottom: 10px; }
.upload-sample-code {
  margin: 0;
  max-height: min(520px, 62vh);
  overflow: auto;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
}
.upload-report { margin-top: 16px; }
.upload-report .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.upload-report--failed {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}
.upload-report--partial {
  border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
}
.upload-report--ok {
  border-color: color-mix(in srgb, var(--success) 35%, var(--line));
}
.upload-report-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.upload-report-status.is-bad,
.upload-report-summary.is-bad { color: var(--danger); }
.upload-report-status.is-bad { background: var(--danger-bg); }
.upload-report-status.is-warn,
.upload-report-summary.is-warn { color: var(--warning); }
.upload-report-status.is-warn { background: var(--warning-bg); }
.upload-report-status.is-ok,
.upload-report-summary.is-ok { color: var(--success); }
.upload-report-status.is-ok { background: var(--success-bg); }
.upload-report-summary {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
.upload-report-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.upload-report-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.55;
}
.upload-report-item.is-error {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  background: var(--danger-bg);
  color: var(--danger);
}
.upload-report-item.is-warn {
  border-color: color-mix(in srgb, var(--warning) 28%, var(--line));
  background: var(--warning-bg);
  color: var(--warning);
}
.upload-report-item.is-ok {
  border-color: color-mix(in srgb, var(--success) 28%, var(--line));
  background: var(--success-bg);
  color: var(--success);
}
.upload-report-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, currentColor 12%, transparent);
  color: inherit;
  white-space: nowrap;
}
.upload-report-item > span:last-child {
  min-width: 0;
  color: var(--fg-1);
  word-break: break-word;
}
.upload-report-item.is-error > span:last-child { color: var(--danger); }
.upload-report-item.is-warn > span:last-child { color: var(--warning); }
.upload-report-item.is-ok > span:last-child { color: var(--fg-1); }
@media (max-width: 960px) {
  .upload-layout { grid-template-columns: minmax(0, 1fr); }
}

.editor-page { display: grid; gap: 16px; width: 100%; max-width: none; }
.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.editor-head h1 { margin-bottom: 4px; }
.editor-mode {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}
.editor-mode .ghost {
  min-height: 28px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--fg-2);
  font-size: 12px;
}
.editor-mode .ghost.is-active {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--bg-container);
}
.editor-form { display: grid; gap: 16px; }
.editor-meta { margin-bottom: 0; }
.editor-meta-import { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.editor-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 12px;
}
.editor-meta-translation { margin-top: 12px; }
@media (max-width: 720px) {
  .editor-meta-grid { grid-template-columns: minmax(0, 1fr); }
}
.editor-media-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--line));
  border-radius: var(--radius-lg);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 13px;
  font-weight: 600;
}
.editor-media-hint-details {
  flex: 1 1 100%;
  font-weight: 400;
  color: var(--fg-2);
}
.editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 420px;
}
.editor-workspace.is-edit { grid-template-columns: minmax(0, 1fr); }
.editor-workspace.is-edit [data-md-preview-pane] { display: none; }
.editor-workspace.is-preview { grid-template-columns: minmax(0, 1fr); }
.editor-workspace.is-preview [data-md-source-pane] { display: none; }
.editor-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-container);
  overflow: hidden;
}
.editor-pane-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
  background: var(--bg-subtle);
  font-size: 12px;
  font-weight: 600;
}
.editor-source textarea,
.md-source-readonly {
  flex: 1 1 auto;
  min-height: 380px;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  resize: vertical;
  background: var(--bg-container);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}
.editor-source textarea:focus { box-shadow: none; }
.md-source-readonly {
  padding: 12px 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.md-preview {
  flex: 1 1 auto;
  min-height: 380px;
  padding: 16px 18px;
  overflow: auto;
  line-height: 1.65;
}
.md-preview > :first-child { margin-top: 0; }
.md-preview > :last-child { margin-bottom: 0; }
.md-preview h1, .md-preview h2, .md-preview h3, .md-preview h4 {
  margin: 1.1em 0 0.45em;
  line-height: 1.3;
  font-weight: 650;
}
.md-preview h1 { font-size: 1.45rem; }
.md-preview h2 { font-size: 1.2rem; }
.md-preview h3 { font-size: 1.05rem; }
.md-preview p, .md-preview ul, .md-preview ol, .md-preview pre, .md-preview blockquote {
  margin: 0 0 0.85em;
}
.md-preview ul, .md-preview ol { padding-left: 1.25rem; }
.md-preview code {
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  font-size: 0.92em;
}
.md-preview pre {
  padding: 12px 14px;
  overflow: auto;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}
.md-preview pre code { padding: 0; background: transparent; }
.md-preview blockquote {
  padding: 0 0 0 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--fg-2);
}
.md-preview img { max-width: 100%; height: auto; border-radius: var(--radius); }
.md-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.85em;
  font-size: 0.95em;
  line-height: 1.45;
}
.md-preview th,
.md-preview td {
  border: 1px solid var(--line);
  padding: 0.5em 0.7em;
  text-align: left;
  vertical-align: top;
}
.md-preview th {
  font-weight: 650;
  background: var(--bg-subtle);
}
.md-preview tr:nth-child(even) td { background: var(--bg-hover); }
.editor-actions { margin-top: 0; }

/* EasyMDE (MIT) — toolbar without Font Awesome */
.editor-source .EasyMDEContainer { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 380px; }
.editor-source .EasyMDEContainer .CodeMirror {
  flex: 1 1 auto;
  min-height: 340px;
  border: 0;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-1);
  background: var(--bg-container);
}
.editor-source .EasyMDEContainer .CodeMirror-scroll { min-height: 340px; }
.editor-source .editor-toolbar {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg-subtle);
  padding: 4px 6px;
  opacity: 1;
}
.editor-source .editor-toolbar button {
  width: auto !important;
  min-width: 28px;
  height: 28px !important;
  margin: 2px;
  padding: 0 7px !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius) !important;
  color: var(--fg-1) !important;
  background: transparent;
  box-shadow: none !important;
  font-family: var(--font) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
}
.editor-source .editor-toolbar button:hover,
.editor-source .editor-toolbar button.active {
  border-color: var(--line-strong) !important;
  background: var(--bg-container) !important;
  color: var(--brand) !important;
}
.editor-source .editor-toolbar button.md-ico b,
.editor-source .editor-toolbar button.md-ico i,
.editor-source .editor-toolbar button.md-ico s {
  font: inherit;
  color: inherit;
}
.editor-source .editor-toolbar button.md-ico i { font-style: italic; }
.editor-source .editor-toolbar button.md-ico s { text-decoration: line-through; }
.editor-source .editor-toolbar .separator { border-left-color: var(--line); }
.editor-source .editor-statusbar { border: 0; border-top: 1px solid var(--line); color: var(--fg-3); background: var(--bg-subtle); }
@media (max-width: 960px) {
  .editor-workspace { grid-template-columns: minmax(0, 1fr); }
  .editor-workspace:not(.is-preview) [data-md-preview-pane] { display: none; }
  .editor-workspace.is-preview [data-md-source-pane] { display: none; }
  .editor-workspace.is-preview [data-md-preview-pane] { display: flex; }
}

.ops-page {
  width: 100%;
  max-width: var(--content-max);
  display: grid;
  gap: 12px;
  align-content: start;
}
.ops-page:has(.td-table) { max-width: var(--content-max-wide); }
.ops-page.nav-page,
.ops-page.media-page,
.ops-page.usage-page,
.ops-page.ops-page--flush {
  max-width: none;
}
.ops-head { margin-bottom: 0; }
.ops-head h1 {
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.ops-head .muted,
.ops-head p {
  margin: 0;
  max-width: 62ch;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg-2);
}
.ops-page h2 { margin: 0 0 8px; font-size: 14px; font-weight: 650; }
.ops-page .td-form > input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.ops-page .td-form > select,
.ops-page .td-form > textarea {
  max-width: 32rem;
}
.ops-page .td-form .row { margin-top: 10px; }
.ops-page .field-hint { margin: 2px 0 8px; max-width: 48ch; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
  width: fit-content;
  max-width: 100%;
}
.tab {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--fg-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.tab:hover { color: var(--fg); background: var(--bg-1); }
.tab.is-active {
  color: var(--fg);
  background: var(--bg-container);
  box-shadow: 0 0 0 1px var(--line);
}
.pages-filter { margin: 0 0 12px; }
.tab-count {
  margin-left: 4px;
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 600;
}
.tab.is-active .tab-count { color: var(--fg-2); }

.audit-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
}
.audit-filter .row { grid-column: 1 / -1; }

.usage-page { width: 100%; max-width: none; }
.usage-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.usage-val { font-size: 22px; font-weight: 650; margin: 8px 0; }
.usage-meter--warn { border-color: var(--warning); }
.usage-meter--over { border-color: var(--danger); }

.ownership-list { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--fg-2); }

.inline-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.inline-form select { width: auto; min-height: 32px; }
.invite-form { display: grid; gap: 8px; max-width: 420px; margin-bottom: 16px; }

.theme-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 14px 0 4px;
}
.theme-pick {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
  cursor: pointer;
}
.theme-pick input { position: absolute; opacity: 0; pointer-events: none; }
.theme-pick--card {
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg-container);
  box-shadow: var(--shadow-1);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.theme-pick--card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.theme-pick.is-selected,
.theme-pick:has(input:checked),
.theme-pick--card.is-selected,
.theme-pick--card:has(input:checked) {
  border-color: var(--brand);
  background: var(--bg-container);
  box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow-1);
}
.theme-pick--card:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}
.theme-pick-meta {
  display: grid;
  gap: 3px;
  padding: 12px 14px 14px;
}
.theme-pick-meta strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--fg-1);
}
.theme-pick-meta span {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.45;
}

/* Mini public-site previews — mirrors public theme tokens. */
.theme-preview {
  --tp-bg: #fff;
  --tp-app: #f7f7f8;
  --tp-text: #18181b;
  --tp-muted: #71717a;
  --tp-line: #e4e4e7;
  --tp-link: #6e56cf;
  --tp-serif: "IBM Plex Serif", Georgia, "Songti SC", serif;
  --tp-sans: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  height: 168px;
  border-bottom: 1px solid var(--tp-line);
  background: var(--tp-bg);
  color: var(--tp-text);
  font-family: var(--tp-sans);
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.theme-preview[data-preview="docs-ink"] {
  --tp-bg: #121212;
  --tp-app: #0c0c0c;
  --tp-text: #f2f2f2;
  --tp-muted: #a1a1aa;
  --tp-line: #2a2a2a;
  --tp-link: #9ec1ff;
}
.theme-preview[data-preview="docs-serif"] {
  font-family: var(--tp-serif);
}
.tp-top {
  height: 28px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--tp-line);
  background: color-mix(in srgb, var(--tp-bg) 88%, transparent);
}
.tp-brand { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.tp-langs { display: flex; gap: 5px; }
.tp-langs i {
  width: 18px;
  height: 6px;
  border-radius: 99px;
  background: var(--tp-line);
  display: block;
}
.tp-langs i.is-on { background: var(--tp-text); opacity: 0.55; }
.tp-shell {
  height: calc(100% - 28px);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 44px;
  background: var(--tp-app);
}
.theme-preview[data-preview="docs-serif"] .tp-shell {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  background: var(--tp-bg);
}
.theme-preview[data-preview="docs-serif"] .tp-nav,
.theme-preview[data-preview="docs-serif"] .tp-toc { display: none; }
.tp-nav, .tp-toc {
  padding: 10px 8px;
  display: grid;
  gap: 6px;
  align-content: start;
  border-right: 1px solid var(--tp-line);
  background: var(--tp-bg);
}
.tp-toc { border-right: 0; border-left: 1px solid var(--tp-line); }
.tp-nav b, .tp-nav span, .tp-toc span {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: var(--tp-line);
}
.tp-nav b { width: 70%; height: 6px; margin-bottom: 2px; background: var(--tp-muted); opacity: 0.55; }
.tp-nav span:nth-child(2) { width: 88%; }
.tp-nav span:nth-child(3) { width: 64%; }
.tp-nav span:nth-child(4), .tp-nav span.is-on { width: 78%; background: var(--tp-link); }
.tp-nav span:nth-child(5) { width: 52%; }
.tp-toc span { width: 100%; }
.tp-toc span:nth-child(2), .tp-toc span.is-on { background: var(--tp-link); opacity: 0.85; }
.tp-prose {
  padding: 12px 14px;
  background: var(--tp-bg);
  min-width: 0;
}
.theme-preview[data-preview="docs-serif"] .tp-prose {
  width: min(100%, 78%);
  padding: 14px 18px;
}
.tp-prose h4 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tp-text);
}
.theme-preview[data-preview="docs-serif"] .tp-prose h4 {
  font-size: 14px;
  font-weight: 600;
}
.tp-prose p {
  margin: 0 0 8px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--tp-muted);
}
.tp-prose ul {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.tp-prose li {
  height: 4px;
  border-radius: 99px;
  background: var(--tp-line);
}
.tp-prose li:nth-child(1) { width: 92%; }
.tp-prose li:nth-child(2) { width: 70%; }
.tp-prose li:nth-child(3) { width: 84%; }
.tp-prose code {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 9px;
  color: var(--tp-link);
  background: color-mix(in srgb, var(--tp-link) 14%, var(--tp-bg));
}

.nav-page { width: 100%; max-width: none; }
.nav-edit-tree { display: grid; gap: 16px; }
.nav-edit-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
  display: grid;
  gap: 10px;
}
.nav-edit-section-head, .nav-edit-group-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.nav-edit-section-head input, .nav-edit-group-head input { flex: 1 1 180px; min-width: 0; }
.nav-edit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  min-height: 8px;
}
.nav-edit-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-container);
}
.nav-edit-item.is-dragging { opacity: 0.55; }
.nav-edit-group { display: grid; gap: 8px; }
.nav-edit-handle {
  cursor: grab;
  color: var(--fg-2);
  user-select: none;
  letter-spacing: -2px;
}
.nav-edit-label { flex: 1 1 auto; min-width: 0; }
.nav-edit-actions { margin-top: 4px; }
.nav-unplaced { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nav-unplaced li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.nav-unplaced li:last-child { border-bottom: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.media-page { width: 100%; max-width: none; display: grid; gap: 14px; }
.media-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, var(--brand-light) 0%, transparent 46%),
    var(--bg-container);
}
.media-hero-copy h1 { margin-bottom: 6px; }
.media-hero-copy .muted { margin: 0; max-width: 56ch; }
.media-batch { display: grid; gap: 14px; }
/* .media-batch-bar alias kept on template during migration — styles live on .td-batch-bar */
.media-batch-actions { margin-left: auto; display: flex; gap: 8px; }
.media-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}
.media-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: var(--brand);
}
.media-check--card {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
html[data-theme="dark"] .media-check--card {
  background: rgba(24, 24, 24, 0.92);
}
.media-card.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow-1);
  background: var(--brand-light);
}
.media-col-check { width: 44px; }
.media-upload { margin: 0; }
.media-upload-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.media-upload-field { flex: 1 1 280px; min-width: 0; }
.media-upload-field label { display: block; margin-bottom: 6px; }
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.media-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-container);
  min-width: 0;
  position: relative;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.media-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-1);
}
.media-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  height: 148px;
  max-height: 148px;
  overflow: hidden;
  border-radius: 0;
  background:
    linear-gradient(45deg, var(--bg-hover) 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(-45deg, var(--bg-hover) 25%, transparent 25%) 0 6px / 12px 12px,
    var(--bg-subtle);
  border: 0;
  border-bottom: 1px solid var(--line);
}
.media-thumb img {
  max-width: 100%;
  max-height: 148px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.media-thumb--sm {
  width: 44px;
  height: 44px;
  max-height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.media-thumb--sm img {
  max-width: 44px;
  max-height: 44px;
}
.media-meta {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
  padding: 12px 14px 14px;
}
.media-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.media-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}
.media-ref {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.media-ref input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg-subtle);
}
.media-empty { text-align: center; padding: 28px 16px; }
.media-table-wrap { padding: 0; overflow: auto; }
.media-table-wrap .td-table { border: 0; border-radius: 0; }
.td-table .media-ref { min-width: 220px; }
.media-col-thumb { width: 64px; }

@media (max-width: 720px) {
  .media-grid { grid-template-columns: minmax(0, 1fr); }
  .td-table .media-ref { min-width: 160px; }
  .media-batch-actions { margin-left: 0; width: 100%; }
  .media-batch-actions .danger { width: 100%; }
}
.discovery-page {
  --disc-info: #0052d9;
  --disc-info-bg: #ecf2fe;
  --disc-info-soft: rgba(0, 82, 217, 0.1);
  --disc-model: #7a4bd6;
  --disc-model-bg: #f3eefc;
  --disc-model-soft: rgba(122, 75, 214, 0.12);
  --disc-api: #2ba471;
  --disc-api-bg: #e3f9e9;
  --disc-api-soft: rgba(43, 164, 113, 0.12);
  --disc-entry: #b25a08;
  --disc-entry-bg: #fff1e9;
  --disc-entry-soft: rgba(178, 90, 8, 0.12);
  --disc-path: #5f6b7a;
  --disc-path-bg: #eef1f5;
  --disc-path-soft: rgba(95, 107, 122, 0.12);
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: none;
}
html[data-theme="dark"] .discovery-page {
  --disc-info: #69b1ff;
  --disc-info-bg: rgba(77, 145, 255, 0.16);
  --disc-info-soft: rgba(77, 145, 255, 0.2);
  --disc-model: #b79bff;
  --disc-model-bg: rgba(122, 75, 214, 0.2);
  --disc-model-soft: rgba(183, 155, 255, 0.22);
  --disc-api: #3fb37f;
  --disc-api-bg: rgba(43, 164, 113, 0.16);
  --disc-api-soft: rgba(63, 179, 127, 0.2);
  --disc-entry: #e8935c;
  --disc-entry-bg: rgba(237, 123, 47, 0.16);
  --disc-entry-soft: rgba(232, 147, 92, 0.2);
  --disc-path: #a0a8b4;
  --disc-path-bg: rgba(160, 168, 180, 0.14);
  --disc-path-soft: rgba(160, 168, 180, 0.18);
}
.discovery-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, var(--disc-info-bg) 0%, transparent 42%),
    linear-gradient(315deg, var(--disc-model-bg) 0%, var(--bg-container) 48%);
}
.discovery-head-copy h1 { margin-bottom: 6px; }
.discovery-head-copy .muted { margin: 0; max-width: 56ch; }
.discovery-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.discovery-split {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 240px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-container);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.discovery-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: var(--bg-subtle);
  overflow: auto;
}
.discovery-group {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: var(--radius-lg);
  background: var(--bg-container);
  border: 1px solid var(--line);
}
.discovery-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 8px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}
.discovery-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 auto;
  background: var(--fg-3);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.discovery-group--info,
.discovery-item[data-discovery-tone="info"] { --tone: var(--disc-info); --tone-bg: var(--disc-info-bg); --tone-soft: var(--disc-info-soft); }
.discovery-group--model,
.discovery-item[data-discovery-tone="model"] { --tone: var(--disc-model); --tone-bg: var(--disc-model-bg); --tone-soft: var(--disc-model-soft); }
.discovery-group--api,
.discovery-item[data-discovery-tone="api"] { --tone: var(--disc-api); --tone-bg: var(--disc-api-bg); --tone-soft: var(--disc-api-soft); }
.discovery-group--entry,
.discovery-item[data-discovery-tone="entry"] { --tone: var(--disc-entry); --tone-bg: var(--disc-entry-bg); --tone-soft: var(--disc-entry-soft); }
.discovery-group--path,
.discovery-item[data-discovery-tone="path"] { --tone: var(--disc-path); --tone-bg: var(--disc-path-bg); --tone-soft: var(--disc-path-soft); }
.discovery-group--info,
.discovery-group--model,
.discovery-group--api,
.discovery-group--entry,
.discovery-group--path {
  background: linear-gradient(180deg, var(--tone-bg) 0%, var(--bg-container) 56%);
  border-color: color-mix(in srgb, var(--tone) 22%, var(--line));
}
.discovery-group-head .discovery-swatch,
.discovery-item .discovery-swatch { background: var(--tone); }
.discovery-group-head { color: var(--tone); }
.discovery-nav button.discovery-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  text-align: left !important;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  cursor: pointer;
  font: inherit;
}
html[data-theme="dark"] .discovery-nav button.discovery-item {
  background: rgba(255, 255, 255, 0.03);
}
.discovery-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
}
.discovery-nav button.discovery-item strong {
  display: block;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  color: var(--fg-1);
}
.discovery-item-hint {
  display: -webkit-box;
  width: 100%;
  padding-left: 18px;
  text-align: left;
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.discovery-nav button.discovery-item:hover {
  background: var(--tone-soft);
  border-color: color-mix(in srgb, var(--tone) 25%, transparent);
}
.discovery-nav button.discovery-item.is-active {
  border-color: color-mix(in srgb, var(--tone) 45%, var(--line));
  background: var(--tone-bg);
  box-shadow: inset 3px 0 0 var(--tone);
}
.discovery-nav button.discovery-item.is-active strong {
  color: var(--tone);
}
.discovery-nav button.discovery-item.is-active .discovery-item-hint {
  color: var(--fg-2);
}
.discovery-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-container);
}
.discovery-pane[data-active-tone="info"] { --tone: var(--disc-info); --tone-bg: var(--disc-info-bg); }
.discovery-pane[data-active-tone="model"] { --tone: var(--disc-model); --tone-bg: var(--disc-model-bg); }
.discovery-pane[data-active-tone="api"] { --tone: var(--disc-api); --tone-bg: var(--disc-api-bg); }
.discovery-pane[data-active-tone="entry"] { --tone: var(--disc-entry); --tone-bg: var(--disc-entry-bg); }
.discovery-pane[data-active-tone="path"] { --tone: var(--disc-path); --tone-bg: var(--disc-path-bg); }
.discovery-pane-head {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--tone-bg, var(--bg-subtle)) 0%, var(--bg-container) 100%);
}
.discovery-pane-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.discovery-pane-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}
.discovery-tone-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--tone-bg, var(--bg-hover));
  color: var(--tone, var(--fg-2));
  font-size: 11px;
  font-weight: 650;
}
.discovery-pane-note { margin: 0 0 0 auto; font-size: 12px; }
.discovery-url { display: flex; gap: 8px; align-items: center; min-width: 0; }
.discovery-url input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-container);
  border-color: color-mix(in srgb, var(--tone, var(--line-strong)) 25%, var(--line-strong));
}
.discovery-url a.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}
.discovery-preview {
  flex: 1 1 auto;
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  tab-size: 2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--fg-1);
  background: #f7f8fa;
  border-top: 3px solid var(--tone, var(--line));
}
html[data-theme="dark"] .discovery-preview {
  background: #171717;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  font-weight: 500;
  font-size: 13px;
}
.check-row input { width: auto; min-height: 0; }
@media (max-width: 960px) {
  .discovery-split {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .discovery-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 280px;
  }
  .discovery-preview { white-space: pre-wrap; word-break: break-word; }
}

.flash { margin-bottom: 16px; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-lg); background: var(--info-bg); color: var(--info); font-weight: 600; }
.flash--success { color: var(--success); background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 28%, transparent); }
.flash--error { color: #b42318; background: #fef3f2; border-color: #f97066; }
.flash--warning { color: var(--warning); background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 28%, transparent); }
html[data-theme="dark"] .flash--error { color: #ffb4ab; background: rgba(213, 73, 65, 0.22); border-color: rgba(232, 115, 108, 0.55); }
.legacy .err, .field-error { padding: 8px 12px; border-radius: var(--radius-lg); color: var(--danger); background: var(--danger-bg); }
.legacy .ok { padding: 8px 12px; border-radius: var(--radius-lg); color: var(--success); background: var(--success-bg); }
.pill { height: 22px; padding: 0 8px; border-radius: var(--radius); display: inline-flex; align-items: center; gap: 4px; color: var(--fg-2); background: var(--bg-hover); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; flex: 0 0 auto; background: currentColor; }
.pill--success { color: var(--success); background: var(--success-bg); }
.pill--warning { color: var(--warning); background: var(--warning-bg); }
.pill--error, .pill--danger { color: var(--danger); background: var(--danger-bg); }
.pill--info { color: var(--info); background: var(--info-bg); }
.legend { margin-bottom: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--fg-2); background: var(--bg-subtle); font-size: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.sys-tag { padding: 3px 7px; border: 1px solid var(--sys-line); border-radius: var(--radius); color: var(--sys); background: var(--sys-bg); font-size: 11px; font-weight: 600; }
.sys-tag--org { color: var(--info); border-color: transparent; background: var(--info-bg); }
.empty { padding: 44px 20px; color: var(--fg-3); text-align: center; }
.empty .e-icon { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-hover); }
.empty h3 { margin-bottom: 4px; color: var(--fg-1); font-size: 14px; }
.empty--compact { padding: 28px 12px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.3; }
.page-head .desc { margin-top: 4px; color: var(--fg-2); font-size: 12.5px; max-width: 62ch; line-height: 1.5; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn--sm { min-height: 28px; padding: 0 10px; font-size: 12px; }
.btn--danger {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}
.btn--danger:hover:not([disabled]) {
  color: #fff;
  filter: brightness(0.95);
}
.btn--danger[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
.pages-col-check {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}
.pages-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.pages-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.td-table tr.is-selected td {
  background: var(--brand-light);
}

.hero-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, #0d2b63, #123a86 55%, #1a4fb0);
  color: #fff;
  overflow: hidden;
  position: relative;
}
.hero-strip::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(105, 177, 255, 0.45), transparent 65%);
}
.hero-strip .hs-body { flex: 1 1 auto; min-width: 0; position: relative; z-index: 1; }
.hero-strip h2 { font-size: 15px; font-weight: 650; }
.hero-strip p { margin-top: 4px; font-size: 12.5px; color: rgba(255, 255, 255, 0.75); }
.hero-strip code { color: #fff; background: rgba(255, 255, 255, 0.14); }
.hero-strip .btn {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.hero-strip .btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.dash-section { margin-bottom: 14px; }
.dash-section-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.dash-section-head h2 { font-size: 15px; font-weight: 650; }
.dash-metrics { margin-bottom: 16px; }
.dash-main { margin-top: 4px; }

.grid { display: grid; gap: 12px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-container);
  box-shadow: var(--shadow-1);
}
a.stat, a.stat:hover { color: inherit; text-decoration: none; }
.stat--link { transition: border-color .15s ease, box-shadow .15s ease; }
.stat--link:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.stat-top { display: flex; align-items: center; gap: 6px; color: var(--fg-2); font-size: 12px; }
.stat-top .i { color: var(--fg-3); }
.stat-val { margin-top: 4px; font-size: 22px; font-weight: 650; letter-spacing: -0.4px; line-height: 1.15; display: flex; align-items: baseline; gap: 6px; min-height: 1.15em; }
.stat-val small { font-size: 12px; font-weight: 400; color: var(--fg-3); letter-spacing: 0; }
.stat-code { font-size: 13px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.stat-foot { margin-top: 4px; font-size: 11.5px; color: var(--fg-3); }

.panel { background: var(--bg-container); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.panel-head { padding: 10px 14px 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.panel-head h3 { font-size: 13.5px; font-weight: 650; }
.panel-body { padding: 10px 14px 14px; }
.dash-section-head .sub, .panel-head .sub { color: var(--fg-3); font-size: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--fg-3); }
.kv .v { color: var(--fg-1); font-weight: 560; }

.share-bar { margin-top: 12px; height: 8px; border-radius: 99px; background: var(--bg-active); overflow: hidden; }
.share-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #69b1ff); border-radius: 99px; }

/* .dash-table removed — use .td-table / .td-table--compact */

.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 10px; font-size: 12px; color: var(--fg-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
#bot-traffic-chart { width: 100%; height: auto; display: block; max-height: 280px; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hero-strip { flex-wrap: wrap; }
  .hero-strip .btn { width: 100%; justify-content: center; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
}

.setup-wizard { width: 100%; display: grid; gap: 16px; }
.setup-steps {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-container);
  box-shadow: var(--shadow-1);
}
.setup-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-3);
  text-decoration: none;
  white-space: nowrap;
}
.setup-step b {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 650;
  background: var(--bg-active);
  color: var(--fg-2);
}
.setup-step.is-on { color: var(--fg-1); font-weight: 650; }
.setup-step.is-on b { background: var(--brand); color: #fff; }
.setup-step.is-done b { background: var(--success); color: #fff; }
.setup-step:hover { color: var(--fg-1); }
.setup-sep {
  flex: 1 1 12px;
  min-width: 12px;
  height: 1px;
  margin: 0 10px;
  background: var(--line-strong);
}
.setup-panel { padding: 0; overflow: hidden; }
.setup-panel-head { padding: 16px 16px 0; }
.setup-panel-head h2 { font-size: 16px; font-weight: 650; margin: 0; }
.setup-panel-head .muted { margin: 6px 0 0; }
.setup-form { padding: 14px 16px 16px; display: grid; gap: 12px; background: var(--bg-subtle); }
.setup-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 14px;
  align-items: stretch;
}
.setup-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
  align-content: start;
}
.setup-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-container);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.setup-block-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
}
.setup-block-head h3 {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--fg-1);
}
.setup-block-head p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.45;
}
.setup-block-body {
  display: grid;
  gap: 2px;
  padding: 12px 14px 14px;
}
.setup-block--site .setup-block-head { border-left-color: var(--brand); background: var(--brand-soft); }
.setup-block--policy .setup-block-head { border-left-color: #2ba471; background: rgba(43, 164, 113, 0.08); }
.setup-block--company .setup-block-head { border-left-color: #b25a08; background: rgba(178, 90, 8, 0.08); }
.setup-block--host .setup-block-head { border-left-color: var(--brand); background: var(--brand-soft); }
.setup-block--path .setup-block-head { border-left-color: #7c5cbf; background: rgba(124, 92, 191, 0.08); }
.setup-block--cert .setup-block-head { border-left-color: #b25a08; background: rgba(178, 90, 8, 0.08); }
.setup-block--company { height: 100%; display: flex; flex-direction: column; }
.setup-block--company .setup-block-body { flex: 1 1 auto; }
.setup-split--domains {
  margin-bottom: 14px;
}
.setup-split--domains .setup-block { height: 100%; display: flex; flex-direction: column; }
.setup-split--domains .setup-block-body { flex: 1 1 auto; }
.setup-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.setup-badge--ok {
  color: #1f7a4d;
  background: rgba(43, 164, 113, 0.12);
}
.setup-badge--off {
  color: var(--fg-3);
  background: var(--bg-subtle);
}
.domain-host {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.domain-host-label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 650;
  color: var(--fg-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.domain-host code {
  font-size: 14px;
  font-weight: 650;
  color: var(--fg-1);
}
.domain-url-label {
  margin: 4px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
}
.domain-url {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-container);
}
.domain-url input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  margin: 0;
  padding: 0 11px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 12px;
  color: var(--fg-1);
}
.domain-url input:focus {
  outline: none;
  box-shadow: none;
}
.domain-url-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg-subtle);
  color: var(--fg-1);
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.domain-url-btn:hover {
  background: var(--bg-hover);
  color: var(--fg-1);
}
.domain-empty {
  margin: 4px 0 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  line-height: 1.55;
}
.domain-cert {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.domain-cert-item {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.domain-cert-item strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--fg-1);
}
.domain-cert-item span {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.45;
}
.domain-cert-item.is-soon {
  opacity: 0.78;
  border-style: dashed;
}
@media (max-width: 720px) {
  .domain-cert { grid-template-columns: minmax(0, 1fr); }
}
.setup-split .field-hint { margin: 4px 0 8px; }
.setup-split-note { grid-column: 1 / -1; margin: 0; }
.setup-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-container);
}
.setup-subhead {
  margin: 18px 0 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
  color: var(--fg-1);
}
.setup-form textarea,
.setup-block textarea {
  width: 100%;
  min-height: 148px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-container);
  color: var(--fg-1);
  font: inherit;
  line-height: 1.55;
}
@media (max-width: 900px) {
  .setup-split { grid-template-columns: minmax(0, 1fr); }
  .setup-block--company { height: auto; }
}
.setup-done { padding: 18px 16px 16px; display: grid; gap: 12px; }
.setup-done h2 { font-size: 17px; font-weight: 650; margin: 0; }
.setup-summary { display: grid; gap: 10px; margin: 0; }
.setup-summary > div { display: grid; gap: 2px; }
.setup-summary dt { font-size: 12px; color: var(--fg-3); }
.setup-summary dd { margin: 0; font-size: 13.5px; color: var(--fg-1); }
@media (max-width: 720px) {
  .setup-sep { display: none; }
  .setup-steps { gap: 10px; }
}

.overlay, .cmdk { position: fixed; inset: 0; z-index: 1000; padding: 8vh 16px 16px; display: flex; align-items: flex-start; justify-content: center; background: rgba(0, 0, 0, .45); }
.modal, .cmdk-panel { width: 100%; max-width: 560px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--bg-container); box-shadow: var(--shadow-3); }
.modal-head, .modal-foot { padding: 16px 20px; display: flex; align-items: center; gap: 10px; }
.modal-head h3 { flex: 1 1 auto; }
.modal-body { padding: 4px 20px 16px; }
.modal-foot { justify-content: flex-end; }
.media-picker { max-width: 640px; }
.media-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
  max-height: min(50vh, 420px);
  overflow: auto;
}
.media-picker-item {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  cursor: pointer;
  text-align: left;
}
.media-picker-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
}
.media-picker-item span {
  font-size: 11px;
  color: var(--fg-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmdk-input { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.cmdk-input input { border: 0; box-shadow: none; }
.cmdk-list { min-height: 90px; padding: 14px 16px; color: var(--fg-3); }
.auth-main { min-height: 100%; padding: 28px; }
.login { max-width: 420px; margin: 10vh auto; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-container); box-shadow: var(--shadow-1); }

@media (max-width: 860px) {
  .aside { position: fixed; z-index: 900; height: 100%; box-shadow: var(--shadow-3); }
  body:not(.side-open) .aside { width: 0; flex-basis: 0; border: 0; }
  .mobile-menu { display: inline-grid; }
  .content { padding: 16px 14px 48px; }
  .search-trigger { width: 34px; min-width: 0; padding: 0; justify-content: center; }
  .search-trigger .grow, .search-trigger kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
