:root {
  color-scheme: light;
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-muted: #f1efe8;
  --text: #161616;
  --muted: #66645f;
  --line: #d9d5cb;
  --accent: #0f766e;
  --accent-strong: #0b4f4a;
  --warn-bg: #fff4d8;
  --warn-text: #7c4a03;
  --shadow: 0 18px 60px rgba(39, 34, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(180, 83, 9, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.hero-topline {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
}

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

.language-switch {
  display: inline-flex;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.language-switch button {
  min-width: 54px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.language-switch button.active {
  background: var(--accent);
  color: white;
}

.language-switch button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: -3px;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.price-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.price-card {
  display: grid;
  gap: 4px;
  padding: 18px;
}

.price-card span,
.price-card small {
  color: var(--muted);
}

.price-card strong {
  font-size: 34px;
  line-height: 1;
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 22px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field-full {
  grid-column: 1 / -1;
}

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

.field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

textarea,
input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

textarea {
  min-height: 190px;
  resize: vertical;
  padding: 14px;
  line-height: 1.55;
}

input[type="number"] {
  height: 44px;
  padding: 0 12px;
}

textarea:focus,
input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.segmented {
  display: flex;
  width: 100%;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.segmented label {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.segmented input:checked + span {
  background: var(--accent);
  color: white;
}

.switch-row {
  align-content: start;
}

.switch {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  transition: background 0.18s, border-color 0.18s;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  content: "";
  transition: transform 0.18s;
}

.switch input:checked + .switch-track {
  border-color: var(--accent);
  background: var(--accent);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}

.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.switch-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.presets button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0 12px;
}

.presets button:hover {
  border-color: var(--accent);
}

.results {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 18px;
}

.total {
  display: grid;
  gap: 12px;
}

.total span,
.total small {
  color: var(--muted);
}

.total small:empty,
.per-image small:empty {
  display: none;
}

.total-prices {
  display: grid;
  gap: 6px;
}

.total-prices strong {
  font-size: 46px;
  line-height: 1;
}

.total-prices small {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-strong);
}

.per-image {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.per-image span {
  font-size: 13px;
  font-weight: 700;
}

.per-image strong {
  font-size: 18px;
  text-align: right;
}

.per-image small {
  grid-column: 2;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-strong);
  text-align: right;
}

.meter {
  display: flex;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.meter span:first-child {
  background: #2563eb;
}

.meter span:last-child {
  background: var(--accent);
}

.breakdown {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.breakdown dt {
  color: var(--muted);
}

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

.notice {
  display: none;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn-text);
  padding: 12px;
  line-height: 1.5;
}

.notice:not(:empty) {
  display: block;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.links a {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

.seo-content {
  max-width: 900px;
  margin: 30px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.seo-content h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.25;
}

.seo-content p {
  margin: 0 0 12px;
}

@media (max-width: 860px) {
  .hero,
  .calculator,
  .inputs,
  .form-row {
    grid-template-columns: 1fr;
  }

  .results {
    position: static;
  }
}

@media (max-width: 520px) {
  .hero-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .shell {
    width: min(100% - 20px, 1180px);
    padding: 22px 0;
  }

  .panel {
    padding: 16px;
  }

  .total-prices strong {
    font-size: 38px;
  }
}
