/* Plain and legible, in the same register as the CLI report. This screen is
   read once a day, quickly, before coffee has fully landed. Nothing decorative. */

:root {
  --bg: #fbfaf8;
  --panel: #ffffff;
  --ink: #16150f;
  --muted: #6d6a5f;
  --line: #dedbd2;
  --accent: #1b5e3f;
  --warn: #8a5a00;
  --danger: #97231b;
  --ok: #1b5e3f;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14150f;
    --panel: #1c1e17;
    --ink: #ecebe3;
    --muted: #9b978a;
    --line: #33362b;
    --accent: #7fd0a3;
    --warn: #e0ac52;
    --danger: #e98a80;
    --ok: #7fd0a3;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* ---- login ------------------------------------------------------------- */

.login { max-width: 22rem; margin: 12vh auto; padding: 0 1.5rem; }
.login h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.01em; }
.login .sub { margin: 0.1rem 0 2rem; color: var(--muted); font-family: var(--mono); font-size: 0.85rem; }
.login label { display: block; margin-bottom: 0.9rem; font-size: 0.8rem; color: var(--muted); }
.login input {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.55rem 0.65rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--ink); font: inherit;
}
.login button {
  width: 100%; padding: 0.6rem; border: 0; border-radius: 6px;
  background: var(--accent); color: var(--bg); font: inherit; font-weight: 600; cursor: pointer;
}
.fineprint { margin-top: 1.6rem; color: var(--muted); font-size: 0.76rem; line-height: 1.5; }

/* ---- chrome ------------------------------------------------------------ */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line);
  background: var(--panel); position: sticky; top: 0; z-index: 5;
}
.topbar-right { display: flex; align-items: center; gap: 0.6rem; }
.muted { color: var(--muted); font-size: 0.82rem; }

button.ghost {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 6px; padding: 0.3rem 0.6rem; font: inherit; font-size: 0.82rem; cursor: pointer;
}
button.ghost:hover { border-color: var(--muted); }

.cols { display: grid; grid-template-columns: 20rem 1fr; min-height: calc(100vh - 3.1rem); }
@media (max-width: 60rem) { .cols { grid-template-columns: 1fr; } }

/* ---- queue ------------------------------------------------------------- */

.queue { border-right: 1px solid var(--line); background: var(--panel); }
.qrow {
  display: block; width: 100%; text-align: left; padding: 0.7rem 0.9rem;
  border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent;
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.qrow:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.qrow[aria-current="true"] { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.qrow .name { font-weight: 600; }
.qrow .meta { color: var(--muted); font-size: 0.78rem; font-family: var(--mono); margin-top: 0.15rem; }

.grade { font-family: var(--mono); font-weight: 700; font-size: 0.78rem; padding: 0.05rem 0.3rem; border-radius: 4px; }
.grade-A { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.grade-B { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }

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

.detail { padding: 1.2rem 1.4rem 5rem; max-width: 60rem; }
.empty { color: var(--muted); }
.detail h2 { margin: 0 0 0.15rem; font-size: 1.3rem; }
.detail h3 {
  margin: 2rem 0 0.6rem; font-size: 0.76rem; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--muted); font-family: var(--mono);
}
.factline { color: var(--muted); font-size: 0.85rem; font-family: var(--mono); }
.factline a { color: var(--accent); }

.card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 0.8rem 0.95rem; }

.banner { border-radius: 8px; padding: 0.65rem 0.85rem; margin: 0.9rem 0; font-size: 0.87rem; }
.banner-warn { background: color-mix(in srgb, var(--warn) 15%, transparent); border: 1px solid var(--warn); }
.banner-danger { background: color-mix(in srgb, var(--danger) 13%, transparent); border: 1px solid var(--danger); }
.banner-info { background: color-mix(in srgb, var(--accent) 11%, transparent); border: 1px solid var(--accent); }

/* score breakdown, monospace so the columns line up like the CLI's */
.rules { font-family: var(--mono); font-size: 0.82rem; }
.rules div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.1rem 0; }
.rules .pos { color: var(--ok); }
.rules .neg { color: var(--danger); }
.rules .total { border-top: 1px solid var(--line); margin-top: 0.35rem; padding-top: 0.35rem; font-weight: 700; }

/* the gate checklist */
.checks { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }
.checks li { padding: 0.16rem 0; display: flex; gap: 0.5rem; align-items: baseline; }
.checks .mark { font-family: var(--mono); font-weight: 700; width: 1.1rem; flex: none; }
.checks .yes .mark { color: var(--ok); }
.checks .no .mark { color: var(--danger); }
.checks .no { color: var(--muted); }

.preview-bar { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
iframe.preview {
  width: 100%; height: 30rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff;
}
iframe.preview.mobile { width: 24rem; max-width: 100%; height: 34rem; }

textarea, input.text {
  width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 0.9rem; resize: vertical;
}
textarea.opener { min-height: 6rem; font-family: var(--mono); font-size: 0.85rem; }
textarea.email { min-height: 16rem; font-family: var(--mono); font-size: 0.82rem; }

ul.plain { margin: 0.3rem 0 0; padding-left: 1.1rem; font-size: 0.88rem; }
ul.plain li { margin: 0.2rem 0; }

.actions {
  position: sticky; bottom: 0; margin-top: 2rem; padding: 0.8rem 0;
  background: linear-gradient(to top, var(--bg) 72%, transparent);
  display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
}
button.primary {
  border: 0; border-radius: 6px; padding: 0.55rem 1rem; font: inherit; font-weight: 600;
  background: var(--accent); color: var(--bg); cursor: pointer;
}
button.primary:disabled { opacity: 0.4; cursor: not-allowed; }
button.danger {
  border: 1px solid var(--danger); background: transparent; color: var(--danger);
  border-radius: 6px; padding: 0.5rem 0.8rem; font: inherit; cursor: pointer;
}
button.small { font-size: 0.82rem; padding: 0.35rem 0.7rem; }

.error { color: var(--danger); font-size: 0.85rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.3rem; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 8px;
  font-size: 0.88rem; max-width: 44rem; z-index: 50; white-space: pre-wrap;
}
.toast.bad { background: var(--danger); color: #fff; }

/* ---- rep worklist -------------------------------------------------------
   Phone-first: this is read standing next to a truck, about to dial. Big tap
   targets, the call opener as the largest text on the page. */

body.rep { max-width: 46rem; margin: 0 auto; }

.rep-list { padding: 0.4rem 0 4rem; }
.rep-row {
  display: flex; align-items: center; gap: 0.8rem; width: 100%; text-align: left;
  padding: 0.95rem 1rem; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.rep-row:active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rep-row-main { flex: 1; min-width: 0; }
.rep-row .name { font-weight: 600; font-size: 1.02rem; }
.rep-row .meta { color: var(--muted); font-size: 0.84rem; font-family: var(--mono); margin-top: 0.1rem; }
.rep-row-state { color: var(--muted); font-size: 0.8rem; font-family: var(--mono); flex: none; }
.rep-row.done { opacity: 0.55; }
.rep-row.done .rep-row-state { color: var(--ok); }

.rep-empty { padding: 2rem 1.2rem; }
.rep-call { padding: 0.8rem 1.1rem 5rem; }
.rep-call h2 { margin: 0.6rem 0 0.2rem; font-size: 1.45rem; }
button.back { margin-bottom: 0.4rem; }

/* The only thing on this screen that must be hit correctly while holding a
   phone in the other hand. */
a.calltap {
  display: block; margin: 1rem 0 0.2rem; padding: 1rem; border-radius: 10px;
  background: var(--accent); color: var(--bg); text-align: center;
  font-size: 1.15rem; font-weight: 700; text-decoration: none;
  font-family: var(--mono); letter-spacing: 0.01em;
}
a.calltap:active { filter: brightness(0.92); }

.opener-card {
  border: 1px solid var(--accent); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 0.9rem 1rem; background: var(--panel);
  font-size: 1.08rem; line-height: 1.6; white-space: pre-wrap;
}

ul.plain.big, ol.plain.big { font-size: 1rem; line-height: 1.5; }
ol.plain.big li { margin: 0.45rem 0; }

.objections details {
  border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.7rem;
  margin-bottom: 0.4rem; background: var(--panel);
}
.objections summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; text-transform: capitalize; }
.objections p { margin: 0.5rem 0 0.2rem; font-size: 0.92rem; }

.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.7rem; }
button.outcome {
  padding: 0.75rem 0.6rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); font: inherit; font-size: 0.92rem; cursor: pointer;
}
button.outcome.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); font-weight: 700; }

textarea.note { min-height: 4.5rem; margin-bottom: 0.7rem; }
button.wide { width: 100%; padding: 0.85rem; font-size: 1rem; margin-bottom: 0.9rem; }
.muted.small { font-size: 0.76rem; }
.attrib { margin-top: 1.6rem; padding-top: 0.7rem; border-top: 1px solid var(--line); }

/* Full-width concept review. Replaces an "open in a new tab" link that was
   implemented with a blob: URL — blobs inherit the creating origin, so it handed
   LLM-authored markup a same-origin document and undid the iframe sandbox. */
iframe.preview.wide { height: 46rem; }
