/* LRCP Ops Dashboard.

   Brand read from littleriverinvest.com on 2026-09-10, from the published
   Webflow variables and the computed styles of the live page:
     navy #002944, blue #295486, light blue #4472c4, orange #f48327,
     sand #dfd7cc, almond #f2f2e8, hairline #c2c2c2, Inter throughout,
     system pairs success #cef5ca/#114e0b, warning #fcf8d8/#5e5515,
     error #f8e4e4/#3b0b0b.
   Two habits of the site are carried over deliberately: large headings are set
   in Inter 400, not bold, and orange appears only as a small uppercase eyebrow
   label. Everything else is navy on almond.

   Surface: dense internal product UI for three people (Garrett, John, Kyle).
   13.5px body, tight rows, one accent, two elevation levels, no decoration. */

/* ============================================================ tokens ===== */

:root {
  color-scheme: light dark;

  /* brand */
  --navy: #002944;
  --navy-lift: #0b3a5b;
  --blue: #295486;
  --blue-light: #4472c4;
  --orange: #f48327;
  --sand: #dfd7cc;
  --almond: #f2f2e8;
  --hairline: #c2c2c2;

  /* surfaces */
  --bg: var(--almond);
  --surface: #ffffff;
  --surface-2: #ecebdf;        /* inset fills: code, agent bubbles, rails */
  --surface-3: #f7f6ef;        /* row hover, quiet stripes */
  --chrome: var(--navy);       /* app bar, both themes */
  --chrome-ink: var(--almond);
  --chrome-ink-dim: #9db3c4;
  --chrome-line: #14405e;

  /* ink */
  --text: var(--navy);
  --text-muted: #4a6072;
  --text-faint: #6c8194;

  /* lines */
  --border: var(--sand);
  --border-strong: var(--hairline);

  /* action */
  --primary: var(--navy);
  --primary-ink: var(--almond);
  --primary-hover: #063f66;
  --accent: var(--orange);
  --accent-ink: var(--navy);
  --link: var(--blue);
  --focus: var(--blue-light);

  /* semantic, derived from the site's own system pairs */
  --ok-bg: #dcefd6;      --ok-ink: #17501a;
  --warn-bg: #f7f0cf;    --warn-ink: #5e5515;
  --bad-bg: #f6e2e2;     --bad-ink: #7a1f1f;
  --info-bg: #e2e9f7;    --info-ink: #23417a;
  --neutral-bg: #e6e4d7; --neutral-ink: #4b5763;

  /* type */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             Helvetica, Arial, sans-serif;
  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs-base: 13.5px;
  --fs-md: 15px;
  --fs-xl: 30px;

  /* geometry */
  --radius: 8px;                /* the site's button radius */
  --radius-sm: 5px;
  --radius-lg: 12px;
  --gutter: 24px;

  /* motion */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* elevation: resting is a hairline, floating is one soft shadow */
  --shadow-float: 0 1px 2px rgba(0, 41, 68, 0.05),
                  0 6px 16px rgba(0, 41, 68, 0.09),
                  0 18px 36px rgba(0, 41, 68, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #011f34;
    --surface: #052f4c;
    --surface-2: #0a3d61;
    --surface-3: #073859;
    --chrome: #001a2c;
    --chrome-line: #0d3552;

    --text: var(--almond);
    --text-muted: #b4c5d3;
    --text-faint: #8ba0b2;

    --border: #12456a;
    --border-strong: #1e5c85;

    --primary: var(--almond);
    --primary-ink: var(--navy);
    --primary-hover: #ffffff;
    --link: #8fb2e4;
    --focus: #8fb2e4;

    --ok-bg: #103d24;      --ok-ink: #b3ddb8;
    --warn-bg: #4a3d15;    --warn-ink: #ecd98f;
    --bad-bg: #4c1f1f;     --bad-ink: #eeb0aa;
    --info-bg: #17325c;    --info-ink: #b6cbef;
    --neutral-bg: #0f3d5d; --neutral-ink: #bfcdd8;

    --shadow-float: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 26px rgba(0, 0, 0, 0.4);
  }
}

/* ============================================================== base ===== */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.55;
  font-feature-settings: "cv05" 1;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

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

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius-sm); z-index: 40;
}
.skip:focus { left: 16px; }

/* ============================================================= chrome ==== */

header.top {
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-line);
  position: sticky; top: 0; z-index: 20;
}
.topin {
  max-width: 1240px; margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 4px;
  min-height: 54px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: baseline; gap: 10px;
  color: var(--chrome-ink); margin-right: 20px; padding: 8px 0;
}
.brand:hover { text-decoration: none; }
.brand img { height: 22px; width: auto; display: block; align-self: center; }
.brand .sub {
  font-size: var(--fs-xs); letter-spacing: 0.26em; text-transform: uppercase;
  font-weight: 500; color: var(--chrome-ink-dim);
}
nav.main { display: flex; gap: 2px; flex-wrap: wrap; }
nav.main a {
  position: relative;
  color: var(--chrome-ink-dim);
  padding: 17px 12px 16px;
  font-weight: 500; font-size: var(--fs-base);
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-out);
}
nav.main a:hover { color: var(--chrome-ink); text-decoration: none; }
nav.main a.active { color: var(--chrome-ink); border-bottom-color: var(--accent); }
nav.main .pip {
  display: inline-block; min-width: 16px; text-align: center;
  background: var(--accent); color: var(--navy);
  border-radius: 999px; font-size: 10px; font-weight: 600;
  padding: 1px 5px; margin-left: 6px; vertical-align: 1px;
  font-variant-numeric: tabular-nums;
}
/* area sub-navigation: one quiet band under the app bar */
.subbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.subin {
  max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; gap: 0; flex-wrap: wrap;
}
.subin a {
  padding: 10px 13px 9px; color: var(--text-muted);
  font-weight: 500; font-size: var(--fs-base);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease-out);
}
.subin a:hover { color: var(--text); text-decoration: none; }
.subin a.active { color: var(--text); border-bottom-color: var(--accent); }
.subin .pip {
  display: inline-block; min-width: 16px; text-align: center;
  background: var(--accent); color: var(--navy);
  border-radius: 999px; font-size: 10px; font-weight: 600;
  padding: 1px 5px; margin-left: 6px; vertical-align: 1px;
  font-variant-numeric: tabular-nums;
}
.spacer { flex: 1 1 auto; }
.userpick {
  display: flex; align-items: center; gap: 10px;
  color: var(--chrome-ink-dim); font-size: var(--fs-sm); white-space: nowrap;
}
.userpick .who { color: var(--chrome-ink); font-weight: 500; }
.userpick .btn-quiet,
.userpick button {
  background: transparent; color: var(--chrome-ink-dim);
  border: 1px solid var(--chrome-line); padding: 4px 10px;
  font-size: var(--fs-sm);
}
.userpick button:hover { color: var(--chrome-ink); border-color: var(--chrome-ink-dim); opacity: 1; }

.shell { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter) 72px; }

/* ========================================================== headings ===== */

h1 {
  font-size: var(--fs-xl); font-weight: 400; letter-spacing: -0.015em;
  line-height: 1.12; margin: 0 0 6px;
}
h2 {
  font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.005em;
  line-height: 1.3; margin: 0 0 12px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
h2 .cmeta { font-weight: 400; }

.eyebrow {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 8px;
}

.pagehead { margin: 28px 0 20px; }
.pagehead .meta {
  color: var(--text-muted); font-size: var(--fs-sm);
  max-width: 74ch; margin: 8px 0 0;
}
.pagehead .meta a { color: var(--link); }
.pagehead + .tabs { margin-top: -4px; }

/* ====================================================== tabs & chips ===== */

.tabs {
  display: flex; gap: 0; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.tabs a {
  padding: 9px 13px 10px; color: var(--text-muted);
  font-weight: 500; font-size: var(--fs-base);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease-out);
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .n {
  color: var(--text-faint); font-variant-numeric: tabular-nums;
  margin-left: 6px; font-size: var(--fs-sm);
}
.tabs a.active .n { color: var(--text-muted); }

.chips { display: flex; gap: 6px; margin: 0 0 18px; flex-wrap: wrap; align-items: center; }
.chips .cmeta {
  align-self: center; text-transform: uppercase; letter-spacing: 0.12em;
  font-size: var(--fs-xs); font-weight: 500; color: var(--text-faint);
}
.chip {
  font-size: var(--fs-sm); font-weight: 500; padding: 3px 11px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--text-muted); background: transparent;
  transition: color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.chip:hover { text-decoration: none; border-color: var(--text-faint); color: var(--text); }
.chip.active {
  background: var(--primary); color: var(--primary-ink);
  border-color: var(--primary);
}

/* ============================================================ tables ===== */

.tablewrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow-x: auto;
}
table.leads { width: 100%; border-collapse: collapse; min-width: 880px; }
.card table.leads, .prose table { min-width: 0; }
table.leads th {
  text-align: left; font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint);
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--surface);
}
table.leads td {
  padding: 11px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.leads tbody tr:last-child td { border-bottom: 0; }
table.leads tr.row { cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
table.leads tr.row:hover td { background: var(--surface-3); }
table.leads tr.row:focus-within td { background: var(--surface-3); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.principal { max-width: 260px; }
td.principal .pname {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
td.principal .cmeta { display: block; }
.co { font-weight: 500; }
.co a { color: inherit; }
.co a:hover { color: var(--link); }
.co .where {
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: 400;
  margin-top: 1px;
}
table.leads .rank {
  color: var(--text-faint); font-variant-numeric: tabular-nums;
  width: 42px; padding-left: 16px;
}
.card table.leads th:first-child, .card table.leads td:first-child { padding-left: 0; }
.card table.leads th:last-child, .card table.leads td:last-child { padding-right: 0; }

/* ============================================================ badges ===== */

.badge {
  display: inline-block; font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: 0.02em; padding: 2px 8px; border-radius: 999px;
  white-space: nowrap; vertical-align: baseline;
}
.b-ok { background: var(--ok-bg); color: var(--ok-ink); }
.b-warn { background: var(--warn-bg); color: var(--warn-ink); }
.b-bad { background: var(--bad-bg); color: var(--bad-ink); }
.b-neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
.b-outline { border: 1px solid var(--border-strong); color: var(--text-muted); padding: 1px 7px; }

.b-status { background: var(--neutral-bg); color: var(--neutral-ink); }
.b-status.s-READY { background: var(--ok-bg); color: var(--ok-ink); }
.b-status.s-REVIEW { background: var(--warn-bg); color: var(--warn-ink); }
.b-status.s-IN_CONVERSATION,
.b-status.s-MEETING { background: var(--accent); color: var(--accent-ink); }
.b-status.s-CONTACTED { background: var(--info-bg); color: var(--info-ink); }
.b-status.s-DNC,
.b-status.s-DEAD,
.b-status.s-HOLD {
  background: transparent; color: var(--text-faint);
  border: 1px solid var(--border-strong); padding: 1px 7px;
}

/* fit bands: two independent reads, so they must be scannable side by side */
.f-strong { background: var(--ok-bg); color: var(--ok-ink); }
.f-possible { background: var(--warn-bg); color: var(--warn-ink); }
.f-conflict { background: var(--bad-bg); color: var(--bad-ink); }
.f-constraint_review { background: var(--info-bg); color: var(--info-ink); }
.f-insufficient {
  background: transparent; color: var(--text-faint);
  border: 1px solid var(--border); padding: 1px 7px;
}
.badge.f-strong, .badge.f-possible, .badge.f-conflict,
.badge.f-constraint_review, .badge.f-insufficient {
  display: inline-block; font-size: var(--fs-xs); font-weight: 600;
  border-radius: 999px; white-space: nowrap;
}

/* ================================================== cards and layout ===== */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
}
.card > :last-child { margin-bottom: 0; }
.card.tight { padding: 14px 16px; }

/* the agent's own writing: quieter ground, orange rule, never a card */
.brief {
  border-left: 3px solid var(--accent);
  background: var(--surface); border: 1px solid var(--border); border-left-width: 3px;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 20px; margin: 0 0 12px;
}
.brief > div, .brief > p:not(.eyebrow) { max-width: 92ch; }
.brief .eyebrow { color: var(--accent); margin-bottom: 4px; }
.brief.warn { border-left-color: var(--warn-ink); }
.brief.warn .eyebrow { color: var(--warn-ink); }
.brief.memo { border-left-color: var(--blue); }
.brief.memo .eyebrow { color: var(--blue); }
.briefs { margin: 18px 0 20px; }

/* an alert is not a card: it is a tinted panel that must interrupt */
.alert {
  border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px;
  font-size: var(--fs-sm);
}
.alert.bad { background: var(--bad-bg); color: var(--bad-ink); }
.alert.bad a { color: inherit; text-decoration: underline; }
.alert .alerthead { font-weight: 600; margin: 0 0 6px; }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert.ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert.info { background: var(--info-bg); color: var(--info-ink); }
.alert ul { margin: 0; padding-left: 18px; }
.alert li + li { margin-top: 3px; }

/* Clear Street: file names are identifiers, so they read as code */
.fname { font: var(--fs-sm)/1.45 ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; }
.nowrap { white-space: nowrap; }
.filepick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filepick input[type="file"] { font-size: var(--fs-sm); color: var(--text-muted); }
.datepick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.datepick select { width: auto; }


.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--gutter); align-items: start; }
.cols > * { min-width: 0; }
@media (max-width: 1000px) { .cols { grid-template-columns: minmax(0, 1fr); } }

.rail .card { padding: 14px 16px; }
.rail h2 { font-size: var(--fs-base); margin-bottom: 8px; }

/* ============================================================= facts ===== */

.facts {
  display: grid; grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px 18px; font-size: var(--fs-base); margin: 0;
}
.facts dt {
  color: var(--text-faint); font-size: var(--fs-sm);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
  padding-top: 1px;
}
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* the two fits, side by side, because they are read against each other */
.fitgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 14px; }
@media (max-width: 560px) { .fitgrid { grid-template-columns: 1fr; } }
.fitcell {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.fitcell .k {
  display: block; font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-faint); font-weight: 600;
  margin-bottom: 6px;
}
.fitcell .why {
  color: var(--text-muted); font-size: var(--fs-sm); margin-top: 6px;
  white-space: pre-wrap;
}

pre.evidence {
  font: 12px/1.55 ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere;
  margin: 8px 0 0; color: var(--text);
}

/* ================================================== lists of records ===== */

ul.contacts { list-style: none; margin: 0; padding: 0; }
ul.contacts li { padding: 12px 0; border-bottom: 1px solid var(--border); }
ul.contacts li:first-child { padding-top: 0; }
ul.contacts li:last-child { border-bottom: 0; padding-bottom: 0; }
.cv { font-weight: 500; font-size: var(--fs-base); overflow-wrap: anywhere; }
.cmeta { color: var(--text-muted); font-size: var(--fs-sm); }
.cmeta a { color: var(--link); }
.rkind {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 600; color: var(--text-faint);
}
.rflags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 5px; }

ul.blockers { margin: 6px 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
ul.blockers li { padding: 3px 0; display: flex; gap: 8px; align-items: baseline; }
ul.blockers .badge { flex: none; }

/* ============================================================= forms ===== */

label.lbl {
  display: block; font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint);
  margin: 14px 0 5px;
}
label.lbl:first-child, form > label.lbl:first-of-type { margin-top: 0; }
label.lbl .hint {
  text-transform: none; letter-spacing: 0; font-weight: 400;
  color: var(--text-muted); font-size: var(--fs-sm);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

select, textarea,
input[type="text"], input[type="email"], input[type="password"], input[type="date"] {
  width: 100%; font: inherit; font-size: var(--fs-base); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 10px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
select:hover, textarea:hover,
input[type="text"]:hover, input[type="email"]:hover,
input[type="password"]:hover, input[type="date"]:hover { border-color: var(--text-faint); }
select { appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 14px center, right 9px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
textarea { min-height: 68px; resize: vertical; line-height: 1.5; }
::placeholder { color: var(--text-faint); opacity: 1; }

button, .btn {
  font: inherit; font-weight: 600; font-size: var(--fs-base); cursor: pointer;
  background: var(--primary); color: var(--primary-ink);
  border: 1px solid var(--primary); border-radius: var(--radius);
  padding: 7px 16px; line-height: 1.4; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
button:hover, .btn:hover {
  background: var(--primary-hover); border-color: var(--primary-hover);
  text-decoration: none; color: var(--primary-ink);
}
.btn-quiet {
  background: transparent; color: var(--text-muted); border-color: var(--border-strong);
}
.btn-quiet:hover {
  background: var(--surface-3); border-color: var(--text-faint); color: var(--text);
}
.btn-danger { background: var(--bad-ink); border-color: var(--bad-ink); color: #fff; }
.btn-danger:hover { background: #5f1414; border-color: #5f1414; color: #fff; }
button[disabled], .btn[disabled] { opacity: 0.4; cursor: not-allowed; }
button[disabled]:hover { background: var(--primary); border-color: var(--primary); }

.btnrow { display: flex; gap: 8px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.btnrow.inline { margin-top: 0; }
.fieldrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.fieldrow input[type="text"] { flex: 1 1 160px; width: auto; }
.fieldrow select { flex: 0 1 auto; width: auto; }
.formnote {
  color: var(--text-muted); font-size: var(--fs-sm); margin: 10px 0 0;
  max-width: 68ch;
}

/* ================================================ activity & comments ==== */

ul.timeline { list-style: none; margin: 0; padding: 0; }
ul.timeline li {
  display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr);
  gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}
ul.timeline li:first-child { padding-top: 0; }
ul.timeline li:last-child { border-bottom: 0; padding-bottom: 0; }
ul.timeline .t {
  color: var(--text-faint); font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs); padding-top: 2px; line-height: 1.5;
}
ul.timeline .who { font-weight: 600; }
@media (max-width: 560px) { ul.timeline li { grid-template-columns: 1fr; gap: 2px; } }

.comment { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-base); }
.comment:last-child { border-bottom: 0; padding-bottom: 0; }
.comment .head { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 3px; }
.comment .head .who { color: var(--text); font-weight: 600; }
.comment.from-agent {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 12px 14px; border-bottom: 0; margin: 8px 0;
}
.unreadflag {
  color: var(--accent-strong, var(--warn-ink)); font-size: var(--fs-xs);
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ============================================================== chat ===== */

.chatlog {
  max-height: 400px; min-height: 120px; overflow-y: auto;
  padding: 4px 2px; display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.bubble-row { display: flex; }
.bubble-row.human { justify-content: flex-end; }
.bubble-row.agent { justify-content: flex-start; }
.bubble {
  max-width: 82%; padding: 9px 13px; border-radius: var(--radius-lg);
  font-size: var(--fs-base); line-height: 1.5;
}
.bubble-row.human .bubble {
  background: var(--primary); color: var(--primary-ink);
  border-bottom-right-radius: var(--radius-sm);
}
.bubble-row.agent .bubble {
  background: var(--surface-2); color: var(--text);
  border-bottom-left-radius: var(--radius-sm);
}
.bubble .bmeta { font-size: 10.5px; opacity: 0.7; margin-bottom: 3px; }
.bubble .btext { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.thinking { opacity: 0.8; font-style: italic; }
.dots i { font-style: normal; animation: dotblink 1.4s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotblink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
.chatempty { color: var(--text-muted); font-size: var(--fs-sm); padding: 20px 4px; margin: 0; max-width: 62ch; }
.chatbar { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.chatbar textarea { flex: 1; min-height: 40px; max-height: 140px; resize: none; }
.chatbar button { height: 40px; }
.chatlog.htmx-request { opacity: 0.65; transition: opacity var(--dur-base) var(--ease-out); }

/* ========================================================== playbook ===== */

.pbwrap { max-width: 820px; }
.pbmeta {
  display: flex; gap: 8px 18px; color: var(--text-muted);
  font-size: var(--fs-sm); margin: 10px 0 0; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.prose { font-size: var(--fs-base); line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 22px; font-weight: 500; margin: 0 0 10px; }
.prose h2 {
  display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  margin: 30px 0 8px; padding-top: 14px; border-top: 1px solid var(--border);
}
.prose h3 { font-size: var(--fs-md); font-weight: 600; margin: 22px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 0 0 12px; max-width: 72ch; }
.prose li { margin-bottom: 4px; }
.prose table {
  border-collapse: collapse; width: 100%; font-size: var(--fs-sm);
  display: block; overflow-x: auto; margin: 0 0 14px;
}
.prose th {
  text-align: left; font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-faint); font-weight: 600;
  padding: 7px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.prose td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose code {
  background: var(--surface-2); border-radius: 4px; padding: 1px 5px;
  font-size: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.prose pre { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote {
  margin: 0 0 12px; padding: 2px 16px; border-left: 3px solid var(--sand);
  color: var(--text-muted);
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

.loglist { list-style: none; padding: 0; margin: 0; }
.loglist li {
  margin-bottom: 9px; font-size: var(--fs-sm); line-height: 1.5;
  padding-bottom: 9px; border-bottom: 1px solid var(--border);
}
.loglist li:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.loglist .t {
  color: var(--text-faint); font-variant-numeric: tabular-nums;
  margin-right: 8px; font-size: var(--fs-xs);
}
.logkind {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; margin-right: 7px;
  display: inline-block; vertical-align: 1px;
}
.logkind.change { background: var(--neutral-bg); color: var(--neutral-ink); }
.logkind.learning { background: var(--ok-bg); color: var(--ok-ink); }
.logkind.experiment { background: var(--warn-bg); color: var(--warn-ink); }

/* ============================================================== runs ===== */

:root { --runcols: 14px 136px 68px 58px minmax(60px, 1fr) 68px 68px 50px; }
.runtable { overflow-x: auto; }
.runinner { min-width: 600px; }
.runhead {
  display: grid; grid-template-columns: var(--runcols);
  gap: 8px; align-items: center;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 0 4px 8px; border-bottom: 1px solid var(--border);
}
.runrow { border-bottom: 1px solid var(--border); }
.runrow:last-child { border-bottom: 0; }
.runrow summary {
  display: grid; grid-template-columns: var(--runcols);
  gap: 8px; align-items: center;
  padding: 10px 4px; cursor: pointer; list-style: none; font-size: var(--fs-sm);
  transition: background var(--dur-fast) var(--ease-out);
}
.runrow summary::-webkit-details-marker { display: none; }
.runrow summary::before {
  content: "›"; text-align: center; font-size: 15px;
  color: var(--text-faint); transition: transform var(--dur-fast) var(--ease-out);
}
.runrow[open] summary::before { transform: rotate(90deg); }
.runrow summary .t { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-muted); }
.runrow summary .models { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runrow summary .num { font-variant-numeric: tabular-nums; }
.runrow summary:hover { background: var(--surface-3); }
.runbody { padding: 2px 8px 16px 38px; font-size: var(--fs-base); }
.runbody > :first-child { margin-top: 0; }

/* ============================================================ states ===== */

.empty {
  text-align: center; padding: 64px 24px; color: var(--text-muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); margin-top: 4px;
}
.empty .big {
  font-size: 20px; font-weight: 400; color: var(--text); margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.empty p { margin: 0 auto; max-width: 56ch; font-size: var(--fs-sm); }
.quiet { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }

/* ============================================================= login ===== */

.login-wrap {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 24px; background: var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 34px 30px 30px; box-shadow: var(--shadow-float);
}
.login-mark { width: 210px; height: auto; display: block; margin: 0 auto 12px; }
.login-mark.dark-only { display: none; }
@media (prefers-color-scheme: dark) {
  .login-mark.light-only { display: none; }
  .login-mark.dark-only { display: block; }
}
.login-card .eyebrow { text-align: center; margin-bottom: 22px; }
.login-card .lbl:first-of-type { margin-top: 0; }
.login-error {
  background: var(--bad-bg); color: var(--bad-ink); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: var(--fs-sm); margin: 0 0 16px;
}
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-bottom: 16px; padding: 9px 14px;
  font-weight: 600; font-size: var(--fs-base);
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.sso-btn:hover { text-decoration: none; border-color: var(--text-faint); background: var(--surface-3); }
.pw-fallback { margin-bottom: 4px; }
.pw-fallback summary {
  font-size: var(--fs-sm); color: var(--text-muted); cursor: pointer;
  text-align: center; list-style: none; padding: 4px 0;
}
.pw-fallback summary::-webkit-details-marker { display: none; }
.pw-fallback summary:hover { color: var(--text); }
.pw-fallback[open] summary { margin-bottom: 8px; }
.login-foot {
  text-align: center; color: var(--text-faint); font-size: var(--fs-xs);
  margin: 22px 0 0; letter-spacing: 0.02em;
}

/* ===================================================== reduced motion ==== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .chatlog { scroll-behavior: auto; }
}

/* ========================================================= narrow ==== */

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  h1 { font-size: 24px; }
  .topin { min-height: 0; padding-top: 6px; padding-bottom: 2px; }
  nav.main a { padding: 10px 10px 9px; }
  .pagehead { margin-top: 20px; }
}
