:root {
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --ink: #111318;
  --muted: #65616d;
  --line: #d8d1c7;
  --dark: #14131b;
  --green: #31d26b;
  --red: #d44747;
  /* Superfícies e textos que variam com o tema (ver :root[data-theme="dark"]). */
  --surface: #fff;
  --surface-soft: #fffaf0;
  --hover: #f0fff0;
  --edge: #111318;
  --dash: #8d887f;
  --ink-2: #2d2a33;
  --muted-2: #4f4a55;
  --on-accent: #111318;
  --stop-bg: #ffd7d7;
  --stop-ink: #5b1010;
  --soft-shadow: #0000001c;
  --cone-line: #11131824;
  --cone-bg: linear-gradient(180deg, #f9fff9, #fffdf8 58%, #f4f1ea);
  --node-ok-bg: #eafff1;  --node-ok-edge: #118c45;
  --node-warn-bg: #fff3cf; --node-warn-edge: #b37b00;
  --node-off-bg: #eee8df;  --node-off-edge: #8d887f;
  --node-cand-bg: #eaf2ff; --node-cand-edge: #4169a8;
  --node-small: #6a5b37;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1015;
  --panel: #151821;
  --ink: #e4e7ed;
  --muted: #9aa1ae;
  --line: #2a2f3b;
  --dark: #07080b;
  --surface: #1b1f29;
  --surface-soft: #181c25;
  --hover: #1c2a22;
  --edge: #3d4454;
  --dash: #4d5466;
  --ink-2: #c7ccd6;
  --muted-2: #aab0bc;
  --on-accent: #0b0d10;
  --stop-bg: #4a1a1a;
  --stop-ink: #ffcaca;
  --soft-shadow: #00000066;
  --cone-line: #ffffff1f;
  --cone-bg: linear-gradient(180deg, #13201a, #151821 58%, #11141b);
  --node-ok-bg: #12301f;  --node-ok-edge: #2fae63;
  --node-warn-bg: #33290d; --node-warn-edge: #c99a1d;
  --node-off-bg: #22252d;  --node-off-edge: #4d5466;
  --node-cand-bg: #172338; --node-cand-edge: #5a86d6;
  --node-small: #cdb87c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
.topbar {
  min-height: 30px;
  padding: 3px clamp(10px, 3vw, 18px);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  background: var(--dark);
  color: white;
  border-bottom: 2px solid #000;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Alternador de tema (role="switch"): trilho + bolinha, rótulo à direita. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #fff;
  font: 800 11px "Courier New", monospace;
  cursor: pointer;
}
.theme-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border: 2px solid #ffffff66;
  border-radius: 999px;
  background: #ffffff14;
  transition: background .15s ease, border-color .15s ease;
}
.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}
.theme-toggle[aria-checked="true"] .theme-toggle-track { background: var(--green); border-color: var(--green); }
.theme-toggle[aria-checked="true"] .theme-toggle-thumb { transform: translateX(16px); background: #0b0d10; }
.theme-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle-track, .theme-toggle-thumb { transition: none; }
}
h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: 0; }
h1 { font-size: 16px; }
h2 { font-size: 24px; }
h3 { font-size: 17px; }
p { margin: 6px 0 0; color: var(--muted); }
.status-pill {
  border: 1px solid #ffffff33;
  background: #ffffff12;
  color: #fff;
  border-radius: 999px;
  padding: 5px 9px;
  font: 800 11px "Courier New", monospace;
  white-space: nowrap;
}
.status-pill.ok { background: #093d22; color: #bff7d1; }
.status-pill.bad { background: #4a1212; color: #ffd1d1; }
.shell {
  width: min(1380px, calc(100% - 24px));
  margin: 6px auto 14px;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.tab, .button {
  min-height: 32px;
  border: 2px solid var(--edge);
  background: var(--surface);
  color: var(--ink);
  padding: 0 11px;
  font-weight: 900;
  cursor: pointer;
}
.tab.is-active, .button.primary { background: var(--green); color: var(--on-accent); }
.button.secondary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: var(--surface);
}
.panel {
  display: none;
  border: 3px solid var(--edge);
  background: var(--panel);
}
.panel.is-active { display: block; }
.panel-head {
  min-height: 72px;
  padding: 14px;
  border-bottom: 2px solid var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.map-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 94px);
  min-height: 620px;
  border: 0;
  background: var(--panel);
}
.lg-split {
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 14px;
  align-items: start;
}
.lg-workspace {
  min-width: 0;
  border: 2px solid var(--edge);
  background: var(--panel);
  overflow: hidden;
}
.lg-form {
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(170px, .9fr) minmax(170px, .9fr) minmax(260px, 1.5fr) auto;
  gap: 8px;
  align-items: end;
}
.asn-form {
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.help-grid {
  padding: 0 8px 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.help-box {
  border: 2px dashed var(--dash);
  background: var(--surface-soft);
  padding: 7px 8px;
  min-height: 48px;
}
.help-box b {
  display: block;
  margin-bottom: 4px;
  font: 900 11px "Courier New", monospace;
  text-transform: uppercase;
}
.help-box span {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.25;
}
.asn-help {
  margin: 0 8px 8px;
}
label {
  position: relative;
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink-2);
}
.provider-menu {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  border: 2px solid var(--edge);
  background: var(--surface);
  box-shadow: 0 8px 0 var(--soft-shadow);
  display: grid;
  max-height: 260px;
  overflow: auto;
}
.provider-menu[hidden] { display: none; }
.provider-option {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  text-align: left;
  cursor: pointer;
}
.provider-option:hover,
.provider-option:focus {
  background: var(--hover);
}
.provider-option strong {
  font: 900 13px "Courier New", monospace;
}
.provider-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
input, select {
  width: 100%;
  min-height: 32px;
  border: 2px solid var(--edge);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  font: 800 14px "Courier New", monospace;
}
.query-tabs {
  padding: 0 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  min-height: 48px;
}
.query-tabs-empty {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font: 800 12px "Courier New", monospace;
}
.query-tab {
  min-height: 42px;
  border: 2px solid var(--edge);
  border-bottom-width: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 5px 8px 5px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  min-width: 132px;
  max-width: 240px;
  cursor: pointer;
}
.query-tab.is-active {
  background: var(--green);
  color: var(--on-accent);
}
.query-tab.is-active small { color: var(--on-accent); }
.query-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}
.query-tab small {
  grid-column: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font: 800 10px "Courier New", monospace;
}
.query-tab b {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 22px;
  height: 22px;
  border: 2px solid var(--edge);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 900 13px "Courier New", monospace;
}
.result-card {
  margin: 0;
  border: 0;
  border-top: 2px solid var(--edge);
  background: #101218;
  color: #e7f7e7;
}
.result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid #ffffff2e;
}
.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.button.stop {
  background: var(--stop-bg);
  color: var(--stop-ink);
}
.result-head > div {
  min-width: 0;
}
.result-head strong,
.result-head span {
  overflow-wrap: anywhere;
}
.result-head span { display: block; color: #9ca3af; font-size: 12px; }
.result-head strong { display: block; color: #fff; }
.subtabs {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #ffffff2e;
  background: #151923;
}
.subtabs[hidden] { display: none; }
.subtabs button {
  min-height: 30px;
  border: 1px solid #ffffff55;
  background: #fff;
  color: #111318;
  padding: 0 10px;
  font-weight: 900;
  cursor: pointer;
}
.subtabs button.is-active {
  background: var(--green);
  border-color: var(--green);
}
pre {
  margin: 0;
  min-height: 390px;
  max-height: 680px;
  overflow: auto;
  padding: 14px;
  font: 13px/1.45 "Courier New", monospace;
  white-space: pre-wrap;
}
.history-list { padding: 10px; display: grid; gap: 8px; }
.history-item {
  border: 2px solid var(--edge);
  background: var(--surface);
  padding: 10px;
  cursor: pointer;
}
.history-item:hover { background: var(--hover); }
.history-item b { display: flex; align-items: center; gap: 8px; }
.history-item span { color: var(--muted); font-size: 12px; }
.history-kind {
  display: inline-flex;
  min-width: 38px;
  justify-content: center;
  border: 2px solid var(--edge);
  background: var(--green);
  color: var(--on-accent) !important;
  padding: 2px 5px;
  font: 900 11px "Courier New", monospace;
}
.history-empty {
  border: 2px dashed var(--dash);
  background: var(--surface-soft);
  padding: 12px;
}
.history-empty b,
.history-empty span { display: block; }
.history-empty span { margin-top: 4px; color: var(--muted); font-size: 13px; }

.ascone-shell {
  padding: 12px;
  display: grid;
  gap: 12px;
}
.ascone-hero {
  border: 2px solid var(--edge);
  background:
    radial-gradient(circle at 78% 10%, #31d26b33, transparent 28%),
    linear-gradient(135deg, #111318, #202334 62%, #151a22);
  color: #fff;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
  gap: 18px;
  align-items: end;
}
.ascone-hero p { color: #d7dde7; max-width: 760px; }
.ascone-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.ascone-form label { color: #fff; }
.ascone-options {
  grid-column: 1;
  display: grid;
  gap: 6px;
  align-self: start;
}
.ascone-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  gap: 8px;
  align-self: end;
}
.checkbox-line {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 13px;
}
.checkbox-line input {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--green);
}
.ascone-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ascone-kpis div {
  border: 2px solid var(--edge);
  background: var(--surface);
  padding: 12px;
  box-shadow: 5px 5px 0 var(--soft-shadow);
}
.ascone-kpis b { display: block; font: 900 28px/1 "Courier New", monospace; }
.ascone-kpis span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.ascone-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 12px;
  align-items: stretch;
}
.cone-card,
.cone-side {
  border: 2px solid var(--edge);
  background: var(--surface);
  min-width: 0;
}
.cone-head {
  min-height: 64px;
  padding: 10px 12px;
  border-bottom: 2px solid var(--edge);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.cone-head span { display: block; color: var(--muted); font-size: 12px; }
.cone-head strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.cone-legend {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 900;
}
.cone-legend i {
  width: 11px;
  height: 11px;
  border: 2px solid var(--edge);
  display: inline-block;
}
.cone-legend .ok { background: var(--green); }
.cone-legend .warn { background: #ffd166; }
.cone-legend .off { background: var(--node-off-bg); }
.cone-legend .candidate { background: #dbeafe; }
.cone-viz {
  min-height: 640px;
  padding: 20px 18px 28px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0, #31d26b30, transparent 30%),
    var(--cone-bg);
}
.cone-empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-weight: 900;
}
.cone-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
}
.cone-root {
  width: min(360px, 92%);
  border: 3px solid var(--edge);
  background: var(--green);
  color: var(--on-accent);
  padding: 14px;
  text-align: center;
  box-shadow: 8px 8px 0 #00000020;
}
.cone-root small,
.cone-root span { display: block; }
.cone-root small { font: 900 11px "Courier New", monospace; text-transform: uppercase; }
.cone-root b { display: block; font-size: 26px; margin: 2px 0; }
.cone-root span { color: #17301f; font-weight: 900; overflow-wrap: anywhere; }
.cone-lines {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 82px;
  height: 455px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(125deg, transparent 49.7%, var(--cone-line) 50%, transparent 50.5%),
    linear-gradient(55deg, transparent 49.7%, var(--cone-line) 50%, transparent 50.5%),
    linear-gradient(180deg, #31d26b18, #1113180a);
  pointer-events: none;
}
.cone-row {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px auto 0;
}
.cone-level {
  position: relative;
  z-index: 2;
  margin-top: 18px;
}
.cone-level-title {
  width: min(860px, 96%);
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font: 900 12px "Courier New", monospace;
  text-transform: uppercase;
}
.cone-level-title:before,
.cone-level-title:after {
  content: "";
  height: 2px;
  background: var(--cone-line);
  flex: 1;
}
.cone-level-title span {
  color: var(--muted);
  text-transform: none;
}
.cone-more {
  border: 2px dashed var(--dash);
  background: var(--surface-soft);
  color: var(--muted);
  padding: 9px 11px;
  font-weight: 900;
  align-self: center;
}
.cone-row.tier1 { width: min(620px, 88%); }
.cone-row.tier2 { width: min(820px, 96%); }
.cone-row.tier3 { width: 100%; }
.cone-node {
  width: calc(128px * var(--scale));
  min-height: 74px;
  border: 2px solid var(--edge);
  background: var(--surface);
  padding: 9px;
  box-shadow: 5px 5px 0 var(--soft-shadow);
  display: grid;
  align-content: center;
  gap: 3px;
}
.cone-node.ok { background: var(--node-ok-bg); border-color: var(--node-ok-edge); }
.cone-node.warn { background: var(--node-warn-bg); border-color: var(--node-warn-edge); }
.cone-node.off { background: var(--node-off-bg); border-color: var(--node-off-edge); opacity: .86; }
.cone-node.candidate { background: var(--node-cand-bg); border-color: var(--node-cand-edge); opacity: .9; }
.cone-node b { font: 900 15px "Courier New", monospace; }
.cone-node span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.cone-node small {
  color: var(--node-small);
  font: 900 10px "Courier New", monospace;
}
.cone-filters {
  padding: 10px;
  border-bottom: 2px solid var(--edge);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cone-filters button {
  min-height: 30px;
  border: 2px solid var(--edge);
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}
.cone-filters button.is-active { background: var(--green); color: var(--on-accent); }
.cone-list {
  padding: 10px;
  display: grid;
  gap: 8px;
  max-height: 706px;
  overflow: auto;
}
.cone-list-item {
  border: 2px solid var(--edge);
  background: var(--surface);
  padding: 10px;
  display: grid;
  gap: 5px;
  border-left-width: 8px;
}
.cone-list-item.ok { border-left-color: var(--green); }
.cone-list-item.warn { border-left-color: #ffd166; }
.cone-list-item.off { border-left-color: var(--node-off-edge); }
.cone-list-item.candidate { border-left-color: #7aa7f7; }
.cone-list-item div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}
.cone-list-item b { font: 900 14px "Courier New", monospace; }
.cone-list-item span {
  color: var(--ink-2);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cone-list-item strong { font-size: 12px; }
.cone-list-item small { color: var(--muted); font: 800 11px "Courier New", monospace; }
.genealogy-wrap {
  border-top: 2px solid var(--edge);
  background: #071018;
}
.genealogy-toolbar {
  min-height: 46px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--edge);
  background: var(--panel);
}
.genealogy-toolbar span {
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
}
.genealogy-canvas {
  position: relative;
  height: 760px;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  background:
    linear-gradient(#ffffff08 1px, transparent 1px),
    linear-gradient(90deg, #ffffff08 1px, transparent 1px),
    radial-gradient(circle at center, #173b2a, #071018 68%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
}
.genealogy-canvas:active { cursor: grabbing; }
.gene-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
.gene-edges {
  position: absolute;
  inset: 0;
  overflow: visible;
}
.gene-edge {
  stroke: #dbeafe;
  stroke-width: 2;
  opacity: .72;
  fill: none;
  transition: opacity .12s ease, stroke-width .12s ease;
}
.gene-edge.upstream {
  stroke: #7aa7f7;
  stroke-width: 2.4;
}
.gene-edge.active {
  opacity: 1;
  stroke: #20d878;
  stroke-width: 4;
}
.gene-edge.dim {
  opacity: .12;
}
.gene-node {
  position: absolute;
  width: 168px;
  min-height: 78px;
  transform: translate(-50%, -50%);
  border: 2px solid #d49400;
  background: #fff3cf;
  color: #101218;
  box-shadow: 6px 6px 0 #00000040;
  padding: 8px;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: center;
  transition: opacity .12s ease, outline-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.gene-node:hover,
.gene-node.active {
  z-index: 8;
  outline: 3px solid #fff;
}
.gene-node.active {
  box-shadow: 8px 8px 0 #00000066, 0 0 0 5px #20d878;
}
.gene-node.related {
  z-index: 6;
  outline: 3px solid #20d878;
}
.gene-node.dim {
  opacity: .28;
}
.gene-node.root {
  width: 190px;
  min-height: 86px;
  background: var(--green);
  border-color: #111318;
}
.gene-node.upstream {
  background: #dbeafe;
  border-color: #5a86d6;
}
.gene-node b {
  font: 900 15px "Courier New", monospace;
}
.gene-node.root b { font-size: 22px; }
.gene-node span {
  font-size: 11px;
  font-weight: 900;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.gene-node small {
  color: #4f4a55;
  font: 900 10px "Courier New", monospace;
}

.site-footer {
  width: min(1380px, calc(100% - 24px));
  margin: 0 auto 16px;
  padding: 10px 2px 0;
  border-top: 2px solid var(--edge);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 18px;
  color: var(--muted);
  font-size: 12px;
}
.site-footer strong { color: var(--ink); }
.client-ips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  font: 800 12px "Courier New", monospace;
}
.client-ips div { display: flex; gap: 6px; min-width: 0; }
.client-ips dt { color: var(--muted); }
.client-ips dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.client-ips dd.is-missing { color: var(--muted); font-weight: 700; }

@media (max-width: 900px) {
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .lg-split, .lg-form, .asn-form, .help-grid, .ascone-hero, .ascone-form, .ascone-grid { grid-template-columns: 1fr; }
  .ascone-options,
  .ascone-actions { grid-column: auto; grid-row: auto; }
  .ascone-actions { grid-template-columns: 1fr 1fr; }
  .ascone-kpis { grid-template-columns: 1fr 1fr; }
  .map-frame { height: calc(100vh - 88px); min-height: 560px; }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 28px;
    padding: 3px 10px;
    flex-direction: row;
    align-items: center;
  }
  h1 { font-size: 15px; }
  .theme-toggle-label { display: none; }
  .site-footer { width: 100%; padding: 8px 6px 0; margin-bottom: 10px; }
  .status-pill { padding: 4px 7px; font-size: 10px; }
  .shell {
    width: 100%;
    margin: 4px 0 10px;
    padding: 0 6px;
  }
  .tabs {
    gap: 4px;
    margin-bottom: 5px;
  }
  .tab, .button {
    min-height: 30px;
    padding: 0 9px;
    font-size: 13px;
  }
  .panel {
    border-width: 2px;
  }
  .lg-split {
    padding: 6px;
    gap: 8px;
  }
  .lg-form,
  .asn-form {
    padding: 6px;
    gap: 6px;
  }
  .help-grid {
    padding: 0 6px 6px;
    gap: 6px;
  }
  .help-box {
    padding: 6px;
    min-height: 0;
  }
  .help-box span {
    font-size: 11px;
    line-height: 1.2;
  }
  input, select {
    min-height: 32px;
    padding: 7px 8px;
    font-size: 13px;
  }
  .query-tabs {
    padding: 0 6px;
    gap: 5px;
    min-height: 38px;
  }
  .query-tab {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 38px;
  }
  .result-head {
    padding: 8px;
    gap: 8px;
    align-items: flex-start;
  }
  .result-head .button {
    flex: 0 0 auto;
  }
  .subtabs {
    padding: 7px 8px;
    gap: 5px;
  }
  .subtabs button {
    min-height: 30px;
    padding: 0 9px;
  }
  pre {
    min-height: 360px;
    max-height: none;
    padding: 10px;
    font-size: 12px;
    line-height: 1.4;
    overflow-x: auto;
  }
  .ascone-shell { padding: 6px; gap: 8px; }
  .ascone-hero { padding: 12px; gap: 12px; }
  .ascone-kpis { grid-template-columns: 1fr; gap: 6px; }
  .cone-head { align-items: flex-start; flex-direction: column; }
  .cone-legend { justify-content: flex-start; }
  .cone-viz { min-height: 520px; padding: 14px 8px 20px; }
  .cone-lines { left: 2%; right: 2%; height: 380px; }
  .cone-row, .cone-row.tier1, .cone-row.tier2 { width: 100%; gap: 7px; }
  .cone-node { width: min(100%, 142px); min-height: 66px; padding: 8px; }
  .cone-list { max-height: none; }
  .cone-list-item div { grid-template-columns: 1fr; gap: 2px; }
  .cone-list-item span { white-space: normal; }
}
