:root {
  --bg: #f4f7f4;
  --panel: #ffffff;
  --text: #1e2721;
  --muted: #66716a;
  --line: #d9e0da;
  --accent: #2f7d57;
  --accent-dark: #245f43;
  --warning: #8a4b20;
  --shadow: 0 16px 40px rgba(32, 46, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(47, 125, 87, 0.45);
  outline-offset: 2px;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero {
  padding: 24px 0 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.25rem;
}

.intro {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.1rem;
}

.panel,
.results {
  margin-top: 20px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.remove-heading {
  width: 92px;
}

th {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

td input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--text);
  border: 1px solid #cbd5ce;
  border-radius: 6px;
  background: #fff;
}

.daily-wh-cell {
  min-width: 110px;
  padding-top: 18px;
  font-weight: 700;
}

.appliance-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

label input {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid #cbd5ce;
  border-radius: 6px;
  background: #fff;
}

small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.primary-button,
.secondary-button,
.remove-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  margin-top: 22px;
  padding: 0 22px;
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  padding: 0 16px;
  color: var(--accent-dark);
  background: #e3f0e8;
}

.secondary-button:hover {
  background: #d4e8dc;
}

.remove-button {
  width: 84px;
  color: #7a2d1f;
  background: #f7e3dd;
}

.remove-button:hover {
  background: #efd0c7;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.result-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.result-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.result-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.8rem;
  line-height: 1.1;
}

.disclaimer {
  margin: 18px 0 0;
  padding: 16px 18px;
  color: var(--warning);
  background: #fff7ec;
  border: 1px solid #f1d1a7;
  border-radius: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 820px) {
  .settings-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .secondary-button {
    margin-top: 14px;
  }

  .table-wrap {
    overflow-x: visible;
    max-width: 100%;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    width: 100%;
    min-width: 0;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  tr {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfb;
  }

  tr + tr {
    margin-top: 12px;
  }

  td {
    width: 100%;
    max-width: 100%;
    padding: 0;
    border-bottom: 0;
  }

  td + td {
    margin-top: 12px;
  }

  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
  }

  .daily-wh-cell {
    min-width: 0;
    padding-top: 0;
  }

  td input {
    min-width: 0;
  }

  .remove-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(calc(100% - 20px), 1120px);
    padding: 18px 0;
  }

  .panel,
  .results {
    padding: 16px;
  }

  h1 {
    font-size: 2.1rem;
  }
}
