/* One hand-written stylesheet. No build step, no framework, no compile.
   Light and dark both supported via prefers-color-scheme. */

/* ONYX — black, white, purple.
   Royal purple is the house colour and the only one with a job: it marks what is active,
   selected or pressable, never decoration. Semantic colour (oxblood / amber / green) is
   separate and small, so "this is wrong" never competes with "this is a button".
   Depth comes from a light source: a layered shadow BELOW plus a 1px highlight along the
   TOP edge of anything raised. That is what reads as glossy, rather than gradients. */

:root {
  --bg: #f4f2f7;
  --panel: #ffffff;
  --panel-2: #f7f6fa;
  --ink: #14121a;
  --ink-soft: #5c5670;
  --ink-faint: #8e879f;
  --line: #e6e3ed;
  --line-2: #d3cfdd;

  --accent: #7c3aed;
  --accent-2: #a78bfa;
  --accent-deep: #5b21b6;
  --accent-ink: #ffffff;
  --accent-soft: #f3efff;
  --accent-line: #ded2ff;
  --accent-glow: rgba(124, 58, 237, 0.32);

  --onyx: #0d0b12;
  --onyx-2: #1a1722;
  --onyx-3: #272233;

  --warn-bg: #fdf3e0;
  --warn-line: #e8c37a;
  --warn-ink: #8a6100;
  --err-bg: #fdecea;
  --err-line: #eab5b0;
  --err-ink: #b3261e;
  --ok-bg: #e5f4ec;
  --ok-line: #a8d7bd;
  --ok-ink: #137a4b;

  /* the gloss kit */
  --edge: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --edge-dark: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  --sheen: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0) 42%);
  --lift-1: 0 1px 1px rgba(16,10,32,.05), 0 2px 4px rgba(16,10,32,.05);
  --lift-2: 0 2px 4px rgba(16,10,32,.07), 0 10px 24px rgba(16,10,32,.09);
  --lift-3: 0 4px 10px rgba(16,10,32,.10), 0 24px 60px rgba(16,10,32,.16);

  --serif: ui-serif, Georgia, "Iowan Old Style", serif;
  --radius: 10px;
  --radius-sm: 7px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08070b;
    --panel: #131019;
    --panel-2: #1a1622;
    --ink: #f0edf6;
    --ink-soft: #a49dba;
    --ink-faint: #7a7291;
    --line: #241f30;
    --line-2: #332c44;

    --accent: #a78bfa;
    --accent-2: #c4b5fd;
    --accent-deep: #8b5cf6;
    --accent-ink: #14101f;
    --accent-soft: #241a3f;
    --accent-line: #3d3163;

    --warn-bg: #2a2113; --warn-line: #6b5220; --warn-ink: #e0b155;
    --err-bg: #2c1614;  --err-line: #6b2b2b;  --err-ink: #f4877e;
    --ok-bg: #12271c;   --ok-line: #2c5a41;   --ok-ink: #6fca97;

    --edge: var(--edge-dark);
    --sheen: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0) 45%);
    --lift-1: 0 1px 1px rgba(0,0,0,.5);
    --lift-2: 0 2px 6px rgba(0,0,0,.5), 0 12px 30px rgba(0,0,0,.45);
    --lift-3: 0 6px 14px rgba(0,0,0,.55), 0 30px 70px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 460px at 10% -6%, rgba(124, 58, 237, 0.07), transparent 62%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The workspace is a raised white sheet on the tinted ground, not the ground itself. */
main {
  max-width: 68rem; margin: 1.5rem auto 4rem; padding: 1.9rem 1.9rem 3rem;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--lift-2), var(--edge);
}
main.narrow { max-width: 27rem; padding: 1.75rem; }
@media (max-width: 46rem) {
  main { margin: 0; border-radius: 0; border-left: 0; border-right: 0; padding: 1.4rem 1.1rem 3rem; }
}

/* Serif for names and headings: it is what makes this read as a firm's system rather than a
   generic admin panel. Body stays sans, because that is what gets read all day. */
h1 {
  font-family: var(--serif); font-size: 1.75rem; font-weight: 600;
  letter-spacing: -0.022em; line-height: 1.15; margin: 0 0 1rem; text-wrap: balance;
}
h2 {
  font-family: var(--serif); font-size: 1.22rem; font-weight: 600;
  letter-spacing: -0.015em; margin: 2rem 0 .6rem;
}
h3 { font-size: 1rem; font-weight: 620; letter-spacing: -0.008em; margin: 1.4rem 0 .4rem; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.muted { color: var(--ink-soft); }
small { color: var(--ink-soft); display: block; font-size: 0.82rem; margin-top: 0.15rem; }

/* ---- top bar: THE BLACK ----
   Glossy obsidian with a violet bloom off the top left. It is the one dark surface, which is
   what makes the white workspace below it read as paper rather than as the default background. */
.topbar {
  position: relative;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.72rem 1.25rem;
  background:
    radial-gradient(420px 180px at 8% -40%, rgba(124, 58, 237, 0.55), transparent 70%),
    linear-gradient(180deg, var(--onyx-2), var(--onyx));
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.07), var(--lift-2);
  color: #e8e4f2;
}
.topbar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0) 45%);
}
.topbar > * { position: relative; }
.brand {
  font-family: var(--serif); font-weight: 600; font-size: 1.02rem;
  text-decoration: none; color: #fff; letter-spacing: -0.018em;
}
.topbar nav { display: flex; gap: 0.2rem; flex-wrap: wrap; }
.topbar nav a {
  color: #a9a2bd; text-decoration: none; font-size: 0.88rem;
  padding: 0.32rem 0.6rem; border-radius: var(--radius-sm);
  transition: background .16s, color .16s;
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
/* The one nav item that is not an ordinary section. */
.topbar nav a.nav-platform {
  color: #fff; font-weight: 580;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: var(--edge-dark), 0 2px 8px var(--accent-glow);
}
.topbar nav a.nav-platform:hover { filter: brightness(1.08); background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.85rem; font-size: 0.9rem; }
.tenant { color: #a9a2bd; }
.topbar .chip { border-color: rgba(255,255,255,.18); }
.topbar button.linklike { color: #a9a2bd; }
.topbar button.linklike:hover { color: #fff; }
@media (max-width: 40rem) {
  .topbar { flex-wrap: wrap; gap: .6rem; }
  .topbar nav { order: 3; width: 100%; }
}

/* ---- forms ---- */
.stack { display: flex; flex-direction: column; gap: 1rem; }
label { display: block; font-size: 0.9rem; font-weight: 520; }
input, select, textarea {
  display: block; width: 100%; margin-top: 0.3rem;
  padding: 0.5rem 0.6rem;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(16,10,32,.06);
  transition: border-color .18s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), inset 0 1px 2px rgba(16,10,32,.05);
}

button, .button {
  font: inherit; cursor: pointer;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink);
  text-decoration: none; display: inline-block;
  box-shadow: var(--lift-1), var(--edge);
  transition: transform .15s, box-shadow .22s, filter .2s;
}
button:hover, .button:hover { transform: translateY(-1px); box-shadow: var(--lift-2), var(--edge); }
button:active, .button:active { transform: translateY(0); }
button.primary, .button.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff; border-color: transparent; font-weight: 600;
  box-shadow: var(--edge-dark), 0 2px 5px var(--accent-glow), 0 8px 20px rgba(91,33,182,.20);
}
button.primary:hover, .button.primary:hover {
  filter: brightness(1.06);
  box-shadow: var(--edge-dark), 0 4px 10px var(--accent-glow), 0 14px 32px rgba(91,33,182,.28);
}
button.linklike {
  background: none; border: none; padding: 0; color: var(--ink-soft);
  text-decoration: underline; box-shadow: none;
}
button.linklike:hover { transform: none; box-shadow: none; color: var(--ink); }

/* ---- alerts ---- */
.alert {
  padding: 0.8rem 1rem; border-radius: var(--radius); border: 1px solid var(--line);
  margin-bottom: 1.25rem; background: var(--panel);
  box-shadow: var(--lift-1), var(--edge);
  border-left-width: 3px; border-left-color: var(--accent);
}
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-error { background: var(--err-bg); border-color: var(--err-line); border-left-color: var(--err-ink); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-line); border-left-color: var(--warn-ink); }

.chip {
  display: inline-block; padding: 0.1rem 0.45rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-soft);
  box-shadow: var(--edge); text-decoration: none;
}
.chip-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }

/* ---- tiles: the figures, and they lift ---- */
.tiles { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.25rem 0; }
.tile {
  position: relative; overflow: hidden;
  flex: 1 1 9rem; padding: 0.85rem 1rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 0.15rem;
  box-shadow: var(--lift-1), var(--edge);
  transition: transform .2s, box-shadow .25s, border-color .2s;
}
.tile::before { content: ""; position: absolute; inset: 0; background: var(--sheen); pointer-events: none; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--lift-2), var(--edge); border-color: var(--accent-line); }
.tile > * { position: relative; }
.tile-n {
  font-family: var(--serif); font-size: 1.62rem; font-weight: 600;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.tile-l { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.11em; color: var(--ink-faint); font-weight: 700; }

/* ---- tabs (pure CSS: radios drive which panel shows, no JS) ---- */
.tabs .tab-radio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tab-nav {
  display: flex; gap: 0.15rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin: 1.5rem 0 1.75rem;
}
.tab-nav label {
  padding: 0.55rem 1rem; cursor: pointer; font-size: 0.94rem; font-weight: 540;
  color: var(--ink-soft); border: 1px solid transparent; border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0; margin-bottom: -1px; user-select: none;
}
.tab-nav label:hover { color: var(--ink); }
.tab-count {
  display: inline-block; margin-left: 0.35rem; padding: 0 0.4rem;
  font-size: 0.72rem; font-weight: 600; color: var(--ink-soft);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
}
.tab-panel { display: none; }

#tab-overview:checked  ~ .tab-nav label[for="tab-overview"],
#tab-record:checked    ~ .tab-nav label[for="tab-record"],
#tab-accounts:checked  ~ .tab-nav label[for="tab-accounts"],
#tab-paperwork:checked ~ .tab-nav label[for="tab-paperwork"],
#tab-documents:checked ~ .tab-nav label[for="tab-documents"] {
  color: var(--ink); background: var(--panel);
  border-color: var(--line); border-bottom-color: var(--panel); font-weight: 600;
}
#tab-overview:checked  ~ .tab-panels .tab-panel[data-tab="overview"],
#tab-record:checked    ~ .tab-panels .tab-panel[data-tab="record"],
#tab-accounts:checked  ~ .tab-panels .tab-panel[data-tab="accounts"],
#tab-paperwork:checked ~ .tab-panels .tab-panel[data-tab="paperwork"],
#tab-documents:checked ~ .tab-panels .tab-panel[data-tab="documents"] { display: block; }

/* keyboard focus lands on the hidden radio -- reflect it on the visible label */
.tab-radio:focus-visible ~ .tab-nav label[for="tab-overview"],
.tab-radio:focus-visible ~ .tab-nav label[for="tab-record"],
.tab-radio:focus-visible ~ .tab-nav label[for="tab-accounts"],
.tab-radio:focus-visible ~ .tab-nav label[for="tab-paperwork"],
.tab-radio:focus-visible ~ .tab-nav label[for="tab-documents"] { outline: 2px solid var(--accent); outline-offset: 2px; }

/* outcome chips on the track record */
/* Semantic chips, on tokens so both themes come from one place. There used to be two competing
   .chip-ok rules with different hardcoded greens; the later one silently won. */
.chip-ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.chip-info { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-line); }
/* The per-theme overrides that used to live here are gone: the tokens above already carry both
   themes, so a second set of hardcoded values could only ever drift out of step with them. */

/* record-a-dispute capture form on the track record */
.record-add { margin:.4rem 0 1.6rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); }
.record-add summary { cursor:pointer; padding:.6rem .9rem; font-weight:560; color:var(--accent); list-style:none; }
.record-add summary::-webkit-details-marker { display:none; }
.record-add[open] summary { border-bottom:1px solid var(--line); }
.record-add form { padding:0 .9rem 1rem; }

/* the "get your reports" option buttons — show every route at once */
.report-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:.6rem; margin-top:.8rem; }
.report-options .button { display:flex; flex-direction:column; align-items:flex-start; text-align:left; gap:.15rem; padding:.75rem .95rem; height:100%; }
.report-options .button small { margin-top:0; }

pre.secret {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.7rem 0.85rem; font-size: 1rem; letter-spacing: 0.08em;
  overflow-x: auto; word-break: break-all; white-space: pre-wrap;
}

/* ---- layout helpers ---- */
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.right { text-align: right; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pair3 { display: grid; grid-template-columns: 2fr 0.6fr 1fr; gap: 1rem; }
@media (max-width: 32rem) { .pair, .pair3 { grid-template-columns: 1fr; } }

section { margin: 2rem 0; padding-top: 1.25rem; border-top: 1px solid var(--line); }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.75rem; }

select, textarea {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.5rem 0.6rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); font: inherit;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }

.checklist { list-style: none; padding: 0; margin: 0.5rem 0; }
.checklist li { padding: 0.3rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }

.alert-ok { background: var(--ok-bg); border-color: var(--ok-line); border-left-color: var(--ok-ink); }

code.tiny { font-size: 0.78rem; color: var(--ink-soft); }

.account {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.85rem 1rem; margin-bottom: 0.85rem; background: var(--panel);
}
.inline-form { margin-top: 0.6rem; display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form label.inline { flex: 1 1 18rem; }
.inline-form small { flex-basis: 100%; }

details { margin: 0.5rem 0; }
summary { cursor: pointer; color: var(--ink-soft); font-size: 0.9rem; }

/* ---- consumer portal: plainer, larger, no operator chrome ---- */
main.portal { max-width: 42rem; font-size: 16px; }
.portal-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem;
}
.steps { list-style: none; padding: 0; margin: 0 0 1.75rem; display: flex; flex-wrap: wrap; gap: 0.85rem; }
.steps li { font-size: 0.88rem; color: var(--ink-soft); }
.steps li.done { color: var(--ink); }
.doc { margin-bottom: 1.5rem; }
.doc-body {
  white-space: pre-wrap; word-wrap: break-word;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; font: inherit; line-height: 1.6; max-height: 26rem; overflow-y: auto;
}
label.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 0.25rem; }
.signout { margin-top: 2.5rem; }

/* Wide content scrolls inside its own container; the page body never scrolls sideways. */
.scroll-x { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
th { color: var(--ink-soft); font-weight: 560; }

/* ---- consumer-protection area ----
   These services are not credit repair, and the UI says so before the operator reads a word: its own
   bar, its own accent. Keeping the two worlds visually apart is a compliance habit, not decoration --
   it is harder to describe one service in the other's language when they never share a screen. */
.protection-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .25rem;
  margin: -0.5rem 0 1.5rem; padding: .5rem .75rem;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid #0e7490; border-radius: var(--radius);
}
.protection-mark {
  font-size: .7rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em;
  color: #0e7490; margin-right: .75rem;
}
.protection-bar a {
  padding: .25rem .6rem; border-radius: 999px; text-decoration: none;
  font-size: .88rem; color: var(--ink-soft);
}
.protection-bar a:hover { color: var(--ink); }
.protection-bar a.on { background: #0e7490; color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .protection-bar { border-left-color: #22d3ee; }
  :root:not([data-theme="light"]) .protection-mark { color: #22d3ee; }
  :root:not([data-theme="light"]) .protection-bar a.on { background: #22d3ee; color: #10202a; }
}
:root[data-theme="dark"] .protection-bar { border-left-color: #22d3ee; }
:root[data-theme="dark"] .protection-mark { color: #22d3ee; }
:root[data-theme="dark"] .protection-bar a.on { background: #22d3ee; color: #10202a; }

/* ---- PHONE ----
   Measured, not guessed: at 390px every page scrolled sideways (document 666px), because the top bar
   is a single non-wrapping row of six links. The practical consequence was worse than untidy —
   Settings and Sign out sat off the right edge and could not be reached at all.

   Three fixes, in order of how much they mattered:
     1. the bar wraps, and the nav takes its own full-width row, so every destination is reachable;
     2. wide tables get a min-width INSIDE their .scroll-x box, so the TABLE scrolls instead of the
        whole page -- `width: 100%` alone just crushes the columns and pushes the document wide;
     3. inputs go to 16px, because iOS Safari zooms the viewport whenever a focused field is smaller,
        which is most of the "it feels glitchy" on a phone. */
@media (max-width: 40rem) {
  main { padding: 1.25rem 0.9rem 3rem; }
  h1 { font-size: 1.25rem; }

  .topbar { flex-wrap: wrap; gap: 0.4rem 0.9rem; padding: 0.6rem 0.9rem; }
  .brand { white-space: nowrap; font-size: 1rem; }
  .topbar-right { margin-left: auto; gap: 0.6rem; font-size: 0.85rem; }
  .topbar nav { order: 3; width: 100%; flex-wrap: wrap; gap: 0.5rem 0.95rem; padding-top: 0.15rem; }
  .topbar nav a { font-size: 0.9rem; }

  /* The table scrolls; the page does not. */
  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .scroll-x table { min-width: 34rem; }

  /* Long unbroken strings -- portal links, letters -- must wrap rather than widen the page. */
  pre.secret, pre.doc-body { white-space: pre-wrap; word-break: break-word; }

  /* iOS zooms on focus below 16px. */
  input, select, textarea { font-size: 16px; }

  .tab-nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-nav label { white-space: nowrap; padding: 0.5rem 0.75rem; }

  .tile { flex: 1 1 7.5rem; }
  .inline-form { gap: 0.4rem; }
}
