/* Deal Desk: surveyor's-ledger look. Cool grey ground, navy ink, one magenta boundary line. */
:root {
  --ground: #f1f4f3;
  --paper: #ffffff;
  --ink: #1a2b3c;
  --ink-soft: #52606d;
  --rule: #d3dadf;
  --rule-strong: #aab6bf;
  --accent: #a8205f;
  --accent-ink: #ffffff;
  --good: #1e7b4f;
  --warn: #9a5b00;
  --bad: #a12a2a;
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 15px/1.5 var(--sans); font-variant-numeric: tabular-nums;
}
a { color: var(--ink); text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; margin-bottom: .6rem; }
p { margin: 0 0 .8rem; max-width: 68ch; }
.muted { color: var(--ink-soft); }

/* top bar */
.bar { background: var(--ink); color: #fff; }
.bar-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 28px; min-height: 52px; flex-wrap: wrap; }
.mark { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: #fff; text-decoration: none; letter-spacing: .01em; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { color: #cfd9e1; text-decoration: none; padding: 14px 10px; border-bottom: 3px solid transparent; }
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }
.who { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: #cfd9e1; }
.who form { margin: 0; }
.linklike { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

.foot { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; color: var(--ink-soft); font-size: .82rem; border-top: 1px solid var(--rule); }
.foot p { margin: 14px 0 0; max-width: 90ch; }
body.pack .foot { max-width: 800px; padding: 0 32px 30px; }

/* messages */
.note { padding: 10px 14px; border-left: 4px solid var(--rule-strong); background: var(--paper); margin: 0 0 18px; max-width: 80ch; }
.note.ok { border-left-color: var(--good); }
.note.err { border-left-color: var(--bad); }
.note.warn { border-left-color: var(--warn); }

/* buttons and fields */
.btn, button.btn { display: inline-block; font: inherit; font-weight: 600; padding: 8px 16px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none; border-radius: 2px; }
.btn:hover { background: #e8edf0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #8d1a50; }
.btn.small { padding: 3px 10px; font-weight: 500; font-size: .85rem; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .88rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink); border-radius: 2px;
}
textarea { min-height: 120px; resize: vertical; }
input[type=file] { font: inherit; }
.field { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; }
.checks label { font-weight: 500; display: flex; gap: 6px; align-items: center; margin: 0; }
fieldset { border: 0; border-top: 1px solid var(--rule-strong); margin: 28px 0 0; padding: 14px 0 0; }
legend { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; padding-right: 10px; }

/* score ruler: a measuring tape with a pin at the score */
.ruler { position: relative; display: inline-block; width: 110px; height: 18px; vertical-align: middle;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 2px no-repeat,
    repeating-linear-gradient(to right, var(--ink) 0 1px, transparent 1px 11px) 0 100% / 100% 7px no-repeat; }
.ruler::before { content: ""; position: absolute; left: 0; bottom: 0; height: 6px; width: calc(var(--s) * 1%); background: var(--ink); opacity: .85; }
.ruler::after { content: ""; position: absolute; bottom: 0; left: calc(var(--s) * 1%); width: 3px; height: 18px; background: var(--accent); transform: translateX(-1px); }
.ruler.big { width: 220px; height: 26px; }
.ruler.big::after { height: 26px; }
.ruler.big { background:
    linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 2px no-repeat,
    repeating-linear-gradient(to right, var(--ink) 0 1px, transparent 1px 22px) 0 100% / 100% 9px no-repeat; }
.score { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; display: inline-block; min-width: 2ch; text-align: right; margin-right: 8px; }
.score.big { font-size: 2.6rem; line-height: 1; margin-right: 12px; }

/* inbox */
.tabs { display: flex; gap: 0; flex-wrap: wrap; border-bottom: 1px solid var(--rule-strong); margin-bottom: 14px; }
.tabs a { padding: 8px 14px; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--ink-soft); }
.tabs a[aria-current="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.filters label { font-size: .85rem; }
.tablewrap { overflow-x: auto; background: var(--paper); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule-strong); }
table.deals { width: 100%; border-collapse: collapse; min-width: 860px; }
table.deals th { text-align: left; font-weight: 600; font-size: .85rem; color: var(--ink-soft); padding: 10px 12px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
table.deals td { padding: 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.deals tr:last-child td { border-bottom: 0; }
table.deals td.num, table.deals th.num { text-align: right; }
.addr { font-weight: 600; text-decoration: none; }
.addr:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.sub { color: var(--ink-soft); font-size: .88rem; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: .8rem; border: 1px solid var(--rule-strong); padding: 0 7px; border-radius: 2px; background: var(--ground); white-space: nowrap; }
.chip.good { border-color: var(--good); color: var(--good); }
.chip.flag { border-color: var(--warn); color: var(--warn); }
.pos { color: var(--good); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }
.rowactions { display: flex; gap: 6px; }
.rowactions form { margin: 0; }
.empty { background: var(--paper); border-top: 2px solid var(--ink); padding: 28px; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 14px; }

/* deal detail */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.verdict { display: flex; align-items: center; margin-top: 10px; }
.ledger { width: 100%; border-collapse: collapse; margin-bottom: 26px; }
.ledger caption { text-align: left; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.ledger td { padding: 6px 0; border-bottom: 1px dotted var(--rule-strong); vertical-align: baseline; }
.ledger td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.ledger td small { display: block; color: var(--ink-soft); font-weight: 400; font-size: .82rem; }
.ledger tr.total td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 700; padding-top: 8px; }
.ledger tr.total td:first-child { font-weight: 700; }
.panel { border-top: 2px solid var(--ink); background: var(--paper); padding: 16px 18px; margin-bottom: 22px; }
.panel h2 { margin-bottom: 8px; }
.flags { margin: 0 0 10px; padding-left: 18px; }
.flags li { color: var(--warn); margin-bottom: 2px; }
.desc { white-space: pre-wrap; max-height: 260px; overflow: auto; font-size: .92rem; color: var(--ink-soft); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline select { width: auto; }

/* login */
.auth { max-width: 880px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.auth.single { grid-template-columns: minmax(0, 420px); }

/* investor pack: a plain printed page */
body.pack { background: #fff; }
.sheet { max-width: 800px; margin: 0 auto; padding: 36px 32px 48px; font-family: var(--serif); }
.sheet .sub, .sheet .hint, .sheet .muted { font-family: var(--sans); }
.sheet h1 { font-size: 2rem; }
.sheet .ledger td, .sheet .ledger caption { font-family: var(--sans); }
.sheet .ledger caption { font-family: var(--serif); }
.letterhead { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 22px; font-family: var(--sans); }
.packbar { max-width: 800px; margin: 0 auto; padding: 14px 32px 0; display: flex; gap: 10px; align-items: center; font-family: var(--sans); }
.disclaimer { border-top: 1px solid var(--rule-strong); margin-top: 28px; padding-top: 10px; font-size: .82rem; color: var(--ink-soft); font-family: var(--sans); }
.keyfigs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule-strong); margin: 18px 0 26px; font-family: var(--sans); }
.keyfigs div { padding: 10px 12px; border-right: 1px solid var(--rule); }
.keyfigs div:last-child { border-right: 0; }
.keyfigs b { display: block; font-family: var(--serif); font-size: 1.5rem; }
.keyfigs span { font-size: .85rem; color: var(--ink-soft); }

@media (max-width: 860px) {
  .detail, .auth, .grid2, .grid3 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .keyfigs { grid-template-columns: 1fr 1fr; }
}
@media print {
  .bar, .packbar, .no-print { display: none !important; }
  body, body.pack { background: #fff; }
  .sheet { padding: 0; max-width: none; }
  a { text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
