/* ============================================================
   Components
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--h); padding: 0 var(--s-5);
  border-radius: var(--r-md);
  font-weight: 600; font-size: var(--fs-md); letter-spacing: .01em;
  white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn--sm { --h: 40px; padding: 0 var(--s-3); font-size: var(--fs-sm); }
.btn--icon { padding: 0; width: var(--h); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn--primary:disabled { background: var(--surface-4); color: var(--text-3); }
.btn--secondary { background: var(--text); color: var(--text-inverse); }
.btn--secondary:hover:not(:disabled) { background: #fff; }
.btn--ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn--ghost:hover:not(:disabled) { border-color: var(--line-3); background: rgba(255,255,255,.04); }
.btn--quiet { color: var(--text-2); background: var(--surface-3); }
.btn--quiet:hover:not(:disabled) { color: var(--text); background: var(--surface-4); }
.btn--quiet:disabled { opacity: .35; }
.btn--block { width: 100%; }
.btn .icon { width: 18px; height: 18px; }
.btn--link {
  display: inline-flex; gap: var(--s-1); align-items: center;
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}
.btn--link:hover { color: var(--text); }

/* ---------- Stepper ---------- */
.stepper {
  flex: none;
  padding: var(--s-4) var(--s-5) var(--s-3);
  border-bottom: 1px solid var(--line);
  background: var(--surface-1);
}
.stepper-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.stepper-list > li { min-width: 0; }
.step-btn {
  width: 100%;
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
  padding: 4px 0 2px; text-align: left; color: var(--text-3);
  font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  border-radius: 4px;
}
.step-btn .bar {
  height: 3px; border-radius: 3px; background: var(--surface-4);
  position: relative; overflow: hidden;
}
.step-btn .bar::after {
  content: ""; position: absolute; inset: 0; background: var(--text);
  transform: scaleX(0); transform-origin: left; transition: transform var(--t-slow) var(--ease-out);
}
.step-btn.is-done { color: var(--text-2); }
.step-btn.is-done .bar::after { transform: scaleX(1); background: var(--text-2); }
.step-btn.is-current { color: var(--text); }
.step-btn.is-current .bar::after { transform: scaleX(1); background: var(--accent); }
.step-btn:disabled { color: #5c5c63; cursor: default; }
.step-btn:not(:disabled):hover { color: var(--text); }
.step-btn .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Step header ---------- */
.step-head { margin-bottom: var(--s-5); }
.step-head .eyebrow { display: block; margin-bottom: var(--s-2); }
.step-head .display { margin-bottom: var(--s-2); }
.step-head p { color: var(--text-2); max-width: 46ch; }

.enter > * { animation: rise var(--t-slow) var(--ease-out) both; }
.enter > *:nth-child(2) { animation-delay: 40ms; }
.enter > *:nth-child(3) { animation-delay: 80ms; }
.enter > *:nth-child(4) { animation-delay: 120ms; }
.enter > *:nth-child(n+5) { animation-delay: 160ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Groups ---------- */
.group { margin-top: var(--s-6); }
.group:first-child { margin-top: 0; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.group-title {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: var(--tracking-caps);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-2);
}
.group-title .opt-tag { color: var(--text-3); font-family: var(--font-ui); text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---------- Native-input choice primitives ---------- */
.choice { position: relative; display: block; cursor: pointer; }
.choice > input {
  position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
.choice:has(> input:disabled) { cursor: not-allowed; }

/* Chips (make/model) */
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s-2); }
.chip-grid--wide { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.chip {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
  font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-2);
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.chip small { display: block; font-family: var(--font-ui); text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 500; color: var(--text-3); }
.choice:hover .chip { border-color: var(--line-3); color: var(--text); }
.choice > input:checked + .chip { border-color: var(--accent); background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.choice > input:focus-visible + .chip,
.choice > input:focus-visible + .card,
.choice > input:focus-visible + .seg,
.choice > input:focus-visible + .swatch,
.choice > input:focus-visible + .opt-row { box-shadow: var(--ring); }

/* Segmented with illustrations (cab) */
.seg-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: var(--s-2); }
.seg {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-2) var(--s-3);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
  color: var(--text-2); text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.seg svg { width: 100%; max-width: 112px; height: auto; color: var(--text-3); transition: color var(--t-fast); }
.seg .seg-label { font-family: var(--font-display); text-transform: uppercase; font-weight: 600; letter-spacing: .05em; font-size: 1rem; }
.choice:hover .seg { border-color: var(--line-3); color: var(--text); }
.choice > input:checked + .seg { border-color: var(--accent); background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.choice > input:checked + .seg svg { color: var(--accent); }

/* Cards (setup / sizes / install) */
.card-list { display: grid; gap: var(--s-3); }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2);
  overflow: hidden;
  transition: border-color var(--t-fast), transform var(--t-med) var(--ease), box-shadow var(--t-med), background var(--t-fast);
}
.choice:hover .card { border-color: var(--line-3); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.choice > input:checked + .card { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-2); }
.choice > input:disabled + .card { opacity: .5; transform: none; box-shadow: none; }
.card-media {
  position: relative; aspect-ratio: 16 / 10; background: var(--well); overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; transition: transform var(--t-slow) var(--ease-out); }
.choice:hover .card-media img { transform: scale(1.03); }
.card-media--wide { aspect-ratio: 16 / 8; }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: var(--s-3) var(--s-4) var(--s-4); }
.card-title { font-family: var(--font-display); text-transform: uppercase; font-weight: 700; font-size: 1.25rem; letter-spacing: .03em; line-height: 1.1; }
.card-sub { font-size: var(--fs-sm); color: var(--text-2); }
.card-meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.card-price { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.card-price .from { font-weight: 400; color: var(--text-3); font-size: var(--fs-xs); margin-right: 2px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-2); }
.card--row { flex-direction: row; align-items: stretch; }
.card--row .card-media { width: 42%; aspect-ratio: auto; flex: none; min-height: 132px; }
.card--row .card-body { justify-content: center; padding: var(--s-4); }

.check-badge {
  position: absolute; top: var(--s-3); right: var(--s-3); z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  transform: scale(.4); opacity: 0; transition: transform var(--t-med) var(--ease-out), opacity var(--t-fast);
}
.check-badge .icon { width: 16px; height: 16px; }
.choice > input:checked + .card .check-badge { transform: scale(1); opacity: 1; }

/* Pills / badges */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface-4); color: var(--text-2);
}
.pill--accent { background: var(--accent-soft); color: var(--accent); }
.pill--poa { background: transparent; border: 1px solid var(--line-2); color: var(--text-2); }
.pill--ok { background: rgba(123, 212, 155, .12); color: var(--ok); }
.media-pill { position: absolute; left: var(--s-3); top: var(--s-3); z-index: 2; background: rgba(11,11,12,.82); color: #fff; }

/* Callouts */
.callout {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s-3);
  padding: var(--s-4); border-radius: var(--r-md);
  background: var(--info-soft); border: 1px solid var(--line);
  font-size: var(--fs-sm); color: var(--text-2);
}
.callout .icon { color: var(--text-2); margin-top: 1px; }
.callout strong { color: var(--text); font-weight: 600; display: block; margin-bottom: 2px; font-size: var(--fs-md); }
.callout--accent { background: var(--accent-soft); border-color: rgba(242,163,58,.3); }
.callout--accent .icon { color: var(--accent); }
.callout p + p { margin-top: var(--s-2); }
.callout .btn-row { margin-top: var(--s-3); display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Inclusions */
.incl { border-top: 1px solid var(--line); margin-top: var(--s-2); padding-top: var(--s-2); }
.incl summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); letter-spacing: .02em;
  padding: 4px 0; border-radius: 4px;
}
.incl summary::-webkit-details-marker { display: none; }
.incl summary .icon { width: 14px; height: 14px; transition: transform var(--t-fast); }
.incl[open] summary .icon { transform: rotate(180deg); }
.incl summary:hover { color: var(--text); }
.check-list { display: grid; gap: 6px; margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--text-2); }
.check-list li { display: grid; grid-template-columns: 16px 1fr; gap: var(--s-2); align-items: start; }
.check-list li::before {
  content: ""; width: 14px; height: 14px; margin-top: 3px;
  background: var(--ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.included-box {
  padding: var(--s-4); border: 1px dashed var(--line-2); border-radius: var(--r-md);
}
.included-box h4 { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 2px; }

/* Quantity stepper */
.qty {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 2px;
  background: var(--surface-1);
}
.qty button {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text);
}
.qty button:hover:not(:disabled) { background: var(--surface-4); }
.qty button:disabled { color: var(--text-3); opacity: .5; }
.qty button .icon { width: 16px; height: 16px; }
.qty output { min-width: 24px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Tabs (zones) */
.tabs {
  display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--s-5) * -1); padding: 2px var(--s-5) var(--s-2);
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--s-5);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: var(--s-2);
  height: 40px; padding: 0 var(--s-4); border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 600; scroll-snap-align: start;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.tab:hover { color: var(--text); border-color: var(--line-3); }
.tab[aria-selected="true"] { background: var(--text); color: var(--text-inverse); border-color: var(--text); }
.tab .count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  display: inline-grid; place-items: center; font-size: 11px; font-variant-numeric: tabular-nums;
  background: var(--accent); color: var(--accent-ink);
}
@media (max-width: 900px) { .tabs { margin: 0 calc(var(--s-4) * -1); padding: 2px var(--s-4) var(--s-2); } }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-3); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.field .req { color: var(--accent); }
.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font-size: 16px; /* prevents iOS zoom */
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--line-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface-3); }
textarea.input { min-height: 104px; resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { font-size: var(--fs-xs); color: var(--danger); min-height: 0; }
.field-error:empty { display: none; }
.field-help { font-size: var(--fs-xs); color: var(--text-3); }

.checkbox-row {
  display: grid; grid-template-columns: 22px 1fr; gap: var(--s-3); align-items: start; cursor: pointer;
  font-size: var(--fs-sm); color: var(--text-2);
}
.checkbox-row input {
  appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 6px;
  border: 1.5px solid var(--line-3); background: var(--surface-2); display: grid; place-items: center; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.checkbox-row input::after {
  content: ""; width: 12px; height: 12px; background: var(--accent-ink); transform: scale(0); transition: transform var(--t-fast) var(--ease-out);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round' d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round' d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.checkbox-row input:checked { background: var(--accent); border-color: var(--accent); }
.checkbox-row input:checked::after { transform: scale(1); }
.checkbox-row input:focus-visible { box-shadow: var(--ring); outline: none; }
.checkbox-row input[aria-invalid="true"] { border-color: var(--danger); }

/* ---------- Footer total ---------- */
.total {
  display: grid; text-align: left; gap: 0; min-width: 0;
  padding: 4px 8px; margin: -4px -8px; border-radius: var(--r-sm);
}
.total:hover { background: rgba(255,255,255,.03); }
.total-label { white-space: nowrap; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }
.total-label .muted { color: var(--text-3); font-weight: 500; text-transform: none; letter-spacing: 0; }
.total-value {
  font-family: var(--font-display); font-weight: 700; font-size: 1.875rem; line-height: 1.05; letter-spacing: .01em;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.total-value.is-text { font-size: 1.375rem; text-transform: uppercase; padding: 3px 0; }
.total-note { font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.total-note:empty { display: none; }
.total-note { color: var(--text-3); }
.total-note .poa-note { color: var(--accent); font-weight: 500; }
.total-note .link-note { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
#back-btn:disabled { visibility: hidden; }

#cta-btn { min-width: 152px; }
@media (max-width: 900px) {
  #cta-btn { min-width: 0; padding: 0 var(--s-4); }
  #back-btn { --h: 44px; }
  .total-note { font-size: 11px; white-space: normal; line-height: 1.35; }
}
@media (max-width: 380px) { #cta-btn { min-width: 0; padding: 0 var(--s-4); } .total-value { font-size: 1.625rem; } }

/* ---------- Stage UI ---------- */
.view-chips {
  display: flex; gap: 4px; padding: 4px;
  border-radius: var(--r-pill); background: rgba(17,17,19,.72); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.view-chips::-webkit-scrollbar { display: none; }
.view-chips:empty { display: none; }
.view-chip {
  flex: none; height: 32px; padding: 0 14px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.view-chip:hover { color: var(--text); background: rgba(255,255,255,.06); }
.view-chip[aria-pressed="true"] { background: var(--text); color: var(--text-inverse); }
@media (max-width: 900px) {
  .view-chips { border-radius: 0; background: transparent; border: 0; backdrop-filter: none; padding: 0 var(--s-3); gap: 6px; }
  .view-chip { background: rgba(17,17,19,.78); border: 1px solid var(--line); backdrop-filter: blur(10px); }
}

.tool-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 10px;
  justify-content: center;
  border-radius: var(--r-pill); background: rgba(17,17,19,.78); border: 1px solid var(--line);
  color: var(--text-2); font-size: var(--fs-xs); font-weight: 600;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.tool-btn:hover { color: var(--text); border-color: var(--line-3); }
.tool-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); }
.tool-btn .icon { width: 18px; height: 18px; }
@media (max-width: 900px) { .tool-label { display: none; } }

.stage-notice {
  display: flex; align-items: center; gap: var(--s-2); max-width: 420px;
  padding: 8px 8px 8px 12px; border-radius: var(--r-md);
  background: rgba(17,17,19,.86); border: 1px solid var(--line); color: var(--text-2);
  font-size: var(--fs-xs); backdrop-filter: blur(14px);
}
.stage-notice button { color: var(--text-3); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; flex: none; }
.stage-notice button:hover { color: var(--text); }

.hint-chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 8px 8px 8px 14px; border-radius: var(--r-pill);
  background: rgba(17,17,19,.86); border: 1px solid var(--accent-line); color: var(--text);
  font-size: var(--fs-sm); font-weight: 500; box-shadow: var(--shadow-2);
  backdrop-filter: blur(14px);
  animation: rise var(--t-slow) var(--ease-out) both;
}
.hint-chip .pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(242,163,58,.6); animation: pulse 1.8s infinite; flex: none; }
.hint-chip button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--text-2); }
.hint-chip button:hover { color: var(--text); background: rgba(255,255,255,.06); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(242,163,58,.55); } 70% { box-shadow: 0 0 0 10px rgba(242,163,58,0); } 100% { box-shadow: 0 0 0 0 rgba(242,163,58,0); } }

/* Loader */
.stage-loader {
  position: absolute; inset: 0; z-index: 8;
  display: grid; place-content: center; justify-items: center; gap: var(--s-4);
  background: radial-gradient(70% 60% at 50% 45%, #18181b 0%, #0b0b0c 100%);
  transition: opacity var(--t-slow) var(--ease), visibility var(--t-slow);
}
.stage-loader img { width: 96px; height: auto; opacity: .92; animation: breathe 2.4s var(--ease) infinite; }
.stage-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-bar { width: 180px; height: 2px; border-radius: 2px; background: var(--surface-4); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 240ms var(--ease); }
.loader-text { font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes breathe { 50% { opacity: .55; } }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  top: calc(var(--header-h) + var(--s-4));
  display: grid; gap: var(--s-2); width: min(440px, calc(100vw - 32px)); pointer-events: none;
}
@media (min-width: 901px) {
  .toasts { top: auto; bottom: 84px; left: calc((100vw - var(--panel-w)) / 2); display: flex; flex-direction: column-reverse; }
}
.toast {
  pointer-events: auto;
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  border-radius: var(--r-md); background: var(--surface-3); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-3); font-size: var(--fs-sm); color: var(--text);
  animation: toast-in var(--t-med) var(--ease-out) both;
}
.toast.is-leaving { animation: toast-out var(--t-med) var(--ease) both; }
.toast .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.toast--ok .icon { color: var(--ok); }
.toast p { color: var(--text-2); margin-top: 2px; }
.toast strong { font-weight: 600; }
.toast-close { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--text-3); }
.toast-close:hover { color: var(--text); background: rgba(255,255,255,.06); }
.toast-actions { grid-column: 2 / -1; display: flex; gap: var(--s-2); margin-top: var(--s-1); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* ---------- Dialog ---------- */
.dialog {
  width: min(520px, calc(100vw - 24px)); max-height: min(80dvh, 760px);
  padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-xl);
  background: var(--surface-2); color: var(--text); box-shadow: var(--shadow-3);
  overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; animation: rise var(--t-med) var(--ease-out); }
.dialog::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
.dialog--sm { width: min(400px, calc(100vw - 24px)); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-4) var(--s-4) var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); }
.dialog-body { padding: var(--s-5); overflow-y: auto; }
.dialog-body > .display-sm + p { margin-top: var(--s-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-5); }
@media (max-width: 600px) {
  .dialog:not(.dialog--sm) { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: var(--r-xl) var(--r-xl) 0 0; }
}

/* ---------- Line items ---------- */
.lines { display: grid; gap: var(--s-5); }
.line-group h4 {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: var(--tracking-caps);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-3); margin-bottom: var(--s-2);
}
.line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-1) var(--s-4);
  padding: var(--s-2) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm);
}
.line:last-child { border-bottom: 0; }
.line-name { color: var(--text); }
.line-sub { grid-column: 1; font-size: var(--fs-xs); color: var(--text-3); margin-top: -2px; }
.line-price { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.line-price.is-poa {
  align-self: start; color: var(--text-2); font-weight: 600; font-size: 11px; letter-spacing: .02em;
  padding: 2px 8px; border: 1px dashed var(--line-3); border-radius: var(--r-pill);
}
.line-price.is-free { color: var(--text-3); font-weight: 500; }
.lines-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4);
  padding-top: var(--s-4); border-top: 1px solid var(--line-2);
}
.lines-total .lbl { font-weight: 600; }
.lines-total .val { font-family: var(--font-display); font-weight: 700; font-size: 2rem; font-variant-numeric: tabular-nums; }
.lines-empty { color: var(--text-3); font-size: var(--fs-sm); }

/* Flash highlight */
@keyframes flash {
  0% { box-shadow: 0 0 0 0 rgba(242,163,58,0); border-color: var(--line); }
  20% { box-shadow: 0 0 0 4px rgba(242,163,58,.35); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 0 rgba(242,163,58,0); }
}
.is-flash { animation: flash 1.4s var(--ease) 1; }
