```css
/* Design Contract: Local-first NOC telemetry; dense, legible, keyboard-accessible, and overflow-safe at every viewport. */

:root {
  color-scheme: dark;
  --canvas: #090d12;
  --panel: #111821;
  --panel-raised: #151e29;
  --border: #1b2533;
  --ink: #e6edf3;
  --muted: #8b9cb3;
  --amber: #f59e0b;
  --green: #10b981;
  --red: #ef4444;
  --cyan: #38bdf8;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --radius-sm: 5px;
  --space: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  scroll-behavior: smooth;
  scrollbar-color: #344254 var(--canvas);
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    linear-gradient(180deg, #0c1219 0, var(--canvas) 240px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  max-width: 100%;
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--cyan);
  text-decoration-color: #38bdf866;
  text-underline-offset: 3px;
}

a:hover {
  color: #7dd3fc;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

::selection {
  background: #38bdf833;
  color: var(--ink);
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

code,
pre,
kbd,
samp,
.metric,
.badge {
  font-family: var(--mono);
}

code {
  color: #c8d7e8;
}

pre {
  max-width: 100%;
  overflow: auto;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  background: #0b1118;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand > :first-child {
  flex: 0 0 auto;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid #10b98155;
  border-radius: 999px;
  background: #10b9810d;
  color: #9be7ca;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
}

.trust-pill::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px #10b98166;
  content: "";
}

.hero {
  width: min(100% - 32px, 1200px);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px) 0 18px;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.hero p {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.sample-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0d141c;
  color: var(--muted);
  font-size: 12px;
}

.sample-bar > * {
  min-width: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #151e29;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn:hover {
  border-color: #405168;
  background: #1b2735;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  border-color: #28a983;
  background: #087a5c;
  color: #f0fdf8;
}

.btn-primary:hover {
  border-color: #34d399;
  background: #09936c;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--border);
  background: #151e29;
  color: var(--ink);
}

.btn-amber {
  border-color: #a76208;
  background: #3a280d;
  color: #ffd27a;
}

.btn-amber:hover {
  border-color: var(--amber);
  background: #4a320d;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  width: min(100% - 32px, 1200px);
  min-width: 0;
  margin: 0 auto;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 24px #0000001a;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #131c26;
}

.panel-head h2,
.panel-head h3 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.panel-head > * {
  min-width: 0;
}

.editor {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 280px;
  resize: vertical;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: #0c1219;
  color: #cbd8e6;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}

.editor::placeholder {
  color: #607186;
  opacity: 1;
}

.editor:focus {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 130px;
  margin: 14px;
  padding: 20px;
  border: 1px dashed #405168;
  border-radius: var(--radius);
  background: #0d151e;
  color: var(--muted);
  text-align: center;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.is-active,
.dropzone[aria-dropeffect="copy"] {
  border-color: var(--cyan);
  background: #0d1b25;
  color: var(--ink);
}

.dropzone p {
  margin: 0;
}

.score-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #0f171f;
}

.score-ring {
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  place-items: center;
  border: 4px solid #243344;
  border-radius: 50%;
  background: #111b26;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.score-ring[data-grade="good"],
.score-ring.is-good {
  border-color: var(--green);
  color: #83e5bf;
}

.score-ring[data-grade="warning"],
.score-ring.is-warning {
  border-color: var(--amber);
  color: #ffd27a;
}

.score-ring[data-grade="critical"],
.score-ring.is-critical {
  border-color: var(--red);
  color: #ff9a9a;
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid #344254;
  border-radius: 4px;
  background: #18222e;
  color: #c8d7e8;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1.35;
  text-transform: uppercase;
}

.grade-badge.good {
  border-color: #10b98166;
  background: #10b98112;
  color: #83e5bf;
}

.grade-badge.warning {
  border-color: #f59e0b66;
  background: #f59e0b12;
  color: #ffd27a;
}

.grade-badge.critical {
  border-color: #ef444466;
  background: #ef444412;
  color: #ff9a9a;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  padding: 14px;
}

.stat-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0e151d;
}

.stat-card .label,
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.stat-card .value,
.stat-card strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.finding-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px 14px;
}

.finding-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-left: 3px solid #516174;
  border-radius: var(--radius-sm);
  background: #0e151d;
}

.finding-card > * {
  min-width: 0;
}

.finding-card h3,
.finding-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.finding-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.sev-CRITICAL {
  border-left-color: var(--red);
}

.sev-HIGH {
  border-left-color: #fb923c;
}

.sev-MEDIUM {
  border-left-color: var(--amber);
}

.sev-CRITICAL .severity,
.sev-HIGH .severity,
.sev-MEDIUM .severity {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.sev-CRITICAL .severity {
  color: #ff7777;
}

.sev-HIGH .severity {
  color: #fdad69;
}

.sev-MEDIUM .severity {
  color: #ffd27a;
}

.code-block {
  display: block;
  max-width: 100%;
  margin: 8px 0 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #090e14;
  color: #b7d8e8;
  font-size: 11px;
  line-height: 1.6;
  tab-size: 4;
  white-space: pre;
}

.cta-band {
  width: min(100% - 32px, 1200px);
  margin:

/* Layout & component polish additions */
.container { max-width: 1320px; margin: 0 auto; padding: 20px; box-sizing: border-box; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid #f59e0b; color: #f59e0b; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; font-size: 13px; background: #111821; flex-shrink: 0; }
.brand-title { font-weight: 700; font-size: 15px; color: #e6edf3; }
.brand-sub { font-size: 12px; color: #8b9cb3; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }
.dropzone.dragover { outline: 2px dashed #f59e0b; outline-offset: 2px; }
.score-meta { flex: 1; min-width: 0; }
.grade-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.muted { color: #8b9cb3; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.finding-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.sev-badge { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.sev-badge.sev-CRITICAL { background: rgba(239,68,68,.18); color: #fca5a5; }
.sev-badge.sev-HIGH { background: rgba(245,158,11,.18); color: #fcd34d; }
.sev-badge.sev-MEDIUM { background: rgba(56,189,248,.18); color: #7dd3fc; }
.finding-card.sev-PASS { border-left: 3px solid #10b981; background: rgba(16,185,129,.08); }
.finding-card h4 { margin: 4px 0 6px; font-size: 14px; color: #e6edf3; }
.finding-card p { margin: 6px 0 0; font-size: 13px; color: #b8c4d4; line-height: 1.5; }
.excerpt { display: block; padding: 6px 8px; background: #090d12; border: 1px solid #1b2533; border-radius: 6px; font-size: 12px; color: #f59e0b; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.fix-section { margin-top: 16px; }
.fix-section h3 { font-size: 13px; color: #8b9cb3; margin: 0 0 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code-block { max-height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #10b981; color: #052e16; font-weight: 700; padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 99; }
.hidden { display: none !important; }
@media (max-width: 640px) { .container { padding: 12px; } .topbar { flex-wrap: wrap; gap: 10px; } }
