/* PeakWright: one theme, stated explicitly. Canvas colors live in chart.mjs THEME
   and are kept in sync with the --trace-* and --ink tokens below by hand. */

:root {
  --paper:      #f4f5f2;   /* page ground, warm neutral like an instrument panel */
  --surface:    #ffffff;   /* cards, plot field */
  --surface-2:  #f8f9f6;   /* inset strips */
  --rule:       #d8dbd4;   /* hairlines */
  --rule-soft:  #e7e9e3;
  --ink:        #15181a;   /* body text */
  --ink-2:      #3d443f;
  --muted:      #5d635e;
  --faint:      #868c86;
  --accent:     #1b4f9c;   /* ink blue, matches TRACE_COLORS[0] */
  --accent-2:   #143b76;
  --accent-wash:#e8edf6;
  --alert:      #9c2e1b;
  --ok:         #1d7a5f;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --radius: 3px;
  --shell: 1100px;
}

* { box-sizing: border-box; }

/* The UA rule for [hidden] loses to any class that sets display, and several
   panels here are toggled with .hidden = true. Make the attribute win. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* Every number on screen is a readout: line the digits up. */
.num, td.num, .readout, table td, .kv dd { font-variant-numeric: tabular-nums; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(27, 79, 156, 0.3); }
a:hover { border-bottom-color: var(--accent); }

h1, h2, h3 { font-weight: 620; letter-spacing: -0.012em; line-height: 1.2; margin: 0; }

code, kbd, samp { font-family: var(--mono); font-size: 0.9em; }

kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
}

/* ---------------------------------------------------------------- *
 * Wordmark and site chrome
 * ---------------------------------------------------------------- */

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  border: 0;
  color: var(--ink);
  font-weight: 640;
  font-size: 17px;
  letter-spacing: -0.005em;
  text-transform: none;
}
.wordmark .mark { position: relative; padding-right: 1px; }
/* A baseline tick under the wordmark: the chromatogram, abbreviated. */
.wordmark .mark::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  height: 5px;
  background:
    linear-gradient(var(--accent), var(--accent)) left bottom / 100% 1px no-repeat,
    radial-gradient(6px 5px at 62% 100%, var(--accent) 0 42%, transparent 44%);
}
.wordmark .tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  border-left: 1px solid var(--rule);
  padding-left: 9px;
}

.topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.topbar .inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.topbar nav a {
  border: 0;
  color: var(--muted);
  font-size: 13.5px;
}
.topbar nav a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- *
 * Buttons
 * ---------------------------------------------------------------- */

.btn,
.btn-primary,
button,
select,
label.filebtn {
  font: inherit;
  font-size: 13.5px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 6px 11px;
  cursor: pointer;
  line-height: 1.4;
}
/* Links styled as buttons: cancel the underline the global `a` rule adds. */
.btn, .btn-primary { display: inline-block; text-decoration: none; }
button:hover, label.filebtn:hover, .btn:hover { border-color: var(--faint); background: var(--surface-2); }
button:disabled { opacity: 0.4; cursor: default; }
button:disabled:hover { border-color: var(--rule); background: var(--surface); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn-primary,
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 550;
  padding: 9px 18px;
  font-size: 14.5px;
}
.btn-primary:hover, button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

/* Nav links are muted by default; a button in the nav keeps its own chrome. */
.topbar nav a.btn, .topbar nav a.btn-primary { color: var(--ink); }
.topbar nav a.btn:hover { color: var(--ink); border-color: var(--faint); background: var(--surface-2); }

/* ---------------------------------------------------------------- *
 * Tables
 * ---------------------------------------------------------------- */

table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--surface);
}
table.grid th, table.grid td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
table.grid thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid td code { color: var(--ink); }

/* The only status a public table carries: a row is there because a real file
   proved it. Anything short of that does not get a row. */
.status-ok { color: var(--ok); }
