/*
 * SpadeCalc calculator card: "garden centre shelf tag" (design/tokens.md, Stage 0.3, v2).
 * Workbench on the left (measuring-tape edge, drawn shape tiles, live sketch of the bed),
 * kraft-paper price tag on the right with the shopping list. Mobile: tag after the inputs
 * plus a peek bar. Loaded only on pages with [spadecalc]. Colours read the Kadence palette.
 */
.sc-calc {
  --sc-leaf: var(--global-palette1, #2f7d4f);
  --sc-leaf-dark: var(--global-palette2, #246140);
  --sc-soil: var(--global-palette3, #3b2f2a);
  --sc-soil-soft: var(--global-palette4, #6b5f59);
  --sc-clay: var(--global-palette5, #c46a3a);
  --sc-clay-deep: var(--global-palette6, #a5532a);
  --sc-line: var(--global-palette7, #e2ddd5);
  --sc-stone: var(--global-palette8, #f4f2ee);
  --sc-white: var(--global-palette9, #ffffff);
  --sc-kraft: #efe5d3;
  --sc-kraft-edge: #d9ccb4;
  --sc-display: var(--global-heading-font-family, 'Archivo', 'Arial Narrow', sans-serif);
  --sc-body: var(--global-body-font-family, 'Public Sans', system-ui, sans-serif);
  --sc-r: 4px;
  --sc-tap: 48px;

  position: relative;
  color: var(--sc-soil);
  background: var(--sc-white);
  border: 1px solid var(--sc-kraft-edge);
  border-radius: var(--sc-r);
  margin: 0 0 40px;
  font-family: var(--sc-body);
  font-size: 17px;
  line-height: 1.5;
  overflow: clip;
}

.sc-calc *,
.sc-calc *::before,
.sc-calc *::after {
  box-sizing: border-box;
}

/* Measuring-tape edge: inch ticks with a longer tick every 6. Decorative. */
.sc-calc::before {
  content: '';
  display: block;
  height: 14px;
  background:
    repeating-linear-gradient(90deg, var(--sc-soil) 0 1px, transparent 1px 12px) 0 0 / 100% 6px
      no-repeat,
    repeating-linear-gradient(90deg, var(--sc-soil) 0 1.5px, transparent 1.5px 72px) 0 0 / 100% 11px
      no-repeat,
    var(--sc-kraft);
  border-bottom: 1px solid var(--sc-kraft-edge);
}

.sc-calc__form {
  display: grid;
  /* minmax(0, ...): a long select option must not widen the column past a phone screen. */
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
}

@media (min-width: 900px) {
  .sc-calc__form {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}

.sc-calc__inputs {
  padding: 24px 16px 32px;
  display: grid;
  gap: 28px;
  align-content: start;
}

@media (min-width: 600px) {
  .sc-calc__inputs {
    padding: 28px 28px 36px;
  }
}

/* ---------- Steps ---------- */

.sc-step {
  display: grid;
  gap: 14px;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.sc-step__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 0;
  font-family: var(--sc-display);
  font-size: 19px;
  font-weight: 700;
  font-stretch: 90%;
  line-height: 1.2;
  color: var(--sc-soil);
}

.sc-step__num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border: 1.5px solid var(--sc-soil);
  border-radius: 50%;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transform: translateY(-1px);
}

/* ---------- Fields ---------- */

.sc-field {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.sc-field > label {
  font-weight: 600;
  font-size: 15px;
}

.sc-hint {
  font-size: 14px;
  color: var(--sc-soil-soft);
  margin: 0;
}

.sc-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px 16px;
}

/* Rows whose fields need more room (depth with its cross-section, long selects). */
.sc-row--wide {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

/* Input with an attached unit box, like a measuring form. */
.sc-input {
  display: flex;
  min-width: 0;
  height: var(--sc-tap);
  border: 1.5px solid var(--sc-soil-soft);
  border-radius: var(--sc-r);
  background: var(--sc-white);
}

.sc-input:focus-within {
  border-color: var(--sc-leaf);
  box-shadow: 0 0 0 2px var(--sc-leaf);
}

.sc-input input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  border-radius: var(--sc-r) 0 0 var(--sc-r);
  padding: 0 12px;
  font: inherit;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--sc-soil);
  background: transparent;
  outline: 0;
}

.sc-input__unit {
  display: grid;
  place-items: center;
  min-width: 46px;
  padding: 0 10px;
  background: var(--sc-kraft);
  border-left: 1.5px solid var(--sc-soil-soft);
  border-radius: 0 calc(var(--sc-r) - 1px) calc(var(--sc-r) - 1px) 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--sc-soil);
}

.sc-input__unit--pre {
  order: -1;
  border-left: 0;
  border-right: 1.5px solid var(--sc-soil-soft);
  border-radius: calc(var(--sc-r) - 1px) 0 0 calc(var(--sc-r) - 1px);
}

.sc-calc select {
  width: 100%;
  height: var(--sc-tap);
  padding: 0 40px 0 12px;
  font: inherit;
  color: var(--sc-soil);
  background:
    linear-gradient(45deg, transparent 50%, var(--sc-soil) 50%) right 20px center / 6px 6px
      no-repeat,
    linear-gradient(135deg, var(--sc-soil) 50%, transparent 50%) right 14px center / 6px 6px
      no-repeat,
    var(--sc-white);
  border: 1.5px solid var(--sc-soil-soft);
  border-radius: var(--sc-r);
  appearance: none;
}

.sc-input input[aria-invalid='true'] {
  color: var(--sc-clay-deep);
}

.sc-input:has(input[aria-invalid='true']) {
  border-color: var(--sc-clay-deep);
}

.sc-error {
  font-size: 14px;
  font-weight: 600;
  color: var(--sc-clay-deep);
  margin: 0;
}

.sc-error:empty {
  display: none;
}

.sc-calc select:focus-visible,
.sc-calc button:focus-visible,
.sc-calc a:focus-visible,
.sc-tile input:focus-visible + span,
.sc-toggle input:focus-visible + span {
  outline: 2px solid var(--sc-leaf);
  outline-offset: 2px;
}

/* ---------- Unit toggle (two-way switch) ---------- */

.sc-toggle {
  display: inline-flex;
  justify-self: start;
  border: 1.5px solid var(--sc-soil);
  border-radius: var(--sc-r);
  overflow: hidden;
}

.sc-toggle label {
  position: relative;
}

.sc-toggle input,
.sc-tile input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.sc-toggle span {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.sc-toggle label + label span {
  border-left: 1.5px solid var(--sc-soil);
}

.sc-toggle input:checked + span {
  background: var(--sc-soil);
  color: var(--sc-white);
}

/* ---------- Shape tiles (drawn) ---------- */

.sc-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 440px;
}

.sc-tile span {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  border: 1.5px solid var(--sc-line);
  border-radius: var(--sc-r);
  background: var(--sc-white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.sc-tile svg {
  width: 40px;
  height: 32px;
  color: var(--sc-soil-soft);
}

/* Four tiles split words like "Rectangle" on phones up to about 420 px wide: use two rows. */
@media (max-width: 420px) {
  .sc-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sc-tile span {
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
    min-height: var(--sc-tap);
    padding: 6px 10px;
  }

  .sc-tile svg {
    width: 30px;
    height: 24px;
  }
}

.sc-tile span:hover {
  border-color: var(--sc-soil-soft);
}

.sc-tile input:checked + span {
  border-color: var(--sc-leaf);
  background: var(--sc-stone);
  box-shadow: inset 0 0 0 1px var(--sc-leaf);
}

.sc-tile input:checked + span svg {
  color: var(--sc-leaf);
}

/* ---------- Areas and the live sketch ---------- */

.sc-area {
  display: grid;
  gap: 16px;
  padding: 16px 0 0;
  border-top: 1px dashed var(--sc-kraft-edge);
}

.sc-area:first-child {
  border-top: 0;
  padding-top: 0;
}

.sc-area__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.sc-area__title {
  margin: 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--sc-soil-soft);
}

.sc-area__body {
  display: grid;
  gap: 16px;
}

@media (min-width: 600px) {
  .sc-area__body {
    grid-template-columns: minmax(0, 1fr) 200px;
    align-items: start;
  }
}

.sc-shape {
  display: none;
}

/* Shape switching works without JavaScript (:has); the UI also sets [data-shape]. */
.sc-area:has(input[value='rectangle']:checked) .sc-shape--rectangle,
.sc-area:has(input[value='circle']:checked) .sc-shape--circle,
.sc-area:has(input[value='triangle']:checked) .sc-shape--triangle,
.sc-area:has(input[value='ring']:checked) .sc-shape--ring {
  display: grid;
}

.sc-sketch {
  margin: 0;
  width: 100%;
  max-width: 260px;
  background:
    linear-gradient(var(--sc-line) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, var(--sc-line) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--sc-white);
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-r);
  aspect-ratio: 5 / 4;
}

.sc-sketch svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sc-sketch .bed {
  fill: #8a5a3c;
  fill-opacity: 0.18;
  stroke: var(--sc-soil);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.sc-sketch .hole {
  fill: var(--sc-white);
  stroke: var(--sc-soil);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.sc-sketch .dim {
  stroke: var(--sc-clay-deep);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.sc-sketch text {
  font-family: var(--sc-display);
  font-size: 12px;
  font-weight: 700;
  fill: var(--sc-clay-deep);
  font-variant-numeric: tabular-nums;
}

/* Depth cross-section beside the depth field. */
.sc-section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.sc-section__bar {
  width: 64px;
  height: 64px;
  border: 1px solid var(--sc-kraft-edge);
  border-radius: var(--sc-r);
  background: repeating-linear-gradient(-45deg, #b9a586 0 2px, #cdbb9c 2px 6px);
  position: relative;
  overflow: hidden;
}

.sc-section__layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--sc-depth, 30%);
  background:
    radial-gradient(circle at 20% 40%, #6b4226 0 2px, transparent 3px) 0 0 / 9px 7px,
    radial-gradient(circle at 70% 60%, #8a5a3c 0 2px, transparent 3px) 0 0 / 11px 9px,
    #5a3a24;
  border-bottom: 2px solid var(--sc-soil);
  transition: height 0.2s ease;
}

/* Gravel: grey stones instead of wood chips. */
[data-spadecalc='gravel'] .sc-section__layer {
  background:
    radial-gradient(circle at 30% 40%, #a7a29a 0 2.5px, transparent 3.5px) 0 0 / 8px 7px,
    radial-gradient(circle at 70% 70%, #d3cec5 0 2px, transparent 3px) 0 0 / 10px 9px,
    #7d776f;
}

/* Topsoil: fine dark loam instead of wood chips. */
[data-spadecalc='topsoil'] .sc-section__layer {
  background:
    radial-gradient(circle at 30% 40%, #4a3424 0 1px, transparent 1.5px) 0 0 / 5px 4px,
    radial-gradient(circle at 70% 70%, #7a5a40 0 1px, transparent 1.5px) 0 0 / 6px 5px,
    #3e2b1e;
}

/* Depth shortcuts (topsoil): set the depth field to a sourced value. */
.sc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sc-presets .sc-btn {
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.875rem;
}

/* ---------- Buttons ---------- */

.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: var(--sc-r);
  border: 1.5px solid var(--sc-leaf);
  background: var(--sc-leaf);
  color: var(--sc-white);
  cursor: pointer;
  text-decoration: none;
}

.sc-btn:hover {
  background: var(--sc-leaf-dark);
  border-color: var(--sc-leaf-dark);
  color: var(--sc-white);
}

.sc-btn--line {
  background: transparent;
  color: var(--sc-soil);
  border-color: var(--sc-soil);
}

.sc-btn--line:hover {
  background: var(--sc-soil);
  border-color: var(--sc-soil);
  color: var(--sc-white);
}

.sc-btn--text {
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--sc-leaf-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sc-btn--text:hover {
  background: none;
  color: var(--sc-soil);
}

.sc-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ---------- The tag (result) ---------- */

.sc-calc__result {
  padding: 28px 16px 32px;
  background: var(--sc-stone);
  border-top: 1px solid var(--sc-kraft-edge);
  scroll-margin-top: 96px;
}

@media (min-width: 900px) {
  .sc-calc__result {
    border-top: 0;
    border-left: 1px solid var(--sc-kraft-edge);
    padding: 28px 24px 36px;
  }

  .sc-tag {
    position: sticky;
    top: 96px;
  }
}

.sc-tag {
  position: relative;
  background: var(--sc-kraft);
  border: 1px solid var(--sc-kraft-edge);
  border-radius: 6px 6px 3px 3px;
  padding: 34px 20px 20px;
  box-shadow:
    0 1px 0 var(--sc-kraft-edge),
    0 10px 24px -14px rgb(59 47 42 / 0.45);
  /* Reserved height so live updates never shift the page (CLS budget 0.02). */
  min-height: 460px;
  display: grid;
  align-content: start;
  gap: 14px;
}

/* Punched hole with a loop of string. */
.sc-tag::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--sc-stone);
  box-shadow: inset 0 1px 2px rgb(59 47 42 / 0.4);
}

.sc-tag::after {
  content: '';
  position: absolute;
  top: -22px;
  left: 50%;
  width: 2px;
  height: 36px;
  margin-left: -1px;
  background: var(--sc-soil-soft);
  border-radius: 1px;
}

.sc-tag__kicker {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--sc-soil-soft);
}

.sc-tag__big {
  margin: -6px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 10px;
  font-family: var(--sc-display);
  font-stretch: 85%;
  font-weight: 800;
  /* Smaller on phones so "12.35 cu yd" fits; the number itself never breaks. */
  font-size: clamp(48px, 14vw, 72px);
  white-space: nowrap;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.sc-tag__big small {
  font-size: 24px;
  font-weight: 700;
  font-stretch: 90%;
  letter-spacing: 0;
}

.sc-tag__sub {
  margin: -6px 0 0;
  font-size: 16px;
}

.sc-tag__sub strong {
  font-variant-numeric: tabular-nums;
}

/* Receipt lines with dotted leaders. */
.sc-tag__lines {
  margin: 4px 0 0;
  padding: 12px 0 0;
  border-top: 2px dashed var(--sc-kraft-edge);
  display: grid;
  gap: 6px;
}

.sc-tag__lines div {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 15px;
}

.sc-tag__lines dt {
  color: var(--sc-soil);
}

.sc-tag__lines div::after {
  content: '';
  order: 1;
  flex: 1;
  border-bottom: 2px dotted var(--sc-kraft-edge);
  transform: translateY(-4px);
}

.sc-tag__lines dd {
  order: 2;
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.sc-tag__note {
  margin: 0;
  font-size: 14px;
  color: var(--sc-soil-soft);
}

.sc-tag__note--warn {
  color: #8a4421; /* clay-deep darkened: 5.74:1 on kraft (clay-deep is only 4.35:1) */
  font-weight: 600;
}

.sc-tag__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 2px dashed var(--sc-kraft-edge);
}

.sc-status {
  font-size: 14px;
  font-weight: 600;
  color: var(--sc-leaf-dark);
  min-height: 1.5em;
  margin: -6px 0 0;
}

/* ---------- Mobile peek bar ---------- */

.sc-peek {
  display: none;
}

@media (max-width: 899px) {
  .sc-peek {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--sc-kraft);
    border-top: 2px dashed var(--sc-kraft-edge);
    box-shadow: 0 -6px 18px -8px rgb(59 47 42 / 0.35);
    font-variant-numeric: tabular-nums;
    transition: transform 0.2s ease;
  }

  .sc-peek.is-hidden {
    transform: translateY(115%);
  }

  .sc-peek__num {
    font-family: var(--sc-display);
    font-stretch: 85%;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
  }

  .sc-peek__sub {
    display: block;
    font-size: 14px;
    color: var(--sc-soil-soft);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-peek,
  .sc-section__layer {
    transition: none;
  }
}

/* ---------- Helpers ---------- */

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

.sc-nojs {
  margin: 0;
  padding: 12px 16px;
  background: var(--sc-kraft);
  border-left: 4px solid var(--sc-clay-deep);
  font-size: 15px;
}

/* ---------- Print: the tag as a shopping list ---------- */

@media print {
  .sc-calc {
    border: 0;
  }

  .sc-calc::before,
  .sc-tiles,
  .sc-toggle,
  .sc-sketch,
  .sc-section__bar,
  .sc-tag__actions,
  .sc-peek,
  .sc-status,
  [data-add-area],
  [data-remove-area] {
    display: none !important;
  }

  .sc-calc__form {
    grid-template-columns: 1fr;
  }

  .sc-calc__result {
    background: none;
    border: 0;
  }

  .sc-tag {
    min-height: 0;
    box-shadow: none;
  }

  .sc-tag::before,
  .sc-tag::after {
    display: none;
  }
}

.sc-tag__lines--more {
  margin: 0;
  padding: 0;
  border: 0;
}

.sc-tag__lines--more:empty {
  display: none;
}

/* ---------- Raised bed soil ---------- */

/* Two bed shapes: keep the tiles tile-sized instead of stretching to four columns. */
.sc-tiles--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 220px;
}

/* Custom blend parts show only when "My own blend" is chosen (works without JavaScript). */
.sc-calc:not(:has(#sc-recipe option[value='custom']:checked)) .sc-custom {
  display: none;
}

.sc-custom {
  display: grid;
  gap: 10px;
}

/* Price fields for ingredients the blend does not use (the UI sets [hidden]). */
.sc-field[hidden] {
  display: none;
}

/*
 * SpadeCalc v4 "Editorial" calculator skin (prototype, 30 Oct 2026).
 * Layered after calculator.css for the preview; merged into it once approved.
 * White card with hairlines, iOS-style segmented controls, a black result panel.
 */
.sc-calc {
  --sc-leaf: #0b0b0b;
  --sc-leaf-dark: #3d3d3a;
  --sc-soil: #0b0b0b;
  --sc-soil-soft: #66665f;
  --sc-line: #e6e6e2;
  --sc-stone: #f5f5f3;
  --sc-kraft: #f5f5f3;
  --sc-kraft-edge: #e6e6e2;
  --sc-display: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --sc-body: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --sc-r: 12px;

  border: 1px solid var(--sc-line);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 24px 48px -32px rgb(0 0 0 / 0.18);
}

.sc-calc::before {
  display: none;
}

.sc-calc__inputs {
  gap: 36px;
}

@media (min-width: 600px) {
  .sc-calc__inputs {
    padding: 36px 36px 40px;
  }
}

.sc-step {
  gap: 16px;
}

.sc-step__title {
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 24px;
  font-weight: 500;
  font-stretch: normal;
  letter-spacing: -0.025em;
}

.sc-step__num {
  display: inline-block;
  white-space: nowrap;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--sc-soil-soft);
  transform: none;
}

.sc-step__num::before {
  content: '0';
}

.sc-field > label {
  font-weight: 500;
  font-size: 14px;
  color: var(--sc-soil-soft);
}

.sc-input,
.sc-calc select {
  border: 1px solid #d6d6d1;
  border-radius: var(--sc-r);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sc-input:hover,
.sc-calc select:hover {
  border-color: #b9b9b3;
}

.sc-input:focus-within,
.sc-calc select:focus {
  border-color: var(--sc-soil);
  box-shadow: 0 0 0 3px rgb(11 11 11 / 0.08);
}

.sc-input input {
  font-size: 18px;
  font-weight: 500;
}

.sc-input input::placeholder {
  color: #767670;
  font-weight: 400;
}

.sc-input__unit {
  min-width: 44px;
  background: transparent;
  border-left: 0;
  font-size: 15px;
  font-weight: 400;
  color: var(--sc-soil-soft);
}

.sc-input__unit--pre {
  border-right: 0;
  padding-right: 0;
}

/* Segmented control */
.sc-toggle {
  padding: 3px;
  border: 0;
  border-radius: 12px;
  background: var(--sc-stone);
}

.sc-toggle label + label span {
  border-left: 0;
}

.sc-toggle span {
  min-height: 36px;
  padding: 0 18px;
  border-radius: 9px;
  font-weight: 500;
  color: var(--sc-soil-soft);
  transition: background 0.2s, color 0.2s;
}

.sc-toggle input:checked + span {
  background: var(--sc-white);
  color: var(--sc-soil);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

/* Shape tiles */
.sc-tiles {
  gap: 8px;
}

.sc-tile span {
  border: 1px solid var(--sc-line);
  border-radius: 14px;
  font-weight: 500;
  color: var(--sc-soil-soft);
  transition: border-color 0.15s, background 0.15s;
}

.sc-tile span:hover {
  border-color: #b9b9b3;
}

.sc-tile svg {
  color: var(--sc-soil-soft);
}

.sc-tile input:checked + span {
  border-color: var(--sc-soil);
  background: var(--sc-white);
  box-shadow: inset 0 0 0 1px var(--sc-soil);
  color: var(--sc-soil);
}

.sc-tile input:checked + span svg {
  color: var(--sc-soil);
}

@media (max-width: 420px) {
  .sc-tile span {
    gap: 8px;
    padding: 6px 10px;
    font-size: 14px;
  }

  .sc-tile svg {
    width: 24px;
    flex: none;
  }
}

.sc-area {
  border-top: 1px solid var(--sc-line);
}

.sc-area__title {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sc-sketch {
  border: 1px solid var(--sc-line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 1px 1px, #dcdcd7 1px, transparent 1.2px) 0 0 / 16px 16px,
    #fafaf8;
}

.sc-sketch .bed {
  fill: #0b0b0b;
  fill-opacity: 0.06;
  stroke: var(--sc-soil);
  stroke-width: 1.5;
}

.sc-sketch .dim {
  stroke: var(--sc-soil-soft);
}

.sc-sketch text {
  font-weight: 500;
  fill: var(--sc-soil-soft);
}

.sc-section__bar {
  border: 1px solid var(--sc-line);
  border-radius: 12px;
}

/* Buttons */
.sc-btn {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--sc-soil);
  border-radius: 999px;
  background: var(--sc-soil);
  color: var(--sc-white);
  font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sc-btn:hover {
  background: #3d3d3a;
  border-color: #3d3d3a;
}

.sc-btn--line {
  background: transparent;
  color: var(--sc-soil);
  border-color: #d6d6d1;
}

.sc-btn--line:hover {
  background: var(--sc-white);
  color: var(--sc-soil);
  border-color: var(--sc-soil);
}

.sc-btn--text {
  border: 0;
  background: none;
  color: var(--sc-soil);
  text-decoration-thickness: 1px;
  text-decoration-color: rgb(11 11 11 / 0.35);
}

.sc-btn--text:hover {
  background: none;
  text-decoration-color: currentColor;
}

/* Result: black panel */
.sc-calc__result {
  background: var(--sc-stone);
  border-top: 1px solid var(--sc-line);
}

@media (min-width: 900px) {
  .sc-calc__result {
    border-top: 0;
    border-left: 1px solid var(--sc-line);
    padding: 28px 24px 36px;
  }
}

.sc-tag {
  background: #0b0b0b;
  color: #fff;
  border: 0;
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.5);
}

.sc-tag::before,
.sc-tag::after {
  display: none;
}

.sc-tag__kicker {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.62);
}

.sc-tag__big {
  font-weight: 500;
  font-stretch: normal;
  letter-spacing: -0.05em;
  font-size: clamp(60px, 17vw, 88px);
  line-height: 0.9;
}

.sc-tag__big small {
  font-size: 22px;
  font-weight: 400;
  font-stretch: normal;
  letter-spacing: -0.01em;
  color: rgb(255 255 255 / 0.62);
}

.sc-tag__sub {
  color: rgb(255 255 255 / 0.72);
}

.sc-tag__sub strong {
  color: #fff;
  font-weight: 500;
}

.sc-tag__lines,
.sc-tag__actions {
  border-top: 1px solid rgb(255 255 255 / 0.14);
}

.sc-tag__lines--more {
  border-top: 0;
}

.sc-tag__lines dt {
  color: rgb(255 255 255 / 0.62);
}

.sc-tag__lines dd {
  font-weight: 500;
}

.sc-tag__lines div::after {
  border-bottom: 0;
}

.sc-tag__note {
  color: rgb(255 255 255 / 0.62);
}

.sc-tag__note--warn {
  color: #f5c66b;
  font-weight: 500;
}

.sc-tag .sc-btn {
  background: #fff;
  color: #0b0b0b;
  border-color: #fff;
}

.sc-tag .sc-btn:hover {
  background: #e9e9e6;
}

.sc-tag .sc-btn--line {
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  border-color: rgb(255 255 255 / 0.2);
}

.sc-tag .sc-btn--line:hover {
  background: rgb(255 255 255 / 0.16);
  color: #fff;
}

.sc-tag .sc-btn--text {
  background: none;
  border: 0;
  color: #fff;
  text-decoration-color: rgb(255 255 255 / 0.4);
}

.sc-status,
.sc-tag a {
  color: #fff;
}

/* Mobile peek bar: frosted black */
@media (max-width: 899px) {
  .sc-peek {
    margin: 0 10px 10px;
    left: 0;
    right: 0;
    border-radius: 20px;
    background: rgb(11 11 11 / 0.88);
    backdrop-filter: blur(14px);
    color: #fff;
    border: 0;
    box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.5);
  }

  .sc-peek__num {
    font-weight: 500;
    font-stretch: normal;
    letter-spacing: -0.03em;
  }

  .sc-peek__sub {
    color: rgb(255 255 255 / 0.62);
  }

  .sc-peek .sc-btn {
    background: #fff;
    color: #0b0b0b;
    border-color: #fff;
  }
}

.sc-nojs {
  background: var(--sc-stone);
  border-left: 0;
  border-radius: 12px;
}

@media print {
  .sc-calc {
    box-shadow: none;
  }

  .sc-tag {
    background: none;
    color: #000;
    box-shadow: none;
  }

  .sc-tag__big,
  .sc-tag__big small,
  .sc-tag__sub,
  .sc-tag__sub strong,
  .sc-tag__lines dt,
  .sc-tag__note {
    color: #000;
  }
}

/* ---------- Checkbox row (grass seed: coated seed) ---------- */

.sc-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 16px;
  cursor: pointer;
}

.sc-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  accent-color: var(--sc-soil);
}

.sc-check input:focus-visible {
  outline: 2px solid var(--sc-soil);
  outline-offset: 2px;
}

/* Long units ("lb / 1,000 sq ft") stay on one line; the input keeps at least 4 digits of room. */
.sc-input__unit {
  white-space: nowrap;
}

.sc-input input {
  min-width: 4ch;
}
