:root {
    --un-blue: #0086cd;
    --un-blue-dark: #0072a3;
    --un-blue-deeper: #004e6a;
    --un-blue-light: #e6f5fc;
    --un-blue-pale: #f0f9fd;
    --un-gold: #d4a843;
    --un-gold-light: #f5ecd4;
    --text-primary: #1a1a2e;
    --text-secondary: #3d3d5c;
    --text-muted: #6b6b8d;
    --border-light: #d6dce4;
    --border-medium: #b0bec5;
    --bg-white: #ffffff;
    --bg-cream: #fafbfc;
    --bg-section: #f5f7fa;
    --chart-red: #e74c3c;
    --chart-orange: #f39c12;
    --chart-green: #27ae60;
    --chart-purple: #8e44ad;
    --chart-teal: #1abc9c;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { font-size: 16px; scroll-behavior: smooth; }

  body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: #e8ecf1;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
  }

  .document-wrapper { max-width: 920px; margin: 0 auto; background: var(--bg-white); box-shadow: 0 0 60px rgba(0,0,0,0.08); }

  /* === TITLE PAGE === */
  .title-page {
    position: relative;
    background: linear-gradient(160deg, var(--un-blue-deeper) 0%, var(--un-blue) 100%);
    color: #fff; padding: 60px 60px 50px; overflow: hidden;
  }
  .title-page::before {
    content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
  }
  .title-page::after {
    content: ''; position: absolute; bottom: -30%; left: -10%; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(212,168,67,0.08) 0%, transparent 70%);
    border-radius: 50%;
  }

  .agency-badge {
    display: table; margin: 0 auto 10px; position: relative; z-index: 1;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 6px 22px;
    border-radius: 50px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  }

  .un-org-name { text-align: center; font-size: 0.95rem; font-weight: 300; letter-spacing: 5px; text-transform: uppercase; margin-bottom: 30px; opacity: 0.85; position: relative; z-index: 1; }

  .header-meta {
    display: flex; justify-content: space-between; font-size: 0.8rem; opacity: 0.8;
    margin-bottom: 20px; position: relative; z-index: 1;
    border-bottom: 1px solid rgba(255,255,255,0.15); padding-bottom: 18px;
  }
  .header-meta-left { text-align: left; line-height: 1.7; }
  .header-meta-right { text-align: right; line-height: 1.7; }

  .doc-reference {
    display: inline-block; background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 4px 16px; border-radius: 4px;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 0.95rem; font-weight: 700; letter-spacing: 1px;
    margin: 14px 0 24px; position: relative; z-index: 1;
  }

  .title-decorative-line { width: 80px; height: 3px; background: var(--un-gold); margin: 20px 0; position: relative; z-index: 1; }

  .title-page h1 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.75rem; font-weight: 700; line-height: 1.35;
    margin-bottom: 12px; position: relative; z-index: 1;
  }
  .title-page .subtitle { font-size: 1rem; font-weight: 300; opacity: 0.9; font-style: italic; position: relative; z-index: 1; line-height: 1.7; }

  /* === EXECUTIVE SUMMARY === */
  .executive-summary {
    background: var(--un-blue-pale); border-left: 4px solid var(--un-blue);
    margin: 40px 60px; padding: 32px 36px; position: relative;
  }
  .executive-summary::before {
    content: 'EXECUTIVE SUMMARY'; display: block;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 3px;
    color: var(--un-blue-dark); margin-bottom: 16px;
    padding-bottom: 10px; border-bottom: 1px solid rgba(0,134,205,0.2);
  }
  .executive-summary p { font-size: 0.92rem; line-height: 1.85; color: var(--text-secondary); margin-bottom: 14px; text-align: justify; }
  .executive-summary p:last-child { margin-bottom: 0; }

  /* === TABLE OF CONTENTS === */
  .toc-section {
    margin: 0 60px 30px; padding: 36px 0;
    border-top: 2px solid var(--un-blue);
    border-bottom: 1px solid var(--border-light);
  }
  .toc-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.1rem; font-weight: 700; color: var(--un-blue-dark);
    letter-spacing: 2px; text-transform: uppercase; margin-bottom: 24px;
  }
  .toc-list { list-style: none; }
  .toc-list > li { margin-bottom: 6px; }
  .toc-list > li > a {
    display: flex; align-items: baseline;
    text-decoration: none; color: var(--text-primary);
    font-weight: 600; font-size: 0.92rem; padding: 6px 0;
    transition: color 0.2s;
  }
  .toc-list > li > a:hover { color: var(--un-blue); }
  .toc-list > li > a .toc-num { color: var(--un-blue-dark); font-weight: 700; min-width: 40px; }
  .toc-list > li > a .toc-dots { flex: 1; border-bottom: 1px dotted var(--border-medium); margin: 0 8px; min-height: 1px; position: relative; top: -4px; }

  /* === CONTENT BODY === */
  .content-body { padding: 0 60px 40px; }

  .chapter { margin-top: 50px; padding-top: 40px; border-top: 2px solid var(--un-blue); position: relative; }
  .chapter:first-child { margin-top: 20px; border-top: none; padding-top: 0; }

  .chapter-number {
    display: inline-block; background: var(--un-blue); color: #fff;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 2px;
    padding: 4px 14px; border-radius: 2px; margin-bottom: 14px;
    text-transform: uppercase;
  }

  .content-body h2 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.35rem; font-weight: 700; color: var(--un-blue-deeper);
    line-height: 1.35; margin-bottom: 24px;
  }
  .content-body h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem; font-weight: 700; color: var(--un-blue-dark);
    margin-top: 34px; margin-bottom: 14px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
  }
  .content-body h4 {
    font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
    margin-top: 26px; margin-bottom: 10px;
  }
  .content-body p {
    font-size: 0.93rem; line-height: 1.85; color: var(--text-secondary);
    margin-bottom: 16px; text-align: justify; hyphens: auto;
  }
  .content-body strong { color: var(--text-primary); font-weight: 600; }
  .content-body ol, .content-body ul { margin: 16px 0 16px 24px; color: var(--text-secondary); font-size: 0.93rem; line-height: 1.85; }
  .content-body ol li, .content-body ul li { margin-bottom: 10px; padding-left: 4px; }
  .content-body ol li strong { color: var(--un-blue-dark); }
  .chapter-intro { font-size: 0.96rem; line-height: 1.85; color: var(--text-primary); font-weight: 400; margin-bottom: 20px; }

  /* === STAT CARDS === */
  .stat-callout { display: flex; gap: 16px; flex-wrap: wrap; margin: 24px 0; }
  .stat-card {
    flex: 1 1 140px;
    background: var(--un-blue-pale);
    border: 1px solid rgba(0,134,205,0.2);
    border-top: 3px solid var(--un-blue);
    border-radius: 4px; padding: 18px 16px;
    text-align: center; min-width: 130px;
  }
  .stat-card .stat-number {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.6rem; font-weight: 700;
    color: var(--un-blue-deeper); line-height: 1.2;
  }
  .stat-card .stat-label {
    font-size: 0.72rem; color: var(--text-muted);
    margin-top: 6px; line-height: 1.4;
    text-transform: uppercase; letter-spacing: 0.5px;
  }

  /* === MISSION BOX === */
  .mission-box {
    background: var(--un-blue-pale); border-left: 5px solid var(--un-blue);
    padding: 28px 32px; border-radius: 0 6px 6px 0;
    font-size: 1rem; font-style: italic;
    margin: 28px 0; color: var(--un-blue-deeper);
    line-height: 1.85;
  }

  /* === RISK GRID === */
  .risk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; margin-top: 24px; }
  .risk-card {
    background: white; border: 1px solid var(--border-light);
    border-radius: 6px; overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .risk-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }
  .risk-header {
    padding: 14px 20px; color: white;
    font-weight: 700; font-size: 0.8rem;
    letter-spacing: 1.5px; text-transform: uppercase;
  }
  .risk-content { padding: 20px; }
  .risk-content p { font-size: 0.88rem; margin-bottom: 12px; }
  .risk-content ul { font-size: 0.85rem; padding-left: 20px; color: var(--text-secondary); margin-top: 10px; }
  .risk-content ul li { margin-bottom: 6px; }
  .risk-level-1 { background: var(--chart-red); }
  .risk-level-2 { background: var(--chart-orange); }
  .risk-level-3 { background: var(--un-blue); }
  .risk-level-4 { background: var(--chart-green); }

  /* === ORG CHART === */
  .org-chart { margin: 30px 0; }
  .tree-node {
    background: var(--un-blue-deeper); color: #fff;
    border-radius: 6px; padding: 14px 20px;
    text-align: center; font-weight: 700; font-size: 0.95rem;
    width: 280px; margin: 0 auto 0;
    position: relative; z-index: 2; letter-spacing: 0.5px;
  }
  .tree-connector-v { height: 24px; border-left: 2px solid var(--un-blue); margin: 0 auto; width: 0; }
  .tree-connector-h { height: 0; border-top: 2px solid var(--un-blue); width: 85%; margin: 0 auto; }
  .tree-children { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 0; }
  .tree-child {
    background: var(--un-blue-pale); border: 1px solid rgba(0,134,205,0.25);
    border-top: 3px solid var(--un-blue);
    border-radius: 6px; padding: 16px;
    text-align: center; font-size: 0.88rem;
    flex: 1; min-width: 160px;
  }
  .tree-child strong { color: var(--un-blue-deeper); font-size: 0.9rem; }
  .tree-child span { display: block; margin-top: 6px; font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

  .tree-level-2 { margin-top: 20px; }
  .tree-level-2 .tree-child { border-top-color: var(--un-gold); background: var(--un-gold-light); }
  .tree-level-2 .tree-child strong { color: #8B6914; }

  /* === DATA VISUALIZATION === */
  .viz-container {
    background: var(--bg-section); border: 1px solid var(--border-light);
    border-radius: 6px; padding: 28px 24px; margin: 28px 0; position: relative;
  }
  .viz-container::before {
    content: attr(data-figure); display: block;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 2px;
    color: var(--un-blue-dark); text-transform: uppercase; margin-bottom: 8px;
  }
  .viz-title {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1rem; font-weight: 700;
    color: var(--un-blue-deeper); margin-bottom: 6px;
  }
  .viz-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 18px; font-style: italic; }
  .viz-source {
    font-size: 0.72rem; color: var(--text-muted);
    margin-top: 14px; padding-top: 10px;
    border-top: 1px solid var(--border-light); font-style: italic;
  }
  .chart-wrapper { position: relative; width: 100%; max-height: 400px; }
  .chart-wrapper canvas { width: 100% !important; }

  /* === ENFORCEMENT CARDS === */
  .enforcement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin: 24px 0; }
  .enforcement-card {
    background: #fff; padding: 22px; border-radius: 6px;
    border: 1px solid var(--border-light);
    border-top: 4px solid var(--un-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  }
  .enforcement-card h4 { font-size: 0.95rem; color: var(--un-blue-deeper); margin-bottom: 10px; }
  .enforcement-card p { font-size: 0.88rem; }

  /* === CASE STUDY BOX === */
  .case-study-box {
    background: #fff8f0; border-left: 4px solid var(--chart-orange);
    padding: 20px 24px; margin: 20px 0; border-radius: 0 4px 4px 0;
  }
  .case-study-box h5 { font-size: 0.9rem; font-weight: 700; color: #c0392b; margin-bottom: 8px; }
  .case-study-box p { font-size: 0.85rem; margin-bottom: 8px; text-align: left; }

  /* === PRINCIPLE CARDS === */
  .principles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin: 24px 0; }
  .principle-card {
    background: var(--bg-section); border: 1px solid var(--border-light);
    border-radius: 6px; padding: 24px; text-align: center;
  }
  .principle-icon { font-size: 2rem; margin-bottom: 12px; }
  .principle-card h4 { font-size: 0.95rem; color: var(--un-blue-deeper); margin-bottom: 10px; }
  .principle-card p { font-size: 0.85rem; text-align: center; }

  /* === RECOMMENDATIONS BOX === */
  .recommendations-box {
    background: var(--bg-section); border: 1px solid var(--border-light);
    border-radius: 4px; padding: 28px 32px; margin: 24px 0;
  }
  .recommendations-box ol li { margin-bottom: 14px; }

  /* === DATA TABLE === */
  .data-table-wrapper { overflow-x: auto; margin: 20px 0; }
  .data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; border: 1px solid var(--border-light); }
  .data-table thead th {
    background: var(--un-blue-deeper); color: #fff;
    padding: 12px 14px; text-align: left;
    font-weight: 600; font-size: 0.8rem; letter-spacing: 0.5px;
  }
  .data-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }
  .data-table tbody tr:nth-child(even) { background: var(--un-blue-pale); }
  .data-table tbody tr:hover { background: var(--un-blue-light); }

  /* === FOOTER === */
  .document-footer {
    background: var(--un-blue-deeper); color: rgba(255,255,255,0.7);
    padding: 30px 60px; display: flex; justify-content: space-between;
    align-items: center; font-size: 0.78rem;
  }
  .footer-left { line-height: 1.7; }
  .footer-right { text-align: right; font-style: italic; opacity: 0.7; }
  .footer-ref { font-weight: 600; color: rgba(255,255,255,0.9); letter-spacing: 1px; }

  /* === BACK TO TOP === */
  #backToTop {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--un-blue); color: white;
    width: 44px; height: 44px; border-radius: 50%; border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer; font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s, transform 0.3s, background 0.3s;
    z-index: 1000;
  }
  #backToTop.visible { opacity: 1; pointer-events: auto; }
  #backToTop:hover { background: var(--un-blue-deeper); transform: scale(1.1); }

  /* === PRINT === */
  @media print {
    body { background: #fff; }
    .document-wrapper { box-shadow: none; max-width: 100%; margin: 0; }
    .title-page { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .chapter { page-break-before: always; margin-top: 0; border-top: none; }
    .chapter:first-of-type { page-break-before: auto; }
    a { color: inherit !important; text-decoration: none !important; }
    #backToTop { display: none; }
  }

  /* === RESPONSIVE === */
  @media (max-width: 768px) {
    .title-page, .executive-summary, .content-body, .document-footer { padding-left: 24px; padding-right: 24px; }
    .toc-section { margin-left: 24px; margin-right: 24px; }
    .executive-summary { margin-left: 24px; margin-right: 24px; }
    .title-page h1 { font-size: 1.3rem; }
    .header-meta { flex-direction: column; gap: 8px; }
    .stat-callout { flex-direction: column; }
    .risk-grid { grid-template-columns: 1fr; }
    .enforcement-grid { grid-template-columns: 1fr; }
    .principles-grid { grid-template-columns: 1fr; }
    .tree-children { flex-direction: column; }
    .tree-node { width: 100%; }
    .document-footer { flex-direction: column; gap: 12px; text-align: center; }
    .footer-right { text-align: center; }
  }

  [id] { scroll-margin-top: 20px; }
