:root {
  --bg: #f8f5ef;
  --panel: #fffdf8;
  --ink: #1d2939;
  --accent: #006d77;
  --accent-soft: #d8f0f2;
  --line: #d0d5dd;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: linear-gradient(140deg, #f6efe3, #e5f1ee 70%, #f6efe3);
  color: var(--ink);
}

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

header p {
  margin: 8px 0 24px;
  color: #475467;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.hint {
  margin-top: 0;
  color: #667085;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.slider-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.slider-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slider-top strong {
  font-size: 1.1rem;
}

input[type="range"] {
  width: 100%;
}

.totals {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.rule-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

.check-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
}

input[type="number"],
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-size: 1rem;
  background: #fff;
}

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

button {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.95rem;
  cursor: pointer;
}

button.secondary {
  background: #475467;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.status {
  margin-left: auto;
  color: #344054;
}

.status.error {
  color: var(--danger);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.label {
  color: #475467;
  margin-bottom: 6px;
}

.value {
  font-weight: 700;
  font-size: 1.4rem;
}

@media (max-width: 700px) {
  .status {
    width: 100%;
    margin-left: 0;
  }
}
