/* 5000Lands.com — mobile-first, adaptive UI for the Leptos mock-up.
   Breakpoints: 640px (2-col forms), 900px (desktop shell: top nav, side panels), 1180px (3-col forms). */

:root {
  --brand: #0e6b4f;
  --brand-ink: #0a4d39;
  --brand-soft: #e3f1ea;
  --accent: #e8a33d;
  --accent-soft: #fdf1dc;
  --ink: #1d2a2c;
  --muted: #5d6b6d;
  --line: #dde3df;
  --bg: #f5f4ef;
  --card: #ffffff;
  --ok: #1f8a5b;
  --warn: #b7791f;
  --off: #9aa3a5;
  --err: #c0392b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 40, 30, .06), 0 6px 18px rgba(20, 40, 30, .06);
  --font: "Noto Sans", "Noto Sans Tamil", "Noto Sans Devanagari", "Nirmala UI", "Latha", "Mangal",
          system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif Tamil", "Noto Serif Devanagari", serif;
  --bottomnav-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.5; font-size: 16px;
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
}
/* Tamil and Devanagari glyphs need more line height and a touch less size. */
html[lang="ta"] body, html[lang="hi"] body { line-height: 1.65; }
html[lang="ta"] h1, html[lang="ta"] .page-title { font-size: clamp(1.35rem, 4.2vw, 2rem); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.block { display: block; }
.center { text-align: center; }
.icon { flex: none; vertical-align: -4px; }

/* ── Shell ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(245, 244, 239, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 2px; text-decoration: none; color: var(--ink); font-weight: 800; }
.brand-mark { background: var(--brand); color: #fff; padding: 2px 7px; border-radius: 7px; font-size: .95rem; letter-spacing: .02em; }
.brand-word { font-family: var(--display); font-size: 1.25rem; margin-left: 4px; }
.topnav { display: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.langswitch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 2px; }
.lang-btn {
  border: 0; background: transparent; font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted);
  min-width: 38px; height: 32px; border-radius: 999px; cursor: pointer;
}
.lang-btn.on { background: var(--brand); color: #fff; }

.container { max-width: 1180px; margin: 0 auto; padding: 18px 16px 32px; }
.footer { max-width: 1180px; margin: 0 auto; padding: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .85rem; border-top: 1px solid var(--line); }

.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.05);
}
.bottomnav-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; min-width: 0;
}
.bottomnav-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.bottomnav-link.active { color: var(--brand); }
.bottomnav-link.active .icon { stroke-width: 2.4; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottomnav { display: none; }
  .topbar { padding: 12px 28px; }
  .topnav { display: flex; gap: 4px; margin-left: 24px; }
  .topnav-link {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
  }
  .topnav-link:hover { background: var(--brand-soft); color: var(--brand-ink); }
  .topnav-link.active { background: var(--brand-soft); color: var(--brand-ink); }
  .container { padding: 28px 28px 48px; }
}

/* ── Buttons & controls ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 650;
  border-radius: 999px; border: 1px solid transparent; padding: 10px 18px; min-height: 44px; cursor: pointer;
  text-decoration: none; transition: transform .05s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn-lg { min-height: 50px; padding: 12px 24px; font-size: 1.02rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: var(--card); color: var(--brand-ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-accent { background: var(--accent); color: #2a1d05; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 8px; border-radius: 999px; color: var(--muted); }
.row-gap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grow { flex: 1; }
.block-btn { width: 100%; margin-top: 16px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card.center { max-width: 640px; margin: 24px auto; padding: 32px 20px; text-align: center; }

.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: #dff3e8; color: var(--ok); }
.pill-warn { background: #fbefd8; color: var(--warn); }
.pill-off { background: #eceeee; color: #6b7577; }
.pill-info { background: var(--accent-soft); color: #8a5a0c; }
.tag { display: inline-block; font-size: .78rem; background: var(--brand-soft); color: var(--brand-ink); border-radius: 6px; padding: 2px 8px; }

/* ── Home ──────────────────────────────────────────────── */
.hero { display: grid; gap: 20px; align-items: center; padding: 8px 0 12px; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); margin-bottom: 10px; }
.hero h1 { font-size: clamp(1.8rem, 6.5vw, 3.1rem); }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 60ch; }
.hero-art { display: none; }
.skyline { width: 100%; height: auto; }
.skyline .ground { fill: #d7e4dc; } .skyline .b1 { fill: #9cc5b1; } .skyline .b2 { fill: var(--brand); }
.skyline .b3 { fill: var(--accent); } .skyline .door { fill: #8a5a0c; } .skyline .sun { fill: #f6d38f; }
.skyline .win rect { fill: rgba(255,255,255,.75); }
@media (min-width: 900px) { .hero { grid-template-columns: 1.25fr 1fr; padding: 24px 0; } .hero-art { display: block; } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 24px; }
.stat, .kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat strong, .kpi strong { display: block; font-size: 1.6rem; font-family: var(--display); color: var(--brand-ink); }
.stat span, .kpi span { font-size: .82rem; color: var(--muted); }

.section-title { font-size: 1.15rem; margin: 24px 0 12px; display: flex; align-items: center; gap: 8px; }
.count { background: var(--brand); color: #fff; font-size: .78rem; border-radius: 999px; padding: 1px 9px; }

.role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.role-card {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); text-decoration: none;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 140px;
}
.role-card:hover { border-color: var(--brand); }
.role-card .muted { font-size: .88rem; }
.role-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; }
.role-seller .role-icon, .role-buyer .role-icon { background: var(--accent-soft); color: #8a5a0c; }
@media (min-width: 900px) { .role-grid { grid-template-columns: repeat(4, 1fr); } }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.steps p { margin: 0; }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* ── Adaptive form ─────────────────────────────────────── */
.page-title { font-size: clamp(1.45rem, 4.8vw, 2.1rem); margin: 6px 0 16px; }
.role-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
.role-tabs::-webkit-scrollbar { display: none; }
.role-tab {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.role-tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.post-layout { display: grid; gap: 16px; padding-bottom: 76px; /* room for the fixed submit bar on phones */ }
.post-main { display: grid; gap: 14px; min-width: 0; }
fieldset.card { margin: 0; min-width: 0; }
legend { font-weight: 750; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-ink); padding: 0 6px; margin-left: -6px; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .post-main .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .label { font-size: .88rem; font-weight: 650; color: var(--ink); }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=password], select, textarea {
  font: inherit; font-size: 16px; /* ≥16px stops iOS zoom-on-focus */
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #c9d2cd; border-radius: var(--radius-sm); background: #fff; color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
.has-error input, .has-error select { border-color: var(--err); background: #fff7f6; }
.err { color: var(--err); font-weight: 600; font-size: .82rem; }
.hint { color: var(--muted); font-size: .82rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-weight: 600; border: 1px solid #c9d2cd; background: #fff; color: var(--ink);
  border-radius: 999px; padding: 9px 16px; min-height: 44px; cursor: pointer;
}
.chip-sm { min-width: 52px; padding: 8px 12px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.scope-grid { display: grid; gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .scope-grid { grid-template-columns: 1fr 1fr; } }
.scope-opt { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid #c9d2cd; border-radius: var(--radius-sm); cursor: pointer; }
.scope-opt input { grid-row: span 2; width: 20px; height: 20px; accent-color: var(--brand); }
.scope-opt small { color: var(--muted); }
.scope-opt.on { border-color: var(--brand); background: var(--brand-soft); }

.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }

.stepper { display: inline-flex; align-items: center; border: 1px solid #c9d2cd; border-radius: var(--radius-sm); overflow: hidden; width: fit-content; background: #fff; }
.stepper button { width: 46px; height: 44px; border: 0; background: var(--brand-soft); font-size: 1.3rem; color: var(--brand-ink); cursor: pointer; }
.stepper output { min-width: 52px; text-align: center; font-weight: 700; }

/* Side panel: hidden on phones (replaced by sticky submit bar); sticky summary on desktop. */
.post-side .summary { display: none; }
.submit-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 8px); z-index: 25;
  display: flex; gap: 10px; align-items: center; padding: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.live-chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px 0 8px; font-weight: 800; color: var(--brand-ink); }
@media (min-width: 900px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; padding-bottom: 0; }
  .post-side { position: sticky; top: 84px; display: grid; gap: 12px; }
  .post-side .summary { display: block; }
  .submit-bar { position: static; border-radius: var(--radius); box-shadow: none; padding: 0; border: 0; background: transparent; }
  .live-chip { display: none; }
}
.summary h3 { font-size: 1rem; }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 14px; font-size: .9rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.live { display: flex; align-items: center; gap: 10px; background: var(--brand-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.live-n { font-size: 1.8rem; font-family: var(--display); color: var(--brand-ink); }

/* ── Matches ───────────────────────────────────────────── */
.picker { display: grid; gap: 8px; align-items: center; }
.picker label { font-weight: 650; font-size: .88rem; }
@media (min-width: 900px) { .picker { grid-template-columns: auto 1fr auto; gap: 14px; } }
.notice { background: var(--accent-soft); border: 1px solid #f2d39c; color: #6b4709; border-radius: var(--radius); padding: 12px 14px; }

.match-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .match-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.match { padding: 0; overflow: hidden; display: grid; }
.thumb { height: 120px; position: relative; background: linear-gradient(135deg, #9cc5b1, var(--brand)); }
.thumb-Villa { background: linear-gradient(135deg, #f6d38f, var(--accent)); }
.thumb-Commercial { background: linear-gradient(135deg, #b9c6d6, #4f6d8a); }
.thumb-Land { background: linear-gradient(135deg, #e3d9b5, #9a8a4f); }
.thumb .pill { position: absolute; top: 10px; left: 10px; }
@media (min-width: 640px) { .match { grid-template-columns: 160px 1fr; } .thumb { height: auto; min-height: 100%; } }
.match-body { padding: 14px 16px; display: grid; gap: 8px; min-width: 0; }
.match-head { display: flex; justify-content: space-between; gap: 10px; }
.match-head h3 { font-size: 1.05rem; margin: 0; }
.match-head p { margin: 2px 0 0; font-size: .88rem; }
.price { font-size: 1.25rem; font-weight: 800; margin: 0; color: var(--ink); }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); }
.facts li { display: inline-flex; gap: 4px; align-items: center; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.contact-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.owner { font-size: .88rem; display: inline-flex; gap: 6px; align-items: center; }

.score { --deg: 0deg; flex: none; width: 62px; height: 62px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, #fff 78%, transparent 80% 100%), conic-gradient(var(--brand) var(--deg), var(--brand-soft) 0); }
.score-num { font-weight: 800; font-size: .95rem; line-height: 1; }
.score-lbl { font-size: .6rem; color: var(--muted); max-width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ext-list { display: grid; gap: 10px; }
.ext { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-decoration: none; color: var(--ink); }
.ext:hover { border-color: var(--brand); }
.portal { grid-column: 1 / -1; font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--warn); }
.ext-title { font-weight: 650; }
.ext-price { font-weight: 800; text-align: right; }
.ext-open { grid-column: 1 / -1; display: inline-flex; gap: 4px; align-items: center; color: var(--brand); font-size: .88rem; font-weight: 650; }

/* ── Dashboard ─────────────────────────────────────────── */
.dash-head { display: grid; gap: 12px; }
.dash-head p { margin: 0; }
.plan-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-name { font-size: 1.1rem; margin-right: auto; }
@media (min-width: 900px) { .dash-head { grid-template-columns: 1fr auto; align-items: end; } }
.listing-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.listing { display: flex; flex-direction: column; gap: 6px; }
.listing h3 { font-size: 1.02rem; margin: 4px 0 0; }
.listing p { margin: 0; }
.listing.dim { opacity: .6; }
.listing-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.listing.add { align-items: center; justify-content: center; text-decoration: none; color: var(--brand); border-style: dashed; min-height: 140px; font-weight: 650; text-align: center; }
.verify { margin-top: 8px; padding: 12px; background: var(--accent-soft); border-radius: var(--radius-sm); display: grid; gap: 6px; }
.req-list { display: grid; gap: 10px; }
.req { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.req-title { flex: 1 1 240px; font-weight: 600; }

/* ── Admin ─────────────────────────────────────────────── */
.admin-head { display: grid; gap: 12px; }
.export { display: grid; gap: 4px; justify-items: start; }
@media (min-width: 900px) { .admin-head { grid-template-columns: 1fr auto; align-items: center; } .export { justify-items: end; } }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.kpi.accent strong { color: #8a5a0c; } .kpi.warn strong { color: var(--warn); }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { font: inherit; font-weight: 650; border: 0; background: transparent; color: var(--muted); padding: 10px 14px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--brand-ink); border-bottom-color: var(--brand); }

.campaign { display: grid; gap: 14px; margin-bottom: 14px; }
@media (min-width: 900px) { .campaign { grid-template-columns: 1fr auto; align-items: center; } }

/* Responsive table: real table on desktop, stacked cards on phones. */
.rtable { width: 100%; border-collapse: separate; border-spacing: 0; }
.rtable th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rtable td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; background: var(--card); }
.rtable tbody tr:hover td { background: #fafcfb; }
.score-pill { font-weight: 800; color: var(--brand-ink); background: var(--brand-soft); padding: 3px 9px; border-radius: 999px; }
.lead-select { min-height: 38px; padding: 6px 10px; width: auto; }
@media (max-width: 759px) {
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); overflow: hidden; }
  .rtable td { display: grid; grid-template-columns: 34% 1fr; gap: 10px; border-bottom: 1px solid #eef1ef; padding: 10px 14px; }
  .rtable td:last-child { border-bottom: 0; }
  .rtable td > * { grid-column: 2; justify-self: start; }
  .rtable td::before { grid-row: 1 / span 3; content: attr(data-label); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 2px; }
}
@media (min-width: 760px) { .rtable { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; } .rtable tr:last-child td { border-bottom: 0; } }

/* ── Register ──────────────────────────────────────────── */
.narrow { max-width: 760px; margin: 0 auto; }
.stepper-bar { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 16px; }
.stepper-bar li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 999px; background: #eceeea; color: var(--muted); font-weight: 650; font-size: .85rem; min-width: 0; }
.stepper-bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper-bar .dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
.stepper-bar li.on { background: var(--brand); color: #fff; } .stepper-bar li.on .dot { color: var(--brand); }
.stepper-bar li.done { background: var(--brand-soft); color: var(--brand-ink); }
.role-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.role-opt { font: inherit; text-align: left; display: grid; gap: 4px; padding: 14px; border-radius: var(--radius); border: 1.5px solid #c9d2cd; background: #fff; cursor: pointer; color: var(--ink); }
.role-opt small { color: var(--muted); }
.role-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.role-opt .icon { color: var(--brand); }
.input-btn { display: flex; gap: 8px; } .input-btn input { flex: 1; min-width: 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
@media (max-width: 639px) { .grow-sm { flex: 1; } }

.plan-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-col { font: inherit; text-align: left; display: grid; align-content: start; gap: 4px; padding: 14px; border: 1.5px solid #c9d2cd; border-radius: var(--radius); background: #fff; color: var(--ink); cursor: pointer; }
.plan-col.on { border-color: var(--brand); background: var(--brand-soft); }
.plan-col ul { margin: 6px 0 0; padding-left: 18px; font-size: .86rem; color: var(--muted); }
.plan-price { font-size: 1.5rem; font-weight: 800; font-family: var(--display); }
.plan-price small { font-size: .8rem; }

.thanks h1 { font-size: 1.6rem; }
.thanks .row-gap { justify-content: center; margin-top: 16px; }
.thanks-badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: var(--brand-soft); color: var(--brand); }
.thanks-badge .icon { width: 32px; height: 32px; }

/* ── Payment sheet: bottom sheet on phones, dialog on desktop ── */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 25, 20, .45); z-index: 40; animation: fade .15s ease-out; }
.sheet {
  position: fixed; z-index: 41; inset: auto 0 0 0; max-height: 92vh; overflow-y: auto; background: var(--card);
  border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease-out;
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sheet-head h2 { margin: 0; font-size: 1.2rem; }
.pay-form { margin-top: 6px; }
@media (min-width: 900px) {
  .sheet { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 520px; border-radius: 20px; animation: pop .18s ease-out; padding: 24px; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -46%); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast-wrap { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomnav-h) + 86px); width: min(92vw, 460px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 600; animation: up .2s ease-out; }
@media (min-width: 900px) { .toast-wrap { bottom: 28px; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Utilities that must win over component rules (keep last). */
@media (max-width: 899px) { .hide-sm { display: none !important; } }

/* ── Chat ─────────────────────────────────────────────── */
.chat-page {
  display: flex; flex-direction: column; gap: 10px;
  height: calc(100dvh - 58px - var(--bottomnav-h) - env(safe-area-inset-bottom) - 30px); min-height: 460px;
}
.chat-head { display: grid; gap: 8px; }
.chat-head .page-title { margin-bottom: 2px; }
.chat-sub { margin: 0; max-width: 70ch; }
.persona-row { display: grid; gap: 4px; min-width: 0; }
.persona-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.persona-tabs::-webkit-scrollbar { display: none; }
.persona { white-space: nowrap; flex: none; }
.chat-log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 12px; display: flex; flex-direction: column; gap: 12px;
}
.msg { max-width: min(620px, 92%); display: grid; gap: 6px; min-width: 0; }
.msg.user {
  align-self: flex-end; background: var(--brand); color: #fff; padding: 9px 13px;
  border-radius: 16px 16px 4px 16px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.bot { align-self: flex-start; }
.bubble { background: var(--brand-soft); color: var(--ink); padding: 9px 13px; border-radius: 16px 16px 16px 4px; white-space: pre-line; overflow-wrap: anywhere; }
.chat-cards { display: grid; gap: 8px; }
@media (min-width: 640px) { .chat-cards:has(.cprop + .cprop), .chat-cards:has(.creq + .creq) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ccard { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--card); display: grid; gap: 4px; min-width: 0; color: var(--ink); text-decoration: none; }
.ccard-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cid { font-weight: 700; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctitle { font-size: .98rem; }
.cline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cline .price { margin: 0; font-size: 1rem; }
.cext .portal { font-weight: 700; color: var(--brand-ink); font-size: .85rem; }
.chat-kv { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: .92rem; }
.chat-kv dt { max-width: 15ch; }
.chat-kv dt { color: var(--muted); }
.chat-kv dd { margin: 0; font-weight: 600; overflow-wrap: break-word; min-width: 0; }
.chat-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-chip {
  border: 1px solid var(--brand); color: var(--brand-ink); background: var(--card); border-radius: 999px;
  padding: 7px 13px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-chip:hover { background: var(--brand-soft); }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; min-width: 0; min-height: 50px; max-height: 140px; resize: none; }
.chat-send { min-height: 50px; }
.chat-fab {
  position: fixed; right: 14px; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 14px); z-index: 24;
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px;
  background: var(--accent); color: #2a1d05; font-weight: 700; text-decoration: none; box-shadow: var(--shadow);
}
.chat-fab span { display: none; }
@media (max-width: 639px) {
  .chat-sub { display: none; }               /* keep the conversation tall on phones */
  .persona-row .label { font-size: .8rem; }
  .chat-input textarea { min-height: 46px; font-size: 16px; }
}
.quick-fill { display: grid; gap: 8px; margin-bottom: 14px; }
.quick-fill label { font-weight: 700; }
.quick-fill textarea { min-height: 64px; }
@media (min-width: 900px) {
  .chat-page { height: calc(100dvh - 120px); }
  .chat-head { grid-template-columns: 1fr auto; align-items: end; }
  .persona-row { justify-items: end; }
  .chat-fab { bottom: 24px; right: 24px; }
  .chat-fab span { display: inline; }
}
/* the post form already has a sticky submit bar on phones; keep the FAB clear of it */
@media (max-width: 899px) { body:has(.submit-bar) .chat-fab { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 84px); } }
