/* Rapport console — deliberately small. System fonts, no framework.
 *
 * Every colour is a token defined on bare :root, so the dark block below
 * only ever REDEFINES them. A colour whose single definition lives inside a
 * media query is the classic way a page ends up rendering one theme's text
 * on the other theme's background. */
:root {
  --ink: #1a1e23;
  --dim: #6b7280;
  --line: #e2e5e9;
  --paper: #fbfbfa;
  --card: #ffffff;
  --accent: #0f6b54;
  --accent-ink: #ffffff;
  --warn-bg: #fff7e6;
  --warn-line: #e0b95c;
  --warn-ink: #7a5b12;
  --danger: #a33a2e;
  --ok: #146c43;
  --pre-bg: #f4f5f4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e8ea;
    --dim: #98a2ad;
    --line: #2b3138;
    --paper: #14181c;
    --card: #1b2027;
    /* lifted off the light-mode green: the same hue at that lightness is
       unreadable on a dark ground */
    --accent: #4bbf95;
    --accent-ink: #08130f;
    --warn-bg: #33290f;
    --warn-line: #8a6d20;
    --warn-ink: #f0d79a;
    --danger: #f08a7c;
    --ok: #6bcf9a;
    --pre-bg: #12161a;
  }
}
* { box-sizing: border-box; }
/* `display` from a type selector beats the hidden attribute's UA rule, which
   is how a signed-out page kept showing a full nav (M12 #124). Anything the
   code hides stays hidden. */
[hidden] { display: none !important; }
body {
  margin: 0 auto;
  max-width: 60rem;
  padding: 0 1.25rem 4rem;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
header {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  /* the nav grew from three items to eight over M10; wrapping the whole
     header keeps that readable instead of squeezing every item */
  flex-wrap: wrap;
}
.brand { font-weight: 650; letter-spacing: 0.01em; white-space: nowrap; }
.dim { color: var(--dim); font-weight: 400; }
.spacer { flex: 1; }
#who, #logout { white-space: nowrap; }
nav { display: flex; flex-wrap: wrap; gap: 0.9rem; }
nav a { white-space: nowrap; }
nav a { color: var(--ink); text-decoration: none; }
nav a.active { color: var(--accent); font-weight: 600; }
/* how many things are waiting on the person — the one number the nav owes
   them, so "what is my agent asking me?" never needs hunting for */
nav .count {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.4rem;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.7rem;
  font-weight: 600;
}

/* Keyboard users get the same affordances as mouse users. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
h2 { font-size: 1.05rem; margin: 1.6rem 0 0.6rem; }
h3 { font-size: 0.95rem; margin: 1.1rem 0 0.4rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  margin: 0.6rem 0;
}
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.grow { flex: 1; }
label { display: block; margin: 0.6rem 0 0.15rem; color: var(--dim); font-size: 0.85rem; }
input, textarea {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  background: var(--card);
}

/* checkbox rows: after the generic label/input rules above, which would
   otherwise win on equal specificity and stretch the box to full width */
.checks { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.85rem; }
label.check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
}
.check input[type="checkbox"] { width: auto; margin: 0; padding: 0; flex: none; }
textarea { min-height: 8rem; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
button, a.button {
  font: inherit;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
a.button { text-decoration: none; display: inline-block; }
button.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.link { background: none; border: none; color: var(--dim); padding: 0; cursor: pointer; text-decoration: underline; }
button:disabled { opacity: 0.5; cursor: default; }

pre {
  background: var(--pre-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
}
.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 99px;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  color: var(--dim);
}
.badge.stale { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.badge.fresh { border-color: var(--accent); color: var(--accent); }
.badge.dead { color: var(--danger); border-color: var(--danger); }
/* a probable email is neither a fact nor a guess, and should not look like either */
.badge.warn-badge { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
/* declared by the person, never computed — visually distinct from every
   badge that reports a fact Rapport worked out */
.badge.stakes { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.badge + .badge { margin-left: 0.35rem; }
h3 .badge, h4 .badge { margin-left: 0.5rem; font-weight: 400; }

.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
  margin: 0.6rem 0;
  color: var(--warn-ink);
}
#flash { margin: 0.6rem 0 0; color: var(--danger); }
#flash.ok { color: var(--ok); }
.meta { color: var(--dim); font-size: 0.82rem; }
.auth { max-width: 22rem; margin: 3.5rem auto; }
.auth .swap { margin-top: 0.9rem; }
table { border-collapse: collapse; width: 100%; }
/* wide tables scroll inside their own box; the page never scrolls sideways */
.scroll-x { overflow-x: auto; }
td, th { text-align: left; padding: 0.4rem 0.6rem 0.4rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
th { color: var(--dim); font-weight: 500; font-size: 0.82rem; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th .arrow { color: var(--accent); }

/* Evidence: every signal Rapport reports can show what it is based on, one
   disclosure away. The rule since M2 is that no conclusion is displayed
   without its working available — this is where that becomes visible. */
.evidence { display: inline; }
.evidence > summary {
  display: inline;
  cursor: pointer;
  color: var(--dim);
  font-size: 0.78rem;
  text-decoration: underline dotted;
}
.evidence > summary::marker, .evidence > summary::-webkit-details-marker { content: ""; }
.evidence > .body {
  display: block;
  margin: 0.35rem 0 0.5rem;
  padding: 0.5rem 0.7rem;
  border-left: 2px solid var(--line);
  background: var(--pre-bg);
  border-radius: 0 4px 4px 0;
  font-size: 0.82rem;
  color: var(--dim);
  white-space: pre-wrap;
  word-break: break-word;
}
/* The loops board: three columns on a wide screen, stacked on a narrow one.
   Grid rather than flex so the columns stay equal without fixed widths. */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: start; }
.board .column h3 { margin-top: 0; }
.board .card { margin: 0 0 0.6rem; }
@media (max-width: 46rem) { .board { grid-template-columns: 1fr; } }

/* the pipeline board: four stages, and a drop target that shows itself */
.deals-board { grid-template-columns: repeat(4, 1fr); }
.deals-board .column { border-radius: 6px; padding: 0.25rem; }
.deals-board .column.drop { background: var(--pre-bg); outline: 2px dashed var(--accent); }
.card.deal { cursor: grab; }
.card.deal.dragging { opacity: 0.5; }
.card.deal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 60rem) { .deals-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 40rem) { .deals-board { grid-template-columns: 1fr; } }

.empty { color: var(--dim); padding: 1.5rem 0; }
.empty strong { display: block; color: var(--ink); margin-bottom: 0.25rem; }

/* Settings: the usage meters, and the one card that has to look like it
   means it. A destructive control should not be styled the same as Save. */
.usage-row { margin: 0.75rem 0 1rem; }
.usage-row .meta { display: block; margin-top: 0.2rem; }
/* A <meter> needs its native appearance removed before either engine will
   take a background from us, and each names the two halves differently. */
meter {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 0.35rem;
  border: 0;
  border-radius: 3px;
  background: var(--pre-bg);
  appearance: none;
  -webkit-appearance: none;
}
meter::-webkit-meter-bar {
  border: 0;
  border-radius: 3px;
  background: var(--pre-bg);
}
meter::-webkit-meter-optimum-value,
meter::-webkit-meter-suboptimum-value,
meter::-webkit-meter-even-less-good-value { background: var(--accent); }
meter::-moz-meter-bar { background: var(--accent); }
meter.full::-webkit-meter-optimum-value,
meter.full::-webkit-meter-suboptimum-value,
meter.full::-webkit-meter-even-less-good-value { background: var(--danger); }
meter.full::-moz-meter-bar { background: var(--danger); }
.tabular { font-variant-numeric: tabular-nums; }
input.narrow { width: 6rem; }
.row.submit { margin-top: 0.9rem; }
.card.danger-zone { border-color: var(--danger); }
.card.danger-zone h3 { color: var(--danger); }

/* The mark, shared with the landing page (M13). Inline SVG taking its colour
   from currentColor — one asset, both themes, no request. */
/* gap, not a margin on the mark: a flex container drops the whitespace
   between its children, so "rapport <span>console</span>" ran together into
   one word the moment this stopped being an inline span. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--ink);
}
.brand .mark { color: var(--accent); flex: none; }
