:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1f2a26;
  --muted: #5a665f;
  --line: #d9d5ca;
  --accent: #2f5d46;
  --accent-ink: #ffffff;
  --accent-soft: #e4eee8;
  --warn-bg: #fff4d6;
  --warn-ink: #5c4300;
  --focus: #0b5fff;
  --radius: 10px;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-bottom: 110px;
  scroll-padding-top: 16px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  padding-bottom: 88px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 20px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}
.demo-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.layout {
  display: grid;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 24px;
}
@media (min-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding-top: 24px;
  }
  .preview {
    position: sticky;
    top: 16px;
  }
}

/* Preview */
.preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 16px;
}
.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.preview-title {
  font-size: 1.05rem;
}
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle button {
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 14px;
  min-height: 36px;
  background: var(--surface);
  border: 0;
  color: var(--ink);
  cursor: pointer;
}
.view-toggle button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.views {
  display: block;
}
.view {
  margin: 0;
}
.view svg {
  display: block;
  width: 100%;
  height: auto;
  background: linear-gradient(#eef2f4, #f8f6f1 70%);
  border-radius: 8px;
}
.view figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 4px 0 8px;
}
.view:not(.is-active) {
  display: none;
}
@media (min-width: 860px) {
  .view-toggle {
    display: none;
  }
  .view:not(.is-active) {
    display: block;
  }
}
.preview-sum {
  font-size: 0.9rem;
  color: var(--muted);
}
.share {
  margin-top: 10px;
}
.share-out {
  margin-top: 8px;
}
.share-out label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}
.share-out input {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #faf9f6;
}
#share-status {
  font-size: 0.85rem;
  color: var(--accent);
  min-height: 1.3em;
}

/* Stepper */
.stepper {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.stepper li {
  flex: 1 1 0;
  min-width: 0;
}
.stepper button {
  width: 100%;
  min-height: 44px;
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 4px;
  text-align: center;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
.stepper .num {
  font-weight: 700;
  color: var(--ink);
}
.stepper button[aria-current="step"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.stepper button[aria-current="step"] .num {
  color: var(--accent-ink);
}
.stepper .label {
  display: none;
}
@media (min-width: 520px) {
  .stepper .label {
    display: block;
  }
}

.notes {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}
.notes:empty {
  display: none;
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.panel[hidden] {
  display: none;
}
.panel h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}
.panel h2:focus {
  outline: none;
}
.panel .lead {
  color: var(--muted);
  margin-bottom: 16px;
}
fieldset {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
  min-width: 0;
}
legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 8px;
}
.cards {
  display: grid;
  gap: 8px;
}
.cards.cols-2 {
  grid-template-columns: 1fr 1fr;
}
.cards.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 420px) {
  .cards.cols-2 {
    grid-template-columns: 1fr;
  }
}
.card {
  position: relative;
  display: block;
}
.card input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
}
.card-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.card-hint {
  font-size: 0.85rem;
  color: var(--muted);
}
.card-reason {
  font-size: 0.85rem;
  color: var(--warn-ink);
}
.card-reason:empty {
  display: none;
}
.card input:checked + .card-body {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.card input:focus-visible + .card-body {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.card input:disabled {
  cursor: not-allowed;
}
.card input:disabled + .card-body {
  background: #efede7;
  border-style: dashed;
}
.card input:disabled + .card-body .card-title,
.card input:disabled + .card-body .card-hint {
  color: #7d857f;
}
.card.check .card-body {
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
}
.card.check .box {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid var(--muted);
  border-radius: 5px;
  background: var(--surface);
  display: grid;
  place-items: center;
}
.card.check input:checked + .card-body .box {
  background: var(--accent);
  border-color: var(--accent);
}
.card.check input:checked + .card-body .box::after {
  content: "";
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.card.check .text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cards.lengths .card-body {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.card.swatch .card-body {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.card.swatch .chip {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.card.swatch .text {
  display: flex;
  flex-direction: column;
}

/* Summary */
.summary {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.summary th {
  text-align: left;
  font-weight: 600;
}
.summary td,
.summary th {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.summary td:last-child {
  text-align: right;
  white-space: nowrap;
  padding-left: 12px;
}
.summary .detail {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 400;
}
.summary tfoot td,
.summary tfoot th {
  border-bottom: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.fineprint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 18px;
}
.form-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
@media (min-width: 520px) {
  .form-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  padding: 10px;
  border: 1px solid #8c9690;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.consent input {
  width: 22px;
  height: 22px;
  flex: none;
  margin: 1px 0 0;
}
.thanks {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 16px;
}
.thanks h3 {
  margin-bottom: 6px;
}
.thanks p + p {
  margin-top: 6px;
}
.thanks .btn {
  margin-top: 12px;
}

/* Buttons and bar */
.btn {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-quiet {
  background: var(--surface);
  color: var(--accent);
}
.btn[disabled],
.btn[hidden] {
  display: none;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
  z-index: 5;
}
.bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.price {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.price-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.price-value {
  font-size: 1.4rem;
}
.price-vat {
  font-size: 0.75rem;
  color: var(--muted);
}
.nav {
  display: flex;
  gap: 8px;
}
@media (max-width: 400px) {
  .btn {
    padding: 8px 12px;
  }
  .price-value {
    font-size: 1.25rem;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .card-body {
    transition:
      border-color 0.12s,
      background-color 0.12s;
  }
}
.lang-link {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
@media (max-width: 640px) {
  .header-row {
    position: relative;
  }
  .lang-link {
    position: absolute;
    right: 16px;
    top: 12px;
    margin-left: 0;
  }
}
