:root {
  color-scheme: light;
  --bg: #f4f7f3;
  --surface: #ffffff;
  --surface-soft: #f9fbf7;
  --text: #17211d;
  --muted: #66736b;
  --line: #dfe6dc;
  --accent: #237564;
  --accent-strong: #15594d;
  --gold: #ad741d;
  --danger: #b44444;
  --shadow: 0 24px 60px rgba(31, 48, 42, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(35, 117, 100, 0.16), transparent 32%),
    linear-gradient(135deg, #f7f8f2 0%, #eef6f2 48%, #f5f1e8 100%);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.intro {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 12px;
  border: 1px solid rgba(35, 117, 100, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: 0;
}

.summary {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.panel {
  border: 1px solid rgba(223, 230, 220, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.metric span,
.range-row label,
label span {
  color: var(--muted);
  font-size: 14px;
}

.calculator {
  display: block;
}

.panel {
  padding: 24px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 4px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

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

.section-title h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

input[type="number"],
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--text);
  background: var(--surface-soft);
  font: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

select {
  cursor: pointer;
}

input:focus,
select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(35, 117, 100, 0.15);
  background: #ffffff;
}

.range-row {
  display: grid;
  grid-template-columns: 90px 1fr 72px;
  gap: 14px;
  align-items: center;
}

input[type="range"] {
  accent-color: var(--accent);
}

output {
  color: var(--text);
  font-weight: 800;
}

.checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 14px;
}

.checks input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.actions button {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  padding: 0 28px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-strong), #2c7c6c);
  box-shadow: 0 14px 28px rgba(21, 89, 77, 0.24);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.actions button:hover {
  filter: brightness(1.04);
}

.actions p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.results {
  margin-top: 22px;
  display: grid;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.results.is-hidden {
  display: none;
}

.score-summary {
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #ffffff;
}

.score-summary > div:first-child {
  padding: 22px 24px;
}

.score-summary span,
.score-summary small {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.score-summary strong#score {
  display: block;
  margin: 8px 0 4px;
  font-size: 58px;
  line-height: 1;
}

.result-head {
  padding: 22px 24px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-strong), #2c7c6c);
}

.result-head span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.result-head strong {
  display: block;
  font-size: 26px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 16px 24px;
}

.metric:nth-child(3n) {
  border-right: 0;
}

.metric.wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.metric strong {
  display: block;
  font-size: 25px;
  line-height: 1.2;
}

.metric p {
  margin: 2px 0 0;
  color: var(--text);
  line-height: 1.7;
}

.good {
  color: var(--accent-strong);
}

.okay {
  color: var(--gold);
}

.bad {
  color: var(--danger);
}

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

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-summary,
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .metric:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 24px, 560px);
    padding: 28px 0;
  }

  .field-grid,
  .checks,
  .range-row {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
  }

  .actions button {
    width: 100%;
  }

  .actions p {
    text-align: left;
  }

  .score-summary,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .metric,
  .metric:nth-child(2n),
  .metric:nth-child(3n) {
    border-right: 0;
  }

  .section-title {
    display: block;
  }

  .section-title p {
    margin-top: 6px;
    text-align: left;
  }

  .score-summary strong#score {
    font-size: 52px;
  }
}
