:root {
  --ink: #10221d;
  --muted: #5e6d67;
  --cream: #f4f0e6;
  --paper: #fbfaf6;
  --lime: #d9ff68;
  --green: #1e463b;
  --line: #ddd8cc;
  --bad: #8d2f2f;
  --ok: #1d6b45;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
button, input, select { font: inherit; color: inherit; }
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.94);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 800 18px Manrope; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--lime);
}
.top-note { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.top-actions { display: flex; gap: 8px; }
.ghost, .primary {
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}
.ghost { border: 1px solid var(--ink); background: transparent; }
.primary { border: 0; background: var(--ink); color: white; font-weight: 700; }
.primary.small { padding: 10px 16px; }
.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 22px;
  padding: 22px 28px 40px;
  align-items: start;
}
.panel fieldset {
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 0 0 14px;
  padding: 14px 14px 16px;
  background: white;
}
.panel legend { font: 700 13px Manrope; padding: 0 6px; }
.project-name { display: grid; gap: 6px; font-size: 13px; font-weight: 700; margin-bottom: 12px; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
  font-weight: 500;
}
input:focus, select:focus { outline: 2px solid #c9e0d6; border-color: #648d80; }
.unit { position: relative; }
.unit i {
  position: absolute; right: 10px; top: 11px;
  font-style: normal; color: #85918c; font-weight: 600; font-size: 12px;
}
.unit input { padding-right: 64px; }
.pair, .trio { display: grid; gap: 10px; margin-bottom: 10px; }
.pair { grid-template-columns: 1fr 1fr; }
.trio { grid-template-columns: 1fr 1fr 1fr; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 6px 0 0; font-weight: 500; }
.hint.center { text-align: center; }
.file-row, .row-buttons { display: flex; gap: 8px; align-items: end; margin-top: 8px; }
.file { flex: 1; }
#catalog { min-height: 44px; background: white; }
.results { display: grid; gap: 14px; }
.result-head, .map-card, .metric-row, .notice {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.result-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 8px;
  background: var(--ink);
  color: white;
  border: 0;
}
.eyebrow { letter-spacing: 0.14em; font-size: 11px; font-weight: 800; color: #b7c7c0; }
.big-number { display: flex; align-items: baseline; gap: 10px; }
.big-number strong { font: 800 64px/1 Manrope; color: var(--lime); }
.big-number span { font-size: 18px; }
.result-head p { color: #c5d2cc; margin: 0 0 12px; }
.status {
  align-self: start;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  background: #314e44;
}
.status.ok { background: #d9ff68; color: #17352c; }
.status.bad { background: #ffd0c8; color: #6d241c; }
.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  overflow: hidden;
}
.metric-row div { padding: 14px 16px; border-right: 1px solid var(--line); display: grid; gap: 4px; }
.metric-row div:nth-child(4n) { border-right: 0; }
.metric-row span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.metric-row strong { font-size: 16px; }
.metric-row .warn { color: var(--bad); }
.metric-row .good { color: var(--ok); }
.map-card { padding: 16px; }
.map-title { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.map-title span { color: var(--muted); font-size: 13px; }
canvas { width: 100%; height: auto; border-radius: 12px; background: #f6f3ea; margin-top: 10px; }
.notice { padding: 14px 16px; color: #3e514a; font-size: 13px; line-height: 1.5; background: #f3f7f4; }
footer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px 28px 28px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
footer p { margin: 0; }
@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; padding: 16px; }
  .topbar { flex-wrap: wrap; }
  .top-note { display: none; }
  .metric-row { grid-template-columns: 1fr 1fr; }
  .metric-row div:nth-child(2n) { border-right: 0; }
  .trio { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .panel, footer, .notice { display: none !important; }
  .workspace { display: block; padding: 0; }
  .result-head, .map-card, .metric-row { break-inside: avoid; }
  body { background: white; }
}
