  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { background: #FAF9F5; color: #0A0B0F; font-family: 'Onest', system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: clip; max-width: 100vw; }
  html { scroll-behavior: smooth; }
  html[dir="rtl"], html[dir="rtl"] body { font-family: 'IBM Plex Sans Arabic', 'Onest', system-ui, sans-serif; }
  html[dir="rtl"] input, html[dir="rtl"] textarea, html[dir="rtl"] button { font-family: 'IBM Plex Sans Arabic', 'Onest', system-ui, sans-serif; }
  html[dir="rtl"] .mono-keep { font-family: 'JetBrains Mono', monospace !important; }
  html[dir="rtl"] input[type="text"], html[dir="rtl"] textarea { text-align: start; }
  /* Prevent any element from causing horizontal scroll */
  *, *::before, *::after { box-sizing: border-box; }
  /* In RTL, negative letter-spacing on big headlines pushes content past viewport edges */
  html[dir="rtl"] .hero-h1 { letter-spacing: -0.5px !important; }
  /* Stop initial scroll-jump on RTL by ensuring root is anchored */
  #root { overflow-x: clip; max-width: 100vw; }
  input, textarea, button { font-family: inherit; color: inherit; }
  input:focus, textarea:focus { outline: 1px solid #65A30D; outline-offset: -1px; }
  button { transition: all 0.15s ease; }
  button:hover:not(:disabled) { transform: translateY(-1px); }
  button:active:not(:disabled) { transform: translateY(0); }
  ::selection { background: #C9FF3D; color: #0A0B0F; }
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(10,11,15,0.15); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(10,11,15,0.25); }
  @keyframes proof-spin { to { transform: rotate(360deg); } }
  @keyframes proof-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
  @keyframes proof-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .proof-spin { animation: proof-spin 0.8s linear infinite; }
  .proof-pulse { animation: proof-pulse 2s ease-in-out infinite; }
  .proof-fade { animation: proof-fade-up 0.5s ease-out backwards; }
  .grid-bg {
    background-image:
      linear-gradient(rgba(10,11,15,0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(10,11,15,0.035) 1px, transparent 1px);
    background-size: 60px 60px;
  }
  .bookmarklet-link { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; background: #C9FF3D; color: #0A0B0F; text-decoration: none; cursor: grab; font-weight: 600; font-size: 14px; letter-spacing: 0.5px; border: 1px solid #0A0B0F; box-shadow: 4px 4px 0 #0A0B0F; }
  .bookmarklet-link:active { cursor: grabbing; transform: translate(2px, 2px); box-shadow: 2px 2px 0 #0A0B0F; }

  @media print {
    @page { size: A4; margin: 14mm; }
    html, body { background: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; overflow: visible !important; height: auto !important; }
    header, footer, .no-print, .grid-bg { display: none !important; }
    main { padding: 0 !important; max-width: none !important; }
    .proof-fade { animation: none !important; opacity: 1 !important; }
    .kpi-grid { grid-template-columns: 1fr 1fr 1fr !important; page-break-inside: avoid; }
    .kpi-radial { grid-column: span 3 !important; grid-row: auto !important; }
    .rec-card { page-break-inside: avoid; display: grid !important; opacity: 1 !important; }
    .cat-row { page-break-inside: avoid; }
    h1, h2, h3 { page-break-after: avoid; }
    .page-break { page-break-before: always; }
    /* Force-show everything that might be collapsed */
    [data-collapsed] { display: block !important; max-height: none !important; overflow: visible !important; }
    .check-detail { display: block !important; }
    /* Hide all interactive buttons in print */
    button { display: none !important; }
    /* Show all recommendations even if showAllRecs is false */
    .rec-list-item { display: grid !important; opacity: 1 !important; }
    /* Force all dashboards and expansion content to render */
    .proof-fade, .rec-card, .cat-row, [class*="dashboard"], [class*="card"] {
      opacity: 1 !important;
      transform: none !important;
      visibility: visible !important;
    }
    /* Make sure RTL doesn't cause overflow issues in print */
    html[dir="rtl"] * { letter-spacing: normal !important; }
    /* Avoid awkward breaks inside grids */
    [style*="display: grid"] > div { page-break-inside: avoid; }
  }
  /* Watermark for free PDF downloads */
  @media print {
    body.proof-watermark::after {
      content: 'ProofRanked, proofranked.com';
      position: fixed;
      bottom: 10mm;
      right: 12mm;
      font-family: JetBrains Mono, monospace;
      font-size: 9pt;
      color: rgba(10,11,15,0.25);
      letter-spacing: 2px;
      text-transform: uppercase;
      pointer-events: none;
    }
  }
  @media (max-width: 900px) {
    .kpi-grid { grid-template-columns: 1fr 1fr !important; }
    .kpi-radial { grid-column: span 2 !important; grid-row: auto !important; }
    .rec-card { grid-template-columns: 32px 1fr !important; }
    .rec-card-points { grid-column: 2 !important; margin-top: 8px !important; text-align: start !important; }
    .version-tag { display: none !important; }
    .cat-row { grid-template-columns: 110px 1fr 50px 60px !important; gap: 10px !important; }
    .cat-row > div:last-child { display: none !important; }
    .padded { padding: 24px !important; }
    .hero-h1 { font-size: 56px !important; }
  }
  @media (max-width: 600px) {
    .kpi-grid { grid-template-columns: 1fr !important; }
    .kpi-radial { grid-column: span 1 !important; }
    .cat-row { grid-template-columns: 90px 1fr 44px 50px !important; gap: 8px !important; }
    .hero-h1 { font-size: 44px !important; letter-spacing: -2px !important; }
  }
