/* Freeboard: a quiet ledger for reading valuations. One loud element: the
   price-against-value scale on company pages. */
:root {
  --ground: #eef2ee;   /* ledger paper */
  --sheet: #f8faf8;    /* tables and forms */
  --ink: #1d2a26;      /* deep green-black */
  --ink-2: #4c5c56;    /* secondary text */
  --rule: #c9d3cc;     /* ledger rules */
  --rule-2: #dfe6e0;
  --pen: #2a4f9e;      /* actions and links */
  --below: #2f7d4f;    /* price below value */
  --above: #9c2f3a;    /* price above value */
  --band: #d5e8da;
  --fc: #e7ece8;       /* forecast columns */
  --ttm: #f1f4ec;
  --radius: 4px;
  font-family: "Public Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--pen); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.top { display: flex; align-items: baseline; gap: 28px; padding: 14px 28px; border-bottom: 1px solid var(--rule); background: var(--sheet); }
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 20px; }
.top nav a { color: var(--ink-2); text-decoration: none; padding-bottom: 2px; }
.top nav a[aria-current] { color: var(--ink); border-bottom: 2px solid var(--ink); }
.who { margin-left: auto; color: var(--ink-2); font-size: 13px; }

main { max-width: 1440px; margin: 0 auto; padding: 24px 28px 64px; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
h1 .name { font-weight: 400; color: var(--ink-2); font-size: 22px; letter-spacing: -0.01em; }
h2 { font-size: 19px; font-weight: 600; margin: 40px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 600; margin: 28px 0 8px; }
section > h2:first-child { margin-top: 40px; }
.lede { max-width: 68ch; color: var(--ink-2); margin: 0 0 16px; }
.quiet { color: var(--ink-2); }
.foot { color: var(--ink-2); font-size: 13px; max-width: 80ch; margin: 10px 0 0; }
.empty { padding: 28px; background: var(--sheet); border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--ink-2); max-width: 70ch; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.company-head { align-items: flex-start; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 12px 0 0; }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-size: 12px; color: var(--ink-2); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.section-head h2 { margin-bottom: 12px; }

.notice { background: var(--sheet); border-left: 3px solid var(--pen); padding: 10px 14px; margin: 0 0 16px; max-width: 90ch; }
.notice.bad { border-left-color: var(--above); }

/* forms */
button { font: inherit; font-weight: 600; color: #fff; background: var(--pen); border: 1px solid var(--pen); border-radius: var(--radius); padding: 7px 14px; cursor: pointer; }
button:hover { background: #213f80; }
button.secondary { background: transparent; color: var(--pen); }
button.link { background: none; border: 0; padding: 0; color: var(--pen); font-weight: 400; text-decoration: underline; text-underline-offset: 2px; }
button.link.danger { color: var(--above); }
button[disabled] { opacity: .6; cursor: progress; }
input, select { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 8px; }
input::placeholder { color: #8a9892; }
label { font-size: 13px; color: var(--ink-2); }
.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-form input { text-transform: uppercase; }
.inline-form input::placeholder { text-transform: none; }

.adjust { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); padding: 12px 16px 16px; margin: 0; min-width: 0; }
legend { font-weight: 600; padding: 0 6px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.field.wide, .actions { grid-column: 1 / -1; }
.field.wide input { max-width: 640px; }
.unit-input { display: inline-flex; align-items: center; gap: 6px; }
.unit-input input { width: 9em; }
.unit { color: var(--ink-2); }
.actions { display: flex; gap: 12px; }

.rule-form { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; }
.rule-form .field { margin: 0; }
.rule-form .compare { border: 0; padding: 0; background: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rule-form .compare legend { font-weight: 400; font-size: 13px; color: var(--ink-2); padding: 0; margin-bottom: 4px; }
.rule-form .compare label { color: var(--ink); font-size: 15px; }
.rule-form [data-for][hidden] { display: none; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
table.grid { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 7px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--rule-2); }
.grid thead th { font-weight: 600; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--rule); vertical-align: bottom; background: var(--sheet); }
.grid .left { text-align: left; }
.grid tbody th { font-weight: 500; }
.grid tbody tr:last-child > * { border-bottom: 0; }
.grid tbody tr:hover > * { background: #eef3ef; }
.grid .company a { font-weight: 700; }
.grid .company .sub { display: block; font-size: 12px; color: var(--ink-2); font-weight: 400; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.sortable thead th[data-sort] { cursor: pointer; user-select: none; }
.sortable thead th[aria-sort="ascending"]::after { content: " ↑"; }
.sortable thead th[aria-sort="descending"]::after { content: " ↓"; }
td.below { color: var(--below); font-weight: 600; }
td.above { color: var(--above); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 10px; background: #f6dfe1; color: var(--above); text-decoration: none; }

.model .stick { position: sticky; left: 0; background: var(--sheet); z-index: 1; min-width: 15rem; }
.model td.fc, .model th.fc { background: var(--fc); }
.model td.ttm, .model th.ttm { background: var(--ttm); font-weight: 600; }
.model .col-note { display: block; font-weight: 400; font-size: 11px; color: var(--ink-2); }
.model tr.sec th { font-weight: 600; color: var(--ink); background: var(--ground); padding-top: 14px; border-bottom: 1px solid var(--rule); }
.model tbody tr:hover > .stick { background: #eef3ef; }

/* the price-against-value scale. --levels: rows of value labels above the
   track; --level: a mark's row (stacked when values sit close together). */
.scale-block { margin: 28px 0 8px; }
.scale { --track: calc(36px + var(--levels, 1) * 34px); position: relative; height: calc(var(--track) + 64px); margin: 0 12px; }
.scale::before { content: ""; position: absolute; left: 0; right: 0; top: var(--track); height: 2px; background: var(--ink); }
.scale .band { position: absolute; top: calc(var(--track) - 10px); height: 22px; background: var(--band); border-radius: 2px; }
.scale .mark { position: absolute; top: calc(var(--track) - 40px - var(--level, 0) * 34px); height: calc(52px + var(--level, 0) * 34px); border-left: 2px solid var(--below); }
.scale .mark-label { position: absolute; left: 4px; top: -4px; padding: 0 4px 2px 2px; font-size: 12px; line-height: 1.25; color: var(--ink-2); white-space: nowrap; background: var(--ground); z-index: 2; }
.scale .mark.flip .mark-label { left: auto; right: 4px; padding: 0 2px 2px 4px; text-align: right; }
.scale .mark-label b { display: block; color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.scale .price { position: absolute; top: calc(var(--track) - 18px); height: 40px; border-left: 4px solid var(--ink); margin-left: -2px; }
.scale .price.above { border-color: var(--above); }
.scale .price.below { border-color: var(--below); }
.scale .price-label { position: absolute; top: 42px; left: -2px; transform: translateX(-50%); font-size: 13px; white-space: nowrap; }
.scale .price-label b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.scale .price.above .price-label b { color: var(--above); }
.scale .price.below .price-label b { color: var(--below); }
.scale .axis { position: absolute; left: 0; right: 0; top: calc(var(--track) + 6px); font-size: 11px; color: var(--ink-2); }
.scale .axis span { position: absolute; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.scale-legend { display: none; }
.scale-note { margin: 4px 12px 0; max-width: 90ch; }
.scale-note .above { color: var(--above); font-weight: 600; }
.scale-note .below { color: var(--below); font-weight: 600; }

.warnings { background: #fbf6e9; border: 1px solid #e8dcb8; border-radius: var(--radius); padding: 4px 18px 10px; margin-top: 24px; }
.warnings h2 { font-size: 15px; margin: 12px 0 6px; }
.warnings ul { margin: 0; padding-left: 18px; }
.warnings li { margin: 3px 0; max-width: 100ch; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
ul.plain li.hit b { color: var(--above); }
.rules li { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.history code { font-size: 13px; background: var(--sheet); padding: 1px 5px; border-radius: 3px; word-break: break-word; }
.history .note { color: var(--ink-2); font-style: italic; }

@media (max-width: 720px) {
  .scale .price-label { transform: translateX(-80%); }
  .scale { --levels: 0 !important; }
  .scale .mark { top: calc(var(--track) - 10px); height: 22px; }
  .scale .mark-label { display: none; }
  .scale-legend { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin: 0 12px 10px; font-variant-numeric: tabular-nums; }
  .scale-legend div { display: contents; }
  .scale-legend dt { color: var(--ink-2); }
  .scale-legend dd { margin: 0; text-align: right; }
  main { padding: 16px 16px 48px; }
  .top { padding: 12px 16px; gap: 16px; flex-wrap: wrap; }
  .who { width: 100%; margin: 0; }
  h1 { font-size: 24px; }
  .model .stick { min-width: 10rem; }
  .scale .mark-label { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* public legal pages */
main.legal { max-width: 72ch; }
main.legal p, main.legal li { line-height: 1.6; }
main.legal h2 { margin-top: 32px; }
