/* Loan Desk — shared tokens and base styles. Sizes in rem; light first, dark follows the system.
   Palette: institutional credit-ledger ground, slate-blue actions, violet with a dashed outline
   reserved strictly for AI summaries and AI-drafted conditions, solid borders for human decisions. */
:root {
  --ground: #f4f6f9;
  --surface: #ffffff;
  --sunk: #e9edf3;
  --ink: #101e2d;
  --ink-2: #36495d;
  --ink-3: #52657a;
  --line: #c8d2de;
  --line-2: #dfe5ee;
  --action: #184b7c;
  --action-ink: #ffffff;
  --action-soft: #e2ecf7;
  --ai: #553c9a;
  --ai-soft: #efeafa;
  --wait: #9e6500;
  --wait-soft: #fcefd2;
  --wait-ink: #6b4300;
  --ok: #16653b;
  --ok-soft: #dff2e7;
  --bad: #9e2328;
  --bad-soft: #fce6e6;
  --grey-soft: #e6ebf2;
  --deep: #112233;
  --deep-ink: #eaf0f6;
  --deep-dim: #a8bacd;
  --deep-line: #253a50;
  --radius: .375rem;
  --shadow: 0 1px 2px rgba(16, 30, 45, .07), 0 6px 18px rgba(16, 30, 45, .07);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0c141d;
    --surface: #14202e;
    --sunk: #0f1924;
    --ink: #e7eef5;
    --ink-2: #b4c3d2;
    --ink-3: #8ca0b5;
    --line: #29394b;
    --line-2: #1e2c3b;
    --action: #78b3eb;
    --action-ink: #071a2c;
    --action-soft: #162d44;
    --ai: #c2b5ff;
    --ai-soft: #262042;
    --wait: #e3ad3b;
    --wait-soft: #38290d;
    --wait-ink: #f3d184;
    --ok: #6dd59c;
    --ok-soft: #143323;
    --bad: #ff9999;
    --bad-soft: #3d1c1e;
    --grey-soft: #1d2b3a;
    --deep: #091018;
    --deep-ink: #eaf0f6;
    --deep-dim: #9eb1c5;
    --deep-line: #1f3144;
    --shadow: 0 1px 2px rgba(0, 0, 0, .38), 0 6px 18px rgba(0, 0, 0, .32);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 1rem/1.55 var(--sans); }
h1, h2, h3 { font-weight: 650; line-height: 1.18; margin: 0; letter-spacing: -.015em; }
p { margin: 0; }
a { color: var(--action); text-underline-offset: .15em; }
code, .mono { font-family: var(--mono); font-size: .92em; font-variant-numeric: tabular-nums; }
:focus-visible { outline: .19rem solid var(--action); outline-offset: .15rem; border-radius: .2rem; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

.btn { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-weight: 600; cursor: pointer;
       padding: .6rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
       color: var(--ink); text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }

.mark { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.1rem;
        letter-spacing: -.01em; color: inherit; text-decoration: none; }
.mark svg { width: 1.65rem; height: 1.65rem; flex: none; }

/* Every chip carries a word; colour and border style reinforce it.
   AI-originated badges use a dashed border; human determinations use a solid one. */
.chip { display: inline-block; font-size: .75rem; font-weight: 600; line-height: 1; padding: .3rem .5rem;
        border-radius: .25rem; background: var(--grey-soft); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.chip.wait { background: var(--wait-soft); color: var(--wait-ink); border-color: transparent; }
.chip.go { background: var(--action-soft); color: var(--action); border-color: transparent; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.ai { background: var(--ai-soft); color: var(--ai); border: 1px dashed var(--ai); }

.demo-bar { background: var(--wait-soft); color: var(--wait-ink); font-size: .84rem; text-align: center;
            padding: .45rem 1rem; border-bottom: 1px solid var(--line); }
.demo-bar b { font-weight: 700; }
.demo-bar a { color: inherit; font-weight: 600; }
