/* Sentry Init - one stylesheet, both themes, no external fonts. */

:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2330;
  --ink: #e6edf3;
  --ink-dim: #9aa7b4;
  --line: #2a3441;
  --accent: #4c9aff;
  --accent-ink: #08131f;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --crit: #ff7b72;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 10px;
}

:root[data-theme="light"] {
  --bg: #f6f8fa;
  --panel: #ffffff;
  --panel2: #f0f3f6;
  --ink: #1f2328;
  --ink-dim: #5b6570;
  --line: #d8dee4;
  --accent: #0969da;
  --accent-ink: #ffffff;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #cf222e;
  --crit: #a40e26;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

code, pre, .mono { font-family: var(--mono); }
.mono { font-size: 0.92em; }
.small { font-size: 0.85em; }
.muted { color: var(--ink-dim); }
.hidden { display: none !important; }

a { color: var(--accent); }
a:hover { text-decoration: underline; }

/* --- top bar ------------------------------------------------------------- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand .sep { color: var(--ink-dim); }
.backlink { text-decoration: none; }
.topactions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.credits { font-family: var(--mono); font-size: 0.85em; color: var(--ink-dim); }
.topup {
  font-size: 0.85em;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
}

/* --- buttons -------------------------------------------------------------- */

button { font-family: inherit; font-size: 1em; cursor: pointer; }

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 11px;
}
.ghost:hover { background: var(--panel2); }

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-weight: 600;
}
.primary:disabled { opacity: 0.45; cursor: not-allowed; }

.big {
  background: var(--panel2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
}
.big:hover { border-color: var(--accent); }

.mini {
  background: var(--panel2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85em;
}
.mini:hover { border-color: var(--accent); }

.linkish {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
}

/* --- layout ---------------------------------------------------------------- */

main { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }

.hero h1 { font-size: 1.9rem; line-height: 1.25; margin: 18px 0 10px; }
.lede { font-size: 1.05rem; color: var(--ink); max-width: 74ch; }
.herobtns { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 18px 0;
}
.card h2 { font-size: 1.15rem; margin: 0 0 10px; }
.card h3 { font-size: 1.05rem; margin: 0 0 10px; }
.count {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 9px;
  margin-left: 6px;
}

.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; }
.labelrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.labelrow label { font-weight: 600; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row .field { flex: 1 1 240px; }

textarea, select, input[type="file"] {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.5;
}
select { font-family: var(--sans); font-size: 0.95rem; }
textarea { resize: vertical; }
textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.dropzone { border: 1px dashed transparent; border-radius: 10px; transition: border-color 0.15s, background 0.15s; }
.dropzone.dragging { border-color: var(--accent); background: rgba(76, 154, 255, 0.06); }
.droprow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.droprow input[type="file"] { width: auto; flex: 0 1 auto; font-size: 0.8rem; padding: 4px; }

.runrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }

.rungate {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--warn);
  border-radius: 8px;
  background: rgba(210, 153, 34, 0.08);
  font-size: 0.92em;
}
.gateaction { font-weight: 600; cursor: pointer; }

/* --- prescan ---------------------------------------------------------------- */

.prescan {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel2);
  margin-bottom: 14px;
}
.prescan h2 { font-size: 1rem; }
.flaglist { list-style: none; padding: 0; margin: 8px 0 0; }
.flaglist li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 0.92em; }
.flaglist li:first-child { border-top: none; }
.flagid {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
  margin-right: 6px;
  font-size: 0.82em;
  color: var(--ink-dim);
}

/* --- progress ----------------------------------------------------------------- */

.progresshead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.steps { list-style: none; padding: 0; margin: 12px 0 0; }
.step { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: var(--ink-dim); }
.step-ic {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--line); flex: 0 0 auto;
}
.step.done { color: var(--ink); }
.step.done .step-ic { background: var(--ok); border-color: var(--ok); }
.step.live { color: var(--ink); }
.step.live .step-ic { border-color: var(--accent); background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* --- result ---------------------------------------------------------------------- */

.resulthead h2 { font-size: 1.35rem; }
.verdict {
  font-size: 1.03rem;
  border-left: 3px solid var(--line);
  padding-left: 12px;
  margin: 10px 0;
}
.verdict.posture-hardened { border-left-color: var(--ok); }
.verdict.posture-needs-hardening { border-left-color: var(--warn); }
.verdict.posture-exposed { border-left-color: var(--bad); }

.sdkstrip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
}
.sdkbox { display: flex; flex-direction: column; min-width: 78px; }
.sdkbox strong { font-size: 1.25rem; }
.sdkarrow { color: var(--ink-dim); font-size: 1.3rem; }

.prose p { margin: 10px 0; }
.delta {
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(76, 154, 255, 0.07);
  font-size: 0.92em;
}
.warnline {
  border: 1px solid var(--warn);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(210, 153, 34, 0.09);
}
.warnline ul { margin: 6px 0 0; padding-left: 18px; }
.warnline li { margin: 2px 0; word-break: break-word; }

/* --- settings patch table ---------------------------------------------------------- */

.patchwrap { margin: 10px 0; }
.patch td { vertical-align: top; }
.patch td.mono { white-space: nowrap; }
.patch td:nth-child(3), .patch td:nth-child(4) {
  min-width: 180px;
  word-break: break-word;
  white-space: pre-wrap;
}
.patch td:nth-child(4) { color: var(--ok, var(--ink)); }

/* --- hops -------------------------------------------------------------------------- */

.hop { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--panel2); }
.hop-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hop-badge {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 8px;
  font-weight: 600;
}
.hop-theme { font-weight: 600; }
.hop ul { margin: 8px 0 0; padding-left: 22px; }
.hop ul.watch { color: var(--ink-dim); }

/* --- findings ------------------------------------------------------------------------ */

.finding {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--panel2);
}
.finding.pri-critical { border-left-color: var(--crit); }
.finding.pri-high { border-left-color: var(--bad); }
.finding.pri-medium { border-left-color: var(--warn); }
.finding.pri-low { border-left-color: var(--line); }
.finding header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.fid { font-weight: 700; }
.fres { color: var(--ink-dim); font-size: 0.88em; }
.ftags { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.tag {
  font-family: var(--mono);
  font-size: 0.74em;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 8px;
  color: var(--ink-dim);
  white-space: nowrap;
}
.finding p { margin: 7px 0; }

.tag.ctl-present { color: var(--ok); border-color: var(--ok); }
.tag.ctl-weak { color: var(--warn); border-color: var(--warn); }
.tag.ctl-missing { color: var(--bad); border-color: var(--bad); }
.tag.ctl-unknown { color: var(--ink-dim); }
.snipwrap { position: relative; margin-top: 10px; }
.snipwrap .mini { position: absolute; top: 6px; right: 6px; }
pre.snippet, pre.bigpre {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre;
  margin: 0;
}
pre.bigpre { max-height: 480px; overflow-y: auto; }

/* --- coverage ----------------------------------------------------------------------- */

.covlist { list-style: none; padding: 0; margin: 8px 0 0; }
.covlist li { padding: 5px 0; border-top: 1px solid var(--line); font-size: 0.9em; }
.covlist li:first-child { border-top: none; }
.covmark { display: inline-block; width: 20px; font-weight: 700; }
.covmark.yes { color: var(--ok); }
.covmark.no { color: var(--warn); }
.covmark.missed { color: var(--bad); }
.covnote { color: var(--ink-dim); }

/* --- inventory ------------------------------------------------------------------------ */

.tablewrap { overflow-x: auto; }
table.inv { width: 100%; border-collapse: collapse; font-size: 0.9em; min-width: 560px; }
table.inv th, table.inv td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.inv th { color: var(--ink-dim); font-weight: 600; font-size: 0.85em; }

.focus { padding: 7px 0; border-top: 1px solid var(--line); }
.focus:first-child { border-top: none; }

.exportrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

/* --- history ------------------------------------------------------------------------- */

.history { list-style: none; padding: 0; margin: 0 0 10px; }
.history li { border-top: 1px solid var(--line); }
.history li:first-child { border-top: none; }
.histbtn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--ink);
  padding: 9px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.histbtn:hover { background: var(--panel2); }
.histtitle { font-weight: 600; }
.histmeta { color: var(--ink-dim); }
.histload { margin: 0 0 10px 4px; }

.explain p { max-width: 78ch; }

/* --- footer + toasts -------------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 20px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.9em;
}
.foot p { margin: 6px 0; max-width: 80ch; margin-left: auto; margin-right: auto; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(440px, calc(100vw - 32px)); }
.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  font-size: 0.92em;
  transition: opacity 0.5s;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--bad); }
.toast.gone { opacity: 0; }
.toast a { margin-left: 8px; font-weight: 600; }

/* --- docs pages ---------------------------------------------------------------------- */

.doc { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
.doc h1 { font-size: 1.7rem; }
.doc h2 { font-size: 1.2rem; margin-top: 30px; }
.doc h3 { font-size: 1rem; margin-top: 22px; }
.doc p, .doc li { max-width: 80ch; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.9em; margin: 12px 0; }
.doc th, .doc td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--ink-dim); }
.doc code { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 0.88em; }
.doc pre code { background: none; border: none; padding: 0; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0 0; }
.tab {
  background: var(--panel2);
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 5px 12px;
  font-size: 0.85em;
}
.tab.active { background: var(--bg); color: var(--ink); font-weight: 600; }
.codegroup pre { border-radius: 0 8px 8px 8px; margin-top: 0; }
.codegroup pre[hidden] { display: none; }

.tokenrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.tokenbox {
  flex: 1 1 320px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 0.85rem;
  word-break: break-all;
  min-height: 44px;
}
.statebox { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--panel2); margin: 12px 0; }

@media (max-width: 620px) {
  .hero h1 { font-size: 1.5rem; }
  .ftags { margin-left: 0; }
  main, .doc { padding: 16px 14px 48px; }
}

@media print {
  .topbar, .toasts, .exportrow, form, .prescan, #progressPanel, #historyZone, .herobtns, .foot { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border-color: #ccc; break-inside: avoid; }
}

/* --- Py Shift additions ---------------------------------------------------------
 *
 * The shared shell above is unchanged; these are the classes this app's markup
 * introduces on top of it: the posture verdict, the check-status and step
 * badges, the prescan resource list and the per-flag reconciliation states. */

.verdict.rd-modern { border-left-color: var(--ok); }
.verdict.rd-partial { border-left-color: var(--warn); }
.verdict.rd-legacy { border-left-color: var(--bad); }

.findhead {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.findhead code { font-weight: 700; }
.findhead strong { font-size: 0.95em; }
.flabel { color: var(--ink-dim); font-weight: 600; }

.badge {
  font-family: var(--mono);
  font-size: 0.74em;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 8px;
  color: var(--ink-dim);
  white-space: nowrap;
}
.badge.st-pass { color: var(--ok); border-color: var(--ok); }
.badge.st-fail { color: var(--bad); border-color: var(--bad); }
.badge.st-partial { color: var(--warn); border-color: var(--warn); }
.badge.st-unknown { color: var(--ink-dim); }
.badge.b-priority.v-critical { color: var(--crit); border-color: var(--crit); }
.badge.b-priority.v-high { color: var(--bad); border-color: var(--bad); }
.badge.b-priority.v-medium { color: var(--warn); border-color: var(--warn); }
.badge.b-risk.v-high, .badge.b-effort.v-high { color: var(--bad); border-color: var(--bad); }
.badge.b-risk.v-medium, .badge.b-effort.v-medium { color: var(--warn); border-color: var(--warn); }
.badge.b-phase { color: var(--accent); border-color: var(--line); }
.badge.diff-still-open { color: var(--warn); border-color: var(--warn); }
.badge.diff-new { color: var(--accent); border-color: var(--accent); }

.reslist { list-style: none; padding: 0; margin: 8px 0 0; }
.reslist li {
  padding: 5px 0;
  border-top: 1px solid var(--line);
  font-size: 0.88em;
  color: var(--ink-dim);
}
.reslist li:first-child { border-top: none; }

.covlist li.cov-ok code { color: var(--ok); }
.covlist li.cov-aside code { color: var(--warn); }
.covlist li.cov-missed code { color: var(--bad); }
.covlist li.cov-missed { color: var(--ink); }

.focusitem { padding: 9px 0; border-top: 1px solid var(--line); }
.focusitem:first-child { border-top: none; }
.focusitem p { margin: 5px 0 0; color: var(--ink-dim); }
.focusitem code { font-size: 0.8em; color: var(--ink-dim); }

.history li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 2px;
}
.history li .mini { margin-left: auto; }

/* ---- NB Shift: lanes, results, tables ------------------------------------ */

.lanebar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-end;
  padding: 12px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.lanegroup { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lanestage {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.lanegroup > .lane + .lane { margin-left: 0; }
.lanegroup { flex-direction: row; align-items: center; flex-wrap: wrap; }
.lanegroup .lanestage { width: 100%; }
.lane {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.lane:hover { border-color: var(--accent); }
.lane[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}
.lanetag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 2px 9px;
  margin-bottom: 8px;
}

.warn {
  border-left: 3px solid var(--warn);
  background: var(--panel2);
  padding: 9px 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  margin: 10px 0 0;
}
.gate {
  border-left: 3px solid var(--bad);
  background: var(--panel2);
  padding: 9px 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  margin: 10px 0 0;
}
.rowbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.progress { border-left: 3px solid var(--accent); }
.result .reshead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.result h2 { margin: 0 0 6px; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.fact {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-width: 0;
}
.fact strong { display: block; font-size: 18px; margin-top: 3px; overflow-wrap: anywhere; }
.factlabel {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.handoff {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--panel2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 8px 0 18px;
}

.sub { margin: 26px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.sub h3 { margin: 0 0 10px; }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 520px; }
.tbl th, .tbl td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.tbl th { color: var(--ink-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.tbl td.st-pass, .tbl td.st-ok { color: var(--ok); }
.tbl td.st-fail, .tbl td.st-blocked { color: var(--bad); }
.tbl td.st-warn, .tbl td.st-partial { color: var(--warn); }
.tbl td.st-unknown { color: var(--ink-dim); }

.code {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
  margin: 0;
}
.ordered { padding-left: 22px; margin: 0; }
.ordered li { margin-bottom: 9px; }

.finding-item {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--panel2);
}
.finding-item.sev-critical { border-left-color: var(--crit); }
.finding-item.sev-high { border-left-color: var(--bad); }
.finding-item.sev-medium { border-left-color: var(--warn); }
.finding-item.sev-low { border-left-color: var(--ink-dim); }
.finding-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.finding-head .fid { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.finding-head .sev {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}
.finding-item h4 { margin: 6px 0 4px; font-size: 15px; }
.finding-item p { margin: 4px 0; font-size: 14px; }
.finding-item pre { margin-top: 8px; }

.history { list-style: none; padding: 0; margin: 10px 0 0; }
.history li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.history .htitle { font-weight: 600; overflow-wrap: anywhere; }
.history .hmeta { color: var(--ink-dim); font-size: 12px; }

@media (max-width: 620px) {
  .lanebar { gap: 12px; padding: 10px 14px 12px; }
  .lane { font-size: 13px; padding: 6px 11px; }
  .facts { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .code { font-size: 11.5px; }
}

.verdict {
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
  align-self: flex-start;
}
.verdict.v-ready { color: var(--ok); border-color: var(--ok); }
.verdict.v-needs-work { color: var(--warn); border-color: var(--warn); }
.verdict.v-blocked { color: var(--bad); border-color: var(--bad); }

/* ---- Overflow containment ------------------------------------------------
 *
 * Both fixes below came out of driving the built bundle in a real browser at
 * 390px; neither is visible to an offline harness.
 *
 * 1. The text this app renders is other people's file paths, variable names and
 *    package names - `/Users/priya/Downloads/churn_export_2026_07_18.csv` has no
 *    break opportunity in it, so a finding heading or a prescan flag line pushed
 *    the whole page 82px wider than the phone and the browser answered by
 *    shrinking the page to fit. The element that grew was the <h4> and the <li>,
 *    not any container, so containment has to be set on them.
 * 2. The api.html code samples are <pre><code> with no class; `white-space: pre`
 *    plus an inline <code> child overflowed visibly and took the document
 *    scrollWidth to 5441px at desktop width. The <pre> is the element that must
 *    scroll, and the <code> must be a block for it to do so. */

.flaglist li,
.finding-item h4,
.finding-item p,
.finding-head .fid,
.finding .problem, .finding .fix, .finding .findhead span,
.tbl td, .tbl th,
table.inv td, table.inv th,
#summaryText, #resHeadline, #resTitle, #handoffNote, #stepsNote, #artifactNote,
#prescanSummary, #covMiss, #clipNotice, #secretWarn, #meter, #scanStats, #runMeta,
.history .htitle, .history .hmeta, .history li, .histhead strong, .plainlist li,
.warn, .warnline, .gate, .delta, .rungate, .lede, .explain p, .prescan p, .prescan h4,
.doc p, .doc li, .doc td, .doc th {
  overflow-wrap: anywhere;
  word-break: normal;
}

.doc pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.doc pre code {
  display: block;
  white-space: pre;
}
.codegroup { max-width: 100%; min-width: 0; }
.codegroup .tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.codegroup .tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--ink-dim);
  font: inherit;
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.codegroup .tab:hover { border-color: var(--accent); color: var(--ink); }
.codegroup .tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}

/* ---- Change Desk's own components ---------------------------------------- */

.offscreen { position: absolute; left: -9999px; top: 0; }

.tierline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.tierpill {
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.tierpill.tier-low { color: var(--ok); border-color: var(--ok); }
.tierpill.tier-moderate { color: var(--warn); border-color: var(--warn); }
.tierpill.tier-high { color: var(--bad); border-color: var(--bad); }
.tierpill.tier-severe { color: var(--crit); border-color: var(--crit); }
.tierpill.tier-unknown { color: var(--ink-dim); }

.sev {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap;
  display: inline-block;
}
.sev.sev-critical { color: var(--crit); border-color: var(--crit); }
.sev.sev-high { color: var(--bad); border-color: var(--bad); }
.sev.sev-medium { color: var(--warn); border-color: var(--warn); }
.sev.sev-low { color: var(--ink-dim); }

.status {
  font-family: var(--mono); font-size: 11.5px; white-space: nowrap;
}
.status.s-pass { color: var(--ok); }
.status.s-warn { color: var(--warn); }
.status.s-fail { color: var(--bad); }
.status.s-unknown { color: var(--ink-dim); }
.status.cov-confirmed { color: var(--ok); }
.status.cov-cleared { color: var(--warn); }
.status.cov-not-applicable { color: var(--ink-dim); }

.finding {
  border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px; background: var(--panel2); min-width: 0;
}
.finding.sev-border-critical { border-left-color: var(--crit); }
.finding.sev-border-high { border-left-color: var(--bad); }
.finding.sev-border-medium { border-left-color: var(--warn); }
.finding.sev-border-low { border-left-color: var(--ink-dim); }
.findhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.finding .problem { margin: 4px 0; font-size: 14.5px; font-weight: 600; }
.finding .fix { margin: 6px 0 0; font-size: 14px; }
.finding pre.evidence {
  margin: 8px 0 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; font-family: var(--mono); font-size: 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre.cmd {
  margin: 0; padding: 6px 8px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; font-family: var(--mono); font-size: 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.abort { margin: 6px 0 0; color: var(--ink-dim); }

.headline { font-size: 16px; margin: 4px 0 8px; }
.plainlist { margin: 6px 0 0; padding-left: 20px; }
.plainlist li { margin-bottom: 6px; min-width: 0; }

.histhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; width: 100%; min-width: 0; }
.history li { display: block; }
.lanetag {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--ink-dim);
  white-space: nowrap;
}

.dropzone.dragging { border-color: var(--accent); }

.handoff #handoffBtn { margin-top: 6px; }

/* Tables carry other people's identifiers, so the wrapper is the scroller and
 * every cell is allowed to break inside a long token. */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.inv td, table.inv th { min-width: 0; }

.resulthead { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.resulthead h2 { margin: 2px 0; }

input[type="search"] {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--ink); font: inherit; font-size: 14px;
}

/* ---- House Style additions ------------------------------------------------ */

.zone {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 20px;
  min-width: 0;
  max-width: 100%;
}
.zone > h3 { margin: 0 0 6px; }
.hint { margin: 2px 0 8px; }
.clipnote {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-dim);
  border-left: 3px solid var(--line);
  padding-left: 10px;
}
.summaryline { margin: 4px 0 10px; font-size: 14px; line-height: 1.6; }
.summary { margin: 8px 0 14px; line-height: 1.65; }
.meter { font-size: 13px; color: var(--ink-dim); min-width: 0; }
.gateaction { margin-left: 6px; }
.bullets { margin: 6px 0 0; padding-left: 20px; line-height: 1.65; }
.bullets li { margin-bottom: 8px; min-width: 0; }
.raw { margin-top: 18px; }
.raw > summary { cursor: pointer; font-size: 13px; color: var(--ink-dim); }

table.grid { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.grid th, table.grid td {
  border-bottom: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
table.grid th { font-weight: 600; color: var(--ink-dim); white-space: nowrap; }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid tr:last-child td { border-bottom: 0; }

.findings { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fitem {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--panel2);
  min-width: 0;
  max-width: 100%;
}
.fitem.sev-critical { border-left-color: #e0555f; }
.fitem.sev-high { border-left-color: #e08a3c; }
.fitem.sev-medium { border-left-color: #d4b83c; }
.fitem.sev-low { border-left-color: var(--line); }
.fitem h4 { margin: 0 0 6px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.fitem p { margin: 6px 0; line-height: 1.6; }
.fitem blockquote {
  margin: 8px 0;
  padding: 7px 11px;
  border-left: 3px solid var(--line);
  background: var(--panel);
  border-radius: 0 6px 6px 0;
  font-size: 13.5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fitem blockquote.rewrite { border-left-color: #7ee0c0; }
.sevtag {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  white-space: nowrap;
}
.sevtag.sev-critical, .sevtag.sev-high { color: var(--ink); border-color: currentColor; }
.ruleid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--ink-dim); }

.metricgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0 4px;
  min-width: 0;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel2);
  min-width: 0;
}
.metric .mlabel { display: block; font-size: 11px; color: var(--ink-dim); letter-spacing: 0.04em; }
.metric strong { font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric .mnote { display: block; font-size: 11.5px; color: var(--ink-dim); margin-top: 2px; overflow-wrap: anywhere; }

@media (max-width: 620px) {
  .metricgrid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .lane { white-space: normal; }
}

/* The artifact and raw-output panels are <pre class="doc"> INSIDE the app page,
 * not inside main.doc, so the docs-page pre rules never reached them and a
 * 2,800px line of generated Markdown pushed the whole document sideways. Found
 * by measuring documentElement.scrollWidth in a real browser: no single element
 * looked wrong, because each one was simply as wide as its content. */
pre.doc {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  tab-size: 2;
}
.result, .zone, main, .card { min-width: 0; }
.card { max-width: 100%; }

/* ---------------------------------------------------------------------------
 * Sentry Init: the pieces this app adds on top of the shared shell.
 * ------------------------------------------------------------------------ */

/* The masking consent line under the paste box. It is a real control, not a
 * note, so it gets the affordance of one. */
.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel2);
  font-size: 13.5px;
  color: var(--ink-dim);
  line-height: 1.5;
  cursor: pointer;
}
.checkline input { margin-top: 3px; flex: 0 0 auto; }

/* The traffic and plan disclosure. Closed by default on every lane but budget,
 * because most people arrive to audit rather than to cost. */
.trafficbox {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel2);
}
.trafficbox > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}
.trafficbox .row { margin-top: 10px; }
.trafficbox input[type="number"] { font-family: var(--mono); }

/* The prescan tiles. */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
  min-width: 0;
}
.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}
.metric strong { font-size: 18px; overflow-wrap: anywhere; }
.metriclabel { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-dim); }
.metricnote { font-size: 12px; color: var(--ink-dim); overflow-wrap: anywhere; }

/* Findings, this app's shape: severity border, an id, the option it is about. */
.finding.f-critical { border-left-color: var(--crit); }
.finding.f-high { border-left-color: var(--bad); }
.finding.f-medium { border-left-color: var(--warn); }
.finding.f-low { border-left-color: var(--ink-dim); }
.findinghead {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}
.findinghead code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}
.findinghead code.optiontag {
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

/* A check row's verdict chip. */
.chk {
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}
.chk.c-good { color: var(--ok); }
.chk.c-weak { color: var(--warn); }
.chk.c-missing { color: var(--bad); }
.chk.c-risky { color: var(--crit); }
.chk.c-not-applicable { color: var(--ink-dim); }

/* This app's verdict words. The shared sheet only knows the previous apps'. */
.verdict.v-production-ready, .verdict.v-contained, .verdict.v-within-quota,
.verdict.v-covered { color: var(--ok); border-color: var(--ok); }
.verdict.v-minor-gaps, .verdict.v-needs-scrubbing, .verdict.v-tight,
.verdict.v-partial { color: var(--warn); border-color: var(--warn); }
.verdict.v-incomplete, .verdict.v-over-quota, .verdict.v-blind { color: var(--bad); border-color: var(--bad); }
.verdict.v-misconfigured, .verdict.v-exposed { color: var(--crit); border-color: var(--crit); }

/* A table cell can hold a long DSN host or an option expression; the wrapper
 * scrolls, and the cell itself is allowed to break rather than to stretch. */
.grid td, .grid th { overflow-wrap: anywhere; }
.grid td.mono { font-family: var(--mono); font-size: 12.5px; }

/* Long option values inside the prescan and long fix blocks inside a finding
 * both scroll horizontally in their own container rather than widening the
 * page. Every pre in this app is one of these two. */
pre.evidence, pre.cmd {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.finding, .metric, .zone, .prescan { min-width: 0; }
