/* ═══════════════════════════════════════════════════════════════
   FAIRLENS — Precision Instrument Theme
   "Swiss audit tool meets editorial luxury"
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=Spline+Sans+Mono:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
button { cursor: pointer; font: inherit; border: none; background: none; }
a { text-decoration: none; color: inherit; }

:root {
  /* Warm cream base — not cold white */
  --paper:     #FAFAF7;
  --paper2:    #F5F4EF;
  --paper3:    #EDECE5;
  --white:     #FFFFFF;

  /* Ink hierarchy */
  --ink-1:     #0D0D0B;
  --ink-2:     #2C2C28;
  --ink-3:     #5C5C55;
  --ink-4:     #9C9C90;
  --ink-5:     #C4C4B8;

  /* Ruled lines — warm gray */
  --rule:      rgba(0,0,0,0.07);
  --rule2:     rgba(0,0,0,0.12);

  /* Forest green accent — trustworthy, unexpected, memorable */
  --green:        #1a7a4a;
  --green-light:  #237a54;
  --green-dim:    #EBF5EF;
  --green-border: #A8D5BC;
  --green-glow:   rgba(26, 122, 74, 0.12);

  /* Semantic — muted, professional */
  --red:        #C0392B;
  --red-dim:    #FDF0EE;
  --red-border: #F0B8B2;

  --amber:        #B8600A;
  --amber-dim:    #FDF5EC;
  --amber-border: #EDD0A4;

  --ok:        var(--green);
  --ok-dim:    var(--green-dim);
  --ok-border: var(--green-border);

  /* Typography */
  --serif:  'DM Serif Display', Georgia, serif;
  --sans:   'DM Sans', system-ui, sans-serif;
  --mono:   'Spline Sans Mono', 'Fira Code', monospace;

  /* Geometry — very subtle rounding, precision instrument feel */
  --r1:  4px;
  --r2:  8px;
  --r3:  12px;
  --r4:  20px;

  /* Elevation — warm paper shadows */
  --s1: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --s2: 0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  --s3: 0 12px 40px rgba(0,0,0,0.09), 0 4px 12px rgba(0,0,0,0.05);

  --sidebar-w: 256px;
}

html, body { height: 100%; font-family: var(--sans); color: var(--ink-1); background: var(--paper); }
#root { height: 100vh; display: flex; overflow: hidden; }

/* ── Paper texture overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--rule2);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 1px 0 0 var(--rule);
}

.sidebar-brand {
  padding: 32px 28px 28px;
  border-bottom: 1px solid var(--rule);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--green);
  border-radius: var(--r1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 14px;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink-1);
  line-height: 1;
  letter-spacing: -0.3px;
}

.brand-name em { font-style: italic; color: var(--green); }

.brand-tagline {
  font-size: 10px;
  color: var(--ink-4);
  font-family: var(--mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 400;
  padding-left: 44px;
}

.nav-group { padding: 24px 16px 8px; }

.nav-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-5);
  padding: 0 12px;
  margin-bottom: 8px;
  font-family: var(--mono);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r2);
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 500;
  width: 100%;
  text-align: left;
  transition: all .18s ease;
  position: relative;
}

.nav-item:hover { background: var(--paper2); color: var(--ink-1); }

.nav-item.active {
  background: var(--green-dim);
  color: var(--green);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 3px;
  background: var(--green);
  border-radius: 0 2px 2px 0;
}

.nav-icon { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }

/* dataset nav items */
.nav-ds {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r2);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 400;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all .18s ease;
}

.nav-ds:hover { background: var(--paper2); color: var(--ink-1); }
.nav-ds.active { color: var(--ink-1); font-weight: 600; }

.nav-ds-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-ds-name { flex: 1; }
.nav-ds-score { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.nav-ds.active .nav-ds-score { color: var(--ink-2); font-weight: 600; }

.sidebar-footer {
  margin-top: auto;
  padding: 20px 28px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-version { font-family: var(--mono); font-size: 10px; color: var(--ink-5); }

.api-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ══════════════════════════════════════════
   MAIN
══════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  min-width: 0;
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--rule2);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  flex-shrink: 0;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 10px; }

.topbar-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-1);
}

.crumb-sep { color: var(--ink-5); }
.crumb-sub { color: var(--ink-3); font-weight: 400; }

.topbar-chip {
  font-size: 11px;
  font-family: var(--mono);
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid var(--green-border);
  font-weight: 500;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--r4);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--rule2);
  background: var(--white);
  color: var(--ink-2);
  transition: all .18s ease;
  white-space: nowrap;
  font-family: var(--sans);
  box-shadow: var(--s1);
  cursor: pointer;
}

.btn:hover { border-color: var(--ink-5); color: var(--ink-1); box-shadow: var(--s2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 4px 14px var(--green-glow);
}

.btn-primary:hover {
  background: var(--green-light);
  border-color: var(--green-light);
  color: #fff;
  box-shadow: 0 6px 20px rgba(26,122,74,0.2);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-3);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--paper2); color: var(--ink-1); border-color: transparent; box-shadow: none; }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 14px; font-weight: 600; }

/* ══════════════════════════════════════════
   CONTENT AREA
══════════════════════════════════════════ */
.content { flex: 1; overflow-y: auto; padding: 40px; }
.page { animation: page-in .35s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.card {
  background: var(--white);
  border: 1px solid var(--rule2);
  border-radius: var(--r3);
  box-shadow: var(--s1);
  overflow: hidden;
  transition: box-shadow .2s ease;
}

.card:hover { box-shadow: var(--s2); }

.card-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-family: var(--mono);
}

.card-sub { font-size: 11px; color: var(--ink-4); font-family: var(--mono); }
.card-body { padding: 24px; }

.accent-card { border-color: var(--green-border); }
.accent-card .card-head { background: var(--green-dim); }

/* ══════════════════════════════════════════
   GRIDS
══════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-28 { margin-bottom: 28px; }

/* ══════════════════════════════════════════
   HERO
══════════════════════════════════════════ */
.hero {
  background: var(--white);
  border: 1px solid var(--rule2);
  border-radius: var(--r4);
  padding: 52px 56px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--s1);
}

/* Ruled-line watermark — precision instrument */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 45%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 28px,
    var(--rule) 28px,
    var(--rule) 29px
  );
  opacity: 1;
  pointer-events: none;
}

/* Green corner accent */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--green);
  border-radius: 0 0 0 var(--r4);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 20px;
  font-family: var(--mono);
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.hero-title {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 400;
  color: var(--ink-1);
  line-height: 1.05;
  margin-bottom: 18px;
  letter-spacing: -1.5px;
  max-width: 580px;
}

.hero-title em {
  font-style: italic;
  color: var(--green);
}

.hero-desc {
  font-size: 15px;
  color: var(--ink-3);
  max-width: 500px;
  line-height: 1.65;
  margin-bottom: 32px;
  font-weight: 400;
}

.hero-actions { display: flex; gap: 12px; align-items: center; }

.hero-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-meta-num {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--ink-1);
  letter-spacing: -1px;
  line-height: 1;
}

.hero-meta-label {
  font-size: 11px;
  color: var(--ink-4);
  font-family: var(--mono);
  line-height: 1.4;
  max-width: 80px;
}

.hero-meta-divider { width: 1px; height: 32px; background: var(--rule2); }

/* ══════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════ */
.stat-card {
  background: var(--white);
  border: 1px solid var(--rule2);
  border-radius: var(--r3);
  padding: 24px 24px 20px;
  box-shadow: var(--s1);
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--rule));
  transition: opacity .2s;
  opacity: 0;
}

.stat-card:hover { box-shadow: var(--s2); transform: translateY(-2px); }
.stat-card:hover::after { opacity: 1; }

.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 16px;
  font-family: var(--mono);
}

.stat-value {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -2px;
}

.stat-detail {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--mono);
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   BADGES
══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-family: var(--mono);
}

.badge-high   { background: var(--red-dim);    color: var(--red);    border: 1px solid var(--red-border); }
.badge-med    { background: var(--amber-dim);  color: var(--amber);  border: 1px solid var(--amber-border); }
.badge-low    { background: var(--green-dim);  color: var(--green);  border: 1px solid var(--green-border); }
.badge-pass   { background: var(--green-dim);  color: var(--green);  border: 1px solid var(--green-border); }
.badge-fail   { background: var(--red-dim);    color: var(--red);    border: 1px solid var(--red-border); }
.badge-accent { background: var(--green);      color: #fff;          border: 1px solid var(--green); }
.badge-muted  { background: var(--paper2);     color: var(--ink-3);  border: 1px solid var(--rule2); }

/* ══════════════════════════════════════════
   TABLES
══════════════════════════════════════════ */
.tbl-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  padding: 12px 20px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-4);
  border-bottom: 1px solid var(--rule2);
  font-family: var(--mono);
  white-space: nowrap;
  background: var(--paper);
}

tbody td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: var(--paper); }
td strong { color: var(--ink-1); font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ══════════════════════════════════════════
   PROGRESS BARS
══════════════════════════════════════════ */
.bar-track {
  flex: 1;
  height: 6px;
  background: var(--paper3);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ══════════════════════════════════════════
   GAUGE — editorial serif number style
══════════════════════════════════════════ */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 12px;
}

.gauge-svg { width: 100%; max-width: 200px; height: auto; }

/* ══════════════════════════════════════════
   METRIC ROWS
══════════════════════════════════════════ */
.mrow {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}

.mrow:last-child { border-bottom: none; }

.mrow-name {
  font-size: 13px;
  color: var(--ink-2);
  width: 200px;
  flex-shrink: 0;
  font-weight: 500;
}

.mrow-val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  width: 76px;
  text-align: right;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   SHAP BARS
══════════════════════════════════════════ */
.shap-list { display: flex; flex-direction: column; }

.shap-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}
.shap-row:last-child { border-bottom: none; }

.shap-rank { font-family: var(--mono); font-size: 10px; color: var(--ink-5); width: 18px; text-align: right; flex-shrink: 0; }

.shap-feat {
  font-family: var(--mono);
  font-size: 12px;
  width: 160px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.shap-feat.protected { color: var(--red); font-weight: 600; }
.shap-feat.regular { color: var(--ink-2); }

.shap-bar-bg {
  flex: 1;
  height: 18px;
  background: var(--paper2);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.shap-bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 8px;
  border-radius: 3px;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.shap-inner-val { font-size: 10px; font-family: var(--mono); color: #fff; font-weight: 600; white-space: nowrap; }
.shap-num { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink-4); width: 44px; text-align: right; flex-shrink: 0; }

/* ══════════════════════════════════════════
   DATASET PILLS
══════════════════════════════════════════ */
.ds-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.ds-pill {
  border: 1px solid var(--rule2);
  border-radius: var(--r3);
  padding: 16px 18px;
  background: var(--white);
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: var(--s1);
}

.ds-pill:hover { border-color: var(--ink-5); box-shadow: var(--s2); transform: translateY(-2px); }

.ds-pill.active {
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 1px var(--green), var(--s2);
}

.ds-pill-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.ds-pill-name { font-size: 13px; font-weight: 600; color: var(--ink-1); }
.ds-pill-sub { font-size: 11px; color: var(--ink-4); font-family: var(--mono); margin-bottom: 4px; }
.ds-pill-rows { font-size: 11px; color: var(--ink-5); font-family: var(--mono); }

/* ══════════════════════════════════════════
   TABS
══════════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--rule2);
  padding: 0 4px;
}

.tab {
  padding: 14px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all .18s ease;
  font-family: var(--sans);
  cursor: pointer;
  margin-bottom: -1px;
  letter-spacing: 0.2px;
}

.tab:hover { color: var(--ink-1); }
.tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

.tab-card { background: var(--white); border: 1px solid var(--rule2); border-radius: var(--r3); margin-bottom: 24px; padding: 0 16px; box-shadow: var(--s1); }

/* ══════════════════════════════════════════
   MITIGATION ITEMS
══════════════════════════════════════════ */
.mit-item {
  border: 1px solid var(--rule2);
  border-radius: var(--r3);
  padding: 22px 24px;
  background: var(--white);
  box-shadow: var(--s1);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 22px;
  transition: all .2s ease;
}

.mit-item:hover { box-shadow: var(--s2); border-color: var(--ink-5); transform: translateY(-1px); }

.mit-item.best {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green), var(--s2);
}

.mit-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--r2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--paper2);
  border: 1px solid var(--rule2);
  font-family: var(--mono);
  color: var(--ink-3);
}

.mit-item.best .mit-icon-wrap { background: var(--green-dim); border-color: var(--green-border); color: var(--green); }

.mit-info { flex: 1; min-width: 0; }
.mit-name { font-size: 15px; font-weight: 600; color: var(--ink-1); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.mit-desc { font-size: 12px; color: var(--ink-3); font-family: var(--mono); margin-bottom: 14px; }
.mit-progress-row { display: flex; align-items: center; gap: 10px; }
.mit-progress-label { font-size: 11px; color: var(--ink-4); font-family: var(--mono); font-weight: 500; white-space: nowrap; }

.mit-score-block { text-align: right; flex-shrink: 0; }
.mit-score-before { font-size: 11px; color: var(--ink-4); margin-bottom: 4px; font-family: var(--mono); }

.mit-score-after {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -1.5px;
}

.mit-delta {
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 4px;
}

.delta-pos { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-border); }
.delta-zero { background: var(--paper2); color: var(--ink-4); border: 1px solid var(--rule2); }

/* ══════════════════════════════════════════
   UPLOAD / DROP ZONE
══════════════════════════════════════════ */
.drop-zone {
  border: 1.5px dashed var(--rule2);
  border-radius: var(--r3);
  padding: 56px 40px;
  text-align: center;
  cursor: pointer;
  background: var(--paper);
  transition: all .2s ease;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--green);
  background: var(--green-dim);
}

.drop-icon { font-size: 32px; margin-bottom: 14px; display: block; color: var(--green); }
.drop-title { font-size: 16px; font-weight: 600; color: var(--ink-1); margin-bottom: 6px; }
.drop-sub { font-size: 12px; color: var(--ink-4); font-family: var(--mono); }

.field-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 7px;
  font-family: var(--mono);
}

.field-input {
  width: 100%;
  border: 1px solid var(--rule2);
  border-radius: var(--r2);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--mono);
  color: var(--ink-1);
  background: var(--white);
  outline: none;
  transition: all .18s ease;
}

.field-input::placeholder { color: var(--ink-5); }
.field-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }

/* ══════════════════════════════════════════
   RECOMMENDATIONS
══════════════════════════════════════════ */
.rec-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.rec-item:last-child { border-bottom: none; }

.rec-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green-dim);
  border: 1px solid var(--green-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
  font-family: var(--mono);
}

.rec-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; font-weight: 400; }

/* ══════════════════════════════════════════
   MISC
══════════════════════════════════════════ */
.divider { height: 1px; background: var(--rule); margin: 18px 0; }

.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-5);
  margin-bottom: 14px;
  font-family: var(--mono);
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--mono);
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--paper2);
  color: var(--ink-3);
  border: 1px solid var(--rule2);
}

/* ══════════════════════════════════════════
   LOADING OVERLAY
══════════════════════════════════════════ */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(8px);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--rule2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.overlay-label { font-size: 16px; color: var(--ink-1); font-weight: 600; }
.overlay-sub { font-size: 12px; color: var(--ink-4); font-family: var(--mono); }

/* ══════════════════════════════════════════
   TOASTS
══════════════════════════════════════════ */
.toast-stack {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--white);
  border: 1px solid var(--rule2);
  border-radius: var(--r2);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--s3);
  animation: toast-in .28s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 260px;
  max-width: 380px;
  font-size: 13.5px;
  font-weight: 500;
}

.toast.ok  { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--amber); }

.toast-msg { flex: 1; color: var(--ink-1); line-height: 1.5; }
.toast-close { color: var(--ink-5); font-size: 16px; padding: 0; background: none; border: none; cursor: pointer; transition: color .15s; }
.toast-close:hover { color: var(--ink-1); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ══════════════════════════════════════════
   REPORT DOWNLOADS
══════════════════════════════════════════ */
.report-dl-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--rule2);
  border-radius: var(--r2);
  margin-bottom: 10px;
  transition: all .18s ease;
  box-shadow: var(--s1);
}

.report-dl-item:hover { border-color: var(--ink-5); box-shadow: var(--s2); transform: translateY(-1px); }

.report-dl-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r2);
  background: var(--paper2);
  border: 1px solid var(--rule2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: var(--green);
  font-weight: 700;
  font-family: var(--mono);
}

.report-dl-name { font-size: 14px; font-weight: 600; color: var(--ink-1); margin-bottom: 3px; }
.report-dl-desc { font-size: 11.5px; color: var(--ink-4); font-family: var(--mono); }

/* ══════════════════════════════════════════
   VERDICT / INFO
══════════════════════════════════════════ */
.verdict-cell {
  padding: 20px;
  background: var(--paper);
  border-radius: var(--r2);
  border: 1px solid var(--rule2);
  text-align: center;
}

.verdict-cell-label { font-size: 10px; color: var(--ink-4); font-family: var(--mono); margin-bottom: 8px; text-transform: uppercase; font-weight: 600; letter-spacing: 1px; }

.verdict-cell-value {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -1.5px;
  margin-bottom: 8px;
}

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.info-cell { padding: 12px 14px; background: var(--paper); border-radius: var(--r1); border: 1px solid var(--rule); }
.info-cell-key { font-size: 10px; color: var(--ink-5); font-family: var(--mono); text-transform: uppercase; font-weight: 600; letter-spacing: 0.8px; margin-bottom: 4px; }
.info-cell-val { font-size: 13px; font-weight: 600; color: var(--ink-1); }

.method-badge { font-family: var(--mono); font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 3px; }
.method-get  { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-border); }
.method-post { background: var(--amber-dim); color: var(--amber); border: 1px solid var(--amber-border); }

.result-score-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.result-score-cell { padding: 18px; background: var(--paper); border-radius: var(--r2); border: 1px solid var(--rule2); }
.result-score-key { font-size: 10px; font-weight: 600; font-family: var(--mono); text-transform: uppercase; color: var(--ink-5); letter-spacing: 1px; margin-bottom: 6px; }
.result-score-val { font-family: var(--serif); font-size: 30px; font-weight: 400; color: var(--green); letter-spacing: -1px; }

.stack-item { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.stack-item:last-child { border-bottom: none; }
.stack-name { font-weight: 600; font-size: 14px; color: var(--ink-1); }
.stack-role { font-size: 12px; color: var(--ink-4); font-family: var(--mono); }

/* ══════════════════════════════════════════
   OVERVIEW DS HEADER
══════════════════════════════════════════ */
.ds-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--white);
  border: 1px solid var(--rule2);
  border-radius: var(--r3);
  box-shadow: var(--s1);
}

.ds-mark {
  width: 44px;
  height: 44px;
  background: var(--green);
  border-radius: var(--r2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.ds-header-name { font-size: 20px; font-weight: 600; color: var(--ink-1); margin-bottom: 4px; font-family: var(--serif); letter-spacing: -0.3px; }
.ds-header-meta { display: flex; gap: 10px; align-items: center; }

/* ══════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════ */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-5); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .ds-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 32px 28px; }
  .hero-title { font-size: 36px; }
  .content { padding: 24px; }
}