/* One stylesheet for every page. Content first, hairlines not boxes, sharp corners, ink primary.
   Red is for failure and flagged items only; amber warns; green passes. System fonts: no network.

   Reuse these before adding a rule:
     layout   .page  .narrow  .split (rail + main)  .rail  .bar (sticky summary strip)
     text     h1 h2 h3  .cap  .muted  .small  .mono  .num
     controls .btn  .btn.primary  .btn.quiet  .field (label + input)  .form  .inline
     data     table.grid  .rows > .r (36px hairline rows: label | value | kind | action)
     state    .kind.entered .kind.pick .kind.calculated .kind.unverified  .status.<name>
     notes    .notice  .notice.warn  .notice.err  .notice.ok  .empty */
:root {
  --red: #DD0C36; --red-soft: #FDE2E2; --ink: #2B2B2B; --ink-strong: #161922; --surface: #FFFFFF;
  --fill: #F4F5F7; --tint: rgba(22, 25, 34, .04); --line: #E6E7EA; --line-2: #D3D4D8;
  --muted: #6B6E78; --muted-2: #A1A4B1; --amber: #A35F00; --amber-soft: #FFF4DC;
  --ok: #1E7E4F; --ok-soft: #E8F5EE; --info: #0B5CAD; --info-soft: #E6F0FB;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sandbox: #FBBF24; /* the same pill as the company website */
  --top: 48px; --bar: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface); color: var(--ink);
  font: 14.5px/1.45 var(--sans); font-variant-numeric: tabular-nums lining-nums; }
a { color: var(--ink-strong); }
h1 { font-size: 26px; line-height: 1.15; margin: 0 0 6px; font-weight: 750; color: var(--ink-strong); }
h2 { font-size: 18px; margin: 0; font-weight: 700; color: var(--ink-strong); }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 700; }
p { margin: 0 0 10px; }
.cap { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700;
  color: var(--muted); margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.mono, code { font-family: var(--mono); font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 1px; }

/* app bar */
.top { position: sticky; top: 0; height: var(--top); z-index: 50; background: var(--surface);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.brand img { display: block; height: 28px; width: auto; }
.bsub { font-size: 14px; color: var(--muted); border-left: 1px solid var(--line-2); padding-left: 9px; }
.modules { display: flex; align-items: stretch; height: 100%; margin-left: 10px; gap: 4px; }
.modules a { text-decoration: none; display: flex; align-items: center; padding: 0 12px; font-weight: 600;
  color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.modules a[aria-current], .modules a:hover { color: var(--ink-strong); }
.modules a[aria-current] { border-bottom-color: var(--ink-strong); }
.sandbox { font: 600 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em;
  padding: 2px 6px; border-radius: 3px; background: var(--sandbox); color: #000; white-space: nowrap; }
.util { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13.5px; }

/* layout */
.page { padding: 24px 20px 64px; max-width: 1240px; margin: 0 auto; }
.narrow { max-width: 420px; margin: 8vh auto 0; }
.split { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; }
.rail { position: sticky; top: calc(var(--top) + var(--bar) + 16px); display: grid; gap: 1px; }
.rail a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; text-decoration: none;
  color: var(--ink); border-left: 2px solid transparent; }
.rail a:hover { background: var(--tint); }
.rail a[aria-current] { border-left-color: var(--ink-strong); font-weight: 650; color: var(--ink-strong); }
.bar { position: sticky; top: var(--top); min-height: var(--bar); z-index: 40; background: var(--surface);
  border-bottom: 1px solid var(--line-2); display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 28px; padding: 8px 0; margin-bottom: 20px; }
.bar .fig { display: grid; } .bar .fig b { font-size: 17px; color: var(--ink-strong); }
.bar .fig span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bar .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } .rail { position: static; } }

/* controls */
.btn { font: inherit; font-weight: 600; cursor: pointer; padding: 7px 14px; border-radius: 3px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-strong);
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--fill); }
.btn.primary { background: var(--ink-strong); border-color: var(--ink-strong); color: #fff; }
.btn.primary:hover { background: var(--ink); }
.btn.quiet { border-color: transparent; color: var(--muted); padding: 5px 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 13px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  font: inherit; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 4px;
  background: var(--surface); color: var(--ink-strong); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--ink-strong); outline-offset: -1px; }
.inline { display: flex; gap: 8px; align-items: center; }

/* tables and rows */
table.grid { border-collapse: collapse; width: 100%; }
table.grid th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:hover td { background: var(--tint); }
.rows .g { font: 600 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  padding: 18px 10px 6px; border-bottom: 1px solid var(--line); }
.rows .r { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 132px 70px;
  column-gap: 14px; align-items: center; min-height: 36px; padding: 2px 4px 2px 10px;
  border-bottom: 1px solid var(--line); }
.rows .r:hover { background: var(--tint); }
.rows .r input, .rows .r select { padding: 4px 7px; }
.rows .r .unit { color: var(--muted); font-size: 12.5px; margin-left: 6px; }

/* state */
.kind { font: 600 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px;
  border-radius: 2px; white-space: nowrap; justify-self: start; }
.kind.entered { background: var(--info-soft); color: var(--info); }
.kind.pick { background: var(--fill); color: var(--ink); }
.kind.calculated { background: var(--ok-soft); color: var(--ok); }
.kind.unverified { background: var(--amber-soft); color: var(--amber); }
.status { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 10px; background: var(--fill); }
.status.draft { background: var(--fill); color: var(--muted); }
.status.ready, .status.ok { background: var(--ok-soft); color: var(--ok); }
.status.review { background: var(--amber-soft); color: var(--amber); }

/* notes */
.notice { padding: 9px 12px; box-shadow: inset 2px 0 0 var(--line-2); background: var(--fill); margin: 0 0 14px; }
.notice.warn { box-shadow: inset 2px 0 0 var(--amber); background: var(--amber-soft); color: var(--amber); }
.notice.err { box-shadow: inset 2px 0 0 var(--red); background: var(--red-soft); color: #8E0A24; }
.notice.ok { box-shadow: inset 2px 0 0 var(--ok); background: var(--ok-soft); color: var(--ok); }
.empty { padding: 40px 0; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }

/* quotes */
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 14px; }
.head h1 { margin: 0 auto 0 0; }
.start { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 10px; margin: 0 0 18px; }
.start .field { flex: 0 1 280px; min-width: 0; }
.start p { flex: 1 0 100%; margin: 0; }
.scroll { overflow-x: auto; }
.bar .who { display: grid; gap: 2px; min-width: 0; }
.rail .cap { margin: 12px 0 4px 10px; } .rail .cap:first-child { margin-top: 0; }
.rows.q { margin-top: 10px; border-top: 1px solid var(--line-2); }
.rows.q .r { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 132px 104px; }
.rows .r .lbl { padding: 6px 0; line-height: 1.3; min-width: 0; }
.rows .r .val { font-weight: 600; color: var(--ink-strong); overflow-wrap: anywhere; }
.rows .r .unit { margin-left: 0; overflow-wrap: anywhere; }
.rows.q .r .kind { grid-column: 3; } .rows.q .r .unit { grid-column: 4; }
.rows .r .rowmsg { grid-column: 1 / -1; margin: 2px 0 8px; } .rows .r .rowmsg:empty { display: none; }
.rows .r:has(.rowmsg:not(:empty)) :is(input, select) { border-color: var(--red); }
.rows .r .dash { color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; }
@media (max-width: 560px) {
  .page { padding: 16px 12px 48px; }
  .bar { position: static; gap: 6px 18px; }
  .rows.q .r { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 2px; padding: 6px 4px 6px 10px; }
  .rows.q .r .kind, .rows.q .r .unit { grid-column: auto; }
}

/* narrow screens: the top bar wraps instead of running off the edge, and nothing sticks */
@media (max-width: 640px) {
  .top { position: static; height: auto; min-height: var(--top); flex-wrap: wrap; gap: 4px 10px; padding: 6px 12px; }
  .modules { order: 3; width: 100%; height: 34px; margin-left: 0; }
  .util { margin-left: auto; min-width: 0; }
  .util > * { min-width: 0; overflow-wrap: anywhere; }
  .bar .end { margin-left: 0; width: 100%; flex-wrap: wrap; justify-content: space-between; }
  .bar .end > * { min-width: 0; overflow-wrap: anywhere; }
}
