/* Shared look of the Calibrex browser pages (app/index.html, app/check.html); matches the site theme. */
  :root {
    --bg: #f8fafc; --panel: #ffffff; --text: #0f172a; --muted: #475569; --line: #e2e8f0;
    --accent: #0d9488; --accent-text: #ffffff; --link: #0f766e; --pass: #15803d; --warn: #b45309; --fail: #b91c1c;
    --inconclusive: #64748b; --code: #f1f5f9; --header: #0f172a;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0b1120; --panel: #111a2e; --text: #e2e8f0; --muted: #94a3b8; --line: #243049;
      --accent: #2dd4bf; --accent-text: #04201c; --link: #2dd4bf; --pass: #22c55e; --warn: #f59e0b; --fail: #ef4444;
      --inconclusive: #64748b; --code: #0b1120; --header: #020617;
    }
  }
  :root[data-theme="dark"] {
    --bg: #0b1120; --panel: #111a2e; --text: #e2e8f0; --muted: #94a3b8; --line: #243049;
    --accent: #2dd4bf; --accent-text: #04201c; --link: #2dd4bf; --pass: #22c55e; --warn: #f59e0b; --fail: #ef4444;
    --inconclusive: #64748b; --code: #0b1120; --header: #020617;
  }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--bg); color: var(--text);
    font: 15px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
  .site-header { background: var(--header); color: #e2e8f0; }
  .site-header .bar { max-width: 980px; margin: 0 auto; padding: 12px 16px; display: flex;
    align-items: center; gap: 12px; flex-wrap: wrap; }
  .site-header img { height: 28px; width: 28px; }
  .site-header .brand { font-weight: 700; color: #fff; text-decoration: none; margin-right: auto; }
  .site-header a.nav { color: #cbd5e1; text-decoration: none; font-size: 0.9rem; }
  .site-header a.nav:hover { color: #2dd4bf; }
  main { max-width: 980px; margin: 0 auto; padding: 28px 16px 64px; }
  .intro h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.15; letter-spacing: -0.01em; }
  .intro p { margin: 0 0 8px; color: var(--muted); max-width: 46rem; }
  .privacy { display: inline-block; margin-top: 4px; padding: 3px 12px; border-radius: 999px; font-size: 0.82rem;
    font-weight: 600; background: var(--code); border: 1px solid var(--line); color: var(--text); }
  a { color: var(--link); }
  .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    padding: 20px; margin-top: 20px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
  .panel h2 { margin: 0 0 12px; font-size: 1.1rem; }
  .panel h3 { font-size: 1rem; margin: 22px 0 6px; }
  .quick { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 20px;
    padding: 16px 20px; border-radius: 12px; border: 1px solid var(--accent); background: var(--panel); }
  .quick p { margin: 0; color: var(--muted); flex: 1 1 260px; }
  .divider { margin: 18px 0 6px; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
  .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
  label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.92rem; }
  label.field span.hint { font-weight: 400; color: var(--muted); font-size: 0.84rem; }
  input[type=file], select { width: 100%; padding: 8px; border: 1px solid var(--line);
    border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
  .check { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
  .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
  button { font: inherit; border-radius: 8px; padding: 9px 18px; cursor: pointer;
    border: 1px solid var(--line); background: var(--panel); color: var(--text); }
  button:hover:not(:disabled) { border-color: var(--accent); }
  button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
  button.big { padding: 12px 22px; font-size: 1rem; }
  button:disabled { opacity: 0.55; cursor: not-allowed; }
  #log { font: 12.5px/1.45 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code);
    border-radius: 8px; padding: 10px; margin: 14px 0 0; max-height: 180px; overflow: auto; white-space: pre-wrap; }
  .badge { display: inline-block; padding: 2px 12px; border-radius: 999px; font-weight: 700;
    font-size: 0.8rem; color: #fff; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; margin-left: 6px; }
  .badge.pass { background: var(--pass); } .badge.warn { background: var(--warn); }
  .badge.fail { background: var(--fail); } .badge.inconclusive { background: var(--inconclusive); }
  .table-wrap { overflow-x: auto; }
  table { border-collapse: collapse; width: 100%; margin-top: 10px; font-size: 0.9rem; }
  th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  th { color: var(--muted); font-weight: 600; background: var(--code); }
  td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.85rem; }
  .reasons { color: var(--muted); margin: 6px 0 0; padding-left: 18px; }
  pre.matrix { font: 13px/1.5 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code);
    padding: 12px; border-radius: 8px; overflow-x: auto; }
  .muted { color: var(--muted); }
  code { background: var(--code); padding: 1px 5px; border-radius: 4px; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.88em; }
  #results[hidden] { display: none; }

/* ---- bag check page (app/check.html) ---- */
.site-header a.nav.current { color: #2dd4bf; }
.privacy.plan { border-color: var(--accent); }
.intro .pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 22px 16px; text-align: center;
  background: var(--bg); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--code); }
.dropzone p { margin: 0 0 10px; color: var(--muted); }
.dropzone strong { color: var(--text); }
.dropzone input[type=file] { display: none; }
.files { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.files li { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--code); font-size: 0.82rem; }
.files li code { background: none; padding: 0; }
.files li .size { color: var(--muted); }
.files li button.x { border: 0; background: none; padding: 0 2px; color: var(--muted); font-size: 1rem; line-height: 1; }
.files li button.x:hover { color: var(--fail); }
input[type=text], textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: 13.5px/1.5 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
textarea { resize: vertical; min-height: 64px; }
input:focus-visible, textarea:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }
details.opt { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.opt > summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
details.opt[open] > summary { margin-bottom: 12px; }
.note { font-size: 0.85rem; color: var(--muted); margin: 6px 0 0; }
.error { margin-top: 14px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--fail);
  color: var(--fail); background: var(--code); white-space: pre-wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 8px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--bg); }
.stat .n { font-size: 1.7rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 0.82rem; }
.stat.ok .n { color: var(--pass); }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap; }
.pill.planned { color: var(--pass); border-color: var(--pass); }
.pill.skipped { color: var(--muted); border-color: var(--line); background: var(--code); }
.pill.action { color: var(--warn); border-color: var(--warn); }
.pill.role { color: var(--link); border-color: var(--line); background: var(--code); }
.pill.source { color: var(--muted); border-color: var(--line); font-weight: 400; }
td.wrap, th.wrap { white-space: normal; min-width: 280px; }
.nowrap { white-space: nowrap; }
td.mono, td .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.84rem; }
td.dim { color: var(--muted); }
ul.tree, ul.tree ul { list-style: none; margin: 0; padding-left: 20px; border-left: 1px solid var(--line); }
ul.tree { border-left: 0; padding-left: 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.86rem; }
ul.tree li { margin: 3px 0; padding-left: 10px; position: relative; }
ul.tree ul li::before { content: ""; position: absolute; left: -1px; top: 0.85em; width: 8px; border-top: 1px solid var(--line); }
ul.tree .frame { font-weight: 500; }
ul.tree .xyz, ul.tree .topics { color: var(--muted); font-size: 0.8rem; margin-left: 8px; }
ul.tree .topics { color: var(--link); }
.sources { margin: 0; padding-left: 18px; }
.sources li { margin: 4px 0; }
.codebox { position: relative; }
.codebox pre { margin: 0; padding: 12px 84px 12px 12px; background: var(--code); border-radius: 8px;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all; font: 13px/1.5 "JetBrains Mono", ui-monospace, monospace; }
.codebox button { position: absolute; top: 8px; right: 8px; padding: 3px 12px; font-size: 0.82rem; }
.callout { margin-top: 14px; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--code);
  border-radius: 0 8px 8px 0; }
.callout p { margin: 0; }
.callout p + p { margin-top: 6px; }
#results[hidden], [hidden] { display: none !important; }
@media (max-width: 560px) { .codebox pre { padding-right: 12px; padding-top: 40px; } }

/* run in the browser */
.pairset { margin: 14px 0 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.pairset legend { padding: 0 6px; font-weight: 600; font-size: 0.92rem; }
.pairset .choice { display: block; padding: 3px 0; font-weight: 400; }
#run-panel select, #run-panel input[type=number] { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
.progress { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar.thin { height: 5px; margin-top: 8px; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.prog-line { margin: 8px 0 0; font-weight: 600; }
.prog-done { list-style: none; margin: 8px 0 0; padding: 0; font-size: 0.88rem; }
.prog-done li { padding: 2px 0; }
.pill.pass { color: var(--pass); border-color: var(--pass); }
.pill.warn { color: var(--warn); border-color: var(--warn); }
.pill.fail, .pill.failed { color: var(--fail); border-color: var(--fail); }
.pill.inconclusive { color: var(--inconclusive); border-color: var(--inconclusive); }
.verdict-pass { color: var(--pass); } .verdict-warn { color: var(--warn); } .verdict-fail { color: var(--fail); } .verdict-inconclusive { color: var(--inconclusive); }
.report { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 10px; resize: vertical; }
.textout { max-height: 480px; overflow: auto; font: 12.5px/1.45 "JetBrains Mono", ui-monospace, monospace; background: var(--code); padding: 12px; border-radius: 8px; }
.codeline { overflow-x: auto; margin: 8px 0 0; }
