/* CMC Respray Estimator — matches the cmc-respray.vercel.app theme */
:root {
  --bg: #0a0b0d;
  --bg-2: #111317;
  --card: rgba(255, 255, 255, 0.04);
  --card-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #f4f4f2;
  --muted: #a3a7ae;
  --electric: #23f67b;
  --electric-2: #00d4ff;
  --negative: #ff6b6b;
  --warning: #ffc857;
  --radius: 22px;
  --radius-sm: 14px;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--electric); color: #000; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--electric); outline-offset: 3px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
h1, h2, h3 { font-family: var(--display); line-height: 1.04; letter-spacing: -0.04em; margin: 0 0 14px; }
h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 58ch; margin: 0; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--electric);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--electric); box-shadow: 0 0 0 4px rgba(35,246,123,0.2), 0 0 18px var(--electric); }
.spray {
  background: linear-gradient(100deg, var(--electric), var(--electric-2), var(--electric));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 6s linear infinite;
}
@keyframes sheen { to { background-position: 200% center; } }

/* ambient glow */
.mist { position: fixed; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(110px); opacity: 0.16; z-index: -1; pointer-events: none; }
.mist.a { background: var(--electric); top: -32vmax; right: -24vmax; animation: drift 16s ease-in-out infinite alternate; }
.mist.b { background: var(--electric-2); bottom: -38vmax; left: -28vmax; opacity: 0.1; animation: drift 20s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(-8vmax, 6vmax) scale(1.15); } }

/* header */
header.site {
  position: sticky; top: 14px; z-index: 50; margin: 14px auto 0;
  width: min(1200px, 100% - 24px);
  background: rgba(10, 11, 13, 0.6); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line); border-radius: 999px;
}
header.site .bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 22px; gap: 12px; }
.brand { font-family: var(--display); font-weight: 700; text-decoration: none; font-size: 1.15rem; letter-spacing: -0.02em; display: inline-flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand b { color: var(--electric); }
.brand small { font-family: "Inter", sans-serif; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
header.site nav { display: flex; align-items: center; gap: 4px; }
header.site nav a { color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-size: 0.92rem; transition: color .2s, background .2s; white-space: nowrap; }
header.site nav a:hover, header.site nav a[aria-current="page"] { color: var(--text); background: rgba(255,255,255,0.06); }
header.site nav a.cta { background: var(--electric); color: #000; font-weight: 600; }
header.site nav a.cta:hover { background: #fff; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); padding: 0 10px; white-space: nowrap; }
.topbar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--electric); box-shadow: 0 0 10px var(--electric); }
.topbar__dot--off { background: var(--negative); box-shadow: 0 0 10px var(--negative); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 26px; border-radius: 999px;
  font: 600 0.95rem/1.2 "Inter", sans-serif; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; background: var(--electric); color: #000;
  box-shadow: 0 10px 40px -12px var(--electric);
  transition: transform .2s, box-shadow .3s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 60px -8px var(--electric); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn--secondary, .btn--quiet {
  background: rgba(255,255,255,0.05); color: var(--text); border-color: var(--line); box-shadow: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.btn--secondary:hover, .btn--quiet:hover { background: rgba(255,255,255,0.1); border-color: var(--line-2); box-shadow: none; }
.btn--quiet { border-color: transparent; }
.btn--small { padding: 9px 16px; font-size: 0.85rem; }

/* layout */
main { flex: 1; padding: 72px 0 96px; }
.hero { display: grid; gap: 22px; margin-bottom: 48px; }
.hero__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.steps li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 0.85rem; color: var(--muted); }
.steps li b { font-family: var(--display); color: var(--electric); }

.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.stack > * + * { margin-top: 18px; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.card__title { font-family: var(--display); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.card__meta, .panel__meta { font-size: 0.85rem; color: var(--muted); margin: 4px 0 0; }

/* upload */
.upload { display: grid; grid-template-columns: 1.6fr 1fr; grid-template-areas: "drop consent" "drop sample" "drop trust" "drop ."; grid-template-rows: auto auto auto 1fr; gap: 18px; }
.upload .drop { grid-area: drop; }
.upload .consent { grid-area: consent; }
.upload .sample { grid-area: sample; }
.upload .trust { grid-area: trust; }
.drop {
  position: relative; overflow: hidden; display: grid; place-items: center; text-align: center;
  min-height: 380px; padding: 48px 28px; border-radius: var(--radius);
  border: 1.5px dashed rgba(35,246,123,0.4); background: radial-gradient(120% 90% at 50% 0%, rgba(35,246,123,0.1), transparent 60%), var(--card);
  transition: border-color .2s, background .2s, transform .2s;
}
.drop--over { border-color: var(--electric); background: radial-gradient(120% 90% at 50% 0%, rgba(35,246,123,0.22), transparent 70%), var(--card-2); transform: scale(1.01); }
.drop__icon {
  width: 76px; height: 76px; margin: 0 auto 22px; border-radius: 24px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--electric), var(--electric-2)); color: #000;
  box-shadow: 0 20px 60px -15px var(--electric);
}
.drop__icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drop h2 { margin-bottom: 10px; }
.drop p { color: var(--muted); max-width: 46ch; margin: 0 auto; }
.drop__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 26px 0 18px; }
.drop__fine { font-size: 0.8rem; }

.consent { padding: 22px; }
.consent p { font-size: 0.82rem; color: var(--muted); margin: 12px 0 0; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.92rem; }
.check input { appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0; border-radius: 7px; border: 1.5px solid var(--line-2); background: rgba(255,255,255,0.04); cursor: pointer; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.check input:checked { background: var(--electric); border-color: var(--electric); }
.check input:checked::after { content: ""; width: 6px; height: 11px; border: solid #000; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }

.sample { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding: 18px; }
.sample__image { width: 96px; height: 120px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.sample__title { font-family: var(--display); font-weight: 700; margin-bottom: 4px; }
.sample__text { font-size: 0.82rem; color: var(--muted); margin: 0 0 12px; }

.trust { display: grid; gap: 12px; padding: 22px; font-size: 0.88rem; color: var(--muted); }
.trust div { display: flex; gap: 10px; align-items: center; }
.trust b { color: var(--text); font-weight: 600; }
.trust svg { flex: none; width: 18px; height: 18px; stroke: var(--electric); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* progress */
.progress-card { max-width: 720px; margin: 0 auto; text-align: center; padding: 56px 32px; }
.spinner { width: 64px; height: 64px; margin: 0 auto 24px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.08); border-top-color: var(--electric); border-right-color: var(--electric-2); animation: spin 1s linear infinite; box-shadow: 0 0 40px -10px var(--electric); }
@keyframes spin { to { transform: rotate(360deg); } }
.progress__bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; margin: 26px 0 14px; }
.progress__fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--electric), var(--electric-2)); box-shadow: 0 0 20px var(--electric); transition: width .4s cubic-bezier(.16,1,.3,1); }
.progress__text { display: flex; justify-content: space-between; gap: 12px; font-size: 0.88rem; color: var(--muted); }
.progress__text span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* result */
.strip { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; margin-bottom: 18px; }
.strip__cell { padding: 22px; border-right: 1px solid var(--line); min-width: 0; }
.strip__cell:last-child { border-right: 0; }
.strip__cell--lead { background: radial-gradient(120% 140% at 0% 0%, rgba(35,246,123,0.16), transparent 70%); }
.strip__label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.strip__value { font-family: var(--display); font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 700; letter-spacing: -0.03em; margin-top: 6px; }
.strip__value--lead { color: var(--electric); }

.work { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.work__aside { position: sticky; top: 96px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.photo { position: relative; display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(255,255,255,0.03); transition: border-color .2s, opacity .2s; }
.photo:hover { border-color: var(--line-2); }
.photo--excluded { opacity: 0.55; }
.photo__toggle { position: absolute; top: 8px; left: 8px; z-index: 1; width: 20px; height: 20px; accent-color: var(--electric); cursor: pointer; }
.photo__thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--bg-2); }
.photo__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.photo__name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo__line, .photo__counts { font-size: 0.78rem; color: var(--muted); }
.photo__state { align-self: flex-start; margin-top: 4px; font-size: 0.7rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: rgba(35,246,123,0.14); color: var(--electric); }
.photo__state--excluded { background: rgba(255,255,255,0.06); color: var(--muted); }

.elevation { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 8px; padding: 18px; border-radius: var(--radius-sm); background: rgba(0,0,0,0.3); border: 1px solid var(--line); }
.front { border-radius: 6px; animation: pop .4s cubic-bezier(.16,1,.3,1) both; }
.front--door { height: 64px; background: linear-gradient(160deg, rgba(35,246,123,0.9), rgba(35,246,123,0.45)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 6px 20px -8px var(--electric); }
.front--drawer { height: 26px; align-self: end; background: linear-gradient(160deg, rgba(0,212,255,0.9), rgba(0,212,255,0.45)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 6px 20px -8px var(--electric-2); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.elevation__empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 0.88rem; padding: 18px; }
.legend { display: flex; gap: 22px; margin-top: 14px; font-size: 0.88rem; color: var(--muted); }
.legend__item { display: inline-flex; align-items: center; gap: 8px; }
.legend__swatch { width: 12px; height: 12px; border-radius: 4px; }
.legend__swatch--door { background: var(--electric); }
.legend__swatch--drawer { background: var(--electric-2); }
.legend__value { color: var(--text); font-weight: 600; }

.estimate { overflow: hidden; border-color: rgba(35,246,123,0.35); background: radial-gradient(140% 80% at 100% 0%, rgba(35,246,123,0.16), transparent 60%), radial-gradient(120% 80% at 0% 100%, rgba(0,212,255,0.08), transparent 60%), var(--card); }
.estimate__heading { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--electric); }
.estimate__total { font-family: var(--display); font-size: clamp(2.6rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; margin: 10px 0 4px; }
.estimate__vat { padding: 14px 0; border-bottom: 1px solid var(--line); }
.estimate__vat-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; }
.estimate__vat-row .num { font-weight: 600; }
.estimate__vat-note { font-size: 0.78rem; color: var(--muted); margin: 8px 0 0; }
.estimate__validity { font-size: 0.85rem; color: var(--muted); margin-top: 14px; }
.estimate__ref { display: flex; justify-content: space-between; margin: 8px 0 0; font-size: 0.85rem; }
.estimate__ref dt { color: var(--muted); }
.estimate__ref dd { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: 0.02em; }
.estimate__disclaimer { font-size: 0.75rem; color: var(--muted); margin: 16px 0 20px; line-height: 1.55; }
.estimate__actions { display: grid; gap: 10px; }

.fields { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.field small { font-size: 0.75rem; color: var(--muted); }
.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,0.3);
  color: var(--text); font: inherit; font-size: 0.95rem; transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--electric); box-shadow: 0 0 0 4px rgba(35,246,123,0.15); }
textarea.input { resize: vertical; min-height: 88px; }

/* notices */
#notices:not(:empty), #gate-notice:not(:empty) { margin-bottom: 18px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card-2); font-size: 0.92rem; }
.notice__icon { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.notice--error { border-color: rgba(255,107,107,0.4); color: #ffb3b3; background: rgba(255,107,107,0.08); }
.notice--warning { border-color: rgba(255,200,87,0.4); color: #ffe0a3; background: rgba(255,200,87,0.08); }
.notice--ok { border-color: rgba(35,246,123,0.4); color: #a6ffcb; background: rgba(35,246,123,0.08); }

/* admin */
.gate { max-width: 440px; margin: 40px auto 0; text-align: center; padding: 40px 32px; }
.gate h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.gate .field { text-align: left; margin: 26px 0 16px; }
.gate .btn { width: 100%; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 28px 0 18px; }
.count { text-align: left; padding: 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; }
.count[aria-pressed="true"] { border-color: rgba(35,246,123,0.5); background: rgba(35,246,123,0.08); }
.count__label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.count__value { font-family: var(--display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; }
.table-wrap { overflow-x: auto; margin: 0 -28px; padding: 0 28px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 760px; }
.table th { text-align: left; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(255,255,255,0.03); }
.table .num { text-align: right; }
.table__ref { font-family: var(--display); font-weight: 700; }
.table__sub { font-size: 0.75rem; color: var(--muted); }
.pill { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(35,246,123,0.14); color: var(--electric); }
.pill--bedroom { background: rgba(0,212,255,0.14); color: var(--electric-2); }
.pill--mixed { background: rgba(255,200,87,0.14); color: var(--warning); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings .card--wide { grid-column: 1 / -1; }
.save-bar { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 18px; }
.saved { color: var(--electric); font-weight: 600; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* legal */
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.3rem; margin: 30px 0 8px; }
.prose p { color: var(--muted); }

/* footer */
footer.site { border-top: 1px solid var(--line); padding: 28px 0; font-size: 0.85rem; color: var(--muted); }
footer.site .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.site nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer.site a { text-decoration: none; }
footer.site a:hover { color: var(--text); }

.print-only { display: none; }

/* touch vs mouse wording */
.on-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .on-touch { display: inline; }
  .on-pointer { display: none !important; }
  .btn--small { padding: 12px 18px; }
  .photo__toggle { width: 24px; height: 24px; }
}

/* admin quotes */
.quote-list { display: grid; gap: 8px; }
.quote-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; font: inherit; color: var(--text); cursor: pointer; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(255,255,255,0.03); transition: border-color .2s, background .2s; }
.quote-row:hover { border-color: rgba(35,246,123,0.4); background: rgba(35,246,123,0.05); }
.quote-row__main { display: grid; gap: 2px; min-width: 0; }
.quote-row__who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-row__side { display: grid; justify-items: end; gap: 6px; flex: none; }
.quote-row__total { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }

.sheet-dialog { width: min(760px, 100% - 32px); max-height: min(90vh, 100%); padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); color: var(--text); overflow: hidden; }
.sheet-dialog::backdrop, .viewer::backdrop { background: rgba(0,0,0,0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet-dialog[open] { display: flex; flex-direction: column; }
.sheet-dialog__close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.sheet-dialog__body { overflow-y: auto; padding: 28px; overscroll-behavior: contain; }
.detail__total { font-family: var(--display); font-size: 2.2rem; font-weight: 700; letter-spacing: -0.03em; color: var(--electric); }
.detail__total .muted { font-size: 0.9rem; font-family: "Inter", sans-serif; font-weight: 500; letter-spacing: 0; }
.detail__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.detail__grid > div { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); }
.detail__num { font-family: var(--display); font-size: 1.5rem; font-weight: 700; }
.detail__contact { display: grid; gap: 4px; margin-bottom: 12px; }
.detail__contact .muted { display: inline-block; min-width: 80px; }
.detail__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 0.88rem; }
.detail__list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.detail__list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery__item { aspect-ratio: 3 / 4; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); cursor: zoom-in; display: grid; place-items: center; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.gallery__loading { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--electric); animation: spin 1s linear infinite; }
.viewer { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; cursor: zoom-out; }
.viewer img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 12px; }

/* phone price bar */
.mobile-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 999px; border: 1px solid rgba(35,246,123,0.4); background: rgba(17,19,23,0.85); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 20px 50px -20px #000; }
.mobile-bar__total { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--electric); line-height: 1.1; }
@media (min-width: 1001px) { .mobile-bar { display: none !important; } }

@media (max-width: 1000px) {
  .upload { grid-template-columns: 1fr; grid-template-areas: "consent" "drop" "sample" "trust"; grid-template-rows: none; }
  .work { display: flex; flex-direction: column; }
  .work > .stack, .work__aside { display: contents; }
  .work > .stack > *, .work__aside > * { margin-top: 0 !important; width: 100%; }
  #estimate-card { order: 1; }
  .work > .stack > :first-child { order: 2; }
  .work > .stack > :last-child { order: 3; }
  .details-card { order: 4; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip__cell { border-bottom: 1px solid var(--line); }
  .strip__cell--lead { grid-column: 1 / -1; }
  .settings { grid-template-columns: 1fr; }
  .hero__top > div:last-child { align-items: flex-start !important; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  header.site { top: 8px; margin-top: 8px; width: calc(100% - 16px); }
  header.site .bar { padding: 6px 6px 6px 16px; }
  header.site nav a { padding: 8px 11px; font-size: 0.85rem; }
  header.site nav a[aria-current="page"], .status, .brand small { display: none; }
  header.site nav:has(a[href="/quotes"]) .cta { display: none; }
  main { padding: 36px 0 110px; }
  h1 { font-size: clamp(2.5rem, 13vw, 3.4rem); }
  .hero { margin-bottom: 26px; gap: 14px; }
  .steps { display: none; }
  .lead { font-size: 1rem; }
  .card { padding: 18px; }
  .drop { min-height: 0; padding: 30px 18px; }
  .drop__icon { width: 60px; height: 60px; border-radius: 18px; margin-bottom: 16px; }
  .drop__actions .btn { width: 100%; }
  .row { grid-template-columns: 1fr; }
  .strip__cell { padding: 14px 16px; }
  .strip__value { font-size: 1.4rem; }
  .photos { grid-template-columns: 1fr; }
  .elevation { grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 6px; padding: 12px; }
  .front--door { height: 48px; }
  .front--drawer { height: 20px; }
  .estimate__total { font-size: 2.6rem; }
  .input { font-size: 16px; } /* stops iOS zooming into fields */
  .counts { grid-template-columns: repeat(2, 1fr); }
  .count__value { font-size: 1.35rem; }
  .gate { padding: 28px 20px; margin-top: 16px; }
  .save-bar { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }
  .save-bar .btn { flex: 1; }
  .sheet-dialog { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
  .sheet-dialog__body { padding: 22px 18px calc(28px + env(safe-area-inset-bottom)); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .quote-row { padding: 12px 14px; }
  footer.site { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  footer.site .wrap { flex-direction: column; }
  /* results on phones: lead with the estimate card, not the page heading */
  body:has(#step-result:not([hidden])) .hero h1, body:has(#step-result:not([hidden])) .hero .lead, body:has(#step-result:not([hidden])) .hero .eyebrow { display: none; }
  body:has(#step-result:not([hidden])) .hero { margin-bottom: 14px; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip__cell:first-child { display: none; }
  .strip__cell { border-right: 0; }
  .strip__cell { border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* manual counts for photos where nothing was detected */
.photo--manual { grid-column: 1 / -1; border-color: rgba(255,200,87,0.35); opacity: 1; }
.photo__manual { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); }
.photo__manual p { margin: 0 0 10px; font-size: 0.85rem; color: #ffe0a3; }
.photo__manual-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.photo__manual-row label { display: grid; gap: 4px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.photo__manual-row .input { width: 96px; padding: 9px 12px; }
@media print { .photo__manual { display: none; } }

/* Face ID style scan ring */
.progress-card .progress__bar { display: none; }
.scan { position: relative; width: 148px; height: 148px; margin: 0 auto 28px; }
.scan__halo { position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle, rgba(35,246,123,0.28), transparent 70%); filter: blur(14px); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.18); opacity: 0.55; } }
.scan__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.scan__ticks line { stroke: rgba(255,255,255,0.13); stroke-width: 3.2; stroke-linecap: round; transform-origin: 60px 60px; transition: stroke .45s cubic-bezier(.2,.8,.2,1), opacity .4s ease, transform .5s cubic-bezier(.2,.8,.2,1); animation: sweep 1.8s linear infinite; animation-delay: calc(var(--i) * -1.8s / 56); }
.scan__ticks line.on { stroke: var(--electric); animation: none; filter: drop-shadow(0 0 3px rgba(35,246,123,0.9)); }
@keyframes sweep { 0%, 100% { stroke: rgba(255,255,255,0.13); } 8% { stroke: rgba(255,255,255,0.55); } 20% { stroke: rgba(255,255,255,0.13); } }
.scan__ring { fill: none; stroke: var(--electric); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transform: rotate(-90deg); transform-origin: 60px 60px; filter: drop-shadow(0 0 6px rgba(35,246,123,0.7)); }
.scan__check { fill: none; stroke: var(--electric); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.scan__glyph { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%); fill: none; stroke: rgba(255,255,255,0.85); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; transition: opacity .3s ease, transform .4s cubic-bezier(.2,.8,.2,1); }
.scan__line { fill: var(--electric); stroke: none; filter: drop-shadow(0 0 6px var(--electric)); animation: scanline 1.6s cubic-bezier(.45,0,.55,1) infinite alternate; }
@keyframes scanline { from { transform: translateY(0); } to { transform: translateY(33px); } }
.scan.done .scan__ticks line { opacity: 0; transform: scale(0.82); }
.scan.done .scan__ring { stroke-dashoffset: 0; transition: stroke-dashoffset .6s cubic-bezier(.65,0,.35,1); }
.scan.done .scan__check { stroke-dashoffset: 0; transition: stroke-dashoffset .38s .5s cubic-bezier(.65,0,.35,1); }
.scan.done .scan__glyph { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
.scan.done .scan__halo { animation: none; opacity: 0.9; transform: scale(1.25); transition: all .6s ease; }
.scan.done { animation: scanPop .55s .55s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes scanPop { 40% { transform: scale(1.07); } 100% { transform: scale(1); } }
#scan-title { transition: color .3s ease; }
.progress-card:has(.scan.done) #scan-title { color: var(--electric); }

/* pieces + count check */
.estimate__pieces { font-size: 0.9rem; margin-bottom: 4px; }
.confirm { margin: 16px 0 4px; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(0,0,0,0.25); }
.confirm__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.88rem; font-weight: 600; margin-bottom: 12px; }
.confirm__badge { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: rgba(35,246,123,0.15); color: var(--electric); }
.confirm--done .confirm__badge { background: var(--electric); color: #000; }
.confirm__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.confirm__grid label { display: grid; gap: 4px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.confirm__grid .input { padding: 10px 12px; font-size: 16px; }
.confirm__hint { font-size: 0.75rem; color: var(--muted); margin: 10px 0 12px; }
.btn--block { width: 100%; }
.legend__swatch--extra { background: var(--warning); }
.front--extra { height: 40px; align-self: end; background: linear-gradient(160deg, rgba(255,200,87,0.9), rgba(255,200,87,0.45)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 6px 20px -8px var(--warning); }

@media (max-width: 720px) { .detail__grid { grid-template-columns: repeat(2, 1fr); } }

/* details before the price */
.details-gate { max-width: 560px; margin: 0 auto; padding: 34px; animation: rise .6s cubic-bezier(.16,1,.3,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.details-gate h2 { margin-top: 6px; }
.details-gate .muted { margin: 0 0 20px; }
.details-gate__price { font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 8vw, 3.6rem); letter-spacing: -0.04em; color: var(--electric); filter: blur(14px); user-select: none; margin: 4px 0 10px; line-height: 1.1; }
.details-gate__hint { font-size: 0.8rem; color: var(--muted); margin: 0; }
.details-gate__hint--error { color: #ffb3b3; }
.field--error .input { border-color: rgba(255,107,107,0.7); box-shadow: 0 0 0 4px rgba(255,107,107,0.12); }
@media (max-width: 720px) { .details-gate { padding: 22px 18px; } }

.btn--done, .btn--done:hover { background: rgba(35,246,123,0.14); color: var(--electric); box-shadow: none; transform: none; cursor: default; }
.details-gate__optout { font-size: 0.78rem; color: var(--muted); }
.details-gate__optout input { width: 18px; height: 18px; border-radius: 5px; }

/* Save as PDF: a dedicated, light A4 estimate */
.print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 14mm 14mm 12mm; }
  html, body { background: #fff !important; }
  body { display: block; min-height: 0; color: #111; font: 10.5pt/1.5 "Inter", Arial, sans-serif; }
  body::before, body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; color: #111; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 14px; border-bottom: 3px solid #111; }
  .ps-brand { font: 700 22pt/1 "Space Grotesk", Arial, sans-serif; letter-spacing: -0.03em; }
  .ps-brand b { color: #12b75a; }
  .ps-sub { margin-top: 6px; color: #666; font-size: 9pt; }
  .ps-meta { text-align: right; font-size: 9.5pt; }
  .ps-meta span { color: #888; margin-right: 6px; }
  .ps-doc { font: 700 15pt/1.2 "Space Grotesk", Arial, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 4px; }
  .ps-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 18px 0; font-size: 9.5pt; color: #333; }
  .ps-label { font-size: 7.5pt; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #888; margin-bottom: 6px; }
  .ps-strong { font-weight: 700; color: #111; font-size: 11pt; }
  .ps-total { display: flex; justify-content: space-between; align-items: flex-end; padding: 18px 20px; border-radius: 10px; background: #f2fbf6; border: 1px solid #cdeedb; margin-bottom: 18px; }
  .ps-price { font: 700 30pt/1 "Space Grotesk", Arial, sans-serif; letter-spacing: -0.03em; }
  .ps-pieces { color: #2d6a46; font-weight: 600; }
  .ps-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
  .ps-table th { text-align: left; font-size: 7.5pt; letter-spacing: 0.14em; text-transform: uppercase; color: #888; padding: 0 0 8px; border-bottom: 1.5px solid #111; }
  .ps-table td { padding: 9px 0; border-bottom: 1px solid #eee; }
  .ps-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 1.5px solid #111; }
  .ps-num { text-align: right; width: 70px; }
  .ps-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
  .ps-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; break-inside: avoid; }
  .ps-next { padding: 14px 16px; border-left: 3px solid #12b75a; background: #fafafa; margin-bottom: 16px; break-inside: avoid; }
  .ps-foot { font-size: 8pt; color: #888; border-top: 1px solid #eee; padding-top: 10px; break-inside: avoid; }
}

/* Quotes: filters as chips above the list */
.counts--filters { display: flex; gap: 8px; margin: 0 0 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.counts--filters::-webkit-scrollbar { display: none; }
.counts--filters .count { flex: none; display: flex; align-items: baseline; gap: 8px; padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.counts--filters .count__label { font-size: 0.72rem; letter-spacing: 0.06em; }
.counts--filters .count__value { font-size: 1rem; margin: 0; }
.counts--filters .count--static { cursor: default; margin-left: auto; }
.counts--filters .count[aria-pressed="true"] .count__label { color: var(--electric); }

/* sheet: the page behind never scrolls */
html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-dialog__body { padding-top: 64px; }
.sheet-dialog__close { top: 12px; right: 12px; }

/* Phones: drop the expensive effects (huge animated blurs, grain overlay, live background blur) */
@media (max-width: 720px), (pointer: coarse) {
  .mist { display: none; }
  body::before { display: none; }
  body { background: radial-gradient(120% 60% at 100% 0%, rgba(35,246,123,0.10), transparent 60%), radial-gradient(100% 50% at 0% 100%, rgba(0,212,255,0.06), transparent 60%), var(--bg); background-attachment: scroll; }
  .card, .btn--secondary, .btn--quiet, .steps li { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .card { background: #15171b; }
  header.site { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(10,11,13,0.96); }
  .sheet-dialog::backdrop, .viewer::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(0,0,0,0.8); }
  .front { animation: none; }
  .quote-row { background: #1a1c21; }
  .counts--filters .count--static { margin-left: 0; }
}

#app > .lead + .card { margin-top: 22px; }
