/* Shatably — v1 classic: iOS 26 / iPadOS 26 Liquid Glass */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, sans-serif;
  --bg: #f6f2ea;
  --label: #1a140c;
  --label2: rgba(66, 52, 34, 0.7);
  --label3: rgba(66, 52, 34, 0.34);
  --sep: rgba(90, 66, 34, 0.16);
  --fill: rgba(140, 110, 70, 0.13);
  --fill2: rgba(140, 110, 70, 0.2);
  --group: rgba(255, 252, 246, 0.66);
  --glass: rgba(255, 251, 243, 0.5);
  --glass-strong: rgba(252, 248, 240, 0.8);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-rim: rgba(90, 60, 20, 0.07);
  --shadow: 0 10px 40px rgba(80, 55, 20, 0.12), 0 2px 6px rgba(80, 55, 20, 0.06);
  --shadow-soft: rgba(80, 55, 20, 0.07);
  --thumb: #fff;
  --tint: #8a5a14;
  --tint-soft: rgba(176, 122, 40, 0.15);
  --accent: #d6a15f;
  --accent-hi: #f3d6a0;
  --on-accent: #1c1408;
  --green: #34c759;
  --red: #ff3b30;
  --wa: #25d366;
  --icon-cut: #fff;
  --blob1: #f6d398;
  --blob2: #ffc7a3;
  --blob3: #e8d3b0;
  --blob4: #fbe7c2;
  --r-group: 26px;
  --r-card: 30px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --nav-h: 52px;
  --wide-w: 1040px; /* Home hero column; the desktop top bar matches it */
  --bar-h: 96px;
  --bar-top: 8px;
  --bar-l: calc(10px + var(--safe-l));
  --bar-r: calc(10px + var(--safe-r));
  --flip: 1;
  --tab-h: 64px;
  --side-w: 0px;
  --gutter: 16px;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1f160c;
  --label: #fbf6ee;
  --label2: rgba(240, 228, 210, 0.64);
  --label3: rgba(240, 228, 210, 0.3);
  --sep: rgba(110, 92, 70, 0.5);
  --fill: rgba(140, 118, 90, 0.24);
  --fill2: rgba(140, 118, 90, 0.34);
  --group: rgba(32, 27, 21, 0.66);
  --glass: rgba(44, 37, 29, 0.48);
  --glass-strong: rgba(30, 26, 20, 0.82);
  --glass-edge: rgba(255, 236, 200, 0.16);
  --glass-rim: rgba(255, 236, 200, 0.06);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-soft: rgba(0, 0, 0, 0.25);
  --thumb: #6b6153;
  --tint: #e6b96a;
  --tint-soft: rgba(230, 185, 106, 0.2);
  --accent: #c8913f;
  --accent-hi: #ecc887;
  --on-accent: #1a1206;
  --green: #30d158;
  --red: #ff453a;
  --icon-cut: #201b15;
  --blob1: #5a3a12;
  --blob2: #4a2414;
  --blob3: #3d2f17;
  --blob4: #5c4419;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}
html.sheet-open {
  overflow: hidden;
}
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--label);
  background: transparent; /* html carries --bg so the fixed blobs (z-index -1) show through */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--tint);
  text-decoration: none;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tint) 70%, transparent);
  outline-offset: 2px;
  border-radius: 12px;
}
.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
}
.skip:focus-visible {
  top: calc(var(--safe-t) + 8px);
}

/* ---------- Background blobs ---------- */
/* iOS Safari doesn't paint fixed layers behind its floating bottom toolbar, so
   the blobs fade into --bg well above it (svh = viewport with toolbars shown).
   The bottom of the screen is then plain --bg on both sides: no seam. */
.blobs {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55svh, transparent 88svh);
  mask-image: linear-gradient(to bottom, #000 55svh, transparent 88svh);
}
.blobs i {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 1;
}
.blobs .b1 { background: var(--blob1); top: -22vmax; left: -18vmax; }
.blobs .b2 { background: var(--blob2); top: 10vmax; right: -26vmax; }
.blobs .b3 { background: var(--blob3); top: 34svh; left: -24vmax; }
.blobs .b4 { background: var(--blob4); top: 42svh; right: -14vmax; width: 44vmax; height: 44vmax; }
@media (prefers-reduced-motion: no-preference) {
  .blobs .b1 { animation: drift 28s ease-in-out infinite alternate; }
  .blobs .b2 { animation: drift 34s ease-in-out infinite alternate-reverse; }
  .blobs .b3 { animation: drift 40s ease-in-out infinite alternate; }
}
@keyframes drift {
  to { transform: translate(6vmax, 4vmax) scale(1.08); }
}

/* ---------- Glass ---------- */
.glass,
.glass-strong,
.glass-card {
  position: relative;
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-rim), var(--shadow);
}
.glass { background: var(--glass); }
.glass-strong { background: var(--glass-strong); }
.glass-card {
  background: var(--group);
  border-radius: var(--r-card);
}
/* specular sheen */
.glass::before,
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.14));
  mix-blend-mode: soft-light;
}
:root[data-theme="dark"] .glass::before,
:root[data-theme="dark"] .glass-card::before {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 40%);
  mix-blend-mode: normal;
}

/* ---------- Top bar (tall at the top, morphs to compact on scroll) ---------- */
/* --morph: 0 = tall, 1 = compact. A scroll timeline drives it where supported, else app.js. */
@property --morph {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
@keyframes morph {
  from { --morph: 0; }
  to { --morph: 1; }
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .navbar {
      animation-name: morph;
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: scroll(root);
      animation-range: 0 120px;
    }
  }
}
.navbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: var(--side-w);
  right: 0;
  height: calc(var(--safe-t) + var(--bar-top) + var(--nav-h) + 18px);
  pointer-events: none;
}
.topbar {
  position: absolute;
  top: calc(var(--safe-t) + var(--bar-top));
  left: var(--bar-l);
  right: var(--bar-r);
  height: calc(var(--bar-h) - (var(--bar-h) - var(--nav-h)) * var(--morph, 0));
  border-radius: calc(32px - 6px * var(--morph, 0));
  pointer-events: auto;
  background: radial-gradient(120% 150% at 0% 0%, color-mix(in srgb, var(--accent-hi) 34%, transparent), transparent 60%), var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow), 0 10px 34px color-mix(in srgb, var(--accent) 20%, transparent);
}
/* golden specular rim: a 1px gradient ring, brightest top-left */
.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, var(--accent-hi), color-mix(in srgb, var(--accent) 45%, transparent) 30%, transparent 55%, color-mix(in srgb, var(--accent) 60%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: calc(1 - 0.4 * var(--morph, 0));
}
/* Logo: 150px tall state, scales to 80px and slides 9px toward the start edge */
.top-brand {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 9px;
  width: 150px;
  border-radius: 14px;
  transform-origin: left center;
  transform: translate(calc(var(--flip) * 9px * (1 - var(--morph, 0))), -50%) scale(calc(1 - 0.4667 * var(--morph, 0)));
  view-transition-name: top-brand;
}
.top-brand::after { content: ""; position: absolute; inset: -10px; } /* ≥44px hit area when compact */
.top-brand .badge-logo { width: 100%; }
.nav-title {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: calc(100% - 240px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 600;
  opacity: calc(var(--morph, 0) * 2.5 - 1.5);
  transform: translate(-50%, calc(-50% + 8px * (1 - var(--morph, 0))));
}

/* ---------- Content ---------- */
.content {
  outline: none;
  padding: calc(var(--safe-t) + var(--bar-top) + var(--bar-h) + 14px) calc(var(--gutter) + var(--safe-r)) calc(var(--tab-h) + var(--safe-b) + 40px) calc(var(--gutter) + var(--safe-l));
  margin-left: var(--side-w);
}
.page {
  max-width: 760px;
  margin: 0 auto;
}
.content[data-view="home"] .page,
.content[data-view="studio"] .page:has(.studio-grid.split) { max-width: var(--wide-w); }
.large-title h1 {
  margin: 0 0 14px 4px;
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.lede {
  margin: -4px 4px 22px;
  color: var(--label2);
  font-size: 17px;
  max-width: 62ch;
}
.form-wrap { padding-bottom: 8px; }
.form-wrap.wide { max-width: none; }

/* ---------- Inset grouped list ---------- */
.group-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 26px 18px 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--label2);
  letter-spacing: -0.01em;
}
.group-title span:not(.badge) { font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; }
.group-foot {
  margin: 8px 18px 0;
  font-size: 13px;
  color: var(--label2);
}
.group {
  position: relative;
  background: var(--group);
  border-radius: var(--r-group);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-rim), 0 4px 24px var(--shadow-soft);
  overflow: hidden;
}
.group-pad { padding: 12px; }
.rows { display: contents; }
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  text-align: left;
  color: var(--label);
}
button.row,
label.row { cursor: pointer; }
button.row:active,
a.row:active { background: var(--fill); }
.row + .row::before,
.rows .row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 16px;
  border-top: 0.5px solid var(--sep);
}
.row:has(.tile) + .row::before { left: 58px; }
.row-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.row-label small {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--label2);
}
.row-value {
  color: var(--label2);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}
.row-value.strong { color: var(--label); font-weight: 500; }
.chev { flex: none; color: var(--label3); }
.row .check { flex: none; color: var(--tint); opacity: 0; transform: scale(0.6); transition: opacity 0.15s, transform 0.25s var(--spring); }
.row[aria-checked="true"] .check { opacity: 1; transform: none; }
.tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--tile);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.tile svg { width: 19px; height: 19px; --icon-cut: var(--tile); }
.line .row-label { font-size: 16px; }
.total-row { font-weight: 600; }
.total-row .row-value { font-size: 17px; }

/* ---------- Segmented control ---------- */
.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  min-height: 44px;
  padding: 3px;
  border-radius: 999px;
  background: var(--fill);
  isolation: isolate;
}
.seg-thumb {
  position: absolute;
  z-index: -1;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / var(--n));
  transform: translateX(calc(100% * var(--i)));
  border-radius: 999px;
  background: var(--thumb);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.35s var(--spring);
}
.seg button {
  min-height: 38px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg button[aria-checked="true"] { font-weight: 600; }
.seg-note { margin: 10px 6px 2px; font-size: 13px; color: var(--label2); }
.seg-row { min-height: 44px; padding-bottom: 0; }
.seg-only { padding-top: 4px; }
.seg-only::before { display: none; }
.seg-only .seg { flex: 1; }

/* ---------- Stepper ---------- */
.stepper {
  flex: none;
  display: flex;
  align-items: center;
  height: 36px;
  border-radius: 999px;
  background: var(--fill);
}
.stepper button {
  width: 48px;
  height: 44px;
  margin: -4px 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}
.stepper button:disabled { color: var(--label3); cursor: default; }
.stepper button:not(:disabled):active { opacity: 0.4; }
.stepper-sep { width: 0.5px; height: 18px; background: var(--sep); }
.stepper-row output {
  min-width: 28px;
  text-align: center;
  color: var(--label);
  font-weight: 500;
  font-size: 17px;
}

/* ---------- Area input & slider ---------- */
.area-input {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--label2);
}
.area-input input {
  width: 92px;
  min-height: 36px;
  padding: 4px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--label);
  -moz-appearance: textfield;
  appearance: textfield;
}
.area-input input::-webkit-inner-spin-button,
.area-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.slider-row { padding-top: 0; min-height: 44px; }
.slider-row::before { display: none; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  --p: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--fill2) var(--p));
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--fill2); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 22px;
  margin-top: -8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}
input[type="range"]::-moz-range-thumb {
  width: 30px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.2s var(--spring), opacity 0.2s;
  cursor: pointer;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(0.97); }
.btn-primary {
  color: var(--on-accent);
  background: linear-gradient(160deg, var(--accent-hi), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(90, 55, 10, 0.18), 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn-glass {
  color: var(--tint);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-rim), 0 4px 14px var(--shadow-soft);
}
.btn-plain { color: var(--tint); background: none; font-weight: 500; padding: 0 12px; }
.btn-danger { color: #fff; background: var(--red); }
.btn-block { width: 100%; margin-top: 22px; }
.btn-lg { min-height: 54px; }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
.hint { text-align: center; color: var(--label2); font-size: 13px; margin: 10px 0 0; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -6px -10px -6px 0;
  border-radius: 999px;
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.danger { color: var(--red); }
.icon-btn:active { background: var(--fill); }

/* ---------- Tab bar (phone) ---------- */
.tabbar {
  position: fixed;
  z-index: 30;
  left: calc(14px + var(--safe-l));
  right: calc(14px + var(--safe-r));
  bottom: calc(max(var(--safe-b), 10px) + 4px);
  height: var(--tab-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px;
  border-radius: 999px;
  max-width: 380px;
  margin: 0 auto;
  --active: 0;
}
.tab-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 4);
  border-radius: 999px;
  background: var(--fill);
  transform: translateX(calc(100% * var(--active)));
  transition: transform 0.45s var(--spring);
}
.tabbar.no-active .tab-pill { opacity: 0; }
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 44px;
  border-radius: 999px;
  color: var(--label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.tab .ico svg { width: 25px; height: 25px; display: block; }
.tab.active { color: var(--tint); }
.ico-fill { display: none; }
.active .ico-fill { display: block; }
.active .ico-line { display: none; }
.tab:active { transform: scale(0.94); transition: transform 0.15s; }

/* ---------- Sidebar (iPad / desktop) ---------- */
.sidebar { display: none; }
@media (min-width: 768px) {
  :root { --side-w: calc(280px + var(--safe-l)); --gutter: 32px; --bar-top: 12px; --bar-l: 0px; --bar-r: calc(12px + var(--safe-r)); }
  .tabbar { display: none; }
  .sidebar {
    position: fixed;
    z-index: 30;
    top: calc(12px + var(--safe-t));
    bottom: calc(12px + var(--safe-b));
    left: calc(12px + var(--safe-l));
    width: 256px;
    display: flex;
    flex-direction: column;
    padding: 18px 12px 14px;
    border-radius: 32px;
  }
  .content { padding-bottom: calc(48px + var(--safe-b)); }
  /* Top bar is the hero's width and centered over the page, on every view */
  .topbar,
  :root[dir="rtl"] .topbar {
    left: 0;
    right: 0;
    width: min(var(--wide-w), 100% - 2 * var(--gutter));
    margin-inline: auto;
  }
  .large-title h1 { font-size: 34px; margin-top: 8px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  :root { --side-w: calc(244px + var(--safe-l)); --gutter: 24px; }
  .sidebar { width: 222px; }
}
/* Gold badge: the wordmark PNG with rounded corners + specular rim */
.badge-logo {
  display: block;
  height: auto;
  border-radius: 14px;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.5), 0 0 0 0.5px rgba(120, 78, 20, 0.28), 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 14px rgba(120, 78, 20, 0.22);
}
/* Home: the bar's badge is the title; keep the h1 for screen readers */
.content[data-view="home"] .large-title h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 14px;
  color: var(--label);
  font-size: 17px;
  font-weight: 500;
}
.side-item .ico { color: var(--tint); }
.side-item .ico svg { width: 23px; height: 23px; display: block; }
.side-item:hover { background: var(--fill); }
.side-item.active { background: linear-gradient(160deg, var(--accent-hi), var(--accent)); color: var(--on-accent); --icon-cut: var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.side-item.active .ico { color: var(--on-accent); }
.side-foot { margin: auto 10px 0; font-size: 12px; color: var(--label2); }

/* ---------- Sheets ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  opacity: 0;
  transition: opacity 0.35s;
}
.sheet {
  position: absolute;
  left: calc(8px + var(--safe-l));
  right: calc(8px + var(--safe-r));
  bottom: calc(8px + var(--safe-b) * 0.5);
  max-height: calc(100dvh - var(--safe-t) - 36px);
  display: flex;
  flex-direction: column;
  border-radius: 38px;
  transform: translateY(calc(100% + 40px));
  transition: transform 0.5s var(--spring);
  overflow: hidden;
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
}
.size-large .sheet { height: calc(100dvh - var(--safe-t) - 36px); }
.sheet-root.open .sheet { transform: none; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.grabber {
  flex: none;
  width: 100%;
  height: 16px;
  position: relative;
  touch-action: none;
}
.grabber::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 36px;
  height: 5px;
  margin-left: -18px;
  border-radius: 3px;
  background: var(--label3);
}
.sheet-head {
  flex: none;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 0 14px 8px;
  touch-action: none;
}
.sheet-head h2 { margin: 0; text-align: center; font-size: 17px; font-weight: 600; }
.circle-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--label);
  box-shadow: inset 0 1px 0 var(--glass-edge);
}
.circle-btn svg { width: 18px; height: 18px; }
.circle-btn.tint { background: linear-gradient(160deg, var(--accent-hi), var(--accent)); color: var(--on-accent); }
.circle-btn.tint .check { opacity: 1; transform: none; color: var(--on-accent); }
.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 16px calc(24px + var(--safe-b));
}
.sheet-body > .group:first-child { margin-top: 8px; }
.sheet-body .group { background: color-mix(in srgb, var(--group) 70%, transparent); }
.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.sheet-actions .btn { flex: 1; min-width: 0; padding: 0 14px; }
.sheet-actions .btn span { overflow: hidden; text-overflow: ellipsis; }
.empty-note { margin: 12px 6px; color: var(--label2); }
.prose p { margin: 8px 4px 16px; color: var(--label2); }

@media (min-width: 768px) {
  .sheet {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(560px, calc(100vw - 48px));
    max-height: min(86dvh, 820px);
    transform: translate(-50%, -46%) scale(0.96);
    opacity: 0;
    transition: transform 0.45s var(--spring), opacity 0.25s;
  }
  .size-large .sheet { height: min(86dvh, 820px); }
  .sheet-root.open .sheet { transform: translate(-50%, -50%); opacity: 1; }
  .grabber::after { display: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: calc(var(--safe-t) + 10px);
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  transform: translate(-50%, -140%);
  transition: transform 0.45s var(--spring);
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Home (v5 Trust) ---------- */
.hero {
  display: grid;
  gap: 22px;
  padding: 26px 22px 22px;
  overflow: hidden;
}
.hero-title {
  margin: 0;
  font-size: clamp(30px, 8vw, 46px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-sub { margin: 12px 0 22px; color: var(--label2); font-size: 17px; max-width: 46ch; }
.t-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.t-stars { color: #e0a526; letter-spacing: 1px; }
.t-cta { width: 100%; }
.t-ticks {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  font-size: 14px;
  color: var(--label2);
}
.t-ticks li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.t-ticks .check { width: 12px; height: 10px; color: var(--tint); }
.glass-inner {
  margin: 0;
  padding: 18px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--glass-strong) 70%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-rim), 0 8px 26px var(--shadow-soft);
}
/* Example estimate as a till receipt: dotted leaders, dashed tear line, torn bottom edge. */
.hero-receipt {
  --tooth: 18px;
  padding-bottom: calc(16px + var(--tooth) / 2);
  border-radius: 24px 24px 0 0;
  background: var(--glass-strong);
  font-variant-numeric: tabular-nums;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) / 2) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) calc(var(--tooth) / 2) repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) / 2) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) calc(var(--tooth) / 2) repeat-x;
}
.hero-receipt figcaption {
  padding-bottom: 12px;
  border-bottom: 1.5px dashed var(--sep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--label2);
}
[dir="rtl"] .hero-receipt figcaption { font-size: 13px; letter-spacing: 0; }
.hr-lines { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 7px; font-size: 14px; }
.hr-lines li { display: flex; align-items: flex-end; gap: 6px; line-height: 1.35; }
.hr-lines li > span { min-width: 0; }
.hr-lines li > i { flex: 1 1 12px; min-width: 12px; margin-bottom: 0.32em; border-bottom: 2px dotted var(--sep); }
.hr-lines b { flex: none; white-space: nowrap; font-weight: 600; }
.hr-lines .hr-rest { color: var(--label2); }
.hr-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--sep);
}
.hr-total span { font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--label2); }
[dir="rtl"] .hr-total span { font-size: 14px; letter-spacing: 0; }
.hr-total b { font-size: clamp(28px, 8vw, 34px); font-weight: 800; letter-spacing: -0.02em; color: var(--tint); white-space: nowrap; }
.hr-sub { font-size: 13px; color: var(--label2); text-align: end; }
.section-title { margin: 34px 6px 12px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

/* Featured testimonial: large, quiet, no card. */
.t-quote { margin: 40px 0 0; padding: 0 10px; text-align: center; }
.t-quote blockquote {
  margin: 0 auto;
  max-width: 30ch;
  font-size: clamp(22px, 5.6vw, 32px);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.t-quote figcaption { margin-top: 14px; font-size: 14px; color: var(--label2); }

/* FAQ: native details as a grouped list. */
.t-faq details { position: relative; }
.t-faq details + details::before { content: ""; position: absolute; top: 0; inset-inline: 16px 0; border-top: 0.5px solid var(--sep); }
.t-faq summary:active { background: var(--fill); }
.t-faq summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.t-faq summary::-webkit-details-marker { display: none; }
.t-faq summary span { flex: 1; }
.t-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.t-faq .chev { transition: transform 0.3s var(--spring); }
[dir="rtl"] .t-faq .chev { transform: scaleX(-1); }
.t-faq details[open] .chev { transform: rotate(90deg); }
.t-faq details p { margin: -2px 16px 16px; color: var(--label2); font-size: 15px; line-height: 1.5; }

.cta { margin-top: 34px; padding: 28px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.cta h3 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.015em; text-wrap: balance; }
.cta p { margin: 0 0 18px; color: var(--label2); }
.cta .btn { min-width: 240px; }

/* WhatsApp card: bold green, white buttons */
.wa-card { position: relative; overflow: hidden; margin: 16px 0 24px; padding: 26px 22px 22px; border-radius: 28px; color: #fff; background: linear-gradient(150deg, color-mix(in srgb, var(--wa) 58%, #000), color-mix(in srgb, var(--wa) 40%, #000)); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18); }
.wa-card h3 { position: relative; margin: 12px 0 6px; font-size: 26px; letter-spacing: -0.02em; text-wrap: balance; }
.wa-card > p { position: relative; margin: 0 0 20px; color: rgba(255, 255, 255, 0.88); }
.wa-mark { position: absolute; top: -26px; right: -26px; opacity: 0.12; pointer-events: none; }
.wa-mark svg { width: 150px; height: 150px; }
[dir="rtl"] .wa-mark { right: auto; left: -26px; transform: scaleX(-1); }
.wa-card .wa-live { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 5px 12px 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-size: 13px; font-weight: 600; }
.wa-live i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #7dffb0; }
.wa-actions { position: relative; display: flex; flex-direction: column; gap: 10px; }
.wa-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px; border-radius: 999px; font-size: 16px; font-weight: 650; text-decoration: none; }
.wa-btn svg { width: 20px; height: 20px; flex: none; }
.wa-btn-solid { background: #fff; color: color-mix(in srgb, var(--wa) 45%, #000); }
.wa-btn-line { color: #fff; background: rgba(255, 255, 255, 0.1); border: 1.5px solid rgba(255, 255, 255, 0.7); }
.wa-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.wa-btn:active { transform: scale(0.97); }
@media (prefers-reduced-motion: no-preference) {
  .wa-live i::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: wa-ping 1.8s ease-out infinite; }
  @keyframes wa-ping { to { transform: scale(2.6); opacity: 0; } }
}
@media (min-width: 768px) { .wa-card { padding: 34px; } .wa-actions { flex-direction: row; } .wa-btn { flex: 1; } }
/* Floating WhatsApp button (Home only): sits above the phone tab bar, bottom end corner; pill (.open) collapses to a circle on scroll down */
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.2fr 1fr; align-items: center; padding: 44px; gap: 44px; }
  .t-cta { width: auto; min-width: 260px; }
  .t-ticks { justify-content: flex-start; }
  .t-quote { margin-top: 56px; }
  .content[data-view="home"] .group { max-width: 720px; margin-inline: auto; }
  .content[data-view="home"] .section-title { max-width: 720px; margin-inline: auto; padding-inline: 6px; }
}

/* ---------- Estimate breakdown: a printed receipt ---------- */
:root { --paper: #fffcf3; --ink: #2b2116; --ink2: rgba(74, 56, 34, 0.66); --ink3: rgba(74, 56, 34, 0.3); --stamp: #b5563a; }
:root[data-theme="dark"] { --paper: #33271a; --ink: #f6ecdc; --ink2: rgba(240, 226, 204, 0.62); --ink3: rgba(240, 226, 204, 0.26); --stamp: #ef9a83; }
.bd { margin-top: 26px; }
.rc-wrap { max-width: 560px; margin: 0 auto; filter: drop-shadow(0 12px 20px var(--shadow-soft)) drop-shadow(0 1px 1px var(--shadow-soft)); }
.receipt {
  --tooth: 14px;
  --zig: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x;
  position: relative;
  padding: calc(var(--tooth) / 2 + 20px) 22px calc(var(--tooth) / 2 + 18px);
  background: var(--paper);
  color: var(--ink);
  -webkit-mask: var(--zig);
  mask: var(--zig);
}
.rc-head { padding-bottom: 14px; border-bottom: 1.5px dashed var(--ink3); text-align: center; }
.rc-brand { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink2); }
.rc-brand time { letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.rc-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.rc-meta { margin: 4px 0 0; font-size: 13px; color: var(--ink2); }
.rc-group { margin-top: 16px; }
.rc-cap { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink2); }
.rc-group ul, .rc-ph { list-style: none; margin: 0; padding: 0; }
.rc-group li { padding: 3px 0; font-size: 15px; }
.rc-group li small { display: block; font-size: 12px; color: var(--ink2); }
.rc-line, .rc-sub { display: flex; align-items: flex-end; gap: 6px; line-height: 1.35; }
.rc-line > span:first-child { min-width: 0; }
.rc-dots { flex: 1 1 12px; min-width: 12px; margin-bottom: 0.32em; border-bottom: 2px dotted var(--ink3); }
.rc-amt { flex: none; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.rc-sub { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--ink3); font-size: 14px; font-weight: 700; }
.rc-sub .rc-dots { visibility: hidden; }
.rc-total { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: 18px; padding-top: 12px; border-top: 4px double var(--ink); }
.rc-total span { font-size: 13px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.rc-total b { font-size: clamp(28px, 8.4vw, 38px); font-weight: 800; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.rc-range { margin: 2px 0 0; white-space: pre-line; font-size: 13px; color: var(--ink2); text-align: end; }
.rc-fine { margin: 16px 0 0; padding-top: 12px; border-top: 1.5px dashed var(--ink3); font-size: 12px; color: var(--ink2); text-align: center; }
.rc-empty { margin: 16px 0 0; color: var(--ink2); text-align: center; }
.rc-code { height: 26px; margin: 14px auto 0; width: min(220px, 70%); opacity: 0.7; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 13px); }
.rc-actions { display: flex; gap: 10px; max-width: 560px; margin: 16px auto 0; }
.rc-actions .btn { flex: 1; min-width: 0; min-height: 50px; padding: 0 14px; }
.rc-actions .btn span { overflow: hidden; text-overflow: ellipsis; }
/* Tear-off stub: the receipt's bottom corners and the stub's top corners are notched, so together they read as one slip with a perforation. */
.receipt.stubbed {
  padding-bottom: 22px;
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x,
    radial-gradient(circle 10px at 0 100%, #0000 98%, #000) 0 100% / 51% 50% no-repeat,
    radial-gradient(circle 10px at 100% 100%, #0000 98%, #000) 100% 100% / 51% 50% no-repeat;
  mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x,
    radial-gradient(circle 10px at 0 100%, #0000 98%, #000) 0 100% / 51% 50% no-repeat,
    radial-gradient(circle 10px at 100% 100%, #0000 98%, #000) 100% 100% / 51% 50% no-repeat;
}
.rc-stub {
  --tooth: 14px;
  --lift: 0px;
  --tilt: 0deg;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 6px;
  padding: 22px 22px calc(var(--tooth) / 2 + 18px);
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transform: translateY(var(--lift)) rotate(var(--tilt));
  transform-origin: 0 0;
  -webkit-mask: radial-gradient(circle 10px at 0 0, #0000 98%, #000) 0 0 / 51% 50% no-repeat,
    radial-gradient(circle 10px at 100% 0, #0000 98%, #000) 100% 0 / 51% 50% no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x;
  mask: radial-gradient(circle 10px at 0 0, #0000 98%, #000) 0 0 / 51% 50% no-repeat,
    radial-gradient(circle 10px at 100% 0, #0000 98%, #000) 100% 0 / 51% 50% no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x;
}
[dir="rtl"] .rc-stub { transform-origin: 100% 0; }
/* The perforation, notch to notch */
.rc-stub::before { content: ''; position: absolute; top: 0; inset-inline: 16px; border-top: 2px dashed var(--ink3); }
.rc-scissors { position: relative; z-index: 1; display: block; height: 0; }
.rc-scissors svg { position: absolute; top: 0; inset-inline-start: 20px; box-sizing: content-box; padding: 0 4px; background: var(--paper); color: var(--ink2); transform: translateY(-50%); }
[dir="rtl"] .rc-scissors svg { transform: translateY(-50%) scaleX(-1); }
.rc-stub-kicker {
  margin-top: 4px;
  padding: 4px 12px;
  border: 2px solid var(--stamp);
  border-radius: 6px;
  color: var(--stamp);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}
.rc-stub-text { max-width: 30ch; font-size: 14px; line-height: 1.4; color: var(--ink2); text-wrap: balance; }
.rc-stub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin-top: 6px;
  padding: 0 22px 0 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 700;
}
.rc-stub-btn svg { box-sizing: content-box; width: 20px; height: 20px; padding: 6px; border-radius: 50%; background: #25d366; color: #fff; }
[dir="rtl"] .rc-stub-btn { padding: 0 8px 0 22px; }
[dir="rtl"] .rc-stub-kicker { letter-spacing: 0; transform: rotate(2deg); }
.rc-stub:focus-visible { outline: none; }
.rc-stub:focus-visible .rc-stub-btn { outline: 3px solid var(--tint); outline-offset: 3px; }
@media (hover: hover) { .rc-stub:hover { --lift: 3px; --tilt: -1.2deg; } [dir="rtl"] .rc-stub:hover { --tilt: 1.2deg; } }
.rc-stub:active { --lift: 5px; --tilt: -2deg; }
[dir="rtl"] .rc-stub:active { --tilt: 2deg; }
@media (prefers-reduced-motion: no-preference) {
  .rc-stub { transition: transform 0.35s var(--spring); }
  .receipt.print ~ .rc-stub { animation: rc-stub-in 0.5s 0.45s var(--spring) backwards; }
}
@media (prefers-reduced-motion: reduce) {
  .rc-stub { transform: none; }
  .rc-stub:active .rc-stub-btn { opacity: 0.85; }
}
@keyframes rc-stub-in { from { opacity: 0; transform: translateY(-10px); } }
/* Blank slip before the unit is described */
.receipt.blank { text-align: center; }
.rc-ghost { opacity: 0.55; text-align: start; }
.ph { display: block; height: 10px; border-radius: 5px; background: var(--ink3); }
.ph.title { width: 52%; height: 16px; margin: 0 auto 8px; }
.ph.meta { width: 74%; margin: 0 auto 14px; }
.ph.amt { flex: none; width: 64px; }
.ph.big { width: 42%; height: 26px; border-radius: 8px; }
.rc-total .ph:first-child { width: 22%; }
.rc-ph { margin-top: 16px; }
.rc-ph li { padding: 6px 0; }
.rc-ph .rc-dots { margin-bottom: 1px; }
.rc-stamp {
  position: absolute;
  top: 34%;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 56px);
  margin: 0;
  padding: 10px 16px;
  border: 4px double var(--stamp);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  color: var(--stamp);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: translate(-50%, -50%) rotate(-5deg);
}
.rc-note { margin: 18px 0 0; font-size: 13px; color: var(--ink2); }
.rc-jumps { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.rc-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px dashed var(--stamp);
  border-radius: 999px;
  color: var(--stamp);
  font-size: 15px;
  font-weight: 600;
}
.rc-jump svg { width: 18px; height: 18px; }
.rc-jump:hover { background: color-mix(in srgb, var(--stamp) 10%, transparent); }
.rc-jump:active { transform: scale(0.97); }
@media (prefers-reduced-motion: no-preference) {
  .receipt.print { animation: rc-print 0.7s var(--spring); }
  .rc-stamp { animation: rc-stamp 0.35s cubic-bezier(0.3, 1.5, 0.6, 1); }
}
@keyframes rc-print { from { clip-path: inset(0 0 100% 0); transform: translateY(-18px); } to { clip-path: inset(0); transform: none; } }
@keyframes rc-stamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-5deg) scale(1.3); } }

/* ---------- Results ---------- */
.result-hero { text-align: center; padding: 8px 4px 4px; }
.result-hero.compact { padding: 22px 18px; margin-top: 8px; }
.result-hero small { color: var(--label2); font-size: 13px; }
.result-total {
  margin: 4px 0 2px;
  font-size: clamp(34px, 10vw, 44px);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.result-range { color: var(--label2); font-size: 15px; }
.result-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 500; }
.fine { margin: 12px 8px 0; font-size: 12px; color: var(--label2); }
.badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--tint-soft);
  color: var(--tint);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Remodel ---------- */
.drop { padding: 14px; }
.drop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 26px 16px 18px;
  border: 1.5px dashed var(--label3);
  border-radius: 18px;
}
.drop-empty svg { width: 40px; height: 40px; color: var(--tint); margin-bottom: 6px; }
.drop-empty span { color: var(--label2); font-size: 14px; max-width: 34ch; }
.drop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.drop-actions .btn { min-height: 44px; font-size: 15px; padding: 0 16px; }
.thumb { border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--fill); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.plan img { object-fit: contain; background: #fff; }
.file-card { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.styles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 560px) { .styles { grid-template-columns: repeat(4, 1fr); } }
.style-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px;
  border-radius: 22px;
  text-align: start;
  min-height: 44px;
  transition: transform 0.25s var(--spring);
}
.style-tile:active { transform: scale(0.97); }
.style-tile[aria-checked="true"] { box-shadow: inset 0 0 0 2.5px var(--tint), var(--shadow); }
.style-photo { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; margin-bottom: 8px; }
.style-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s var(--spring); }
.style-tile[aria-checked="true"] .style-photo img { transform: scale(1.08); }
.style-name { font-weight: 600; font-size: 16px; }
.style-tile small { color: var(--label2); font-size: 12px; }

.compare {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  --pos: 50%;
  user-select: none;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.cmp-overlay { position: absolute; inset: 0; mix-blend-mode: soft-light; }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 8px rgba(0, 0, 0, 0.3); pointer-events: none; }
.cmp-knob { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; }
.cmp-knob::after { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: #fff; letter-spacing: 2px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.cmp-tag { position: absolute; top: 12px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; pointer-events: none; }
.cmp-tag.left { left: 12px; }
.cmp-tag.right { right: 12px; }
.compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding: 36px 20px;
  text-align: center;
}
.loading span { color: var(--label2); font-size: 15px; }
.spinner { position: relative; width: 34px; height: 34px; margin-bottom: 10px; }
.spinner i {
  position: absolute;
  left: 15px;
  top: 0;
  width: 4px;
  height: 10px;
  border-radius: 2px;
  background: var(--label2);
  transform-origin: 2px 17px;
  transform: rotate(calc(var(--k) * 45deg));
  opacity: calc(0.2 + var(--k) * 0.1);
}
@media (prefers-reduced-motion: no-preference) {
  .spinner { animation: spin 0.9s steps(8) infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Studio ---------- */
.studio-grid { display: grid; gap: 8px; }
/* One column like Remodel until there is a result to show beside the form */
@media (min-width: 1000px) {
  .studio-grid.split { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .studio-grid.split > [data-out] { padding-top: 34px; }
  .studio-grid.split > [data-out] .loading { margin-top: 0; }
}
.studio-grid .group-pad { margin-top: 12px; }
.previews { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.preview { margin: 0; padding: 8px; border-radius: 22px; overflow: hidden; }
.preview svg { display: block; width: 100%; height: auto; border-radius: 15px; }
.preview figcaption { padding: 8px 6px 4px; font-size: 13px; font-weight: 600; }

/* ---------- Settings ---------- */
.support { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.support-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  min-height: 120px;
  padding: 18px;
  border-radius: var(--r-group);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), var(--shadow);
  transition: transform 0.2s var(--spring);
}
.support-btn:active { transform: scale(0.97); }
.support-btn svg { width: 32px; height: 32px; }
.support-btn span { display: flex; flex-direction: column; }
.support-btn b { font-size: 20px; }
.support-btn small { opacity: 0.9; font-size: 13px; }
.support-btn.call { background: linear-gradient(160deg, #4cd964, #28a745); }
.support-btn.wa { background: linear-gradient(160deg, #35e07a, #128c7e); }
.sheet-body .group-title.first { margin-top: 10px; }

/* ---------- Support (chat-style) ---------- */
.chat-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.chat-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent));
  color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent);
}
.chat-avatar svg { width: 23px; height: 23px; }
.chat-who { display: flex; flex-direction: column; gap: 1px; font-size: 15px; color: var(--label); }
.chat-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label2); }
.chat-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--label2); opacity: 0.6; }
.chat-status.on::before { background: var(--wa); opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--wa) 25%, transparent); }
.chat-msgs { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 92px; margin-bottom: 18px; padding-inline-start: 50px; }
.bubble {
  margin: 0;
  max-width: 34ch;
  padding: 10px 15px;
  border-radius: 20px;
  background: var(--group);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-rim), 0 2px 12px var(--shadow-soft);
  font-size: 17px;
  line-height: 1.35;
  color: var(--label);
}
.bubble:first-child { border-start-start-radius: 6px; }
.bubble + .bubble { border-start-start-radius: 6px; }
.typing { display: flex; gap: 5px; padding: 15px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--label2); }
.chat-replies { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.chat-replies li { width: min(92%, 440px); }
.reply {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px 10px 12px;
  border-radius: 20px;
  border-end-end-radius: 6px;
  background: var(--tint-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 30%, transparent);
  color: var(--tint);
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.2s var(--spring), background 0.2s;
}
.reply-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--tint) 16%, transparent); }
.reply-ic svg { width: 19px; height: 19px; }
.reply-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.reply-txt small { font-size: 13px; font-weight: 400; color: var(--label2); }
.reply > svg { flex: none; width: 20px; height: 20px; color: var(--wa); }
.reply:hover { background: color-mix(in srgb, var(--tint) 22%, transparent); }
.reply:active { transform: scale(0.98); }
.chat-hint { margin: 10px 4px 0; font-size: 13px; color: var(--label2); text-align: end; }
.call-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 44px;
  margin: 18px auto 0;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--label);
  font-size: 15px;
}
.call-pill svg { width: 18px; height: 18px; color: var(--tint); }
.call-pill b { color: var(--tint); }
.call-pill:hover { background: var(--fill2); }
.chat-hours { margin: 6px 0 0; font-size: 12px; color: var(--label2); text-align: center; }
.chat-settings { margin-top: 28px; }
@media (prefers-reduced-motion: no-preference) {
  .chat-head, .bubble, .chat-replies li { animation: chat-in 0.45s var(--spring) both; }
  .bubble + .bubble { animation-delay: 0.25s; }
  .typing i { animation: typing 1s infinite ease-in-out; }
  .typing i:nth-child(2) { animation-delay: 0.15s; }
  .typing i:nth-child(3) { animation-delay: 0.3s; }
  .chat-replies li { animation-delay: calc(0.75s + var(--k, 0) * 0.05s); }
  .chat-replies li:nth-child(2) { --k: 1; }
  .chat-replies li:nth-child(3) { --k: 2; }
  .chat-replies li:nth-child(4) { --k: 3; }
}
@keyframes chat-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
@keyframes typing { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Language switch (top bar, end side) ---------- */
.lang-switch {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 44px;
  border-radius: 999px;
  background: var(--fill);
  box-shadow: inset 0 1px 2px var(--shadow-soft), inset 0 0 0 0.5px var(--glass-rim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  transform: translate(calc(var(--flip) * -12px * (1 - var(--morph, 0))), -50%);
  view-transition-name: lang-switch;
}
.lang-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform 0.5s var(--spring);
}
:root[lang="ar"] .lang-thumb { transform: translateX(100%); }
/* liquid drop: stretches along the move, squashes, then settles */
@media (prefers-reduced-motion: no-preference) {
  .lang-thumb.drop { animation: drop 0.5s var(--spring); }
}
@keyframes drop {
  0% { scale: 1 1; }
  30% { scale: 1.4 0.8; }
  62% { scale: 0.92 1.07; }
  100% { scale: 1 1; }
}
.lang-opt {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 56px;
  height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--label2);
  transition: color 0.25s;
}
.lang-opt[aria-checked="true"] { color: var(--on-accent); }
.lang-opt:active { scale: 0.94; transition: scale 0.15s; }

/* Language cross-fade (View Transitions); brand + switch glide to their mirrored side */
::view-transition-group(*) { animation-duration: 0.45s; animation-timing-function: var(--spring); }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.3s; }
::view-transition-old(lang-switch) { display: none; }
::view-transition-new(lang-switch) { animation: none; }

/* ---------- Inline unit section (estimate) ---------- */
.unit-sec,
.acc-head { scroll-margin-top: calc(var(--safe-t) + var(--bar-top) + var(--nav-h) + 24px); }
.unit-sec > .group-title:first-child { margin-top: 0; }
.title-link { color: var(--tint); font-size: 15px; font-weight: 500; padding: 4px 0; cursor: pointer; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 15px; }
.unit-card .row { min-height: 68px; padding-block: 14px; }
.unit-card .row-label b { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-card .row-label small { font-size: 14px; }
.text-in {
  flex: 0 1 58%;
  min-width: 0;
  min-height: 36px;
  padding: 4px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  color: var(--label);
  font-size: 16px;
  text-align: end;
}
.text-in::placeholder { color: var(--label3); }
.acc-head .chev { transition: transform 0.3s var(--spring); }
.acc-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
.acc-head .row-value { color: var(--label); font-weight: 500; }
.acc-head.missing .row-value { color: var(--red); font-weight: 500; }
.acc-head.missing .row-label { color: var(--red); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.32s var(--spring); }
.acc-body.open { grid-template-rows: 1fr; }
.acc-body > div { overflow: hidden; min-height: 0; container-type: inline-size; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 16px 14px 58px; }
.opts .chip.opt { min-height: 44px; padding-inline: 16px; }
.acc-head .row-value { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.rv-ic { flex: none; display: grid; color: var(--tint); }
.rv-ic svg { width: 18px; height: 18px; }
.rv-tx { overflow: hidden; text-overflow: ellipsis; }
.opt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 2px 16px 14px 58px; }
@container (min-width: 460px) { .opt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 600px) { .opt-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.opt-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 84px;
  padding: 12px 6px 10px;
  border-radius: 18px;
  background: var(--fill);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-rim);
  color: var(--label);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.2s var(--spring);
}
.opt-tile > svg { width: 28px; height: 28px; flex: none; }
.ot-label { font-size: 13px; font-weight: 500; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.opt-tile:active { transform: scale(0.96); }
.opt-tile[aria-pressed="true"] { background: linear-gradient(160deg, var(--accent-hi), var(--accent)); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.ot-badge {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--on-accent);
  color: var(--accent-hi);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s, transform 0.25s var(--spring);
}
.ot-badge svg { width: 10px; height: 8px; }
.opt-tile[aria-pressed="true"] .ot-badge { opacity: 1; transform: none; }
.chip.opt { min-height: 36px; padding: 7px 14px; font-size: 14px; color: var(--label); cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.2s var(--spring); }
.chip.opt:active { transform: scale(0.96); }
.chip.opt[aria-pressed="true"] { background: linear-gradient(160deg, var(--accent-hi), var(--accent)); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.loc-custom { display: flex; gap: 8px; width: 100%; margin-top: 4px; }
.loc-custom input { flex: 1; min-width: 0; min-height: 36px; padding: 4px 12px; border: 0; border-radius: 999px; background: var(--fill); color: var(--label); font-size: 15px; }
.loc-custom input::placeholder { color: var(--label3); }
.unit-actions { justify-content: flex-end; gap: 10px; padding-block: 12px; }
.unit-actions .btn { min-height: 44px; font-size: 16px; }
.unit-warn { margin: 0 18px 8px; color: var(--red); }
.unit-sec.pulse .group { animation: unit-pulse 1.2s ease-out; }
@keyframes unit-pulse {
  0%, 60% { box-shadow: inset 0 1px 0 var(--glass-edge), 0 0 0 3px color-mix(in srgb, var(--accent) 70%, transparent), 0 4px 24px var(--shadow-soft); }
  100% { box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-rim), 0 4px 24px var(--shadow-soft); }
}
.unit-actions .btn.nudge:not(:disabled) { animation: save-nudge 1.4s ease-out; }
@keyframes save-nudge {
  0%, 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.acc-body + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 58px; border-top: 0.5px solid var(--sep); }
/* Field sections */
.pick-sec { position: relative; scroll-margin-top: calc(var(--safe-t) + var(--bar-top) + var(--nav-h) + 24px); }
.unit-actions { scroll-margin-top: calc(var(--safe-t) + var(--bar-top) + var(--nav-h) + 24px); }
.pick-sec::before,
.pick-sec + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 58px; border-top: 0.5px solid var(--sep); z-index: 1; }
.pick-sec.pulse { animation: sec-pulse 1.4s ease-out; }
@keyframes sec-pulse {
  0%, 45% { background: color-mix(in srgb, var(--accent) 20%, transparent); }
  100% { background: transparent; }
}
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 16px 14px; }
.opt-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  align-items: center;
  column-gap: 8px;
  row-gap: 3px;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--fill);
  color: var(--label);
  text-align: start;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.2s var(--spring);
}
.opt-card:active { transform: scale(0.96); }
.opt-card .opt-ic { display: grid; place-items: center; color: var(--accent); transition: color 0.15s; }
.opt-card svg { width: 22px; height: 22px; }
.opt-card b { font-size: 14px; font-weight: 600; line-height: 1.2; }
.opt-card small { grid-column: 1 / -1; font-size: 12px; line-height: 1.3; color: var(--label2); }
.opt-card[aria-pressed="true"] { background: linear-gradient(160deg, var(--accent-hi), var(--accent)); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.opt-card[aria-pressed="true"] .opt-ic,
.opt-card[aria-pressed="true"] small { color: inherit; }
.opt-card[aria-pressed="true"] small { opacity: 0.85; }
.opt-card:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

/* Numbered steps; the condition step is its own group under the unit */
.group-title.step-title { align-items: center; }
.group-title.step-title .step-lbl { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: inherit; font-variant-numeric: normal; }
.step-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: var(--on-accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.step-n svg { width: 11px; height: 9px; }
.step-n.done { animation: step-done 0.35s var(--spring); }
@keyframes step-done { from { transform: scale(0.6); } }
.group-title.step-title .step-req { font-size: 13px; font-weight: 500; color: var(--red); }
[data-cond-sec],
[data-step-service],
[data-step-spaces],
.cond-cards { scroll-margin-top: calc(var(--safe-t) + var(--bar-top) + var(--nav-h) + 24px); }
.cond-cards { border-radius: 22px; }
.cond-cards.missing { box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 55%, transparent); }
/* How much is already done: a thin bar at the foot of each card */
.cond-cards .card-desc { flex: 1; }
.cond-done { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--label2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cond-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--fill2); overflow: hidden; }
.cond-bar i { display: block; height: 100%; min-width: 5px; border-radius: inherit; background: linear-gradient(90deg, var(--accent-hi), var(--accent)); }
.card-choice[aria-checked="true"] .cond-done { color: var(--tint); }
.cond-cards.pulse .card-choice { animation: sec-pulse 1.4s ease-out; }
@media (prefers-reduced-motion: reduce) { .step-n.done { animation: none; } }

/* ---------- Arabic (RTL) ---------- */
/* Letter-spacing breaks Arabic letter joining */
[dir="rtl"] body { letter-spacing: 0; }
[dir="rtl"] { --flip: -1; }
[dir="rtl"] .topbar { left: var(--bar-r); right: var(--bar-l); background: radial-gradient(120% 150% at 100% 0%, color-mix(in srgb, var(--accent-hi) 34%, transparent), transparent 60%), var(--glass); }
[dir="rtl"] .top-brand { left: auto; right: 9px; transform-origin: right center; }
[dir="rtl"] .lang-switch { right: auto; left: 4px; }
[dir="rtl"] .navbar { left: 0; right: var(--side-w); }
[dir="rtl"] .content { margin-left: 0; margin-right: var(--side-w); }
[dir="rtl"] .large-title h1 { margin: 0 4px 14px 0; }
[dir="rtl"] .row,
[dir="rtl"] .style-tile { text-align: right; }
[dir="rtl"] .row-value,
[dir="rtl"] .area-input input { text-align: left; }
[dir="rtl"] .row + .row::before,
[dir="rtl"] .rows .row + .row::before { left: 0; right: 16px; }
[dir="rtl"] .row:has(.tile) + .row::before { left: 0; right: 58px; }
[dir="rtl"] .seg-thumb { left: auto; right: 3px; transform: translateX(calc(-100% * var(--i))); }
[dir="rtl"] .tab-pill { left: auto; right: 4px; transform: translateX(calc(-100% * var(--active))); }
[dir="rtl"] .chev { transform: scaleX(-1); }
[dir="rtl"] .reply { padding: 10px 12px 10px 14px; }
[dir="rtl"] .call-pill { padding: 0 14px 0 18px; }
[dir="rtl"] .opts,
[dir="rtl"] .opt-grid { padding: 2px 58px 14px 16px; }
[dir="rtl"] .acc-body + .row::before,
[dir="rtl"] .pick-sec::before,
[dir="rtl"] .pick-sec + .row::before { left: 0; right: 58px; }
[dir="rtl"] .acc-head[aria-expanded="true"] .chev { transform: scaleX(-1) rotate(90deg); }
[dir="rtl"] .rc-brand,
[dir="rtl"] .rc-cap,
[dir="rtl"] .rc-total span { letter-spacing: 0; }
[dir="rtl"] input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(to left, var(--accent) var(--p), var(--fill2) var(--p)); }
@media (min-width: 768px) {
  [dir="rtl"] .sidebar { left: auto; right: calc(12px + var(--safe-r)); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Choice cards (Estimate > Service) ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.card-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 112px;
  padding: 12px 14px 14px;
  text-align: start;
  color: var(--label);
  background: var(--group);
  border-radius: 20px;
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-rim), 0 4px 24px var(--shadow-soft);
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s, transform 0.25s var(--spring);
}
.card-choice:active { transform: scale(0.97); }
.card-choice[aria-checked="true"] {
  background: color-mix(in srgb, var(--tint-soft) 60%, var(--group));
  box-shadow: inset 0 0 0 2px var(--tint), 0 4px 24px var(--shadow-soft);
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 4px;
}
.card-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--fill);
  color: var(--label2);
  transition: background 0.2s, color 0.2s;
}
.card-icon svg { width: 22px; height: 22px; }
.card-choice[aria-checked="true"] .card-icon { background: var(--tint-soft); color: var(--tint); }
.card-badge {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--bg, #fff);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s, transform 0.25s var(--spring);
}
.card-badge svg { width: 11px; height: 9px; }
.card-choice[aria-checked="true"] .card-badge { opacity: 1; transform: none; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.25; }
.card-desc { font-size: 12.5px; line-height: 1.3; color: var(--label2); }
@media (prefers-reduced-motion: reduce) {
  .card-choice, .card-badge, .card-icon { transition: none; }
}
.card-choice:focus-visible { border-radius: 20px; }

/* ---- Finishing level cards (Estimate, Studio): 2×2 on phones, 4 across when there's room ---- */
.lvl-wrap { container-type: inline-size; }
@container (min-width: 620px) { .lvl-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lvl-card { min-height: 0; }
.lvl-card .card-desc { flex: 1; }
.lvl-tier { display: flex; align-items: center; gap: 2px; height: 22px; }
.lvl-stars .star { width: 16px; height: 16px; fill: var(--fill2); stroke: none; transition: fill 0.2s; }
.lvl-stars .star.on { fill: var(--accent); }
.lvl-stars .star { width: 14px; height: 14px; fill: none; stroke: var(--label3); stroke-width: 1.6; stroke-linejoin: round; }
.lvl-stars .star.on { fill: var(--accent); stroke: var(--accent); }
.lvl-price {
  margin-top: 8px;
  padding-top: 8px;
  width: 100%;
  border-top: 0.5px solid var(--sep);
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lvl-price small { font-size: 11.5px; font-weight: 400; color: var(--label2); }
.lvl-card[aria-checked="true"] .lvl-price { color: var(--tint); }

/* ---------- Spaces row icons ---------- */
.tile.space-live {
  width: 34px; height: 34px; border-radius: 10px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.38), transparent 60%), linear-gradient(150deg, var(--tile), color-mix(in srgb, var(--tile) 62%, #000));
  box-shadow: 0 3px 10px color-mix(in srgb, var(--tile) 40%, transparent), inset 0 0.5px 0 rgba(255, 255, 255, 0.5);
  transition: filter 0.25s, opacity 0.25s;
}
.tile.space-live svg { width: 20px; height: 20px; }
.is-zero .tile.space-live { filter: grayscale(1); opacity: 0.45; box-shadow: none; }
.bump .tile.space-live { animation: space-bump 0.42s var(--spring); }
@keyframes space-bump { 0% { transform: scale(1); } 35% { transform: scale(1.18) rotate(-6deg); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .bump .tile.space-live { animation: none; } }

/* ---------- Remodel: describe-your-own prompt bar ---------- */
.prompt-wrap { margin: 18px 0 22px; }
.prompt-title { display: block; margin: 0 4px 8px; font-size: 15px; font-weight: 600; color: var(--label2); }
.prompt-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px 10px 16px;
  border-radius: 28px;
  min-height: 56px;
  cursor: text;
  transition: box-shadow 0.25s, transform 0.25s var(--spring);
}
.prompt-bar::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(120deg, var(--accent-hi), var(--accent), color-mix(in srgb, var(--accent) 40%, #9b6bd6), var(--accent-hi));
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.25s;
}
.prompt-bar:focus-within::after { opacity: 0.9; }
.prompt-bar.on { box-shadow: inset 0 0 0 2.5px var(--tint), 0 0 0 5px var(--tint-soft), var(--shadow); }
.prompt-bar.on::after { opacity: 0; }
.prompt-bar > svg { flex: none; width: 24px; height: 24px; margin-top: 7px; color: var(--tint); }
.prompt-bar textarea {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  max-height: calc(3 * 1.4em + 12px);
  padding: 6px 0;
  border: 0;
  outline: 0;
  resize: none;
  overflow-y: auto;
  background: none;
  color: var(--label);
  font: inherit;
  font-size: 17px;
  line-height: 1.4;
}
.prompt-bar textarea::placeholder { color: var(--label3); }
.prompt-bar textarea:focus-visible { outline: 0; }
.prompt-count { flex: none; align-self: flex-end; margin-bottom: 8px; font-size: 11.5px; color: var(--label3); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.2s; }
.prompt-bar.near .prompt-count { opacity: 1; }
.prompt-match { margin: 8px 6px 0; min-height: 1.4em; font-size: 13.5px; color: var(--label2); }
.prompt-match b { color: var(--tint); font-weight: 600; }
.prompt-wrap:has([aria-invalid="true"]) .prompt-match { color: var(--red); }
.prompt-wrap:has([aria-invalid="true"]) .prompt-bar { box-shadow: inset 0 0 0 2px var(--red), var(--shadow); }
.prompt-ideas {
  display: flex;
  gap: 8px;
  margin: 10px calc(-1 * var(--gutter)) 0;
  padding: 2px var(--gutter) 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
  mask: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
}
.prompt-ideas::-webkit-scrollbar { display: none; }
.prompt-ideas .chip { flex: none; min-height: 44px; white-space: nowrap; scroll-snap-align: start; }
.custom-quote { display: flex; gap: 10px; margin: -4px 4px 14px; padding: 0; }
.custom-quote svg { flex: none; width: 20px; height: 20px; margin-top: 3px; color: var(--tint); }
.custom-quote q { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 17px; font-style: italic; }
.custom-quote small { display: block; margin-top: 2px; font-size: 13px; color: var(--label2); }
@media (prefers-reduced-motion: no-preference) {
  .prompt-bar:focus-within::after { animation: prompt-glow 4s linear infinite; }
}
@keyframes prompt-glow { to { background-position: 300% 0; } }
[dir="rtl"] .prompt-bar { padding: 10px 16px 10px 14px; }
[dir="rtl"] .prompt-ideas { -webkit-mask: linear-gradient(270deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent); mask: linear-gradient(270deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent); }
[dir="rtl"] .custom-quote q { font-style: normal; quotes: "«" "»"; }

/* ---------- Real quote ---------- */
.rc-actions + .rc-actions { margin-top: 10px; }

/* ---------- Compare ---------- */
/* An example run counts companies up, chips advance per row, then the head resolves into the result; You vs Us follows. "Book a free visit" floats above the phone tab bar and sits inline on wider screens. */
.cx { padding-bottom: 72px; } /* room for the floating button */
.cx-title {
  margin: 0 4px 10px;
  font-size: clamp(28px, 7.4vw, 40px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.cx-lede { margin: 0 4px 18px; font-size: 16px; color: var(--label2); text-wrap: pretty; }
.cx-run { margin: 0; padding: 18px; }
.cx-cap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 2px 14px; font-size: 14px; color: var(--label2); }
.cx-tag {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1.5px dashed var(--tint);
  color: var(--tint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* The live head and the result share one cell, so swapping them never moves the list */
.cx-head { display: grid; margin-bottom: 12px; }
.cx-live, .cx-result { grid-area: 1 / 1; }
.cx-phase { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; color: var(--tint); }
.cx-phase .typing { padding: 0; gap: 4px; }
.cx-phase .typing i { width: 5px; height: 5px; background: var(--tint); }
.cx-count { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 10px; font-size: 15px; font-weight: 600; }
.cx-count b { font-size: 40px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cx-bar { height: 6px; border-radius: 3px; background: var(--fill2); overflow: hidden; }
.cx-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-hi), var(--accent)); }
[dir="rtl"] .cx-bar i { background: linear-gradient(270deg, var(--accent-hi), var(--accent)); }
.cx-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 18px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent-hi) 34%, var(--glass-strong)), color-mix(in srgb, var(--accent) 22%, var(--glass-strong)));
  box-shadow: inset 0 0 0 2px var(--accent);
  text-align: center;
  visibility: hidden;
  opacity: 0;
}
.cx-result p { margin: 0; font-size: 17px; font-weight: 600; text-wrap: balance; }
.cx-result span { white-space: nowrap; }
.cx-result .cx-sep { display: none; }
.cx-result p span:not(.cx-sep) { display: block; }
.cx-result b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cx-replay { padding: 4px 10px; border: 0; background: none; color: var(--tint); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.done .cx-live { visibility: hidden; opacity: 0; }
.done .cx-result { visibility: visible; opacity: 1; }
/* Fixed-height list so the page never jumps while rows arrive */
.cx-list {
  list-style: none;
  height: 236px;
  margin: 0;
  padding: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-mask: linear-gradient(transparent, #000 10px, #000 calc(100% - 10px), transparent);
  mask: linear-gradient(transparent, #000 10px, #000 calc(100% - 10px), transparent);
}
.cx-co {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding-block: 0;
  padding-inline: 14px 8px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--glass-strong) 70%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-rim);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cx-co[hidden] { display: none; }
.cx-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--label2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.cx-chip .check { width: 11px; height: 9px; }
[data-s="1"] .cx-chip { background: var(--tint-soft); color: var(--tint); }
[data-s="2"] .cx-chip { background: color-mix(in srgb, var(--green) 16%, transparent); color: color-mix(in srgb, var(--green) 55%, var(--label)); }
.cx-co[data-s="nofit"] { opacity: 0.45; }
.cx-co[data-s="nofit"] > span { text-decoration: line-through; }
.cx-co[data-s="short"] {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent-hi) 34%, var(--glass-strong)), color-mix(in srgb, var(--accent) 22%, var(--glass-strong)));
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
[data-s="short"] .cx-chip { background: linear-gradient(160deg, var(--accent-hi), var(--accent)); color: var(--on-accent); font-weight: 700; }
/* The four steps of the real service, under the example */
.cx-steps { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; padding: 0; }
.cx-steps li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 16px; background: var(--fill); font-size: 14px; font-weight: 600; line-height: 1.25; }
.cx-steps b { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(160deg, var(--accent-hi), var(--accent)); color: var(--on-accent); font-size: 12px; }
.cx-fine { margin: 12px 8px 0; text-align: center; font-size: 13px; color: var(--label2); }
/* You vs Us, after the run: two cards on one subgrid so the six rows line up; "On your own" sits muted and inset, "With Shatably" gold and raised */
.cx-next { margin-top: 44px; }
.cx-vs {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
  grid-template-rows: auto repeat(6, auto);
  gap: 0 8px;
}
.cx-col {
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: subgrid;
  padding: 0 12px;
  border-radius: 22px;
}
.cx-alone {
  margin-block: 14px; /* reads shorter than the gold card beside it */
  background: var(--fill);
  color: var(--label2);
}
.cx-us {
  padding-block: 6px;
  background: linear-gradient(170deg, color-mix(in srgb, var(--accent-hi) 30%, var(--glass-strong)), color-mix(in srgb, var(--accent) 14%, var(--glass-strong)));
  box-shadow: inset 0 0 0 2px var(--accent), 0 14px 34px color-mix(in srgb, var(--accent) 32%, transparent);
}
.cx-colhead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; padding: 14px 0 8px; font-size: 15px; font-weight: 700; line-height: 1.2; }
.cx-us .cx-colhead { font-size: 17px; color: var(--label); }
.cx-free {
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--accent-hi), var(--accent));
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cx-cell { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 10px 0; border-top: 0.5px solid var(--sep); }
.cx-what { font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em; color: var(--label3); }
.cx-us .cx-what { color: var(--label2); }
.cx-val { display: flex; align-items: flex-start; gap: 6px; font-size: 13.5px; line-height: 1.3; text-wrap: pretty; }
.cx-us .cx-val { font-size: 15px; font-weight: 650; color: var(--label); }
/* Small grey ✕ / – on the left, gold ✓ on the right */
.cx-mark { display: grid; place-items: center; flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; }
.cx-alone .cx-mark { background: var(--fill2); color: var(--label2); }
.cx-alone .cx-mark svg { width: 10px; height: 10px; }
.cx-dash { display: block; width: 7px; height: 2px; border-radius: 1px; background: currentColor; }
.cx-us .cx-mark { width: 18px; height: 18px; margin-top: 0; background: var(--accent); color: var(--on-accent); }
.cx-us .cx-mark svg { width: 10px; height: 9px; }
.cx-punch {
  margin: 26px 8px 4px;
  font-size: clamp(21px, 5.6vw, 28px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
}
.cx-sub { margin: 0 8px; text-align: center; font-size: 15px; color: var(--label2); }
.cx-book {
  position: fixed;
  z-index: 29;
  left: calc(14px + var(--safe-l));
  right: calc(14px + var(--safe-r));
  bottom: calc(max(var(--safe-b), 10px) + 4px + var(--tab-h) + 10px);
  max-width: 380px;
  margin: 0 auto;
}
.cx-book .btn { width: 100%; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 26px rgba(0, 0, 0, 0.2); }
@media (prefers-reduced-motion: no-preference) {
  .cx-list { scroll-behavior: smooth; }
  .cx-bar i { transition: width 0.1s linear; }
  .cx-live, .cx-result { transition: opacity 0.4s, visibility 0.4s; }
  .cx-co { animation: cx-in 0.35s cubic-bezier(0.32, 0.72, 0, 1); transition: opacity 0.3s, background 0.3s, box-shadow 0.3s; }
  .cx-chip { transition: background 0.3s, color 0.3s; }
}
@keyframes cx-in { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 700px) {
  .cx-run { padding: 22px; }
  .cx-list { height: 276px; }
  .cx-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cx-result .cx-sep { display: inline; }
  .cx-result p span:not(.cx-sep) { display: inline; }
  .cx-vs { gap: 0 14px; }
  .cx-col { padding: 0 20px; }
  .cx-colhead { padding-top: 18px; font-size: 17px; }
  .cx-us .cx-colhead { font-size: 20px; }
  .cx-what { font-size: 12.5px; }
  .cx-val { font-size: 15px; }
  .cx-us .cx-val { font-size: 17px; }
  .cx-cell { padding: 13px 0; }
}
@media (min-width: 768px) {
  .cx { padding-bottom: 0; }
  /* sticks to the bottom of the window until the page reaches it, so it is always in view */
  .cx-book { position: sticky; bottom: 20px; max-width: none; margin-top: 22px; text-align: center; }
  .cx-book .btn { width: auto; min-width: 280px; }
}

