:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --surface: #ffffff;
  --surface-2: #eef4f3;
  --text: #17201f;
  --muted: #66716f;
  --line: #dfe5df;
  --accent: #177c70;
  --accent-2: #d25f3f;
  --accent-3: #395da8;
  --shadow: 0 18px 50px rgba(24, 35, 32, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(16px, 4vw, 48px) 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 5;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 48px) 36px;
}

.panel,
.summary-band {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  border-radius: 8px;
  padding: 18px;
}

.inputs-panel {
  grid-row: span 2;
}

.results-stack {
  display: grid;
  gap: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title.compact {
  margin-top: 22px;
}

.pill {
  border: 1px solid rgba(23, 124, 112, 0.3);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 124, 112, 0.12);
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
}

.summary-band div {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  background: var(--surface);
}

.summary-band span,
.detail-grid span {
  color: var(--muted);
  font-size: 13px;
}

.summary-band strong {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1;
}

.summary-band div:nth-child(1) strong {
  color: var(--accent-2);
}

.summary-band div:nth-child(2) strong {
  color: var(--accent);
}

.summary-band div:nth-child(3) strong {
  color: var(--accent-3);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.detail-grid div {
  display: grid;
  gap: 5px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface-2);
}

canvas {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
}

.comparison-panel {
  grid-column: 1 / -1;
}

.compare-controls {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1fr auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.check-row {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fbfcfa;
  color: var(--text);
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: 13px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  padding: 0 4px;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .inputs-panel {
    grid-row: auto;
  }

  .summary-band,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .compare-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .app-header {
    padding-top: 18px;
  }

  .form-grid,
  .compare-controls {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }
}
