  :root {
    --green: #005753;
    --green-light: #007A75;
    --green-pale: #e0f2f1;
    --red: #c1121f;
    --red-pale: #ffe0e0;
    --orange: #e76f51;
    --orange-pale: #fff0eb;
    --yellow: #e9c46a;
    --yellow-pale: #fffbe6;
    --blue: #005753;
    --blue-pale: #e0f2f1;
    --gray: #6c757d;
    --gray-light: #f8f9fa;
    --gray-mid: #e9ecef;
    --dark: #003330;
    --text: #212529;
    --border: #dee2e6;
    --teal: #005753;
    --teal-mid: #007A75;
    --teal-light: #00938C;
    --teal-pale: #e0f2f1;
    --cyan: #00D9FF;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f7f6;
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
  }

  /* HEADER */
  .report-header {
    background: linear-gradient(135deg, #001a18 0%, #003330 30%, #005753 65%, #007A75 100%);
    color: white;
    padding: 128px 40px 56px;
    position: relative;
    overflow: hidden;
  }
  .report-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0,217,255,0.08) 0%, transparent 70%);
    pointer-events: none;
  }
  .report-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,217,255,0.3), transparent);
  }
  .report-header-inner { display: flex; align-items: flex-start; gap: 32px; position: relative; z-index: 1; }
  .report-header-logo { flex-shrink: 0; }
  .report-header-logo img { height: 56px; width: auto; filter: brightness(0) invert(1); }
  .report-header-text { flex: 1; }
  .report-header .meta { font-size: 11px; text-transform: uppercase; letter-spacing: 3px; opacity: 0.5; margin-bottom: 16px; font-weight: 500; }
  .report-header h1 { font-size: 36px; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.5px; }
  .report-header .subtitle { opacity: 0.7; font-size: 15px; max-width: 640px; line-height: 1.6; }
  .report-header .date { margin-top: 24px; font-size: 12px; opacity: 0.4; letter-spacing: 0.3px; }
  .report-header .header-accent { display: inline-block; width: 48px; height: 3px; background: linear-gradient(90deg, var(--cyan), rgba(0,217,255,0.3)); border-radius: 2px; margin-bottom: 20px; }
  .report-header .header-kpis { display: flex; gap: 32px; margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); }
  .report-header .header-kpi { text-align: left; }
  .report-header .header-kpi-value { font-size: 24px; font-weight: 800; color: var(--cyan); }
  .report-header .header-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.5; margin-top: 2px; }

  /* LAYOUT */
  .container { max-width: 1000px; margin: 0 auto; padding: 32px 24px; }

  /* EXECUTIVE SUMMARY BAR */
  .exec-bar {
    background: white;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 2fr;
    gap: 24px;
    align-items: center;
  }
  .score-box { text-align: center; }
  .score-box .label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--gray); margin-bottom: 6px; }
  .score-circle {
    width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 22px; font-weight: 700; margin: 0 auto 6px;
  }
  .score-bad { background: var(--red-pale); color: var(--red); }
  .score-med { background: var(--orange-pale); color: var(--orange); }
  .score-ok  { background: var(--yellow-pale); color: #b5800d; }
  .score-good { background: var(--green-pale); color: var(--green); }
  .exec-bar .verdict { border-left: 3px solid var(--orange); padding-left: 20px; }
  .exec-bar .verdict h3 { font-size: 15px; color: var(--orange); margin-bottom: 6px; }
  .exec-bar .verdict p { font-size: 13px; color: var(--gray); line-height: 1.5; }

  /* EASY WINS */
  .easy-wins {
    background: linear-gradient(135deg, #003330, #005753);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 32px;
    color: white;
  }
  .easy-wins h2 { font-size: 18px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
  .easy-wins h2 span { background: var(--cyan); color: #003330; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
  .win-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .win-card {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    padding: 16px;
  }
  .win-card .effort { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--cyan); margin-bottom: 8px; }
  .win-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
  .win-card p { font-size: 12px; opacity: 0.65; line-height: 1.4; }

  /* SECTION CARD */
  .card {
    background: white;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
  }
  .card h2 {
    font-size: 17px; font-weight: 700; margin-bottom: 20px;
    padding-bottom: 14px; border-bottom: 2px solid var(--gray-mid);
    display: flex; align-items: center; gap: 10px;
  }
  .card h2 .icon { font-size: 20px; }
  .card h3 { font-size: 14px; font-weight: 600; color: var(--blue); margin: 20px 0 10px; text-transform: uppercase; letter-spacing: .5px; }

  /*
   * CKEditor 5 wraps every <table> on save in <figure class="table">. We
   * render that wrapper the same way we rendered the original
   * <div style="overflow-x:auto"> — horizontal scroll on narrow widths —
   * so pre-edit and post-edit HTML look identical on the FE.
   */
  figure.table {
    display: block;
    width: 100%;
    margin: 0 0 16px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  figure.table > table { margin: 0; width: 100%; }

  /*
   * Table row highlight classes. Replaces inline background:var(--X-pale)
   * on <tr>/<thead>/<tbody>, which CK5's TableProperties plugin drops
   * because CSS custom properties aren't in its colour whitelist.
   */
  tr.row-teal-pale,   .row-teal-pale > td, .row-teal-pale > th   { background: var(--teal-pale); }
  tr.row-green-pale,  .row-green-pale > td, .row-green-pale > th  { background: var(--green-pale); }
  tr.row-red-pale,    .row-red-pale > td, .row-red-pale > th    { background: var(--red-pale); }
  tr.row-orange-pale, .row-orange-pale > td, .row-orange-pale > th { background: var(--orange-pale); }
  tr.row-yellow-pale, .row-yellow-pale > td, .row-yellow-pale > th { background: var(--yellow-pale); }
  tr.row-gray-light,  .row-gray-light > td, .row-gray-light > th  { background: var(--gray-light); }

  /* COMPETITOR COMPARISON TABLE */
  .comp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .comp-table th {
    background: var(--dark);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
  }
  .comp-table th.highlight { background: var(--teal); }
  .comp-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  .comp-table tr:last-child td { border-bottom: none; }
  .comp-table tr:hover td { background: var(--gray-light); }
  .comp-table td.highlight { background: #e8f6f5; font-weight: 500; border-left: 3px solid var(--teal-mid); }
  .comp-table code { word-break: break-all; }

  /* BADGE PILLS */
  .pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
  }
  .pill-red { background: var(--red-pale); color: var(--red); }
  .pill-green { background: var(--green-pale); color: var(--green); }
  .pill-yellow { background: var(--yellow-pale); color: #8a6300; }
  .pill-orange { background: var(--orange-pale); color: #c0521f; }
  .pill-blue { background: var(--blue-pale); color: var(--blue); }
  .pill-gray { background: var(--gray-mid); color: var(--gray); }

  /* ISSUES LIST */
  .issue-list { list-style: none; }
  .issue-list li {
    display: flex; gap: 14px; padding: 12px 0;
    border-bottom: 1px solid var(--gray-mid);
    align-items: flex-start;
  }
  .issue-list li:last-child { border-bottom: none; }
  .issue-icon {
    width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center;
    justify-content: center; font-size: 14px; flex-shrink: 0;
  }
  .issue-critical { background: var(--red-pale); }
  .issue-high { background: var(--orange-pale); }
  .issue-med { background: var(--yellow-pale); }
  .issue-info { background: var(--blue-pale); }
  .issue-content { flex: 1; }
  .issue-content strong { display: block; font-size: 13px; margin-bottom: 3px; }
  .issue-content span { font-size: 12px; color: var(--gray); }
  .issue-content code {
    background: var(--gray-light); padding: 1px 6px; border-radius: 4px;
    font-family: monospace; font-size: 11px; color: var(--red); border: 1px solid var(--border);
  }

  /* MULTILANG MATRIX */
  .lang-matrix { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 480px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .lang-matrix th {
    background: var(--gray-light); padding: 10px 14px; text-align: left;
    font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
    border-bottom: 2px solid var(--border);
  }
  .lang-matrix td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  .lang-matrix tr:hover td { background: var(--gray-light); }
  .check { color: var(--green); font-weight: 700; }
  .cross { color: var(--red); font-weight: 700; }
  .warn { color: var(--orange); font-weight: 700; }

  /* SCORE BAR */
  .score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
  .score-row .label { width: 200px; font-size: 13px; color: var(--text); flex-shrink: 0; }
  .score-bar-wrap { flex: 1; height: 10px; background: var(--gray-mid); border-radius: 10px; overflow: hidden; }
  .score-bar { height: 100%; border-radius: 10px; transition: width .3s; }
  .score-num { width: 36px; font-size: 12px; font-weight: 700; text-align: right; flex-shrink: 0; }
  .bar-red { background: linear-gradient(90deg, var(--red), #e63946); }
  .bar-orange { background: linear-gradient(90deg, var(--orange), #f4a261); }
  .bar-yellow { background: linear-gradient(90deg, #e9c46a, #f4d03f); }
  .bar-green { background: linear-gradient(90deg, var(--teal-mid), var(--teal-light)); }

  /* TWO COLUMNS */
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

  /* STAT CARDS */
  .stat-card {
    background: var(--gray-light); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px 20px;
  }
  .stat-card .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--gray); margin-bottom: 4px; }
  .stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--dark); }
  .stat-card .stat-sub { font-size: 12px; color: var(--gray); margin-top: 2px; }

  .callout {
    background: var(--red-pale); border-left: 4px solid var(--red);
    border-radius: 0 8px 8px 0; padding: 14px 18px; margin: 14px 0;
    font-size: 13px; line-height: 1.5;
  }
  .callout-orange { background: var(--orange-pale); border-left-color: var(--orange); }
  .callout-green { background: var(--green-pale); border-left-color: var(--green); }
  .callout-blue { background: var(--blue-pale); border-left-color: var(--blue); }
  .callout strong { display: block; margin-bottom: 4px; }

  /* STATS GRID */
  .stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }

  /* REUSABLE RESPONSIVE GRIDS */
  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

  /* INVESTMENT SECTION LAYOUT */
  .invest-body { padding: 28px 32px 0; }
  .invest-pillar { padding: 0 32px 32px; border-top: 1px solid var(--border); }
  .invest-warning { margin: 0 32px 28px; }

  /* TABS */
  .tab-group { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--gray-mid); }
  .tab { padding: 10px 20px; font-size: 13px; font-weight: 600; border: none; background: none; cursor: pointer; color: var(--gray); border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .2s; }
  .tab:hover { color: var(--teal); }
  .tab.active { color: var(--teal); border-bottom-color: var(--teal); }
  .tab-content.hidden { display: none; }

  /* TOC */
  .toc {
    background: white;
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
  }
  .toc h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--gray-mid); display: flex; align-items: center; gap: 8px; }
  .toc ol { list-style: none; counter-reset: toc; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
  .toc li { counter-increment: toc; }
  .toc li a {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px;
    text-decoration: none; color: var(--text); font-size: 13px; transition: background .15s;
  }
  .toc li a:hover { background: var(--green-pale); color: var(--green); }
  .toc li a .toc-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; background: var(--gray-mid);
    font-size: 11px; font-weight: 700; color: var(--gray); flex-shrink: 0;
  }
  .toc li a:hover .toc-num { background: var(--green-pale); color: var(--green); }
  @media (max-width: 600px) { .toc ol { grid-template-columns: 1fr; } }

  /* FOOTER */
  .report-footer { text-align: center; padding: 32px; font-size: 12px; color: var(--gray); }

  @media (max-width: 900px) {
    .exec-bar { grid-template-columns: 1fr 1fr; }
    .win-grid { grid-template-columns: 1fr 1fr; }
    .two-col, .three-col { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .grid-3 { grid-template-columns: 1fr 1fr; }

    /* Inline grids: collapse 4+ columns to 2, and 5+ to 2 */
    [style*="repeat(4,1fr)"],
    [style*="repeat(5,1fr)"] {
      grid-template-columns: repeat(2, 1fr) !important;
    }
    [style*="repeat(3,1fr)"] {
      grid-template-columns: repeat(2, 1fr) !important;
    }
    [style*="grid-template-columns:2fr 1fr"] {
      grid-template-columns: 1fr !important;
    }
  }

  /* SCROLL PROGRESS BAR */
  .scroll-progress {
    position: fixed; top: 0; left: 0; width: 0; height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--teal-light));
    z-index: 1000; transition: width 0.1s linear;
  }

  /* BACK TO TOP */
  .back-to-top {
    position: fixed; bottom: 32px; right: 32px; width: 44px; height: 44px;
    border-radius: 50%; background: var(--dark); color: white; border: none;
    cursor: pointer; font-size: 20px; display: flex; align-items: center;
    justify-content: center; opacity: 0; transform: translateY(16px);
    transition: opacity .3s, transform .3s, background .2s;
    z-index: 999; box-shadow: 0 4px 16px rgba(0,0,0,.2);
  }
  .back-to-top.visible { opacity: 1; transform: translateY(0); }
  .back-to-top:hover { background: var(--teal); }

  /* COLLAPSIBLE SECTIONS */
  .card h2 { cursor: pointer; user-select: none; position: relative; }
  .card h2::after {
    content: ''; display: inline-block; width: 8px; height: 8px;
    border-right: 2px solid var(--gray); border-bottom: 2px solid var(--gray);
    transform: rotate(-135deg); transition: transform .3s;
    margin-left: auto; flex-shrink: 0;
  }
  .card.collapsed h2::after { transform: rotate(45deg); }
  .card.collapsed .card-body { display: none; }
  /* STICKY TOC */
  .toc.sticky {
    position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
    max-width: 1000px; width: calc(100% - 48px); z-index: 100;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
    padding: 12px 24px; transition: all .3s;
  }
  .toc.sticky h2 { display: none; }
  .toc.sticky ol { gap: 4px 16px; }
  .toc.sticky li a { padding: 4px 8px; font-size: 12px; }
  .toc li a.active:not(.toc-highlight) .toc-num { background: var(--gray-mid); color: var(--gray); }
  .toc li a.active:not(.toc-highlight) { color: var(--text); }

  /* TOOLTIP */
  .tooltip-trigger { position: relative; cursor: help; }
  .tooltip-content {
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%); background: var(--dark); color: white;
    padding: 8px 12px; border-radius: 6px; font-size: 12px; line-height: 1.4;
    width: max-content; max-width: 280px; opacity: 0; pointer-events: none;
    transition: opacity .2s; z-index: 50; text-transform: none;
    letter-spacing: normal; font-weight: 400;
  }
  .tooltip-content::after {
    content: ''; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); border: 5px solid transparent;
    border-top-color: var(--dark);
  }
  .tooltip-trigger:hover .tooltip-content { opacity: 1; }

  /* ANIMATED COUNTERS & BARS */
  .score-bar { width: 0; }
  .score-bar.animated { transition: width 1s cubic-bezier(.4,0,.2,1); }
  .animate-in { opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .5s; }
  .animate-in.visible { opacity: 1; transform: translateY(0); }

  /* PRINT BUTTON */
  .print-btn {
    position: fixed; bottom: 32px; right: 88px; width: 44px; height: 44px;
    border-radius: 50%; background: white; color: var(--dark); border: 2px solid var(--border);
    cursor: pointer; font-size: 18px; display: flex; align-items: center;
    justify-content: center; opacity: 0; transform: translateY(16px);
    transition: opacity .3s, transform .3s, border-color .2s;
    z-index: 999; box-shadow: 0 4px 16px rgba(0,0,0,.1);
  }
  .print-btn.visible { opacity: 1; transform: translateY(0); }
  .print-btn:hover { border-color: var(--teal); color: var(--teal); }

  /* ENHANCED HOVER STATES */
  .card { transition: box-shadow .2s; }
  .card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); }
  .win-card { transition: transform .2s, background .2s; cursor: default; }
  .win-card:hover { background: rgba(255,255,255,.14); transform: translateY(-2px); }
  .stat-card { transition: border-color .2s, transform .2s; }
  .stat-card:hover { border-color: var(--teal); transform: translateY(-1px); }
  .toc li a { transition: background .15s, padding-left .15s; }
  .toc li a:hover { padding-left: 14px; }
  .toc li a.toc-highlight { background: var(--green-pale); color: var(--green); font-weight: 600; }
  .toc li a.toc-highlight .toc-num { background: var(--green); color: white; }
  .issue-list li { transition: background .15s; border-radius: 6px; padding-left: 8px; padding-right: 8px; }
  .issue-list li:hover { background: var(--gray-light); }

  /* SMOOTH SCROLL */
  html { scroll-behavior: smooth; scroll-padding-top: 24px; }

  @media print {
    .scroll-progress, .back-to-top, .print-btn, .toc.sticky { display: none !important; }
    .card.collapsed .card-body { display: block !important; }
    .card h2::after { display: none !important; }
  }

  @media (max-width: 600px) {
    /* Header */
    .report-header { padding: 40px 20px 32px; }
    .report-header-inner { flex-direction: column; gap: 20px; }
    .report-header-logo img { height: 40px; }
    .report-header h1 { font-size: 26px; }
    .report-header .subtitle { font-size: 14px; }
    .report-header .date { font-size: 11px; }
    .report-header .header-kpis { flex-wrap: wrap; gap: 20px; }
    .report-header .header-kpi-value { font-size: 20px; }

    /* Container */
    .container { padding: 20px 16px; }

    /* Executive summary: stack all items */
    .exec-bar {
      grid-template-columns: 1fr 1fr;
      padding: 20px 16px;
      gap: 16px;
    }
    .exec-bar .verdict {
      grid-column: 1 / -1;
      border-left: none;
      border-top: 3px solid var(--orange);
      padding-left: 0;
      padding-top: 16px;
    }

    /* Score bars: shrink fixed label */
    .score-row { gap: 8px; }
    .score-row .label { width: 130px; font-size: 12px; }
    .score-num { font-size: 11px; width: 28px; }

    /* Cards */
    .card { padding: 20px 16px; }
    .card h2 { font-size: 15px; }

    /* Easy wins: single column */
    .win-grid { grid-template-columns: 1fr; }

    /* Easy wins panel */
    .easy-wins { padding: 20px 16px; }

    /* Stat cards: tighter */
    .stat-card { padding: 12px 14px; }
    .stat-card .stat-value { font-size: 22px; }

    /* Score circles in exec bar */
    .score-circle { width: 52px; height: 52px; font-size: 18px; }

    /* Stats grid: 2 columns on mobile */
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    /* Generic responsive grids */
    .grid-3, .grid-2 { grid-template-columns: 1fr; }

    /* Investment section: reduce side padding */
    .invest-body { padding: 20px 16px 0; }
    .invest-pillar { padding: 0 16px 24px; }
    .invest-warning { margin: 0 16px 20px; }

    /* Issue list: stack pill below content */
    .issue-list li { flex-wrap: wrap; }
    .issue-list li .pill { margin-left: 42px; }

    /* Prevent wide code blocks from breaking layout */
    .issue-content code { word-break: break-all; }

    /* Floating buttons */
    .back-to-top, .print-btn { bottom: 20px; }
    .back-to-top { right: 20px; }
    .print-btn { right: 72px; }

    /* Sticky TOC: disable on mobile */
    .toc.sticky { position: static; transform: none; width: auto; padding: 24px 16px; }
    .toc.sticky h2 { display: flex; }
    .toc.sticky ol { gap: 6px 24px; }
    .toc.sticky li a { font-size: 13px; padding: 6px 10px; }

    /* === INLINE GRID MOBILE OVERRIDES === */
    /* Stack all inline 2-col grids */
    [style*="grid-template-columns:1fr 1fr"] {
      grid-template-columns: 1fr !important;
    }
    /* Collapse 3+ col inline grids to 2 cols */
    [style*="repeat(3,1fr)"] {
      grid-template-columns: repeat(2, 1fr) !important;
    }
    /* Collapse 4+ col inline grids to 2 cols */
    [style*="repeat(4,1fr)"],
    [style*="repeat(5,1fr)"] {
      grid-template-columns: repeat(2, 1fr) !important;
    }
    /* Stack 2fr 1fr layouts */
    [style*="grid-template-columns:2fr 1fr"] {
      grid-template-columns: 1fr !important;
    }

    /* === MOBILE TYPOGRAPHY === */
    /* Phase/section headings: scale down in stacked cards */
    .invest-body [style*="font-size:20px"] {
      font-size: 17px !important;
    }
    /* Stat card values: slightly smaller to fit 2-col */
    [style*="font-size:22px"][style*="font-weight:700"] {
      font-size: 19px !important;
    }

    /* Tables: prevent overflow */
    table { font-size: 12px; }
    th, td { padding: 8px 10px !important; }
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Prevent content from overflowing viewport (not .card — tables need scroll) */
    .invest-body, .easy-wins, .detail-panel { overflow-x: hidden; }
  }

  /* === DETAIL PANEL TOGGLE === */
  .detail-panel { display: none; }
  .detail-panel.open { display: block; }
  .detail-toggle {
    display: block; width: 100%; padding: 16px 24px;
    margin-bottom: 28px; border-radius: 12px;
    background: linear-gradient(135deg, #003330, #005753);
    color: white; font-size: 15px; font-weight: 600;
    border: none; cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
  }
  .detail-toggle:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,.15); }
  .detail-toggle.open { background: linear-gradient(135deg, #005753, #007A75); }
  @media print { .detail-toggle { display: none !important; } .detail-panel { display: block !important; } }
