/* HQ wears the website's colours, light version (James, 12 Sep 2026: "too dark, brighten it up"):
   cream page, white cards, ink text, emerald for numbers and buttons; only the sidebar stays green-black. */
:root {
  --bg: #F4F1EB;
  --surface: #FFFFFF;
  --surface-2: #ECE9E3;
  --card: #FFFFFF;
  --tint: rgba(9, 9, 11,.04);
  --line: rgba(9, 9, 11,.10);
  --line-strong: rgba(9, 9, 11,.20);
  --fg: #09090B;
  --fg-2: #505050;
  --fg-3: #808080;
  --accent: #10A5B0;
  --accent-deep: #0F407B;
  --on-accent: #09090B;
  --ink: #09090B;
  --cream: #F8F3ED;
  --chalk: #D9D6CF;
  --red: #B42318;
  --amber: #8F5B00;
  --blue: #1D5FD1;
  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
}
button, input, select { font-family: inherit; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--ink);
  color: var(--cream);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; text-decoration: none; }
.brand img { height: 36px; width: auto; display: block; }
.brand .hq-tag { font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: .08em; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 2px 8px; line-height: 1.3; }
.nav-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 4px;
  border-left: 3px solid transparent;
}
.sidebar .nav-item { color: rgba(248,243,237,.78); }
.nav-item .nav-label { color: inherit; }
.nav-item .nav-hint { font-size: 12px; font-weight: 400; color: rgba(248,243,237,.5); margin-top: 1px; }
.sidebar .nav-item:hover { background: rgba(248,243,237,.07); color: var(--cream); }
.sidebar .nav-item.active { background: rgba(248,243,237,.09); color: var(--cream); border-left-color: var(--accent); }
.nav-item.active .nav-hint { color: rgba(248,243,237,.7); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topbar .who { color: var(--fg-2); }
.topbar .who { font-size: 13px; color: var(--fg-3); }
.content { max-width: 1120px; margin: 0 auto; padding: 32px; }

h1 { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.subtitle { color: var(--fg-2); font-size: 14px; margin: 0 0 24px; }

h2.section-head {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 32px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
h2.section-head:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
h2.section-head .count { color: var(--fg-3); font-weight: 400; font-size: 15px; }

/* ---------- KPI row ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(9, 9, 11,.04);
  min-height: 96px;
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  text-decoration: none;
}
button.kpi-tile, a.kpi-tile { cursor: pointer; }
button.kpi-tile:hover, a.kpi-tile:hover { border-color: var(--accent); background: var(--surface); }
button.kpi-tile:focus-visible, a.kpi-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kpi-tile .label, .kpi-tile .value, .kpi-tile .note { display: block; }
.kpi-tile .label { font-size: 13px; font-weight: 500; color: var(--fg-2); }
.kpi-tile .value { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; line-height: 1.1; color: var(--accent-deep); }
.kpi-tile .value.bad { color: var(--red); }
.kpi-tile .note { font-size: 12px; font-weight: 400; margin-top: 4px; color: var(--fg-3); line-height: 1.35; }

/* ---------- month-over-month compare chart, 14 Sep 2026 ---------- */
.hq-compare {
  background: var(--surface); border: 1px solid var(--border, #E2DFD6); border-radius: 12px;
  padding: 16px 18px 12px; margin: 14px 0;
}
.hq-compare-row { margin-bottom: 12px; }
.hq-compare-row:last-of-type { margin-bottom: 8px; }
.hq-compare-label { display: block; font-size: 13px; font-weight: 600; color: var(--fg-2); margin-bottom: 5px; }
.hq-compare-track { position: relative; height: 20px; margin-bottom: 3px; background: var(--cream, #F8F3ED); border-radius: 5px; overflow: hidden; }
.hq-compare-bar { height: 100%; width: 100%; transform-origin: left; border-radius: 5px; transition: transform .3s ease; }
.hq-compare-bar.now { background: var(--accent-deep); }
.hq-compare-bar.last { background: var(--accent); opacity: .45; }
.hq-compare-num { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11.5px; font-weight: 700; color: var(--ink); }
.hq-compare-num.muted { color: var(--fg-3); font-weight: 600; }
.hq-compare-key { display: flex; gap: 16px; margin-top: 6px; font-size: 11.5px; color: var(--fg-3); }
.hq-compare-key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.hq-compare-key i.now { background: var(--accent-deep); }
.hq-compare-key i.last { background: var(--accent); opacity: .45; }

.hq-trend-card {
  background: var(--surface); border: 1px solid var(--border, #E2DFD6); border-radius: 12px;
  padding: 16px 18px 12px; margin: 14px 0;
}
.hq-trend-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.hq-trend { width: 100%; height: 150px; display: block; }
.hq-trend-line { stroke-width: 2; }
.hq-trend-line.spend { stroke: var(--accent); }
.hq-trend-line.brought { stroke: var(--accent-deep); }
.hq-trend-dot.spend { fill: var(--accent); }
.hq-trend-dot.brought { fill: var(--accent-deep); }
.hq-trend-axis { font-size: 10px; fill: var(--fg-3); }
.hq-trend-key { display: flex; gap: 16px; margin-top: 4px; font-size: 11.5px; color: var(--fg-3); }
.hq-trend-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.hq-trend-key i.now, .hq-trend-key i.brought { background: var(--accent-deep); }
.hq-trend-key i.spend { background: var(--accent); }

/* ---------- accounts card (14 Sep 2026) ---------- */
.hq-accounts-card {
  background: var(--surface); border: 1px solid var(--border, #E2DFD6); border-radius: 12px;
  padding: 16px 18px; margin: 14px 0;
}
.hq-accounts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.hq-accounts-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.hq-accounts-ask:disabled { opacity: .45; cursor: default; }
.hq-accounts-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 0; border-top: 1px solid var(--border, #E2DFD6);
}
.hq-accounts-row:first-of-type { border-top: none; }
.hq-accounts-check { width: 16px; height: 16px; accent-color: var(--accent-deep); flex-shrink: 0; }
.hq-accounts-name { font-size: 13.5px; font-weight: 600; color: var(--ink); min-width: 150px; }
.hq-accounts-state { font-size: 13px; color: var(--fg-3); flex: 1; }
.hq-accounts-state.good { color: var(--accent-deep); font-weight: 600; }
.hq-accounts-state.amber { color: var(--amber); font-weight: 600; }
.hq-accounts-state.red { color: var(--red); font-weight: 600; }
.hq-accounts-state.muted { color: var(--fg-3); }
.hq-accounts-checknow { padding: 4px 10px; font-size: 12.5px; }
.hq-accounts-summary { margin-top: 10px; font-size: 12.5px; color: var(--fg-3); }

/* ---------- table ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.data td, table.data th { overflow-wrap: anywhere; }
table.data th:first-child, table.data td:first-child { width: 34%; }
table.data th:last-child, table.data td:last-child { width: 200px; }
table.data th.num, table.data td.num { width: 130px; }
table.data th {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
table.data td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: top;
}
table.data tr:hover td { background: var(--surface); }
table.data td.num, table.data th.num { text-align: right; }
table.data .row-title { font-weight: 600; }
table.data .row-sub { color: var(--fg-2); font-size: 13px; margin-top: 2px; }

/* ---------- status dot ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.green, .dot.won, .dot.paid, .dot.approved { background: var(--accent-deep); }
.dot.amber, .dot.due, .dot.pending, .dot.claimed { background: var(--amber); }
.dot.red, .dot.late, .dot.rejected, .dot.lost { background: var(--red); }
.dot.blue, .dot.new, .dot.booked { background: var(--blue); }
.dot.grey, .dot.called, .dot.open, .dot.skipped { background: var(--fg-3); }

/* ---------- buttons ---------- */
.btn {
  height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #19c0c9; }
.btn-secondary { background: var(--surface); border: 1px solid var(--line-strong); color: var(--fg); }
.btn-secondary:hover { border-color: var(--accent-deep); color: var(--accent-deep); }
.btn-quiet { background: transparent; color: var(--fg-2); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid transparent; }
.btn-danger:hover { border-color: rgba(180,35,24,.35); }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- cards / rows ---------- */
.row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(9, 9, 11,.04);
}
.row-card .left { min-width: 0; flex: 1 1 200px; }
.row-card .sub { overflow-wrap: break-word; }
.row-card .title { font-weight: 600; font-size: 14px; }
.row-card .sub { color: var(--fg-2); font-size: 13px; margin-top: 2px; }
.row-card .right { flex-shrink: 0; display: flex; gap: 8px; align-items: center; }

.empty {
  color: var(--fg-2);
  font-size: 13px;
  padding: 16px;
  margin: 4px 0 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
}
.empty .empty-title { font-weight: 600; color: var(--fg); font-size: 14px; }
.empty .empty-next { margin-top: 4px; color: var(--fg-3); }

input[type="text"], input[type="email"], select {
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  padding: 0 10px;
  font-size: 14px;
}

/* ---------- mobile tabbar ---------- */
.tabbar { display: none; }

@media (max-width: 767px) {
  .sidebar { display: none; }
  .content { padding: 16px; padding-bottom: 80px; }
  .topbar { padding: 12px 16px; }
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-tile { min-height: 92px; padding: 12px 14px; }
  .kpi-tile .value { font-size: 24px; }
  .table-wrap { display: none; }
  table.data { display: none; }
  .row-card { flex-wrap: wrap; }
  .row-card .left { flex-basis: 100%; }
  .row-card .right { flex-direction: row; flex-wrap: wrap; margin-top: 8px; }
  .btn { height: 44px; }

  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--ink);
    border-top: 1px solid rgba(248,243,237,.12);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
  }
  .tabbar .tab {
    flex: 1;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 2px;
    color: rgba(248,243,237,.6);
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
  }
  .tabbar .tab.active { color: var(--accent); }
}

@media (min-width: 768px) {
  .cards-view { display: none; }
}

.signin{max-width:420px;margin:12vh auto;padding:0 20px}
.signin h1{margin:0 0 8px}.signin p{opacity:.8;margin:0 0 16px}
.signin form{display:flex;flex-direction:column;gap:10px}
.signin input{flex:0 0 auto;display:block;width:100%;height:48px;padding:0 12px;border-radius:10px;border:1px solid var(--line-strong);background:var(--surface);color:inherit;font:inherit}
.signin .btn{width:100%;justify-content:center}
.signin .note{margin-top:12px;font-size:14px}
.signin .note a{color:inherit;opacity:.8}

/* ---------- sign out ---------- */
.signout-link {
  display: block;
  padding: 10px 12px;
  margin-top: 16px;
  border-top: 1px solid rgba(248,243,237,.12);
  color: rgba(248,243,237,.55);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.signout-link:hover { color: var(--cream); }
.tabbar .signout-link { border-top: none; padding: 10px 0 8px; flex: 1; text-align: center; }

/* ---------- client page ---------- */
.back-link { display: inline-block; color: var(--fg-3); font-size: 13px; text-decoration: none; margin-bottom: 12px; cursor: pointer; }
.back-link:hover { color: var(--fg); }
.client-meta { color: var(--fg-2); font-size: 13px; margin: 0 0 24px; }
.inline-note { color: var(--fg-3); font-size: 12px; margin-left: 8px; }
.dot.found{background:#8a8f98}

/* ---------- lead quality pill ---------- */
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  cursor: default;
}
.pill.hot { background: rgba(16,165,176,.16); color: var(--accent-deep); }
.pill.warm { background: rgba(233,180,76,.22); color: var(--amber); }
.pill.cold { background: var(--surface-2); color: var(--fg-3); }
.pill.found { background: rgba(29,95,209,.10); color: var(--blue); }

/* ---------- filter bar ---------- */
.filters { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 8px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-group .flabel {
  font-size: 13px;
  color: var(--fg-3);
  width: 84px;
  flex-shrink: 0;
}
.chip {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--fg-2);
  border-radius: 999px;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip:hover { color: var(--fg); }
.chip.on { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.chip.on .n { color: var(--on-accent); }
.chip .n { font-variant-numeric: tabular-nums; opacity: .55; }
.chip.on .n { opacity: .7; }

@media (max-width: 767px) {
  .filter-group .flabel { width: 100%; }
}


/* ---------- one line, the rest opens when you tap ---------- */
.expando { min-width: 0; }
.expando .row-open {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 4px 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
}
.expando.can-open .row-open { cursor: pointer; }
.expando .row-open .row-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.expando.open .row-open .row-title { white-space: normal; overflow: visible; }
.expando .chev {
  flex: 0 0 auto;
  color: var(--fg-3);
  font-size: 16px;
  line-height: 18px;
  transition: transform .12s ease;
}
.expando.can-open:hover .chev { color: var(--fg); }
.chip.on{color:var(--on-accent)}
.expando.open .chev { transform: rotate(180deg); }
.expando .more-body { display: none; padding: 2px 0 6px; }
.expando.open .more-body { display: block; }
.expando .more-body .row-sub {
  color: var(--fg-2);
  font-size: 13px;
  margin-top: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.expando .peek {
  color: var(--fg-2);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 4px;
}
.expando.open .peek { display: none; }

/* ---------- small tap targets ---------- */
.back-link { min-height: 44px; display: inline-flex; align-items: center; }
.signout-link { min-height: 44px; display: flex; align-items: center; }
@media (max-width: 767px) { .chip { height: 44px; } }

/* A row's buttons, side by side, wrapping on a phone rather than squashing. */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
/* In a table the buttons sit on one line and stay small, so a row is one line tall. */
td .btn-row { margin-top: 0; flex-wrap: nowrap; white-space: nowrap; }
td .btn-row .btn { padding: 6px 10px; font-size: 12.5px; }
table.data td:last-child { width: 1%; }
.btn-row .btn { text-decoration: none; }
/* A phone number or email you can tap. */
.link { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--accent-deep); }
.row-card.wide { flex-direction: column; align-items: stretch; }
.done-note { color: var(--fg-2); font-size: 13px; }

/* ---------- Agents screen ---------- */
/* One card per helper. Reads top to bottom like a note left on the desk. */
.run-card{
  border:1px solid var(--line); border-radius:12px; background:var(--card);
  padding:16px 18px; margin-bottom:12px;
}
.run-top{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px}
.run-name{font-weight:650; font-size:15px}
.run-when{color:var(--fg-2); font-size:13px; margin-left:auto}
.run-out{font-size:19px; font-weight:600; line-height:1.3; margin-bottom:12px}
.run-line{
  display:grid; grid-template-columns:170px 1fr; gap:12px;
  padding:7px 0; border-top:1px solid var(--line); font-size:14px;
}
.run-line .k{color:var(--fg-2)}
.run-line.warn .v{color:var(--amber)}
.run-line.bad .v{color:var(--red); font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:13px}
.run-wants{
  display:grid; grid-template-columns:170px 1fr; gap:12px;
  margin-top:12px; padding:10px 12px; border-radius:6px;
  background:var(--tint, rgba(0,0,0,.035)); font-size:14px;
}
.run-wants .k{color:var(--fg-2)}
.chip{
  font-size:11px; letter-spacing:.06em; text-transform:uppercase; font-weight:700;
  padding:3px 9px; border-radius:99px; border:1px solid var(--line); color:var(--fg-2);
}
.chip.ok{background:rgba(16,165,176,.16); border-color:transparent; color:var(--accent-deep)}
.chip.warn{background:rgba(233,180,76,.22); border-color:transparent; color:var(--amber)}
.chip.bad{background:rgba(180,35,24,.12); border-color:transparent; color:var(--red)}
@media (max-width:640px){
  .run-line, .run-wants{grid-template-columns:1fr; gap:2px}
  .run-line .k, .run-wants .k{font-size:12px}
}

/* ---------- the morning strip ---------- */
/* First thing on Today. One line, and it is either green or it names what broke. */
.strip{
  display:block; padding:12px 16px; border-radius:12px; margin-bottom:18px;
  font-size:15px; font-weight:600; border:1px solid var(--line); background:var(--card);
}
.strip.ok{background:rgba(16,165,176,.14); border-color:transparent; color:var(--accent-deep)}
.strip.bad{background:rgba(180,35,24,.10); border-color:transparent; color:var(--red)}
.strip-sub{display:block; font-weight:400; font-size:13.5px; color:var(--fg-2); margin-top:3px}

/* ---------- the lanes, 12 Sep 2026 ---------- */
/* Same cards as everywhere else: white on cream, one job per card, 44px taps. */
.strip.warn { background: rgba(233,180,76,.22); border-color: transparent; color: var(--amber); }
.btn[hidden] { display: none; }

/* Your 15 messages today */
.dm-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(9, 9, 11,.04);
}
.dm-card .dm-name { font-weight: 600; font-size: 15px; }
.dm-card .dm-why { color: var(--fg-2); font-size: 13px; margin-top: 2px; }
.opener {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}

/* the collapsed line at the bottom of a section */
.done-today {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 0 16px;
  margin: 8px 0 4px;
}
.done-today > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  list-style-position: inside;
}
.done-today[open] > summary { border-bottom: 1px solid var(--line); }
.done-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.done-row:last-child { border-bottom: none; }
.done-row .done-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.done-row .done-what { color: var(--fg-2); flex-shrink: 0; }

/* Answer - one card per reply */
.reply-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(9, 9, 11,.04);
}
.reply-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.reply-top .reply-name { font-weight: 650; font-size: 15px; }
.reply-top .reply-to { color: var(--fg-2); font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.clock {
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.clock.ok { background: rgba(16,165,176,.16); color: var(--accent-deep); }
.clock.over { background: rgba(180,35,24,.12); color: var(--red); }
.quote {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 10px 10px 0;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sent-detail { margin-top: 10px; }
.sent-detail > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  list-style-position: inside;
}
.sent-subject { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.sent-text {
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding-bottom: 6px;
}
.reply-link { margin-top: 8px; font-size: 13px; }
textarea.reply-draft {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
}
textarea.reply-draft:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Leads - the two small pills and the line saying where they came from */
.pill.started { background: rgba(29,95,209,.10); color: var(--blue); }
.pill.quick { background: rgba(16,165,176,.16); color: var(--accent-deep); }
.pill.slow { background: rgba(180,35,24,.12); color: var(--red); }
.dot.started { background: var(--blue); }
.source-detail { color: var(--fg-3); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }

/* Partners - add one */
.client-actions { margin: -12px 0 20px; }
.client-actions:empty { margin: 0; }
.add-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 16px;
  margin-top: 12px;
}
.add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.add-form .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.add-form label { font-size: 13px; color: var(--fg-2); }
.add-form input, .add-form select {
  height: 44px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  padding: 0 10px;
  font-size: 14px;
}

/* A tall card (a lead, a partner) stacks - it must never wrap into a second
   column, or the line sizes itself to the longest sentence and the card spills
   off the side of a phone. */
.row-card.wide { flex-wrap: nowrap; }
.reply-link .btn { text-decoration: none; }

/* A collapsed line says it can be opened, the same way a row title does. */
.done-today > summary, .sent-detail > summary { justify-content: space-between; list-style: none; }
.done-today > summary::-webkit-details-marker, .sent-detail > summary::-webkit-details-marker { display: none; }
.done-today > summary::after, .sent-detail > summary::after {
  content: "\25BE";
  color: var(--fg-3);
  font-size: 16px;
  line-height: 18px;
  transition: transform .12s ease;
}
.done-today[open] > summary::after, .sent-detail[open] > summary::after { transform: rotate(180deg); }
