/* ===========================================================================
   app/ui/app.css — the visual system, defined once
   ===========================================================================
   A NEUTRAL TOOL WITH ONE ACCENT. Tim, asked what it should look like: a
   neutral tool, GMT green as the single accent. Everything that is not ink,
   paper or a line is either green (something you can act on) or one of the two
   states that need to shout: red for "not priced", gold for "somebody typed
   this".

   TWO THINGS ARE LOAD-BEARING AND ARE NOT STYLE:

   1 · A COMPUTED CELL IS NOT BLUE. Until 2026-09-12 computed cells used the
       same blue as the "from Velocity" stripe, which said two different things
       with one colour: "the API told us" and "the engine worked it out". A
       computed cell is grey with a right-aligned figure; blue is only ever
       provenance.

   2 · PROVENANCE IS A 3px LEFT STRIPE, nothing else. Blue from Velocity, gold
       edited or assumed or your own figure, nothing at all typed here, a dotted
       right edge for a required cell that is empty. Explained once in Settings
       and on hover, never as a legend on every page.
   =========================================================================== */

:root {
  --ink: #1b2330;
  --ink-2: #4b5563;
  --ink-3: #8b95a3;
  --line: #dfe4ea;
  --line-2: #eef1f5;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --accent: #2D682E;          /* GMT green-dark: primary, active tab, focus ring */
  --accent-2: #47934E;        /* GMT green-medium: links, hover */
  --accent-soft: #e8f1e9;
  --computed: #f3f5f8;
  --pulled: #2f6f9f;
  --edited: #a67c26;
  --refuse: #b42318;
  --refuse-soft: #fdf1f0;
  --notice: #a67c26;
  --notice-soft: #fdf8ec;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --row: 32px;                /* every grid row, every band row */
  --labelcol: 220px;          /* the board's sticky label column */
  --optioncol: 176px;         /* one option column, minimum */
  --bar: 52px;                /* the file bar */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.45 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 19px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
p { margin: 0 0 8px; }
a { color: var(--accent-2); }

/* Sentence case throughout; no uppercase labels anywhere. */
button, input, select, textarea { font: inherit; color: inherit; font-variant-numeric: inherit; }
/* One accent, checkboxes and radios included: the browser's own blue is the one
   colour on the page that belongs to nothing here. */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

#app { min-height: 100%; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- buttons */
.btn {
  height: 30px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: 0.45; cursor: default; border-color: var(--line); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-primary:disabled { background: var(--accent); border-color: var(--accent); }
.btn-danger { color: var(--refuse); border-color: transparent; background: transparent; }
.btn-danger:hover { background: var(--refuse-soft); border-color: var(--refuse-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-2); border-color: var(--line-2); }
.btn-small { height: 24px; padding: 0 8px; border-radius: 5px; font-size: 12px; }
.btn-link {
  border: 0; background: none; padding: 0; height: auto;
  color: var(--accent-2); text-decoration: underline; cursor: pointer;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ------------------------------------------------------------- the file bar */
.filebar {
  height: var(--bar); flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.filebar-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.filebar-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dealcode {
  font: 600 13px var(--mono); color: var(--ink); background: none; border: 1px solid transparent;
  border-radius: 4px; padding: 1px 4px; min-width: 90px; max-width: 200px;
}
.dealcode:hover { border-color: var(--line); }
.clientname {
  font-size: 13px; color: var(--ink-2); background: none; border: 1px solid transparent;
  border-radius: 4px; padding: 1px 4px; min-width: 110px; max-width: 240px;
}
.clientname:hover { border-color: var(--line); }
.clientname::placeholder { color: var(--ink-3); font-style: italic; }
.filebar-sub { font-size: 11.5px; color: var(--ink-3); padding-left: 5px; }
.filebar-sub .is-dirty { color: var(--edited); }
.filebar-sub .is-degraded { color: var(--notice); border-bottom: 1px dotted var(--notice); cursor: help; }

.tabs { display: flex; gap: 2px; margin: 0 auto; }
.tab {
  height: 30px; padding: 0 14px; border-radius: 6px; border: 1px solid transparent;
  background: none; cursor: pointer; color: var(--ink-2); display: flex; align-items: center; gap: 6px;
}
.tab:hover { background: var(--line-2); }
.tab.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; }
.tab .dot.is-refuse { background: var(--refuse); }
.tab .dot.is-notice { background: var(--notice); }
.tab .count {
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--notice); color: #fff; font-size: 11px; line-height: 17px; text-align: center;
}
.filebar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.homebtn { width: 30px; height: 30px; display: grid; place-items: center; }

/* ------------------------------------------------------------------ layout */
.screen { flex: 1; min-height: 0; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 18px 20px 60px; }
.wrap-narrow { max-width: 1180px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }

.block { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.block-head {
  display: flex; align-items: baseline; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
}
.block-head .hint { font-size: 12px; color: var(--ink-3); }
.block-body { padding: 12px; }
.block-foot { padding: 8px 12px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--ink-2); }

/* -------------------------------------------------------------------- Home */
.home-top {
  height: var(--bar); display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: 0.02em; color: var(--accent); }
.home-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 200px; }
.filelist { width: 100%; border-collapse: collapse; }
.filelist th {
  text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px;
  padding: 6px 10px; border-bottom: 1px solid var(--line);
}
.filelist td { padding: 0 10px; height: 38px; border-bottom: 1px solid var(--line-2); }
.filelist tbody tr { cursor: pointer; }
.filelist tbody tr:hover { background: var(--accent-soft); }
.filelist .code { font: 600 12.5px var(--mono); }
.filelist .num { text-align: right; }

/* ------------------------------------------------------------ notice strip */
.notices { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 460px; }
.notice-card {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ink-3);
  border-radius: 6px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(20, 28, 40, 0.12);
  display: flex; gap: 10px; align-items: flex-start;
}
.notice-card.is-bad { border-left-color: var(--refuse); }
.notice-card.is-warn { border-left-color: var(--notice); }
.notice-card.is-ok { border-left-color: var(--accent); }
.notice-card .body { flex: 1; }
.notice-card .acts { display: flex; gap: 6px; margin-top: 8px; }

/* --------------------------------------------------------------- the panel */
.attention { border-left: 3px solid var(--notice); background: var(--notice-soft); }
.attention.is-blocker { border-left-color: var(--refuse); background: var(--refuse-soft); }
.attn-item { padding: 10px 12px; border-top: 1px solid rgba(0, 0, 0, 0.06); }
.attn-item:first-child { border-top: 0; }
.attn-head { display: flex; align-items: center; gap: 8px; }
.attn-do { color: var(--ink-2); margin-top: 3px; }
.attn-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pill {
  font-size: 11px; padding: 1px 7px; border-radius: 9px; background: var(--line-2); color: var(--ink-2);
}
.pill.is-blocker { background: var(--refuse); color: #fff; }
.pill.is-notice { background: var(--notice); color: #fff; }
.pill.is-ok { background: var(--accent-soft); color: var(--accent); }
.pill.is-refuse { background: var(--refuse-soft); color: var(--refuse); }

/* ---------------------------------------------------------------- the grid */
.grid-wrap { overflow-x: auto; }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line-2); }
table.grid thead th {
  position: sticky; top: 0; z-index: 3; background: var(--surface);
  text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px;
  padding: 5px 10px; white-space: nowrap; border-bottom: 1px solid var(--line);
}
table.grid thead th .unit { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 400; }
table.grid td { height: var(--row); padding: 0; background: var(--surface); }
table.grid td.computed { background: var(--computed); color: var(--ink); text-align: right; padding: 0 10px; }
table.grid td.computed.is-bad { color: var(--refuse); }
table.grid td.is-unpriced { color: var(--refuse); font-style: italic; }
table.grid td.is-derived { padding: 0 10px; color: var(--ink-2); text-align: right; background: var(--computed); }
table.grid tfoot td { background: var(--surface); font-weight: 600; padding: 0 10px; height: var(--row); border-top: 1px solid var(--line); }
table.grid td.rowhead, table.grid th.rowhead {
  position: sticky; left: 0; z-index: 2; background: var(--surface); width: 34px; min-width: 34px;
  text-align: center; color: var(--ink-3); font: 500 11px var(--sans);
}
table.grid thead th.rowhead { z-index: 4; }
table.grid td.actions { padding: 0 4px; text-align: right; white-space: nowrap; background: var(--surface); }

/* One cell, one input. The stripe is the provenance. */
.cell {
  width: 100%; height: var(--row); border: 0; background: transparent; padding: 0 10px;
  border-left: 3px solid transparent;
}
.cell.num { text-align: right; }
.cell::placeholder { color: var(--ink-3); }
.cell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface); }
select.cell { padding-left: 7px; }
td.prov-pulled .cell { border-left-color: var(--pulled); }
td.prov-overridden .cell, td.prov-typedOver .cell, td.prov-assumed .cell { border-left-color: var(--edited); }
td.prov-empty .cell { box-shadow: inset -3px 0 0 -1px var(--line); }
td.prov-empty.is-required .cell { box-shadow: inset -3px 0 0 -1px var(--refuse); }
td.is-stale { background: var(--notice-soft); }
td.field-flag { background: var(--refuse-soft); }

/* ---------------------------------------------------------- the row drawer */
.drawer-row td { background: var(--computed); padding: 10px 12px; }
.drawer-fields { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.field > label { font-size: 11.5px; color: var(--ink-3); }
.field .note { font-size: 11px; color: var(--ink-3); }
.field input, .field select, .field textarea {
  height: 28px; border: 1px solid var(--line); border-radius: 5px; padding: 0 8px; background: var(--surface);
}
.field textarea { height: auto; padding: 6px 8px; resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* ------------------------------------------------------------- the options board */
.board-head { display: flex; align-items: center; gap: 10px; padding: 0 0 10px; flex-wrap: wrap; }
.propchip {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
.propchip .bit { white-space: nowrap; }
.propchip .bit button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; border-bottom: 1px dotted var(--ink-3); }
.propchip .bit .differs { color: var(--edited); }

.board-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table.board { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
table.board th, table.board td { border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.board col.labelcol { width: var(--labelcol); }
table.board .lbl {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  /* FIXED, not "at least". A label column that grows to fit its longest label
     is a column that steals the room the options need, and "Cash left over
     after down, closing and payoffs" is longer than any figure beside it. */
  width: var(--labelcol); min-width: var(--labelcol); max-width: var(--labelcol);
  text-align: left; font-weight: 400;
  padding: 0 10px; height: var(--row); color: var(--ink-2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
table.board .lbl .unit { color: var(--ink-3); font-size: 11px; margin-left: 5px; }
table.board .lbl .departed { color: var(--edited); margin-left: 5px; }
table.board td.opt { min-width: var(--optioncol); padding: 0; background: var(--surface); }
table.board thead th { position: sticky; top: 0; z-index: 5; background: var(--surface); }
table.board thead th.lbl { z-index: 6; }
/* A computed cell looks the same on both tables. These repeat the `table.grid`
   rules above rather than joining their selector, because `td.opt` sets the
   padding and background a few lines up at the same specificity and would win
   on source order. Board-only bits: `vertical-align` back to middle (the table
   sets `top` for the option heads) and the line height a row needs when the
   cell holds a span rather than an input. */
table.board td.opt.computed {
  background: var(--computed); color: var(--ink); text-align: right;
  padding: 0 10px; vertical-align: middle;
}
table.board td.opt.computed.is-bad { color: var(--refuse); }
table.board td.opt.is-unpriced { color: var(--refuse); font-style: italic; }

.opt-head { padding: 8px 10px; border-left: 1px solid var(--line-2); min-width: var(--optioncol); }
.opt-head.is-refused { background: var(--refuse-soft); }
.opt-head-top { display: flex; align-items: center; gap: 4px; }
.opt-name {
  font-weight: 600; border: 1px solid transparent; background: none; border-radius: 4px;
  padding: 1px 4px; min-width: 0; flex: 1;
}
.opt-name:hover { border-color: var(--line); }
.opt-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; height: 15px; overflow: hidden; }
.opt-off { font-size: 11px; color: var(--ink-3); }

.results { border-left: 1px solid var(--line-2); padding: 8px 10px; }
.results .big { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.results .big .per { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.results .heloc-add { font-size: 11.5px; color: var(--ink-2); }
.results .ratios { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.results .ratios .over { color: var(--refuse); font-weight: 600; }
.results .cash { font-size: 12.5px; margin-top: 3px; }
.results .cash.is-bad { color: var(--refuse); }
.results .notice-line { font-size: 11.5px; color: var(--notice); margin-top: 4px; }
.results .refusal { color: var(--refuse); font-size: 12px; }
.results .refusal li { margin: 0 0 4px; }
.results .refusal ul { margin: 0; padding-left: 16px; }

.bandhead td, .bandhead th {
  background: var(--computed); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.bandhead .lbl { background: var(--computed); font-weight: 600; color: var(--ink); }
.band-toggle {
  border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 6px; padding: 0; height: var(--row);
}
.band-note { padding: 4px 10px; font-size: 11.5px; color: var(--notice); }
.subrow .lbl { padding-left: 26px; color: var(--ink-3); }
.expander {
  border: 0; background: none; cursor: pointer; color: var(--ink-3); padding: 0 4px 0 0; font-size: 10px;
}
.ghostcol { min-width: 150px; padding: 10px; }

/* ------------------------------------------------------------- tools drawer */
.board-layout { display: flex; gap: 14px; align-items: flex-start; }
.board-main { flex: 1; min-width: 0; }
.tools { width: 300px; flex: none; display: flex; flex-direction: column; gap: 14px; }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.tool-head { padding: 8px 12px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.tool-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.tool-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tool-row > label { color: var(--ink-2); }
.tool-row input, .tool-row select { width: 110px; height: 26px; border: 1px solid var(--line); border-radius: 5px; padding: 0 7px; text-align: right; }
.tool-out { border-top: 1px solid var(--line-2); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.tool-out > div { display: flex; justify-content: space-between; gap: 10px; }
.tool-out .is-total { font-weight: 600; border-top: 1px solid var(--line-2); padding-top: 4px; }
.tool-out .is-bad { color: var(--refuse); }
.tool-note { font-size: 11.5px; color: var(--ink-3); }

/* ------------------------------------------------------------- deliverable */
.deliver { display: flex; gap: 16px; align-items: flex-start; }
.deliver-outline { width: 460px; flex: none; display: flex; flex-direction: column; gap: 10px; }
.deliver-preview { flex: 1; min-width: 0; position: sticky; top: calc(var(--bar) + 14px); }
.sec-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.sec-card.is-dragging { opacity: 0.5; }
.sec-card.is-drop { border-color: var(--accent); }
.sec-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; }
.sec-head .grip { color: var(--ink-3); cursor: grab; }
.sec-head .where { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.sec-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 10px; }
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 0 0 8px; flex-wrap: wrap; }
.preview-warn { color: var(--notice); font-size: 12px; }
.preview-scaler { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.preview-frame { width: 1100px; height: 1400px; border: 0; transform-origin: top left; }
.preview-frame.is-phone { width: 390px; }
.prose-area { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; resize: vertical; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-choice {
  flex: 1; min-width: 120px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
  cursor: pointer; display: flex; flex-direction: column; gap: 2px; background: var(--surface);
}
.mode-choice.is-on { border-color: var(--accent); background: var(--accent-soft); }
.mode-choice span { font-size: 11.5px; color: var(--ink-3); }
.inline-check { display: flex; gap: 8px; align-items: flex-start; }

/* -------------------------------------------------------------------- menu */
.menu-pop {
  position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 10px 30px rgba(20, 28, 40, 0.16); padding: 4px; min-width: 190px;
}
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 0; background: none; padding: 7px 10px; border-radius: 5px; cursor: pointer;
}
.menu-item:hover { background: var(--accent-soft); }
.menu-item:disabled { color: var(--ink-3); background: none; cursor: default; }
.menu-item.is-danger { color: var(--refuse); }
.menu-item.is-danger:hover { background: var(--refuse-soft); }
.menu-sep { height: 1px; background: var(--line-2); margin: 4px 2px; }
.menu-label { padding: 6px 10px 2px; font-size: 11px; color: var(--ink-3); }

/* ------------------------------------------------------------------ dialog */
.dialog {
  border: 1px solid var(--line); border-radius: 10px; padding: 0; max-width: 860px; width: 92vw;
  max-height: 84vh; color: var(--ink); background: var(--surface);
}
.dialog::backdrop { background: rgba(15, 20, 28, 0.35); }
.dialog-head { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.dialog-body { padding: 14px 16px; overflow: auto; max-height: 56vh; }
.dialog-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.diff-list { list-style: none; margin: 0; padding: 0; }
.diff-list li { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.diff-path { flex: 1; color: var(--ink-2); }
.diff-before { color: var(--refuse); }
.diff-after { color: var(--accent); }
.diff-kept { color: var(--ink-3); font-size: 11.5px; }

/* Copy for CRM. WIDE, because the review can carry five option columns beside
   its labels, and a table squeezed into 860px wraps every figure onto two lines.
   The class is added by crm-dialog.js and taken off again when it closes:
   #dialog is one element every dialog shares. */
.dialog.is-wide { max-width: 1280px; width: 96vw; }
.dialog.is-wide .dialog-body { max-height: 66vh; }
.crm-gaps { margin-bottom: 14px; }
.crm-gap-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
.crm-review h2 { margin-bottom: 2px; }
.crm-line { color: var(--ink-2); margin-bottom: 4px; }
.crm-section h3 { margin: 14px 0 6px; }
.crm-table-wrap { overflow-x: auto; }
/* The template's look in the app's own palette: hairline borders, the header
   row shaded, the label column bold and shaded. Compact, because this is a
   preview of a paste and not a screen anybody types in. */
.crm-table { border-collapse: collapse; font-size: 12px; line-height: 1.35; }
.crm-table th, .crm-table td {
  border: 1px solid var(--line); padding: 3px 7px; vertical-align: top; text-align: left;
}
.crm-table thead th { background: var(--line); font-weight: 600; white-space: nowrap; }
.crm-table .crm-label { background: var(--computed); font-weight: 600; min-width: 140px; max-width: 260px; }
.crm-table td { min-width: 90px; max-width: 280px; }
.crm-list { margin: 0; padding-left: 22px; }
.crm-list li { min-height: 1.45em; }
.crm-status { margin-right: auto; align-self: center; font-size: 12px; color: var(--ink-2); }
.crm-status.is-ok { color: var(--accent); }
.crm-status.is-warn { color: var(--notice); }
.crm-status.is-bad { color: var(--refuse); }

/* --------------------------------------------------------------- messages */
.empty { padding: 22px; text-align: center; color: var(--ink-3); }
.explain { padding: 22px 26px; line-height: 1.6; max-width: 720px; }
.stripe-key { display: flex; align-items: center; gap: 8px; }
.stripe-key i { width: 3px; height: 16px; border-radius: 2px; display: inline-block; }
.is-refuse-text { color: var(--refuse); }
.is-notice-text { color: var(--notice); }

/* A cell that carries a menu keeps both inside the td: `display:flex` on the td
   itself takes it out of the table's column sizing and every column after it
   stops lining up. */
.cell-with-menu { display: flex; align-items: center; gap: 2px; }
.cell-with-menu .cell { flex: 1; min-width: 0; }
.cell-with-menu .btn { opacity: 0; flex: none; }
td:hover .cell-with-menu .btn, .cell-with-menu .cell:focus + .btn, .cell-with-menu .btn:focus { opacity: 1; }
.cell-action { margin-left: 6px; }

.opt-head .grip { color: var(--ink-3); cursor: grab; font-size: 11px; }
.opt-head [draggable].is-drop { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 6px; }

/* A field this file has raised a notice about: the sentence sits under it, in
   the notice colour, rather than in a block somewhere else on the page. */
.field-notice { background: var(--notice-soft); border-radius: 6px; padding: 6px; margin: -6px; }
.field .note.is-notice-text { color: var(--notice); }

/* A cell a warning is about. The panel at the top names it and its Go lands
   here; this is what tells somebody who scrolled past the panel that this
   particular cell is the one. */
td.has-flag { position: relative; }
td.has-flag::after {
  content: ""; position: absolute; top: 3px; right: 3px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--notice);
}

/* The Share dialog (share-dialog.js): who is on a file, and adding someone. */
.share-list { list-style: none; margin: 0; padding: 0; }
.share-person { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.share-pick { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.share-sub { margin: 14px 0 4px; }
.share-foot { margin-top: 10px; }
.btn .count {
  display: inline-block; min-width: 17px; height: 17px; margin-left: 6px; padding: 0 4px; border-radius: 9px;
  background: var(--line); color: var(--ink); font-size: 11px; line-height: 17px; text-align: center;
}

/* One editor at a time: who has the file, and the screens drawn read-only. */
.hold-banner {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  background: var(--notice-soft); border-bottom: 1px solid var(--line);
}
.screen.is-readonly input[readonly], .screen.is-readonly textarea[readonly], .screen.is-readonly select:disabled {
  opacity: 0.75;
}
