/* Pearl Lend — the counting-house desk.
 * Deep ledger green, brass fittings, cream paper ink, serif display type. */
:root {
  --bg: #08110c;
  --bg2: #0b1710;
  --panel: #0e1c13;
  --line: #24402e;
  --ink: #f0e9d6;      /* cream */
  --dim: #9db3a0;
  --brass: #d4a24e;    /* brass */
  --brass-dim: #8a6a30;
  --green: #7fd08a;
  --red: #ff7b7b;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --serif: Georgia, "Times New Roman", "Nimbus Roman", serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink);
  font-family: -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  background:
    radial-gradient(1100px 480px at 12% -5%, rgba(212,162,78,.08), transparent 60%),
    radial-gradient(900px 520px at 95% 5%, rgba(127,208,138,.05), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
.topbar {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between; padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line); background: rgba(11,23,16,.88);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px);
}
.brand { display: flex; gap: .8rem; align-items: center; }
.seal { width: 40px; height: 40px; color: var(--brass); }
.brand h1 { margin: 0; font-size: 1.4rem; letter-spacing: .03em; font-family: var(--serif); color: var(--brass); }
.tagline { margin: .15rem 0 0; color: var(--dim); font-size: .85rem; font-style: italic; font-family: var(--serif); }
.steps { display: flex; gap: .35rem; flex-wrap: wrap; }
.steps button {
  background: transparent; color: var(--dim); border: 1px solid var(--line);
  border-radius: 6px; padding: .4rem .7rem; font-size: .82rem; cursor: pointer;
}
.steps button.active { color: #0b1710; background: var(--brass); border-color: var(--brass); font-weight: 700; }
.steps button:disabled { opacity: .35; cursor: not-allowed; }
.steps button:not(:disabled):hover { border-color: var(--brass); color: var(--ink); }
main { max-width: 1060px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.panel {
  display: none; background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.25rem;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.panel.active { display: block; }
.panel h2 { margin: 0 0 .6rem; font-family: var(--serif); color: var(--brass); font-size: 1.5rem; letter-spacing: .02em; }
.panel h3 { font-family: var(--serif); color: var(--ink); margin: 1.4rem 0 .5rem; font-size: 1.1rem; }
.lede { color: var(--dim); line-height: 1.6; max-width: 70ch; }
.lede strong { color: var(--ink); }
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .8rem 1rem; margin: 1rem 0;
}
label { display: block; font-size: .85rem; color: var(--ink); font-weight: 600; }
label.wide { grid-column: 1 / -1; }
.hint { display: block; font-weight: 400; color: var(--dim); font-size: .75rem; margin-top: .15rem; }
input, select, textarea {
  width: 100%; margin-top: .3rem; padding: .55rem .65rem; font-size: .9rem;
  background: #060d09; color: var(--ink); border: 1px solid var(--line); border-radius: 7px;
  font-family: var(--mono);
}
input[type="number"] { font-family: var(--mono); }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 2px rgba(212,162,78,.25); }
.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; color: var(--dim); margin: .8rem 0; cursor: pointer; }
.check input { width: auto; margin-top: .2rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; margin: .9rem 0; }
button {
  font-size: .88rem; padding: .55rem 1.1rem; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: #12271a; color: var(--ink);
}
button.primary { background: var(--brass); border-color: var(--brass); color: #14100a; font-weight: 700; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.ghost:hover { border-color: var(--brass); }
button.armed { background: var(--red); border-color: var(--red); color: #1a0a0a; font-weight: 700; }
button:disabled { opacity: .4; cursor: not-allowed; }
.error {
  background: rgba(255,123,123,.1); border: 1px solid var(--red); color: #ffc9c9;
  border-radius: 8px; padding: .7rem .9rem; margin: .8rem 0; font-size: .88rem;
  white-space: pre-wrap; word-break: break-word;
}
.ok {
  background: rgba(127,208,138,.1); border: 1px solid var(--green); color: #d8f3dc;
  border-radius: 8px; padding: .7rem .9rem; margin: .8rem 0; font-size: .88rem; word-break: break-all;
}
.kv { display: grid; gap: .45rem; margin: 1rem 0; }
.kv > div { display: grid; grid-template-columns: 190px 1fr; gap: .8rem; align-items: baseline; }
.kv dt { color: var(--dim); font-size: .82rem; }
.kv dd { margin: 0; font-size: .9rem; word-break: break-all; }
code, .addr { font-family: var(--mono); font-size: .82rem; }
.addr { color: var(--brass); }
pre {
  background: #050b07; border: 1px solid var(--line); border-radius: 8px;
  padding: .8rem; overflow-x: auto; font-family: var(--mono); font-size: .78rem;
  line-height: 1.5; color: #cfe0d2; white-space: pre-wrap; word-break: break-all;
}
pre.asm { color: var(--brass); }
details { margin: .7rem 0; }
summary { cursor: pointer; color: var(--brass); font-size: .9rem; }
summary:hover { text-decoration: underline; }
.note {
  border-left: 3px solid var(--brass); padding: .5rem .9rem; color: var(--dim);
  font-size: .85rem; margin: 1rem 0; background: rgba(212,162,78,.06); border-radius: 0 8px 8px 0;
}
.limits ul { margin: .5rem 0; padding-left: 1.2rem; color: var(--dim); line-height: 1.65; font-size: .9rem; }
.limits li { margin-bottom: .55rem; }
.limits strong { color: var(--ink); }
.closegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 820px) { .closegrid { grid-template-columns: 1fr; } .kv > div { grid-template-columns: 1fr; } }
.verdict {
  font-family: var(--serif); font-size: 1.6rem; letter-spacing: .06em; text-align: center;
  padding: 1rem; border-radius: 10px; margin: 1rem 0; font-weight: 700;
}
.verdict.proven { background: rgba(127,208,138,.12); border: 2px solid var(--green); color: var(--green); }
.verdict.notproven { background: rgba(255,123,123,.1); border: 2px solid var(--red); color: var(--red); }
footer {
  max-width: 1060px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem;
  color: var(--dim); font-size: .85rem; border-top: 1px solid var(--line);
}
footer a { color: var(--brass); }
footer .fine { font-size: .78rem; }
footer code { color: var(--brass); word-break: break-all; }

/* Keyboard focus: a visible ring in this app's accent on every interactive element (fleet focus-visible pass). */
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* Skip link: the first Tab stop on the page — parked off-screen until keyboard focus reveals it (fleet skip-link pass). */
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 1000; padding: 10px 16px; border: 2px solid var(--brass); border-radius: 8px; background: #0b0e14; color: var(--brass); font-weight: 700; text-decoration: none; transition: top .15s ease; }
.skip-link:focus-visible { top: 12px; }
main:focus { outline: none; }

/* Reduced motion: when the OS asks for reduced motion, animations and transitions finish near-instantly and scrolling is not smoothed (fleet reduced-motion pass). Near-zero durations — not animation: none — so fade-ins still land on their end state and no content can be stranded invisible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
