/* Dran's Heating & A/C — Lead Desk
   Palette sampled from the company logo: the four elemental quadrants
   (sun, snowflake, leaf, water) plus the wordmark's sky blue. */

:root {
  --sky: #6dc6f2;
  --sky-deep: #2f9fd6;
  --sky-wash: #e8f6fd;
  --teal: #047780;
  --teal-deep: #03323a;
  --teal-mid: #065c66;
  --leaf: #7fb52c;
  --leaf-wash: #eef7e0;
  --sun: #f2852b;
  --sun-wash: #fdefe1;
  --ember: #c0272d;
  --ember-wash: #fbe9e9;

  --paper: #eef4f7;
  --card: #ffffff;
  --ink: #0f2229;
  --muted: #5c7681;
  --faint: #8ba3ad;
  --line: #d9e6ec;
  --line-soft: #eaf1f5;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 34, 41, .06), 0 8px 24px -16px rgba(15, 34, 41, .3);

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; margin: 0; }

a { color: var(--teal); }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--sky-deep); outline-offset: 2px; border-radius: 3px; }

.wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  background: var(--teal-deep);
  color: #eaf5f8;
  border-bottom: 3px solid var(--sky);
}

.masthead-inner {
  display: flex; align-items: center; gap: 20px;
  padding: 16px 0; flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 13px; margin-right: auto; }

.brand-mark { width: 38px; height: 38px; flex: none; }

.brand-name {
  font-family: var(--display); font-weight: 800; font-size: 17px;
  letter-spacing: -.02em; line-height: 1.1;
}

.brand-sub {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--sky); font-weight: 600;
}

.masthead-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.stamp {
  font-family: var(--mono); font-size: 11.5px; color: #9fc4cd;
  display: flex; align-items: center; gap: 7px;
}

.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--leaf);
  box-shadow: 0 0 0 3px rgba(127, 181, 44, .22);
}

.pulse[data-source="snapshot"] { background: var(--sun); box-shadow: 0 0 0 3px rgba(242, 133, 43, .22); }

.ghost-btn {
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .2);
  color: #eaf5f8; border-radius: var(--radius-sm); padding: 7px 13px;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s;
}

.ghost-btn:hover { background: rgba(255, 255, 255, .16); }

.ghost-btn[disabled] { opacity: .5; cursor: default; }

/* -------------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 4px; margin: 28px 0 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

.tab {
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 9px 15px; cursor: pointer; font-weight: 600; font-size: 14.5px;
  color: var(--muted); margin-bottom: -1px;
}

.tab[aria-selected="true"] { color: var(--teal-deep); border-bottom-color: var(--sky); }

.panel { padding: 20px 0 60px; }

.panel[hidden] { display: none; }

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

.filters {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 13px; margin-bottom: 14px;
}

.filters input[type="search"], .filters select {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 7px 10px; background: #fff; font-size: 14px;
}

.filters input[type="search"] { flex: 1 1 210px; min-width: 0; }

.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--muted); font-weight: 500;
}

.chip[aria-pressed="true"] { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }

.result-count { margin-left: auto; font-size: 13px; color: var(--muted); font-family: var(--mono); }

/* ------------------------------------------------------------------- leads */

.lead-list { display: flex; flex-direction: column; gap: 7px; }

.lead {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}

.lead[open] { border-color: var(--sky-deep); box-shadow: var(--shadow); }

.lead-row {
  display: grid; align-items: center; gap: 14px; padding: 12px 15px; cursor: pointer;
  grid-template-columns: minmax(160px, 1.5fr) minmax(96px, .8fr) minmax(130px, 1.1fr) minmax(150px, 1fr) 92px 18px;
  list-style: none;
}

.lead-row::-webkit-details-marker { display: none; }

.lead-row:hover { background: var(--sky-wash); }

.lead-name { font-weight: 600; }

.lead-flag {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--sun); margin-left: 6px; vertical-align: middle;
}

.lead-sub { font-size: 12px; color: var(--faint); font-family: var(--mono); }

.cell-muted { font-size: 13.5px; color: var(--muted); }

.lead-when { font-size: 12.5px; color: var(--faint); font-family: var(--mono); text-align: right; }

.chevron { color: var(--faint); transition: transform .15s; }

.lead[open] .chevron { transform: rotate(90deg); }

.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; background: var(--line-soft); color: var(--muted); white-space: nowrap;
}

.pill.good { background: var(--leaf-wash); color: #4c7212; }
.pill.warn { background: var(--sun-wash); color: #a55208; }
.pill.bad { background: var(--ember-wash); color: var(--ember); }
.pill.info { background: var(--sky-wash); color: #14647f; }

.pill-src {
  font-family: var(--mono); font-size: 10px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--faint); margin-left: 6px;
}

/* ------------------------------------------------------------------ detail */

.detail { border-top: 1px solid var(--line-soft); padding: 4px 15px 16px; }

.detail-grid { display: grid; gap: 18px; grid-template-columns: 1fr 380px; align-items: start; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2px 22px; margin: 12px 0 4px; }

.fact dt {
  font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--faint); font-weight: 600;
}

.fact dd { margin: 0 0 10px; font-size: 14px; overflow-wrap: anywhere; }

.block { margin-top: 16px; }

.block h4 {
  font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 7px;
}

.quote {
  background: var(--paper); border-left: 3px solid var(--sky); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 11px 14px; font-size: 13.5px; white-space: pre-wrap;
  max-height: 260px; overflow-y: auto; line-height: 1.6;
}

.quote.plain { border-left-color: var(--line); }

audio { width: 100%; margin-top: 7px; height: 36px; }

.audio-note { font-size: 12px; color: var(--faint); margin-top: 5px; }

/* ------------------------------------------------------------------- notes */

.notebox {
  background: var(--sky-wash); border: 1px solid #c6e6f6; border-radius: var(--radius); padding: 15px;
}

.notebox h4 { font-family: var(--display); font-size: 15px; letter-spacing: -.01em; text-transform: none; color: var(--teal-deep); margin-bottom: 3px; }

.notebox p.hint { font-size: 12.5px; color: var(--muted); margin: 0 0 11px; }

.field { display: block; margin-bottom: 10px; }

.field span {
  display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 4px;
}

.field select, .field input, .field textarea {
  width: 100%; border: 1px solid #b9dced; border-radius: var(--radius-sm);
  padding: 8px 10px; background: #fff; font-size: 14px;
}

.field textarea { min-height: 76px; resize: vertical; }

::placeholder { color: var(--faint); opacity: 1; }

.btn {
  background: var(--teal); color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: 9px 17px; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s;
}

.btn:hover { background: var(--teal-mid); }

.btn[disabled] { background: var(--faint); cursor: default; }

.note-status { font-size: 12.5px; margin-left: 10px; }

.note-status.ok { color: #4c7212; }

.note-status.err { color: var(--ember); }

.note-log { margin-top: 13px; display: flex; flex-direction: column; gap: 8px; }

.note-item { background: #fff; border: 1px solid #cfe7f4; border-radius: var(--radius-sm); padding: 9px 11px; font-size: 13.5px; }

.note-meta { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-bottom: 3px; }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .lead-row { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 13px 14px; }
  .lead-row .cell-city, .lead-row .cell-service { display: none; }
  .lead-when { text-align: left; grid-column: 1; }
  .chevron { grid-row: 1 / span 2; align-self: center; }
  .t-line { grid-template-columns: 1fr; gap: 1px; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }

}

/* ------------------------------------------------------------- active set */

.active-set {
  flex-basis: 100%; font-size: 12.5px; color: var(--teal);
  font-weight: 500; margin-top: 2px;
}

.provenance {
  margin-top: 14px; font-size: 11.5px; color: var(--faint);
  border-top: 1px solid var(--line-soft); padding-top: 9px;
}

/* ------------------------------------------------------------ call history */

.call {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; margin-bottom: 9px; background: #fff;
}

.call-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }

.call-when { font-family: var(--mono); font-size: 12px; color: var(--teal); }

.call-meta { font-size: 12px; color: var(--faint); }

.call-outcome { font-size: 13.5px; font-weight: 500; margin-bottom: 5px; }

.call-transcript summary {
  cursor: pointer; font-size: 12.5px; color: var(--teal); font-weight: 500; margin: 7px 0 4px;
}

.players { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 9px; }

.player-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; }

.player audio { margin-top: 4px; }

.reviewed {
  margin-top: 15px; background: var(--sky-wash); border-left: 3px solid var(--sky-deep);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 10px 13px; font-size: 13px;
  color: #17505f;
}

.reviewed strong { display: block; margin-bottom: 2px; color: var(--teal-deep); }

/* ---------------------------------------------------- missed opportunities */

.missed-intro {
  background: var(--ember-wash); border: 1px solid #f0cfcf; border-left: 4px solid var(--ember);
  border-radius: var(--radius); padding: 14px 17px; margin-bottom: 20px;
}

.missed-intro p { margin: 0; font-size: 14.5px; }

.group-head {
  font-family: var(--display); font-size: 15px; margin: 26px 0 2px;
  display: flex; align-items: baseline; gap: 9px; color: var(--teal-deep);
}

.group-head:first-child { margin-top: 0; }

.group-head span {
  font-size: 12px; font-weight: 700; background: var(--teal); color: #fff;
  border-radius: 999px; padding: 1px 9px;
}

.group-note { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }







/* ------------------------------------------------------------------ checks */










