:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #68757f;
  --line: #d9e0e5;
  --accent: #0f766e;
  --accent-2: #b42318;
  --soft: #eef5f4;
}

* {
  box-sizing: border-box;
}

.sbio-sitebar { min-height: 76px; padding: 8px 28px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid #dce8ea; background: #fff; color: #102b59; }
.sbio-brand { display: flex; align-items: center; gap: 11px; color: #102b59; text-decoration: none; }
.sbio-brand img { width: 58px; height: 58px; object-fit: contain; }
.sbio-brand strong { font: 800 17px Arial, Helvetica, sans-serif; }
.sbio-sitebar nav { margin-left: auto; display: flex; gap: 20px; }
.sbio-sitebar nav a { color: #52616c; text-decoration: none; font-size: 13px; font-weight: 700; }
.sbio-sitebar nav a:hover { color: #117c7a; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
}

.load-panel {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

button,
.file-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:hover,
.file-button:hover {
  border-color: var(--accent);
}

.file-button input {
  display: none;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - 93px);
}

.controls {
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.controls section {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.check-grid label {
  grid-template-columns: 18px 1fr;
  align-items: center;
  color: var(--ink);
  font-weight: 600;
}

.legend {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.legend-scale {
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #2b9090 0%, #f8fafb 50%, #c84436 100%);
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.legend p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.plot-area {
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.summary-bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}

.heatmap-shell {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.heatmap {
  width: max-content;
  min-width: 100%;
  padding: 12px;
}

.heatmap.empty {
  width: 100%;
  min-height: 440px;
  display: grid;
  place-items: center;
}

.empty-state {
  display: grid;
  gap: 6px;
  text-align: center;
  color: var(--muted);
}

.matrix {
  display: grid;
  align-items: stretch;
  font-size: 11px;
}

.corner,
.col-header,
.row-header,
.cell {
  border-right: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.corner,
.col-header,
.row-header {
  position: sticky;
  background: #f8fafb;
  z-index: 2;
}

.corner {
  left: 0;
  top: 0;
  z-index: 4;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.col-header {
  top: 0;
  min-height: 96px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 8px 5px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  overflow: hidden;
}

.row-header {
  left: 0;
  min-height: 24px;
  padding: 5px 8px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  white-space: nowrap;
}

.cell {
  width: 28px;
  height: 24px;
}

@media (max-width: 860px) {
  .app-header,
  .summary-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
