:root {
  --ink: #f1f5f9;
  --ink-soft: #94a3b8;
  --ink-muted: #64748b;
  --paper: #111726;
  --paper-card: #141d2f;
  --paper-card-hover: #1a253c;
  --page: #080c16;
  --page-radial:
    radial-gradient(1000px circle at 50% -12%, rgba(59, 130, 246, 0.24) 0%, transparent 70%),
    radial-gradient(850px circle at 92% 18%, rgba(139, 92, 246, 0.16) 0%, transparent 60%),
    radial-gradient(800px circle at 8% 65%, rgba(37, 99, 235, 0.12) 0%, transparent 65%);
  --line: #1e2b40;
  --line-light: rgba(255, 255, 255, 0.08);
  --line-focus: #3b82f6;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --accent-ink: #ffffff;
  --ok: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --ok-border: rgba(16, 185, 129, 0.3);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(245, 158, 11, 0.3);
  --bad: #ef4444;
  --bad-bg: rgba(239, 68, 68, 0.12);
  --bad-border: rgba(239, 68, 68, 0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--page);
  background-image: var(--page-radial);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.6 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: rgba(13, 18, 32, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; width: 100%; }

header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
header .brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
}
header .brand .brand-q {
  background: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.65));
}
header .brand .brand-stage {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border: 1px solid #f59e0b;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 4px;
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
header nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
header a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}
header a:hover { color: #fff; text-shadow: 0 0 8px rgba(255, 255, 255, 0.4); }

main { padding: 36px 0 64px; flex: 1; }

h1 {
  font-size: 34px;
  line-height: 1.25;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 15%, #cbd5e1 45%, #93c5fd 75%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
h2 { font-size: 22px; margin: 36px 0 14px; letter-spacing: -0.02em; font-weight: 700; color: #f8fafc; }
h3 { font-size: 17px; margin: 24px 0 8px; font-weight: 600; color: #e2e8f0; }
p { margin: 0 0 16px; color: var(--ink); }
a { color: var(--accent); transition: color 0.15s ease; }
a:hover { color: #60a5fa; }
ul, ol { margin: 0 0 16px; padding-left: 24px; color: var(--ink); }
li { margin-bottom: 8px; }

code, pre {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

code {
  background: #172235;
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: #93c5fd;
}

.card {
  background: linear-gradient(180deg, rgba(21, 30, 48, 0.85) 0%, rgba(15, 23, 38, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(59, 130, 246, 0.12);
}

.muted { color: var(--ink-soft); font-size: 14px; }
.lead { font-size: 18px; color: var(--ink-soft); line-height: 1.6; }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
  color: #fff;
  padding: 13px 26px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.2s ease;
}
.cta:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  box-shadow: 0 6px 26px rgba(99, 102, 241, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  color: #fff;
}
.cta[disabled], .cta.off {
  background: #232d3f;
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  border-color: transparent;
}

.sec-btn {
  background: #192336;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s ease;
}
.sec-btn:hover {
  background: #223048;
  border-color: #3b82f6;
  color: #fff;
}

.credits {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #a5b4fc;
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.18);
}
.credits.none {
  background: var(--bad-bg);
  border-color: var(--bad-border);
  color: #f87171;
  box-shadow: none;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }

label { display: block; font-weight: 600; margin-bottom: 8px; color: #e2e8f0; font-size: 14px; }
input[type="text"], input[type="password"], input[type="file"], select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1422;
  color: #f1f5f9;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.15s ease;
}
input[type="text"]:focus, input[type="password"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
input[type="file"] { padding: 8px 12px; }
select { cursor: pointer; }

pre {
  background: #0c121e;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  color: #cbd5e1;
}

.hint { color: var(--ink-soft); font-size: 13px; margin-top: 6px; }

.err {
  background: var(--bad-bg);
  border: 1px solid var(--bad-border);
  color: #f87171;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}

table { width: 100%; border-collapse: collapse; margin: 12px 0 6px; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th {
  background: #0f1626;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
td { color: var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', monospace; }
tr:hover td { background: rgba(59, 130, 246, 0.04); }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill.ok { background: var(--ok-bg); color: #34d399; border: 1px solid var(--ok-border); }
.pill.warn { background: var(--warn-bg); color: #fbbf24; border: 1px solid var(--warn-border); }
.pill.bad { background: var(--bad-bg); color: #f87171; border: 1px solid var(--bad-border); }
.pill.info { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }

.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 46px; margin-bottom: 18px; color: var(--ink-soft); }
.steps > li strong { color: #f8fafc; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.note {
  border-left: 4px solid var(--accent);
  background: #111a2c;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  color: #cbd5e1;
}
.note.good { border-color: var(--ok); background: #0f231e; color: #a7f3d0; }

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  color: var(--ink-soft);
  font-size: 13px;
  background: rgba(11, 16, 26, 0.7);
}
footer a { color: var(--ink-soft); }

/* Drag and Drop Zone */
.dropzone-box {
  border: 2px dashed #283750;
  border-radius: var(--radius);
  background: #0d1422;
  padding: 28px 22px;
  text-align: center;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}
.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--accent);
  background: #111b2e;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}
.dropzone-content {
  cursor: pointer;
  padding: 14px 10px;
}
.dropzone-svg {
  display: block;
  margin: 0 auto 12px auto;
  stroke: #4b6a9a;
  transition: transform 0.2s ease, stroke 0.2s ease;
}
.dropzone-box:hover .dropzone-svg, .dropzone-box.dragover .dropzone-svg {
  transform: translateY(-3px);
  stroke: #60a5fa;
}
.dropzone-text {
  font-size: 16px;
  color: var(--ink);
}
.dropzone-text .browse-link {
  color: #60a5fa;
  text-decoration: underline;
  font-weight: 600;
}
.dropzone-previews {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.preview-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #141c2c;
  border: 1px solid #23324d;
  border-radius: 8px;
  padding: 8px;
  max-width: 140px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.preview-item img {
  width: 104px;
  height: 144px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #23324d;
  background: #0b101c;
}
.preview-item .preview-name {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 6px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 120px;
}
.preview-item .preview-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.preview-item .preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.preview-item .preview-remove:hover {
  background: #dc2626;
}

/* MicroSaaS Condition Metrology & Tolerance Headroom Styles */
.badge-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-mode.in_hand {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.badge-mode.listing {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.coverage-box {
  background: #111827;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 18px 0 26px;
}
.coverage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 14px;
}
.coverage-bar {
  height: 8px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}
.coverage-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.bottleneck-card {
  background: #1c151c;
  border-left: 5px solid #ef4444;
  border-top: 1px solid rgba(239, 68, 68, 0.25);
  border-right: 1px solid rgba(239, 68, 68, 0.25);
  border-bottom: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 22px 0;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.12);
}
.bottleneck-card.clean {
  background: #10211d;
  border-left-color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}
.bottleneck-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #f87171;
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.05em;
}
.bottleneck-card.clean .bottleneck-badge {
  color: #34d399;
}
.bottleneck-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
}
.bottleneck-detail {
  font-size: 14px;
  color: #cbd5e1;
  margin: 0 0 6px;
}
.bottleneck-impact {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}

.headroom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}
.headroom-card {
  background: #131a2a;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.headroom-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.headroom-name {
  font-weight: 700;
  font-size: 14px;
  color: #f1f5f9;
}
.headroom-status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.status-PASS { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-BORDERLINE { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-FAIL { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.status-UNVERIFIED { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

.headroom-meter {
  height: 6px;
  background: #0c121e;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
}
.headroom-meter-fill {
  height: 100%;
  border-radius: 999px;
}
.headroom-meter-fill.PASS { background: #10b981; }
.headroom-meter-fill.BORDERLINE { background: #f59e0b; }
.headroom-meter-fill.FAIL { background: #ef4444; }
.headroom-meter-fill.UNVERIFIED { background: #475569; }

.headroom-summary {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}

.blind-spots-card {
  background: #241b12;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
}
.blind-spots-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #fbbf24;
}
.blind-spots-card ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: #fde68a;
}

/* Operator Submissions Preview Grid */
.operator-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 18px 0 28px;
}
.sub-preview-card {
  background: #131a29;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}
.sub-preview-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.sub-preview-thumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  justify-content: center;
}
.sub-preview-img {
  width: 90px;
  height: 125px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #233149;
  background: #090e18;
}
.sub-preview-img.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 11px;
}

/* Visual Security CAPTCHA */
.captcha-card {
  border-left: 4px solid #6366f1 !important;
  background: linear-gradient(135deg, rgba(30, 41, 69, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.captcha-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.captcha-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 6px;
  color: #c7d2fe;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.captcha-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid var(--line);
  padding: 18px 20px;
  border-radius: 10px;
  margin-top: 6px;
}
.captcha-visual-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.captcha-img-box {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.captcha-img {
  display: block;
  width: 240px;
  height: 80px;
  object-fit: cover;
}
.captcha-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #192336;
  color: #cbd5e1;
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.captcha-refresh-btn:hover {
  background: #25334c;
  color: #fff;
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}
.captcha-refresh-btn.spinning svg {
  animation: captcha-spin 0.4s linear infinite;
}
@keyframes captcha-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.captcha-input-wrap {
  flex: 1;
  min-width: 200px;
}
.captcha-input {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  letter-spacing: 0.25em !important;
  text-transform: uppercase !important;
  padding: 10px 16px !important;
  background: #060913 !important;
  border: 1.5px solid rgba(99, 102, 241, 0.45) !important;
  border-radius: 8px !important;
  color: #67e8f9 !important;
  max-width: 220px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
.captcha-input:focus {
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35), inset 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

/* ==========================================================================
   Quantitative Metrology & Probability Engine (Gradieq Advanced Analytics)
   ========================================================================== */
.quant-engine-box {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius);
  padding: 24px;
  margin: 28px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.quant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.quant-title {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
}
.quant-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.4);
}
.quant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.quant-card {
  background: #0d1527;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.quant-card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.quant-card-value {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin: 4px 0 8px;
  font-family: 'JetBrains Mono', monospace;
}
.quant-card-sub {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
}
.pmf-chart-container {
  margin: 14px 0 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 14px 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.pmf-bars {
  display: flex;
  align-items: flex-end;
  height: 95px;
  gap: 8px;
  padding: 0 4px;
}
.pmf-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.pmf-bar-val {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 4px;
  font-family: 'JetBrains Mono', monospace;
}
.pmf-bar {
  width: 100%;
  max-width: 28px;
  background: linear-gradient(180deg, #6366f1 0%, #4338ca 100%);
  border-radius: 4px 4px 0 0;
  transition: all 0.3s ease;
  min-height: 2px;
}
.pmf-bar.high {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}
.pmf-bar.mid {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}
.pmf-bar.low {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}
.pmf-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
}
.quant-meter {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.quant-meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}
.quant-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.quant-pill.ok { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.quant-pill.warn { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.quant-pill.danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.quant-pill.info { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }



/* ======================================================================== */
/* GradieQ brand, v2 (2026-10).  The grader's bench: a dark graphite-teal    */
/* work surface, the gold of a slab label's foil for the one thing to do,   */
/* and a measuring cyan for numbers and lines.  Flat panels, hairline       */
/* borders, no glows: the page should feel like an instrument, not an ad.   */
/* Declared after the original rules so it wins at equal specificity.      */
/* ======================================================================== */
:root {
  --ink: #ecf1ef;
  --ink-soft: #a3b4b1;
  --ink-muted: #73858a;
  --paper: #161f22;
  --paper-card: #161f22;
  --paper-card-hover: #1b2629;
  --page: #0f1517;
  --page-radial: none;
  --line: #283639;
  --line-light: rgba(236, 241, 239, 0.08);
  --line-focus: #e2b04a;
  --accent: #e2b04a;
  --accent-ink: #1a1404;
  --accent-glow: transparent;
  --measure: #6fd3c4;
  --ok: #4fc08d;
  --warn: #e2b04a;
  --bad: #ef6f5e;
  --radius: 14px;
  --radius-sm: 6px;
  --shadow-card: none;
  --shadow-glow: none;
  --font: 'Archivo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background: var(--page);
  font-family: var(--font);
  font-feature-settings: "tnum" 1;
}

header { background: rgba(15, 21, 23, 0.92); border-bottom-color: var(--line); }
header .wrap { height: 60px; }
header .brand { gap: 10px; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -0.01em; font-stretch: 112%; }
header .brand svg { flex: none; display: block; }
header .brand .brand-q { background: none; -webkit-text-fill-color: currentColor; color: var(--accent); filter: none; }
header .brand .brand-stage {
  border-color: var(--line); color: var(--ink-soft); background: transparent;
  text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 0.6em; font-stretch: 100%;
}
header a { color: var(--ink-soft); }
header a:hover { color: var(--ink); text-shadow: none; }
header nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 4px; }

h1 {
  background: none; -webkit-text-fill-color: currentColor; color: var(--ink);
  font-stretch: 118%; font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; font-size: clamp(30px, 4.6vw, 48px);
}
h2 { color: var(--ink); font-stretch: 110%; font-weight: 750; letter-spacing: -0.01em; }
h3 { color: var(--ink); }
a { color: var(--measure); }
a:hover { color: #9fe6dc; }
code { background: #1b2629; color: var(--measure); border-color: var(--line); }

.card {
  background: var(--paper-card); border: 1px solid var(--line); box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.card:hover { border-color: #33464a; box-shadow: none; }

.cta {
  background: var(--accent); color: var(--accent-ink); border: 1px solid #f0c86e;
  border-radius: var(--radius-sm); box-shadow: none; font-weight: 700; letter-spacing: 0;
}
.cta:hover { background: #efc163; color: var(--accent-ink); box-shadow: none; transform: none; }
.cta:focus-visible, .sec-btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.cta[disabled], .cta.off { background: #222d30; color: var(--ink-muted); border-color: var(--line); }
.sec-btn { background: transparent; border-color: var(--line); border-radius: var(--radius-sm); color: var(--ink); }
.sec-btn:hover { background: #1b2629; border-color: var(--ink-muted); color: var(--ink); }

.credits {
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  box-shadow: none; border-radius: var(--radius-sm); font-weight: 500;
}

input[type="text"], input[type="password"], input[type="email"], input[type="file"], select {
  background: #121a1c; border-color: var(--line); color: var(--ink); border-radius: var(--radius-sm);
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226, 176, 74, 0.22);
}

th { background: transparent; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink-soft); }
td.num, th.num { font-family: var(--font); }
tr:hover td { background: rgba(111, 211, 196, 0.035); }

.pill.info { background: rgba(111, 211, 196, 0.1); color: var(--measure); border-color: rgba(111, 211, 196, 0.3); }
.pill.warn { color: var(--accent); }

.note { background: #141c1f; border-left-color: var(--measure); color: var(--ink); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.note.good { background: #12201b; border-left-color: var(--ok); color: #cfeee0; }
.note.bad { background: #241614; border-left-color: var(--bad); color: #f6d3cd; }
.note.info { border-left-color: var(--measure); }

.steps > li::before {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  box-shadow: none; border-radius: 6px; font-stretch: 112%;
}
.steps > li strong { color: var(--ink); }

footer { background: transparent; border-top-color: var(--line); }
footer .foot { display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: baseline; justify-content: space-between; }
footer .foot-version { color: var(--ink-muted); font-size: 12px; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; align-items: center; padding: 20px 0 8px; }
.hero p.lead { max-width: 46ch; color: var(--ink-soft); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; margin: 26px 0 10px; }
.hero-allowance { color: var(--ink-muted); font-size: 14px; margin: 0; }
.hero-figure { width: 100%; max-width: 380px; justify-self: end; }
.hero-figure svg { width: 100%; height: auto; display: block; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-figure { justify-self: start; max-width: 300px; }
}

.label-strip {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 20px; align-items: center;
  border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px;
  background: var(--paper-card); padding: 16px 20px; margin: 18px 0 8px; max-width: 640px;
}
.label-strip .ls-card { font-weight: 700; font-stretch: 112%; }
.label-strip .ls-sub { color: var(--ink-soft); font-size: 13px; grid-column: 1 / 3; }
.label-strip .ls-caps { display: flex; gap: 14px; grid-row: 1 / 3; grid-column: 3; }
.label-strip .ls-cap { text-align: center; }
.label-strip .ls-co { display: block; color: var(--ink-soft); font-size: 12px; }
.label-strip .ls-num { display: block; font-size: 28px; font-weight: 800; font-stretch: 112%; line-height: 1.05; color: var(--ink); }
@media (max-width: 560px) {
  .label-strip { grid-template-columns: 1fr; }
  .label-strip .ls-caps { grid-row: auto; grid-column: auto; }
  .label-strip .ls-sub { grid-column: auto; }
}

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 8px 0 0; max-width: 820px; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } }
.facts > div { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.facts h3 { margin: 0 0 6px; font-size: 16px; }
.facts p { color: var(--ink-soft); font-size: 15px; margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media (max-width: 680px) {
  header .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 8px; row-gap: 6px; }
  header nav { margin-left: 0; width: 100%; gap: 18px; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; scrollbar-width: none; }
  header nav a { flex: none; }
}

/* Captcha and drop zone in the brand */
.captcha-card { border-left: 1px solid var(--line) !important; background: var(--paper-card) !important; box-shadow: none !important; }
.captcha-container { background: transparent !important; border-color: var(--line) !important; }
.captcha-img-box { border-color: var(--line) !important; box-shadow: none !important; }
.captcha-refresh-btn { background: transparent !important; color: var(--ink-soft) !important; border: 1px solid var(--line) !important; box-shadow: none !important; }
.captcha-refresh-btn:hover { color: var(--ink) !important; border-color: var(--ink-muted) !important; }
.captcha-input { background: #121a1c !important; border: 1px solid var(--line) !important; color: var(--ink) !important; box-shadow: none !important; }
.captcha-input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(226, 176, 74, 0.22) !important; }
.dropzone-box { border-color: #33464a !important; background: #121a1c !important; }
.dropzone-box:hover, .dropzone-box.dragover { border-color: var(--accent) !important; background: #161f22 !important; }
.browse-link { color: var(--measure) !important; }
.dropzone-svg { color: var(--ink-soft) !important; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); }
.dropzone-svg, .dropzone-box .dropzone-svg { color: var(--ink-soft) !important; stroke: currentColor; }

/* Upload Modal & Submission Loader */
.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(8, 12, 22, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.upload-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.upload-modal {
  background: var(--paper-card, #141d2f);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 50px rgba(59, 130, 246, 0.2);
  width: 100%;
  max-width: 440px;
  padding: 34px 28px;
  text-align: center;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.upload-overlay.visible .upload-modal {
  transform: scale(1) translateY(0);
}

.upload-scanner-visual {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-ring {
  position: absolute;
  border-radius: 50%;
}

.scanner-ring-outer {
  inset: 0;
  border: 2px dashed rgba(59, 130, 246, 0.4);
  animation: uploadSpinClockwise 10s linear infinite;
}

.scanner-ring-inner {
  inset: 10px;
  border: 2px solid transparent;
  border-top-color: #3b82f6;
  border-right-color: #8b5cf6;
  animation: uploadSpinCounterClockwise 2.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.scanner-card-icon {
  position: relative;
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 46px;
  height: 46px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.08);
}

.scanner-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, #60a5fa, transparent);
  box-shadow: 0 0 8px #38bdf8;
  animation: uploadLaserScan 1.8s ease-in-out infinite alternate;
}

@keyframes uploadSpinClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes uploadSpinCounterClockwise {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes uploadLaserScan {
  0% { top: 4px; opacity: 0.3; }
  50% { opacity: 1; }
  100% { top: 40px; opacity: 0.3; }
}

.upload-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink, #f1f5f9);
  letter-spacing: -0.01em;
}

.upload-subtitle {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--ink-soft, #94a3b8);
  line-height: 1.5;
  min-height: 40px;
}

.upload-progress-container {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 18px;
}

.upload-progress-bar {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, #2563eb, #3b82f6, #8b5cf6);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  transition: width 0.35s ease;
}

.upload-progress-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: uploadShimmerMove 1.5s infinite;
}

@keyframes uploadShimmerMove {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.upload-steps {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 12px;
  background: rgba(13, 18, 32, 0.6);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.upload-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-muted, #64748b);
  transition: all 0.25s ease;
}

.upload-step.active {
  color: #60a5fa;
  font-weight: 600;
}

.upload-step.completed {
  color: #10b981;
}

.upload-step .step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.upload-step.active .step-dot {
  box-shadow: 0 0 8px #60a5fa;
}

.upload-hint {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted, #64748b);
}

.btn-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: uploadSpinClockwise 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* Verification stamp links */
.verify-stamp a,
#verification-code a {
  color: #60a5fa !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  font-weight: 600 !important;
  transition: color 0.15s ease;
}

.verify-stamp a:hover,
#verification-code a:hover {
  color: #93c5fd !important;
}


