:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e1e4e8;
  --border-strong: #cfd4da;
  --text: #14181d;
  --muted: #667085;
  --muted-2: #8a93a1;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --primary-soft: #e6f4f2;
  --pass: #16794a;
  --pass-soft: #e7f5ed;
  --warn: #a45b06;
  --warn-soft: #fdf3e3;
  --fail: #b3261e;
  --fail-soft: #fdeceb;
  --axis: #101820;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.05);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

/* ---------------- top bar ---------------- */

.topbar {
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand-mark {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--axis);
  color: #6ee7d3;
  display: grid; place-items: center;
  flex: none;
}

.brand-text h1 { margin: 0; font-size: 16.5px; font-weight: 650; letter-spacing: 0; }

.topbar-meta { display: flex; align-items: center; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 550;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  white-space: nowrap;
}
.badge-quiet { background: #eef0f3; color: var(--muted); }

/* ---------------- layout ---------------- */

.layout {
  display: grid;
  grid-template-columns: 356px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding: 16px;
  max-width: 1720px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding-right: 2px;
}

.main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---------------- panels ---------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  box-shadow: var(--shadow);
}

.panel-flat { padding: 0; overflow: hidden; }

.panel-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.panel-tools { display: flex; align-items: center; gap: 7px; }

/* ---------------- controls ---------------- */

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
  background: #eef0f3;
  border-radius: var(--radius-sm);
  margin-bottom: 11px;
}
.segmented-3 { grid-template-columns: repeat(3, 1fr); }
.segmented-2 { grid-template-columns: repeat(2, 1fr); margin-bottom: 0; }
.panel-tight { padding: 8px; }

.seg {
  border: 0;
  background: transparent;
  padding: 6px 4px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg:hover { color: var(--text); }
.seg.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.field { display: block; margin-bottom: 9px; }
.field:last-child { margin-bottom: 0; }

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.field-label b { color: var(--primary-dark); font-variant-numeric: tabular-nums; }

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

input[type="text"], input[type="number"], input[type="search"], select, .textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12.5px;
  outline: none;
}
input:focus, select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2.5px var(--primary-soft);
}

.textarea { resize: vertical; font-family: var(--mono); font-size: 11.5px; line-height: 1.55; }

.primer-input {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 1.1px;
}

.inline-num { width: 56px; padding: 2px 4px; font-size: 11.5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 9px; }

input[type="range"] {
  width: 100%;
  height: 18px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; background: var(--border-strong); border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 13px; height: 13px; margin-top: -5px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--primary);
}

.field-check { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.field-check input[type="checkbox"] { accent-color: var(--primary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.12s, border-color 0.12s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted-2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.icon-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
}
.icon-btn:hover { color: var(--text); border-color: var(--muted-2); }

.search { width: 190px; }

.sidebar-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 -2px 8px rgba(16, 24, 32, 0.05);
}
.sidebar-actions .btn-ghost { width: auto; }

/* ---------------- source panes ---------------- */

.source-body.is-hidden, .tab-pane.is-hidden, .is-hidden { display: none !important; }

.dataset-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 9px;
  line-height: 1.65;
}
.dataset-card b { color: var(--text); font-weight: 600; }
.dataset-card .dc-title { color: var(--text); font-weight: 650; font-size: 12.5px; display: block; margin-bottom: 3px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 8px;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }

.hint { font-size: 11px; color: var(--muted-2); margin: 8px 0 0; line-height: 1.6; }
.hint.is-ok { color: var(--pass); }
.hint.is-err { color: var(--fail); }

.progress {
  height: 4px;
  margin-top: 9px;
  border-radius: 2px;
  background: #e6e9ec;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.25s;
}

/* ---------------- stage strip ---------------- */

.stage-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  box-shadow: var(--shadow);
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.stage-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.stage-bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.25s; }
.stage.is-done .stage-bar i { width: 100%; background: var(--pass); }
.stage.is-active .stage-bar i { background: var(--primary); }
.stage-label { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage.is-active .stage-label { color: var(--primary-dark); font-weight: 600; }
.stage.is-done .stage-label { color: var(--text); }

/* ---------------- kpis ---------------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}
.kpi-label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.kpi-value { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi-sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.kpi.is-good .kpi-value { color: var(--pass); }
.kpi.is-warn .kpi-value { color: var(--warn); }
.kpi.is-fail .kpi-value { color: var(--fail); }

/* ---------------- tabs & table ---------------- */

.tabs { display: flex; gap: 2px; }
.tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 11px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 550; color: var(--muted);
}
.tab:hover { color: var(--text); background: #f1f3f5; }
.tab.is-active { background: var(--primary-soft); color: var(--primary-dark); }

.table-wrap { max-height: 460px; overflow: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left;
  padding: 8px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 650; color: var(--muted);
  white-space: nowrap;
}
.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f2f4;
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f7f9fa; }
.data-table tbody tr.is-selected { background: var(--primary-soft); }
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.seq {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.3px;
}
.seq i { font-style: normal; color: var(--primary-dark); font-weight: 700; }

.verdict {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.verdict-pass { background: var(--pass-soft); color: var(--pass); }
.verdict-warn { background: var(--warn-soft); color: var(--warn); }
.verdict-fail { background: var(--fail-soft); color: var(--fail); }

.mini-bar {
  position: relative;
  display: inline-block;
  width: 52px; height: 5px;
  border-radius: 3px;
  background: #e8ebee;
  vertical-align: middle;
  overflow: hidden;
}
.mini-bar i { position: absolute; inset: 0 auto 0 0; background: var(--primary); }
.mini-bar.is-good i { background: var(--pass); }
.mini-bar.is-warn i { background: var(--warn); }
.mini-bar.is-fail i { background: var(--fail); }
.pct { margin-left: 6px; font-variant-numeric: tabular-nums; }

/* ---------------- genome map ---------------- */

.map-wrap { padding: 12px 14px 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.map-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.map-head-left { display: flex; align-items: center; gap: 9px; }
.map-title { font-size: 11.5px; font-weight: 600; color: var(--text); }
.map-select {
  width: auto; min-width: 110px; max-width: 240px;
  padding: 3px 7px; font-size: 11.5px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface);
}
.map-legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); align-items: center; }
.lg { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.lg-cons { background: #9fd7cd; }
.lg-primer { background: #0f766e; }
.lg-hit { background: #16794a; }
#genomeMap { width: 100%; display: block; height: 120px; }

/* ---------------- set tab ---------------- */

.set-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.set-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; }
.set-stat .kpi-label { margin-bottom: 2px; }
.set-stat .kpi-value { font-size: 17px; }

.missing-list { padding: 12px 14px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.missing-list code { font-family: var(--mono); font-size: 11px; background: #f1f3f5; padding: 1px 5px; border-radius: 4px; margin-right: 5px; }

/* ---------------- group cards ---------------- */

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 11px; padding: 13px; }
.group-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 11px; background: var(--surface); }
.group-card h3 { margin: 0 0 3px; font-size: 13px; font-weight: 650; }
.group-card .gc-sub { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.group-card .gc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 8px; }
.group-card .gc-stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 7px; }
.group-card .gc-stat b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.group-card .gc-stat span { font-size: 10.5px; color: var(--muted); }
.group-note { font-size: 11px; color: var(--warn); background: var(--warn-soft); padding: 6px 8px; border-radius: var(--radius-sm); }

.interval-bar { height: 14px; position: relative; background: var(--surface-2); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.interval-bar i { position: absolute; top: 0; bottom: 0; background: #9fd7cd; }

/* ---------------- detail ---------------- */

.detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.detail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 13px 15px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.detail-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.detail-head .dh-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.detail-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0; }
.detail-col { padding: 14px 15px; }
.detail-col + .detail-col { border-left: 1px solid var(--border); }

.detail-sub { font-size: 11px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 9px; }

.primer-block { margin-bottom: 14px; }
.primer-row { display: flex; align-items: baseline; gap: 9px; margin-bottom: 6px; }
.primer-tag {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  background: #eef0f3; border-radius: 4px; padding: 2px 6px; flex: none;
}
.primer-seq { font-family: var(--mono); font-size: 13px; letter-spacing: 0.4px; word-break: break-all; }
.primer-plain { font-family: var(--mono); font-size: 11px; color: var(--muted-2); word-break: break-all; }
.primer-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); margin-top: 5px; }
.primer-meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.score-grid { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 14px; }
.score-row {
  display: grid; grid-template-columns: 15px minmax(0, 1fr) auto;
  gap: 8px; align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 11.5px;
}
.score-row .sr-icon { display: grid; place-items: center; }
.score-row .sr-name { color: var(--text); }
.score-row .sr-detail { color: var(--muted-2); font-size: 11px; display: block; }
.score-row .sr-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.score-pass .sr-icon { color: var(--pass); }
.score-warn .sr-icon { color: var(--warn); }
.score-fail .sr-icon { color: var(--fail); }
.score-fail { border-color: #f3cdc9; background: var(--fail-soft); }
.score-warn { border-color: #f0dcbb; background: var(--warn-soft); }

.mismatch-map { margin-bottom: 14px; }
.mm-row { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: end; margin-bottom: 6px; }
.mm-label { font-size: 10.5px; color: var(--muted); padding-bottom: 2px; }
.mm-bars { display: flex; gap: 2px; align-items: flex-end; height: 34px; }
.mm-bar { flex: 1; background: #d9dee3; border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.mm-bar.is-tail { background: #e7b6b1; }
.mm-bar.has { background: var(--fail); }
.mm-tail-note { font-size: 10.5px; color: var(--muted); margin: 3px 0 0 38px; }

.seq-matrix { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 5px; }
.seq-cell { width: 13px; height: 13px; border-radius: 2px; background: #e3e7ea; cursor: default; }
.seq-cell.hit { background: #7ec8a4; }
.seq-cell.miss { background: #e9a6a0; }
.seq-cell.holdout { outline: 1.5px solid #697586; outline-offset: -1.5px; }

.detail-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.detail-actions .btn { width: auto; padding: 6px 10px; font-size: 12px; }

.seq-table { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.seq-table table { width: 100%; border-collapse: collapse; font-size: 11px; }
.seq-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; padding: 5px 8px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); font-size: 10.5px; }
.seq-table td { padding: 4px 8px; border-bottom: 1px solid #f2f4f6; white-space: nowrap; }
.seq-table td.name { max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.dot.hit { background: var(--pass); }
.dot.miss { background: var(--fail); }

/* ---------------- toast ---------------- */

/* ---------------- primer check report ---------------- */

.check-report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.cr-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.cr-head .cr-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.cr-primers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }

.cr-primer {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  background: var(--surface-2);
}
.cr-primer .cp-tag {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.cr-primer .cp-seq {
  font-family: var(--mono); font-size: 13px; letter-spacing: 1px;
  margin: 4px 0 6px; word-break: break-all;
}
.cr-primer .cp-seq i { font-style: normal; color: var(--primary-dark); font-weight: 700; }
.cr-primer .cp-meta { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 11px; color: var(--muted); }
.cr-primer .cp-meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.hist {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 74px;
  padding: 0 0 0 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}
.hist span {
  flex: 1;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: 0.85;
}
.hist span.out { background: var(--fail); opacity: 0.55; }
.hist-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted-2); }

.warn-banner {
  font-size: 11.5px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  margin-bottom: 12px;
}

.detail-body.is-single { grid-template-columns: 1fr; }

/* ---------------- tiled scheme ---------------- */

.tiled-track {
  width: 100%;
  height: 90px;
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tiled-track .track-bg { fill: #eef1f3; }
.tiled-track .amp-good { fill: #16794a; }
.tiled-track .amp-ok { fill: #7ea88f; }
.tiled-track .amp-weak { fill: #c8a24a; }
.tiled-track .gap-terminal { fill: #d7dde2; opacity: 0.55; }
.tiled-track .gap-internal { fill: #e9a6a0; opacity: 0.75; }
.tiled-track .track-tick { fill: #8a93a1; font-size: 9px; font-family: sans-serif; }
.tiled-track rect { cursor: default; }
.tiled-track rect:hover { stroke: #101820; stroke-width: 0.8; }

.pool-tag {
  display: inline-block;
  min-width: 16px;
  text-align: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 650;
  background: #eef0f3;
  color: var(--muted);
}
.pool-tag.pool-1 { background: #e2edff; color: #2457a8; }
.pool-tag.pool-2 { background: #e6f4ec; color: #1c6b45; }
.pool-tag.pool-3 { background: #fbf0dd; color: #8a5a10; }
.pool-tag.pool-4 { background: #f3e8f7; color: #6c3b86; }

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(14px);
  background: var(--axis);
  color: #f2f5f7;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 60;
  max-width: 70vw;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.is-err { background: var(--fail); }

/* ---------------- empty state ---------------- */

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------------- responsive ---------------- */

@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .sidebar-actions { position: static; }
  .detail-body { grid-template-columns: 1fr; }
  .detail-col + .detail-col { border-left: 0; border-top: 1px solid var(--border); }
  .stage-strip { grid-template-columns: repeat(3, 1fr); row-gap: 10px; }
}

@media (max-width: 720px) {
  .layout { padding: 10px; gap: 10px; }
  .topbar { padding: 0 12px; }
  .topbar-meta .badge-quiet { display: none; }
  .stage-strip { grid-template-columns: repeat(2, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .search { width: 120px; }
  .group-grid { grid-template-columns: 1fr; }
}
