
:root {
  color-scheme: light;
  --ink: #1e2028;
  --muted: #626875;
  --line: #dfe3ea;
  --paper: #ffffff;
  --wash: #f4f6f9;
  --accent: #146c94;
  --accent-dark: #0f4e6d;
  --warn: #9f3d27;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--wash);
  color: var(--ink);
}
button, input { font: inherit; }
button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
}
button:hover { background: var(--accent-dark); }
button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}
.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 4px;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1; }
h2 { font-size: 20px; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.tab {
  background: transparent;
  color: var(--muted);
  border-radius: 6px 6px 0 0;
  min-height: 44px;
  padding: 0 18px;
}
.tab:hover,
.tab.active {
  background: var(--paper);
  color: var(--ink);
}
.tab.active {
  border: 1px solid var(--line);
  border-bottom-color: var(--paper);
  transform: translateY(1px);
}
.tab-page { display: none; }
.tab-page.active { display: block; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.importer {
  min-width: 0;
  padding: 22px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.importer + .importer { border-left: 1px solid var(--line); }
.importer p {
  color: var(--muted);
  margin: 0;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #e6f2f7;
  color: var(--accent-dark);
  font-weight: 800;
}
input[type=file] {
  width: 100%;
  border: 1px dashed #aeb7c3;
  border-radius: 6px;
  background: #fbfcfe;
  padding: 14px;
}
output {
  min-height: 20px;
  color: var(--muted);
}
.measure-cell {
  min-width: 118px;
}
.measure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.measure input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
.measured-row {
  background: #fafbfc;
}
.measured-row td {
  color: #7b828d;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.metrics div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.metrics strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}
.metrics span {
  color: var(--muted);
  display: block;
  margin-top: 6px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 16px;
  align-items: start;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.table-wrap {
  overflow: auto;
  max-height: 58vh;
}
.table-wrap.tall { max-height: 72vh; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  position: sticky;
  top: 0;
  background: #f9fafc;
  color: #3a414d;
  z-index: 1;
}
td small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f7e9e5;
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
}
.badge.ok {
  background: #e8f5ed;
  color: #276840;
}
.list {
  display: grid;
  gap: 5px;
}
.list span {
  display: block;
}
.muted {
  color: var(--muted);
}
.empty {
  color: var(--muted);
  padding: 18px;
}
@media (max-width: 860px) {
  .topbar, .section-head { align-items: stretch; flex-direction: column; }
  .grid, .metrics, .split { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
  .importer + .importer {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
