/* LeadRebound — "The Front Desk"
   Warm paper, deep pine chrome, vermilion missed-call signal, leaf-green captured leads.
   Display: Bricolage Grotesque · Body: Instrument Sans · Data: IBM Plex Mono */

:root {
  color-scheme: light;
  --paper: #f2efe6;
  --panel: #fffdf6;
  --ink: #1c2420;
  --muted: #5f6a63;
  --line: #ddd6c4;
  --pine: #175348;
  --pine-deep: #0d352d;
  --pine-wash: #e4ede8;
  --vermilion: #c23c1c;
  --vermilion-wash: #f7e4dd;
  --leaf: #2f7d46;
  --leaf-wash: #e2efe4;
  --amber: #96660f;
  --amber-wash: #f5ecd6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 36, 32, 0.06), 0 6px 24px -12px rgba(28, 36, 32, 0.18);
  --font-display: "Bricolage Grotesque", "Avenir Next", "Trebuchet MS", sans-serif;
  --font-body: "Instrument Sans", "Gill Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

/* Author display rules (e.g. label { display: flex }) must never defeat the hidden attribute. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(rgba(23, 83, 72, 0.045) 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.5;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 700; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 650; margin: 0; }

a { color: var(--pine); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, .mono, .pair-code, time { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Chrome ─────────────────────────────────────────────── */

.topbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 28px;
  background: var(--pine-deep);
  color: #ecf2ec;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 19px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: block;
  width: var(--brand-mark-size, 26px);
  height: var(--brand-mark-size, 26px);
  flex: 0 0 auto;
}
.brand-mark.small {
  --brand-mark-size: 18px;
}

.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: #c8d6cc;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 14px;
}
.nav a:hover { color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }

.user-menu { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: #c8d6cc; }
.user-email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.plan-chip.pro { background: var(--leaf); border-color: var(--leaf); color: #fff; }

.link-button {
  background: none; border: none; cursor: pointer;
  color: #c8d6cc; font: inherit; padding: 0;
}
.link-button:hover { color: #fff; text-decoration: underline; }

.page { max-width: 1060px; margin: 0 auto; padding: 34px 28px 64px; }
.footer {
  max-width: 1060px; margin: 0 auto; padding: 0 28px 40px;
  color: var(--muted); font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}

/* Staggered entrance — one orchestrated load, CSS only */
.page > * { animation: rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.page > *:nth-child(2) { animation-delay: 0.05s; }
.page > *:nth-child(3) { animation-delay: 0.1s; }
.page > *:nth-child(4) { animation-delay: 0.15s; }
.page > *:nth-child(5) { animation-delay: 0.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page > * { animation: none; } }

/* ── Panels & structure ─────────────────────────────────── */

.hero-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.back-link { font-size: 13.5px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.panel.centered { text-align: center; padding: 48px 24px; }
.celebrate {
  width: 56px; height: 56px; margin: 0 auto 12px;
  display: grid; place-items: center;
  background: var(--leaf-wash); color: var(--leaf);
  border-radius: 50%; font-size: 26px; font-weight: 700;
}

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-title a { font-size: 13.5px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ── Stat tiles & meter ─────────────────────────────────── */

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 720px) { .stats-grid { grid-template-columns: 1fr; } }

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
}
.stat > span { display: block; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.stat-number {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.25;
  display: block;
}
.stat-number.good { color: var(--leaf); }
.stat-of { font-style: normal; font-size: 16px; color: var(--muted); margin-left: 4px; }
.stat small { color: var(--muted); font-size: 12.5px; }
.stat small a { font-weight: 600; }

.meter {
  height: 6px;
  background: #e7e1d2;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.meter span { display: block; height: 100%; background: var(--pine); border-radius: 999px; transition: width 0.6s ease; }
.meter.warn span { background: var(--amber); }

/* ── Onboarding checklist ───────────────────────────────── */

.onboarding { border-left: 4px solid var(--vermilion); }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.setup-steps li { display: flex; align-items: center; gap: 12px; }
.setup-steps .step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  flex-shrink: 0;
}
.setup-steps li.done .step-num { background: var(--leaf-wash); border-color: var(--leaf); color: var(--leaf); font-weight: 700; }
.setup-steps li.done .step-label { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(95, 106, 99, 0.5); }
.setup-steps li a { margin-left: auto; font-size: 13.5px; white-space: nowrap; }
.setup-steps.compact li { align-items: flex-start; }
.setup-steps.compact .step-num { margin-top: 1px; }

/* ── Setup flow ─────────────────────────────────────────── */

.setup-flow-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.setup-welcome { margin: 4px 0 0; max-width: 560px; }
.flow-progress {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.flow-meter {
  width: 64px;
  flex: 0 0 64px;
  margin: 0;
}
.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 14px;
  padding: 0 0 20px;
}
.flow-step:last-child { padding-bottom: 0; }
.flow-step::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}
.flow-step.done::after { background: var(--leaf-wash); }
.flow-step:last-child::after { display: none; }
.flow-chip {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
}
.flow-chip svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flow-step.done .flow-chip {
  background: var(--leaf-wash);
  border-color: var(--leaf);
  color: var(--leaf);
  font-weight: 700;
}
.flow-step.active .flow-chip {
  background: var(--vermilion-wash);
  border-color: var(--vermilion);
  color: var(--vermilion);
  box-shadow: 0 0 0 4px rgba(194, 60, 28, 0.12);
}
.flow-step.todo .flow-chip { opacity: 0.72; }
.flow-step-body h3 {
  margin: 4px 0 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}
.flow-step.done .flow-step-body h3 {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(95, 106, 99, 0.5);
}
.flow-step.todo .flow-step-body h3 { color: var(--ink); }
.flow-step.todo .flow-hint { opacity: 0.85; }
.flow-hint {
  margin: 5px 0 0;
  max-width: 660px;
}
.flow-action { margin-top: 13px; }
.flow-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  max-width: 600px;
}
.flow-artifact {
  min-height: 178px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}
.flow-artifact p {
  margin: 10px 0 0;
  font-weight: 600;
}
.flow-qr {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid #ece7d9;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.flow-qr svg { display: block; }
.flow-apk-link {
  margin-top: 2px;
  font-size: 13px;
}
.flow-pair p.flow-pair-lead { margin: 0 0 12px; }
.flow-pair .error { margin-top: 8px; }
.flow-pair .pair-code {
  margin: 0 0 8px;
  font-size: 30px;
}
.flow-pair .muted { margin-top: 0; font-weight: 400; }
.flow-inline-action {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.flow-listening {
  margin: 0;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .flow-meter span { transition: none; }
}

@media (max-width: 640px) {
  .setup-flow-header {
    flex-direction: column;
    gap: 10px;
  }
  .flow-progress { justify-content: flex-start; }
  .flow-action-grid { grid-template-columns: 1fr; }
}

/* ── Tables ─────────────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
th a { color: var(--muted); }
th a.sorted { color: var(--pine); }
td { padding: 11px 10px; border-bottom: 1px solid #ece7d9; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: rgba(23, 83, 72, 0.04); }
time { color: var(--muted); font-size: 13px; }

/* ── Badges & status ────────────────────────────────────── */

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--pine-wash);
  color: var(--pine);
  white-space: nowrap;
}
.badge.state-lead_captured { background: var(--leaf-wash); color: var(--leaf); }
.badge.state-escalated { background: var(--vermilion-wash); color: var(--vermilion); }
.badge.state-opted_out, .badge.state-closed { background: #eae6da; color: var(--muted); }
.badge.state-ai_engaged { background: var(--amber-wash); color: var(--amber); }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #b9b2a0; }
.status.online i { background: var(--leaf); box-shadow: 0 0 0 0 rgba(47, 125, 70, 0.5); animation: pulse 2.2s infinite; }
.status.online { color: var(--leaf); font-weight: 600; }
.status.offline { color: var(--muted); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 125, 70, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(47, 125, 70, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 125, 70, 0); }
}

/* ── Lead feed & lead card ──────────────────────────────── */

.lead-feed { list-style: none; margin: 0; padding: 0; }
.lead-feed li {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name time" "intent phone";
  gap: 1px 12px;
  padding: 11px 2px;
  border-bottom: 1px solid #ece7d9;
}
.lead-feed li:last-child { border-bottom: none; }
.lead-feed strong { grid-area: name; }
.lead-feed .muted { grid-area: intent; font-size: 13.5px; }
.lead-feed .mono { grid-area: phone; text-align: right; font-size: 13px; color: var(--muted); }
.lead-feed time { grid-area: time; text-align: right; }

.lead-card {
  display: flex;
  align-items: center;
  gap: 18px;
  border-left: 4px solid var(--leaf);
}
.lead-flag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--leaf);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
}
.lead-card p { margin: 2px 0 0; }
.lead-when { margin-left: auto; text-align: right; }
.lead-when span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }

/* ── Conversation thread (SMS bubbles) ──────────────────── */

.thread { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.bubble p { margin: 0; }
.bubble.in {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.bubble.out {
  align-self: flex-end;
  background: var(--pine);
  color: #f2f7f2;
  border-bottom-right-radius: 4px;
}
.bubble-meta { font-size: 11.5px; margin-top: 5px; opacity: 0.65; font-family: var(--font-mono); }

/* ── Forms ──────────────────────────────────────────────── */

fieldset {
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 0 0;
  margin: 6px 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
legend {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 17px;
  padding: 0 12px 0 0;
}
label { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 600; }
label .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
label.wide { grid-column: 1 / -1; }
label.check-row { flex-direction: row; align-items: center; gap: 9px; grid-column: 1 / -1; font-weight: 500; }

input, textarea, select {
  font: inherit;
  font-size: 14.5px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(23, 83, 72, 0.35);
  outline-offset: 1px;
  border-color: var(--pine);
}
textarea { resize: vertical; font-family: var(--font-body); font-size: 14.5px; line-height: 1.5; }

button, .button {
  font: inherit;
  font-weight: 650;
  font-size: 14.5px;
  background: var(--pine);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  display: inline-block;
  transition: background 0.15s ease, transform 0.1s ease;
}
button:hover, .button:hover { background: var(--pine-deep); text-decoration: none; }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary, .button.secondary {
  background: transparent;
  color: var(--pine);
  border: 1px solid var(--pine);
}
button.secondary:hover { background: var(--pine-wash); }
button.secondary.danger { color: var(--vermilion); border-color: var(--vermilion); }
button.secondary.danger:hover { background: var(--vermilion-wash); }

.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.inline-form input { flex: 0 1 240px; }
.form-grid > button { justify-self: start; }
.form-status { min-height: 1em; font-size: 14px; margin: 4px 0; }
.form-status.success { color: var(--leaf); }
.error { color: var(--vermilion); font-size: 14px; min-height: 1em; margin: 4px 0; }
.success { color: var(--leaf); }

.ai-setup-panel { border-left: 4px solid var(--pine); }
.ai-setup-panel.slim { border-left: 1px solid var(--line); padding: 12px 18px; }
.ai-setup-lead { margin: -6px 0 16px; max-width: 560px; }
.ai-setup-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.ai-setup-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ai-setup-actions .form-status { margin: 0; }
.ai-mode-toggle {
  color: var(--pine);
  font-size: 13.5px;
}
.form-status.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.ai-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid var(--pine-wash);
  border-top-color: var(--pine);
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
}
.field-flash {
  animation: field-flash 1.3s ease-out;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
@keyframes field-flash {
  0% { background: var(--leaf-wash); border-color: rgba(47, 125, 70, 0.55); }
  100% { background: #fff; border-color: var(--line); }
}

@media (max-width: 720px) {
  fieldset,
  .ai-setup-form { grid-template-columns: 1fr; }
}

/* ── My Business: two-column layout + live phone preview ── */

.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start; /* a stretched grid item cannot stick */
}
.config-main { min-width: 0; }
.config-preview { position: sticky; top: 78px; }
.config-preview:empty,
#preview-slot-mobile:empty { display: none; }
.phone-preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.preview-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 12px;
}
.preview-thread { display: flex; flex-direction: column; gap: 8px; }
.preview-sysline {
  margin: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--vermilion);
}
.preview-note {
  margin: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}
.preview-thread .bubble {
  margin: 0;
  max-width: 88%;
  padding: 8px 12px;
  font-size: 13.5px;
  white-space: pre-wrap;
  min-height: 1em;
}
.preview-faq { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.greeting-preview-warning {
  color: var(--amber);
  font-size: 13px;
  margin: 10px 0 0;
}
@media (max-width: 960px) {
  .config-layout { grid-template-columns: 1fr; }
  .preview-faq { display: none; }
}
#faq-list {
  grid-column: 1 / -1;
}
.faq-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: start;
}
.faq-row input,
.faq-row textarea {
  width: 100%;
}
.form-grid textarea,
.ai-setup-form textarea {
  resize: none;
  overflow: hidden;
}
.faq-remove {
  border: none;
  background: none;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 16px;
  line-height: 1;
}
.faq-remove:hover { color: var(--vermilion); background: var(--vermilion-wash); }
#faq-add {
  justify-self: start;
}
.fieldset-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}
.advanced-box {
  grid-column: 1 / -1;
}
.advanced-box summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  padding: 4px 0;
}
.advanced-box summary:hover {
  color: var(--pine);
}
.advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  padding-top: 14px;
}
.ai-refill summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 15px;
  color: var(--pine);
}
.ai-refill summary:hover { color: var(--pine-deep); }
.ai-refill-body { padding-top: 14px; }
.save-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 10px max(28px, calc((100% - 1004px) / 2)) calc(10px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px -12px rgba(28, 36, 32, 0.18);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0s 0.25s;
}
.save-bar.visible {
  transform: none;
  visibility: visible;
  transition: transform 0.25s ease, visibility 0s;
}
body.save-bar-visible .page { padding-bottom: 140px; }
@media (prefers-reduced-motion: reduce) {
  .save-bar { transition: none; }
}
.save-bar .form-status { margin: 0; text-align: right; }
.form-status.dirty-note { color: var(--muted); font-style: italic; }

@media (max-width: 640px) {
  .faq-row,
  .advanced-grid { grid-template-columns: 1fr; }
}

/* ── Admin ──────────────────────────────────────────────── */

.stats-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .stats-grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .stats-grid.four { grid-template-columns: 1fr; }
}
.admin-facts { margin: 0; display: grid; gap: 10px; }
.admin-facts > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}
.admin-facts dt { color: var(--muted); font-size: 13.5px; }
.admin-facts dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }

/* ── Pairing ────────────────────────────────────────────── */

.pair-result { text-align: center; border-style: dashed; border-width: 2px; }
.pair-code {
  display: inline-block;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.25em;
  padding: 12px 22px;
  margin: 10px 0;
  background: var(--pine-wash);
  color: var(--pine-deep);
  border-radius: var(--radius);
}
.pair-help { border-left: 4px solid var(--pine); }
.new-key {
  background: var(--amber-wash);
  border: 1px solid var(--amber);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
}
.new-key code { word-break: break-all; }

/* ── Plan cards ─────────────────────────────────────────── */

.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 720px) { .plan-cards { grid-template-columns: 1fr; } }
.plan-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.plan-card.pro { border-color: var(--pine); border-width: 2px; }
.plan-card.current { background: linear-gradient(180deg, var(--pine-wash), var(--panel) 55%); }
.plan-card header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.plan-card ul { margin: 0 0 14px; padding-left: 20px; color: var(--muted); }
.plan-card li { margin: 4px 0; }
.price { font-family: var(--font-display); font-size: 36px; font-weight: 750; margin: auto 0 10px; }
.price span { font-size: 15px; color: var(--muted); font-weight: 400; }

/* ── Empty states ───────────────────────────────────────── */

.empty-state { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty-glyph { display: block; font-size: 30px; color: var(--vermilion); margin-bottom: 6px; }
.empty-state strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 16px; }
.empty-state p { margin: 4px auto 0; max-width: 380px; font-size: 14px; }

/* ── Auth split layout ──────────────────────────────────── */

body.bare {
  background: var(--pine-deep);
  display: grid;
  place-items: center;
  padding: 24px;
}
.bare-main { width: 100%; max-width: 880px; }
.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--panel);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px -24px rgba(0, 0, 0, 0.5);
}
.auth-brand {
  background:
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.4px) 0 0 / 20px 20px,
    linear-gradient(160deg, var(--pine) 0%, var(--pine-deep) 80%);
  color: #e8f0e8;
  padding: 38px 34px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.brand.on-dark { color: #fff; }
.auth-pitch {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 750;
  line-height: 1.18;
  margin: 0;
}
.auth-steps { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: 12px; font-size: 14.5px; color: #c9d8cc; }
.auth-steps span { font-family: var(--font-mono); font-size: 11.5px; color: #ff9b7b; margin-right: 8px; }

.auth-panel { padding: 38px 34px; display: flex; flex-direction: column; justify-content: center; }
.auth-panel h1 { margin-bottom: 18px; }
.auth-panel form { display: grid; gap: 14px; }
.auth-panel button { margin-top: 4px; }
.auth-panel .muted { margin-top: 18px; font-size: 14px; }

@media (max-width: 720px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { padding: 26px; gap: 16px; }
  .auth-steps { display: none; }
}

/* ── Responsive tables → stacked cards ──────────────────── */

@media (max-width: 640px) {
  .page { padding: 22px 16px 48px; }
  .topbar { padding: 10px 16px; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  td { border: none; padding: 3px 2px; }
  .truncate { max-width: none; white-space: normal; }
}

/* ── Landing — Clean SaaS reskin ─────────────────────────── */

body.landing-body {
  display: block;
  place-items: initial;
  padding: 0;
  overflow-x: hidden;
  background: #f2efe6;
  color: #1a1f1c;
  font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.landing-body .bare-main {
  width: 100%;
  max-width: none;
}

.landing-page {
  --landing-container: 1180px;
  --night: #0b201b;
  --night-deep: #050f0c;
  --night-soft: #14362d;
  --cream: #f2efe6;
  --white: #ffffff;
  --ember: #e05a2b;
  --ember-dark: #c23c1c;
  --ink: #1a1f1c;
  --muted: #5b665f;
  --line: #e6e2d6;
  --soft-line: rgba(230, 226, 214, 0.72);
  --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  --hero-card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-wrap: break-word;
  background: var(--cream);
  color: var(--ink);
}

.landing-page *,
.landing-page *::before,
.landing-page *::after {
  box-sizing: border-box;
}

.landing-page h1,
.landing-page h2,
.landing-page h3,
.landing-page p {
  margin-top: 0;
}

.landing-page h1,
.landing-page h2,
.landing-page h3 {
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.landing-page svg {
  display: block;
  max-width: 100%;
}

.landing-wrap {
  width: min(var(--landing-container), calc(100% - 48px));
  max-width: 100%;
  margin: 0 auto;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.landing-nav-inner {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  width: min(var(--landing-container), calc(100% - 48px));
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
}

.landing-brand.brand,
.landing-brand.brand:hover {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
  color: var(--night);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.landing-nav-links,
.landing-nav-actions,
.landing-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.landing-nav-links {
  justify-content: center;
  gap: 22px;
  max-width: 100%;
}

.landing-nav-actions {
  justify-content: flex-end;
  gap: 10px;
}

.landing-nav-links a,
.landing-login {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: color 0.16s ease;
}

.landing-nav-links a:hover,
.landing-login:hover,
.landing-footer a:hover,
.landing-back-link:hover {
  color: var(--night);
  text-decoration: none;
}

.landing-page .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 46px;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.landing-primary,
.landing-nav-button.landing-primary {
  background: var(--ember);
  color: #fff;
  border-color: var(--ember);
  box-shadow: 0 14px 24px rgba(224, 90, 43, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.landing-nav-button.landing-primary {
  min-height: 38px;
  padding: 10px 18px;
  font-size: 14px;
}

.landing-primary:hover,
.landing-nav-button.landing-primary:hover {
  background: var(--ember-dark);
  border-color: var(--ember-dark);
  color: #fff;
  transform: translateY(-1px);
  text-decoration: none;
}

.landing-secondary {
  background: transparent;
  color: var(--night);
  border-color: rgba(26, 31, 28, 0.35);
}

.landing-secondary:hover {
  background: var(--night);
  color: #fff;
  border-color: var(--night);
  transform: translateY(-1px);
  text-decoration: none;
}

.landing-secondary-dark {
  color: #fff;
  border-color: rgba(242, 239, 230, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.landing-secondary-dark:hover {
  color: #fff;
  border-color: rgba(242, 239, 230, 0.46);
  background: rgba(255, 255, 255, 0.1);
}

/* Inert status pill — iPhone isn't shipped yet, so no hover, no lift, no pointer. */
.landing-soon,
.landing-soon:hover {
  opacity: 0.55;
  cursor: default;
  transform: none;
  background: transparent;
}

.landing-soon.landing-secondary-dark,
.landing-soon.landing-secondary-dark:hover {
  color: #fff;
  border-color: rgba(242, 239, 230, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.landing-section {
  padding: 96px 0;
}

.lr-eyebrow {
  margin: 0 0 14px;
  color: var(--ember);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 84px 0 72px;
  background: var(--night);
  color: #fff;
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 0%, rgba(20, 54, 45, 0.88) 0%, rgba(11, 32, 27, 0) 68%);
  pointer-events: none;
}

.landing-hero-copy {
  display: grid;
  justify-items: center;
  gap: 24px;
  max-width: 920px;
  text-align: center;
}

.landing-hero h1 {
  margin: 0;
  color: #fff;
  font-size: 68px;
  line-height: 1.04;
}

.landing-hero h1 span {
  display: block;
}

.landing-hero h1 span:last-child {
  color: var(--ember);
}

.landing-subhead {
  max-width: 62ch;
  margin: 0;
  color: rgba(242, 239, 230, 0.72);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.58;
  overflow-wrap: break-word;
}

.landing-actions {
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.landing-hero-product {
  margin-top: 56px;
}

.lr-product-card {
  width: min(980px, 100%);
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: var(--hero-card-shadow);
  color: var(--ink);
}

.lr-product-main {
  display: grid;
  grid-template-columns: 55fr 45fr;
  min-height: 500px;
}

.lr-phone-screen {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fafafa;
  border-right: 1px solid #ecefea;
}

.lr-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 16px 22px;
  background: #fff;
  border-bottom: 1px solid #ecefea;
}

.lr-chat-contact {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: #222722;
  font-size: 14px;
}

.lr-chat-contact strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lr-avatar-dot {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #c7d8cd 0 24%, #f2efe6 25% 100%);
  border: 1px solid #e6e2d6;
}

.lr-lead-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #cfe8d5;
  border-radius: 999px;
  background: #effaf1;
  color: #256b3c;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
}

.lr-lead-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fa74f;
}

.lr-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  padding: 26px 24px 28px;
}

.lr-thread-day {
  align-self: center;
  margin: 0 0 2px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f0f1ef;
  color: #758078;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.1;
}

.lr-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.42;
  overflow-wrap: break-word;
  box-shadow: 0 1px 2px rgba(5, 15, 12, 0.04);
}

.lr-bubble.out {
  align-self: flex-end;
  background: var(--night);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.lr-bubble.in {
  align-self: flex-start;
  background: #f1f2f0;
  color: #252c27;
  border-bottom-left-radius: 6px;
}

.lr-bubble-meta {
  align-self: flex-end;
  margin: -6px 4px 0;
  color: #89938c;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.lr-leads-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f6f6f3;
}

.lr-leads-head {
  min-height: 66px;
  padding: 20px 26px 14px;
  background: #fff;
  border-bottom: 1px solid #f0eee7;
}

.lr-leads-head h2 {
  margin: 0;
  color: #171c18;
  font-size: 26px;
  line-height: 1.1;
}

.lr-lead-card {
  display: grid;
  gap: 18px;
  margin: 28px;
  padding: 24px;
  background: #fff;
  border: 1px solid #efeee8;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
}

.lr-lead-tag {
  width: max-content;
  padding: 6px 9px;
  border: 1px solid #f4cfbd;
  border-radius: 8px;
  background: #fff3ed;
  color: var(--ember);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.1em;
}

.lr-lead-card h3 {
  margin: -6px 0 0;
  color: #171c18;
  font-size: 24px;
  line-height: 1.1;
}

.lr-lead-fields {
  display: grid;
  gap: 0;
  margin: 0;
}

.lr-lead-fields div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid #f0eee7;
}

.lr-lead-fields dt,
.lr-lead-fields dd {
  margin: 0;
}

.lr-lead-fields dt {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #7c867f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.lr-lead-fields dt span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f7f7f4;
  color: #8b958e;
}

.lr-diff-icon svg,
.lr-lead-fields svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lr-lead-fields dd {
  padding-left: 37px;
  color: #222722;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
}

.lr-ai-summary {
  margin: 2px 0 0;
  padding: 14px 15px;
  border: 1px solid #f2d2c3;
  border-radius: 12px;
  background: #fff4ee;
  color: #3f433f;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.lr-ai-summary strong {
  color: var(--ember-dark);
  font-weight: 800;
}

.lr-product-footer {
  padding: 13px 20px;
  border-top: 1px solid #ecefea;
  background: #fff;
  color: #53605a;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.lr-diff-strip {
  background: var(--night-deep);
  color: #fff;
  text-align: center;
}

.lr-eyebrow-light {
  color: var(--ember);
}

.lr-diff-heading {
  margin: 0 auto 52px;
  max-width: 18ch;
  color: #fff;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lr-diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 980px;
  margin: 0 auto;
  text-align: left;
}

.lr-diff-grid article {
  padding: 38px 36px;
  border: 1px solid rgba(242, 239, 230, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.lr-diff-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 22px;
  border: 1px solid rgba(224, 90, 43, 0.45);
  border-radius: 50%;
  background: rgba(224, 90, 43, 0.12);
  color: var(--ember);
}

.lr-diff-icon svg {
  width: 26px;
  height: 26px;
}

.lr-diff-grid h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lr-diff-grid p {
  margin: 0;
  color: rgba(242, 239, 230, 0.68);
  font-size: 16px;
  line-height: 1.6;
  max-width: 46ch;
}

.lr-trades {
  background: var(--cream);
}

.lr-trades h2,
.lr-how h2,
.lr-pricing h2,
.lr-final-cta h2,
.landing-app-install h1 {
  margin: 0;
  color: var(--ink);
  font-size: 46px;
  line-height: 1.08;
}

.lr-trades h2 {
  max-width: 620px;
  margin-bottom: 42px;
}

.lr-trade-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.lr-trade-card {
  min-width: 0;
  padding: 12px 12px 22px;
  background: #fff;
  border: 1px solid rgba(230, 226, 214, 0.74);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lr-trade-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -12px rgba(0, 0, 0, 0.12), var(--card-shadow);
}

.lr-trade-art {
  display: grid;
  place-items: center;
  min-height: 168px;
  margin-bottom: 18px;
  padding: 16px;
  overflow: hidden;
  border-radius: 14px;
  background: #f6f2e8;
}

.lr-trade-art svg {
  width: min(210px, 100%);
  height: auto;
  overflow: visible;
}

.lr-trade-card h3 {
  margin: 0 10px 8px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.18;
}

.lr-trade-card p {
  margin: 0 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.lr-how {
  background: #fff;
  color: var(--ink);
}

.lr-how h2 {
  max-width: 640px;
  margin-bottom: 52px;
}

.lr-how-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
}

.lr-how-grid li {
  min-width: 0;
}

.lr-step-no {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--night);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.lr-how-grid h3 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.lr-how-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.lr-pricing {
  background: var(--cream);
  text-align: center;
}

/* FAQ — type does the work: one narrow column, hairline separators. */
.lr-faq {
  background: var(--white);
  border-top: 1px solid var(--line);
}
.lr-faq-wrap {
  max-width: 780px;
}
.lr-faq h2 {
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 34px;
}
.lr-faq-list {
  border-top: 1px solid var(--line);
}
.lr-faq-item {
  border-bottom: 1px solid var(--line);
}
.lr-faq-item summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 17.5px;
  line-height: 1.35;
}
.lr-faq-item summary::-webkit-details-marker {
  display: none;
}
.lr-faq-marker {
  flex: 0 0 auto;
  position: relative;
  top: 2px;
  width: 14px;
  height: 14px;
  color: var(--ember-dark);
}
.lr-faq-marker::before,
.lr-faq-marker::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  background: currentColor;
  transition: transform 0.18s ease;
}
.lr-faq-marker::before {
  width: 14px;
  height: 2px;
}
.lr-faq-marker::after {
  width: 2px;
  height: 14px;
}
.lr-faq-item[open] .lr-faq-marker::after {
  transform: scaleY(0);
}
.lr-faq-item > p {
  margin: 0;
  padding: 0 40px 22px 0;
  max-width: 66ch;
  color: var(--muted);
  line-height: 1.65;
}
@media (prefers-reduced-motion: reduce) {
  .lr-faq-marker::before,
  .lr-faq-marker::after {
    transition: none;
  }
}

.lr-pricing h2 {
  margin-bottom: 44px;
}

.lr-price-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
  text-align: left;
}

.lr-price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 500px;
  padding: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  color: var(--ink);
}

.lr-price-pro {
  z-index: 1;
  border: 2px solid var(--ember);
  box-shadow: 0 24px 50px -18px rgba(224, 90, 43, 0.28), var(--card-shadow);
  transform: scale(1.035);
}

.lr-price-card h3 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.1;
}

.lr-price-pro h3 {
  color: var(--ember-dark);
}

.lr-price-card header p {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 30px;
  padding-bottom: 28px;
  border-bottom: 1px solid #f0eee7;
}

.lr-price-card header span {
  color: var(--ink);
  font-size: 64px;
  font-weight: 800;
  line-height: 0.95;
}

.lr-price-card header small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.lr-price-card ul {
  display: grid;
  gap: 16px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.lr-price-card li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  line-height: 1.35;
}

.lr-price-card li svg {
  width: 19px;
  height: 19px;
  margin-top: 1px;
  fill: none;
  stroke: var(--night);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lr-price-card li svg.lr-check-ember {
  stroke: var(--ember);
}

.lr-price-card .button {
  width: 100%;
  margin-top: auto;
}

.lr-popular-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--ember);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.12em;
  white-space: nowrap;
  box-shadow: 0 12px 20px rgba(224, 90, 43, 0.2);
}

.lr-final-cta {
  padding: 78px 0;
  background: var(--ember);
  color: #fff;
  text-align: center;
}

.lr-final-cta h2 {
  max-width: 760px;
  margin: 0 auto 28px;
  color: #fff;
  text-wrap: balance;
}

.landing-secondary-light {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
  box-shadow: 0 14px 24px rgba(5, 15, 12, 0.12);
}

.landing-secondary-light:hover {
  background: #f7f7f4;
  color: var(--ink);
  border-color: #f7f7f4;
}

.landing-secondary-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
}

.landing-secondary-outline:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.16);
}

.landing-soon.landing-secondary-outline,
.landing-soon.landing-secondary-outline:hover {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
}

.landing-footer {
  padding: 58px 0 34px;
  background: var(--night-deep);
  color: rgba(242, 239, 230, 0.66);
}

.landing-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 42px;
  align-items: start;
}

.landing-footer .landing-brand.brand,
.landing-footer .landing-brand.brand:hover {
  color: #fff;
}

.landing-footer-brand {
  display: grid;
  gap: 14px;
  align-content: start;
}

.landing-footer-brand p {
  max-width: 320px;
  margin: 0;
  color: rgba(242, 239, 230, 0.66);
  font-size: 14px;
  line-height: 1.5;
}

.landing-footer nav {
  display: grid;
  gap: 11px;
  align-content: start;
}

.landing-footer h3 {
  margin: 0 0 4px;
  color: rgba(242, 239, 230, 0.42);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: 0.12em;
}

.landing-footer a {
  color: rgba(242, 239, 230, 0.86);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.landing-footer-bottom {
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid rgba(242, 239, 230, 0.1);
  color: rgba(242, 239, 230, 0.52);
  font-size: 13px;
  font-weight: 650;
}

.landing-app-page {
  background: var(--cream);
}

.landing-app-install {
  min-height: calc(100vh - 68px);
  background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
}

.landing-app-install-wrap {
  max-width: 760px;
}

.landing-app-install h1 {
  max-width: 680px;
  margin-bottom: 18px;
}

.landing-app-install .landing-subhead {
  margin-bottom: 28px;
  color: var(--muted);
}

.landing-download-button {
  margin-bottom: 36px;
}

.landing-install-guide {
  display: grid;
  gap: 14px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.landing-install-guide li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

.landing-install-guide span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--night);
  color: #fff;
  font-weight: 800;
  line-height: 1;
}

.landing-install-guide p {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.landing-permissions-note {
  margin: 22px 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.58;
}

.landing-back-link {
  color: var(--ember-dark);
  font-weight: 800;
  text-decoration: none;
}

#how,
#pricing {
  scroll-margin-top: 92px;
}

@media (prefers-reduced-motion: no-preference) {
  .lr-anim {
    opacity: 0;
    transform: translateY(10px);
    animation: lr-rise 0.46s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  .lr-thread .lr-anim:nth-child(1) { animation-delay: 0.16s; }
  .lr-thread .lr-anim:nth-child(2) { animation-delay: 0.34s; }
  .lr-thread .lr-anim:nth-child(3) { animation-delay: 0.48s; }
  .lr-thread .lr-anim:nth-child(4) { animation-delay: 0.82s; }
  .lr-thread .lr-anim:nth-child(5) { animation-delay: 1.2s; }
  .lr-thread .lr-anim:nth-child(6) { animation-delay: 1.58s; }
  .lr-thread .lr-anim:nth-child(7) { animation-delay: 1.96s; }

  .lr-ring-a {
    animation: lr-ring-pulse 1.8s ease-in-out infinite;
  }

  .lr-ring-b {
    animation: lr-ring-pulse 1.8s ease-in-out 0.18s infinite;
  }
}

@keyframes lr-rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes lr-ring-pulse {
  0%, 100% {
    opacity: 0.42;
    transform: translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lr-anim,
  .lr-ring-a,
  .lr-ring-b {
    animation: none;
  }

  .lr-anim {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1060px) {
  .lr-trade-grid,
  .lr-how-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lr-product-main {
    grid-template-columns: 1fr;
  }

  .lr-phone-screen {
    border-right: 0;
    border-bottom: 1px solid #ecefea;
  }
}

@media (max-width: 860px) {
  .landing-nav-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    min-height: 0;
    padding: 12px 0;
  }

  .landing-nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .landing-nav-links::-webkit-scrollbar {
    display: none;
  }

  .lr-diff-grid {
    grid-template-columns: 1fr;
  }

  .landing-footer-grid {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(140px, 180px));
  }
}

@media (max-width: 760px) {
  .landing-wrap,
  .landing-nav-inner {
    width: min(var(--landing-container), calc(100% - 32px));
  }

  .landing-hero {
    padding: 64px 0 54px;
  }

  .landing-hero h1 {
    font-size: 52px;
  }

  .landing-subhead {
    font-size: 18px;
  }

  .landing-section {
    padding: 72px 0;
  }

  .lr-trades h2,
  .lr-how h2,
  .lr-pricing h2,
  .lr-final-cta h2,
  .landing-app-install h1 {
    font-size: 38px;
  }

  .lr-product-card {
    border-radius: 20px;
  }

  .lr-product-main {
    min-height: 0;
  }

  .lr-chat-head,
  .lr-leads-head {
    padding-inline: 18px;
  }

  .lr-thread {
    padding: 22px 18px 24px;
  }

  .lr-lead-card {
    margin: 20px;
    padding: 20px;
  }

  .lr-diff-grid article {
    padding: 28px 24px;
  }

  .lr-price-cards,
  .landing-footer-grid {
    grid-template-columns: 1fr;
  }

  .lr-price-pro {
    transform: none;
  }

  .landing-actions .button,
  .landing-app-install .landing-download-button {
    width: 100%;
  }

  .landing-footer-grid {
    gap: 30px;
  }
}

@media (max-width: 560px) {
  .landing-nav-links {
    gap: 12px;
  }

  .landing-nav-links a,
  .landing-login {
    font-size: 13px;
  }

  .landing-nav-button.landing-primary {
    padding-inline: 14px;
  }

  .landing-hero h1 {
    font-size: 42px;
  }

  .landing-subhead {
    font-size: 16.5px;
  }

  .lr-trades h2,
  .lr-how h2,
  .lr-pricing h2,
  .lr-final-cta h2,
  .landing-app-install h1 {
    font-size: 32px;
  }

  .lr-product-card {
    width: 100%;
  }

  .lr-chat-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .lr-thread {
    gap: 10px;
  }

  .lr-bubble {
    max-width: 90%;
    font-size: 13px;
  }

  .lr-lead-card {
    margin: 16px;
    padding: 18px;
  }

  .lr-trade-grid,
  .lr-how-grid {
    grid-template-columns: 1fr;
  }

  .lr-trade-art {
    min-height: 150px;
  }

  .lr-price-card {
    min-height: 0;
    padding: 30px 24px;
  }

  .lr-price-card header span {
    font-size: 58px;
  }

  .lr-diff-icon {
    width: 48px;
    height: 48px;
  }

  .landing-install-guide li {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 16px;
  }
}

@media (max-width: 420px) {
  .landing-login {
    display: none;
  }

  .landing-brand.brand {
    font-size: 18px;
  }

  .landing-page .button {
    padding-inline: 18px;
  }

  .landing-hero h1 {
    font-size: 40px;
  }

  .lr-bubble {
    max-width: 94%;
  }

  .lr-lead-fields dd {
    padding-left: 0;
  }
}
