/* ==========================================================================
   TAT YO GRANDMA — SHARED COMPONENT LIBRARY
   Phase 4. Implements Phase 3 §4–§9 component rules exactly.
   --------------------------------------------------------------------------
   NAMING: BEM-ish. Blocks are the component root (.btn, .card, .lb …).
   Elements use __ (e.g. .card__body). Modifiers use -- (e.g. .card--dark).
   Variants use a single hyphen (e.g. .btn-outline, .card-b).
   Theme context (dark base vs paper inversion) is set by a section-level
   .on-paper class or by the component's own modifier — components do not
   guess the surface they sit on.
   --------------------------------------------------------------------------
   SURFACE RULES:
   - --muted is DARK-SURFACES ONLY. On light surfaces use --ink-60/--ink-40.
   - --accent never carries small white text — fills use --accent-deep.
   ========================================================================== */

/* ---------------------------------------------------------------- helpers */
.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section-head { margin-bottom: 34px; }
@media (max-width: 899px) { .section-head { margin-bottom: 28px; } }

.eyebrow {
  display: block;
  margin: 0 0 14px;
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--accent);
}
.on-paper .eyebrow,
.eyebrow--on-paper { color: var(--accent-deep); }

.h-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: var(--lh-h2);
  margin: 0 0 16px;
}

/* Dark/paper surface helpers */
.on-paper {
  background: var(--paper);
  color: var(--ink);
}
.on-paper .h-display { color: var(--ink); }

/* ==========================================================================
   BUTTONS — §5. Three kinds, five states each. Labels: uppercase, 700.
   ========================================================================== */
.btn {
  --btn-bg: var(--accent-deep);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: 0;
  border-radius: 18px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-btn);
  font-weight: 700;
  line-height: var(--lh-btn);
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--d-micro) var(--ease),
              transform var(--d-micro) var(--ease),
              box-shadow var(--d-micro) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 899px) { .btn { min-height: 52px; } }

/* -- 5.1 Primary — the money action -------------------------------------- */
.btn-primary {
  background: var(--accent-deep);
  color: #fff;
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(242, 106, 36, .45);
}
.btn-primary:active {
  background: var(--accent-active);
  transform: translateY(0) scale(.98);
}

/* -- 5.2 Secondary variants ------------------------------------------------ */
/* On light: outline */
.btn-outline {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn-outline:hover { box-shadow: inset 0 0 0 2px var(--ink); transform: translateY(-2px); }
.btn-outline:active { transform: translateY(0) scale(.98); }
/* On dark: subtle fill */
.btn-light {
  background: rgba(255, 255, 255, .10);
  color: #fff;
  box-shadow: inset 0 0 0 2px var(--line-light);
}
.btn-light:hover { box-shadow: inset 0 0 0 2px #fff; transform: translateY(-2px); }
.btn-light:active { transform: translateY(0) scale(.98); }
/* Ink fill for light sections where outline feels weak */
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); transform: translateY(-2px); }
.btn-dark:active { transform: translateY(0) scale(.98); }
/* White fill — reserved for colored surfaces */
.btn-white { background: var(--white); color: var(--ink); }
.btn-white:hover { transform: translateY(-2px); }
.btn-white:active { transform: translateY(0) scale(.98); }

/* -- Disabled (all kinds) --------------------------------------------------- */
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  background: var(--accent-disabled-bg);
  color: var(--accent-disabled-fg-dark);
}
.on-paper .btn-primary:disabled,
.on-paper .btn-primary[aria-disabled="true"] { color: var(--accent-disabled-fg-light); }
.btn-outline:disabled, .btn-light:disabled,
.btn-dark:disabled, .btn-white:disabled,
.btn-outline[aria-disabled="true"], .btn-light[aria-disabled="true"],
.btn-dark[aria-disabled="true"], .btn-white[aria-disabled="true"] {
  opacity: .45;
}

/* -- Sizes / layouts -------------------------------------------------------- */
.btn-block { display: flex; width: 100%; }
.btn-row {
  display: grid;
  gap: 10px;
}
@media (min-width: 600px) { .btn-row { grid-auto-flow: column; gap: 12px; justify-content: start; } }

/* -- 5.3 Text button ---------------------------------------------------------- */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-weight: 700;
  font-size: inherit;
  border-bottom: 2px solid var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.text-link .text-link__arrow { transition: transform var(--d-micro) var(--ease); }
.text-link:hover .text-link__arrow { transform: translateX(5px); }
.text-link--padded { padding: 12px 4px; } /* standalone target: 44px+ hit area */

/* Icon-only buttons: 48px preferred */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-light);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background-color var(--d-micro) var(--ease),
              transform var(--d-micro) var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled {
  opacity: .25;
  cursor: not-allowed;
  transform: none;
  background: rgba(255, 255, 255, .04);
}

/* ==========================================================================
   CARDS — §4. Three types. Radius 16–28px. Borders over shadows.
   ========================================================================== */
.card {
  border-radius: var(--r-md);
  overflow: hidden;
}
.card-grid {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 899px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .card-grid { grid-template-columns: 1fr; } }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 899px) { .card-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .card-grid--3 { grid-template-columns: 1fr; } }

/* -- Type A: content card ---------------------------------------------------- */
.card-a {
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line-light);
  color: var(--white);
  padding: clamp(24px, 4vw, 40px);
}
@media (max-width: 899px) { .card-a { padding: 24px 20px; } }
.on-paper .card-a {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}
.card-a h3, .card__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  letter-spacing: .01em;
  margin: 0 0 12px;
}
.card-a p, .card__text {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, .78);
}
.on-paper .card-a p, .on-paper .card__text { color: var(--ink-60); }
.card-a p:last-child, .card__text:last-child { margin-bottom: 0; }

/* -- Type B: visual card — image flush-bleed, ink scrim for labels ---------- */
.card-b { position: relative; background: var(--ink-2); border: 1px solid var(--line-light); }
.card-b img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}
.card-b--square img { aspect-ratio: 1 / 1; }
.card-b--wide img { aspect-ratio: 16 / 10; }
.card-b__scrim {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 16px 16px;
  background: linear-gradient(to top, rgba(5, 5, 6, .88), transparent);
  color: #fff;
}
.card-b__label {
  font-weight: 700;
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0;
}

/* -- Type C: action card — type A surface + full-card affordance -------------- */
.card-c {
  display: block;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line-light);
  color: var(--white);
  padding: clamp(24px, 4vw, 32px);
  text-decoration: none;
  transition: transform var(--d-card) var(--ease),
              box-shadow var(--d-card) var(--ease),
              border-color var(--d-card) var(--ease);
}
.on-paper .card-c {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  .card-c:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
  }
}
.card-c .card__cta {
  margin-top: var(--s2);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}
@media (max-width: 899px) { .card-c .card__cta { min-height: 52px; } }

/* -- Chips / tags (pills — white text sits on --accent-deep) ------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--accent-deep);
  color: #fff;
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.chip--ghost {
  background: transparent;
  border: 1px solid var(--line-light);
  color: var(--white);
}
.on-paper .chip--ghost { border-color: var(--line); color: var(--ink); }

/* ==========================================================================
   STICKY BOOK BAR — §8.7. Verbatim copy: "Ready to book? 📲".
   Sits above the desktop nav on ALL public routes. Not on /stats.
   ========================================================================== */
.bookbar {
  position: sticky;
  top: 0;
  z-index: var(--z-bookbar);
  min-height: var(--bookbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--white);
  border-bottom: 1px solid var(--line-light);
  font-weight: 600;
  font-size: var(--fs-small);
}
.bookbar .btn {
  min-height: 40px;
  padding: 8px 18px;
  font-size: .875rem;
}
.bookbar__copy { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   DESKTOP STICKY NAV — §6.1. Order top→bottom: bookbar → nav.
   Transparent over hero (white text) → solid paper after ~55% hero scroll.
   ========================================================================== */
.nav-desktop {
  position: sticky;
  top: 0; /* sits under .bookbar because the bar is sticky too */
  z-index: var(--z-nav);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--pad-x);
  background: transparent;
  color: #fff;
  transition: background-color var(--d-card) var(--ease),
              color var(--d-card) var(--ease),
              box-shadow var(--d-card) var(--ease);
}
@media (min-width: 900px) { .nav-desktop { display: flex; } }
.nav-desktop--solid {
  background: rgba(244, 241, 234, .92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-height: 48px;
}
.nav-brand img {
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  object-fit: cover;
}
.nav-brand__word {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: .03em;
  line-height: 1;
  display: block;
}
.nav-brand__sub {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  opacity: .75;
  margin-top: 2px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  position: relative;
}
.nav-links a[aria-current="page"] { color: var(--accent); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.nav-desktop--solid .nav-links a[aria-current="page"] { color: var(--accent-deep); }
.nav-desktop--solid .nav-links a[aria-current="page"]::after { background: var(--accent-deep); }
.nav-links .btn { min-height: 44px; padding: 10px 20px; }

/* ==========================================================================
   MOBILE BOTTOM NAV — §6.2 (<900px). 5 tabs; BOOK is an --accent-deep pill.
   64px bar + env(safe-area-inset-bottom). Active state = --accent.
   ========================================================================== */
.nav-mobile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-nav);
  background: var(--ink-2);
  border-top: 1px solid var(--line-light);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: transform var(--d-card) var(--ease);
}
@media (min-width: 900px) { .nav-mobile { display: none; } }
.nav-mobile--hidden { transform: translateY(110%); } /* lightbox/modal/sheet open */
.nav-mobile__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 560px;
  margin-inline: auto;
}
.nav-mobile__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 8px 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav-mobile__tab svg, .nav-mobile__tab .tab-ico {
  width: 24px;
  height: 24px;
  display: block;
  font-size: 24px;
  line-height: 1;
}
.nav-mobile__tab[aria-current="page"] { color: var(--accent); }
.nav-mobile__tab--book {
  color: #fff;
}
.nav-mobile__tab--book .nav-mobile__pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: 52px;
  margin: 6px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-deep);
  color: #fff;
  box-shadow: var(--shadow-cta);
}

/* ==========================================================================
   TOOL-MODE BOTTOM CHROME — §6.3. Replaces mobile nav on /estimate, /build.
   [← Back (text)] [progress context] [CONTINUE → (primary, disabled until valid)]
   ========================================================================== */
.tool-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-nav);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(244, 241, 234, .94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.tool-footer--on { display: flex; }
.tool-footer .btn { min-height: 52px; }
.tool-footer__progress {
  flex: 1;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--accent-deep);
}

/* ==========================================================================
   ACCORDION — §8.2 (FAQ). One open at a time. Trigger = <button>.
   ========================================================================== */
.acc { border-radius: var(--r-md); overflow: hidden; }
.acc__item {
  border: 1px solid var(--line-light);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .045);
  margin-bottom: 12px;
}
.on-paper .acc__item { border-color: var(--line); background: var(--white); }
.acc__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  padding: 16px 20px;
  border: 0;
  background: none;
  color: inherit;
  font-weight: 700;
  font-size: var(--fs-body);
  text-align: left;
  cursor: pointer;
}
.acc__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .08);
  font-size: 1.25rem;
  line-height: 1;
  transition: transform var(--d-card) var(--ease),
              background-color var(--d-card) var(--ease),
              color var(--d-card) var(--ease);
}
.on-paper .acc__icon { background: rgba(11, 11, 12, .06); }
.acc__item--open .acc__icon {
  transform: rotate(45deg);
  background: var(--accent-deep);
  color: #fff;
}
.acc__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--d-card) var(--ease);
}
.acc__panel-inner { padding: 0 20px 20px; }
.acc__panel-inner p { margin: 0 0 12px; }
.acc__item--open { box-shadow: var(--shadow-sm); }

/* ==========================================================================
   LIGHTBOX / VIEWER — §8.1. Near-black backdrop. NO WRAP at either end.
   ========================================================================== */
.lb {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: none;
  flex-direction: column;
  background: rgba(5, 5, 6, .96);
  color: #fff;
  opacity: 0;
  transition: opacity var(--d-page) var(--ease);
}
.lb--open { display: flex; opacity: 1; }
.lb__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  min-height: 64px;
}
.lb__counter {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .85);
}
.lb__stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-y;
  min-height: 0;
}
.lb__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform var(--d-card) var(--ease);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
}
.lb__img--zoomed { transform: scale(1.8); cursor: zoom-out; }
.lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.lb__nav--prev { left: 12px; }
.lb__nav--next { right: 12px; }
/* no-wrap disabled states: dimmed, aria-disabled, no-op on activation */
.lb__nav[aria-disabled="true"] {
  opacity: .25;
  cursor: not-allowed;
}
.lb__nav[aria-disabled="true"]:hover { background: rgba(255, 255, 255, .06); transform: translateY(-50%); }
.lb__meta {
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.lb__tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lb__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.lb__actions .btn { min-height: 52px; }

/* ==========================================================================
   SHEETS & MODALS — §8.3. Esc closes topmost; scrim click closes modals only.
   ========================================================================== */
.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background: rgba(5, 5, 6, .6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--d-page) var(--ease);
  display: none;
}
.scrim--on { display: block; opacity: 1; }

/* Sheet: full-viewport estimator/builder shell */
.sheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  display: none;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
}
.sheet--open { display: flex; }
.sheet__header {
  background: var(--ink);
  color: #fff;
  padding: 16px var(--pad-x) 12px;
}
.sheet__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sheet__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  letter-spacing: .01em;
  margin: 0;
}
.sheet__progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.sheet__progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width var(--d-card) var(--ease);
}
.sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px var(--pad-x);
  max-width: 720px;
  width: 100%;
  margin-inline: auto;
}
.sheet__footer { /* tool chrome handled by .tool-footer on mobile */ }

/* Modal: bottom sheet on mobile, centered card ≤560px on desktop */
.modal {
  position: fixed;
  z-index: var(--z-modal);
  display: none;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--ink-2);
  color: #fff;
  border: 1px solid var(--line-light);
  border-radius: 26px 26px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(24px);
  opacity: 0;
  transition: transform var(--d-page) var(--ease), opacity var(--d-page) var(--ease);
}
.modal--open { display: block; transform: none; opacity: 1; }
@media (min-width: 600px) {
  .modal {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(560px, calc(100vw - 40px));
    border-radius: 26px;
    transform: translate(-50%, calc(-50% + 16px));
  }
  .modal--open { transform: translate(-50%, -50%); }
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.modal__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  letter-spacing: .01em;
  margin: 0;
}

/* ==========================================================================
   STEPPER — §8.4 (estimator, builder). Option cards, step eyebrow, progress.
   ========================================================================== */
.stepper { max-width: 720px; margin-inline: auto; }
.step__eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--accent-deep);
  margin: 0 0 12px;
}
.step__q {
  font-weight: 700;
  font-size: clamp(1.5rem, 5.5vw, 2rem);
  line-height: 1.15;
  margin: 0 0 24px;
}
.step__opts { display: grid; gap: 12px; }
.opt {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color var(--d-card) var(--ease),
              box-shadow var(--d-card) var(--ease),
              transform var(--d-card) var(--ease);
}
.opt:hover { border-color: var(--ink-40); }
.opt__icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.opt__label { font-weight: 700; display: block; }
.opt__hint { font-size: var(--fs-small); color: var(--ink-60); display: block; margin-top: 2px; }
.opt--selected {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transform: scale(1.01);
}
.step__progress {
  height: 6px;
  border-radius: 3px;
  background: rgba(11, 11, 12, .10);
  overflow: hidden;
  margin-bottom: 24px;
}
.step__progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width var(--d-card) var(--ease);
}

/* ==========================================================================
   FORM CONTROLS — §8.5. Labels always visible; 52px min-height.
   ========================================================================== */
.field { margin-bottom: 20px; }
.field__label {
  display: block;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 8px;
}
.field__label .req { color: var(--accent-deep); font-weight: 700; }
.field__hint { font-size: var(--fs-small); color: var(--ink-60); margin: 6px 0 0; }
.field__error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--fs-small);
  color: var(--danger);
  font-weight: 600;
  margin: 8px 0 0;
}
.input, .select, .textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  transition: border-color var(--d-micro) var(--ease),
              box-shadow var(--d-micro) var(--ease);
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border: 2px solid var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.on-dark .input, .on-dark .select, .on-dark .textarea {
  background: var(--ink-3);
  border-color: var(--line-light);
  color: #fff;
}
.on-dark .input:focus, .on-dark .select:focus, .on-dark .textarea:focus {
  border-color: var(--accent);
}
.on-dark .field__label { color: #fff; }
.on-dark .field__hint { color: var(--muted); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border: 2px solid var(--danger);
}

/* File chip: dashed well, hidden-but-focusable input */
.file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
}
.file-chip input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
}
.file-chip:focus-within {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.file-chip__name { color: var(--ink-60); font-weight: 400; font-size: var(--fs-small); }

/* Checkbox: 44px+ row target */
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 600;
}
.check input {
  width: 24px;
  height: 24px;
  flex: none;
  margin-top: 2px;
  accent-color: var(--accent-deep);
}

/* ==========================================================================
   BEFORE/AFTER COMPARE SLIDER — §8.6. Honest "coming soon" empty state.
   ========================================================================== */
.compare {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line-light);
  background: var(--ink-3);
  aspect-ratio: 3 / 4;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.compare__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.compare__before-wrap {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
}
.compare__before-wrap .compare__img { width: 100%; height: 100%; }
.compare__rail {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background: var(--accent);
  pointer-events: none;
}
.compare__grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}
.compare__tag {
  position: absolute;
  top: 12px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(5, 5, 6, .72);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  pointer-events: none;
}
.compare__tag--before { left: 12px; }
.compare__tag--after { right: 12px; }
/* Honest placeholder: striped, no mismatched photos, ever */
.compare--soon {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(
    -45deg,
    var(--ink-3) 0 16px,
    var(--ink-2) 16px 32px
  );
}
.compare--soon .compare__soon-copy {
  text-align: center;
  padding: 24px;
  color: #fff;
}
.compare--soon .compare__soon-copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.compare--soon .compare__soon-copy span {
  color: var(--muted);
  font-size: var(--fs-small);
}

/* ==========================================================================
   FOOTER — §8.8. Five columns: brand · TATTOO · RESOURCES · ARCADE · FOLLOW.
   ========================================================================== */
.footer {
  background: var(--ink);
  color: #fff;
  border-top: 1px solid var(--line-light);
  padding: var(--s8) 0 calc(28px + env(safe-area-inset-bottom, 0px));
  margin-bottom: 64px; /* clearance for mobile bottom nav */
}
@media (min-width: 900px) { .footer { margin-bottom: 0; } }
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: var(--s4);
}
@media (max-width: 899px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 599px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__col h4 {
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--accent);
  margin: 0 0 16px;
}
.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col li { margin: 0; }
.footer__col a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  transition: color var(--d-micro) var(--ease);
}
.footer__col a:hover { color: #fff; }
.footer__brand p { color: rgba(255, 255, 255, .6); font-size: var(--fs-small); }
.footer__socials { display: flex; gap: 10px; margin-top: 16px; }
.footer__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
  transition: background-color var(--d-micro) var(--ease),
              transform var(--d-micro) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .footer__social:hover { background: var(--accent-deep); transform: translateY(-2px); }
}
.footer__bottom {
  margin-top: var(--s6);
  padding-top: 24px;
  border-top: 1px solid var(--line-light);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  color: rgba(255, 255, 255, .45);
  font-size: var(--fs-small);
}

/* ==========================================================================
   STATE CARDS — error / empty / offline. Honest placeholders only.
   ========================================================================== */
.state-card {
  text-align: center;
  padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 40px);
  border-radius: var(--r-md);
  border: 1px dashed var(--line-light);
  background: rgba(255, 255, 255, .03);
  color: #fff;
}
.on-paper .state-card {
  border-color: var(--line);
  background: rgba(11, 11, 12, .03);
  color: var(--ink);
}
.state-card__icon { font-size: 2.5rem; margin-bottom: 12px; }
.state-card h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  letter-spacing: .02em;
  margin: 0 0 8px;
}
.state-card p {
  margin: 0 auto var(--s2);
  max-width: 46ch;
  color: rgba(255, 255, 255, .72);
}
.on-paper .state-card p { color: var(--ink-60); }

/* Red-flag aftercare card pattern: --danger-bg, danger rail, ink body */
.state-card--danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-left: 4px solid var(--danger);
  color: var(--ink);
  text-align: left;
}
.state-card--danger h3 { color: var(--danger); }

/* ==========================================================================
   TOAST — aria-live announcements, --d-micro in/out.
   ========================================================================== */
.toast-stack {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
@media (min-width: 600px) {
  .toast-stack { left: auto; right: 24px; bottom: 24px; align-items: flex-end; }
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(480px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--ink-2);
  color: #fff;
  border: 1px solid var(--line-light);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: var(--fs-small);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--d-micro) var(--ease), transform var(--d-micro) var(--ease);
}
.toast--in { opacity: 1; transform: none; }

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

/* Scroll-reveal: IntersectionObserver adds .in once. Reserve space — no
   layout-shifting entrances. Instant under prefers-reduced-motion. */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--d-card) var(--ease), transform var(--d-card) var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
