/* gio public — design system per ADR-012 + audit fix v2 (2026-04-28) */
:root {
  --bg: #FAFAF7;
  --surface: #F2F1EB;
  --text: #1A1F26;
  --text-muted: #5A6573;
  --brand: #3A4A5C;
  --brand-hover: #2C3845;
  --accent: #C9A227;
  --accent-text: #7A6010;
  --warning-soft: #FBF3D5;
  --success: #3F7A4D;
  --danger: #A23B2D;
  --border: #D5D2C8;
  --border-strong: #9B9586;

  --cat-family: #8B4789;
  --cat-business: #1F6F8B;
  --cat-political: #3A4A5C;
  --cat-financial: #C9A227;
  --cat-social: #5A8B5E;
  --cat-judicial: #A23B2D;
  --cat-media: #D17C3F;

  --radius: 6px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  /* Type scale (Bringhurst — perfect fourth ratio 1.333) */
  --fs-base: 16px;
  --fs-sm: 13px;
  --fs-md: 16px;
  --fs-lg: 21px;
  --fs-xl: 28px;
  --fs-2xl: 37px;
  --fs-hero: 49px;

  /* Focus ring — contrast ≥3:1 pe orice background din paleta */
  --focus-ring: #1F4F7A;
  --focus-ring-offset: 2px;

  /* OpenType + text rendering global */
  font-feature-settings: "kern" 1, "liga" 1, "clig" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: subpixel-antialiased;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 16px; line-height: 1.5;
  background: var(--bg); color: var(--text);
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }
code, pre { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }
.muted { color: var(--text-muted); }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: var(--sp-5);
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: var(--sp-2); }
.brand-dot {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent);
  border: 2px solid var(--brand);
}
.brand-name { font-weight: 700; font-size: 22px; color: var(--brand); }
.brand-tag { color: var(--text-muted); font-size: 14px; font-style: italic; }
.nav { display: flex; gap: var(--sp-3); margin-left: auto; }
.nav a {
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius);
}
.nav a.active { background: var(--brand); color: #fff; }
.nav a.active:hover { color: #fff; text-decoration: none; }

main { padding: var(--sp-5); max-width: 1200px; margin: 0 auto; }

h1 { font-size: 32px; color: var(--brand); margin: 0 0 var(--sp-4) 0; line-height: 1.2; }
h2 { font-size: 22px; color: var(--brand); margin: var(--sp-6) 0 var(--sp-3) 0; }
h3 { font-size: 18px; color: var(--brand); margin: var(--sp-4) 0 var(--sp-2) 0; }

/* Hero */
.hero { padding: var(--sp-6) 0 var(--sp-5); }
.hero h1 { font-size: 48px; line-height: 1.1; }
.lead { font-size: 19px; line-height: 1.6; max-width: 70ch; margin-bottom: var(--sp-4); }
.lead-action { display: flex; gap: var(--sp-3); margin: var(--sp-4) 0; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--border); text-decoration: none; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-hover); }
.btn-sm {
  display: inline-block; padding: 4px 10px; font-size: 13px;
  border-radius: 4px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  text-decoration: none;
}
.btn-sm.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-sm:hover { background: var(--border); }
.btn-sm.primary:hover { background: var(--brand-hover); color: #fff; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-5) 0;
}
.stat-card {
  background: #fff; padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 38px; font-weight: 700; color: var(--brand); margin: 4px 0; }
.stat-detail { font-size: 13px; color: var(--text-muted); }

/* Top entities */
.top-grid {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
}
.top-card {
  display: block; background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.top-card:hover {
  border-color: var(--brand);
  text-decoration: none;
  transform: translateY(-1px);
}
.top-name { display: block; font-weight: 600; color: var(--brand); }
.top-meta { display: block; font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* How it works */
.how ol { padding-left: var(--sp-5); }
.how li { margin-bottom: var(--sp-3); max-width: 70ch; }

.manifest p { max-width: 70ch; }

/* Banner disclaimer */
.banner-disclaimer {
  background: var(--warning-soft);
  border-left: 4px solid var(--accent);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: var(--sp-4);
  font-size: 14px;
}

/* Entity */
.entity-page { max-width: 900px; }
.entity-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0; }
.aliases-row { color: var(--text-muted); font-size: 14px; }
.aliases-row code {
  background: var(--surface); padding: 2px 6px; border-radius: 3px;
  border: 1px solid var(--border); margin: 0 2px;
}
.entity-notes {
  white-space: pre-line;
  background: var(--surface);
  padding: var(--sp-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 3px;
  font-size: 12px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.badge.muted { color: var(--text-muted); }
.badge.type-person { background: #d6e3ee; border-color: #b6cce0; color: #1F6F8B; }
.badge.type-company, .badge.type-media_outlet { background: #dceadd; color: var(--success); border-color: #b3d3b6; }
.badge.type-institution { background: #e7d8e9; color: #8B4789; border-color: #cba5cf; }

/* Relation list */
.rel-list { list-style: none; padding: 0; }
.rel-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: var(--sp-2);
  align-items: baseline;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.rel-item:last-child { border-bottom: none; }
.rel-cat {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.rel-cat.cat-family { background: var(--cat-family); color: #fff; }
.rel-cat.cat-business { background: var(--cat-business); color: #fff; }
.rel-cat.cat-political { background: var(--cat-political); color: #fff; }
.rel-cat.cat-financial { background: var(--cat-financial); color: #1A1F26; }
.rel-cat.cat-social { background: var(--cat-social); color: #fff; }
.rel-cat.cat-judicial { background: var(--cat-judicial); color: #fff; }
.rel-cat.cat-media { background: var(--cat-media); color: #fff; }
.rel-arrow { font-weight: 700; color: var(--text-muted); }
.rel-other { font-size: 16px; }
.rel-pred { color: var(--text-muted); }
.rel-conf {
  background: var(--brand); color: #fff;
  padding: 1px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
}
.rel-srcs { font-size: 12px; color: var(--text-muted); }
.rel-quote {
  grid-column: 1 / -1;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: var(--sp-2) var(--sp-3);
  margin: var(--sp-2) 0 0 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
}
.rel-quote em { font-style: italic; }
.yt-link {
  display: inline-block; margin-top: 4px;
  background: var(--accent); color: var(--text);
  padding: 2px 10px; border-radius: 3px;
  font-size: 12px; font-weight: 500;
}
.yt-link:hover { background: var(--accent-text); color: #fff; text-decoration: none; }

/* Video page */
.video-page { max-width: 900px; }
.video-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.claim-list { list-style: none; padding: 0; }
.claim-item {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3); margin-bottom: var(--sp-3);
}
.claim-head { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }

/* Search */
.search-form { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.search-big {
  flex: 1; padding: 10px 14px;
  border: 2px solid var(--border); border-radius: var(--radius);
  font-size: 16px; background: #fff;
}
.search-big:focus { outline: none; border-color: var(--brand); }
.search-results { list-style: none; padding: 0; }
.search-results li {
  padding: var(--sp-2) 0; border-bottom: 1px solid var(--border);
}

/* Forms (RTR) */
.form-page { max-width: 760px; }
.form-stacked fieldset {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-4); margin-bottom: var(--sp-4);
  background: #fff;
}
.form-stacked legend {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); font-weight: 600;
  padding: 0 var(--sp-2);
}
.field { margin-bottom: var(--sp-3); }
.field label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 14px; }
.field .req { color: var(--danger); }
.field input[type=text], .field input[type=email], .field input[type=url],
.field select, .field textarea, .field input[type=date] {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(58,74,92,0.1);
}
.field textarea { resize: vertical; min-height: 100px; font-family: inherit; }
.field .hint { font-size: 12px; color: var(--text-muted); display: block; margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.check-label { font-weight: 400; display: flex; align-items: flex-start; gap: var(--sp-2); }
.form-actions { display: flex; gap: var(--sp-3); justify-content: flex-end; margin-top: var(--sp-4); }

.alert {
  padding: var(--sp-4);
  border-radius: var(--radius);
  margin: var(--sp-4) 0;
  border-left: 4px solid;
}
.alert.success { background: #dceadd; border-left-color: var(--success); }
.alert.error { background: #f3d4ce; border-left-color: var(--danger); }
.alert h2 { margin-top: 0; }

/* Empty state */
.empty-state { color: var(--text-muted); padding: var(--sp-5); text-align: center; background: var(--surface); border-radius: var(--radius); }
.subtitle { color: var(--text-muted); margin-top: -8px; margin-bottom: var(--sp-4); }

/* Explore — fullscreen layout (no h1, no footer per page override).
   body in flex column ensures topbar takes natural height, main fills rest. */
body:has(.explore-wrap) {
  display: flex; flex-direction: column; min-height: 100dvh;
}
body:has(.explore-wrap) main {
  flex: 1 1 auto; min-height: 0; display: flex;
  max-width: none; padding: 0; margin: 0;
}
.explore-wrap {
  display: grid;
  grid-template-rows: auto 1fr auto;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.explore-toolbar {
  display: flex; gap: var(--sp-2); align-items: center;
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface); border-top: 1px solid var(--border);
}
.search-input {
  flex: 1; max-width: 360px;
  padding: 8px 12px; font: inherit;
  background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(58, 74, 92, 0.1); }
.search-result-count { font-size: 12px; color: var(--text-muted); }

.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: 13px;
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; user-select: none;
  transition: all 120ms ease;
}
.filter-chip input[type="checkbox"] { display: none; }
.filter-chip[data-active="true"] {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.filter-chip:hover:not([data-active="true"]) { background: rgba(0,0,0,0.04); color: var(--text); }

.toolbar-sep { color: var(--text-muted); margin: 0 4px; }
.toolbar-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

.category-chips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.category-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; user-select: none;
  transition: opacity 120ms ease;
}
.category-chip input[type="checkbox"] { display: none; }
.category-chip[data-active="false"] { opacity: 0.4; }
.category-chip:hover { background: rgba(0,0,0,0.04); }
.cat-swatch {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; flex: 0 0 auto;
}

.explore-canvas-wrap { position: relative; min-height: 400px; }
.explore-canvas {
  width: 100%; height: 100%; min-height: 400px;
  background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.zoom-controls {
  position: absolute; bottom: 16px; right: 16px;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  z-index: 10;
}
.zoom-controls button {
  width: 36px; height: 36px;
  font-size: 18px; line-height: 1;
  background: transparent; color: var(--text);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.zoom-controls button + button { border-top: 1px solid var(--border); }
.zoom-controls button:hover { background: rgba(0,0,0,0.04); }
.zoom-controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.explore-loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--surface); padding: var(--sp-4); border-radius: var(--radius);
  border: 1px solid var(--border);
  z-index: 5;
}
.explore-details {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: var(--sp-3);
  font-size: 14px; line-height: 1.5;
}

/* Sidebar headings */
.sidebar-h {
  font-size: 18px; color: var(--text); margin: 0 0 var(--sp-3);
  font-weight: 700; line-height: 1.2;
}
.sidebar-h-sm {
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: var(--sp-4) 0 var(--sp-2); font-weight: 700;
}
.sidebar-h-sm .muted {
  font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--text-muted); font-size: 11px;
}
.sidebar-divider {
  border: 0; border-top: 1px solid var(--border); margin: var(--sp-3) 0;
}

/* Stats 2x2 grid */
.sidebar-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.sidebar-stat {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; text-align: left;
}
.sidebar-stat-value {
  display: block; font-size: 24px; font-weight: 700;
  color: var(--text); line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}
.sidebar-stat-label {
  display: block; margin-top: 4px; font-size: 11px; color: var(--text-muted);
}

/* Top entities list */
.sidebar-top {
  list-style: none; padding: 0; margin: 0; counter-reset: rank;
}
.sidebar-top li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  counter-increment: rank; min-height: 36px;
}
.sidebar-top li:last-child { border-bottom: none; }
.sidebar-top li::before {
  content: counter(rank); flex: 0 0 20px;
  font-size: 11px; color: var(--text-muted);
  font-variant-numeric: tabular-nums; text-align: right;
}
.sidebar-top a {
  flex: 1 1 auto; color: var(--text); text-decoration: none;
  font-weight: 500; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-top a:hover { text-decoration: underline; }
.sidebar-top-count {
  flex: 0 0 auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 8px; font-size: 11px;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
}

/* Categories with bar viz */
.sidebar-cats {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-cat {
  display: grid; grid-template-columns: 10px 1fr auto 80px;
  align-items: center; gap: 8px; font-size: 12px;
}
.sidebar-cat-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.sidebar-cat-count {
  font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 11px;
}
.sidebar-cat-bar {
  height: 4px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.sidebar-cat-bar-fill { height: 100%; border-radius: 2px; }

/* Hint card */
.sidebar-hint {
  background: rgba(0,0,0,0.02); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
}
.sidebar-hint .sidebar-h-sm { margin-top: 0; }
.sidebar-hint-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--text);
}
.sidebar-hint-list li::before {
  content: "→ "; color: var(--accent); font-weight: 700;
}

/* Selected state — back button */
.sidebar-back {
  background: transparent; border: 0; color: var(--text);
  cursor: pointer; padding: 6px 0; font: inherit; font-size: 12px;
  margin-bottom: var(--sp-2);
}
.sidebar-back:hover { text-decoration: underline; }

/* Bottom-sheet handle (vizibil doar pe mobile) */
.bottom-sheet-handle { display: none; }

@media (min-width: 1024px) {
  .explore-wrap {
    grid-template-columns: 1fr 380px;
    grid-template-rows: auto 1fr;
  }
  .explore-toolbar { grid-column: 1 / -1; }
  .explore-canvas-wrap { grid-column: 1; grid-row: 2; }
  .explore-details {
    grid-column: 2; grid-row: 2;
    border-top: none; border-left: 1px solid var(--border);
    max-height: none;
  }
}

/* MOBILE — bottom-sheet pattern.
   Canvas full-width între toolbar și sheet-ul de jos. */
@media (max-width: 1023px) {
  .explore-wrap {
    display: flex; flex-direction: column;
    position: relative;
  }
  .explore-toolbar {
    flex-wrap: wrap; gap: 8px;
    padding: 8px 12px;
    position: sticky; top: 0; z-index: 30;
  }
  .search-input {
    flex: 1 1 100%; max-width: none;
    min-height: 44px; font-size: 16px; /* 16px previne zoom iOS focus */
  }
  .filter-chip {
    min-height: 44px; padding: 10px 14px;
    font-size: 14px;
  }
  .toolbar-sep, .toolbar-label { display: none; }
  .category-chips {
    width: 100%; gap: 6px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap; scrollbar-width: none;
    padding-bottom: 4px;
  }
  .category-chips::-webkit-scrollbar { display: none; }
  .category-chip {
    min-height: 36px; padding: 8px 12px; font-size: 13px;
    flex: 0 0 auto;
  }

  .explore-canvas-wrap {
    flex: 1 1 auto;
    min-height: 50vh;
    padding-bottom: 56px; /* loc pentru sheet-ul în peek */
  }
  .explore-canvas { min-height: 0; }
  .zoom-controls { bottom: 72px; right: 12px; }
  .zoom-controls button { width: 44px; height: 44px; font-size: 22px; }

  .explore-details {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 40;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.10);
    padding: 0;
    transition: height 240ms ease;
    overflow: hidden;
    will-change: height;
  }
  .explore-details[data-sheet="peek"] { height: 56px; }
  .explore-details[data-sheet="half"] { height: 50dvh; }
  .explore-details[data-sheet="full"] { height: calc(100dvh - 60px); }

  .bottom-sheet-handle {
    display: flex; align-items: center; justify-content: center;
    height: 56px; width: 100%;
    background: var(--surface); border: 0;
    color: var(--text-muted); font-size: 13px; font-weight: 600;
    cursor: pointer; padding-top: 16px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-sheet-handle::before {
    content: '';
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px;
    background: var(--border); border-radius: 2px;
  }
  .bottom-sheet-handle:active::before { background: var(--accent); }

  .explore-details-inner {
    height: calc(100% - 56px);
    overflow-y: auto; overscroll-behavior: contain;
    padding: 0 var(--sp-3) var(--sp-3);
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-back { min-height: 44px; padding: 10px 0; font-size: 14px; }

  /* Footer ascuns pe mobile pe /explore — sheet-ul îl ar acoperi oricum */
  body:has(.explore-wrap) .footer { display: none; }
}

/* Legal pages */
.legal-page { max-width: 760px; }
.legal-content { line-height: 1.7; }
.legal-content h2 { color: var(--brand); margin-top: var(--sp-5); }
.legal-content h3 { color: var(--text); margin-top: var(--sp-4); }
.legal-content code { background: var(--surface); padding: 1px 4px; border-radius: 2px; font-size: 0.9em; }
.legal-content pre { background: var(--surface); padding: var(--sp-3); border-radius: var(--radius); overflow-x: auto; }
.legal-content table { border-collapse: collapse; margin: var(--sp-3) 0; width: 100%; font-size: 14px; }
.legal-content th, .legal-content td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.legal-content th { background: var(--surface); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.legal-content blockquote {
  border-left: 4px solid var(--accent);
  padding: var(--sp-2) var(--sp-3);
  background: var(--warning-soft);
  margin: var(--sp-3) 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.legal-content a { color: var(--brand); text-decoration: underline; }
.legal-content ul, .legal-content ol { padding-left: var(--sp-5); }

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--sp-5);
  margin-top: var(--sp-7);
  text-align: center;
}
.footer-inner { max-width: 800px; margin: 0 auto; font-size: 14px; }
.footer p { margin: var(--sp-2) 0; color: var(--text-muted); }
.footer p:first-child { color: var(--text); }
.footer a { color: var(--brand); }

@media (max-width: 768px) {
  main { padding: var(--sp-3); }
  h1 { font-size: 26px; }
  .hero h1 { font-size: 32px; line-height: 1.1; }
  .stat-value { font-size: 32px; }
  .lead { font-size: 15px; }
  .nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .stats-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .lead-action { flex-direction: column; }
  .lead-action .btn { width: 100%; text-align: center; }
}

/* ============================================================================
 * Audit fix v2 (2026-04-28) — patches dupa raportul agentului 03-designer.
 * Vezi docs/agent-reports/designer-css-audit-m4.jsonl
 * ============================================================================ */

/* Focus visible universal (P0.1, WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.btn-sm:focus-visible,
.nav a:focus-visible,
.top-card:focus-visible,
.yt-link:focus-visible,
.search-big:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  box-shadow: none;
}
.search-big:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--brand);
}

/* Skip-link (P0 — accesibilitate keyboard) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: var(--sp-3) var(--sp-4);
  z-index: 1000;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  outline: 3px solid var(--focus-ring);
}

/* Touch targets ≥44px (P0.7, WCAG 2.5.5) */
.nav a {
  padding: 11px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.btn {
  padding: 12px 20px;
  min-height: 44px;
}
.btn-sm { min-height: 36px; }
@media (max-width: 767px) {
  .btn-sm { min-height: 44px; padding: 10px 14px; font-size: 14px; }
  .yt-link { min-height: 44px; padding: 10px 14px; }
}

/* Contrast fix categorii (P1.9) — text negru pe verde si orange */
.rel-cat.cat-social {
  background: var(--cat-social);
  color: #1A1F26;
}
.rel-cat.cat-media {
  background: var(--cat-media);
  color: #1A1F26;
}

/* Tabular nums + display tracking (P1.2, P1.3) */
.stat-value,
.rel-conf,
.confidence-pill,
.hist-count,
.hist-label {
  font-variant-numeric: tabular-nums lining-nums;
}
.stat-value {
  letter-spacing: -0.02em;
}
.stat-label {
  color: var(--brand);
  font-weight: 600;
}

/* prefers-reduced-motion (P1.5) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .top-card:hover { transform: none; }
}

/* Banner disclaimer — link mai puternic */
.banner-disclaimer strong { color: var(--accent-text); }
.banner-disclaimer a {
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* .rel-item reflow at 320px — pastreaza informatia critica (P0.6) */
.rel-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "cat       arrow-other"
    "pred      pred"
    "meta      meta"
    "quote     quote";
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.rel-item:last-child { border-bottom: none; }
.rel-item .rel-cat { grid-area: cat; align-self: center; }
.rel-item .rel-other { grid-area: arrow-other; }
.rel-item .rel-arrow { display: none; }
.rel-item .rel-pred { grid-area: pred; font-size: 14px; }
.rel-item .rel-conf,
.rel-item .rel-srcs { display: inline-block; }
.rel-item .rel-quote { grid-area: quote; }
.rel-item .rel-meta-row {
  grid-area: meta;
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  font-size: 13px;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .rel-item {
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-areas:
      "cat arrow other pred metaconf"
      "quote quote quote quote quote";
  }
  .rel-item .rel-arrow { display: inline-block; grid-area: arrow; }
  .rel-item .rel-pred { grid-area: pred; }
  .rel-item .rel-meta-row { grid-area: metaconf; }
}

/* Stat card — brand dot subtil */
.stat-card {
  position: relative;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* Aliases row — virgule fara orfani */
.aliases-row code { display: inline-block; margin: 2px 0; }

/* Cazuri longform list */
.cases-list { list-style: none; padding: 0; display: grid; gap: var(--sp-3); }
.case-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.case-link {
  display: block;
  padding: var(--sp-4);
  color: inherit;
  text-decoration: none;
}
.case-link:hover {
  border-color: var(--brand);
  text-decoration: none;
}
.case-link h2 { margin: 0 0 var(--sp-2) 0; color: var(--brand); }
.case-summary { margin: 0; color: var(--text); }
.case-date { margin-top: var(--sp-2); font-size: 13px; }

/* Caz detail page */
.case-page { max-width: 760px; }
.case-page .lead { font-size: var(--fs-lg); }
.case-entities-row {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin: var(--sp-3) 0;
}
.entity-chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
}
.entity-chip:hover { border-color: var(--brand); text-decoration: none; }

/* Rel quote actions (separare link-in-link, P0.9) */
.rel-quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin-top: var(--sp-2);
}
.rel-quote-source { font-size: 13px; }
