/* Pecorva Pricing & Hardware Order Sheet (/pricing/index.html)
   Built strictly on shared/tokens.css (Barn Dawn dark palette, Tanker + Switzer + Azeret Mono).
   Layout: /pricing/ order sheet - two-column rate card ladder with sticky order receipt on desktop
   and single-column document stack on mobile -> sticky-aside
   (https://raw.githubusercontent.com/changeroa/StyleGallery/main/layout/index.md);
   scroll owner: document; anti-patterns: nested vertical scrollbars, equal SaaS card grid, horizontal overflow. */

:root {
  --pad: clamp(16px, 4vw, 48px);
  --maxw: 1280px;
  --nav-h: 68px;
  --text-muted: #9e9586;
}

[data-theme="light"] {
  --text-muted: #5c5549;
}

[hidden] {
  display: none !important;
}

html {
  scroll-padding-top: calc(var(--nav-h) + var(--space-4));
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--bg-canvas);
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
}

p,
h1,
h2,
h3,
dt,
dd,
li,
span,
a,
label {
  overflow-wrap: anywhere;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

input,
textarea,
select {
  caret-color: var(--accent-primary);
}

::selection {
  background: var(--accent-primary-subtle);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent-primary);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-mono);
}

.skip {
  position: absolute;
  left: var(--space-3);
  top: -64px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: var(--space-3);
}

.container {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ============================================================================
   NAVIGATION HEADER
   ============================================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
}

.site-nav__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  min-height: var(--nav-h);
  padding-block: var(--space-2);
}

.site-nav__brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-nav__brand img {
  height: 32px;
  width: auto;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition:
    color var(--duration-micro) var(--ease-out-expo),
    background-color var(--duration-micro) var(--ease-out-expo);
}

.site-nav__link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.site-nav__link[aria-current="page"] {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

/* ============================================================================
   MAIN WORKSPACE & SHEET HEADER
   ============================================================================ */
.sheet-main {
  flex: 1;
  padding-block: clamp(var(--space-6), 4vw, var(--space-12));
}

.notice-bar {
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.notice-bar__text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 68ch;
}

.sheet-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-header__copy {
  display: grid;
  gap: var(--space-3);
  max-width: 68ch;
  min-width: 0;
}

.sheet-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-synthesis: none;
  font-size: clamp(2.35rem, 4.2vw, 3.75rem);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--text-primary);
}

.sheet-lede {
  margin: 0;
  max-width: 66ch;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text-secondary);
}

.sheet-header__controls {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 100%;
}

/* Billing Interval Switch */
.interval-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-1);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  max-width: 100%;
}

.interval-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out-expo),
    color var(--duration-fast) var(--ease-out-expo),
    transform var(--duration-micro) var(--ease-out-expo);
}

.interval-switch__btn:hover {
  color: var(--text-primary);
}

.interval-switch__btn:active {
  transform: scale(0.98);
}

.interval-switch__btn[aria-pressed="true"] {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.interval-switch__sub {
  font-size: var(--text-xs);
  color: var(--accent-primary);
}

/* ============================================================================
   SIGNED-OUT GATE STRIP
   ============================================================================ */
.gate-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-top: var(--space-6);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.gate-strip__copy {
  display: grid;
  gap: var(--space-2);
  max-width: 64ch;
  min-width: 0;
  flex: 1 1 320px;
}

.gate-strip__title {
  margin: 0;
  font-size: clamp(1.75rem, 2.4vw, 2.15rem);
  font-weight: 600;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-heading);
  color: var(--text-primary);
}

.gate-strip__text {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text-secondary);
  max-width: 65ch;
}

.gate-strip__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* ============================================================================
   TWO-COLUMN RATE CARD + STICKY RECEIPT LAYOUT
   ============================================================================ */
.sheet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.95fr);
  gap: clamp(var(--space-8), 4vw, var(--space-12));
  align-items: start;
  margin-top: var(--space-10);
}

.sheet-layout > *,
.sheet-column > * {
  min-width: 0;
}

.sheet-column {
  display: grid;
  gap: var(--space-12);
}

.sheet-section {
  display: grid;
  gap: var(--space-6);
}

.sheet-section--hardware {
  padding-top: var(--space-10);
  border-top: 1px solid var(--border-subtle);
}

.sheet-section__head {
  display: grid;
  gap: var(--space-2);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-synthesis: none;
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-display);
  color: var(--text-primary);
}

.section-note {
  margin: 0;
  max-width: 66ch;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text-secondary);
}

/* ============================================================================
   RULED RATE CARD LADDER
   ============================================================================ */
.rate-ladder {
  display: grid;
  border-top: 1px solid var(--border-subtle);
}

.rate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-6);
  align-items: start;
  padding: var(--space-6) var(--space-5);
  border-bottom: 1px solid var(--border-hairline);
  background: transparent;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out-expo);
}

.rate-row:hover {
  background: var(--bg-surface);
}

.rate-row[aria-checked="true"] {
  background: var(--accent-primary-subtle);
}

.rate-row__main {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.rate-row__title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.rate-row__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: transparent;
  flex-shrink: 0;
  transition:
    background-color var(--duration-fast) var(--ease-out-expo),
    border-color var(--duration-fast) var(--ease-out-expo),
    color var(--duration-fast) var(--ease-out-expo),
    transform var(--duration-fast) var(--ease-optical-lock);
}

.rate-row[aria-checked="true"] .rate-row__check {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-inverse);
}

.row-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-synthesis: none;
  font-size: clamp(1.35rem, 1.6vw, 1.55rem);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
  color: var(--text-primary);
}

.current-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-0-5) var(--space-2);
  border-radius: var(--radius-xs);
  border: 1px solid var(--status-nominal-border);
  background: var(--status-nominal-bg);
  font-size: var(--text-xs);
  color: var(--status-nominal);
}

.trial-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-0-5) var(--space-2);
  border-radius: var(--radius-xs);
  border: 1px solid var(--accent-primary-border);
  background: var(--accent-primary-subtle);
  font-size: var(--text-xs);
  color: var(--accent-primary);
}

.rate-row__desc {
  margin: 0;
  max-width: 65ch;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text-secondary);
}

.rate-row[aria-checked="true"] .rate-row__desc {
  color: var(--text-primary);
}

.rate-row__meta {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.rate-row__price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  min-width: 128px;
  text-align: right;
}

/* ============================================================================
   PRICE SLOTS & REDACTION BARS (LOCKED vs LIVE)
   ============================================================================ */
.price-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 40px;
}

.price-redact {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1-5) var(--space-3);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  transform-origin: right center;
}

.price-redact__bar {
  display: inline-block;
  width: 68px;
  height: 14px;
  border-radius: 2px;
  background: var(--border-strong);
}

.price-redact--sm {
  padding: var(--space-1) var(--space-2);
}

.price-redact--sm .price-redact__bar {
  width: 48px;
  height: 10px;
}

.lock-glyph {
  flex-shrink: 0;
  color: var(--accent-primary);
}

.price-live {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-0-5);
}

.price-live__amount {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.5vw, 2.35rem);
  line-height: 1;
  letter-spacing: var(--tracking-display);
  color: var(--accent-primary);
}

.price-live__unit {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.price-live__note {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.price-live__note:empty {
  display: none;
}

/* ============================================================================
   CAMERA SELECTOR & FALLING STEP CURVE
   ============================================================================ */
/* Picker: a header line, an even segmented control, then the plan's allowance as chips */
.cam-picker {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.cam-picker__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.cam-picker__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.cam-picker__more {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration-color: var(--border-strong);
}

.cam-picker__more:hover {
  color: var(--accent-primary);
  text-decoration-color: currentColor;
}

.cam-selector {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
}

.cam-selector__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 0;
  padding: 0 var(--space-1);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out-expo),
    color var(--duration-fast) var(--ease-out-expo),
    transform var(--duration-micro) var(--ease-out-expo);
}

.cam-selector__btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.cam-selector__btn:active {
  transform: scale(0.97);
}

.cam-selector__btn[aria-checked="true"] {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

.cam-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.cam-stat + .cam-stat::before {
  content: "·";
  margin-right: var(--space-2);
  color: var(--border-strong);
}

.cam-stat strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* One quiet panel: where the cameras run, then the cost of the selected step */
.cam-facts {
  display: grid;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  overflow: hidden;
}

/* Falling cost per added camera: only the selected step shows; its bar compares it with the first */
.step-curve {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--border-hairline);
}

.step-curve__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
}

.step-curve__title {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.step-curve__sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary, var(--text-secondary));
}

.step-curve__bars {
  display: grid;
}

.step-bar[data-active="false"] {
  display: none;
}

.step-bar {
  display: grid;
  gap: var(--space-2);
}

.step-bar__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.step-bar__label {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.step-bar__val {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-primary);
  white-space: nowrap;
}

.step-bar__track {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.step-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-primary);
  transition: width var(--duration-base) var(--ease-out-expo);
}

/* ============================================================================
   WHERE CAMERAS RUN: CLOUD (2) VS BARNSTAR BOX (8 PER BOX)
   ============================================================================ */
.run-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.run-mode {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  transition: border-color var(--duration-fast) var(--ease-out-expo),
    background-color var(--duration-fast) var(--ease-out-expo);
}

.run-mode[data-active="true"] {
  border-color: var(--accent-primary-border);
  background: var(--accent-primary-subtle);
}

.run-mode__tag {
  font-size: var(--text-xs);
  color: var(--accent-primary);
}

.run-mode__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-synthesis: none;
  font-size: clamp(1.35rem, 1.6vw, 1.55rem);
  color: var(--text-primary);
}

.run-mode__desc {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--text-secondary);
}

.run-mode__price {
  margin: var(--space-2) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-hairline);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
}

.run-modes__foot {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.run-note {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-4);
}

.run-note::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

.run-note[data-mode="box"]::before {
  background: var(--accent-primary);
}

.run-note[data-mode="warn"]::before {
  background: var(--status-watch);
}

.run-note__text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

/* ============================================================================
   HARDWARE CARDS (plan-style rows) & STEPPERS
   ============================================================================ */
.hw-qty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.hw-enterprise {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.stepper__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition:
    background-color var(--duration-micro) var(--ease-out-expo),
    transform var(--duration-micro) var(--ease-out-expo);
}

.stepper__btn:hover:not([disabled]) {
  background: var(--bg-hover);
}

.stepper__btn:active:not([disabled]) {
  transform: scale(0.95);
}

.stepper__btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.stepper__input {
  width: 52px;
  height: 44px;
  border: 0;
  background: transparent;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ============================================================================
   STICKY RECEIPT ORDER SUMMARY
   ============================================================================ */
.receipt-aside {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-6));
}

.receipt-sheet {
  display: grid;
  gap: var(--space-5);
  padding: clamp(var(--space-5), 3vw, var(--space-6));
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
}

.receipt-sheet__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.receipt-sheet__title {
  margin: 0;
}

.receipt-sheet__state {
  font-size: var(--text-xs);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.receipt-locked-note {
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--text-secondary);
}

/* Farm Attachment inside Receipt */
.receipt-farm {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-hairline);
}

.receipt-farm__single {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.receipt-farm__label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.receipt-farm__name {
  color: var(--text-primary);
  font-weight: 600;
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.field__input,
.field__select {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.field__input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.field__hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Receipt Line Items */
.receipt-lines {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.receipt-line {
  display: grid;
  grid-template-columns: auto minmax(16px, 1fr) auto;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.receipt-line::before {
  content: "";
  grid-column: 2;
  grid-row: 1;
  border-bottom: 1px dotted var(--border-subtle);
  height: 1px;
  align-self: baseline;
  margin-bottom: 4px;
}

.receipt-line--sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.receipt-line__term {
  grid-column: 1;
  grid-row: 1;
  font-weight: 500;
}

.receipt-line--sub .receipt-line__term {
  font-weight: 400;
}

.receipt-line__val {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  text-align: right;
}

/* Receipt Totals */
.receipt-totals {
  display: grid;
  gap: var(--space-3);
}

.receipt-total-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.receipt-total-row--recurring .receipt-total-row__label {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}

.receipt-total-row__figure {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
}

.receipt-total-row__unit {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.receipt-total-row__amount {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 2.6vw, 2.45rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: var(--tracking-display);
  color: var(--accent-primary);
}

.receipt-total-row--due .receipt-total-row__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.receipt-total-note {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.receipt-total-row__due {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

/* Inline Errors */
.inline-msg {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.inline-msg--error {
  border-color: var(--status-alert-border);
  background: var(--status-alert-bg);
}

.inline-msg__text {
  margin: 0;
}

.inline-msg__link {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent-primary);
}

/* Receipt Actions & State-Stable Buttons */
.receipt-actions {
  display: grid;
  gap: var(--space-3);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  min-width: 140px;
  max-width: 100%;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out-expo),
    border-color var(--duration-fast) var(--ease-out-expo),
    color var(--duration-fast) var(--ease-out-expo),
    transform var(--duration-micro) var(--ease-out-expo);
}

.btn:active:not([disabled]) {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

.btn--primary:hover:not([disabled]) {
  background: var(--accent-primary-hover);
  color: var(--text-inverse);
}

.btn--ghost {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn--ghost:hover:not([disabled]) {
  border-color: var(--text-primary);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn--sm {
  min-height: 44px;
  min-width: 104px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.58;
  cursor: not-allowed;
}

.btn__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
  transition: opacity var(--duration-micro) var(--ease-out-expo);
}

.btn__spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-micro) var(--ease-out-expo);
}

.btn[data-loading="true"] .btn__label {
  opacity: 0;
}

.btn[data-loading="true"] .btn__spinner {
  opacity: 1;
  animation: pecorva-spin 0.7s var(--ease-linear) infinite;
}

@keyframes pecorva-spin {
  to {
    transform: rotate(360deg);
  }
}

.receipt-footnote {
  margin: 0;
  font-size: var(--text-xs);
  line-height: var(--leading-body);
  color: var(--text-muted);
}

/* ============================================================================
   FOOTER
   ============================================================================ */
.site-footer {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */
@media (max-width: 980px) {
  .sheet-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .receipt-aside {
    position: static;
  }
}

@media (max-width: 680px) {
  :root {
    --nav-h: 58px;
  }

  .site-nav__brand img {
    height: 20px;
  }

  .site-nav__links {
    gap: var(--space-1);
  }

  .site-nav__link {
    padding: 0 var(--space-2);
    font-size: var(--text-xs);
  }

  .rate-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-5) var(--space-3);
  }

  .rate-row__price-col {
    align-items: flex-start;
    text-align: left;
  }

  .price-live {
    align-items: flex-start;
  }

  .run-modes {
    grid-template-columns: minmax(0, 1fr);
  }

  .gate-strip {
    padding: var(--space-5) var(--space-4);
  }

  .gate-strip__actions {
    width: 100%;
  }

  .gate-strip__actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn:active:not([disabled]),
  .stepper__btn:active:not([disabled]),
  .cam-selector__btn:active,
  .interval-switch__btn:active {
    transform: none;
  }

  .step-bar__fill {
    transition: none;
  }

  .btn[data-loading="true"] .btn__spinner {
    animation-duration: 1.6s;
  }
}
