/* Brand typeface for the wordmark and headlines (Manrope ExtraBold, SIL OFL, self-hosted: CSP font-src 'self'). */
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-800-latin.woff2?v=2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

/* Dealcraft CRM: hand-written CSS, system fonts, no framework (CSP stays 'self'). */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #dfe3e8;
  --text: #1b2430;
  --muted: #5d6b7a;
  /* Brand (logo direction B): navy + teal. UI teal is darker than the logo teal so text passes WCAG AA. */
  --navy: #1b2a4a;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: #ccfbf1;
  --logo-ink: #1b2a4a;
  --logo-accent: #0d9488;
  --display: "Manrope", var(--font);
  --info: #2457c5;   --info-soft: #e7eefc;
  --good: #1f7a3d;   --good-soft: #e3f4e8;
  --bad: #b42318;    --bad-soft: #fdecea;
  --hot: #a35200;    --hot-soft: #fff1e0;
  --warn-soft: #fff6d6; --warn: #7a5a00;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-w: 220px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419; --surface: #161d24; --surface-2: #1d262f; --border: #2a3540;
    --text: #e6ebf0; --muted: #98a6b3; --brand: #2dd4bf; --brand-ink: #042f2e; --brand-soft: #0f2f2c;
    --navy: #e8edf6; --logo-ink: #e8edf6; --logo-accent: #2dd4bf;
    --info: #8fb0ff; --info-soft: #18233b; --good: #6fd39a; --good-soft: #142b1e;
    --bad: #ff8b80; --bad-soft: #351816; --hot: #ffb36b; --hot-soft: #33220f;
    --warn-soft: #2f2810; --warn: #f2d27a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
code { font-family: var(--mono); font-size: .9em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: none; }
.mark { width: 30px; height: 30px; flex: none; }
.mark-bar { fill: var(--logo-ink); }
.mark-accent { fill: var(--logo-accent); }
.mark-roof { fill: none; stroke: var(--logo-accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.wordmark { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; color: var(--logo-ink); font-size: 1.3rem; line-height: 1; display: inline-flex; align-items: baseline; gap: 6px; }
.wordmark .tm { font-family: var(--font); font-weight: 600; font-size: .42em; letter-spacing: 0; align-self: flex-start; margin: .1em 0 0 -4px; }
.wordmark small { font-family: var(--font); font-weight: 600; font-size: .62em; letter-spacing: 0; color: var(--brand); }

/* ---------- App shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.topsearch { flex: 1; max-width: 520px; }
.topsearch input { width: 100%; }
.account-menu { margin-left: auto; }
.sidenav {
  position: fixed; top: 56px; bottom: 0; left: 0; width: var(--nav-w); padding: 12px 10px;
  background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.sidenav a:hover { background: var(--surface-2); color: var(--text); }
.sidenav a.active { background: var(--brand-soft); color: var(--brand); }
.sidenav .nav-settings { margin-top: auto; }
.in-app .banner, .in-app .flashes, .app-main { margin-left: var(--nav-w); }
.app-main { padding: 24px; max-width: calc(1280px + var(--nav-w)); }
.in-app .sitefoot { margin-left: var(--nav-w); }

.banner { padding: 9px 24px; font-size: .92rem; border-bottom: 1px solid var(--border); }
.banner a, .banner .linkish { margin-left: 8px; font-weight: 600; }
.banner-info { background: var(--info-soft); color: var(--info); }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.flashes:empty { display: none; }
.flashes { padding: 12px 24px 0; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; border: 1px solid transparent; }
.flash-success { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.flash-error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.flash-info { background: var(--info-soft); color: var(--info); }
.flash-warn { background: var(--warn-soft); color: var(--warn); }

/* dropdown menu built on <details> so it works without JS */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); font-weight: 500; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; padding: 6px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.menu-head { padding: 8px 10px; font-weight: 600; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-head small { display: block; font-weight: 400; }
.menu-label { display: block; padding: 6px 10px 2px; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.current { font-weight: 600; color: var(--brand); }

/* ---------- Page structure ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.narrow { max-width: 460px; margin: 40px auto; padding: 0 16px; }
.medium { max-width: 760px; margin: 32px auto; padding: 0 16px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; }
.stat:hover { border-color: var(--brand); }
.stat .label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat .value { font-size: 1.9rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .note { font-size: .8rem; color: var(--muted); }
.stat.alert .value { color: var(--bad); }

/* definition list for record details */
.details { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; margin: 0; }
.details div { min-width: 0; }
.details dt { font-size: .8rem; color: var(--muted); }
.details dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Forms ---------- */
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=url],
input[type=number], input[type=date], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; min-height: 38px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .field legend, .label-text { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
.hint { font-size: .8rem; }
.checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks legend { width: 100%; margin-bottom: 4px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--text); }
.money-input { display: flex; align-items: stretch; }
.money-input span { display: flex; align-items: center; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px; color: var(--muted); }
.money-input input { border-radius: 0 8px 8px 0; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.req::after { content: " *"; color: var(--bad); }
fieldset.section { border: 0; border-top: 1px solid var(--border); padding: 14px 0 0; margin: 14px 0 0; }
fieldset.section > legend { font-weight: 700; padding-right: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.inline { display: inline; }
.warning-box { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.warning-box ul { margin: 6px 0; padding-left: 20px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center; padding: 8px 14px; min-height: 38px;
  font: inherit; font-weight: 600; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand);
  color: var(--brand-ink); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.07); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); filter: none; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-small { padding: 5px 10px; min-height: 32px; font-size: .88rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 140px; flex: 1 1 140px; max-width: 220px; }
.filters .field.grow { max-width: 320px; flex-basis: 220px; }
.filters .btns { display: flex; gap: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
th a { color: inherit; text-decoration: none; }
th a.sorted { color: var(--brand); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub, dd .sub { display: block; font-size: .82rem; color: var(--muted); }
dd.updating { opacity: .6; transition: opacity .2s; }
.overdue { color: var(--bad); font-weight: 600; }
.due-today { color: var(--hot); font-weight: 600; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.pager { display: flex; gap: 12px; align-items: center; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-hot { background: var(--hot-soft); color: var(--hot); }
.badge-muted { background: var(--surface-2); color: var(--muted); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty p { margin-bottom: 12px; }

/* lists inside cards */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list .meta { font-size: .82rem; color: var(--muted); }
.list .main { min-width: 0; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline li:last-child { border-left-color: transparent; }
.timeline .when { font-size: .8rem; color: var(--muted); }
.timeline .what { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Pipeline ---------- */
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.pipe-col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.pipe-col h2 { font-size: .9rem; display: flex; justify-content: space-between; align-items: center; margin: 2px 2px 10px; }
.pipe-col h2 .count { background: var(--surface); border-radius: 999px; padding: 1px 9px; font-size: .8rem; }
.pipe-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); }
.pipe-card a.title { font-weight: 600; text-decoration: none; color: var(--text); display: block; }
.pipe-card a.title:hover { color: var(--brand); }
.pipe-card .meta { font-size: .8rem; color: var(--muted); margin: 2px 0 8px; }
.pipe-card form { display: flex; gap: 6px; }
.pipe-card select { min-height: 30px; padding: 3px 6px; font-size: .85rem; }
.pipe-outcomes { margin-top: 18px; }
.stage-steps { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 14px; }
.stage-steps span { font-size: .75rem; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.stage-steps span.done { background: var(--brand-soft); color: var(--brand); }
.stage-steps span.current { background: var(--brand); color: var(--brand-ink); font-weight: 600; }

/* ---------- Calculator ---------- */
.calc table td, .calc table th { padding: 6px 8px; }
.calc input { min-height: 34px; padding: 5px 8px; text-align: right; }
.calc .money-input span { padding: 0 7px; }
.calc .total td { font-weight: 700; border-top: 2px solid var(--border); }
.calc .result td { font-weight: 700; font-size: 1.05rem; }
.calc .pos { color: var(--good); }
.calc .neg { color: var(--bad); }
.calc-note { font-size: .82rem; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.calc .cost-label input { text-align: left; }
.calc .remove { color: var(--bad); }

/* ---------- Public / marketing ---------- */
.pubbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; max-width: 1160px; margin: 0 auto; flex-wrap: wrap; }
.pubbar nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pubbar nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; }
.hero { max-width: 1160px; margin: 0 auto; padding: 56px 24px 40px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.02em; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-shot { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 50px rgba(16,24,40,.12); padding: 16px; }
.section-pub { max-width: 1160px; margin: 0 auto; padding: 40px 24px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature h3 { margin-bottom: .3em; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); gap: 18px; justify-content: center; }
.price { font-size: 2.2rem; font-weight: 800; }
.price small { font-size: 1rem; font-weight: 500; }
.ticks { list-style: none; padding: 0; margin: 12px 0 18px; }
.ticks li { padding: 4px 0 4px 24px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.legal { max-width: 760px; margin: 0 auto; padding: 24px; }
.legal h2 { margin-top: 1.4em; }
.sitefoot { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; padding: 24px 16px; color: var(--muted); font-size: .85rem; }
.sitefoot a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  :root { --nav-w: 0px; }
  .sidenav {
    position: sticky; top: 56px; z-index: 15; width: auto; height: auto; flex-direction: row; overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--border); padding: 6px 10px;
  }
  .sidenav a { flex: none; padding: 6px 10px; }
  .sidenav .nav-settings { margin-top: 0; }
  .app-main { padding: 16px; }
  .banner, .flashes { padding-left: 16px; padding-right: 16px; }
  .topsearch { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .features, .grid-halves { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .value { font-size: 1.5rem; }
  .filters .field { max-width: none; flex-basis: 100%; }
  /* tables become stacked cards */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  table.stack td { border: 0; padding: 2px 0; text-align: left; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8rem; }
  table.stack td.num { text-align: left; }
  .menu > summary { max-width: 150px; }
}
@media print {
  .topbar, .sidenav, .banner, .sitefoot, .actions, .filters, form { display: none !important; }
  .app-main { margin: 0; }
}

/* ---------- Founding-member pricing ---------- */
.was { color: var(--muted); font-size: .9rem; margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.was s { text-decoration-thickness: 2px; }
.founding-banner {
  background: var(--brand-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-radius: var(--radius); padding: 12px 16px; margin: 0 auto 22px; max-width: 760px; text-align: center;
}
.founding-banner .places { display: inline-block; margin-left: 6px; font-weight: 700; color: var(--brand); }

/* ---------- Help centre ---------- */
.help-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; margin-left: auto;
  border-radius: 50%; border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-weight: 700;
}
.help-btn:hover { color: var(--brand); border-color: var(--brand); }
.help-btn + .account-menu { margin-left: 0; }
.sidenav .nav-help { margin-top: auto; }
.sidenav .nav-help + .nav-settings { margin-top: 0; }
.help-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.help-toc { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; }
.help-toc ol { list-style: none; margin: 0; padding: 0; }
.help-toc a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.help-toc a:hover { background: var(--surface-2); color: var(--text); }
.help-search { margin-bottom: 14px; }
.help-section { scroll-margin-top: 72px; }
.help-section h2 { display: flex; align-items: center; gap: 8px; }
.help-section h3 { margin-top: 1.2em; }
.help-section ul, .help-section ol { padding-left: 20px; margin: 0 0 1em; }
.help-section li { margin-bottom: 4px; }
.help-section table { margin: 8px 0 14px; }
.help-section .table-wrap { box-shadow: none; }
.help-tip { background: var(--info-soft); color: var(--info); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.help-tip strong { color: inherit; }
.help-goto { font-size: .85rem; font-weight: 600; margin-left: auto; }
.help-empty { display: none; }
kbd { font-family: var(--mono); font-size: .85em; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); }
@media (max-width: 860px) {
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-toc input { min-width: 0; }
  .help-toc { position: static; max-height: none; }
  .help-toc ol { display: flex; flex-wrap: wrap; gap: 4px; }
  .help-toc a { border: 1px solid var(--border); }
  .sidenav .nav-help { margin-top: 0; }
}

/* ---------- Referrals ---------- */
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: .9rem; }
.ref-code { font-family: var(--mono); letter-spacing: .08em; font-size: 1.05rem; color: var(--brand); }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }
@media (max-width: 640px) { .copy-row { flex-direction: column; } }

/* ---------- Pipeline drag and drop ---------- */
body:not(.dnd) .dnd-hint, body.dnd .select-hint { display: none; }
body.dnd .pipe-card form { display: none; }
body.dnd .pipe-card { cursor: grab; transition: box-shadow .15s, transform .15s; }
body.dnd .pipe-card:hover { box-shadow: 0 4px 12px rgba(16, 24, 40, .12); }
body.dnd .pipe-card:active { cursor: grabbing; }
.pipe-card.dragging { opacity: .35; }
.pipe-card.saving { opacity: .6; }
.pipe-col { transition: background .12s, outline-color .12s; outline: 2px dashed transparent; outline-offset: -2px; }
.pipe-col.drop-target { background: var(--brand-soft); outline-color: var(--brand); }
.pipe-status:empty { display: none; }
.pipe-status { margin-bottom: 12px; }
.reason-dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; width: min(460px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.reason-dialog::backdrop { background: rgba(15, 20, 25, .45); }
.reason-dialog h2 { font-size: 1.1rem; }
.reason-dialog textarea { margin-top: 4px; }

/* ---------- Pipeline stage settings ---------- */
.stages-table td { vertical-align: middle; }
.stages-table .order-cell { white-space: nowrap; }
.stages-table .order-cell .btn { min-width: 34px; padding: 4px 8px; }
.stages-table input[type=text] { min-width: 180px; }
.pipe-col.pipe-won h2 { color: var(--good); }

/* ---------- Files & storage ---------- */
.usage { min-width: 180px; }
.usage-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 4px; border: 1px solid var(--border); }
.usage-bar span { display: block; height: 100%; border-radius: 999px; }
.usage-good { background: var(--good); }
.usage-hot { background: var(--hot); }
.usage-bad { background: var(--bad); }
.card-head .usage { max-width: 240px; text-align: right; }
.list .main .icon { width: 15px; height: 15px; vertical-align: -2px; color: var(--muted); }

/* ---------- Sortable columns ---------- */
th a.th-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; white-space: nowrap; }
th a.th-sort:hover { color: var(--text); }
th a.th-sort.sorted { color: var(--brand); }
.sort-arrow { font-size: .7rem; opacity: .45; }
th a.th-sort.sorted .sort-arrow, th[aria-sort] .sort-arrow { opacity: 1; }
th.num a.th-sort { justify-content: flex-end; }
th.js-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.js-sortable:hover { color: var(--text); }
th.js-sortable[aria-sort] { color: var(--brand); }
@media (min-width: 641px) { .sort-select { display: none; } }
td[data-label="Ref"], td[data-label="#"] { white-space: nowrap; }

/* ---------- Marketing pages ---------- */
.page-intro { max-width: 760px; margin-bottom: 24px; }
.page-intro h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
.page-intro .lead, .hero p.lead { font-size: 1.12rem; color: var(--muted); }
.toc-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.toc-pills a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-size: .9rem; background: var(--surface); }
.toc-pills a:hover { border-color: var(--brand); color: var(--brand); }
.feature-section { scroll-margin-top: 16px; }
.feature-section h2 { font-size: 1.3rem; }
.how-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 0; list-style: none; counter-reset: step; }
.how-steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 16px 52px; position: relative; counter-increment: step; }
.how-steps li::before { content: counter(step); position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; }
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq-item { margin: 0; padding: 0; }
.faq-item summary { cursor: pointer; padding: 14px 18px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-weight: 700; color: var(--brand); font-size: 1.2rem; }
.faq-item[open] summary::after { content: "−"; }
.faq-item summary h3 { margin: 0; font-size: 1rem; }
.faq-item p { padding: 0 18px 16px; margin: 0; color: var(--muted); }
.cta-band { text-align: center; padding-top: 32px; padding-bottom: 48px; }
.cta-band .btn { margin: 4px; }
@media (max-width: 860px) { .how-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .how-steps { grid-template-columns: 1fr; } }

/* ---------- Brand typography on marketing pages ---------- */
.hero h1, .page-intro h1, .cta-band h2, .section-pub > h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.025em; color: var(--navy); }
.public .pubbar .wordmark { font-size: 1.4rem; }

/* ---------- Strategy analysis & deal pack ---------- */
.strategy-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 14px; }
.strategy-tabs a { padding: 8px 12px; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.strategy-tabs a:hover { color: var(--text); background: var(--surface-2); }
.strategy-tabs a.active { color: var(--brand); background: var(--surface); border-color: var(--border); }
.strategy-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.strategy-grid .form-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.strategy-out { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; transition: opacity .15s; position: sticky; top: 72px; }
.strategy-out.updating { opacity: .55; }
.strategy-results { width: 100%; border-collapse: collapse; }
.strategy-results td { padding: 5px 4px; border-bottom: 1px solid var(--border); background: none; }
.strategy-results tr:last-child td { border-bottom: 0; }
.strategy-results .sr-total td { font-weight: 700; border-top: 2px solid var(--border); }
.strategy-results .sr-result td { font-weight: 700; color: var(--brand); }
.strategy-results .sr-sub td { color: var(--muted); font-size: .88rem; }
.pct-input { display: flex; align-items: stretch; }
.pct-input input { border-radius: 8px 0 0 8px; text-align: right; }
.pct-input span { display: flex; align-items: center; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border); border-left: 0; border-radius: 0 8px 8px 0; color: var(--muted); }
#deal-pack .checks { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1100px) { .strategy-grid { grid-template-columns: 1fr; } .strategy-out { position: static; } }
.pack-strategies { border: 0; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.pack-strategies legend { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.pack-strategy { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--surface); }
.pack-strategy:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pack-strategy input { margin-top: 3px; }
.pack-strategy span { display: flex; flex-direction: column; line-height: 1.3; }
.pack-strategy small { color: var(--muted); font-size: .82rem; }

/* ---------- Refurb estimator ---------- */
.refurb-est { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; background: var(--surface); }
.refurb-est > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 10px 14px; }
.refurb-est > summary::-webkit-details-marker { display: none; }
.refurb-est-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.refurb-est-toggle { margin-left: auto; color: var(--brand); font-weight: 600; font-size: .9rem; }
.refurb-est-toggle::after { content: " ▸"; }
.refurb-est[open] .refurb-est-toggle::after { content: " ▾"; }
.refurb-form { padding: 0 14px 12px; border-top: 1px solid var(--border); }
.refurb-row { display: grid; grid-template-columns: 110px minmax(0, 1.4fr) minmax(0, 1.6fr) 90px 110px; gap: 10px; margin-top: 12px; }
.refurb-scope { font-size: .85rem; margin: 6px 0 4px; }
.refurb-result { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: .92rem; }
.refurb-total { font-size: 1.1rem; color: var(--brand); }
@media (max-width: 900px) { .refurb-row { grid-template-columns: 1fr 1fr; } .refurb-row .field-spec, .refurb-row .field-region { grid-column: span 2; } }
.refurb-row select { font-size: .9rem; padding-left: 8px; padding-right: 4px; }
.refurb-row { grid-template-columns: 100px minmax(0, 1.4fr) minmax(0, 1.5fr) 82px 100px; }
@media (max-width: 900px) { .refurb-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Platform admin ---------- */
.super-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.super-nav a { padding: 9px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font-weight: 600; text-decoration: none; }
.super-nav a.active { color: var(--text); border-bottom-color: var(--brand); }
.super-nav a:hover { color: var(--text); }
.super-nav .badge { margin-left: 4px; }
.super-nav-me { margin-left: auto; color: var(--muted); font-size: .85rem; padding: 9px 0; }
.super-nav-me a { padding: 0; border: 0; margin: 0; color: inherit; font-weight: 500; text-decoration: underline; }
.super-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.health-summary { margin-bottom: 18px; }
.health-ok { margin: 0 0 18px; }
.health-list { list-style: none; margin: 0; padding: 0; }
.health-list li { padding: 9px 0; border-bottom: 1px solid var(--border); }
.health-list li:last-child { border-bottom: 0; }
.health-list .badge { min-width: 52px; text-align: center; margin-right: 6px; }
.health-list .sub { display: block; color: var(--muted); font-size: .85rem; margin: 2px 0 0 64px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { display: inline-block; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; color: var(--muted); text-decoration: none; background: var(--surface); }
.chip.active { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, transparent); font-weight: 600; }
.kv { margin: 0; }
.kv-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.kv-row:last-child { border-bottom: 0; }
.kv-row dt { color: var(--muted); }
.kv-row dd { margin: 0; overflow-wrap: anywhere; }
.wrap-any { overflow-wrap: anywhere; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin: 4px 0; }
.timeline-simple { list-style: none; margin: 0; padding: 0; }
.timeline-simple li { padding: 6px 0 6px 14px; border-left: 2px solid var(--border); font-size: .92rem; }
.timeline-simple time { color: var(--muted); font-size: .85rem; margin-right: 6px; }
.error-log { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.error-entry { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: .82rem; }
.error-entry time { color: var(--muted); white-space: nowrap; }
.error-entry pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.bar-chart { margin: 0; }
.bar-chart .bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 18px; border-bottom: 1px solid var(--border); }
.bar-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar { display: block; width: 100%; max-width: 44px; border-radius: 4px 4px 0 0; min-height: 0; }
.bar-info { background: var(--info); }
.bar-good { background: var(--good); }
.bar-bad { background: var(--bad); }
.bar-none { background: transparent; }
.bar-val { font-size: .7rem; color: var(--muted); white-space: nowrap; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.bar-label { position: absolute; bottom: -20px; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.bar-chart figcaption { margin-top: 26px; font-size: .8rem; color: var(--muted); }
.bars:has(.bar-col:nth-child(16)) .bar-val { display: none; }
.bars:has(.bar-col:nth-child(16)) .bar-col:nth-child(odd) .bar-label { visibility: hidden; }
p.small { font-size: .85rem; }
@media (max-width: 900px) {
  .super-grid { grid-template-columns: 1fr; }
  .super-nav-me { width: 100%; margin-left: 0; }
  .kv-row { grid-template-columns: 120px 1fr; }
  .error-entry { grid-template-columns: 1fr; gap: 2px; }
  .health-list .sub { margin-left: 0; }
  .bar-val { display: none; }
}

/* ---------- Comparable sales ---------- */
.comps-card.updating { opacity: .6; transition: opacity .2s; }
.comps-card .card-head .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comps-loading { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); margin-bottom: 10px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.comps-value { display: grid; grid-template-columns: 1fr 1.3fr 1fr auto; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 6px; }
.comps-value .label { display: block; font-size: .78rem; color: var(--muted); }
.comps-value strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.comps-value .mid strong { font-size: 1.5rem; color: var(--brand); }
.comps-basis { margin: 0 0 12px; }
.comps-table tr.excluded td { opacity: .5; }
.comps-table tr.excluded td:first-child { opacity: 1; }
.comps-table td .sub { display: block; }
.comps-add { margin-top: 12px; }
.comps-add summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.comps-add form { margin-top: 10px; }
.comps-foot { margin-top: 12px; }
.comps-foot ul { margin: 0 0 6px; padding-left: 18px; }
.comps-foot p { margin: 0; }
.small { font-size: .85rem; }
@media (max-width: 700px) {
  .comps-value { grid-template-columns: 1fr 1fr 1fr; }
  .comps-value .comps-use { grid-column: 1 / -1; }
  .comps-value .mid strong { font-size: 1.25rem; }
}
.stats.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats.stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .stats.stats-5 { grid-template-columns: 1fr 1fr; } }
.nowrap { white-space: nowrap; }
.comps-table td .ext { white-space: nowrap; }
.comps-table .comps-use-col { width: 28px; }
.comps-table td .sub .badge { margin-right: 4px; }
@media (max-width: 700px) {
  .comps-table td[data-label="Use in value"] { float: right; }
  .comps-table td[data-label="Use in value"]::before { content: "Use"; }
}
@media (max-width: 700px) {
  .comps-value { gap: 6px; padding: 10px; }
  .comps-value strong { font-size: .98rem; }
  .comps-value .mid strong { font-size: 1.08rem; }
  .comps-value .label { font-size: .72rem; }
}
.refurb-form .form-actions .btn, .comps-use .btn { white-space: normal; max-width: 100%; text-align: center; }
/* Refurb estimator on the property form */
.refurb-field-row { display: flex; gap: 8px; align-items: center; }
.refurb-field-row .money-input { flex: 1 1 auto; min-width: 0; }
.refurb-field-row .btn { flex: none; }
.refurb-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.refurb-panel[hidden] { display: none; }
.refurb-panel .form-actions { margin-top: 8px; }
.refurb-panel .refurb-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.5fr) 90px 110px; margin-top: 0; }
.refurb-panel .refurb-result { background: var(--surface); }
@media (max-width: 900px) { .refurb-panel .refurb-row { grid-template-columns: 1fr 1fr; } }
.refurb-field-row .money-input { min-width: 110px; }

/* ---------- Hosted website enquiry form (/form/) ---------- */
body.capture { background: var(--bg); }
body.capture-embedded { background: transparent; }
.capture-wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px; }
.capture-embedded .capture-wrap { padding: 2px; }
.capture-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 22px 16px; box-shadow: var(--shadow); }
.capture-card h1 { font-size: 1.45rem; margin: 0 0 6px; }
.capture-intro { color: var(--muted); margin: 0 0 14px; }
.capture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-bottom: 16px; }
.capture-grid .field-wide { grid-column: 1 / -1; }
.capture-grid input, .capture-grid select, .capture-grid textarea { width: 100%; }
.capture .btn.capture-btn { width: 100%; background: var(--capture); border-color: var(--capture); color: #fff; font-size: 1.05rem; padding: 12px; }
.capture .btn.capture-btn:hover { filter: brightness(1.08); }
.capture-card :focus-visible { outline-color: color-mix(in srgb, var(--capture) 60%, transparent); }
.capture-privacy { font-size: .8rem; color: var(--muted); margin: 10px 0 0; text-align: center; }
.capture-by { font-size: .75rem; color: var(--muted); text-align: center; margin: 10px 0 0; }
.capture-by a { color: inherit; }
.capture-thanks h1 { color: var(--capture); }
.field-error { color: var(--bad); font-size: .82rem; display: block; margin-top: 3px; }
[aria-invalid="true"] { border-color: var(--bad) !important; }
@media (max-width: 520px) { .capture-grid { grid-template-columns: 1fr; } .capture-card { padding: 18px 14px 12px; } }
textarea.code { width: 100%; font-family: var(--mono, ui-monospace, monospace); font-size: .82rem; background: var(--surface-2); }
body.capture-embedded, .capture-embedded { min-height: 0; }
.comps-table td[data-label="Address"] { min-width: 150px; }
.strategy-form .field[hidden] { display: none; }
