/* ==========================================================================
   FunnelVibey styles: "Forest & Cream" theme
   ==========================================================================
   How this file is organised:
     1. Fonts (self-hosted, no outside requests)
     2. Colour and size tokens (change the look here, in one place)
     3. Base elements
     4. Layout: sidebar (laptop) and bottom tab bar (phone)
     5. Components: buttons, cards, chips, forms, messages
     6. Pages: login, home
     7. Public website (funnelvibey.com: home, privacy, terms)
   Rules we keep:
     - Motion is small (under 0.2s) and is switched off for people who ask
       their device to reduce motion.
     - Nothing here is needed for the page to work. If CSS fails to load,
       every link, button and form still works.
     - Text colours pass WCAG AA contrast on their backgrounds.
   ========================================================================== */

/* 1. Fonts ---------------------------------------------------------------- */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/inter-latin-400-normal.f837d382a885.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("fonts/inter-latin-600-normal.75fb76ec3559.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("fonts/space-grotesk-latin-600-normal.74399d3ac36c.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("fonts/space-grotesk-latin-700-normal.04a0491ad41d.woff2") format("woff2"); }

/* 2. Tokens ----------------------------------------------------------------- */
:root {
  /* Forest & Cream palette */
  --forest-950: #062223;   /* sidebar, dark cards, main buttons */
  --forest-900: #09302B;   /* hover on dark */
  --teal-600:   #418B7E;
  --teal-500:   #4E977A;
  --leaf-400:   #7AB37C;   /* accent fills (always with dark text) */
  --cream-100:  #F7F4D1;

  --bg:           #F8F6E3; /* page background (cream, slightly lighter) */
  --surface:      #FFFEF7; /* cards */
  --line:         #E6E1BF;
  --text:         #0B2422;
  --muted:        #4D5C55;
  --side:         var(--forest-950);
  --side-hover:   var(--forest-900);
  --side-text:    #C9D8D2;
  --side-muted:   #8FA8A0;
  --accent:       var(--leaf-400);
  --accent-ink:   var(--forest-950);
  --accent-soft:  #E2EFD8;
  --accent-text:  #2F6B55; /* green text on light backgrounds */
  --danger:       #B42318;
  --danger-soft:  #FDECEA;
  --warning-soft: #FFF1D6;
  --warning-text: #7A4B00;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --pill:      999px;
  --shadow:    0 10px 24px rgba(6, 34, 35, .08);
  --sidebar-w: 240px;
  --tabbar-h:  64px;
  --speed:     .16s;
}

/* 3. Base --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.5 var(--font-body);
  background: var(--bg);
  color: var(--text);
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
a { color: var(--accent-text); }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--teal-600); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 4. Layout ------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side); color: var(--side-text);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px;
  color: #fff; text-decoration: none; font: 700 19px var(--font-head); }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent);
  color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }

.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: 12px; color: var(--side-text); text-decoration: none; font-weight: 600; font-size: 15px;
  transition: background var(--speed) ease;
}
.nav-link:hover { background: var(--side-hover); color: #fff; }
.nav-link[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.nav-link.is-soon { color: var(--side-muted); cursor: default; }
.nav-link.is-soon:hover { background: transparent; color: var(--side-muted); }
.soon { margin-left: auto; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--pill);
  background: rgba(255, 255, 255, .08); color: var(--side-text); }

.sidebar-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.me-name { color: #fff; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { color: var(--side-muted); font-size: 12px; }
.me-text { min-width: 0; display: flex; flex-direction: column; }
.logout-form { margin: 0; }
.logout-btn { width: 100%; justify-content: flex-start; }

.content { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 48px; }
.content-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

/* Phone top bar and bottom tab bar (hidden on laptops) */
.mobile-top, .tabbar { display: none; }

@media (max-width: 899px) {
  .app { grid-template-columns: minmax(0, 1fr); align-content: start; } /* short pages: don't stretch the top bar */
  .sidebar { display: none; }
  .mobile-top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 10; padding: 12px 16px;
    background: var(--side); color: #fff;
  }
  .mobile-top .brand { padding: 0; font-size: 17px; }
  .mobile-top .biz-switch { margin: 0; min-width: 0; flex: 1; }
  .mobile-top .biz-switch summary, .mobile-top .biz-switch.is-single { padding: 6px 10px; }
  .mobile-top .biz-switch summary::after { top: 16px; }
  .mobile-top .biz-switch[open] summary::after { top: 19px; }
  .mobile-top .biz-list { position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: calc(100vw - 32px); z-index: 20;
    background: var(--side); border-radius: 14px; box-shadow: var(--shadow); }
  .content { padding: 20px 16px calc(var(--tabbar-h) + 28px); }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600;
  }
  .tab[aria-current="page"] { color: var(--text); }
  .tab[aria-current="page"] .icon { color: var(--accent-text); }
  .tab.is-soon { opacity: .55; }
}

/* 5. Components ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--pill); border: 1px solid transparent;
  font: 600 15px var(--font-body); text-decoration: none; cursor: pointer;
  transition: filter var(--speed) ease, transform .1s ease, background var(--speed) ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); color: var(--accent-ink); }
.btn-dark { background: var(--side); color: #fff; }
.btn-dark:hover { background: var(--side-hover); color: #fff; }
.btn-light { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost-dark { background: transparent; color: var(--side-text); border-color: rgba(255, 255, 255, .14); }
.btn-ghost-dark:hover { background: var(--side-hover); color: #fff; }
.btn-block { width: 100%; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 8px;
}
.card-lift { transition: transform var(--speed) ease, box-shadow var(--speed) ease; }
.card-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-dark { background: var(--side); border-color: var(--side); color: #fff; }
.card-dark .muted { color: var(--side-text); }
.card-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.card h2 { font-size: 18px; }
.card p { margin: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.chip { display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--pill);
  background: var(--accent-soft); color: var(--accent-text); }
.chip-dark { background: rgba(255, 255, 255, .1); color: #fff; }
.chip-danger { background: var(--danger-soft); color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.input {
  width: 100%; min-height: 46px; padding: 10px 14px; font: 400 16px var(--font-body); color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.input:focus { outline: 3px solid rgba(65, 139, 126, .35); border-color: var(--teal-600); }

.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.message { padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.message.error { background: var(--danger-soft); color: var(--danger); }
.message.warning { background: var(--warning-soft); color: var(--warning-text); }
.field-error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 600; }
.field-check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
.field-check input { width: 20px; height: 20px; accent-color: var(--teal-600); }
.field-check .help { flex-basis: 100%; }
.field-check .field-error { flex-basis: 100%; }
select.input { appearance: auto; }
.form-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 600; }

/* 6. Pages -------------------------------------------------------------------------- */
/* Page heading with an action button on the right */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: clamp(24px, 3vw, 32px); }
.page-head p { margin: 4px 0 0; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.facts { margin: 4px 0 8px; display: grid; gap: 10px 20px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.form-card { max-width: 560px; gap: 16px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.empty { align-items: flex-start; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.small { font-size: 13px; }
.help { font-size: 13px; }

/* Lists of people / teams / invites inside a card */
.rows { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.is-off { opacity: .6; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 600; }
.row-main .muted { overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; }
@media (max-width: 599px) {
  .row { flex-wrap: wrap; }
  .row-actions { flex-basis: 100%; justify-content: flex-start; }
}

/* Permissions (person edit page) */
.preset-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 0; }
.preset { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; cursor: pointer;
  transition: border-color var(--speed) ease, background var(--speed) ease; }
.preset:hover { border-color: var(--teal-500); background: var(--accent-soft); }
.preset-label { font-weight: 600; }
.perm-table { display: flex; flex-direction: column; gap: 8px; }
.perm-table.is-off { opacity: .5; }
.perm-head, .perm-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.perm-head { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.perm-layer { font-weight: 600; }
.perm-row .field-error { grid-column: 1 / -1; }
@media (max-width: 599px) {
  .perm-head { display: none; }
  .perm-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 10px 0; border-top: 1px solid var(--line); }
  .perm-layer { grid-column: 1 / -1; }
}

/* Settings and Activity */
.settings-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.input-number { max-width: 140px; }
.changes { margin-top: 6px; font-size: 14px; }
.changes summary { cursor: pointer; color: var(--accent-text); font-weight: 600; width: fit-content; }
.changes dl { margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.changes dl div { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.changes dt { font-weight: 600; min-width: 120px; }
.changes dd { margin: 0; }
.changes .old { color: var(--muted); text-decoration: line-through; }
.changes .new { font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; }

/* "More" page (phone) */
.more-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.more-list li + li { border-top: 1px solid var(--line); }
.more-link { display: flex; align-items: center; gap: 12px; min-height: 52px; color: var(--text); font-weight: 600; text-decoration: none; }
.more-link.is-soon { color: var(--muted); font-weight: 400; }
.more-link .soon { margin-left: auto; background: var(--bg); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chips:empty { display: none; }
.chip-plain { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.chip-link { text-decoration: none; }
.chip-link:hover { background: var(--accent); color: var(--accent-ink); }
.avatar-light { width: 38px; height: 38px; }

/* Checkbox lists (teams) */
.checks { border: 0; padding: 0; margin: 0; }
.checks legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.checks .check-option { display: flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 400; }
.check-option input { width: 20px; height: 20px; accent-color: var(--teal-600); }

/* Business switcher (sidebar + phone top bar). <details>, no JavaScript. */
.biz-switch { position: relative; margin: 0 0 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); color: #fff; }
.biz-switch summary, .biz-switch.is-single { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; }
.biz-switch summary { cursor: pointer; list-style: none; padding-right: 32px; }
.biz-switch summary::-webkit-details-marker { display: none; }
.biz-switch summary::after { content: ""; position: absolute; right: 14px; top: 22px; width: 7px; height: 7px;
  border-right: 2px solid var(--side-muted); border-bottom: 2px solid var(--side-muted); transform: rotate(45deg); }
.biz-switch[open] summary::after { transform: rotate(-135deg); top: 25px; }
.biz-label { font-size: 11px; font-weight: 600; color: var(--side-muted); text-transform: uppercase; letter-spacing: .06em; }
.biz-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-list { list-style: none; margin: 0; padding: 4px 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.biz-list form { margin: 0; }
.biz-option { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--side-text); font: 500 14px var(--font-body); cursor: pointer; }
button.biz-option:hover { background: var(--side-hover); color: #fff; }
.biz-option[aria-current="true"] { color: var(--accent); font-weight: 600; }

/* Login (no sidebar) */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 20% 0%, rgba(122, 179, 124, .25), transparent 55%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.auth { align-content: center; gap: 14px; }
.auth-legal { font-size: 14px; color: var(--muted); margin: 0; }
.auth-brand { display: flex; align-items: center; gap: 10px; font: 700 20px var(--font-head); color: var(--text); }
.auth-card h1 { font-size: 26px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }

/* Home */
.hello { font-size: 15px; color: var(--muted); }
.headline { font-size: clamp(26px, 3.4vw, 38px); max-width: 760px; }
.headline-pill { display: inline-block; padding: 0 12px; border-radius: var(--pill); background: var(--accent); color: var(--accent-ink); }
.layer-num { font: 700 13px var(--font-body); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.step-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .25); flex: none; }
.steps li.is-now .step-dot { background: var(--accent); }
.steps li.is-done { color: var(--side-text); }
.steps li.is-done .step-dot { background: var(--teal-500); }

/* Leads */
.text-danger { color: var(--danger); }
.wrap { overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; padding: 4px; width: fit-content; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); }
.tabs a { padding: 8px 16px; border-radius: var(--pill); color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { background: var(--side); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.filters .input { width: auto; min-width: 150px; flex: 0 1 auto; }
.filters .filter-search { flex: 1 1 240px; }
.lead-link { color: inherit; text-decoration: none; }
.lead-link:hover .row-title { text-decoration: underline; }
.lead-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; flex: none; }
.due { font-weight: 600; font-size: 14px; }
.due.is-overdue { color: var(--danger); }
.unassigned { color: var(--warning-text); font-weight: 600; }
.form-pair { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.more-fields summary { cursor: pointer; color: var(--accent-text); font-weight: 600; width: fit-content; }
.more-fields-body { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.back { margin: 0 0 6px; }
.back a { text-decoration: none; }
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-layout { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.lead-main { display: flex; flex-direction: column; gap: 22px; }
.close-lead summary { list-style: none; width: fit-content; }
.close-lead summary::-webkit-details-marker { display: none; }
.close-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; max-width: 420px; }
.note-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding: 10px 0; position: relative; }
.timeline-item + .timeline-item { border-top: 1px dashed var(--line); }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal-500); margin-top: 6px; }
.kind-closed .timeline-dot { background: var(--muted); }
.kind-came_back .timeline-dot { background: var(--leaf-400); }
.kind-note .timeline-dot { background: var(--cream-100); border: 2px solid var(--teal-600); }
.timeline-title { margin: 0; font-weight: 600; font-size: 15px; }
.timeline-text { margin: 4px 0 0; overflow-wrap: anywhere; }
.changes-list { margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.changes-list div { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.changes-list dt { font-weight: 600; min-width: 100px; }
.changes-list dd { margin: 0; }
.changes-list .old { color: var(--muted); text-decoration: line-through; }
.changes-list .new { font-weight: 600; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mono, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.code { margin: 8px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.map-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 12px 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.sample { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.sample th, .sample td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sample th { background: var(--bg); font-weight: 600; }
.sample tr:last-child td { border-bottom: 0; }
.problem-list { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 899px) {
  .lead-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .filters .input { flex: 1 1 140px; min-width: 0; }
  .lead-row { flex-wrap: nowrap; }
  .lead-side { max-width: 45%; }
  .contact-actions { width: 100%; }
  .contact-actions .btn { flex: 1; }
}

/* Respect "reduce motion" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card-lift:hover { transform: none; }
}

/* Assignment (Phase 3 step 3) */
.chip-warning { background: var(--warning-soft); color: var(--warning-text); text-decoration: none; font-weight: 600; }
a.chip-warning:hover { text-decoration: underline; }
.assign-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; padding: 10px 12px; border-radius: var(--radius-sm, 10px); background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.assign-bar .input { width: auto; min-width: 180px; flex: 1 1 180px; }
.lead-row .pick { width: 20px; height: 20px; flex: none; accent-color: var(--teal-600); }
.card-alert { border-color: var(--warning-text); background: var(--warning-soft); }
.sharing-check { display: flex; gap: 12px; flex: 1; min-width: 0; align-items: flex-start; cursor: pointer; }
.sharing-check input { margin-top: 2px; flex: none; }

/* Calls (Phase 3 step 4) */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; display: inline-flex; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text); }
.pill input:checked + span { background: var(--side); border-color: var(--side); color: #fff; }
.pill input:focus-visible + span { outline: 3px solid var(--teal-600); outline-offset: 2px; }
.call-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.call-form fieldset { border: 0; padding: 0; margin: 0; }
.call-form legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.today-row { flex-direction: column; align-items: stretch; }
.today-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.today-actions { display: flex; gap: 8px; flex: none; }
.today-row .chips .due { font-size: 13px; align-self: center; }
.log-call > summary { list-style: none; width: fit-content; cursor: pointer; }
.log-call > summary::-webkit-details-marker { display: none; }
.log-call[open] > summary { margin-bottom: 4px; }
.today-main .row-main { flex: 1 1 240px; }

/* Photos (Phase 3 step 5) */
.photo-grid { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.photo-tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.photo-thumb { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg, #f3efe6); border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.photo-actions form { margin: 0; }
.photo-replace { flex-basis: auto; }
.photo-replace[open] { flex-basis: 100%; }
.photo-replace > summary { list-style: none; cursor: pointer; width: fit-content; }
.photo-replace > summary::-webkit-details-marker { display: none; }
.photo-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.photo-form label { font-weight: 600; font-size: 14px; }
.photo-form input[type=file] { font-size: 14px; max-width: 100%; }
.photo-form .btn { width: fit-content; }
.usage-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.usage-num { font-size: 26px; font-weight: 700; }
.storage-filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.storage-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.storage-row:first-child { border-top: 0; }
.storage-row .pick { width: 20px; height: 20px; flex: none; accent-color: var(--teal-600); }
.storage-row img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex: none; border: 1px solid var(--line); }
.storage-row .row-text { flex: 1; min-width: 0; }
.storage-row .row-text p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.storage-list { list-style: none; margin: 0; padding: 0; }

/* Leak alarms (Phase 3 step 6) */
.card-leak { border-color: var(--danger); }
.alarm-summary.is-leaking { border-color: var(--danger); background: var(--danger-soft); }
.alarm-tile { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; border-radius: 12px; padding: 4px 0; }
.alarm-tile:hover .usage-num { text-decoration: underline; }
.alarm-summary .usage-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.people-table { font-size: 14px; }
.people-table th[scope=row] { background: transparent; font-weight: 600; }
.people-table td, .people-table th { white-space: nowrap; }
.leak-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-color: var(--danger); background: var(--danger-soft); }

/* Settings: section cards and section pages */
.settings-group { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 10px; }
.settings-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.settings-grid > li { display: flex; }
.settings-card { flex: 1; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit;
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease; }
.settings-card:hover, .settings-card:focus-visible { border-color: var(--accent); box-shadow: 0 6px 18px rgba(6, 34, 35, .08); }
.settings-card-head { display: flex; align-items: center; gap: 12px; }
.settings-card-title { font-weight: 700; font-size: 17px; flex: 1; }
.settings-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text);
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.settings-chevron { color: var(--muted); }
.settings-card:hover .settings-chevron { color: var(--accent-text); }
.settings-summary { margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 13px; }
.settings-summary div { display: flex; justify-content: space-between; gap: 12px; }
.settings-summary dt { color: var(--muted); }
.settings-summary dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; }
.settings-summary dd.is-list { white-space: normal; }
.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 24px; }
.settings-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.settings-nav ul a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text); font-weight: 600; font-size: 15px; }
.settings-nav ul a:hover { background: var(--accent-soft); }
.settings-nav ul a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.settings-main { display: grid; gap: 18px; min-width: 0; }
.settings-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (max-width: 899px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .settings-nav { position: static; min-width: 0; }
  .settings-nav ul { display: flex; flex-wrap: wrap; gap: 8px; }
  .settings-nav ul a { border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; font-size: 14px; gap: 0; }
  .settings-nav ul a .icon { display: none; }
}

/* Webhook field matching */
.match-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.match-side { display: grid; gap: 18px; }
.match-card { gap: 12px; }
.match-rows { list-style: none; margin: 0; padding: 0; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line); }
.match-field { display: flex; flex-direction: column; min-width: 0; }
.match-name { font-weight: 600; overflow-wrap: anywhere; }
.match-value { overflow-wrap: anywhere; }
.match-select { width: 100%; }
.match-preview { margin: 0; display: grid; gap: 10px; }
.match-preview dt { font-size: 13px; color: var(--muted); }
.match-preview dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 899px) {
  .match-layout { grid-template-columns: minmax(0, 1fr); }
  .match-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* Deleting and removing: always behind an "are you sure?" page */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.danger-zone { margin: 4px 2px 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.link-danger { color: var(--danger); font-weight: 600; }
.link-danger:hover { color: var(--danger); text-decoration: underline; }
.confirm-card { max-width: 640px; }
.confirm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 280px; overflow: auto; }
.confirm-points { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.form-actions form { display: contents; }
.deleted-row { align-items: center; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { display: contents; }

/* List settings: one row per option (businesses/_list_rows.html + list-rows.js) */
.list-rows { display: grid; gap: 10px; justify-items: start; }
.list-rows-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; counter-reset: opt; }
.list-row { display: flex; align-items: center; gap: 8px; counter-increment: opt; }
.list-row .input { flex: 1 1 auto; min-width: 0; }
.list-num { flex: 0 0 28px; height: 28px; border-radius: 999px; display: grid; place-items: center;
  background: var(--accent-soft, #E9F2E3); color: var(--accent-text, #2F6B55); font-size: 13px; font-weight: 600; }
.list-num::before { content: counter(opt); }
.list-row.is-new .list-num { background: transparent; border: 1px dashed var(--line); }
.list-btn { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 16px; cursor: pointer; }
.list-btn:hover:not(:disabled) { border-color: var(--text); }
.list-btn:disabled { opacity: .35; cursor: default; }
.list-remove:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.list-add:disabled { opacity: .6; }
.list-rows .list-add { width: auto; height: auto; min-height: 36px; padding: 0 14px; white-space: nowrap; font-size: 14px; }
.list-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.list-field legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 8px; }

/* 7. Public website ------------------------------------------------------------
   apps/website: the pages at funnelvibey.com. Same tokens as the CRM. */
.site { background: var(--bg); }
.site-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.site-head { background: var(--side); color: var(--side-text); position: sticky; top: 0; z-index: 5; }
.site-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.site-brand { display: flex; align-items: center; gap: 10px; font: 700 20px var(--font-head); color: #fff; text-decoration: none; }
.site-brand-foot { color: var(--text); }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a:not(.btn) { color: var(--side-text); text-decoration: none; font-weight: 600; font-size: 15px; }
.site-nav a:not(.btn):hover { color: #fff; }
.site-login { min-height: 40px; padding: 8px 18px; }
.site-hero { background: var(--side); color: var(--side-text); padding: 56px 0 72px; }
.site-hero h1 { color: #fff; font-size: clamp(32px, 6vw, 54px); max-width: 20ch; margin: 8px 0 18px; }
.site-lead { font-size: clamp(17px, 2.2vw, 20px); max-width: 60ch; margin: 0 0 28px; }
.site-kicker { margin: 0; font-weight: 600; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-text); }
.site-hero .site-kicker { color: var(--leaf-400); }
.site-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.site-section { padding: 56px 20px; }
.site-section > h2, .site-contact-block h2 { font-size: clamp(24px, 4vw, 34px); margin-bottom: 24px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.site-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.site-card h3 { font-size: 19px; margin-bottom: 8px; }
.site-card p { margin: 0; color: var(--muted); }
.site-contact-block { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.site-contact { font-style: normal; line-height: 1.7; }
.site-doc { max-width: 760px; padding-top: 40px; padding-bottom: 56px; }
.site-doc h1 { font-size: clamp(30px, 5vw, 42px); margin: 6px 0 6px; }
.site-doc h2 { font-size: 21px; margin: 32px 0 10px; }
.site-doc p, .site-doc li { color: var(--text); }
.site-doc ul, .site-doc ol { padding-left: 22px; }
.site-doc li { margin-bottom: 8px; }
.site-updated { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.site-foot { background: var(--surface); border-top: 1px solid var(--line); padding: 40px 0 24px; color: var(--muted); font-size: 15px; }
.site-foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-foot-head { font-size: 15px; color: var(--text); margin-bottom: 10px; }
.site-foot-links { list-style: none; margin: 0; padding: 0; line-height: 2; }
.site-copy { margin-top: 28px; font-size: 13px; }
@media (max-width: 699px) {
  .site-nav a:not(.btn) { display: none; }
  .site-hero { padding: 40px 0 52px; }
  .site-wrap { padding-left: 16px; padding-right: 16px; }
  .site-section { padding: 40px 16px; }
  .site-contact-block, .site-foot-grid { grid-template-columns: 1fr; }
}
