/* ── ATLAS print stylesheet ──────────────────────────────────────────────────
 * Hides all interactive / UI chrome and forces a white-on-black-text layout
 * suitable for printing KPI strips, pipeline data, and page content.
 *
 * IDs / classes confirmed against index.html:
 *   sidebar → <aside class="sidebar" id="rail">
 *   statusbar → <header class="statusbar" id="statusbar">
 *   tag-voice → <span id="tag-voice">
 *   voice dock → <footer class="quick-bar" id="hint-bar">
 *   cmd-palette → <div id="cmd-palette">
 *   notif-center → <div id="notif-center">
 *   kpi-drawer → <div id="kpi-drawer">  + #kpi-drawer-backdrop
 *   agent-modal → <div id="agent-modal">
 *   atlas-toast → dynamically injected by app.js with class .atlas-toast
 *   mob-rail-backdrop → <div id="mob-rail-backdrop">
 *   launch-banner → <a class="launch-banner" id="launch-banner">
 *   skip-link → <a class="skip-link">
 * ─────────────────────────────────────────────────────────────────────────── */

@media print {

  /* ── 1. Hide non-essential UI ─────────────────────────────────────── */
  .sidebar,
  #rail,
  .statusbar,
  #statusbar,
  #tag-voice,
  #hint-bar,
  #cmd-palette,
  #notif-center,
  #notif-backdrop,
  #kpi-drawer,
  #kpi-drawer-backdrop,
  #agent-modal,
  .agent-modal,
  .atlas-toast,
  #mob-rail-backdrop,
  #launch-banner,
  .skip-link,
  .orb-wrap,
  #orb-wrap,
  .voice-settings-popover,
  #voice-ai-active,
  #btn-export-pdf,
  #btn-install-pwa,
  .theme-toggle,
  .cb-toggle,
  .mob-menu-btn,
  #mob-menu-btn,
  .rail-toggle,
  #rail-toggle,
  .org-switcher { display: none !important; }

  /* ── 2. Force white background / black text ───────────────────────── */
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    border-color: #ccc !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html, body, .frame, .main-col, .canvas {
    background: #fff !important;
    color: #000 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* ── 3. Remove all animation / transition ─────────────────────────── */
  *,
  *::before,
  *::after {
    animation: none !important;
    animation-duration: 0s !important;
    transition: none !important;
    transition-duration: 0s !important;
  }

  /* ── 4. KPI strip — keep together, avoid mid-tile page breaks ──────── */
  .kpi-strip {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8pt !important;
  }
  .kpi-tile {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    border: 1px solid #ccc !important;
    padding: 8pt !important;
    flex: 1 1 120pt !important;
  }
  .kpi-sparkline,
  .kpi-spark { display: none !important; }

  /* ── 5. Atlas views — page break before each view (except the first) */
  .atlas-view {
    page-break-before: always;
    break-before: page;
    display: block !important;
  }
  .atlas-view:first-child,
  .atlas-view.view-on:first-child {
    page-break-before: avoid;
    break-before: avoid;
  }
  /* Hide off-screen views entirely in print */
  .atlas-view.view-off {
    display: none !important;
  }

  /* ── 6. Page margins ─────────────────────────────────────────────── */
  @page {
    margin: 20mm;
    size: A4 portrait;
  }

  /* ── 7. Links — show destination URL after anchor text ──────────── */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #555 !important;
  }
}
