/* ObraMano public site. Warm, direct, built for a phone held in one hand.
   Terracotta #C2410C on offwhite #FAF8F5, ink #1C1410 (BUILD-LOG brand
   conventions). The accent variable keeps the fork's --green NAME so every
   downstream rule re-themes in one place; its VALUE is terracotta. */

/* Light is the brand-forward default: warm offwhite paper, terracotta, warm ink. */
:root {
  color-scheme: light;
  --bg: #faf8f5;
  --bg-2: #f3eee8;
  --surface: #ffffff;
  --surface-2: #f6f1eb;
  --surface-3: #efe7de;
  --glass: rgba(252, 250, 247, 0.74);
  --ink: #1c1410;
  --ink-display: #1c1410;
  --ink-2: #463a30;
  --muted: #6b5d52;
  /* WCAG AA: >=4.5:1 on every light surface (bg, panel white, surface-2/3). */
  --faint: #6f6155;
  /* Placeholders only: deliberately dimmer than --faint (a real label sits
     above every field) so an empty input can't pass for a filled one. */
  --placeholder: #a79a8a;
  --line: #eae2da;
  --line-2: #d9cec3;
  --track: #e8e0d7;
  --green: #c2410c;
  --green-bright: #9a3412;
  --green-ink: #ffffff;
  --green-soft: rgba(194, 65, 12, 0.09);
  --green-line: rgba(194, 65, 12, 0.28);
  --honey: #b07f2e;
  /* Dark enough for AA small text on the honey-soft pills (chips). */
  --honey-bright: #7d5717;
  --honey-soft: rgba(176, 127, 46, 0.12);
  --honey-line: rgba(176, 127, 46, 0.3);
  --blue: #3f72a8;
  --red: #b6493c;
  --amber: #a8782a;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1080px;
  --shadow: 0 24px 60px -28px rgba(28, 20, 16, 0.22);
  --shadow-sm: 0 12px 30px -18px rgba(28, 20, 16, 0.16);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Dark: warm near-black (roofing-tar, not navy), off-white text, ember accent. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181210;
  --bg-2: #100c0a;
  --surface: #221a16;
  --surface-2: #2a201b;
  --surface-3: #332720;
  --glass: rgba(34, 26, 22, 0.6);
  --ink: #f4ede7;
  --ink-display: #faf5f0;
  --ink-2: #d9ccc2;
  --muted: #a8988c;
  /* AA >=4.5:1 against every dark surface (see the light-theme note). */
  --faint: #a3937f;
  /* See the light-theme note: placeholders sit a clear step below --faint. */
  --placeholder: #75675a;
  --line: #342a22;
  --line-2: #463931;
  --track: #3a2e26;
  --green: #f97316;
  --green-bright: #fb923c;
  --green-ink: #2a1205;
  --green-soft: rgba(249, 115, 22, 0.13);
  --green-line: rgba(249, 115, 22, 0.32);
  --honey: #e0b36a;
  --honey-bright: #efc886;
  --honey-soft: rgba(224, 179, 106, 0.14);
  --honey-line: rgba(224, 179, 106, 0.3);
  --blue: #7fb3f0;
  --red: #ef8a7d;
  --amber: #e0b24a;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.72);
  --shadow-sm: 0 12px 30px -18px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1000px 580px at 84% -12%, rgba(176, 127, 46, 0.1), transparent 60%),
    radial-gradient(820px 520px at 8% 2%, rgba(194, 65, 12, 0.10), transparent 58%),
    radial-gradient(900px 600px at 10% 106%, rgba(176, 127, 46, 0.08), transparent 60%),
    radial-gradient(1200px 760px at 62% 124%, rgba(194, 65, 12, 0.08), transparent 60%);
}

:root[data-theme="dark"] body::before {
  background:
    radial-gradient(1000px 580px at 84% -12%, rgba(224, 179, 106, 0.12), transparent 60%),
    radial-gradient(820px 520px at 8% 2%, rgba(46, 184, 170, 0.08), transparent 58%),
    radial-gradient(900px 600px at 10% 106%, rgba(224, 179, 106, 0.06), transparent 60%),
    radial-gradient(1200px 760px at 62% 124%, rgba(46, 184, 170, 0.07), transparent 60%);
}

a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.16s ease;
}

a:hover {
  color: var(--green-bright);
}

h1,
h2,
h3,
p {
  margin: 0;
}

::selection {
  background: var(--green-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 70%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- buttons ---------- */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--green);
  background-image: linear-gradient(180deg, var(--green-bright), var(--green));
  color: var(--green-ink);
  font: inherit;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease,
    border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

a.button {
  color: var(--green-ink);
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -10px rgba(17, 148, 138, 0.6);
  color: var(--green-ink);
}

button:active,
.button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button + button {
  margin-left: 8px;
}

.button.secondary,
.secondary-button,
button.ghost {
  background: transparent;
  background-image: none;
  border-color: var(--line-2);
  color: var(--ink);
}

.button.secondary:hover,
.secondary-button:hover,
button.ghost:hover {
  border-color: var(--green-line);
  background: var(--surface-2);
  box-shadow: none;
  color: var(--ink);
}

.button.ghost {
  background: transparent;
  background-image: none;
  border-color: var(--line-2);
  color: var(--ink);
}

button.danger {
  background: transparent;
  background-image: none;
  border-color: rgba(239, 125, 112, 0.45);
  color: var(--red);
}

button.danger:hover {
  background: rgba(239, 125, 112, 0.1);
  border-color: var(--red);
  color: var(--red);
  box-shadow: none;
}

/* ---------- layout shells ---------- */

.landing,
.auth,
.settings,
.onboarding,
.admin,
.doc,
.home,
.capture,
.editor {
  width: min(var(--maxw), calc(100vw - 40px));
  margin: 0 auto;
  padding: 0 0 72px;
}

/* ---------- nav ---------- */

nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 8px;
  padding: 16px 4px;
}

nav::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  z-index: -1;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

nav > strong,
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  flex: none;
}

.brand-bubble {
  width: 26px;
  height: 26px;
  color: var(--green);
  filter: drop-shadow(0 2px 4px rgba(194, 65, 12, 0.28));
}

nav span,
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a {
  color: var(--ink-2);
  font-weight: 550;
  white-space: nowrap;
}

nav a:not(.button) {
  padding: 7px 11px;
  border-radius: 8px;
}

nav a:not(.button):hover {
  color: var(--ink);
  background: var(--surface-2);
}

nav .button {
  padding: 9px 15px;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.theme-toggle:hover {
  color: var(--green);
  border-color: var(--green-line);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .ic-moon {
  fill: currentColor;
  stroke: none;
}

.theme-toggle .ic-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .ic-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .ic-moon {
  display: none;
}

/* ---------- hero ---------- */

.hero {
  max-width: 760px;
  padding: 56px 0 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 44px;
  padding: 60px 0 36px;
  position: relative; /* anchors the full-width hero word-field behind everything */
}

.hero-copy {
  max-width: 560px;
  position: relative;
  z-index: 1; /* headline sits above the word-field */
}

.eyebrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--green-line);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-bright);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eyebrow-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(17, 148, 138, 0.2);
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 680;
  background: linear-gradient(180deg, var(--ink-display) 0%, var(--ink) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h1 .accent {
  background: linear-gradient(180deg, var(--green-bright), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hero p,
.lede {
  max-width: 52ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.actions,
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-actions .button {
  padding: 12px 20px;
  font-size: 15px;
}

.actions a:not(.button),
.hero-actions a:not(.button) {
  color: var(--ink-2);
  font-weight: 550;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trust-row svg {
  width: 16px;
  height: 16px;
  stroke: var(--green);
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* On phones, center the trust chips and tighten the gaps so they sit neatly
   under the centered hero copy instead of strung along the left edge. */
@media (max-width: 640px) {
  .trust-row {
    justify-content: center;
    text-align: center;
    gap: 8px 18px;
  }
}

/* ---------- hero phone (the client's side: a real bot conversation) ---------- */

.hero-shot {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.phone {
  width: min(340px, 88vw);
  border: 1px solid var(--line-2);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1.2deg);
}

.phone-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.phone-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-bright));
  color: var(--green-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.phone-top strong { display: block; font-size: 14.5px; letter-spacing: -0.01em; }

.phone-top .phone-presence {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.phone-chat {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px 14px;
  background:
    radial-gradient(420px 300px at 90% 0%, var(--green-soft), transparent 70%),
    var(--bg);
}

.msg {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.42;
}

.msg small { display: block; margin-top: 3px; color: inherit; opacity: 0.78; font-size: 12px; }

.msg.in {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: var(--green);
  color: var(--green-ink);
  font-weight: 550;
}

.msg.out {
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
}

.phone-foot {
  padding: 9px 14px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--faint);
  font-size: 11.5px;
  text-align: center;
}

/* ---------- closing CTA band ---------- */

.cta-band {
  margin: 0 0 26px;
  padding: 52px 28px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius);
  background:
    radial-gradient(640px 300px at 50% -40%, var(--green-soft), transparent 70%),
    var(--surface);
  text-align: center;
}

.cta-band h2 { font-size: clamp(24px, 3.6vw, 34px); letter-spacing: -0.025em; max-width: 21ch; margin: 0 auto; }

.cta-band p { max-width: 52ch; margin: 12px auto 0; color: var(--muted); font-size: 16px; }

.cta-band .hero-actions { justify-content: center; }

/* keep the legacy image hidden if present, the CSS preview replaces it */
.hero-visual {
  display: none;
}

/* ---------- section heads ---------- */

.section {
  position: relative;
  padding: 92px 0;
  border-top: 1px solid var(--line);
}

/* (Section tint removed - it created a hard-edged band clipped to the content
   width. Rhythm now comes from the hairline dividers, spacing, and the soft
   full-viewport body washes, which have no hard edges.) */

.define-section,
.demo-section {
  padding: 116px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 34px;
}

.section-head h2 {
  margin: 8px 0 10px;
  font-size: clamp(26px, 3.2vw, 34px);
  letter-spacing: -0.03em;
  font-weight: 660;
}

.section-head p {
  color: var(--muted);
  font-size: 16px;
}

/* ---------- features ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.features article,
.feature-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.features article:hover,
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--green-line);
  box-shadow: 0 26px 50px -28px rgba(0, 0, 0, 0.8);
}

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
  margin-bottom: 4px;
}

.feature-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.features h2,
.feature-card h2 {
  font-size: 17px;
  font-weight: 640;
}

.features p,
.feature-card p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}

.step h2 {
  font-size: 16px;
  font-weight: 640;
}

.step p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.step code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---------- generic panels / forms ---------- */

.panel,
form {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel h1,
.panel h2 {
  background: none;
  -webkit-background-clip: border-box;
  color: var(--ink);
}

.panel p {
  color: var(--muted);
}

input,
select,
textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

/* Placeholders must read as HINTS, not as content: at --faint they sat too
   close to real input text at 390px, so an empty "Title in English" field
   (placeholder "Interior Painting - Two Bedrooms") looked filled. Dimmer +
   italic makes "still empty" unmistakable; the label above carries AA. */
input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
  font-style: italic;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green-line);
  box-shadow: 0 0 0 3px var(--green-soft);
  background: var(--surface);
}

textarea {
  line-height: 1.5;
  resize: vertical;
}

label {
  color: var(--ink-2);
}

/* ---------- auth ---------- */

.auth {
  max-width: 432px;
  padding-top: 36px;
}

.auth-status {
  text-align: center;
  padding: 32px 28px;
}
.auth-status .status-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--green-soft);
  border: 1px solid var(--green-line, var(--green));
  color: var(--green);
}
.auth-status .status-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-status .eyebrow { margin-bottom: 8px; }
.auth-status h1 { margin: 0 0 8px; }
.auth-status > p { color: var(--ink-2, var(--muted)); }
.auth-status .button { margin-top: 18px; }

.auth > a:first-child,
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth form {
  display: grid;
  gap: 14px;
  padding: 28px;
}

.auth form h1 {
  margin: 0 0 4px;
  font-size: 26px;
  letter-spacing: -0.03em;
  font-weight: 680;
  background: none;
  color: var(--ink);
}

.auth form > p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-sub {
  margin: 0 0 6px !important;
  color: var(--muted);
  font-size: 14.5px;
}

[data-invite-field][hidden] {
  display: none;
}

.auth form > p a {
  font-weight: 600;
}

.auth button[type="submit"],
.auth form button:not(.ghost) {
  margin-top: 4px;
  width: 100%;
  padding: 12px;
}

#message {
  min-height: 0;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
}

#message:not(:empty) {
  margin-top: 2px;
}

.fine-print {
  margin: 0;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- pricing ---------- */

.pricing-hero {
  max-width: 760px;
  padding: 48px 0 12px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 28px;
}

.pricing-grid article {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.pricing-grid article.popular {
  border-color: var(--green-line);
  background: linear-gradient(180deg, rgba(17, 148, 138, 0.07), var(--surface) 42%);
  box-shadow: 0 30px 60px -34px rgba(17, 148, 138, 0.45);
}

.plan-badge {
  align-self: flex-start;
  margin-bottom: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green-bright);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pricing-grid h2 {
  font-size: 18px;
}

.price {
  margin: 10px 0 8px;
  font-size: 40px;
  font-weight: 720;
  letter-spacing: -0.03em;
  line-height: 1;
}

.price span {
  font-size: 15px;
  font-weight: 550;
  color: var(--muted);
  letter-spacing: 0;
}

.pricing-grid p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.plan-features {
  list-style: none;
  display: grid;
  gap: 9px;
  margin: 14px 0 18px;
  padding: 0;
  width: 100%;
}

.plan-features li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.plan-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
}

.plan-features li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  width: 6px;
  height: 3px;
  border-left: 1.6px solid var(--green);
  border-bottom: 1.6px solid var(--green);
  transform: rotate(-45deg);
}

.pricing-grid .button {
  margin-top: auto;
  width: 100%;
}

.pricing-grid.pricing-solo {
  grid-template-columns: minmax(0, 460px);
  justify-content: center;
}

.pricing-note {
  margin: 18px auto 0;
  max-width: 580px;
  text-align: center;
}

/* ---------- settings / admin ---------- */

.settings,
.admin {
  display: grid;
  /* minmax(0, 1fr): without it the implicit track grows to fit the widest
     child (e.g. a wide admin table), blowing the page out past the phone
     viewport - body overflow-x:clip then hides the nav and CTAs. */
  grid-template-columns: minmax(0, 1fr);
  max-width: 920px;
  gap: 22px;
  padding-top: 8px;
}

/* Grid children default to min-width:auto, which lets wide content (tables,
   long codes) inflate the track instead of scrolling inside their panel. */
.settings > *,
.admin > * {
  min-width: 0;
}

.settings .panel { padding: 22px 24px; }
.settings .panel h1,
.settings .panel h2 { margin: 6px 0 8px; }
.settings .panel > p { margin: 0 0 14px; line-height: 1.55; }
.settings .panel .btn-row { margin-top: 4px; }
/* early-access celebration (subtle, one-time confetti) */
.plan-celebrate { position: relative; overflow: hidden; }
.celebrate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green-line);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti span {
  position: absolute;
  top: -14px;
  width: 7px;
  height: 11px;
  border-radius: 2px;
  opacity: 0;
}
.confetti span:nth-child(odd) { background: var(--green); }
.confetti span:nth-child(even) { background: var(--honey); }
.confetti span:nth-child(3n) { background: var(--green-bright); }
.confetti span:nth-child(1) { left: 6%; animation-delay: 0.02s; }
.confetti span:nth-child(2) { left: 14%; animation-delay: 0.28s; }
.confetti span:nth-child(3) { left: 23%; animation-delay: 0.12s; }
.confetti span:nth-child(4) { left: 31%; animation-delay: 0.42s; }
.confetti span:nth-child(5) { left: 40%; animation-delay: 0.06s; }
.confetti span:nth-child(6) { left: 48%; animation-delay: 0.34s; }
.confetti span:nth-child(7) { left: 57%; animation-delay: 0.18s; }
.confetti span:nth-child(8) { left: 65%; animation-delay: 0.48s; }
.confetti span:nth-child(9) { left: 74%; animation-delay: 0.1s; }
.confetti span:nth-child(10) { left: 82%; animation-delay: 0.38s; }
.confetti span:nth-child(11) { left: 90%; animation-delay: 0.22s; }
.confetti span:nth-child(12) { left: 96%; animation-delay: 0.3s; }
@media (prefers-reduced-motion: no-preference) {
  .plan-celebrate .confetti span { animation: confetti-fall 2.8s cubic-bezier(0.3, 0.7, 0.4, 1) forwards; }
}
@keyframes confetti-fall {
  0% { opacity: 0; transform: translateY(-12px) rotate(0deg); }
  12% { opacity: 0.95; }
  100% { opacity: 0; transform: translateY(240px) rotate(380deg); }
}

.settings-links { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.settings-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.settings-links a:hover { color: var(--ink); }
.settings-status { color: var(--green); font-weight: 600; }
.settings-status:empty { display: none; }

/* the hidden attribute must win over button/display rules */
[hidden] { display: none !important; }

.admin {
  max-width: 1000px;
}

.settings nav,
.admin nav,
.onboarding nav {
  margin-bottom: 4px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.funnel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.funnel-step {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.funnel-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.funnel-num { font-size: 24px; font-weight: 820; letter-spacing: -0.02em; }
.funnel-pct { color: var(--green); font-size: 12px; font-weight: 720; }
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stat-grid article {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.stat-grid span,
.stat-grid em,
.empty-note {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.stat-grid strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.admin-table th,
.admin-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.admin-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.account-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 15px;
}

.account-line .pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green-bright);
  font-family: var(--mono);
  font-size: 12px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.btn-row button {
  margin-left: 0;
}

/* ---------- doc ---------- */

.doc {
  max-width: 720px;
  padding-top: 28px;
  line-height: 1.7;
  color: var(--ink-2);
}

.doc h1 {
  margin: 10px 0 18px;
  font-size: clamp(32px, 4vw, 46px);
}

.doc h2 {
  margin: 28px 0 8px;
  color: var(--ink);
}

.doc p {
  margin: 0 0 14px;
  color: var(--ink-2);
}

.doc strong {
  color: var(--ink);
}

/* ---------- cta band ---------- */

.cta-band {
  margin-top: 72px;
  padding: clamp(52px, 7vw, 88px) clamp(28px, 5vw, 60px);
  border: 1px solid var(--green-line);
  border-radius: var(--radius);
  background:
    radial-gradient(720px 280px at 82% 0%, rgba(232, 182, 92, 0.12), transparent 70%),
    linear-gradient(120deg, rgba(232, 182, 92, 0.07) 0%, rgba(17, 148, 138, 0.12) 100%),
    var(--surface);
}

.cta-band h2 {
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.03em;
  color: var(--ink-display);
}

.cta-band p {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 16px;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta-band .button {
  padding: 14px 26px;
  font-size: 16px;
}

/* ---------- footer ---------- */

footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 14px;
}

footer a {
  color: var(--muted);
  font-weight: 500;
}

footer a:hover {
  color: var(--ink);
}

footer .footer-brand {
  margin-right: auto;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .hero-preview {
    animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .hero-preview {
    animation-delay: 0.08s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 40px 0 24px;
  }

  .steps,
  .pricing-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid article.popular {
    order: -1;
  }
}

@media (max-width: 640px) {
  .features {
    gap: 10px;
  }

  .features article {
    padding: 14px;
    gap: 8px;
  }

  .features h2 {
    font-size: 15px;
  }

  .features p {
    font-size: 13px;
    line-height: 1.45;
  }

  .landing,
  .auth,
  .settings,
  .onboarding,
  .admin,
  .doc {
    width: calc(100vw - 28px);
  }

  nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 4px;
    row-gap: 6px;
  }

  /* Tighten links on small screens so the bar doesn't feel cramped. */
  nav a:not(.button) {
    padding: 6px 8px;
    font-size: 14px;
  }
  nav .button {
    padding: 8px 13px;
    font-size: 14px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .hp-body {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .sticky-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sticky-actions p {
    margin: 0 0 4px;
  }
}

/* ======================================================================
   Stage-7 landing: anchor offsets, the self-playing phone demo, pain
   hooks, demo band, FAQ, WhatsApp door, doc language switch.
   (The fork's old "Parse" art-direction layer lived here - pruned.)
   ====================================================================== */

/* Offset in-page anchor jumps so the sticky nav doesn't cover the heading. */
#pain,
#how,
#why,
#pricing,
#faq,
#demo-band {
  scroll-margin-top: 88px;
}

.ghost-link {
  color: var(--ink-2);
  font-weight: 550;
}

/* ---------- the phone demo plays itself (pure CSS, CSP-safe) ---------- */
.phone-play .pm-1,
.phone-play .pm-2,
.phone-play .pm-3,
.phone-play .pm-4 {
  opacity: 0;
  animation: pm-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.phone-play .pm-1 { animation-delay: 0.5s; }
.phone-play .pm-2 { animation-delay: 1.6s; }
.phone-play .pm-3 { animation-delay: 3.1s; }
.phone-play .pm-4 { animation-delay: 3.9s; }
@keyframes pm-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.pm-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin: 0;
  padding: 2px 0;
  color: var(--muted);
  font-size: 12.5px;
}

.pm-dots {
  display: inline-flex;
  gap: 3px;
}

.pm-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: pm-dot 1.2s ease-in-out infinite;
}
.pm-dots span:nth-child(2) { animation-delay: 0.18s; }
.pm-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes pm-dot {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

/* ---------- pain hooks (the playbook lines) ---------- */
.hook-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.hook-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-sm);
}

.hook-card::before {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: var(--green);
  opacity: 0.85;
}

.hook-quote {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--ink);
}

.hook-card p:not(.hook-quote) {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ---------- demo band ---------- */
.demo-band-inner {
  display: grid;
  gap: 6px;
  padding: 36px 28px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius);
  background:
    radial-gradient(560px 280px at 12% -30%, var(--green-soft), transparent 70%),
    var(--surface);
}

.demo-band .section-head { margin-bottom: 8px; }
.demo-band .hero-actions { margin-top: 10px; }

/* ---------- FAQ (details/summary - no JS) ---------- */
.faq-list {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px; /* full-width thumb target */
  padding: 15px 18px;
  font-weight: 650;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary:hover { color: var(--green-bright); }

.faq-chev {
  flex: none;
  width: 18px;
  height: 18px;
  stroke: var(--green);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-chev { transform: rotate(180deg); }

.faq-item > p {
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 68ch;
}

/* ---------- WhatsApp door (support lives on WhatsApp) ---------- */
/* AA: white on #0e7a4f is 5.4:1 (text), well past 3:1 for the icon. */
.wa-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0e7a4f;
  color: #ffffff;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.45);
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.wa-fab:hover {
  transform: translateY(-2px);
  background: #0b6b45;
  color: #ffffff;
}

.wa-fab svg {
  width: 28px;
  height: 28px;
}

.wa-contact {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  text-align: center;
}

.button.wa-button {
  background: #0e7a4f;
  background-image: none;
  color: #ffffff;
}

.button.wa-button:hover {
  background: #0b6b45;
  color: #ffffff;
  box-shadow: 0 10px 26px -10px rgba(14, 122, 79, 0.6);
}

.wa-button svg {
  width: 19px;
  height: 19px;
}

.wa-or {
  margin: 2px 0 0;
  color: var(--faint);
  font-size: 13px;
}

/* ---------- legal docs: language switch ---------- */
.doc-lang-switch {
  margin: 0 0 8px;
  font-size: 13.5px;
}

/* ---------- stage-7 responsive ---------- */
@media (max-width: 900px) {
  .hook-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .eyebrow-chip {
    margin-bottom: 18px;
  }

  /* One thumb: full-width primary actions in the hero and CTA band. */
  .hero-actions {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .hero-actions .button,
  .hero-actions .ghost-link {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .demo-band-inner {
    padding: 28px 18px;
  }

  .wa-fab {
    right: 14px;
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone-play .pm-1,
  .phone-play .pm-2,
  .phone-play .pm-3,
  .phone-play .pm-4 {
    opacity: 1 !important;
    animation: none !important;
  }

  .pm-dots span {
    animation: none !important;
  }
}

/* ============================================================
   LOADING STATE - admin / settings skeletons + top progress bar
   Keyed on body.is-loading (CSP-safe: JS only toggles the class
   and creates the .page-progress div via createElement).
   ============================================================ */
:root {
  --sk-base: var(--surface-2);
  --sk-hi: color-mix(in srgb, var(--surface-2) 78%, var(--ink) 22%);
}

@keyframes pc-shimmer {
  0% { background-position: 180% 0; }
  100% { background-position: -80% 0; }
}
@keyframes pc-progress { 0% { left: -42%; } 100% { left: 100%; } }

/* Admin: paint faux stat cards + faux table rows into empty panels */
body.is-loading #adminContractors,
body.is-loading #adminSubscriptions,
body.is-loading #adminUsage,
body.is-loading #adminStripeErrors,
body.is-loading #adminJobs {
  min-height: 92px;
  border-radius: var(--radius-sm);
  background-image: linear-gradient(100deg, var(--sk-base) 28%, var(--sk-hi) 48%, var(--sk-base) 68%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: pc-shimmer 1.45s ease-in-out infinite;
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 26px, #0000 26px 44px);
          mask: repeating-linear-gradient(180deg, #000 0 26px, #0000 26px 44px);
}

body.is-loading #adminStats {
  min-height: 96px;
  border-radius: var(--radius-sm);
  background-image: linear-gradient(100deg, var(--sk-base) 28%, var(--sk-hi) 48%, var(--sk-base) 68%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: pc-shimmer 1.45s ease-in-out infinite;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(33.33% - 12px), #0000 calc(33.33% - 12px) 33.33%);
          mask: repeating-linear-gradient(90deg, #000 0 calc(33.33% - 12px), #0000 calc(33.33% - 12px) 33.33%);
}

/* Settings: shimmer the account line while /api/me loads */
body.is-loading #account {
  display: inline-block;
  min-width: 220px;
  min-height: 18px;
  border-radius: 6px;
  color: transparent !important;
  background-image: linear-gradient(100deg, var(--sk-base) 28%, var(--sk-hi) 48%, var(--sk-base) 68%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: pc-shimmer 1.45s ease-in-out infinite;
}

/* Slim top progress bar (shared element, created in JS) */
.page-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px;
  z-index: 200; pointer-events: none; opacity: 0;
  transition: opacity .25s ease; overflow: hidden;
}
.page-progress::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -42%;
  width: 38%; border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, transparent, var(--green-bright));
  box-shadow: 0 0 12px color-mix(in srgb, var(--green) 65%, transparent);
}
body.is-loading .page-progress { opacity: 1; }
body.is-loading .page-progress::before { animation: pc-progress 1.05s ease-in-out infinite; }

/* Busy button: a spinner appended after the (possibly relabeled) text while an
   async action is in flight. Inherits the button's text color. */
@keyframes btn-spin { to { transform: rotate(360deg); } }
button.is-busy,
.button.is-busy {
  cursor: default;
  opacity: 0.9;
}
button.is-busy::after,
.button.is-busy::after {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.5em;
  vertical-align: -0.12em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@media (max-width: 640px) {
  body.is-loading #adminStats {
    -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(50% - 10px), #0000 calc(50% - 10px) 50%);
            mask: repeating-linear-gradient(90deg, #000 0 calc(50% - 10px), #0000 calc(50% - 10px) 50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-loading #adminStats,
  body.is-loading #adminContractors,
  body.is-loading #adminSubscriptions,
  body.is-loading #adminUsage,
  body.is-loading #adminStripeErrors,
  body.is-loading #adminJobs,
  body.is-loading #account {
    animation: none;
    background-image: none;
    background-color: var(--sk-base);
  }
  body.is-loading .page-progress::before { animation: none; left: 0; width: 100%; }
}

/* Keep each hero headline sentence on one line (was wrapping mid-sentence). */
.hero-title { font-size: clamp(32px, 4.5vw, 54px); }
.hero-title .hl { white-space: nowrap; }

/* ---- billing + admin ops ---- */

/* settings plan cards */
.plan-status { font-size: 14.5px; color: var(--ink-2); margin-bottom: 12px; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 6px 0 12px; }
.plan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.plan-card h3 { margin: 0; font-size: 16px; }
.plan-card-price { font-size: 26px; font-weight: 700; color: var(--ink-display); margin: 0; }
.plan-card-price span { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.plan-card p { font-size: 14px; color: var(--ink-2); margin: 0; flex-grow: 1; }
.plan-card button { width: 100%; }

/* admin operator actions */
.admin-actions { white-space: nowrap; }
.admin-actions button { padding: 4px 10px; font-size: 12.5px; margin-right: 6px; }
.admin-actions button.danger { color: var(--red, #ef8a7d); border-color: currentColor; }

/* ============================================================
   Mobile nav, inline validation, error pages
   ============================================================ */

/* CSS-only hamburger (CSP forbids inline JS; no JS needed at all).
   Used on the public pages whose nav carries real links. */
.nav-menu-box {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.nav-burger {
  display: none;
  flex: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.nav-burger svg {
  width: 20px;
  height: 20px;
  stroke: var(--ink);
  stroke-width: 2.1;
  fill: none;
  stroke-linecap: round;
}

.nav-burger .ic-close { display: none; }

@media (max-width: 760px) {
  nav.has-burger .nav-burger { display: grid; }
  nav.has-burger .nav-links {
    position: absolute;
    top: calc(100% - 4px);
    left: 0;
    right: 0;
    z-index: 30;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  nav.has-burger .nav-menu-box:checked ~ .nav-links { display: flex; }
  nav.has-burger .nav-menu-box:checked ~ .nav-burger .ic-open { display: none; }
  nav.has-burger .nav-menu-box:checked ~ .nav-burger .ic-close { display: block; }
  nav.has-burger .nav-links a { text-align: center; }
  nav.has-burger .nav-links .button { margin-top: 4px; }
  nav.has-burger .nav-menu-box:focus-visible ~ .nav-burger {
    outline: 2px solid color-mix(in srgb, var(--green) 70%, transparent);
    outline-offset: 2px;
  }
}

/* Inline validation: only flags fields the user has actually touched
   (:user-invalid), so forms never open shouting in red. */
input:user-invalid,
textarea:user-invalid,
select:user-invalid {
  border-color: var(--red) !important;
  background: color-mix(in srgb, var(--red) 4%, var(--surface));
}

input:user-invalid:focus-visible,
textarea:user-invalid:focus-visible {
  outline-color: color-mix(in srgb, var(--red) 70%, transparent);
}

.field-hint {
  margin: -6px 0 10px;
  color: var(--faint);
  font-size: 12.5px;
}

#message:empty,
.form-msg:empty { display: none; }

/* Friendly error pages (404 / 403 / expired links) */
.error-page {
  max-width: 480px;
  margin: 0 auto;
  padding-top: 8vh;
  text-align: center;
}

.error-page .error-code {
  display: block;
  margin: 30px 0 6px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.error-page h1 { font-size: clamp(26px, 5vw, 34px); margin-bottom: 10px; }

.error-page p { color: var(--muted); font-size: 16px; line-height: 1.55; }

.error-page .hero-actions { justify-content: center; }

.error-page .error-wave {
  width: min(280px, 70vw);
  margin: 26px auto 0;
  color: var(--green-line);
}

/* ============================================================
   Phone a11y + swipeable admin tables
   ============================================================ */

/* Screen-reader-only text: real labels for placeholder-styled forms,
   without changing the visual design. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Operator console: wide admin tables swipe inside their panel instead of
   getting clipped by the page's overflow-x clip on phones. */
#adminContractors,
#adminSubscriptions,
#adminUsage,
#adminStripeErrors,
#adminJobs {
  overflow-x: auto;
}

/* Touch targets (WCAG 2.5.5-ish): 44px hit areas on coarse pointers; the
   icons stay 18px, only the padding grows. */
@media (pointer: coarse) {
  .theme-toggle {
    width: 44px;
    height: 44px;
  }
  nav a:not(.button) { padding: 11px 13px; }
}

/* ============================================================
   ObraMano: voice-note mock on the landing phone + footer heart
   ============================================================ */
.voice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.voice-wave {
  width: 110px;
  height: 22px;
  flex: none;
  color: currentColor;
  opacity: 0.92;
}

.voice-time {
  font-family: var(--mono);
  font-size: 11.5px;
  opacity: 0.85;
}

.msg .msg-total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  opacity: 1;
}

.msg .msg-total strong { color: var(--green); }

.msg.note {
  align-self: center;
  max-width: none;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  color: var(--green-bright);
  font-size: 12px;
  font-weight: 600;
}

:root[data-theme="dark"] .msg.note { color: var(--green); }

footer .footer-heart {
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- estimates home (/estimados) ---------- */

.home,
.capture {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.home > *,
.capture > * {
  min-width: 0;
}

.home {
  max-width: 780px;
}

.home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.home-head h1 {
  font-size: clamp(26px, 5vw, 34px);
  letter-spacing: -0.025em;
}

.est-list {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
}

.est-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.est-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.est-main strong {
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.est-mic {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--green);
  stroke-width: 2.1;
  stroke-linecap: round;
}

.est-sub {
  color: var(--faint);
  font-size: 13px;
}

.est-side {
  display: grid;
  gap: 5px;
  justify-items: end;
  flex: none;
}

.est-total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.chip-draft {
  background: var(--surface-3);
  border-color: var(--line-2);
  color: var(--ink-2);
}

.chip-sent {
  background: color-mix(in srgb, var(--blue) 11%, transparent);
  border-color: color-mix(in srgb, var(--blue) 30%, transparent);
  color: var(--blue);
}

.chip-accepted {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green);
}

.chip-declined {
  background: color-mix(in srgb, var(--red) 10%, transparent);
  border-color: color-mix(in srgb, var(--red) 30%, transparent);
  color: var(--red);
}

.chip-review {
  background: var(--honey-soft);
  border-color: var(--honey-line);
  color: var(--honey-bright);
}

/* Spoken-price provenance: the contractor SAID this price in the voice note
   ("el cuarto a quinientos") and it overrode their price book. Blue "this is
   informational" family - deliberately NOT the honey review family: a spoken
   price is the contractor's own word, not a model suggestion to double-check. */
.chip-spoken {
  background: color-mix(in srgb, var(--blue) 11%, transparent);
  border-color: color-mix(in srgb, var(--blue) 30%, transparent);
  color: var(--blue);
}

/* EN-preview marker: this text is still Spanish - the homeowner would see
   it as-is. Same honey "needs a look" family as .chip-review. */
.chip-es {
  background: var(--honey-soft);
  border-color: var(--honey-line);
  color: var(--honey-bright);
  justify-self: start;
  width: fit-content;
  margin-top: 6px;
}

.est-empty {
  text-align: center;
  padding: 38px 24px;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.est-empty h2 {
  letter-spacing: -0.02em;
}

.est-empty p {
  max-width: 46ch;
}

.est-empty-mic {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
}

.est-empty-mic svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- capture page (/nuevo): the wedge ---------- */

.capture {
  max-width: 640px;
}

.cap-head {
  text-align: center;
  margin-top: 4px;
}

.cap-head h1 {
  font-size: clamp(26px, 6vw, 34px);
  letter-spacing: -0.025em;
}

.cap-sub {
  margin-top: 6px;
  color: var(--muted);
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
}

.cap-rec {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: 30px 22px;
}

/* The record button: the biggest thumb target in the product. Works in work
   gloves, in the sun. */
.rec-btn {
  width: 116px;
  height: 116px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  background-image: linear-gradient(180deg, var(--green-bright), var(--green));
  box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--green) 65%, transparent);
}

.rec-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px -16px color-mix(in srgb, var(--green) 70%, transparent);
}

.rec-btn svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: var(--green-ink);
  stroke-width: 2;
  stroke-linecap: round;
}

.rec-btn .ic-stop rect {
  fill: var(--green-ink);
  stroke: none;
}

.rec-btn .ic-stop {
  display: none;
}

.rec-btn.is-recording .ic-mic {
  display: none;
}

.rec-btn.is-recording .ic-stop {
  display: block;
}

.rec-btn.is-recording {
  background: var(--red);
  background-image: none;
}

@media (prefers-reduced-motion: no-preference) {
  .rec-btn.is-recording {
    animation: rec-pulse 1.6s ease-out infinite;
  }

  @keyframes rec-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 42%, transparent); }
    70% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--red) 0%, transparent); }
    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 0%, transparent); }
  }
}

.rec-timer {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.rec-status {
  color: var(--muted);
  max-width: 40ch;
}

.rec-preview {
  display: grid;
  gap: 12px;
  width: 100%;
  justify-items: center;
}

.rec-preview audio {
  width: 100%;
  max-width: 360px;
}

.up-wrap {
  width: 100%;
  max-width: 360px;
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.up-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--green);
  transition: width 0.2s ease;
}

.cap-typed h2 {
  font-size: 18px;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}

.cap-typed form {
  display: grid;
  gap: 12px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}

/* ---------- the draft result ---------- */

.cap-result {
  display: grid;
  gap: 12px;
}

.cap-transcript {
  color: var(--faint);
  font-size: 13.5px;
  border-left: 3px solid var(--green-line);
  padding-left: 10px;
}

.result-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.result-line .line-main {
  display: grid;
  gap: 3px;
  justify-items: start;
  min-width: 0;
}

.result-line strong {
  letter-spacing: -0.01em;
}

.line-detail {
  color: var(--faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.line-total {
  flex: none;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.result-totals {
  padding-top: 4px;
}

.totals-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.totals-row strong {
  font-size: 22px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

#message.error {
  color: var(--red);
  font-weight: 600;
}

@media (max-width: 640px) {
  .home-head {
    align-items: stretch;
    flex-direction: column;
  }

  .home-head .home-new {
    width: 100%;
  }

  .est-row {
    align-items: flex-start;
  }

  .rec-btn {
    width: 128px;
    height: 128px;
  }
}

/* ============================================================
   Stage 4: estimate editor (/estimados/<id>) - one thumb, big targets
   ============================================================ */

.editor {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  max-width: 680px;
}

.editor > * {
  min-width: 0;
}

.ed-head {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.ed-back {
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: none;
}

.ed-back:hover {
  color: var(--green);
}

.ed-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ed-title-row h1 {
  font-size: clamp(24px, 5.5vw, 32px);
  letter-spacing: -0.025em;
}

.ed-philosophy {
  color: var(--muted);
  font-size: 13.5px;
}

.lang-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  gap: 2px;
  width: fit-content;
  max-width: 100%;
}

.lang-toggle button {
  border: none;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.lang-toggle button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

#editPane {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

#editPane > * {
  min-width: 0;
}

.ed-hint-inline {
  font-style: normal;
  font-weight: 400;
  color: var(--faint);
}

.form-grid-full {
  grid-column: 1 / -1;
}

/* item cards */
.ed-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.ed-item {
  display: grid;
  gap: 9px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface-2);
}

.ed-items-empty {
  color: var(--faint);
  font-size: 14px;
  text-align: center;
  padding: 14px 6px;
}

.ed-item-name {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ed-item-name input {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.ed-item-remove {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: none;
  border: 1px solid var(--line);
  color: var(--faint);
  box-shadow: none;
  font-size: 15px;
}

.ed-item-remove:hover {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, transparent);
  background: color-mix(in srgb, var(--red) 7%, transparent);
}

.ed-item-en {
  font-size: 13.5px;
  color: var(--ink-2);
}

.ed-item-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.ed-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ed-field span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.02em;
}

.ed-field input,
.ed-field select {
  width: 100%;
  min-width: 0;
}

.ed-line-total {
  display: grid;
  gap: 4px;
  justify-items: end;
  padding-bottom: 10px;
}

.ed-line-total span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--faint);
}

.ed-line-total strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.ed-add-row {
  margin-top: 12px;
}

.rate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.rate-grid label {
  display: grid;
  gap: 4px;
}

.rate-grid label span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--faint);
}

.ed-totals {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.ed-totals .totals-row strong {
  font-size: 15px;
}

.ed-totals .ed-grand {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.ed-totals .ed-grand strong {
  font-size: 24px;
  color: var(--green);
}

.ed-notes-label {
  display: grid;
  gap: 6px;
}

.ed-notes-label > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

/* sticky action bar: the money buttons ride the thumb zone */
.ed-actions {
  position: sticky;
  bottom: 10px;
  z-index: 30;
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.ed-actions #sendBtn {
  flex: 1;
}

.ed-actions .ed-pdf {
  flex: none;
}

.ed-danger-row {
  display: flex;
  justify-content: center;
  padding-bottom: 6px;
}

/* share panel */
.share-link-row {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}

.share-link-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.share-btns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.share-btns .button {
  text-align: center;
}

.share-wa {
  background: #1da851;
}

.share-wa:hover {
  background: #168f43;
}

/* client preview (EN) */
.ed-preview-note {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 12px;
}

.prev-title {
  width: 100%;
  font-weight: 700;
  font-size: 17px;
}

.prev-for {
  color: var(--faint);
  font-size: 13px;
  margin-top: 6px;
}

.prev-items {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.prev-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.prev-item-main {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.prev-totals {
  display: grid;
  gap: 6px;
  padding-top: 10px;
}

.prev-totals .ed-grand,
.prev-totals .totals-row:last-of-type strong {
  font-variant-numeric: tabular-nums;
}

.prev-notes {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 13.5px;
  border-left: 3px solid var(--line-2);
  padding-left: 10px;
}

/* price book picker: bottom sheet on phones */
.picker {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--ink) 38%, transparent);
  display: grid;
  align-items: end;
}

.picker[hidden] {
  display: none;
}

.picker-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  max-height: 72vh;
  overflow-y: auto;
  padding: 18px 16px 22px;
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.picker-head h2 {
  font-size: 18px;
  letter-spacing: -0.015em;
}

.picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.picker-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 500;
}

.picker-item:hover {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.picker-item strong {
  flex: 1;
  min-width: 0;
}

.picker-item span {
  flex: none;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 640px) {
  .picker {
    align-items: center;
    justify-items: center;
  }

  .picker-sheet {
    width: min(480px, 92vw);
    border-radius: var(--radius);
  }
}

@media (max-width: 560px) {
  .ed-item-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .ed-line-total {
    justify-items: end;
    padding-bottom: 0;
  }

  .rate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

/* ============================================================
   Stage 4: homeowner share page (/e/<token>) - professional English
   ============================================================ */

.pub-page {
  background: var(--bg);
}

.pub {
  max-width: 680px;
  margin: 0 auto;
  padding: 26px 18px 40px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

.pub > * {
  min-width: 0;
}

.pub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 4px 2px;
}

.pub-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pub-avatar {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}

.pub-brand-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pub-brand-name strong {
  font-size: 17px;
  letter-spacing: -0.015em;
}

.pub-brand-sub {
  color: var(--muted);
  font-size: 13px;
}

.pub-brand-sub a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}

.pub-meta {
  display: grid;
  gap: 1px;
  justify-items: end;
  text-align: right;
}

.pub-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

.pub-number {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pub-date {
  color: var(--faint);
  font-size: 12.5px;
}

.pub-banner {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
}

.pub-banner-ok {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.pub-banner-ok strong {
  color: var(--green);
}

.pub-banner-muted {
  color: var(--muted);
}

.pub-banner a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

.pub-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 20px;
  display: grid;
  gap: 12px;
}

.pub-card h1 {
  font-size: clamp(21px, 5vw, 26px);
  letter-spacing: -0.02em;
}

.pub-for {
  color: var(--muted);
  font-size: 14px;
}

.pub-items {
  width: 100%;
  border-collapse: collapse;
}

.pub-items td {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.pub-item-name {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pub-item-detail {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.pub-item-amount {
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pub-totals {
  display: grid;
  gap: 7px;
  padding-top: 6px;
}

.pub-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.pub-total-row span:last-child {
  color: var(--ink);
  font-weight: 600;
}

.pub-grand {
  border-top: 2px solid var(--green);
  padding-top: 10px;
  margin-top: 4px;
}

.pub-grand span:first-child {
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
}

.pub-grand span:last-child {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--green);
}

.pub-deposit span:last-child {
  font-weight: 700;
}

.pub-valid {
  color: var(--muted);
  font-size: 13.5px;
}

.pub-notes {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: grid;
  gap: 6px;
}

.pub-notes h2 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.pub-notes p {
  font-size: 14.5px;
  color: var(--ink-2);
}

.pub-actions {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.pub-actions form {
  display: contents;
}

.pub-accept {
  width: 100%;
  font-size: 17px;
  padding: 16px 22px;
  border-radius: 14px;
}

.pub-pdf {
  text-align: center;
}

.pub-decline-row {
  text-align: center;
  margin-top: 2px;
}

.pub-decline {
  color: var(--faint);
  font-size: 13px;
  text-decoration: underline;
}

.pub-decline:hover {
  color: var(--red);
}

.pub-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.pub-confirm-actions form {
  display: contents;
}

.pub-decline-btn {
  background: var(--red);
}

.pub-decline-btn:hover {
  background: color-mix(in srgb, var(--red) 86%, #000);
}

.pub-foot {
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
  padding-top: 6px;
}

.pub-foot a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

/* printable: the homeowner hits Cmd+P and gets a clean sheet */
@media print {
  .pub-page {
    background: #fff;
  }

  .pub {
    max-width: none;
    padding: 0;
    gap: 12px;
  }

  .pub-actions,
  .pub-foot,
  .theme-toggle {
    display: none !important;
  }

  .pub-card,
  .pub-notes,
  .pub-banner {
    border: none;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
  }

  .pub-avatar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* estimate rows are links now (stage 4: they open the editor) */
a.est-row {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.est-row:hover {
  border-color: var(--green-line);
  transform: translateY(-1px);
}

/* ============================================================
   Stage 5: home dashboard stats + search, follow-ups, invoices,
   change orders, and the Pro upsell. Mobile (390px) first.
   ============================================================ */

/* ---------- home dashboard ---------- */

.home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 640px) {
  .home-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.home-stats article {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.home-stats span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-stats strong {
  font-size: 21px;
  font-weight: 780;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-tools input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.home-tools input:focus {
  outline: 2px solid var(--green-line);
  border-color: var(--green);
}

/* the search filter hides rows with [hidden]; the flex display would win
   otherwise */
.est-row[hidden] {
  display: none;
}

.est-search-empty {
  text-align: center;
}

.inv-number {
  color: var(--green);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  margin-right: 7px;
}

/* ---------- "Dale seguimiento" strip + waiting chip ---------- */

.fu-strip {
  display: grid;
  gap: 8px;
}

.fu-strip h2 {
  margin: 0;
}

.fu-strip > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.fu-rows {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.fu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2, var(--surface));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.fu-row:hover {
  border-color: var(--green-line);
  transform: translateY(-1px);
}

.fu-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.fu-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.fu-sub {
  color: var(--faint);
  font-size: 13px;
}

.chip-wait {
  background: var(--honey-soft);
  border-color: var(--honey-line);
  color: var(--honey-bright);
}

.chip-paid {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green);
}

.chip-tone {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green);
}

/* ---------- editor: follow-up composer ---------- */

.anchor-target {
  position: relative;
  top: -76px;
  display: block;
  height: 0;
}

.ed-followup,
.ed-accepted {
  display: grid;
  gap: 10px;
}

.fu-intro {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.fu-variant {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2, var(--surface));
}

.fu-variant-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.fu-hint {
  color: var(--faint);
  font-size: 12.5px;
}

.fu-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2, var(--ink));
}

.fu-actions {
  flex-wrap: wrap;
}

.fu-actions .button {
  font-size: 14px;
  padding: 9px 14px;
}

/* ---------- editor: accepted panel (invoice + change orders) ---------- */

.ed-invoice-row button {
  width: 100%;
}

@media (min-width: 640px) {
  .ed-invoice-row button {
    width: auto;
  }
}

.ed-accepted h2 {
  margin: 10px 0 0;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.ed-co-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.ed-co-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ed-co-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2, var(--surface));
}

.ed-co-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ed-co-main strong {
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.ed-co-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--green);
}

.ed-co-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.ed-co-side .ghost-link {
  font-size: 13.5px;
}

.ed-co-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

@media (min-width: 640px) {
  .ed-co-form {
    grid-template-columns: minmax(0, 1fr) 130px auto;
  }
}

.ed-co-form .ed-field input {
  width: 100%;
}

.ed-upsell {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.ed-upsell p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.paid-btn {
  color: var(--green);
  border-color: var(--green-line);
}

/* ---------- the Pro upsell page ---------- */

.upsell {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.upsell .plan-badge {
  position: static;
}

.upsell h1 {
  font-size: clamp(24px, 5vw, 30px);
  letter-spacing: -0.025em;
  margin: 0;
}

.upsell .plan-features li {
  line-height: 1.55;
}

/* ---------- public page: change orders + invoice banner ---------- */

.pub-co {
  gap: 10px;
}

.pub-co h2 {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.pub-co-note {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0;
}

.pub-co-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.pub-co-row:last-of-type {
  border-bottom: none;
}

.pub-co-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pub-co-main span {
  color: var(--muted);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.pub-co-side {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.pub-co-side form {
  display: contents;
}

.pub-co-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pub-co-ok {
  color: var(--green);
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
}

.pub-co-approve {
  font-size: 14px;
  padding: 9px 16px;
}

.pub-co-total {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.pub-banner-due strong {
  color: var(--green);
  font-size: 16px;
}

@media print {
  .pub-co-approve {
    display: none !important;
  }
}

/* ---------- stage 6: plan picker, onboarding wizard, mis precios, demo ---------- */

/* Logo on the homeowner header: same footprint as the initial avatar. */
img.pub-avatar.pub-logo { object-fit: contain; background: #fff; padding: 3px; border: 1px solid var(--line); }

/* Home banners (pick-a-plan paywall / finish-setup nudge). */
.plan-banner { border: 1px solid var(--green-line); background: linear-gradient(135deg, var(--green-soft), var(--surface)); }
.plan-banner h2 { margin: 4px 0 6px; }
.plan-banner p { margin: 0 0 12px; color: var(--ink-2); font-size: 14.5px; }

/* /plan: the trial checkout's front door. */
.plan-pick-head { align-items: flex-start; }
.plan-pick-sub { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; max-width: 560px; }
.plan-pick-cards { margin-top: 14px; }
.plan-card-popular { border-color: var(--green-line); box-shadow: var(--shadow-sm); position: relative; }
.plan-card-popular .plan-badge { position: absolute; top: -11px; right: 14px; }
.plan-card .plan-features { margin: 0 0 12px; padding: 0 0 0 18px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 5px; }
.plan-pick-note { max-width: 640px; }

/* Onboarding wizard (/bienvenida). */
.onboard { max-width: 660px; margin: 0 auto; padding: 0 16px 64px; }
.ob-head { padding: 18px 2px 14px; }
.ob-head h1 { margin: 6px 0 12px; font-size: clamp(26px, 7vw, 34px); }
.ob-dots { display: flex; gap: 8px; }
.ob-dot { width: 34px; height: 6px; border-radius: 99px; background: var(--track); transition: background 0.25s ease; }
.ob-dot.is-active { background: var(--green); }
.ob-step h2 { margin: 4px 0 6px; }
.ob-step > p { color: var(--ink-2); font-size: 14.5px; margin: 0 0 14px; }
.ob-label { display: block; font-weight: 650; font-size: 14px; margin: 16px 0 8px; }
.ob-trade-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ob-trade-btn {
  padding: 14px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 650; font-size: 15px; cursor: pointer;
  min-height: 52px;
}
.ob-trade-btn.is-picked { border-color: var(--green); background: var(--green-soft); color: var(--green-bright); }
.ob-trade-grid + .fine-print { margin-top: 10px; }
.ob-step2-actions { margin-top: 16px; }
.ob-final .cap-guide-sample { margin: 12px 0 18px; }
.ob-cta { font-size: 16px; }

/* Logo block (wizard step 1 + settings). */
.logo-block { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 12px; }
.logo-row { display: flex; gap: 12px; align-items: center; }
.logo-preview { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line-2); padding: 3px; flex: none; }
.logo-copy { display: grid; gap: 2px; font-size: 14px; }
.logo-upload-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* Price list (wizard step 2 + /precios). */
.pb-page { max-width: 720px; }
.pb-sub { color: var(--ink-2); font-size: 14.5px; margin: 0 0 14px; max-width: 560px; }
.pb-list { display: grid; gap: 8px; margin: 8px 0 16px; }
.pb-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; transition: border-color 0.3s ease, background 0.3s ease;
}
.pb-row.pb-saved { border-color: var(--green); background: var(--green-soft); }
.pb-names { display: grid; gap: 1px; min-width: 0; }
.pb-names strong { font-size: 14.5px; line-height: 1.25; }
.pb-name-en { font-size: 12.5px; color: var(--faint); }
.pb-price { display: flex; align-items: center; gap: 4px; flex: none; }
.pb-dollar { color: var(--faint); font-weight: 650; }
.pb-price input {
  width: 76px; padding: 9px 8px; border-radius: 9px; border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 650; text-align: right;
}
.pb-price input:focus { outline: none; border-color: var(--green); }
.pb-unit { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.pb-add h2 { margin: 0 0 10px; }

/* Guided first-estimate card (/nuevo?guia=1). */
.cap-guide { border: 1px solid var(--green-line); background: linear-gradient(135deg, var(--green-soft), var(--surface)); }
.cap-guide h2 { margin: 4px 0 8px; }
.cap-guide-sample {
  margin: 0 0 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px dashed var(--line-2);
  font-size: 15px; line-height: 1.5; color: var(--ink-2); font-style: italic;
}

/* /demo: the walkthrough. */
.demo-page .demo-hero { padding: 26px 2px 18px; max-width: 640px; }
.demo-page .demo-hero h1 { margin: 12px 0 10px; font-size: clamp(28px, 7.5vw, 40px); }
.demo-rec { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 28px 18px; }
.demo-transcript {
  margin: 4px 0 0; padding: 14px 16px; border-radius: var(--radius-sm); width: 100%;
  background: var(--surface-2); border: 1px solid var(--line); text-align: left;
  font-size: 15px; line-height: 1.55; color: var(--ink-2); min-height: 52px;
}
.demo-result .btn-row { margin-top: 14px; flex-wrap: wrap; }
.demo-cta { margin-top: 26px; }
.demo-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 14px 0; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--green-soft); border: 1px solid var(--green-line); font-size: 14px;
}
.demo-banner strong { color: var(--green-bright); }
.demo-banner span { color: var(--ink-2); flex: 1 1 240px; }
.demo-banner-cta { padding: 8px 14px; font-size: 13.5px; flex: none; }
.demo-editor .ed-head { padding-top: 4px; }
.demo-item { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; }
.demo-item-names { display: grid; gap: 2px; min-width: 0; flex: 1 1 240px; }
.demo-item-en { font-size: 12.5px; color: var(--faint); }
.demo-item-en em { font-style: normal; color: var(--faint); }
.demo-item-math { display: grid; gap: 2px; text-align: right; flex: none; }
.demo-item-math span { font-size: 12.5px; color: var(--faint); }
.demo-meta { color: var(--ink-2); font-size: 14px; margin: 4px 0 0; }
/* legacy fork '.demo-totals' (try-it section) collides - this page uses .demo-sum */
.demo-sum { display: grid; gap: 6px; }
.demo-next h2 { margin: 0 0 8px; }
.demo-next .btn-row { margin-top: 12px; flex-wrap: wrap; }
.demo-accept-note { margin: 10px 0 0; text-align: center; }
.pub-accept[disabled] { opacity: 0.75; cursor: default; }

@media (max-width: 480px) {
  .pb-row { flex-wrap: wrap; }
  .pb-price { margin-left: auto; }
  .demo-item-math { text-align: left; }
}
