:root {
  --ink: #172a36;
  --ink-soft: #536774;
  --ink-faint: #8fa0a9;
  --paper: #f5f7f6;
  --card: #ffffff;
  --line: #dde5e6;
  --line-strong: #c9d5d7;
  --nav: #112b3c;
  --nav-soft: #1a3b4e;
  --teal: #278f86;
  --teal-soft: #dff2ef;
  --gold: #d69b3c;
  --gold-soft: #fff1d6;
  --red: #c55b5d;
  --red-soft: #fae6e5;
  --blue: #4b78a5;
  --blue-soft: #e6eff8;
  --shadow: 0 18px 45px rgba(22, 48, 62, .08);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); }
body { min-width: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(39, 143, 134, .25); outline-offset: 2px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: 0 0 248px; display: flex; flex-direction: column; padding: 27px 16px 18px; color: #e8f0f1; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 31px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #17313e; background: var(--gold); font-size: 21px; font-weight: 800; letter-spacing: -.06em; }
.brand-title { font-size: 15px; font-weight: 750; letter-spacing: .01em; }
.brand-caption { margin-top: 3px; color: #9fb7be; font-size: 11px; }
.nav-section-label { margin: 17px 12px 8px; color: #70909a; font-size: 10px; font-weight: 750; letter-spacing: .15em; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 10px; margin: 2px 0; padding: 11px 12px; color: #aac0c6; background: transparent; text-align: left; font-size: 13px; transition: .18s ease; }
.nav-item:hover { color: #f1f7f7; background: rgba(255,255,255,.07); }
.nav-item.active { color: #112b3c; background: #e9f3f1; box-shadow: 0 5px 16px rgba(0,0,0,.12); font-weight: 700; }
.nav-icon { width: 17px; color: #7ea9ab; font-size: 16px; text-align: center; line-height: 1; }
.nav-item.active .nav-icon { color: var(--teal); }
.sidebar-footer { margin-top: auto; padding: 18px 12px 3px; color: #7d9aa3; font-size: 11px; }
.readonly-note { display: flex; align-items: center; gap: 7px; color: #a6c4c5; }
.sidebar-version { margin-top: 11px; color: #607c86; }

.app-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.8); backdrop-filter: blur(12px); }
.topbar-left, .topbar-actions, .breadcrumb { display: flex; align-items: center; }
.topbar-left { min-width: 0; }
.breadcrumb { gap: 11px; min-width: 0; }
.breadcrumb-separator { color: var(--line-strong); }
.breadcrumb #page-heading { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 14px; font-weight: 700; }
.eyebrow { color: var(--ink-faint); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.topbar-actions { gap: 10px; }
.connection-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 31px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: #fff; font-size: 11px; }
.connection-pill.connected { color: #246d68; border-color: #bfe3de; background: var(--teal-soft); }
.connection-pill.error { color: #9b484a; border-color: #efc4c1; background: var(--red-soft); }
.status-dot { width: 7px; height: 7px; display: inline-block; flex: 0 0 7px; border-radius: 50%; background: var(--ink-faint); }
.status-dot.teal { background: #5bc4b5; box-shadow: 0 0 0 3px rgba(91,196,181,.12); }
.status-dot.gray { background: #a9b7bb; }
.status-dot.red { background: var(--red); }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; font-size: 19px; line-height: 1; transition: .18s ease; }
.icon-button:hover { color: var(--ink); border-color: var(--line-strong); background: #f9fbfa; }
.token-button { min-height: 34px; padding: 0 12px; border: 1px solid #d4e4e3; border-radius: 9px; color: #286e6b; background: #eff8f6; font-size: 12px; font-weight: 700; }
.token-button:hover { border-color: #a9d3cf; background: var(--teal-soft); }
.token-key { font-size: 17px; vertical-align: -1px; }
.mobile-menu { display: none; width: 34px; height: 34px; margin-right: 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; }

.content { width: min(1480px, 100%); flex: 1; margin: 0 auto; padding: 36px 38px 54px; }
.app-footer { display: flex; justify-content: center; gap: 9px; padding: 0 28px 20px; color: #9aa9ad; font-size: 10px; }
.footer-separator { color: #c3cdce; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 27px; }
.page-intro h1 { margin: 7px 0 7px; color: var(--ink); font-size: clamp(25px, 3vw, 34px); line-height: 1.1; letter-spacing: -.045em; }
.page-intro p { max-width: 720px; margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.page-meta { flex: 0 0 auto; color: var(--ink-faint); font-size: 11px; text-align: right; }
.page-meta strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 17px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { min-height: 126px; position: relative; overflow: hidden; padding: 19px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.kpi-card::after { content: ""; position: absolute; width: 86px; height: 86px; right: -28px; bottom: -35px; border-radius: 50%; border: 13px solid rgba(39,143,134,.07); }
.kpi-label { color: var(--ink-faint); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.kpi-value { margin-top: 12px; color: var(--ink); font-size: 31px; font-weight: 760; letter-spacing: -.06em; }
.kpi-foot { margin-top: 7px; color: var(--ink-soft); font-size: 11px; }
.kpi-card.accent { border-top: 3px solid var(--teal); }
.kpi-card.gold { border-top: 3px solid var(--gold); }
.kpi-card.blue { border-top: 3px solid var(--blue); }
.kpi-card.red { border-top: 3px solid var(--red); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(0, .87fr); gap: 16px; margin-bottom: 16px; }
.dashboard-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 14px; border-bottom: 1px solid #edf1f1; }
.panel-title { margin: 0; color: var(--ink); font-size: 14px; font-weight: 750; }
.panel-subtitle { margin: 5px 0 0; color: var(--ink-faint); font-size: 11px; line-height: 1.45; }
.panel-body { padding: 17px 20px 20px; }
.panel-link { border: 0; padding: 0; color: var(--teal); background: transparent; font-size: 11px; font-weight: 700; }
.panel-link:hover { text-decoration: underline; }
.bar-list { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(100px, 2fr) 38px; align-items: center; gap: 11px; color: var(--ink-soft); font-size: 11px; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; overflow: hidden; border-radius: 99px; background: #edf2f1; }
.bar-fill { height: 100%; min-width: 2px; border-radius: inherit; background: var(--teal); transition: width .4s ease; }
.bar-fill.gold { background: var(--gold); }
.bar-fill.blue { background: var(--blue); }
.bar-fill.red { background: var(--red); }
.bar-count { color: var(--ink); font-weight: 750; text-align: right; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric-mini { padding: 13px 12px; border: 1px solid #e8eeee; border-radius: 10px; background: #fbfcfc; }
.metric-mini-name { color: var(--ink-faint); font-size: 10px; font-weight: 700; }
.metric-mini-value { margin-top: 7px; color: var(--ink); font-size: 19px; font-weight: 760; letter-spacing: -.04em; }
.metric-mini-foot { margin-top: 3px; color: var(--ink-faint); font-size: 10px; }
.rank-list { display: grid; gap: 8px; }
.rank-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eef2f2; font-size: 12px; }
.rank-row:last-child { border-bottom: 0; }
.rank-name { min-width: 0; overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.rank-count { flex: 0 0 auto; color: var(--ink); font-size: 11px; font-weight: 750; }
.activity-list { display: grid; }
.row-button.activity-row { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef2f2; }
.activity-row:last-child { border-bottom: 0; }
.activity-marker { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--teal); background: var(--teal-soft); font-size: 13px; font-weight: 800; }
.activity-main { min-width: 0; }
.activity-title { display: block; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
.activity-type { display: block; margin-top: 3px; color: var(--ink-faint); font-size: 10px; }
.activity-time { color: var(--ink-faint); font-size: 10px; white-space: nowrap; }
.empty-inline { padding: 20px 0; color: var(--ink-faint); font-size: 12px; text-align: center; }
.welcome-state { display: grid; place-items: center; min-height: 50vh; color: var(--ink-soft); text-align: center; }
.welcome-state h1 { margin: 14px 0 5px; color: var(--ink); font-size: 24px; }
.welcome-state p { margin: 0; font-size: 13px; }
.loading-orb { width: 45px; height: 45px; border: 4px solid #dcebea; border-top-color: var(--teal); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.search-box { position: relative; flex: 1 1 270px; min-width: 190px; }
.search-box input { width: 100%; height: 39px; padding: 0 13px 0 36px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: 12px; }
.search-box input::placeholder { color: #a4b0b3; }
.search-icon { position: absolute; top: 10px; left: 13px; color: var(--ink-faint); font-size: 15px; pointer-events: none; }
.filter-select { height: 39px; min-width: 132px; padding: 0 29px 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: #fff; font-size: 12px; }
.button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; font-size: 12px; font-weight: 700; }
.button:hover { border-color: var(--line-strong); color: var(--ink); }
.button.primary { border-color: var(--teal); color: #fff; background: var(--teal); }
.button.primary:hover { border-color: #1e756e; background: #1e756e; }
.button.subtle { color: var(--ink-soft); background: #f5f8f7; }
.table-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.data-table th { padding: 12px 17px; border-bottom: 1px solid var(--line); color: var(--ink-faint); background: #fbfcfc; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-align: left; white-space: nowrap; }
.sortable-header { width: 100%; min-height: 16px; display: inline-flex; align-items: center; justify-content: flex-start; gap: 7px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; letter-spacing: inherit; text-align: left; white-space: nowrap; }
.sortable-header:hover, .sortable-header:focus-visible, .sortable-header.active { color: var(--teal); }
.sortable-header:focus-visible { outline: 2px solid #8fc8c2; outline-offset: 4px; }
.sort-indicator { width: 12px; flex: 0 0 12px; color: #a5b4b6; font-size: 8px; letter-spacing: 0; text-align: center; }
.sortable-header.active .sort-indicator { color: var(--teal); }
.data-table td { padding: 13px 17px; border-bottom: 1px solid #edf1f1; color: var(--ink-soft); font-size: 12px; vertical-align: middle; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #f7fbfa; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.row-button { width: 100%; display: block; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.row-button:hover .primary-text { color: var(--teal); }
.primary-text { display: block; max-width: 290px; overflow: hidden; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.secondary-text { display: block; max-width: 290px; margin-top: 4px; overflow: hidden; color: var(--ink-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.expression-cell { display: block; max-width: 350px; overflow: hidden; color: #2f5961; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.queue-table { min-width: 920px; }
.queue-expression { max-width: 380px; color: #2f5961; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.queue-expression summary { max-width: 380px; overflow: hidden; cursor: pointer; text-overflow: ellipsis; white-space: nowrap; }
.queue-expression[open] summary { color: var(--teal); white-space: normal; overflow-wrap: anywhere; }
.queue-expression code { display: block; max-width: 520px; margin-top: 8px; padding: 8px; color: var(--ink); background: #f5f8f7; font: inherit; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 240px; }
.chip { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; border-radius: 5px; color: #55747a; background: #edf5f3; font-size: 10px; white-space: nowrap; }
.chip.gray { color: #687a80; background: #eef1f2; }
.chip.gold { color: #986c27; background: var(--gold-soft); }
.chip.red { color: #a44d4f; background: var(--red-soft); }
.chip.blue { color: #4c6d93; background: var(--blue-soft); }
.status-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 8px; border-radius: 6px; color: #55747a; background: #edf3f2; font-size: 10px; font-weight: 750; white-space: nowrap; }
.status-badge.ready, .status-badge.pass, .status-badge.active, .status-badge.completed, .status-badge.evaluated { color: #26766e; background: var(--teal-soft); }
.status-badge.near_pass, .status-badge.pending, .status-badge.queued, .status-badge.registered { color: #946c2a; background: var(--gold-soft); }
.status-badge.iterate, .status-badge.failed, .status-badge.blocked, .status-badge.precheck_blocked { color: #a54e50; background: var(--red-soft); }
.status-badge.linked, .status-badge.info { color: #4e6d91; background: var(--blue-soft); }
.score { display: inline-flex; align-items: baseline; gap: 3px; color: var(--ink); font-weight: 800; }
.score small { color: var(--ink-faint); font-size: 10px; font-weight: 500; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; border-top: 1px solid #edf1f1; }
.pagination-info { color: var(--ink-faint); font-size: 11px; }
.pagination-actions { display: flex; align-items: center; gap: 7px; }
.page-button { min-width: 34px; height: 31px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: #fff; font-size: 12px; }
.page-button:disabled { cursor: not-allowed; opacity: .42; }
.page-button:not(:disabled):hover { border-color: var(--teal); color: var(--teal); }
.page-size { height: 31px; padding: 0 24px 0 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: #fff; font-size: 11px; }
.table-empty { padding: 65px 20px; color: var(--ink-faint); text-align: center; }
.table-empty strong { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 14px; }
.error-banner { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-bottom: 15px; padding: 12px 14px; border: 1px solid #efc4c1; border-radius: 9px; color: #914648; background: var(--red-soft); font-size: 12px; }

.catalog-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.catalog-stat { min-width: 0; padding: 16px 17px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(145deg, #fff, #f8fbfa); box-shadow: var(--shadow); }
.catalog-stat > span { display: block; color: var(--ink-faint); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.catalog-stat strong { display: block; margin-top: 8px; overflow: hidden; color: var(--ink); font-size: 21px; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.catalog-stat small { display: block; margin-top: 5px; overflow: hidden; color: var(--ink-faint); font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-filter-panel { margin-bottom: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.catalog-filter-grid { display: grid; grid-template-columns: 1.25fr 1.35fr .8fr .75fr; gap: 10px; }
.catalog-filter { min-width: 0; display: grid; gap: 6px; }
.catalog-filter > span { color: var(--ink-faint); font-size: 10px; font-weight: 750; }
.catalog-filter select, .catalog-filter input { width: 100%; height: 38px; min-width: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; font-size: 11px; }
.catalog-search-row { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.catalog-table { min-width: 1080px; }
.catalog-table .primary-text { max-width: 360px; }
.mono-primary { color: #2f5961; font-family: "SFMono-Regular", Consolas, monospace; }
.status-badge.matrix { color: #26766e; background: var(--teal-soft); }
.status-badge.vector { color: #946c2a; background: var(--gold-soft); }
.catalog-pack-builder { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(460px, 1.2fr); gap: 28px; align-items: end; margin-top: 17px; padding: 22px; border: 1px solid #beddd9; border-radius: var(--radius); background: linear-gradient(130deg, #f0faf8, #fff 62%); box-shadow: var(--shadow); }
.catalog-pack-copy h2, .catalog-pack-result h2 { margin: 6px 0 7px; color: var(--ink); font-size: 20px; letter-spacing: -.035em; }
.catalog-pack-copy p, .catalog-pack-header p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.catalog-pack-controls { display: grid; grid-template-columns: minmax(230px, 1fr) 130px auto; gap: 9px; align-items: end; }
.catalog-pack-note { grid-column: 1 / -1; padding-top: 11px; border-top: 1px solid rgba(39,143,134,.14); color: var(--ink-faint); font-size: 10px; }
.catalog-pack-result { margin-top: 17px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.catalog-pack-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; border-bottom: 1px solid var(--line); }
.catalog-pack-header .button { flex: 0 0 auto; }
.catalog-evidence-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #fbfcfc; }
.catalog-evidence-grid > div { padding: 13px 15px; border-right: 1px solid #e8eeee; }
.catalog-evidence-grid > div:last-child { border-right: 0; }
.catalog-evidence-grid span, .catalog-evidence-grid strong { display: block; }
.catalog-evidence-grid span { color: var(--ink-faint); font-size: 9px; font-weight: 750; }
.catalog-evidence-grid strong { margin-top: 5px; color: var(--ink); font-size: 17px; }
.catalog-pack-table { min-width: 900px; }
.catalog-pack-table th:first-child, .catalog-pack-table td:first-child { width: 38px; padding-right: 0; text-align: center; }
.catalog-pack-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--teal); }
.catalog-validation { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 14px 20px 0; padding: 12px 13px; border: 1px solid #cfe5e2; border-radius: 9px; color: #286d68; background: #eff9f7; font-size: 11px; }
.catalog-validation strong, .catalog-validation span { display: block; }
.catalog-validation span { margin-top: 3px; font-size: 9px; opacity: .8; }
.catalog-validation.block { border-color: #efc4c1; color: #914648; background: var(--red-soft); }
.catalog-footnote { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--gold); color: var(--ink-soft); background: #fffaf0; font-size: 10px; line-height: 1.65; }
.table-empty.standalone { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }

.drawer-backdrop { position: fixed; z-index: 30; inset: 0; background: rgba(17,43,60,.28); backdrop-filter: blur(2px); }
.detail-drawer { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(620px, 94vw); overflow: hidden; transform: translateX(100%); border-left: 1px solid var(--line); background: #fff; box-shadow: -20px 0 55px rgba(17,43,60,.15); transition: transform .24s ease; }
.detail-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 26px 26px 19px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { max-width: 480px; margin: 6px 0 0; overflow: hidden; color: var(--ink); font-size: 20px; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { height: calc(100% - 103px); overflow-y: auto; padding: 21px 26px 40px; }
.detail-section { margin-bottom: 22px; }
.detail-section h3 { margin: 0 0 10px; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; }
.detail-item { min-width: 0; padding: 10px 11px; border: 1px solid #e8eeee; border-radius: 9px; background: #fbfcfc; }
.detail-key { color: var(--ink-faint); font-size: 10px; font-weight: 700; }
.detail-value { margin-top: 5px; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; line-height: 1.55; }
.detail-block { margin-top: 10px; padding: 13px; overflow-x: auto; border: 1px solid #e8eeee; border-radius: 9px; background: #fbfcfc; }
.detail-block pre { margin: 0; color: #315862; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.detail-list { display: grid; gap: 7px; }
.detail-list-row { padding: 10px 11px; border: 1px solid #e8eeee; border-radius: 9px; background: #fbfcfc; }
.detail-loading { display: grid; place-items: center; min-height: 270px; color: var(--ink-faint); font-size: 12px; }
.detail-loading::before { content: ""; width: 28px; height: 28px; margin-bottom: 11px; border: 3px solid #dcebea; border-top-color: var(--teal); border-radius: 50%; animation: spin 1s linear infinite; }

.token-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; overflow: hidden; border: 0; border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 25px 80px rgba(17,43,60,.25); }
.token-dialog::backdrop { background: rgba(17,43,60,.48); backdrop-filter: blur(4px); }
.token-dialog form { padding: 30px; }
.dialog-mark { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 12px; color: #17313e; background: var(--gold); font-size: 23px; font-weight: 800; }
.token-dialog h2 { margin: 7px 0 9px; color: var(--ink); font-size: 24px; letter-spacing: -.045em; }
.dialog-copy { margin: 0 0 21px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.field-label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 11px; font-weight: 750; }
.token-input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: #fbfcfc; font-size: 12px; }
.dialog-error { min-height: 17px; margin-top: 8px; color: var(--red); font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dialog-hint { margin-top: 18px; padding-top: 14px; border-top: 1px solid #edf1f1; color: var(--ink-faint); font-size: 10px; line-height: 1.55; }
.toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; max-width: min(390px, calc(100vw - 44px)); padding: 11px 14px; border: 1px solid #cfe5e2; border-radius: 9px; color: #286d68; background: #eff9f7; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) {
  .sidebar { width: 218px; flex-basis: 218px; }
  .topbar, .content { padding-left: 27px; padding-right: 27px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-pack-builder { grid-template-columns: 1fr; }
  .catalog-evidence-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog-evidence-grid > div:nth-child(3) { border-right: 0; }
  .catalog-evidence-grid > div:nth-child(-n+3) { border-bottom: 1px solid #e8eeee; }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; transform: translateX(-100%); width: 248px; box-shadow: 18px 0 40px rgba(17,43,60,.18); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-grid; place-items: center; }
  .topbar { min-height: 66px; padding: 0 17px; }
  .content { padding: 27px 17px 45px; }
  .topbar-actions { gap: 6px; }
  .connection-pill { display: none; }
  .token-button { padding: 0 9px; }
  .page-intro { display: block; }
  .page-meta { margin-top: 17px; text-align: left; }
  .dashboard-grid, .dashboard-grid.equal { grid-template-columns: 1fr; }
  .app-footer { padding: 0 15px 17px; font-size: 9px; text-align: center; }
  .catalog-pack-controls { grid-template-columns: 1fr 110px; }
  .catalog-proxy-input { grid-column: 1 / -1; }
  .catalog-pack-header { display: grid; }
}
@media (max-width: 500px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-card { min-height: 111px; padding: 15px; }
  .kpi-value { margin-top: 9px; font-size: 25px; }
  .kpi-foot { font-size: 10px; }
  .panel-header, .panel-body { padding-left: 15px; padding-right: 15px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer-header, .drawer-body { padding-left: 18px; padding-right: 18px; }
  .detail-grid { grid-template-columns: 1fr; }
  .catalog-stats, .catalog-filter-grid { grid-template-columns: 1fr; }
  .catalog-search-row { align-items: stretch; flex-direction: column; }
  .catalog-pack-controls { grid-template-columns: 1fr; }
  .catalog-proxy-input { grid-column: auto; }
  .catalog-evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-evidence-grid > div:nth-child(3) { border-right: 1px solid #e8eeee; }
  .catalog-evidence-grid > div:nth-child(even) { border-right: 0; }
  .catalog-evidence-grid > div:nth-child(-n+4) { border-bottom: 1px solid #e8eeee; }
  .catalog-validation { display: grid; }
}
