:root {
  color-scheme: light;
  --ink: #18201b;
  --muted: #637067;
  --line: #d9e0d8;
  --panel: #fbfcf8;
  --field: #ffffff;
  --accent: #237c62;
  --accent-2: #efb347;
  --accent-3: #456990;
  --good: #1d7f4f;
  --warn: #b46c1b;
  --shadow: 0 18px 50px rgba(32, 44, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(35, 124, 98, 0.12), rgba(239, 179, 71, 0.08)),
    #eef3ed;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  min-height: calc(100vh - 40px);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(217, 224, 216, 0.9);
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 24px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-copy {
  min-width: 0;
}

.brand-logo-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.brand-logo-wrap picture {
  display: block;
}

.brand-logo {
  display: block;
  width: min(260px, 100%);
  height: auto;
  max-height: 66px;
  object-fit: contain;
  object-position: left center;
}

.brand-copy {
  display: none;
}

.icon-action,
.primary-action,
.secondary-action {
  min-height: 38px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.icon-action {
  margin-left: auto;
  padding: 0 12px;
  background: #e7f3ed;
  color: var(--accent);
}

.primary-action {
  padding: 0 14px;
  background: var(--accent);
  color: #ffffff;
}

.secondary-action {
  padding: 0 14px;
  background: #edf1ec;
  color: var(--ink);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.45rem;
  line-height: 1.1;
}

.brand-row p,
.details-band p {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 16px;
}

fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: white;
}

legend {
  padding: 0 6px;
  color: var(--accent);
  font-weight: 750;
}

label {
  display: grid;
  gap: 7px;
  margin-top: 13px;
  color: #334038;
  font-size: 0.92rem;
  font-weight: 650;
}

label:first-of-type {
  margin-top: 4px;
}

.control-line,
.range-line {
  display: grid;
  align-items: center;
  gap: 8px;
}

.control-line {
  grid-template-columns: minmax(0, 1fr) auto;
}

.range-line {
  grid-template-columns: minmax(0, 1fr) 52px;
}

.option-grid {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.option-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid #cbd5cc;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.option-tile:has(input:checked) {
  border-color: var(--accent);
  background: #edf7f1;
  box-shadow: inset 0 0 0 1px rgba(35, 124, 98, 0.22);
}

.option-tile input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.option-tile span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.option-tile strong {
  font-size: 0.95rem;
}

.option-tile small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5cc;
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
}

input[type="number"],
select {
  height: 42px;
  padding: 0 11px;
}

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

.control-line span,
output {
  color: var(--muted);
  font-weight: 700;
}

.field-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.is-hidden {
  display: none;
}

.results-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  min-width: 0;
  padding: 24px;
}

.visual-stage {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fbf4 0%, #e5eee6 100%);
  border: 1px solid var(--line);
}

canvas {
  display: block;
  width: 100%;
  height: min(42vh, 420px);
  min-height: 300px;
}

.headline-metrics {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.headline-metrics article,
.result-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 224, 216, 0.95);
}

.headline-metrics article {
  padding: 13px;
}

.headline-metrics .metric-highlight {
  background: linear-gradient(135deg, rgba(35, 137, 101, 0.96), rgba(100, 182, 56, 0.96));
  border-color: rgba(24, 116, 81, 0.95);
  box-shadow: 0 12px 26px rgba(24, 116, 81, 0.22);
}

.headline-metrics .metric-highlight span,
.headline-metrics .metric-highlight strong {
  color: #fff;
}

.headline-metrics .metric-highlight strong {
  font-size: clamp(1.45rem, 3vw, 2.25rem);
}

.headline-metrics span,
dt {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.headline-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  line-height: 1.1;
}

.estimate-note {
  padding: 16px 18px;
  background: #f2faf5;
  border: 1px solid rgba(35, 124, 98, 0.34);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
}

.estimate-note h2 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 1rem;
}

.estimate-note p {
  margin: 0;
  color: #53655b;
  font-size: 0.96rem;
  line-height: 1.55;
}

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

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

.result-card.is-best {
  border-color: rgba(35, 124, 98, 0.65);
  box-shadow: 0 12px 28px rgba(35, 124, 98, 0.13);
}

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

.card-title h2,
.details-band h2 {
  font-size: 1rem;
}

.card-title span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #e7f3ed;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #eef2ec;
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.details-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-content: start;
  padding: 4px 0 0;
}

.details-band div {
  min-width: 0;
  padding: 16px 0;
  border-top: 2px solid var(--line);
}

.details-band p {
  margin-top: 8px;
  line-height: 1.5;
}

.info-request {
  display: grid;
  gap: 16px;
  margin-top: 6px;
  padding: 20px 0 0;
  border-top: 2px solid var(--line);
}

.info-request h2 {
  font-size: 1.15rem;
}

.info-request p {
  margin-top: 6px;
  color: var(--muted);
}

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

.info-form label {
  margin-top: 0;
}

.info-form input {
  height: 42px;
  padding: 0 11px;
}

.info-form button,
.form-message {
  align-self: end;
}

.form-message {
  min-height: 24px;
  margin: 0;
  font-weight: 750;
}

.form-message.is-error {
  color: #9d2f20;
}

.form-message.is-ok {
  color: var(--good);
}

.admin-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  justify-items: end;
  background: rgba(24, 32, 27, 0.28);
}

.admin-drawer.is-hidden,
.admin-login.is-hidden,
.admin-content.is-hidden {
  display: none;
}

.admin-panel {
  width: min(520px, 100%);
  min-height: 100vh;
  padding: 22px;
  overflow: auto;
  background: #fbfcf8;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 45px rgba(24, 32, 27, 0.18);
}

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

.admin-header h2 {
  font-size: 1.25rem;
}

.admin-header p,
.admin-message {
  margin-top: 5px;
  color: var(--muted);
}

.admin-content-message {
  margin-top: 0;
  padding: 10px 12px;
  background: #f6faf6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-login,
.admin-content {
  display: grid;
  gap: 18px;
}

.admin-content section,
.admin-login {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-content h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

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

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pricing-table {
  display: grid;
  gap: 8px;
}

.pricing-row,
.battery-row {
  display: grid;
  gap: 8px;
  align-items: end;
}

.pricing-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) 38px;
}

.battery-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) 38px;
}

.pricing-row.is-header,
.battery-row.is-header {
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pricing-row input,
.battery-row input {
  height: 38px;
  padding: 0 9px;
}

.admin-subtitle {
  margin-top: 16px;
}

.pricing-remove {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #f4e9e7;
  color: #9d2f20;
  font-weight: 900;
  cursor: pointer;
}

.admin-message.is-error {
  color: #9d2f20;
  font-weight: 750;
}

.admin-message.is-ok {
  color: var(--good);
  font-weight: 750;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: 100vh;
    border: 0;
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 720px) {
  .input-panel,
  .results-panel {
    padding: 16px;
  }

  .form-grid,
  .comparison-grid,
  .details-band,
  .info-form,
  .admin-grid,
  .pricing-row,
  .battery-row,
  .headline-metrics {
    grid-template-columns: 1fr;
  }

  .headline-metrics {
    position: static;
    padding: 12px;
    background: #f8fbf4;
  }

  canvas {
    height: 280px;
    min-height: 260px;
  }

  dl div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  dd {
    text-align: left;
  }

  .brand-logo {
    width: min(230px, 78vw);
    max-height: 190px;
    margin: 0 auto;
    object-position: center;
  }

  .brand-row {
    align-items: center;
  }
}
