/* King & Society Investor Portal — shared styles (brand tokens from the owner dashboard template). */
:root {
  --bg: #f3efe8; --surface: #fffcf7; --surface-2: #f7f2ea; --ink: #182826; --ink-2: #4a5350; --muted: #7b837f;
  --line: #e2dbcf; --navy: #05233a; --navy-ink: #f6efe4; --brass: #a08055; --brass-ink: #7a5f3d; --copper: #94b29d;
  --s1: #2a78d6; --s2: #eb6834; --good: #0ca30c; --good-ink: #006300; --warn: #fab219; --warn-ink: #7a5200; --crit: #d03b3b; --crit-ink: #a52e2e;
  --grid: #e1ddd4; --axis: #c3bdb2; --shadow: 0 1px 2px rgba(5,35,58,.06);
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif; --display: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1716; --surface: #172220; --surface-2: #1d2a27; --ink: #f1ebe1; --ink-2: #c7c1b6; --muted: #8f978f;
    --line: #2a3734; --navy: #0a2740; --navy-ink: #f6efe4; --brass: #b89468; --brass-ink: #d9bd93; --copper: #94b29d;
    --s1: #3987e5; --s2: #d95926; --good: #0ca30c; --good-ink: #3dcc3d; --warn: #fab219; --warn-ink: #fab219; --crit: #e66767; --crit-ink: #e66767;
    --grid: #2c3330; --axis: #3a4440; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1716; --surface: #172220; --surface-2: #1d2a27; --ink: #f1ebe1; --ink-2: #c7c1b6; --muted: #8f978f;
  --line: #2a3734; --navy: #0a2740; --navy-ink: #f6efe4; --brass: #b89468; --brass-ink: #d9bd93; --copper: #94b29d;
  --s1: #3987e5; --s2: #d95926; --good: #0ca30c; --good-ink: #3dcc3d; --warn: #fab219; --warn-ink: #fab219; --crit: #e66767; --crit-ink: #e66767;
  --grid: #2c3330; --axis: #3a4440; --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--brass-ink); }
.masthead { background: var(--navy); color: var(--navy-ink); padding-block: 22px 20px; padding-inline: 16px; }
.wrap { max-width: 1120px; margin: 0 auto; width: 100%; }
.masthead .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-end; justify-content: space-between; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); font-weight: 600; margin: 0 0 4px; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 3.5vw, 32px); margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -.005em; }
.sub { margin: 4px 0 0; color: var(--navy-ink); opacity: .82; font-size: 14px; }
.updated { font-size: 13px; opacity: .85; text-align: right; }
.updated strong { font-weight: 600; }
.who { font-size: 13px; text-align: right; opacity: .9; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.who a, .who button { color: var(--navy-ink); background: none; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.who a:hover, .who button:hover { border-color: var(--brass); }
.who .links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
main { padding-inline: 16px; padding-block: 16px 32px; flex: 1; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.nav .label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 4px; font-weight: 600; }
.pill { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.pill:hover { border-color: var(--brass); }
.pill[aria-pressed="true"], .pill[aria-current="page"] { background: var(--brass); border-color: var(--brass); color: #fff; font-weight: 600; }
.pill:focus-visible, .btn:focus-visible, .bar-hit:focus-visible, .pt:focus-visible, .primary:focus-visible, input:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.state { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px 20px; text-align: center; color: var(--ink-2); box-shadow: var(--shadow); }
.state h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; color: var(--ink); }
.state p { margin: 0; max-width: 56ch; margin-inline: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.tile .k { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; }
.tile .v { font-size: 28px; font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
.tile .d { font-size: 13px; color: var(--muted); margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip.good { color: var(--good-ink); } .chip.good .dot { background: var(--good); }
.chip.warn { color: var(--warn-ink); } .chip.warn .dot { background: var(--warn); }
.chip.crit { color: var(--crit-ink); } .chip.crit .dot { background: var(--crit); }
.chip.info .dot { background: var(--s1); }
.delta.up { color: var(--good-ink); font-weight: 600; } .delta.down { color: var(--crit-ink); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 12px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 15px; font-weight: 600; margin: 0 0 2px; }
.card .hint { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin: 0 0 6px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0,0,0,.12); min-width: 150px; z-index: 2; }
.tip .t { color: var(--muted); margin-bottom: 4px; }
.tip .row { display: flex; justify-content: space-between; gap: 12px; }
.tip .row .key { display: inline-block; width: 12px; border-top: 3px solid; vertical-align: 3px; margin-right: 6px; }
.tip .row strong { font-variant-numeric: tabular-nums; }
.btn { font: inherit; font-size: 12.5px; color: var(--brass-ink); background: none; border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.btn:hover { border-color: var(--brass); }
.ttable { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.ttable th, .ttable td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.ttable th:first-child, .ttable td:first-child { text-align: left; }
.ttable th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .03em; }
table.stmt { width: 100%; border-collapse: collapse; font-size: 14px; }
table.stmt th, table.stmt td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.stmt th:first-child, table.stmt td:first-child { text-align: left; font-variant-numeric: normal; }
table.stmt th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
table.stmt tr.sec td { color: var(--brass-ink); font-weight: 600; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; padding-top: 12px; border-bottom-color: var(--brass); }
table.stmt tr.tot td { font-weight: 600; border-top: 1px solid var(--axis); }
table.stmt tr.hero td { font-weight: 700; background: var(--surface-2); }
table.stmt .tag { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 6px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
table.stmt .note { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }
.twrap { overflow-x: auto; }
.flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.flags li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 14px; color: var(--ink-2); }
.flags li .chip { margin-top: 2px; }
.ahead { list-style: none; margin: 0; padding: 0; }
.ahead li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ahead li:last-child { border-bottom: 0; }
.ahead .dt { color: var(--brass-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ahead li.past { color: var(--muted); } .ahead li.past .dt { color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 20px; font-size: 14px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 5px 0; }
.facts div span:first-child { color: var(--ink-2); }
.facts div span:last-child { font-weight: 500; text-align: right; }
footer { padding-inline: 16px; padding-block: 8px 28px; color: var(--muted); font-size: 12.5px; }
footer p { margin: 4px 0; max-width: 90ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- portal: sign-in and entity list */
.signin { max-width: 440px; margin: 32px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; box-shadow: var(--shadow); }
.signin h2 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.signin p { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }
.signin label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.signin input { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); margin-bottom: 12px; }
.primary { font: inherit; font-size: 15px; font-weight: 600; background: var(--brass); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; width: 100%; }
.primary:hover { filter: brightness(.95); }
.primary[disabled] { opacity: .6; cursor: default; }
.msg { font-size: 14px; margin: 10px 0 0; color: var(--ink-2); }
.msg.err { color: var(--crit-ink); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--brass-ink); cursor: pointer; text-decoration: underline; }
.elist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ecard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ecard h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.25; }
.ecard .prop { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.ecard .meta { margin: 0; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ecard .hold { font-size: 13px; color: var(--ink-2); margin: 0; }
.ecard .hold strong { font-weight: 600; color: var(--ink); }
.ecard .actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.section-title { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
.docs { width: 100%; border-collapse: collapse; font-size: 14px; }
.docs th, .docs td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.docs th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.docs td.r { text-align: right; white-space: nowrap; }
.docs .kind { font-size: 12px; color: var(--muted); display: block; }
.tabs { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid2 { grid-template-columns: 1fr; } .updated, .who { text-align: left; align-items: flex-start; } .who .links { justify-content: flex-start; } }
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr; } .tile .v { font-size: 24px; } .ahead li { grid-template-columns: 92px 1fr; } }
