.arch-root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --header-h: 56px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
}
.arch-root *{ box-sizing: border-box; }
.arch-root { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
.arch-root { margin: 0; background: var(--bg); font-size: 14px; line-height: 1.5; }
.arch-root h1, .arch-root h2, .arch-root h3, .arch-root h4{ margin: 0; line-height: 1.25; }
.arch-root button, .arch-root input, .arch-root select, .arch-root textarea{ font: inherit; color: inherit; }
.arch-root kbd{ font: 12px ui-monospace, Consolas, monospace; background: #f1f5f9; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }
.arch-root code{ font: 12.5px ui-monospace, Consolas, monospace; background: #eef2ff; color: #3730a3; padding: 1px 5px; border-radius: 4px; }
.arch-root .muted{ color: var(--muted); }
.arch-root .small{ font-size: 12px; }

.arch-root /* ---------- Header ---------- */
.topbar{
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px; background: #0f172a; color: #fff;
}
.arch-root .brand{ display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; white-space: nowrap; }
.arch-root .topbar nav{ display: flex; gap: 4px; overflow-x: auto; }
.arch-root .topbar nav a{ color: #cbd5e1; text-decoration: none; padding: 6px 12px; border-radius: 6px; white-space: nowrap; }
.arch-root .topbar nav a:hover{ background: #1e293b; color: #fff; }

.arch-root /* ---------- App layout ---------- */
.app{
  display: grid; grid-template-columns: 236px minmax(0, 1fr) 340px;
  height: calc(100vh - var(--header-h)); min-height: 600px;
  border-bottom: 1px solid var(--border);
}
.arch-root .palette, .arch-root .side{ background: var(--panel); overflow-y: auto; }
.arch-root .palette{ border-right: 1px solid var(--border); padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.arch-root .side{ border-left: 1px solid var(--border); }
.arch-root .panel-head h2{ font-size: 15px; }
.arch-root .search{ width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.arch-root .search:focus{ outline: 2px solid #bfdbfe; border-color: var(--primary); }

.arch-root .palette-list{ display: flex; flex-direction: column; gap: 2px; }
.arch-root .pal-group{ font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 4px 4px; }
.arch-root .pal-item{
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: grab;
}
.arch-root .pal-item:hover{ background: #f1f5f9; border-color: var(--border); }
.arch-root .pal-item:active{ cursor: grabbing; }
.arch-root .pal-icon{ flex: none; width: 30px; height: 30px; border-radius: 7px; color: #fff; font-size: 9.5px; font-weight: 800; display: grid; place-items: center; }
.arch-root .pal-name{ font-weight: 600; font-size: 13px; }

.arch-root .legend{ margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.arch-root .legend h3{ font-size: 12px; margin-bottom: 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.arch-root .legend-row{ display: flex; align-items: center; gap: 8px; font-size: 12px; color: #334155; padding: 2px 0; }

.arch-root /* ---------- Stage ---------- */
.stage{ display: flex; flex-direction: column; min-width: 0; }
.arch-root .toolbar{
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.arch-root .toolbar button, .arch-root .toolbar select, .arch-root .panel button{
  padding: 5px 11px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; cursor: pointer; font-size: 13px;
}
.arch-root .toolbar button:hover, .arch-root .panel button:hover{ background: #f1f5f9; }
.arch-root .toolbar button:disabled{ opacity: .45; cursor: default; background: #fff; }
.arch-root button.primary{ background: var(--primary) !important; border-color: var(--primary) !important; color: #fff; font-weight: 600; }
.arch-root button.primary:hover{ background: var(--primary-dark) !important; }
.arch-root button.danger{ color: #fff; background: var(--danger) !important; border-color: var(--danger) !important; }
.arch-root button.danger-ghost{ color: var(--danger); }
.arch-root .toolbar .sep{ width: 1px; height: 22px; background: var(--border); margin: 0 2px; }
.arch-root .toolbar .spacer{ flex: 1; }
.arch-root .toggle{ display: flex; align-items: center; gap: 4px; font-size: 13px; color: #334155; cursor: pointer; user-select: none; }
.arch-root .rps{ display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.arch-root .rps input{ width: 72px; padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 6px; }

.arch-root .canvas-wrap{ position: relative; flex: 1; min-height: 0; overflow: hidden; background: #f8fafc; }
.arch-root #canvas{ width: 100%; height: 100%; display: block; touch-action: none; user-select: none; cursor: default; }
.arch-root #canvas.panning{ cursor: grabbing; }
.arch-root .canvas-wrap.drop-target{ outline: 3px dashed #93c5fd; outline-offset: -6px; }
.arch-root .empty-hint{ position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; color: var(--muted); }
.arch-root .empty-hint h3{ font-size: 20px; color: #334155; margin-bottom: 6px; }
.arch-root .zoom-ctrls{
  position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 2px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 3px; box-shadow: 0 2px 8px rgba(15,23,42,.08);
}
.arch-root .zoom-ctrls button{ border: none; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.arch-root .zoom-ctrls button:hover{ background: #f1f5f9; }
.arch-root #zoom-label{ font-size: 12px; min-width: 42px; text-align: center; color: var(--muted); }

.arch-root /* ---------- Side panels ---------- */
.panel{ padding: 14px 16px; border-bottom: 1px solid var(--border); }
.arch-root .panel h3{ font-size: 14px; margin-bottom: 10px; }
.arch-root .panel h4{ font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.arch-root .insp-head{ display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.arch-root .insp-icon{ flex: none; width: 38px; height: 38px; border-radius: 9px; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.arch-root .insp-type{ font-weight: 700; }
.arch-root .insp-desc{ font-size: 12px; color: var(--muted); }
.arch-root .field{ display: flex; flex-direction: column; gap: 3px; margin-bottom: 9px; font-size: 12px; font-weight: 600; color: #334155; min-width: 0; }
.arch-root .field i{ font-style: normal; font-weight: 400; color: var(--muted); }
.arch-root .field input, .arch-root .field select, .arch-root .field textarea{ width: 100%; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; font-weight: 400; font-size: 13px; }
.arch-root .field input:focus, .arch-root .field select:focus, .arch-root .field textarea:focus{ outline: 2px solid #bfdbfe; border-color: var(--primary); }
.arch-root .field input[type=range]{ padding: 0; }
.arch-root .field textarea{ resize: vertical; min-height: 48px; }
.arch-root .field .help{ font-weight: 400; color: var(--muted); font-size: 11.5px; }
.arch-root .field-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.arch-root .btn-row{ display: flex; gap: 6px; margin-top: 12px; }
.arch-root .tips{ margin: 0; padding-left: 18px; color: #334155; font-size: 13px; }
.arch-root .tips li{ margin-bottom: 4px; }

.arch-root .metric-box{ background: #f8fafc; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; margin-top: 4px; font-size: 12.5px; }
.arch-root .metric-line{ display: flex; justify-content: space-between; gap: 8px; }
.arch-root .metric-line b{ font-variant-numeric: tabular-nums; }
.arch-root .bar{ height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin: 6px 0 2px; }
.arch-root .bar > span{ display: block; height: 100%; border-radius: 3px; }

.arch-root .chips{ display: flex; flex-wrap: wrap; gap: 5px; }
.arch-root .chip{
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 3px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font-size: 12px; cursor: pointer; max-width: 100%;
}
.arch-root .chip:hover{ border-color: #94a3b8; }
.arch-root .chip .dot{ width: 16px; height: 16px; border-radius: 50%; flex: none; }
.arch-root .chip.plain{ padding: 2px 9px; }
.arch-root .chip-arrow{ color: var(--muted); font-size: 12px; align-self: center; }

.arch-root .cards4{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.arch-root .stat{ background: #f8fafc; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; }
.arch-root .stat-label{ font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.arch-root .stat-value{ font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.arch-root .stat-sub{ font-size: 11px; color: var(--muted); }
.arch-root .stat.bad{ background: #fef2f2; border-color: #fecaca; }
.arch-root .stat.bad .stat-value{ color: var(--danger); }

.arch-root .load-table{ width: 100%; border-collapse: collapse; font-size: 12.5px; }
.arch-root .load-table td{ padding: 3px 0; vertical-align: middle; }
.arch-root .load-table td.name{ max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.arch-root .load-table td.name:hover{ text-decoration: underline; }
.arch-root .load-table td.num{ text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 8px; }
.arch-root .load-table td.barcell{ width: 80px; padding-left: 8px; }
.arch-root .load-table .bar{ margin: 0; }

.arch-root .findings{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.arch-root .finding{ display: flex; gap: 8px; padding: 7px 9px; border-radius: 8px; font-size: 12.5px; border: 1px solid; }
.arch-root .finding .ico{ flex: none; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }
.arch-root .finding.error{ background: #fef2f2; border-color: #fecaca; } .arch-root .finding.error .ico{ background: var(--danger); }
.arch-root .finding.warn{ background: #fffbeb; border-color: #fde68a; } .arch-root .finding.warn .ico{ background: var(--warn); }
.arch-root .finding.info{ background: #eff6ff; border-color: #bfdbfe; } .arch-root .finding.info .ico{ background: var(--primary); }
.arch-root .finding.ok{ background: #f0fdf4; border-color: #bbf7d0; } .arch-root .finding.ok .ico{ background: var(--ok); }
.arch-root .finding.clickable{ cursor: pointer; }
.arch-root .finding.clickable:hover{ filter: brightness(.97); }

.arch-root /* ---------- Docs ---------- */
.docs{ padding: 56px 24px; background: #fff; }
.arch-root .docs.alt{ background: var(--bg); }
.arch-root .docs-inner{ max-width: 1040px; margin: 0 auto; }
.arch-root .docs h2{ font-size: 28px; margin-bottom: 14px; }
.arch-root .docs h3{ font-size: 17px; margin: 22px 0 10px; }
.arch-root .lead{ font-size: 16.5px; color: #334155; max-width: 820px; }
.arch-root .cards{ display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 24px 0; }
.arch-root .card{ border: 1px solid var(--border); border-radius: 12px; padding: 18px; background: #fff; }
.arch-root .card h3{ margin: 10px 0 6px; font-size: 15.5px; }
.arch-root .card p{ margin: 0; color: #475569; }
.arch-root .card-icon{ width: 30px; height: 30px; border-radius: 8px; color: #fff; font-weight: 800; display: grid; place-items: center; }
.arch-root .steps{ padding-left: 22px; font-size: 15px; color: #334155; }
.arch-root .steps li{ margin-bottom: 10px; padding-left: 4px; }
.arch-root .shortcuts{ border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; min-width: 520px; }
.arch-root .shortcuts td{ padding: 8px 14px; border-bottom: 1px solid var(--border); }
.arch-root .shortcuts td:first-child{ font-weight: 600; width: 230px; }
.arch-root .model-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 8px 32px; }
.arch-root .model-grid ul{ padding-left: 20px; color: #334155; margin: 0; }
.arch-root .model-grid li{ margin-bottom: 6px; }
.arch-root .footer{ text-align: center; color: var(--muted); padding: 24px; font-size: 13px; }

.arch-root /* ---------- Modal & toast ---------- */
.modal{ position: fixed; inset: 0; background: rgba(15,23,42,.5); display: grid; place-items: center; z-index: 50; padding: 20px; }
.arch-root .modal[hidden]{ display: none; }
.arch-root .modal-card{ background: #fff; border-radius: 14px; width: min(780px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.arch-root .modal-head{ display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.arch-root .modal-.arch-root{ padding: 16px 18px; overflow: auto; }
.arch-root .icon-btn{ border: none; background: none; font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.arch-root .icon-btn:hover{ background: #f1f5f9; }
.arch-root .code-area{ width: 100%; height: 340px; font: 12.5px/1.5 ui-monospace, Consolas, monospace; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #0f172a; color: #e2e8f0; resize: vertical; }
.arch-root .modal-opts{ display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.arch-root .modal-opts select{ padding: 4px 8px; border: 1px solid #cbd5e1; border-radius: 6px; }
.arch-root .modal-actions{ display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.arch-root .modal-actions button{ padding: 7px 14px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; cursor: pointer; }
.arch-root .modal-actions .muted{ font-size: 12px; margin-left: auto; }
.arch-root .toast{
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: #0f172a; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; transition: .2s; z-index: 60;
}
.arch-root .toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1150px) {
  .arch-root .app{ grid-template-columns: 200px minmax(0, 1fr) 290px; }
  .arch-root .model-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .arch-root .app{ grid-template-columns: 1fr; height: auto; }
  .arch-root .palette{ max-height: 260px; }
  .arch-root .stage{ height: 70vh; }
  .arch-root .topbar nav{ display: none; }
}

.arch-root /* ---------- Hover help ---------- */
.tooltip{
  position: fixed; z-index: 100; max-width: 330px; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: #0f172a; color: #f1f5f9; font-size: 12.5px; line-height: 1.5; padding: 9px 12px; border-radius: 9px;
  box-shadow: 0 8px 24px rgba(15,23,42,.28); white-space: pre-line;
}
.arch-root .tooltip.show{ opacity: 1; }
.arch-root .tip-i, .arch-root .field .tip-i, .arch-root .stat-label .tip-i{
  display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 5px; vertical-align: 1px;
  border-radius: 50%; background: #e2e8f0; color: #475569; font: 700 9.5px/1 Inter, "Segoe UI", system-ui, sans-serif;
  font-style: normal; text-transform: none; letter-spacing: 0; cursor: help;
}
.arch-root [data-tip]:hover > .tip-i, .arch-root [data-tip]:hover > span > .tip-i, .arch-root [data-tip]:hover .stat-label .tip-i{ background: var(--primary); color: #fff; }
.arch-root .legend-row[data-tip], .arch-root .stat[data-tip], .arch-root h4[data-tip], .arch-root .metric-line[data-tip]{ cursor: help; }


html[data-arch-theme="dark"] .arch-root,
.arch-root[data-theme="dark"] {
  --bg: #0a0a0a;
  --panel: #1e1e1e;
  --border: #3c3c3c;
  --text: #d4d4d4;
  --muted: #a0a0a0;
  --primary: #2ec5d6;
  --primary-dark: #1fb4c6;
  --danger: #f14c4c;
  --warn: #d7ba7d;
  --ok: #6a9955;
}
html[data-arch-theme="dark"] .arch-root .topbar,
.arch-root[data-theme="dark"] .topbar { background: #0a0a0a; border-bottom: 1px solid #3c3c3c; }
html[data-arch-theme="dark"] .arch-root .topbar nav a:hover,
.arch-root[data-theme="dark"] .topbar nav a:hover { background: #2d2d30; }
html[data-arch-theme="dark"] .arch-root .search,
html[data-arch-theme="dark"] .arch-root .toolbar button,
html[data-arch-theme="dark"] .arch-root .toolbar select,
html[data-arch-theme="dark"] .arch-root .panel button,
html[data-arch-theme="dark"] .arch-root .field input,
html[data-arch-theme="dark"] .arch-root .field select,
html[data-arch-theme="dark"] .arch-root .field textarea,
html[data-arch-theme="dark"] .arch-root .chip,
html[data-arch-theme="dark"] .arch-root .zoom-ctrls,
html[data-arch-theme="dark"] .arch-root .modal-card,
html[data-arch-theme="dark"] .arch-root .modal-actions button,
html[data-arch-theme="dark"] .arch-root .card,
html[data-arch-theme="dark"] .arch-root .docs,
html[data-arch-theme="dark"] .arch-root .shortcuts,
html[data-arch-theme="dark"] .arch-root .stat,
html[data-arch-theme="dark"] .arch-root .metric-box,
.arch-root[data-theme="dark"] .search,
.arch-root[data-theme="dark"] .toolbar button,
.arch-root[data-theme="dark"] .toolbar select,
.arch-root[data-theme="dark"] .panel button,
.arch-root[data-theme="dark"] .field input,
.arch-root[data-theme="dark"] .field select,
.arch-root[data-theme="dark"] .field textarea,
.arch-root[data-theme="dark"] .chip,
.arch-root[data-theme="dark"] .zoom-ctrls,
.arch-root[data-theme="dark"] .modal-card,
.arch-root[data-theme="dark"] .modal-actions button,
.arch-root[data-theme="dark"] .card,
.arch-root[data-theme="dark"] .docs,
.arch-root[data-theme="dark"] .shortcuts,
.arch-root[data-theme="dark"] .stat,
.arch-root[data-theme="dark"] .metric-box {
  background: #1e1e1e;
  color: #d4d4d4;
  border-color: #3c3c3c;
}
html[data-arch-theme="dark"] .arch-root .canvas-wrap,
html[data-arch-theme="dark"] .arch-root .docs.alt,
html[data-arch-theme="dark"] .arch-root .stat,
html[data-arch-theme="dark"] .arch-root .metric-box,
html[data-arch-theme="dark"] .arch-root .search,
.arch-root[data-theme="dark"] .canvas-wrap,
.arch-root[data-theme="dark"] .docs.alt,
.arch-root[data-theme="dark"] .stat,
.arch-root[data-theme="dark"] .metric-box,
.arch-root[data-theme="dark"] .search { background: #0a0a0a; }
html[data-arch-theme="dark"] .arch-root .toolbar button:hover,
html[data-arch-theme="dark"] .arch-root .panel button:hover,
html[data-arch-theme="dark"] .arch-root .pal-item:hover,
html[data-arch-theme="dark"] .arch-root .zoom-ctrls button:hover,
html[data-arch-theme="dark"] .arch-root .icon-btn:hover,
.arch-root[data-theme="dark"] .toolbar button:hover,
.arch-root[data-theme="dark"] .panel button:hover,
.arch-root[data-theme="dark"] .pal-item:hover,
.arch-root[data-theme="dark"] .zoom-ctrls button:hover,
.arch-root[data-theme="dark"] .icon-btn:hover { background: #2d2d30; }
html[data-arch-theme="dark"] .arch-root .legend-row,
html[data-arch-theme="dark"] .arch-root .toggle,
html[data-arch-theme="dark"] .arch-root .tips,
html[data-arch-theme="dark"] .arch-root .lead,
html[data-arch-theme="dark"] .arch-root .field,
html[data-arch-theme="dark"] .arch-root .steps,
html[data-arch-theme="dark"] .arch-root .model-grid ul,
html[data-arch-theme="dark"] .arch-root .card p,
html[data-arch-theme="dark"] .arch-root .empty-hint h3,
.arch-root[data-theme="dark"] .legend-row,
.arch-root[data-theme="dark"] .toggle,
.arch-root[data-theme="dark"] .tips,
.arch-root[data-theme="dark"] .lead,
.arch-root[data-theme="dark"] .field,
.arch-root[data-theme="dark"] .steps,
.arch-root[data-theme="dark"] .model-grid ul,
.arch-root[data-theme="dark"] .card p,
.arch-root[data-theme="dark"] .empty-hint h3 { color: #d4d4d4; }
html[data-arch-theme="dark"] .arch-root .bar,
.arch-root[data-theme="dark"] .bar { background: #2d2d30; }
html[data-arch-theme="dark"] .arch-root kbd,
.arch-root[data-theme="dark"] kbd { background: #2d2d30; border-color: #3c3c3c; color: #d4d4d4; }
html[data-arch-theme="dark"] .arch-root code,
.arch-root[data-theme="dark"] code { background: #1e1e1e; color: #dcdcaa; }
html[data-arch-theme="dark"] .arch-root .code-area,
.arch-root[data-theme="dark"] .code-area { background: #1e1e1e; color: #d4d4d4; border-color: #3c3c3c; }
html[data-arch-theme="dark"] .arch-root .finding.error,
.arch-root[data-theme="dark"] .finding.error { background: #3a1d1d; border-color: #5a2a2a; }
html[data-arch-theme="dark"] .arch-root .finding.warn,
.arch-root[data-theme="dark"] .finding.warn { background: #3a3420; border-color: #5a4a28; }
html[data-arch-theme="dark"] .arch-root .finding.info,
.arch-root[data-theme="dark"] .finding.info { background: #16343a; border-color: #1f4d56; }
html[data-arch-theme="dark"] .arch-root .finding.ok,
.arch-root[data-theme="dark"] .finding.ok { background: #1d3324; border-color: #2d4a34; }
html[data-arch-theme="dark"] .arch-root .stat.bad,
.arch-root[data-theme="dark"] .stat.bad { background: #3a1d1d; border-color: #5a2a2a; }
html[data-arch-theme="dark"] .arch-root .toolbar button:disabled,
.arch-root[data-theme="dark"] .toolbar button:disabled { background: #1e1e1e; }
html[data-arch-theme="dark"] .arch-root button.primary,
.arch-root[data-theme="dark"] button.primary { color: #0a0a0a; }
.arch-root .theme-toggle,
.arch-root .back-link {
  color: #cbd5e1; text-decoration: none; background: transparent; border: 1px solid transparent;
  border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; font: inherit;
}
.arch-root .theme-toggle:hover,
.arch-root .back-link:hover { background: #1e293b; color: #fff; }
.arch-root .topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  top: 0;
  padding: 0 16px;
}
.arch-root .tool-title {
  justify-self: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  padding: 0 12px;
}
.arch-root .back-link { justify-self: start; }
.arch-root .topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.arch-root .topbar-actions nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.arch-root .topbar-actions .theme-toggle,
.arch-root .topbar-actions nav a {
  padding: 6px 8px;
  font-size: 13px;
}
.arch-root .app { height: calc(100vh - var(--header-h)); }
.arch-root .tooltip { z-index: 80; }
