/* ==========================================================================
   HAUZ design system — no build step needed (works on plain XAMPP).
   Jacaranda violet · Mango · Lake teal (verified only) · Ink · Limestone
   ========================================================================== */

:root {
  --jacaranda: #6B3FE0;
  --jacaranda-600: #5A2FD0;
  --jacaranda-700: #4722AE;
  --jacaranda-50: #F1ECFF;
  --jacaranda-100: #E3D9FF;
  --mango: #FFB020;
  --mango-50: #FFF4DC;
  --lake: #00A99D;
  --lake-50: #DDF6F3;
  --ink: #1B1636;
  --ink-2: #3C3560;
  --muted: #6E6890;
  --line: #E4E1F0;
  --line-2: #D3CFE4;
  --surface: #F6F5FB;
  --paper: #FFFFFF;
  --danger: #D92D4B;
  --danger-50: #FDE8EC;
  --warn: #B86E00;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --shadow-pop: 0 12px 32px -12px rgba(43, 22, 110, .28);
  --focus: 0 0 0 3px rgba(107, 63, 224, .35);
  --sidebar: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  color: var(--ink); background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--jacaranda-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--jacaranda-700); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[x-cloak] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }

/* ── Brand mark ─────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.brand img { width: 34px; height: 34px; }
.brand-word { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; letter-spacing: .04em; }
.brand-word span { color: var(--mango); }

/* ── App shell (admin) ──────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--ink); color: #CFC9EA; padding: 1.25rem .9rem 2rem;
  /* The fold: a quiet zig-zag seam echoing the Z in the mark */
  border-right: 6px solid transparent;
  border-image: repeating-linear-gradient(135deg, var(--jacaranda) 0 6px, var(--ink) 6px 12px) 6;
}
.sidebar .brand { color: #fff; padding: .25rem .6rem 1.25rem; }
.nav-group { margin-top: 1.1rem; }
.nav-group-title { font-size: .78rem; color: #8C85B3; padding: 0 .7rem .35rem; }
.nav a {
  display: flex; align-items: center; gap: .65rem; padding: .5rem .7rem; margin: 1px 0;
  border-radius: var(--r-sm); color: #DCD7F2; text-decoration: none; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--jacaranda); color: #fff; }
.nav a.active svg { opacity: 1; }
.nav .soon { margin-left: auto; font-size: .7rem; color: #8C85B3; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .85rem 2rem;
  background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar .grow { flex: 1; }
.menu-btn { display: none; }
.content { padding: 2rem; max-width: 1280px; width: 100%; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head p { margin: .2rem 0 0; color: var(--muted); max-width: 62ch; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--mango); color: var(--ink); font-weight: 700; font-size: .85rem; flex: none;
}

/* ── Surfaces ───────────────────────────────────────────────── */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel-pad { padding: 1.25rem 1.4rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; }
.stack > * + * { margin-top: 1.25rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* Hero metric strip on the dashboard: one band, not a row of cards */
.metrics {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); border-radius: var(--r-lg); overflow: hidden;
  background: var(--jacaranda); color: #fff;
}
.metrics > div { padding: 1.4rem 1.5rem; border-left: 1px solid rgba(255,255,255,.14); }
.metrics > div:first-child { border-left: 0; background: var(--jacaranda-700); }
.metrics .value { font-family: var(--font-display); font-size: 2.3rem; font-weight: 700; line-height: 1; }
.metrics .label { color: #D9CFFF; margin-top: .45rem; font-size: .9rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: 600 .92rem/1 var(--font-body); padding: .72rem 1.1rem; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--jacaranda); color: #fff; }
.btn-primary:hover { background: var(--jacaranda-700); color: #fff; }
.btn-accent { background: var(--mango); color: var(--ink); }
.btn-accent:hover { background: #F2A000; color: var(--ink); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--jacaranda); color: var(--jacaranda-700); }
.btn-danger { background: var(--paper); color: var(--danger); border-color: #F3B8C3; }
.btn-danger:hover { background: var(--danger-50); color: var(--danger); }
.btn-sm { padding: .45rem .7rem; font-size: .84rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--jacaranda-600); font: inherit; cursor: pointer; }

/* ── Forms ──────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label, .label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.field .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: .82rem; color: var(--muted); }
.field .error, .error-text { font-size: .84rem; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: .68rem .8rem;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--jacaranda); box-shadow: var(--focus); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.form-grid .w-full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; margin-top: .75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.form-section h3 { margin: 0; }
.check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--jacaranda); }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-block; padding: .45rem .85rem; border: 1px solid var(--line-2); border-radius: 999px;
  cursor: pointer; font-size: .9rem; background: var(--paper);
}
.choice input:checked + span { background: var(--jacaranda-50); border-color: var(--jacaranda); color: var(--jacaranda-700); font-weight: 600; }
.choice input:focus-visible + span { box-shadow: var(--focus); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .82rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FBFAFE; }
.cell-user { display: flex; align-items: center; gap: .7rem; }
.cell-user strong { display: block; }

/* ── Pills & badges ─────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.pill-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--lake-50); color: #00756C; border-color: transparent; }
.pill-off { background: var(--danger-50); color: var(--danger); border-color: transparent; }
.pill-warn { background: var(--mango-50); color: var(--warn); border-color: transparent; }
.pill-role { color: #fff; border-color: transparent; }
.verified { display: inline-flex; align-items: center; gap: .3rem; color: #00756C; font-weight: 600; }

/* ── Alerts / flash ─────────────────────────────────────────── */
.flash { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1.1rem; border-radius: var(--r-md); margin-bottom: 1.25rem; font-weight: 500; }
.flash-ok { background: var(--lake-50); color: #00564F; }
.flash-err { background: var(--danger-50); color: #9E1530; }
.flash-key { background: var(--mango-50); color: #6B4100; border: 1px dashed #E5A21B; }
.flash-key code { font-size: 1.05rem; font-weight: 700; letter-spacing: .04em; background: #fff; padding: .15rem .5rem; border-radius: 6px; }

/* ── Role builder ───────────────────────────────────────────── */
.perm-module { border-top: 1px solid var(--line); }
.perm-module:first-child { border-top: 0; }
.perm-head { display: flex; align-items: center; gap: .8rem; padding: .95rem 1.4rem; cursor: pointer; user-select: none; }
.perm-head h3 { margin: 0; flex: 1; }
.perm-count { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.perm-head .link-btn { white-space: nowrap; }
.perm-meter { width: 72px; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.perm-meter i { display: block; height: 100%; background: var(--jacaranda); border-radius: 99px; }
.perm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem 1.25rem; padding: 0 1.4rem 1.1rem 1.4rem; }
.perm-item { display: flex; gap: .65rem; align-items: flex-start; padding: .45rem .55rem; border-radius: var(--r-sm); cursor: pointer; }
.perm-item:hover { background: var(--surface); }
.perm-item input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--jacaranda); flex: none; }
.perm-item code { display: block; font-size: .74rem; color: var(--muted); }
.perm-item.locked { opacity: .45; cursor: not-allowed; }
.role-swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.sticky-save { position: sticky; bottom: 0; background: rgba(246,245,251,.92); backdrop-filter: blur(6px); padding: .9rem 0; border-top: 1px solid var(--line); z-index: 5; }

/* ── Form builder ───────────────────────────────────────────── */
.fb-row { display: flex; align-items: center; gap: .9rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--paper); }
.fb-row:last-child { border-bottom: 0; }
.fb-row.inactive { opacity: .5; }
.fb-row.section { background: var(--jacaranda-50); }
.fb-handle { cursor: grab; color: var(--muted); padding: .2rem; display: grid; }
.fb-handle:active { cursor: grabbing; }
.fb-main { flex: 1; min-width: 0; }
.fb-main strong { display: block; }
.sortable-ghost { opacity: .35; }

/* ── Location tree ──────────────────────────────────────────── */
.tree ul { list-style: none; margin: 0; padding-left: 1.3rem; border-left: 1px dashed var(--line-2); }
.tree > ul { padding-left: 0; border-left: 0; }
.tree li { padding: .2rem 0; }
.tree .node { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; border-radius: var(--r-sm); }
.tree .node:hover { background: var(--surface); }
.tree .type { font-size: .72rem; color: var(--muted); }

/* ── Auth & public ──────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-art {
  position: relative; overflow: hidden; background: var(--jacaranda); color: #fff;
  padding: 2.5rem; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-art .brand { color: #fff; }
.auth-art h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.3rem); font-weight: 800; line-height: 1.02; max-width: 12ch; margin: 0 0 1rem; }
.auth-art p { color: #E3D9FF; max-width: 36ch; }
.auth-art .fold { position: absolute; right: -60px; bottom: -40px; width: 420px; opacity: .14; }
.auth-form { display: grid; place-items: center; padding: 2.5rem 1.25rem; background: var(--paper); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { margin-bottom: .3rem; }
.divider-text { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .85rem; margin: 1rem 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.public-top { display: flex; align-items: center; gap: 1.5rem; padding: 1rem clamp(1rem, 4vw, 3rem); background: var(--paper); border-bottom: 1px solid var(--line); }
.public-top nav { display: flex; gap: 1.4rem; flex: 1; }
.public-top nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.public-top nav a:hover { color: var(--jacaranda); }

.hero { padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem) 3rem; background: var(--jacaranda); color: #fff; position: relative; overflow: hidden; }
.hero-inner { max-width: 1100px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.6rem, 1.5rem + 5vw, 5.4rem); font-weight: 800; line-height: .95; letter-spacing: -.035em; max-width: 11ch; margin-bottom: 1.2rem; }
.hero p { font-size: 1.15rem; color: #E3D9FF; max-width: 46ch; }
.hero .fold { position: absolute; right: -4%; top: 8%; width: min(46vw, 560px); opacity: .16; }
.search-box { margin-top: 2rem; background: var(--paper); color: var(--ink); border-radius: var(--r-lg); padding: .6rem; box-shadow: var(--shadow-pop); max-width: 920px; }
.search-tabs { display: flex; gap: .3rem; padding: .2rem .2rem .6rem; flex-wrap: wrap; }
.search-tabs button { border: 0; background: none; font: 600 .95rem var(--font-body); padding: .45rem .9rem; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.search-tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.search-row { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr auto; gap: .5rem; }
.search-row .input, .search-row .select { border-color: var(--line); background: var(--surface); }
.popular { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.popular a { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.35); padding: .35rem .8rem; border-radius: 999px; font-size: .9rem; }
.popular a:hover { background: rgba(255,255,255,.12); color: #fff; }

.trust { max-width: 1100px; margin: 0 auto; padding: 3.5rem clamp(1rem, 4vw, 3rem); display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2.5rem; }
.trust h3 { font-size: 1.2rem; }
.trust p { color: var(--muted); margin: 0; }
.trust .mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: .9rem; }

.footer { padding: 2rem clamp(1rem, 4vw, 3rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty h3 { color: var(--ink); }

/* Pagination */
.pager { display: flex; gap: .3rem; justify-content: flex-end; padding: 1rem 1.4rem; }
.pager a, .pager span { padding: .4rem .75rem; border-radius: var(--r-sm); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-size: .88rem; }
.pager .current { background: var(--jacaranda); border-color: var(--jacaranda); color: #fff; }
.pager .disabled { opacity: .4; }

/* Modal (dialog element) */
dialog.modal { border: 0; border-radius: var(--r-lg); padding: 0; width: min(560px, calc(100vw - 2rem)); box-shadow: var(--shadow-pop); color: var(--ink); }
dialog.modal::backdrop { background: rgba(27, 22, 54, .45); }
.modal-head { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 1.3rem 1.4rem; }
.modal-foot { padding: 1rem 1.4rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .6rem; }

.health li { display: flex; align-items: center; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.health li:last-child { border: 0; }
.health ul { list-style: none; margin: 0; padding: 0; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .8rem; padding: .7rem 1.4rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.feed li:last-child { border: 0; }
.feed time { color: var(--muted); white-space: nowrap; margin-left: auto; font-size: .82rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics > div:nth-child(3) { border-left: 0; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .content { padding: 1.25rem 1rem; }
  .topbar { padding: .75rem 1rem; }
  .form-grid, .grid-2, .perm-list { grid-template-columns: minmax(0, 1fr); }
  .perm-meter { display: none; }
  .perm-head, .perm-list { padding-left: 1rem; padding-right: 1rem; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 220px; padding: 1.5rem; }
  .auth-art h2 { font-size: 2rem; }
  .search-row { grid-template-columns: 1fr; }
  .public-top nav { display: none; }
  .trust { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Phase 2 — catalogue
   ========================================================================== */

/* Protected media: no drag, no long-press save, no selection. Watermark is the real defence. */
.pm { position: relative; overflow: hidden; background: #E9E6F3; -webkit-touch-callout: none; user-select: none; }
.pm img, .pm video { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-drag: none; pointer-events: none; }
.pm::after { content: ""; position: absolute; inset: 0; } /* shield layer so right-click hits nothing useful */

.cat-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1.75rem; max-width: 1360px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem; }
.cat-top { background: var(--paper); border-bottom: 1px solid var(--line); }
.cat-top-inner { max-width: 1360px; margin: 0 auto; padding: 1rem clamp(1rem, 3vw, 2rem); display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.seg { max-width: 100%; overflow-x: auto; display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg a, .seg button { border: 0; background: none; font: 600 .9rem var(--font-body); padding: .45rem .95rem; border-radius: 999px; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.seg .on { background: var(--ink); color: #fff; }

.filters { position: sticky; top: 1rem; align-self: start; }
.filters .panel-pad + .panel-pad { border-top: 1px solid var(--line); }
.filters h3 { font-size: .95rem; margin-bottom: .6rem; }
.filters .check { display: flex; }
.filters .stack > * + * { margin-top: .5rem; }
.filters .counter { gap: .3rem; }
.filters .choice span { padding: .4rem .7rem; }
.filters-toggle { display: none; }
.results-head .select { width: auto; }
.gallery .pm img { object-position: right bottom; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.counter { display: flex; gap: .35rem; flex-wrap: wrap; }
.counter label span { min-width: 42px; text-align: center; }

.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.results-head h1 { font-size: clamp(1.3rem, 1rem + 1vw, 1.75rem); margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.4rem; }
.lcard { position: relative; background: var(--paper); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; }
.lcard:hover { border-color: var(--line-2); }
.lcard:focus-within { box-shadow: var(--focus); }
.lcard-media { position: relative; }
.lcard .pm { aspect-ratio: 4 / 3; }
.lcard-link { position: absolute; inset: 0; z-index: 1; }
.lcard-link:focus-visible { box-shadow: none; }
.chip { position: absolute; z-index: 2; font-size: .76rem; font-weight: 700; padding: .28rem .6rem; border-radius: 999px; letter-spacing: .01em; }
.chip-rent { top: .75rem; left: .75rem; background: var(--jacaranda); color: #fff; }
.chip-sale { top: .75rem; left: .75rem; background: var(--mango); color: var(--ink); }
.chip-media { bottom: .75rem; left: .75rem; background: rgba(27,22,54,.78); color: #fff; display: inline-flex; gap: .5rem; }
.chip-new { top: .75rem; left: 6.4rem; background: #fff; color: var(--ink); }
.heart { position: absolute; z-index: 3; top: .6rem; right: .6rem; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.heart[aria-pressed="true"] { color: #E0245E; }
.heart[aria-pressed="true"] svg { fill: currentColor; }
.lcard-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.price { font-family: var(--font-display); font-weight: 750; font-size: 1.35rem; letter-spacing: -.01em; color: var(--ink); }
.price small { font-family: var(--font-body); font-weight: 500; font-size: .85rem; color: var(--muted); letter-spacing: 0; }
.lcard-title { font-weight: 600; color: var(--ink); line-height: 1.35; }
.lcard-area { color: var(--muted); font-size: .9rem; }
.facts { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .88rem; color: var(--ink-2); margin-top: .5rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.trust-line { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: auto; padding-top: .6rem; font-size: .82rem; }
.trust-line .verified svg { width: 15px; height: 15px; }
.trusted { color: var(--jacaranda-700); font-weight: 700; display: inline-flex; gap: .3rem; align-items: center; }

#map { height: calc(100vh - 220px); min-height: 460px; border-radius: var(--r-lg); border: 1px solid var(--line); z-index: 0; }
.map-pop { width: 220px; }
.map-pop img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
.map-pop strong { display: block; margin-top: .4rem; font-family: var(--font-display); font-size: 1.05rem; }

/* Detail page */
.detail { max-width: 1240px; margin: 0 auto; padding: 1.25rem clamp(1rem, 3vw, 2rem) 4rem; }
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: .5rem; height: clamp(300px, 52vw, 540px); border-radius: var(--r-lg); overflow: hidden; }
.gallery .pm { cursor: zoom-in; }
.gallery .pm:first-child { grid-row: span 2; }
.gallery .more { position: absolute; inset: auto .75rem .75rem auto; z-index: 2; }
.gallery-1 { grid-template-columns: 1fr; }
.gallery-1 .pm:first-child { grid-row: span 2; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2.5rem; margin-top: 1.75rem; }
.detail h1 { font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.2rem); margin: .4rem 0 .3rem; }
.detail .price { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); }
.keyfacts { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; }
.keyfacts span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .85rem; font-weight: 600; font-size: .92rem; }
.section-title { font-size: 1.2rem; margin: 2rem 0 .8rem; }
.desc { white-space: pre-line; max-width: 70ch; }
.amen { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .45rem 1rem; list-style: none; padding: 0; margin: 0; }
.amen li { display: flex; gap: .5rem; align-items: center; }
.amen svg { color: var(--lake); flex: none; }
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; margin: 0; }
.dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; text-align: right; }
.aside-card { position: sticky; top: 1rem; }
.aside-card .panel-pad + .panel-pad { border-top: 1px solid var(--line); }
.badge-row { display: flex; flex-direction: column; gap: .55rem; }
.badge-row > div { display: flex; gap: .6rem; align-items: flex-start; }
.badge-row .ok { color: #00756C; }
.badge-row .no { color: var(--muted); }
#detail-map { height: 300px; border-radius: var(--r-md); border: 1px solid var(--line); z-index: 0; }
.pano-box { height: clamp(280px, 50vw, 520px); border-radius: var(--r-lg); overflow: hidden; background: var(--ink); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(14,10,32,.94); display: grid; grid-template-rows: auto 1fr auto; color: #fff; }
.lightbox-top { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; }
.lightbox-stage { display: grid; place-items: center; padding: 0 3.5rem; min-height: 0; }
.lightbox-stage .pm { background: transparent; max-width: 100%; max-height: 100%; }
.lightbox-stage .pm img, .lightbox-stage .pm video { object-fit: contain; max-height: calc(100vh - 160px); width: auto; max-width: 100%; margin: 0 auto; }
.lightbox-stage video { pointer-events: auto; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); border: 0; color: #fff; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.lb-prev { left: .8rem; } .lb-next { right: .8rem; }
.lb-prev svg { transform: rotate(180deg); }
.thumbs { display: flex; gap: .4rem; overflow-x: auto; padding: .7rem 1rem; }
.thumbs button { flex: none; width: 76px; height: 56px; border: 2px solid transparent; border-radius: 6px; padding: 0; overflow: hidden; background: none; cursor: pointer; opacity: .6; }
.thumbs button.on { border-color: var(--mango); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* Compare */
.compare { overflow-x: auto; }
.compare table { border-collapse: separate; border-spacing: 0; min-width: 720px; width: 100%; }
.compare th, .compare td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; width: 25%; }
.compare th { color: var(--muted); font-weight: 600; width: 160px; background: var(--surface); position: sticky; left: 0; }
.compare .best { color: #00756C; font-weight: 700; }

/* Media manager (admin) */
.dropzone { border: 2px dashed var(--line-2); border-radius: var(--r-md); padding: 1.6rem; text-align: center; background: var(--surface); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--jacaranda); background: var(--jacaranda-50); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; }
.mtile { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--paper); }
.mtile .pm { aspect-ratio: 4/3; }
.mtile .pm img { pointer-events: auto; }
.mtile-body { padding: .55rem .65rem; font-size: .8rem; display: flex; flex-direction: column; gap: .35rem; }
.mtile .status { position: absolute; inset: auto auto .5rem .5rem; z-index: 2; }
.mtile.cover { border-color: var(--mango); box-shadow: 0 0 0 2px var(--mango); }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--jacaranda); transition: width .2s; }
.pin-map { height: 340px; border-radius: var(--r-md); border: 1px solid var(--line); z-index: 0; }
.steps { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.steps a { padding: .7rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.steps a.on { color: var(--jacaranda-700); border-color: var(--jacaranda); }
.signal { display: flex; gap: .7rem; padding: .8rem 1rem; border-radius: var(--r-sm); margin-bottom: .5rem; }
.signal-high { background: var(--danger-50); color: #8A1028; }
.signal-medium { background: var(--mango-50); color: #6B4100; }
.signal-low { background: var(--surface); color: var(--ink-2); }
.status-pill { font-size: .78rem; }
.st-published { background: var(--lake-50); color: #00756C; border-color: transparent; }
.st-submitted { background: var(--jacaranda-50); color: var(--jacaranda-700); border-color: transparent; }
.st-changes_requested, .st-expired { background: var(--mango-50); color: var(--warn); border-color: transparent; }
.st-rejected, .st-unpublished { background: var(--danger-50); color: var(--danger); border-color: transparent; }
.private-box { border: 1px dashed #E5A21B; background: #FFFBF1; border-radius: var(--r-md); padding: 1rem 1.1rem; }

@media (max-width: 1080px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .aside-card { position: static; }
}
@media (max-width: 860px) {
  .cat-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; display: none; }
  .filters.show { display: block; }
  .filters-toggle { display: inline-flex; }
  .gallery { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 62vw; }
  .gallery .pm:not(:first-child) { display: none; }
  .dl { grid-template-columns: 1fr; }
  .lightbox-stage { padding: 0 .5rem; }
}

/* ==========================================================================
   Phase 3 — viewing list & checkout
   ========================================================================== */
.vl-add { position: relative; z-index: 2; margin-top: .8rem; background: var(--jacaranda-50); color: var(--jacaranda-700); border: 1px solid transparent; }
.vl-add:hover { background: var(--jacaranda-100); color: var(--jacaranda-700); }
.vl-add[aria-pressed="true"] { background: var(--lake-50); color: #00756C; }
.vl-add .when-on, .vl-add[aria-pressed="true"] .when-off { display: none; }
.vl-add[aria-pressed="true"] .when-on { display: inline-flex; gap: .4rem; align-items: center; }
.vl-add .when-off { display: inline-flex; gap: .4rem; align-items: center; }
.btn.vl-big { width: 100%; padding: .9rem; font-size: 1rem; }

.vl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 2rem; align-items: start; }
.vl-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.vl-row:last-child { border-bottom: 0; }
.vl-row .pm { width: 112px; height: 84px; border-radius: 10px; }
.vl-row .price { font-size: 1.05rem; }
.summary { position: sticky; top: 1rem; }
.sum-line { display: flex; justify-content: space-between; padding: .45rem 0; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .8rem; }
.sum-total strong { font-family: var(--font-display); font-size: 1.6rem; }
.hint { background: var(--mango-50); color: #6B4100; border-radius: var(--r-sm); padding: .6rem .8rem; font-size: .88rem; }
.slot-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; }
.mpesa-input { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; background: var(--paper); }
.mpesa-input span { white-space: nowrap; display: grid; place-items: center; padding: 0 .8rem; background: var(--surface); border-right: 1px solid var(--line); font-weight: 700; color: var(--ink-2); }
.mpesa-input input { border: 0; flex: 1; padding: .75rem .8rem; font: inherit; font-size: 1.05rem; letter-spacing: .02em; }
.mpesa-input:focus-within { border-color: var(--jacaranda); box-shadow: var(--focus); }

.pay-card { max-width: 560px; margin: 2.5rem auto; text-align: center; }
.phone-ill { width: 120px; height: 200px; margin: 0 auto 1.4rem; border-radius: 26px; border: 6px solid var(--ink); position: relative; background: var(--surface); display: grid; place-items: center; }
.phone-ill::before { content: ""; position: absolute; top: 8px; width: 34px; height: 5px; border-radius: 4px; background: var(--ink); }
.phone-ill .bubble { width: 84px; border-radius: 10px; background: #fff; box-shadow: 0 6px 16px rgba(27,22,54,.18); padding: .5rem; font-size: .66rem; text-align: left; line-height: 1.3; }
.phone-ill .bubble b { color: #1E9E3C; display: block; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.state-ok { color: #00756C; }
.state-bad { color: var(--danger); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 1.8rem; }
.timeline li::before { content: ""; position: absolute; left: .45rem; top: 1.1rem; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: .2rem; width: 16px; height: 16px; border-radius: 50%; background: var(--line-2); }
.timeline .done .dot { background: var(--lake); }
.timeline .now .dot { background: var(--jacaranda); box-shadow: 0 0 0 4px var(--jacaranda-100); }
.timeline .todo { color: var(--muted); }
.receipt-box { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 1rem 1.2rem; background: var(--paper); }
.st-new, .st-pending_payment { background: var(--mango-50); color: var(--warn); border-color: transparent; }
.st-in_progress, .st-scheduled { background: var(--jacaranda-50); color: var(--jacaranda-700); border-color: transparent; }
.st-visited, .st-confirmed, .st-succeeded { background: var(--lake-50); color: #00756C; border-color: transparent; }
.st-flagged, .st-failed, .st-cancelled, .st-timeout { background: var(--danger-50); color: var(--danger); border-color: transparent; }
.st-awaiting_customer, .st-verifying, .st-initiated { background: var(--jacaranda-50); color: var(--jacaranda-700); border-color: transparent; }
.sla-late { color: var(--danger); font-weight: 700; }

@media (max-width: 1080px) { .vl-layout { grid-template-columns: minmax(0, 1fr); } .summary { position: static; } }
@media (max-width: 860px) {
  .vl-row { grid-template-columns: 84px minmax(0, 1fr); }
  .vl-row .pm { width: 84px; height: 64px; }
  .vl-row > :last-child { grid-column: 2; }
  .public-top { gap: .6rem; padding: .7rem 1rem; }
  .public-top .brand-word { font-size: 1.2rem; }
  .public-top .hide-sm { display: none; }
  #vl-btn { padding: .45rem .6rem; }
}

/* ==========================================================================
   Phase 4 — request CRM
   ========================================================================== */
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; }
.board-col { background: #EFEDF7; border-radius: var(--r-md); padding: .7rem; min-height: 300px; }
.board-col h3 { display: flex; justify-content: space-between; font-size: .92rem; margin: .2rem .3rem .7rem; }
.board-list { display: flex; flex-direction: column; gap: .55rem; min-height: 200px; }
.bcard { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; cursor: grab; text-decoration: none; color: inherit; display: block; }
.bcard:hover { border-color: var(--jacaranda); }
.bcard .row { display: flex; justify-content: space-between; gap: .5rem; align-items: center; font-size: .82rem; }
.bcard.late { border-left: 4px solid var(--danger); }
.dot-unread { width: 9px; height: 9px; border-radius: 50%; background: var(--mango); display: inline-block; }

.ws { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.ws-head { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.pipeline { display: flex; gap: .3rem; flex-wrap: wrap; margin: .6rem 0 1.2rem; }
.pipeline span { padding: .35rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.pipeline .done { background: var(--lake-50); color: #00756C; border-color: transparent; }
.pipeline .cur { background: var(--jacaranda); color: #fff; border-color: transparent; }
.composer { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.composer .tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.composer .tabs button { border: 0; background: none; padding: .75rem 1rem; font: 600 .9rem var(--font-body); color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; gap: .4rem; align-items: center; }
.composer .tabs button.on { color: var(--jacaranda-700); border-color: var(--jacaranda); }
.composer .pane { padding: 1rem; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: .7rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.tl li:last-child { border-bottom: 0; }
.tl .ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); }
.tl .ico.in { background: var(--mango-50); color: var(--warn); }
.tl .ico.out { background: var(--jacaranda-50); color: var(--jacaranda-700); }
.tl .ico.sys { background: var(--lake-50); color: #00756C; }
.tl .meta { font-size: .8rem; color: var(--muted); }
.bubble-in, .bubble-out { border-radius: 12px; padding: .6rem .8rem; margin-top: .35rem; white-space: pre-line; max-width: 62ch; }
.bubble-in { background: var(--mango-50); }
.bubble-out { background: var(--jacaranda-50); }
.chip-ch { font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); margin-left: .3rem; }
.item-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.item-card:last-child { border-bottom: 0; }
.item-card .pm { width: 64px; height: 48px; border-radius: 8px; }
.visit { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; margin-bottom: .5rem; }
.visit.upcoming { border-color: var(--jacaranda-100); background: #FBFAFF; }
.stars { display: flex; gap: .3rem; flex-direction: row-reverse; justify-content: center; }
.stars input { position: absolute; opacity: 0; }
.stars label { font-size: 2.4rem; line-height: 1; color: var(--line-2); cursor: pointer; transition: color .1s; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--mango); }
.stars input:focus-visible + label { outline: 2px solid var(--jacaranda); border-radius: 4px; }
.nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: .25rem; }
.nps label span { display: block; text-align: center; padding: .5rem 0; border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; font-weight: 600; font-size: .85rem; }
.nps input { position: absolute; opacity: 0; }
.nps input:checked + span { background: var(--jacaranda); color: #fff; border-color: var(--jacaranda); }

@media (max-width: 1080px) { .ws { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Phase 5 — live chat & inbox
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chatw { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60; }
.chatw-fab { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--jacaranda); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-pop); position: relative; }
.chatw-fab:hover { background: var(--jacaranda-700); }
.chatw-badge { position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--mango); color: var(--ink); font-size: .75rem; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.chatw-panel { position: absolute; right: 0; bottom: 72px; width: min(380px, calc(100vw - 2rem)); height: min(560px, calc(100vh - 120px)); background: var(--paper); border-radius: var(--r-lg); box-shadow: 0 24px 60px -18px rgba(27,22,54,.45); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.chatw-head { display: flex; gap: .7rem; align-items: center; padding: .9rem 1rem; background: var(--jacaranda); color: #fff; }
.chatw-head .small { color: #E3D9FF; }
.chatw-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3DDC97; margin-right: .2rem; }
.chatw-dot.off { background: var(--mango); }
.chatw-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; background: var(--surface); }
.chatw-msg { max-width: 82%; padding: .55rem .8rem; border-radius: 14px; white-space: pre-line; font-size: .93rem; line-height: 1.45; }
.chatw-msg small { display: block; font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.chatw-msg.them { background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.chatw-msg.me { background: var(--jacaranda); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chatw-context { font-size: .82rem; background: var(--mango-50); color: #6B4100; border-radius: 10px; padding: .45rem .65rem; line-height: 1.4; }
.chatw-context svg { vertical-align: -2px; margin-right: .2rem; }
.chatw-form { border-top: 1px solid var(--line); padding: .7rem; background: var(--paper); }
.chatw-contact { display: grid; gap: .4rem; margin-bottom: .5rem; }
.chatw-contact .input { padding: .5rem .65rem; font-size: .9rem; }
.chatw-contact .choice span { padding: .3rem .6rem; font-size: .8rem; }
.chatw-input { display: flex; gap: .4rem; align-items: flex-end; }
.chatw-input textarea { flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 12px; padding: .6rem .7rem; font: inherit; max-height: 120px; }
.chatw-input textarea:focus { outline: none; border-color: var(--jacaranda); box-shadow: var(--focus); }
.chatw-fine { font-size: .72rem; color: var(--muted); margin: .4rem 0 0; text-align: center; }

.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr) 300px; gap: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); min-height: calc(100vh - 180px); overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox-list .filters-bar { padding: .7rem; border-bottom: 1px solid var(--line); display: grid; gap: .5rem; }
.inbox-items { overflow-y: auto; flex: 1; }
.conv { display: block; padding: .8rem .9rem; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.conv:hover { background: var(--surface); }
.conv.on { background: var(--jacaranda-50); box-shadow: inset 3px 0 0 var(--jacaranda); }
.conv .row { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.conv .snippet { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .waiting { color: var(--danger); font-weight: 700; font-size: .78rem; }
.ch-badge { font-size: .68rem; font-weight: 800; padding: .1rem .4rem; border-radius: 5px; letter-spacing: .02em; }
.ch-web { background: var(--jacaranda-50); color: var(--jacaranda-700); }
.ch-whatsapp { background: #DFF7E6; color: #13803B; }
.ch-sms { background: var(--mango-50); color: var(--warn); }
.ch-email { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.inbox-thread { display: flex; flex-direction: column; min-height: 0; }
.thread-head { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.thread-body { flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: .55rem; background: var(--surface); max-height: calc(100vh - 360px); }
.tmsg { max-width: 72%; padding: .6rem .85rem; border-radius: 14px; white-space: pre-line; }
.tmsg .meta { font-size: .72rem; color: var(--muted); margin-top: .25rem; }
.tmsg.in { background: var(--paper); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.tmsg.out { background: var(--jacaranda); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.tmsg.out .meta { color: #E3D9FF; }
.tmsg.note { background: var(--mango-50); color: #6B4100; align-self: center; max-width: 85%; font-size: .88rem; border-radius: 10px; }
.tmsg.note .meta { color: #8a6a2a; }
.thread-compose { border-top: 1px solid var(--line); padding: .8rem 1rem; }
.inbox-side { border-left: 1px solid var(--line); padding: 1rem; overflow-y: auto; }
.inbox-side h3 { font-size: .95rem; margin-top: 1rem; }
.inbox-side h3:first-child { margin-top: 0; }
.show-sm { display: none; }
.thread-compose .textarea { min-height: 72px; }
.nav .count { margin-left: auto; background: var(--mango); color: var(--ink); border-radius: 999px; font-size: .72rem; font-weight: 800; padding: .05rem .5rem; }

@media (max-width: 1200px) { .inbox { grid-template-columns: 290px minmax(0, 1fr); } .inbox-side { display: none; } }
@media (max-width: 860px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.has-c .inbox-list { display: none; }
  .inbox:not(.has-c) .inbox-thread { display: none; }
  .show-sm { display: inline-flex; }
  .thread-body { max-height: 55vh; }
  .chatw { right: .8rem; bottom: .8rem; }
}

/* ==========================================================================
   Phase 6 — rentals
   ========================================================================== */
.metrics .value { white-space: nowrap; font-size: clamp(1.35rem, 2.1vw, 2.3rem); }
.table .num, .table td.num { white-space: nowrap; }
.links { display: grid; gap: .45rem; }
.links > a { display: block; }
.balance-card .big { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 2.6rem); font-weight: 750; margin: .1rem 0 0; line-height: 1; }
details > summary { list-style-position: inside; }
@media print { .sidebar, .topbar, .seg, form.no-print { display: none !important; } .main { margin: 0 !important; } }

/* ==========================================================================
   Phase 7 — trust & growth
   ========================================================================== */
.understood { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .35rem; }
.understood .chip { position: static; background: var(--jacaranda-50); color: var(--jacaranda-700); }
.home-row { max-width: 1200px; margin: 2.5rem auto 0; padding: 0 1.25rem; }
.invest-cta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.4rem 1.6rem; margin-bottom: 2.5rem; }
.invest-strip { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: 2rem; }
.invest-strip > span { flex: 1 1 280px; }
.invest-result .big, .balance-card .big { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 750; line-height: 1.1; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 84px; padding: .2rem 0; }
.spark i { flex: 1; background: var(--jacaranda); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.spark i:hover { opacity: 1; background: var(--jacaranda-700); }
.funnel { display: grid; gap: .55rem; }
.funnel-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 80px 50px; gap: .6rem; align-items: center; font-size: .92rem; }
.funnel-row .bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.funnel-row .bar i { display: block; height: 100%; background: var(--jacaranda); }
.mod-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); overflow: hidden; }
.mod-score { display: grid; place-content: center; text-align: center; gap: .1rem; color: #fff; }
.mod-score strong { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; }
.mod-score span { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.score-high { background: var(--danger); }
.score-medium { background: var(--warn); }
.score-low { background: var(--muted); }
.mod-body { padding: 1rem 1.1rem; display: grid; gap: .6rem; }
.mod-signals { margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; font-size: .9rem; }
.mod-signals li { padding-left: .7rem; border-left: 3px solid var(--line); }
.mod-signals .sig-high { border-color: var(--danger); }
.mod-signals .sig-medium { border-color: var(--warn); }
.pro-card { text-decoration: none; color: inherit; display: block; }
.pro-card:hover { border-color: var(--jacaranda); }
.pro-hero { background: linear-gradient(120deg, var(--paper), var(--jacaranda-50)); }
.plan-card.on { border-color: var(--jacaranda); box-shadow: 0 0 0 2px var(--jacaranda-50); }
.dcard .chip-new { left: .6rem; }
@media (max-width: 720px) {
  .funnel-row { grid-template-columns: 1fr 60px 44px; }
  .funnel-row .bar { grid-column: 1 / -1; order: 2; }
  .mod-item { grid-template-columns: 1fr; }
  .mod-score { grid-auto-flow: column; justify-content: start; gap: .6rem; padding: .5rem 1rem; }
}

/* Legal pages (Phase 9) */
.legal-body { line-height: 1.65; color: var(--ink-2); }
.legal-body h2 { font-family: var(--font-display); color: var(--ink); font-size: 1.2rem; margin: 1.6rem 0 .5rem; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body ul { padding-left: 1.2rem; }
.legal-body li { margin: .3rem 0; }
.legal-body table { width: 100%; border-collapse: collapse; margin: .8rem 0; font-size: .92rem; }
.legal-body th, .legal-body td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-body th { color: var(--ink); background: var(--surface); }
