/* Paragon Desk: back-office styles. Mobile first.
   Paper and hairlines for calm; canopy for primary actions; jacaranda for links and focus;
   velvet for the bar and for anything still waiting on a first reply (the "tray"). */

:root {
  --paper: #F5F6F3;
  --card: #FFFFFF;
  --ink: #111613;
  --muted: #4E5751;
  --line: #DCE0DA;
  --line-strong: #C9CFC7;
  --wash: #EEF0EC;
  --canopy: #1E3B30;
  --canopy-dark: #142A21;
  --canopy-tint: #E5EDE8;
  --jac: #7A5AC8;
  --jac-deep: #5B3F9E;
  --jac-tint: #F1EDFA;
  --velvet: #0B0C0E;
  --velvet-2: #17191C;
  --velvet-line: #2A2E33;
  --platinum: #E9ECEF;
  --silver: #AEB8C2;
  --ok: #1C7A4C;
  --ok-tint: #E6F2EB;
  --ok-line: #B9DCC7;
  --warn: #9A5B00;
  --warn-tint: #FFF6E5;
  --warn-line: #F0D9A8;
  --bad: #B42318;
  --bad-tint: #FDECEA;
  --bad-line: #F3C3BD;
  --serif: Marcellus, Georgia, 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', Inter, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r-card: 12px;
  --r-ctl: 8px;
  --tap: 44px;
  --gutter: 16px;
  --stripes: repeating-linear-gradient(135deg, #E3E8E2 0 12px, #DCE2DB 12px 24px);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
svg { max-width: 100%; }
a { color: var(--jac-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--jac); }
:focus-visible { outline: 2px solid var(--jac); outline-offset: 2px; }
p { margin: 0 0 .75em; }
h1, h2, h3 { margin: 0; font-weight: 400; color: var(--ink); overflow-wrap: anywhere; }
h1 { font-family: var(--serif); font-size: 30px; line-height: 1.12; letter-spacing: .005em; }
h2 { font-family: var(--serif); font-size: 21px; line-height: 1.2; }
button { font: inherit; }
.mono { font-family: var(--mono); font-size: .875em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 600; }
.skip:focus { top: 10px; }
.eyebrow { margin: 0 0 6px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.eyebrow .mono { font-size: 1em; }
.hint { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.ic { width: 20px; height: 20px; flex: 0 0 auto; }

/* ---------- Top bar ---------- */

.bar { position: sticky; top: 0; z-index: 40; background: var(--velvet); color: var(--platinum); }
.bar-in {
  max-width: 1240px; margin: 0 auto; min-height: 60px; padding: 8px var(--gutter);
  display: flex; align-items: center; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: var(--tap); border-radius: 6px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.desk-tag {
  padding: 2px 9px 3px; border: 1px solid #30353B; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; line-height: 1.3; color: var(--silver);
}
.nav { display: none; }
.bar-user { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.me { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 4px; border-radius: 999px; color: var(--platinum); text-decoration: none; }
.me:hover { color: #fff; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: #22272C; border: 1px solid #383E45; color: var(--platinum);
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
}
.me[aria-current] .avatar { border-color: var(--jac); }
.me-name { display: none; font-size: 15px; font-weight: 500; }
.logout-form { display: none; margin: 0; }
.logout {
  min-height: var(--tap); padding: 0 12px; border: 0; border-radius: 8px; background: none;
  color: var(--silver); font: 500 15px/1 var(--sans); cursor: pointer;
}
.logout:hover { color: #fff; background: var(--velvet-2); }
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--bad); color: #fff; font: 600 11.5px/1 var(--sans);
}
.is-bare .bar-in { justify-content: center; }

/* Bottom tab bar on phones and tablets */
.tabbar {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--velvet); border-top: 1px solid var(--velvet-line);
}
.tabbar > a, .more > summary {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; border-radius: 10px; color: var(--silver); text-decoration: none;
  font-size: 12px; font-weight: 500; line-height: 1.1; cursor: pointer; list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.more > summary::-webkit-details-marker { display: none; }
.tabbar > a:hover, .more > summary:hover { color: #fff; }
.tabbar > a[aria-current="page"], .more > summary.is-active, .more[open] > summary { color: #fff; background: var(--velvet-2); }
.tabbar > a[aria-current="page"]::after {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--jac);
}
.tabbar .ic { width: 22px; height: 22px; }
.tabbar .count { position: absolute; top: 3px; left: calc(50% + 5px); }
.more-panel {
  position: absolute; right: 8px; bottom: calc(100% + 8px); width: min(270px, calc(100vw - 16px));
  display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); box-shadow: 0 14px 34px rgba(11, 12, 14, .2);
}
.more-panel form { margin: 0; }
.more-panel a, .more-panel button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 12px;
  border: 0; border-radius: 8px; background: none; color: var(--ink);
  font: 500 16px/1 var(--sans); text-align: left; text-decoration: none; cursor: pointer;
}
.more-panel a:hover, .more-panel button:hover { background: var(--wash); color: var(--ink); }
.more-panel a[aria-current] { background: var(--jac-tint); color: var(--jac-deep); }
.more-panel .ic { color: var(--muted); }
body.has-nav { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

@media (min-width: 720px) {
  :root { --gutter: 24px; }
}

@media (min-width: 1120px) {
  body.has-nav { padding-bottom: 0; }
  .tabbar { display: none; }
  .bar-in { min-height: 68px; gap: 20px; }
  .nav { display: flex; align-items: center; gap: 2px; }
  .nav > a, .nav-more > summary {
    position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 11px;
    border-radius: 8px; color: var(--silver); text-decoration: none; font-size: 15px; font-weight: 500;
  }
  .nav > a:hover, .nav-more > summary:hover { color: #fff; background: var(--velvet-2); }
  .nav > a[aria-current="page"], .nav-more > summary.is-active, .nav-more[open] > summary { color: #fff; }
  .nav > a[aria-current="page"]::after, .nav-more > summary.is-active::after {
    content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--jac);
  }
  .nav-more { position: relative; }
  .nav-more > summary { cursor: pointer; list-style: none; }
  .nav-more > summary::-webkit-details-marker { display: none; }
  .nav-more > summary::before { content: none; }
  .nav-more-panel {
    position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; width: 250px;
    display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 12px;
    background: #fff; color: var(--ink); box-shadow: 0 14px 34px rgba(11, 12, 14, .2);
  }
  .nav-more-panel a {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px;
    color: var(--ink); font: 500 15px/1 var(--sans); text-decoration: none;
  }
  .nav-more-panel a:hover { background: var(--wash); color: var(--ink); }
  .nav-more-panel a[aria-current] { background: var(--jac-tint); color: var(--jac-deep); }
  .nav-more-panel .ic { width: 20px; height: 20px; color: var(--muted); }
  .logout-form { display: block; }
}

@media (min-width: 1260px) {
  .me-name { display: inline; }
}

/* ---------- Page frame ---------- */

.wrap { max-width: 1240px; margin: 0 auto; padding: 20px var(--gutter) 40px; }
.wrap-narrow { max-width: 520px; }
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px;
  margin: 0 0 18px;
}
.page-head .eyebrow { margin-bottom: 4px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 12px; }
.section-head h2 { font-size: 22px; }
.section-title { margin: 28px 0 12px; font-size: 22px; }

@media (min-width: 720px) {
  .wrap { padding-top: 28px; padding-bottom: 56px; }
  h1 { font-size: 36px; }
  h2 { font-size: 22px; }
}

/* ---------- Flash messages ---------- */

.flash { margin: 0 0 16px; padding: 12px 14px; border: 1px solid; border-radius: 10px; font-size: 15px; font-weight: 500; }
.flash-ok { background: var(--ok-tint); border-color: var(--ok-line); color: #14583A; }
.flash-error { background: var(--bad-tint); border-color: var(--bad-line); color: var(--bad); }
.flash-info { background: var(--jac-tint); border-color: #DDD3F3; color: #47307F; }
.flash-info a { color: inherit; font-weight: 600; }
.flash-secret { background: #fff; border-color: var(--canopy); color: var(--ink); }
.flash-secret p { margin: 0 0 8px; }
.flash-secret .hint { margin: 0; }
.secret { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.secret code {
  padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--paper);
  font-family: var(--mono); font-size: 18px; letter-spacing: .04em; user-select: all;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  background: var(--card); color: var(--ink); font: 600 15px/1.1 var(--sans);
  text-decoration: none; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: #AFB7AD; background: #F7F8F6; color: var(--ink); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary, .btn-main { border-color: var(--canopy); background: var(--canopy); color: #fff; }
.btn-primary:hover, .btn-main:hover { border-color: var(--canopy-dark); background: var(--canopy-dark); color: #fff; }
.btn-danger { border-color: #E8B4AD; background: #fff; color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); background: var(--bad-tint); color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--jac-deep); }
.btn-ghost:hover { border-color: transparent; background: var(--wash); color: var(--jac-deep); }
.btn-small { padding: 0 12px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn.is-off { border-style: dashed; background: transparent; color: #9AA39C; cursor: default; }
.btn-reply { border-color: var(--ok-line); background: var(--ok-tint); color: var(--ok); }
.btn-reply:hover { border-color: var(--ok); background: #D8EBE0; color: var(--ok); }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn-row form { margin: 0; }

/* Quick replies: only the channels a lead has; the first (WhatsApp when there is a phone) is the main one */
.qa { display: flex; gap: 8px; }
.qa .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; }
.qa .btn-main { flex-grow: 1.6; }
.qa-icon { gap: 6px; }
.qa-icon .btn, .qa-icon .btn-main { flex: 0 0 var(--tap); width: var(--tap); padding: 0; }
.qa-icon .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Forms ---------- */

.field { margin: 0 0 16px; }
fieldset { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
legend { padding: 0; }
label, legend { display: block; margin: 0 0 6px; color: var(--ink); font-size: 14.5px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="tel"],
input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], select, textarea {
  display: block; width: 100%; min-height: var(--tap); padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: #fff; color: var(--ink);
  font: 400 16px/1.4 var(--sans);
}
input[type="date"], input[type="datetime-local"], input[type="time"] { -webkit-appearance: none; appearance: none; }
textarea { min-height: 96px; resize: vertical; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234E5751' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--jac); outline: 2px solid var(--jac); outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: #7A847D; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.field-error { margin: 6px 0 0; color: var(--bad); font-size: 14px; font-weight: 600; }
.field-row { display: grid; gap: 0 16px; }
.input-short { max-width: 160px; }
.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); margin: 0; font-weight: 500; cursor: pointer; }
.check input { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: var(--canopy); cursor: pointer; }
.form-actions { display: flex; gap: 8px; }

@media (min-width: 720px) {
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Segmented controls: period toggles (links) and the outcome radios */
.seg { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--wash); }
.seg a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; border-radius: 8px;
  color: var(--muted); font-size: 14.5px; font-weight: 600; text-decoration: none;
}
.seg a:hover { color: var(--ink); }
.seg a[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.seg-radio { display: flex; width: 100%; max-width: 420px; }
.seg-opt { position: relative; flex: 1 1 0; margin: 0; }
.seg-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-opt span {
  display: flex; align-items: center; justify-content: center; min-height: var(--tap); border-radius: 8px;
  color: var(--muted); font-size: 15px; font-weight: 600;
}
.seg-opt input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.seg-opt input[value="won"]:checked + span { color: var(--ok); }
.seg-opt input[value="lost"]:checked + span { color: var(--bad); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--jac); outline-offset: 1px; }

/* ---------- Cards, chips, badges ---------- */

.card { padding: 18px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.card > h2 { margin: 0 0 14px; }
.card > h2 + .hint { margin: -6px 0 16px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: 0 0 10px; }
.card-head h2 { margin: 0; }
.link-more { display: inline-flex; align-items: center; min-height: var(--tap); font-size: 14.5px; font-weight: 600; }
.card-quiet { border-style: dashed; background: transparent; }
.notice-card { margin: 0 0 20px; background: var(--wash); }
.notice-card p { margin: 0; }
.danger-card { margin: 0 0 20px; border-color: var(--bad-line); background: #FFFBFA; }
.danger-card h2 { color: var(--bad); }
.empty { padding: 4px 0 2px; }
.empty-title { margin: 0 0 4px; font-weight: 600; }
.empty p:not(.empty-title) { margin: 0; color: var(--muted); font-size: 15px; }
.empty-state { max-width: 600px; }
.empty-state h1 { margin: 0 0 10px; }

@media (min-width: 720px) {
  .card { padding: 22px 24px; }
}

.chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--wash); color: var(--ink);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.chip-journey { background: #fff; color: var(--muted); }
.chip-won { border-color: var(--ok-line); background: var(--ok-tint); color: var(--ok); }
.chip-lost { border-color: var(--bad-line); background: var(--bad-tint); color: var(--bad); }
.chip-temp { border-color: var(--warn-line); background: var(--warn-tint); color: var(--warn); }
.chip-off { color: var(--muted); }
.tag { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--jac-tint); color: var(--jac-deep); font-size: 12px; font-weight: 600; }
.kind-label { font-weight: 600; }
.stage { font-weight: 600; }

/* SLA clock: icon + text, never colour alone. Live badges tick in desk.js. */
.sla {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px 0 8px;
  border: 1px solid transparent; border-radius: 999px; font: 500 13px/1 var(--mono); white-space: nowrap;
}
.sla .ic { width: 15px; height: 15px; stroke-width: 2; }
.sla .ic-late { display: none; }
.sla-late .ic-due { display: none; }
.sla-late .ic-late { display: block; animation: pd-pulse 1.8s ease-in-out infinite; }
.sla-due { border-color: var(--warn-line); background: var(--warn-tint); color: var(--warn); }
.sla-late { border-color: var(--bad-line); background: var(--bad-tint); color: var(--bad); }
.sla-ok { border-color: var(--ok-line); background: var(--ok-tint); color: var(--ok); }
.sla-slow { border-color: var(--line); background: var(--wash); color: var(--muted); }
.sla-none, .sla-closed { border-color: var(--line); background: transparent; color: var(--muted); }
@keyframes pd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
  .sla-late .ic-late { animation: none; }
}

/* ---------- Today: the velvet tray of leads waiting for a first reply ---------- */

.page-today .wrap { padding-top: 0; }
.tray {
  margin: 0 0 28px; padding: 10px 0 22px; background: var(--velvet); color: var(--platinum);
  box-shadow: 0 0 0 100vmax var(--velvet); clip-path: inset(0 -100vmax);
}
.tray-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 10px; }
.tray h1 { color: #fff; }
.tray-date { margin: 6px 0 0; color: var(--silver); font-size: 13px; }
.tray-link { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--platinum); font-size: 14.5px; font-weight: 600; text-underline-offset: 4px; }
.tray-link:hover { color: #fff; }
.tray-title { margin: 22px 0 4px; color: var(--silver); font-family: var(--sans); font-size: 15px; font-weight: 600; }
.tray-count {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; margin-right: 8px; padding: 0 8px;
  border-radius: 999px; background: var(--bad); color: #fff; font-size: 15px; vertical-align: 1px;
}
.tray.is-clear .tray-title { color: #fff; font-family: var(--serif); font-size: 21px; font-weight: 400; }
.tray-empty { max-width: 60ch; margin: 4px 0 0; color: var(--silver); }
.tray-more { margin: 12px 0 0; }
.tray-more a { color: var(--platinum); font-weight: 600; }

.queue { margin: 0; padding: 0; list-style: none; }
.q-item {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "who clock" "actions actions"; gap: 12px; padding: 16px 0; border-top: 1px solid var(--velvet-line);
}
.q-item:first-child { border-top: 0; }
.q-who { grid-area: who; min-width: 0; overflow-wrap: anywhere; }
.q-clock { grid-area: clock; position: relative; z-index: 1; }
.q-item .qa { grid-area: actions; position: relative; z-index: 1; }
.q-name { color: #fff; font-family: var(--serif); font-size: 20px; line-height: 1.2; text-decoration: none; }
.q-name:hover { color: #fff; text-decoration: underline; }
.q-meta { margin: 5px 0 0; color: var(--silver); font-size: 14px; }
.q-meta .mono { color: var(--platinum); }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 0; }

/* Controls on velvet: platinum for the reply, quiet outlines for the rest */
.tray .btn, .is-waiting .btn { border-color: #3B4148; background: transparent; color: var(--platinum); }
.tray .btn:hover, .is-waiting .btn:hover { border-color: var(--silver); background: var(--velvet-2); color: #fff; }
.tray .btn-main, .is-waiting .btn-main { border-color: var(--platinum); background: var(--platinum); color: var(--velvet); }
.tray .btn-main:hover, .is-waiting .btn-main:hover { border-color: #fff; background: #fff; color: var(--velvet); }
.tray .sla-due, .is-waiting .sla-due { border-color: rgba(246, 207, 122, .4); background: rgba(246, 207, 122, .1); color: #F6CF7A; }
.tray .sla-late, .is-waiting .sla-late { border-color: rgba(255, 180, 171, .45); background: rgba(255, 130, 115, .14); color: #FFB4AB; }
.tray :focus-visible, .is-waiting :focus-visible { outline-color: #B9A3EE; }

@media (min-width: 900px) {
  .q-item { grid-template-columns: minmax(0, 1fr) 150px minmax(320px, 380px); grid-template-areas: "who clock actions"; align-items: center; padding: 14px 0; }
}

/* KPI strip: one hairline-divided panel */
.numbers { margin: 0 0 24px; }
.kpis {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--line); overflow: hidden;
}
.kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px 16px; background: var(--card); }
.kpi-wide { grid-column: span 2; }
.kpi-label { margin: 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.kpi-num { margin: 0; color: var(--ink); font: 600 30px/1.1 var(--sans); letter-spacing: -.01em; }
.kpi-unit { margin-right: 6px; color: var(--muted); font-size: 15px; font-weight: 500; letter-spacing: 0; }
.kpi-sub { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.kpi-break { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 4px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13.5px; }
.kpi-break b { color: var(--ink); font-weight: 600; }
.meter { height: 8px; margin: 8px 0 2px; border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; }
.meter-ok { background: #D4E8DC; }
.meter-ok span { background: var(--ok); }
.meter-warn { background: #F4E2C1; }
.meter-warn span { background: var(--warn); }
.meter-bad { background: #F5D1CC; }
.meter-bad span { background: var(--bad); }
.split-bar { display: flex; gap: 2px; height: 8px; margin: 8px 0 2px; }
.split-bar span { display: block; min-width: 6px; flex-basis: 0; border-radius: 999px; }
.split-bar .won { background: var(--ok); }
.split-bar .lost { background: var(--silver); }

@media (min-width: 1024px) {
  .kpis { grid-template-columns: 1.35fr 1fr 1fr 1.35fr 1.1fr; }
  .kpi-wide { grid-column: auto; }
  .kpi { padding: 18px 20px 20px; }
  .kpi-num { font-size: 34px; }
}

.today-grid { display: grid; gap: 16px; }
@media (min-width: 1024px) {
  .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
}

.todo { margin: 0; padding: 0; list-style: none; }
.todo-item { position: relative; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.todo-item:first-child { padding-top: 2px; border-top: 0; }
.todo-when { display: flex; align-items: center; gap: 6px; margin: 0 0 3px; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.todo-when .ic { width: 15px; height: 15px; }
.todo-item.is-overdue .todo-when { color: var(--bad); }
.todo-what { color: var(--ink); font-size: 16px; font-weight: 600; text-decoration: none; }
.todo-what:hover { color: var(--ink); text-decoration: underline; }
.todo-meta { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Tables (cards under 720 px) ---------- */

.tbl {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-card); border-collapse: separate; border-spacing: 0;
  background: var(--card); font-size: 15px;
}
.tbl th {
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: #FAFBF9;
  color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap;
}
.tbl th:first-child { border-top-left-radius: var(--r-card); }
.tbl th:last-child { border-top-right-radius: var(--r-card); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* Free text from visitors may break anywhere ("anywhere" also lowers the column's minimum width, so one long unbroken
   name cannot widen the table); numbers, prices, modes and times stay on one line. */
.tbl .c-name, .tbl .c-person, .tbl .c-email, .tbl .c-detail, .tbl .c-user { overflow-wrap: anywhere; }
.tbl .num, .tbl .c-mode, .tbl .c-clock, .tbl .c-actions, .tbl .c-links, .tbl .c-stage .stage { white-space: nowrap; }
.tbl .c-price { white-space: normal; } /* the amount keeps its non-breaking space; "a month" may wrap */
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .mono { white-space: nowrap; }
.tbl a.mono { text-decoration: none; }
.tbl a.mono:hover { text-decoration: underline; }

.tbl-plain { border: 0; border-radius: 0; background: none; }
.tbl-plain th { padding: 0 12px 8px 0; background: none; border-radius: 0; }
.tbl-plain td { padding: 10px 12px 10px 0; }
.tbl-plain th:last-child, .tbl-plain td:last-child { padding-right: 0; }
.tbl-top .c-title a { display: block; color: var(--muted); font-size: 12.5px; }
.tbl-top .c-title span { display: block; font-weight: 500; line-height: 1.35; }

.tbl-leads td { padding: 10px 12px; }
.tbl-leads .c-ref a { color: var(--muted); }
.tbl-leads .c-kind .kind-label { display: block; margin-bottom: 4px; font-size: 14.5px; }
.tbl-leads .c-name { font-weight: 600; }
.tbl-leads .c-name a { color: var(--ink); text-decoration: none; }
.tbl-leads .c-name a:hover { text-decoration: underline; }
.tbl-leads .c-stage .chip { margin-left: 6px; }
.tbl-leads .c-assignee { color: var(--ink); }
.tbl-leads tr.row-late td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.tbl-leads tr.row-due td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

.c-listing-main { display: flex; align-items: center; gap: 14px; min-width: 260px; }
.thumb, .listing-thumb {
  flex: 0 0 auto; border-radius: 6px; background-color: #E3E8E2; background-image: var(--stripes);
  background-position: center; background-size: cover; background-repeat: no-repeat;
}
.thumb { width: 72px; aspect-ratio: 4 / 3; }
.c-listing-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.c-listing-text b { font-weight: 600; line-height: 1.3; }
.ref-link { color: var(--muted); font-size: 12.5px; }
.c-links { white-space: nowrap; text-align: right; }
.c-links .btn { margin: 2px 0 2px 6px; }
.c-links .ic { width: 16px; height: 16px; }
.c-user b { font-weight: 600; }
.c-user .small { display: block; }
.tbl-users tr.is-off { color: var(--muted); }
.tbl-audit td { vertical-align: top; font-size: 14.5px; }
.tbl-audit .c-detail { max-width: 520px; color: var(--muted); }
.action-tag { font-weight: 600; }

@media (min-width: 720px) {
  .tbl-leads .c-name, .tbl .c-person { position: relative; }
}

@media (max-width: 719.98px) {
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl { border: 0; border-radius: 0; background: none; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl tr { position: relative; margin: 0 0 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
  .tbl td { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 5px 0; border: 0; text-align: right; }
  .tbl td::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); font-size: 13.5px; font-weight: 500; text-align: left; }
  .tbl td:not([data-label]) { display: block; text-align: left; }
  .tbl td:not([data-label])::before { content: none; }

  /* Inbox cards: name and clock first, then the request, then quiet facts, then the reply buttons */
  .tbl-leads tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 14px; }
  .tbl-leads td { display: block; width: auto; padding: 0; text-align: left; }
  .tbl-leads .c-name { order: 1; flex: 1 1 auto; min-width: 0; font-family: var(--serif); font-size: 19px; font-weight: 400; line-height: 1.25; }
  .tbl-leads .c-clock { order: 2; position: relative; z-index: 1; margin-left: auto; }
  .tbl-leads .c-kind { order: 3; display: flex; flex: 1 0 100%; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 2px; }
  .tbl-leads .c-kind .kind-label { display: inline; margin: 0; }
  .tbl-leads .c-stage { order: 4; }
  .tbl-leads .c-listing { order: 5; }
  .tbl-leads .c-ref { order: 6; }
  .tbl-leads .c-assignee { order: 7; }
  .tbl-leads .c-stage, .tbl-leads .c-listing, .tbl-leads .c-ref, .tbl-leads .c-assignee { color: var(--muted); font-size: 14px; }
  .tbl-leads .c-stage .stage { font-weight: 500; }
  .tbl.tbl-leads .c-listing::before, .tbl.tbl-leads .c-ref::before, .tbl.tbl-leads .c-assignee::before { content: "·"; margin-right: 10px; color: var(--line-strong); }
  .tbl-leads .c-listing.is-empty { display: none; }
  .tbl-leads .c-ref a { position: relative; z-index: 1; }
  .tbl-leads .c-actions { order: 8; flex: 1 0 100%; position: relative; z-index: 1; padding-top: 10px; }
  .tbl-leads tr.row-late { box-shadow: inset 3px 0 0 var(--bad); }
  .tbl-leads tr.row-due { box-shadow: inset 3px 0 0 var(--warn); }
  .tbl-leads tr.row-late td:first-child, .tbl-leads tr.row-due td:first-child { box-shadow: none; }
  .qa-icon { gap: 8px; }
  .qa-icon .btn { flex: 1 1 0; width: auto; padding: 0 10px; }
  .qa-icon .btn-main { flex-grow: 1.6; }
  .qa-icon .btn span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }

  /* Plain tables inside cards: rows are rules, not cards */
  .tbl-plain tr { margin: 0; padding: 12px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
  .tbl-plain tr:first-child { padding-top: 0; border-top: 0; }
  .tbl-top td.c-title { padding-bottom: 6px; }
  .tbl-top td.num { display: inline-flex; width: auto; gap: 6px; margin-right: 14px; padding: 0; }
  .tbl-top td.num::before { font-size: 13px; }

  .tbl .c-person { font-family: var(--serif); font-size: 19px; }
  .tbl .c-person a { color: var(--ink); text-decoration: none; }
  .c-listing-main { min-width: 0; padding-bottom: 8px; }
  .c-links { padding-top: 8px; text-align: left; }
  .c-links .btn { margin: 0 6px 0 0; }
  .c-user { padding-bottom: 6px; }
  .tbl-users td.c-user { display: block; text-align: left; }
  .tbl-users td.c-user::before { content: none; }
  .tbl-audit td { font-size: 14px; }
  .tbl-audit .c-detail { max-width: none; text-align: right; }
}

/* ---------- Inbox filters ---------- */

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.presets a {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card); color: var(--ink);
  font-size: 14.5px; font-weight: 600; text-decoration: none;
}
.presets a:hover { border-color: #AFB7AD; color: var(--ink); }
.presets a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.presets .n { color: var(--muted); font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.presets a[aria-current="page"] .n { color: var(--silver); }
.filters { margin: 0 0 16px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1 1 auto; min-width: 0; }
.btn-search .hide-sm { display: none; }
.more-filters { margin-top: 6px; }
.filters > .more-filters:first-child { margin-top: 0; }
.more-filters > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 10px; border-radius: 8px;
  color: var(--ink); font-weight: 600; list-style: none; cursor: pointer;
}
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters > summary:hover { background: var(--wash); }
.more-filters > summary .ic { width: 18px; height: 18px; color: var(--muted); }
.filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 10px 4px 4px; }
.filter-grid .field { margin: 0; min-width: 0; }
.filter-grid .check-inline { grid-column: 1 / -1; }
.filter-actions { display: flex; gap: 8px; padding: 12px 4px 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 0; }
.pager-pos { color: var(--muted); font-size: 14px; }

@media (min-width: 720px) {
  .btn-search .hide-sm { display: inline; }
}
@media (min-width: 900px) {
  .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Lead page ---------- */

.crumbs { margin: 0 0 6px; }
.crumbs a {
  display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); margin-left: -8px; padding: 0 8px;
  border-radius: 8px; color: var(--muted); font-size: 14.5px; font-weight: 600; text-decoration: none;
}
.crumbs a:hover { background: var(--wash); color: var(--ink); }
.crumbs .ic { width: 18px; height: 18px; }
.lead-head { margin: 0 0 18px; }
.lead-head h1 { margin: 2px 0 12px; }
.lead-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lead-tags .stage { padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; font-size: 13.5px; }
.lead-listing { margin: 12px 0 0; font-weight: 600; }
.lead-listing a { color: var(--ink); text-decoration-color: var(--line-strong); }
.lead-listing a:hover { color: var(--jac-deep); }
.lead-listing .mono { color: var(--muted); font-weight: 500; }
.lead-source { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; overflow-wrap: anywhere; }

.lead-grid { display: flex; flex-direction: column; gap: 16px; }
.lead-col { display: contents; }
.sec-contact { order: 1; }
.sec-details { order: 2; }
.sec-pipeline { order: 3; }
.sec-notes { order: 4; }
.sec-fica { order: 5; }
.sec-activity { order: 6; }

@media (min-width: 1024px) {
  .lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 20px; }
  .lead-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
  .lead-main { grid-column: 1; grid-row: 1; }
  .lead-side { grid-column: 2; grid-row: 1; }
}

.contact-list { display: grid; gap: 8px; margin: 0 0 16px; }
.contact-list div { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: baseline; gap: 12px; }
.contact-list dt { color: var(--muted); font-size: 14px; }
.contact-list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.sec-contact .qa { margin: 0 0 12px; }
.replied-form { margin: 0; }
.sec-contact .hint { margin-top: 8px; }
.replied-note { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; color: var(--ok); font-size: 14.5px; font-weight: 600; }
.replied-note .ic { width: 18px; height: 18px; }
.wa-preview { margin-top: 14px; padding-top: 2px; border-top: 1px solid var(--line); }
.wa-preview summary { display: flex; align-items: center; min-height: var(--tap); color: var(--jac-deep); font-size: 14.5px; font-weight: 600; cursor: pointer; list-style: none; }
.wa-preview summary::-webkit-details-marker { display: none; }
.wa-preview summary::after, .more-filters > summary::after {
  content: ""; width: 7px; height: 7px; margin: -3px 4px 0 auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.more-filters > summary::after { margin-left: 4px; }
.wa-preview[open] summary::after, .more-filters[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.wa-preview .pre { margin: 2px 0 4px; padding: 12px 14px; border-radius: 10px; background: var(--paper); font-size: 15px; }
.take-form { margin: 12px 0 0; }
.person-link { margin: 12px 0 0; font-size: 14.5px; }

/* Waiting for a first reply: the contact card sits on velvet, like the Today tray */
.sec-contact.is-waiting { border-color: var(--velvet); background: var(--velvet); color: var(--platinum); }
.sec-contact.is-waiting h2 { color: #fff; }
.sec-contact.is-waiting dt, .sec-contact.is-waiting .muted, .sec-contact.is-waiting .hint { color: var(--silver); }
.sec-contact.is-waiting a:not(.btn) { color: #fff; }
.sec-contact.is-waiting .btn-reply { border-color: #3B4148; background: transparent; color: var(--platinum); }
.sec-contact.is-waiting .wa-preview { border-color: var(--velvet-line); }
.sec-contact.is-waiting .wa-preview summary { color: var(--platinum); }
.sec-contact.is-waiting .wa-preview .pre { background: var(--velvet-2); color: var(--platinum); }

.listing-card {
  position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  margin: 0 0 16px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); text-decoration: none;
}
.listing-card:hover { border-color: var(--line-strong); background: #FBFCFA; color: var(--ink); }
.listing-thumb { width: 96px; aspect-ratio: 4 / 3; }
.listing-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.listing-text b { font-weight: 600; line-height: 1.3; }
.listing-text span { color: var(--muted); font-size: 14px; }
.listing-text .listing-open { color: var(--jac-deep); font-size: 13.5px; font-weight: 600; }
.ic-ext { width: 18px; height: 18px; color: var(--muted); }
.message { max-width: 70ch; margin: 0 0 16px; padding: 14px 16px; border-radius: 10px; background: var(--paper); font-size: 16px; line-height: 1.6; }
.dl { margin: 0 0 16px; border-top: 1px solid var(--line); }
.dl > div { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dl dt { color: var(--muted); font-size: 14.5px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.dl-stack > div { grid-template-columns: 1fr; gap: 2px; }
.consent { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--muted); font-size: 14px; }
.consent .ic { width: 18px; height: 18px; margin-top: 1px; }
.consent.is-yes .ic { color: var(--ok); }

.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.steps li {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 13.5px;
}
.steps li.done { border-color: #C6D8CD; background: var(--canopy-tint); color: var(--canopy); }
.steps li.done::before { content: "\2713"; margin-right: 6px; font-size: 12px; }
.steps li.current { border-color: var(--canopy); background: var(--canopy); color: #fff; font-weight: 600; }
.advance-form { margin: 0 0 18px; }
.pipeline-form { padding-top: 18px; border-top: 1px solid var(--line); }
.note-form { display: grid; gap: 10px; margin: 0 0 18px; }
.note-form .btn { justify-self: start; }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 11px; height: 11px; border: 2px solid var(--jac);
  border-radius: 50%; background: var(--card);
}
.timeline li::after { content: ""; position: absolute; left: 5px; top: 22px; bottom: 2px; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.t-meta { margin: 0 0 3px; color: var(--muted); font-size: 13.5px; }
.t-meta b { color: var(--ink); font-weight: 600; }
.t-body { margin: 0; overflow-wrap: anywhere; }
.timeline-quiet li::before { border-color: var(--line-strong); }
.timeline-quiet .t-body { font-size: 14.5px; }
.timeline-quiet .t-body b { font-weight: 600; }

.checks { margin: 8px 0 14px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.checks li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; border-bottom: 1px solid var(--line); }
.checks .by { padding: 0 0 8px 34px; color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
@media (min-width: 420px) {
  .checks .by { padding: 0; }
}

/* ---------- People, users, settings ---------- */

.person-grid { display: grid; gap: 16px; margin: 0 0 8px; }
.split { display: grid; gap: 16px; }
.role-options { display: grid; gap: 8px; }
.radio-card {
  display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-weight: 400; cursor: pointer;
}
.radio-card input { flex: 0 0 auto; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--canopy); }
.radio-card b { display: block; font-weight: 600; }
.radio-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.radio-card:has(input:checked) { border-color: var(--canopy); background: var(--canopy-tint); }
.erase-form .field { max-width: 320px; }
.settings-form { display: grid; gap: 16px; max-width: 820px; margin: 0 0 20px; }
.settings-form .card > h2 { margin-bottom: 14px; }
.settings-form > .card-quiet, .page-settings .card-quiet { max-width: 820px; }
.policy { margin: 4px 0 8px; padding: 12px 14px; border-radius: 10px; background: var(--paper); }
.policy p { margin: 0; font-size: 15px; }

@media (min-width: 900px) {
  .person-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (min-width: 1024px) {
  .split { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 20px; }
}

/* ---------- Sign-in and setup ---------- */

.page-auth .wrap { padding-top: 32px; }
.auth-card { padding: 24px 20px; }
.auth-card h1 { margin: 0 0 12px; }
.lede { color: var(--muted); }
.setup-where { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--paper); font-weight: 500; }
.setup-note { margin: 8px 0 22px; }
.auth-foot { margin-top: 16px; }
@media (min-width: 720px) {
  .auth-card { padding: 32px; }
}

/* ---------- Farming: consent-first approaches to private owners ---------- */

.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line-strong); background: var(--card); color: var(--ink); }
.ic-inline { width: 16px; height: 16px; vertical-align: -3px; margin-left: 4px; }
.optional { margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 500; }
.link-btn { padding: 0; border: 0; background: none; color: var(--jac-deep); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--jac); }
.chip-farm { border-color: #DDD3F3; background: var(--jac-tint); color: var(--jac-deep); }
.count-pill {
  display: inline-grid; place-items: center; min-width: 26px; height: 24px; margin-left: 6px; padding: 0 8px; border-radius: 999px;
  background: var(--jac-tint); color: var(--jac-deep); font: 600 13px/1 var(--sans); vertical-align: 3px;
}
.check-box { margin: 0 0 12px; }

/* The velvet tray on the Farming page: "Send now" */
.farm-tray .tray-head { align-items: center; }
.farm-tray .tray-date { margin-top: 8px; line-height: 1.6; }
.win-open { color: #9FD8B8; }
.win-closed { color: #F6CF7A; }
.tray .btn-add { flex: 0 0 auto; border-color: var(--platinum); background: var(--platinum); color: var(--velvet); }
.tray .btn-add:hover { border-color: #fff; background: #fff; color: var(--velvet); }
.tray-count.is-wait { background: #3B4148; }
.farm-q .q-name { font-size: 19px; }
.farm-send { grid-area: actions; position: relative; z-index: 1; display: grid; gap: 6px; min-width: 0; }
.q-item .farm-send .qa { grid-area: auto; }
.farm-msg summary {
  display: flex; align-items: center; min-height: var(--tap); color: var(--silver); font-size: 14px; font-weight: 600; cursor: pointer; list-style: none;
}
.farm-msg summary::-webkit-details-marker { display: none; }
.farm-msg summary::after {
  content: ""; width: 7px; height: 7px; margin: -3px 4px 0 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.farm-msg[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.farm-msg summary:hover { color: #fff; }
.tray textarea { border-color: #3B4148; background: var(--velvet-2); color: var(--platinum); font-size: 15px; }
.tray textarea:focus-visible { border-color: #B9A3EE; outline-color: #B9A3EE; }
.farm-q-wait { grid-area: actions; margin: 0; color: var(--silver); font-size: 14px; }
.approach-error { margin: 4px 0 0; color: #FFB4AB; font-size: 14px; font-weight: 600; }
.card .approach-error { color: var(--bad); }
.seen .ic { width: 15px; height: 15px; }
.tray .sla-none { border-color: #3B4148; color: var(--silver); }

/* "Add contact details": 20 seconds per listing */
.farm-contact { margin: 0 0 24px; }
.farm-contact .card-head .hint { margin: 0; }
.farm-target { margin: 4px 0 14px; }
.farm-target-label { margin: 0; font-size: 14px; }
.farm-target .meter { margin: 6px 0 0; }
.cd-who { font-weight: 600; }
.assign-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 12px; }
.assign-bar .field { margin: 0; min-width: 200px; }
.assign-bar .hint { flex-basis: 100%; margin: 0; }
.c-tick { width: 34px; }
.inline-form { display: inline; }
.owner-brief { margin: 6px 0 0; font-size: 14px; }
.owners-rules { margin: 0 0 12px; }
/* 1.4.8: leak check (canaries), the office only */
.chip-canary { border-color: var(--warn-line); background: var(--warn-tint); color: var(--warn); }
.canary-note { margin: 8px 0 0; }
.farm-leak .leak-list { margin: 8px 0 12px; }
.farm-leak .is-tripped .todo-meta { color: var(--bad); font-weight: 600; }
.farm-leak .leak-add summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.farm-leak .leak-form .btn { margin-top: 8px; }
/* 1.4.8: the search and filters at the top of Farming (Sizwe), a light card on the velvet band */
.farm-find { margin: 16px 0 0; color: var(--ink); }
.farm-find .find-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.farm-find .find-q { grid-column: 1 / -1; }
.farm-find .field { margin: 0; min-width: 0; }
.farm-find .find-go { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-end; }
.farm-find .find-go .btn-primary { flex: 1 1 auto; }
.tray .farm-find .btn { border-color: var(--line-strong); background: var(--card); color: var(--ink); }
.tray .farm-find .btn:hover { border-color: #AFB7AD; background: #F7F8F6; color: var(--ink); }
.tray .farm-find .btn-primary { border-color: var(--canopy); background: var(--canopy); color: #fff; }
.tray .farm-find .btn-primary:hover { border-color: var(--canopy-dark); background: var(--canopy-dark); color: #fff; }
.tray .farm-find .btn-ghost { border-color: transparent; background: transparent; color: var(--jac-deep); }
.tray .farm-find .btn-ghost:hover { background: var(--wash); color: var(--jac-deep); }
.tray .farm-find :focus-visible { outline-color: var(--jac); }
.farm-find .more-filters { margin-top: 8px; }
.farm-find-note { margin-top: 14px; }
.farm-find-note .tray-link { display: inline; min-height: 0; }
.farm-finding { margin: -4px 0 12px; }
@media (max-width: 559px) {
  .farm-tray .tray-head { flex-wrap: wrap; }
  .farm-tray .tray-head h1 { flex: 1 0 100%; } /* "Farming" on its own line, the buttons under it */
}
@media (min-width: 760px) {
  .farm-find .find-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; }
  .farm-find .find-q, .farm-find .find-go { grid-column: auto; }
  .farm-find .find-go .btn-primary { flex: 0 0 auto; }
}
/* 1.4.9: the Area filter: tick suburbs, or a whole region in one tick (Sizwe). In the page's flow, not a floating
   panel: the velvet band clips anything that hangs below it. */
.area-pick { margin-top: 10px; }
.area-pick > summary {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 8px 40px 8px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); color: var(--ink); list-style: none; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234E5751' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px;
}
.area-pick > summary::-webkit-details-marker { display: none; }
.area-pick[open] > summary { border-color: var(--jac); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234E5751' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E"); }
.area-label { flex: 0 0 auto; font-size: 14.5px; font-weight: 600; }
.area-sum { min-width: 0; overflow: hidden; color: var(--ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.area-panel {
  margin-top: 8px; padding: 10px 12px 0; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  max-height: min(70vh, 640px); overflow: auto; overscroll-behavior: contain;
}
.area-tools { display: flex; gap: 8px; margin: 0 0 6px; }
.area-tools .area-find { flex: 1 1 auto; min-width: 0; }
.area-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 24px; }
.area-group { margin: 0 0 8px; }
.area-group[hidden], .area-list li[hidden] { display: none; }
.area-region { width: 100%; margin: 0; border-bottom: 1px solid var(--line); }
.area-region .check { font-weight: 600; }
.area-list { margin: 2px 0 0; padding: 0; list-style: none; }
.area-list .check { min-height: var(--tap); font-weight: 500; }
.area-pick .check { gap: 10px; }
.area-name { min-width: 0; overflow-wrap: anywhere; }
.area-n { margin-left: auto; padding-left: 8px; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.area-foot { position: sticky; bottom: 0; margin: 4px -12px 0; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.area-foot .btn { width: 100%; }
/* 1.4.11: the Price filter (Sizwe): a range for lets and one for sales, under Area; on Owners to contact too */
.price-pick { margin-top: 8px; }
.price-row { min-width: 0; margin: 0 0 12px; padding: 0; border: 0; }
.price-legend { margin: 0 0 4px; padding: 0; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.price-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 8px; }
.price-inputs .field { min-width: 0; margin: 0; }
.price-dash { padding-bottom: 12px; color: var(--muted); }
.price-hint { margin: 0 0 4px; }
.price-pick .area-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.price-pick .area-foot .btn { width: auto; }
.price-pick .area-foot .btn-primary { flex: 1 1 auto; }
.owners-find { margin: 14px 0 6px; }
.owners-find > .area-pick:first-child { margin-top: 0; }
.owners-filtering { margin: 10px 0 0; }
.owners-none .tray-link { display: inline; min-height: 0; }
@media (min-width: 760px) {
  .price-panel { max-width: 640px; }
  .price-pick .area-foot .btn-primary { flex: 0 0 auto; }
}
.region-list { margin: 8px 0 0; }
.region-list > summary { display: flex; align-items: center; min-height: var(--tap); font-weight: 600; cursor: pointer; }
.region-row { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
@media (min-width: 760px) {
  .area-groups { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
  .area-list .check { min-height: 36px; }
  .area-foot .btn { width: auto; }
}
.cd-list { margin: 0; padding: 0; list-style: none; }
.cd-item { padding: 16px 0; border-top: 1px solid var(--line); }
.cd-item:first-child { padding-top: 4px; border-top: 0; }
.cd-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin: 0 0 10px; }
.cd-what { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.cd-title { color: var(--ink); font-family: var(--serif); font-size: 19px; line-height: 1.25; text-decoration: none; }
.cd-title:hover { color: var(--ink); text-decoration: underline; }
.cd-meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.cd-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cd-side .btn .ic { width: 16px; height: 16px; }
.cd-form { margin: 0; }
.cd-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.cd-fields .field { margin-bottom: 10px; min-width: 0; }
.cd-fields .field:nth-child(3) { grid-column: 1 / -1; }
.cd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.cd-actions .check { margin: 0; }
.cd-skip { display: flex; flex: 1 1 100%; gap: 6px; min-width: 0; }
.cd-skip select { flex: 1 1 auto; min-width: 0; width: auto; color: var(--muted); font-size: 15px; }
@media (min-width: 900px) {
  .cd-fields { grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.2fr); }
  .cd-fields .field:nth-child(3) { grid-column: auto; }
  .cd-skip { flex: 0 1 auto; margin-left: auto; }
  .cd-skip select { flex: 0 1 260px; }
}

.farm-grid { margin: 0 0 28px; }
.farm-grid .todo-when .sla { font-size: 12.5px; }
.farm-grid .todo-meta .chip { margin-left: 4px; }
.farm-queued { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }

/* KPIs: seven tiles */
.kpis-farm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis-farm .kpi-last { grid-column: span 2; }
@media (min-width: 720px) {
  .kpis-farm { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1180px) {
  .kpis-farm { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .kpis-farm .kpi-last { grid-column: auto; }
  .kpis-farm .kpi-num { font-size: 30px; }
}

/* Funnels: the area table runs down the left; source, message and channel stack on the right */
.farm-funnels { margin: 0 0 28px; }
@media (min-width: 1024px) {
  .farm-funnels > .card:first-child { grid-row: span 3; }
}
.farm-funnels .card > h2 { margin-bottom: 10px; }
.tbl-funnel .num { width: 1%; }
.tbl-funnel .tier-row td { padding-top: 14px; }
.tbl-funnel .tier-row td.c-what b { font-weight: 600; }
.tbl-funnel .sub-row td { color: var(--muted); font-size: 14.5px; }
.tbl-funnel .sub-name { padding-left: 14px; color: var(--ink); }
@media (max-width: 719.98px) {
  .tbl-funnel td.num { display: inline-flex; width: auto; gap: 6px; margin-right: 12px; padding: 0; }
  .tbl-funnel td.num::before { font-size: 13px; }
  .tbl-funnel td.c-what { padding-bottom: 4px; }
  .tbl-funnel .sub-name { padding-left: 0; }
}

/* All prospects */
.farm-all { margin: 0 0 24px; }
.small-count { margin-left: 6px; font-family: var(--mono); font-size: 14px; }
.tbl-prospects td { padding: 10px 12px; }
.tbl-prospects .c-ref a { color: var(--muted); }
.tbl-prospects .c-name { font-weight: 600; }
.tbl-prospects .c-name a { color: var(--ink); text-decoration: none; }
.tbl-prospects .c-name a:hover { text-decoration: underline; }
.tbl-prospects .c-name .small { display: block; font-weight: 500; }
.tbl-prospects .c-when { color: var(--muted); font-size: 14px; }
.tbl-prospects .ph-label { display: none; } /* words the phone cards need, which the column heads give on wider screens */
@media (min-width: 720px) {
  .tbl-prospects .c-name { position: relative; }
}
@media (max-width: 719.98px) {
  /* A card per prospect: title; status and price; ref, source and tier; then seen, approached and lead, a line each. */
  .tbl-prospects tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 14px; }
  .tbl-prospects tr::before, .tbl-prospects tr::after { content: ""; flex: 1 0 100%; height: 0; }
  .tbl-prospects tr::before { order: 4; }
  .tbl-prospects tr::after { order: 7; }
  .tbl-prospects td { display: block; width: auto; padding: 0; text-align: left; }
  .tbl.tbl-prospects td::before { content: none; }
  .tbl-prospects .c-name { order: 1; flex: 1 0 100%; font-family: var(--serif); font-size: 18px; font-weight: 400; line-height: 1.25; }
  .tbl-prospects .c-name .small { display: none; }
  .tbl-prospects .c-st { order: 2; }
  .tbl-prospects .c-price { order: 3; font-weight: 600; }
  .tbl-prospects .c-ref { order: 5; }
  .tbl-prospects .c-src { order: 6; }
  .tbl-prospects .c-seen { order: 8; }
  .tbl-prospects .c-appr { order: 9; }
  .tbl-prospects .c-lead { order: 10; }
  .tbl-prospects .c-src, .tbl-prospects .c-ref, .tbl-prospects .c-when, .tbl-prospects .c-lead { color: var(--muted); font-size: 14px; }
  .tbl-prospects .c-seen, .tbl-prospects .c-appr, .tbl-prospects .c-lead { flex: 1 0 100%; }
  .tbl.tbl-prospects .c-src::before { content: "·"; margin-right: 10px; color: var(--line-strong); }
  .tbl-prospects .is-empty { display: none; }
  .tbl-prospects .ph-label { display: inline; }
  .tbl-prospects .c-ref a, .tbl-prospects .c-lead a { position: relative; z-index: 1; }
  .tbl-prospects .c-lead .chip { margin-left: 4px; }
}

.farm-dnc { max-width: 820px; }
.dnc-form { display: grid; gap: 0 12px; align-items: end; }
.dnc-form .btn { margin-bottom: 16px; }
@media (min-width: 720px) {
  .dnc-form { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; }
}

/* Prospect page */
.prospect-head h1 { margin-bottom: 12px; }
.page-prospect .sec-approach { order: 1; }
.page-prospect .sec-consent { order: 2; }
.page-prospect .sec-details { order: 3; }
.page-prospect .sec-activity { order: 4; }
.page-prospect .sec-delete { order: 5; }
.dnc-banner {
  display: flex; align-items: flex-start; gap: 14px; margin: 0 0 20px; padding: 16px 18px;
  border: 1px solid var(--bad-line); border-left: 4px solid var(--bad); border-radius: var(--r-card); background: var(--bad-tint);
}
.dnc-banner h2 { margin: 0 0 4px; color: var(--bad); font-size: 21px; }
.dnc-banner p { margin: 0; color: #7A1A12; }
.ic-dnc { width: 26px; height: 26px; margin-top: 2px; color: var(--bad); }
.notice-amber { border-color: var(--warn-line); background: var(--warn-tint); color: #6B3F00; }
.demand-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--jac-tint); color: var(--jac-deep); font-size: 13.5px; font-weight: 600; }
.approach-card .card-head { margin-bottom: 4px; }
.approach-form { display: grid; gap: 10px; }
.msg-box { min-height: 170px; font-size: 16px; line-height: 1.55; }
.msg-meta { margin: -2px 0 2px; }
.approach-buttons { flex-wrap: wrap; }
.approach-buttons .btn { flex: 1 1 0; }
@media (max-width: 719.98px) {
  .approach-buttons .btn-main { flex: 1 0 100%; } /* WhatsApp gets its own row on phones; SMS and Email share the next */
}
.window-closed {
  display: flex; align-items: center; gap: 10px; margin: 2px 0 0; padding: 12px 14px; border: 1px solid var(--warn-line); border-radius: 10px;
  background: var(--warn-tint); color: var(--warn); font-weight: 600;
}
.window-closed .ic { width: 20px; height: 20px; }
.locked-line { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 6px; font-size: 16.5px; font-weight: 600; line-height: 1.45; }
.locked-line .ic { width: 20px; height: 20px; margin-top: 2px; color: var(--ok); }
.reopen { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.reopen p { margin: 0; font-weight: 500; }
.reopen.is-fresh { border-color: #C6D8CD; background: var(--canopy-tint); }
.reply-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.reply-q { margin: 0 0 10px; font-weight: 600; }
.lead-link-card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none;
}
.lead-link-card:hover { border-color: var(--line-strong); background: #FBFCFA; color: var(--ink); }
.lead-link-card .mono { color: var(--muted); }
.lead-link-card b { font-weight: 600; }
.lead-link-card span:not(.mono) { grid-column: 2; color: var(--muted); font-size: 14px; }
.lead-link-card .ic-ext { grid-column: 3; grid-row: 1 / span 2; }
.small-message { margin: 0 0 12px; padding: 10px 12px; font-size: 15px; }
.sec-details .wa-preview .cd-form { padding: 6px 0 4px; }
.sec-details .cd-fields { grid-template-columns: 1fr; }
.sec-details .cd-fields .field:nth-child(3) { grid-column: auto; }

/* Add a prospect */
.prospect-form { max-width: 820px; }
.form-section { margin: 26px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 19px; }
.input-short-date { max-width: 220px; }
.farm-rules h2 { font-size: 19px; }
.rule-list { margin: 0; padding: 0 0 0 18px; color: var(--muted); font-size: 15px; }
.rule-list li { margin: 0 0 10px; }
.rule-list b { color: var(--ink); font-weight: 600; }

/* Settings: farming */
.tpl-field { padding: 16px 0 0; border-top: 1px solid var(--line); }
.tpl-field:first-of-type { padding-top: 4px; border-top: 0; }
.tpl-preview { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--paper); }
.tpl-preview .pre { margin: 4px 0 0; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.tpl-tag { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tpl-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: 4px; }
.tpl-foot .hint { margin: 0; }
.farm-setup { max-width: 820px; margin: 0 0 20px; }
.setup-list { margin: 0 0 8px; }
.setup-list > div { padding: 14px 0; border-top: 1px solid var(--line); }
.setup-list dt { margin: 0 0 6px; font-weight: 600; }
.setup-list dd { margin: 0; }
.setup-list code {
  display: block; max-width: 100%; margin: 0 0 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); font-family: var(--mono); font-size: 13.5px; overflow-wrap: anywhere; word-break: break-all; vertical-align: middle;
}
.setup-list form { margin: 8px 0 0; }
.setup-line { display: flex; align-items: flex-start; gap: 8px; }
.setup-line code { flex: 1 1 auto; min-width: 0; margin: 0; }
.setup-line .btn { flex: 0 0 auto; }
.run-summary { padding: 14px 0 0; border-top: 1px solid var(--line); }
.run-summary h3 { margin: 0 0 6px; font-family: var(--sans); font-size: 15px; font-weight: 600; }
.run-summary p { margin: 0 0 6px; }
.unparsed-list { margin: 0 0 6px; padding: 0 0 0 18px; color: var(--muted); font-size: 14.5px; overflow-wrap: anywhere; }
.unparsed-list a { font-weight: 600; }
.smtp-status { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--paper); font-size: 14.5px; overflow-wrap: anywhere; }
.smtp-status.is-error { background: var(--bad-tint); color: var(--bad); }
.smtp-test { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 0 0 6px; }
.smtp-test .field { flex: 1 1 240px; margin: 0; }

/* The intake-address email reader */
.mail-card { max-width: 820px; }
.mail-body {
  margin: 0 0 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
}
.mail-url { color: var(--muted); font-size: 13px; }
.mail-code { margin: 0 0 14px; }
.mail-code .hint { margin: 0 0 4px; }
.mail-code code {
  display: block; flex: 1 1 auto; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
  font: 500 22px/1.3 var(--mono); letter-spacing: .08em; overflow-wrap: anywhere;
}
.mail-card .form-actions { flex-wrap: wrap; justify-content: space-between; margin-top: 8px; }

/* Today: the Farming tile */
.farm-tile { margin: 0 0 24px; }
.farm-tile-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: 0 0 8px; }
.farm-tile-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.ic-farm { width: 22px; height: 22px; color: var(--canopy); }
.farm-tile-stats { display: grid; gap: 10px; }
.farm-stat {
  display: flex; align-items: baseline; gap: 12px; min-height: var(--tap); padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); text-decoration: none;
}
.farm-stat:hover { border-color: var(--line-strong); background: #FBFCFA; color: var(--ink); }
.farm-stat b { font: 600 28px/1.1 var(--sans); }
.farm-stat span { color: var(--muted); font-size: 14.5px; }
@media (min-width: 720px) {
  .farm-tile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  .bar, .tabbar, .qa, form { display: none !important; }
  body { background: #fff; }
}

/* Settings: links to each module's settings page */
.settings-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }

/* Settings: Listings feed (1.5.0) */
.feed-diff, .feed-problems { display: grid; gap: 6px; margin: 0 0 16px; padding-left: 20px; font-size: 15px; }
.feed-switch .btn { height: auto; padding-block: 10px; white-space: normal; text-align: center; } /* a long label wraps on a phone */
.feed-fields { margin-top: 12px; }
.feed-fields summary { display: flex; align-items: center; min-height: var(--tap); font-weight: 600; cursor: pointer; }
.feed-fields .hint.mono { overflow-wrap: anywhere; }
.feed-sample { max-height: 360px; margin: 0 0 10px; padding: 10px 12px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #FAFBF9; white-space: pre; }

/* Leads to contact: the agent's progress, and History (1.5.0) */
.owners-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 14px; }
.owners-progress .farm-stat { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; }
.owners-progress .farm-stat b { font-size: 22px; }
.owners-progress .farm-stat span { font-size: 13px; line-height: 1.25; }
.tray .owners-progress .farm-stat { border-color: #3B4148; background: transparent; color: var(--platinum); }
.tray .owners-progress .farm-stat b { color: #fff; }
.tray .owners-progress .farm-stat span { color: var(--silver); }
.tray .owners-progress .farm-stat:hover { border-color: var(--silver); background: var(--velvet-2); color: #fff; }
.history-intro { margin: -6px 0 18px; }
.history-numbers .seg { display: flex; flex-wrap: wrap; }
.history-numbers .seg a { flex: 1 1 auto; justify-content: center; padding: 0 8px; }
.kpis-history { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis-history .kpi-last { grid-column: span 2; }
.kpis-history a.kpi { color: inherit; text-decoration: none; }
.kpis-history a.kpi:hover { background: #FBFCFA; }
.history-find { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: end; }
.history-find .find-go { display: flex; gap: 8px; }
.history-find .find-go .btn-primary { flex: 1 1 auto; }
.history-out { margin: 6px 0 0; font-size: 14px; }
.history-out .chip { margin-right: 4px; }
.history-qa { flex-wrap: wrap; margin-top: 10px; }
.history-qa form { display: flex; flex: 1 1 210px; min-width: 0; }
.history-qa .btn { flex: 1 1 auto; height: auto; padding-block: 10px; white-space: normal; }
.history-open { margin: 8px 0 0; }
.tbl-history-people tr.is-picked td { background: var(--wash); }
.farm-history-link { margin: -12px 0 24px; }
@media (min-width: 720px) {
  .kpis-history { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kpis-history .kpi-last { grid-column: auto; }
  .history-find { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .history-find .find-q { grid-column: span 2; }
  .history-find .find-go .btn-primary { flex: 0 0 auto; }
  .history-numbers .seg { display: inline-flex; }
  .history-numbers .seg a { flex: 0 0 auto; padding: 0 14px; }
}
