/* ============================================================
   Print — always ink-on-white, chrome hidden.
   Forces the theme-neutral ink/paper ramp regardless of
   [data-theme]; the work-order traveler stays clean.
   ============================================================ */

@page { margin: 0.4in; }
@page landscape { size: landscape; }

.print-header { display: none; }

@media print {
  :root,
  [data-theme="dark"],
  [data-theme="light"] {
    --canvas: #ffffff;
    --surface: #ffffff;
    --surface-muted: #ffffff;
    --surface-hover: #ffffff;
    --surface-active: #ffffff;
    --ink: #000000;
    --ink-muted: #222222;
    --ink-subtle: #444444;
    --hairline: #cccccc;
    --hairline-mid: #999999;
    --ds-background-100: #ffffff;
    --ds-background-200: #ffffff;
  }

  html,
  body {
    background: #ffffff;
    color: #000000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* App chrome never prints. */
  .app-sidebar,
  .app-topbar,
  .app-shell-backdrop,
  .ai-chat-backdrop,
  .ai-chat-drawer,
  .ai-chat-fab,
  .station-task-drawer,
  .station-task-drawer-backdrop,
  .content-tabs,
  .page-actions,
  /* The trigger goes with every other button; the panel would otherwise leak
     onto paper when it is left open at print time. */
  .info-tip-panel,
  button,
  .btn,
  .no-print {
    display: none !important;
  }

  .station-active-list { gap: 8px; }
  .print-scope { display: block; color: #222222; font-size: 10px; }
  .press-targets { padding-block: 4px; border-color: #cccccc; }

  /* The shell collapses to a single flowing column on paper. */
  .app-shell,
  .app-shell-body {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .app-main {
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible !important;
  }

  .app-main > * {
    max-width: none;
    margin-inline: 0;
  }

  .print-landscape { page: landscape; }

  .print-header {
    display: block;
    margin-bottom: 8px;
    font: 11px var(--font-mono);
  }

  .table-container {
    overflow: visible !important;
    border-radius: 0;
    box-shadow: none;
  }

  .table,
  .table th,
  .table td {
    color: #000000;
    background: #ffffff !important;
    border: 1px solid #999999;
  }

  .table-container .table th,
  .table-container .table td {
    white-space: normal;
  }

  .routing-cell-detail {
    display: inline;
    font-size: 9px;
  }

  .routing-cell {
    width: auto;
    min-width: auto;
    padding: 0 2px;
  }

  .work-order {
    max-width: none;
    padding: 0;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
  }

  .linked-card,
  .report-menu {
    background: #ffffff;
    box-shadow: none;
  }

  .work-order .table { border-collapse: collapse; }

  .wo-header,
  .wo-section-title {
    border-color: #000000;
  }

  .downtime-station { break-before: page; }
  .downtime-station:first-of-type { break-before: auto; }
  .downtime-chart-grid { display: block; }
  .downtime-chart-panel { break-inside: avoid; margin-bottom: 0.2in; }
  .downtime-pareto-grid { display: block; }

  thead { display: table-header-group; }
  tr,
  img { break-inside: avoid; }

  /* Schedule prints as the floor sheet: inline inputs render as plain text. */
  .schedule-comment,
  .schedule-cut {
    border: none !important;
    background: transparent !important;
    width: auto !important;
    padding: 0 !important;
  }

  .schedule-week { break-inside: avoid; }

  /* Knowledge base prints without its TOC. */
  .kb-toc { display: none; }
  .kb-layout { grid-template-columns: 1fr; }
  .kb-section { break-inside: avoid; }

  .maintenance-qr-label .qr-label {
    width: 3.5in;
    padding: 0.2in;
    border: 2px solid #000000;
    break-inside: avoid;
  }
}
