/* ==========================================================================
   PRINT. Any page printed comes out as ink on paper: a white page and black
   text, no sidebar, nav, buttons, or composers, cards flattened to thin rules,
   rows kept whole across page breaks, checkboxes as outlined squares, and done
   tasks struck through. Monthly Review and Routines add their own touches
   (18-monthly-review.css, 26-routines-more.css); this is the base under them.
   ========================================================================== */
@media print {
  @page { margin: 14mm 12mm; }

  /* Ink: the dark theme's fills, glows, and tinted rows (many set inline) all go. */
  *, *::before, *::after {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    color: #111 !important;
    border-color: #d4d4d8 !important;
    -webkit-print-color-adjust: economy;
    print-color-adjust: economy;
  }
  html, body { background: #fff !important; }
  body { font-size: 11pt; }
  a { text-decoration: none !important; }

  /* The app's frame and everything that's for doing rather than reading. */
  #app-sidebar, .mobile-header, .mobile-footer, #mobile-overlay, #dashboard-popover,
  #toast-container, #modal-overlay, .sidebar-compose-wrap, .fab,
  button, .ledger-new, .show-btn, .show-back, .set-btn, .lib-btn, .row-tools, .row-tools-host,
  .task-row-hover-buttons, .delete-cancel-cell, .add-cell, .row-end-cell,
  .journal-collapsed-row, .sched-journal-card, .task-form-card, .day-footer-ring,
  #home-ring, .calendar-row, .date-day-dropdown, .milestone-form-popup,
  .inline-tag-editor-slot, .task-share-slot, input[type="file"], textarea, select,
  [data-turbo-frame="modal"] { display: none !important; }

  /* The page uses the paper's width, with no fixed heights or inner scrolling. */
  .main-content, .ledger-page, .show-page, .set-page { max-width: none !important; width: auto !important; margin: 0 !important; padding: 0 !important; }
  .main-content * { max-height: none !important; overflow: visible !important; }

  /* Home: the day first, then the areas, one under the other. */
  #home-container { display: flex !important; flex-direction: column !important; gap: 18pt; }
  #home-container > #task_schedule_daily { order: -1; }
  .daily-column, .categories-column { width: auto !important; flex: none !important; }

  /* Cards flatten to a rule above them; their rows stay whole across a page break. */
  .ledger-card, .set-card, .day-section, .category-container, [class*="-card"] {
    border: 0 !important; border-top: 1px solid #d4d4d8 !important; border-radius: 0 !important; padding-left: 0 !important; padding-right: 0 !important;
  }
  tr, li, .ledger-row, .jd-content, .day-footer { break-inside: avoid; }
  h1, h2, h3, .date-separator, thead { break-after: avoid; }
  table { width: 100% !important; table-layout: auto !important; }
  td, th { padding-top: 3pt !important; padding-bottom: 3pt !important; }
  .task-row td { border-bottom: 1px solid #ececef !important; }

  /* Checkboxes as outlined squares, ticked ones filled; done tasks struck through. */
  input[type="checkbox"] {
    -webkit-appearance: none !important; appearance: none !important;
    width: 10pt !important; height: 10pt !important; margin: 0 !important;
    border: 1.2pt solid #444 !important; border-radius: 2pt !important;
  }
  input[type="checkbox"]:checked { background: #444 !important; }
  .completed-task .task-title-link, .completed-task .task-title { text-decoration: line-through !important; color: #666 !important; }

  /* Notes: the open note alone, without the list beside it or the editor's toolbar. Its
     body's colour is set by id, so it's named here to come out black. */
  .an-notes-list, .ane-toolbar-wrap { display: none !important; }
  .an-layout, .an-panel-col { display: block !important; width: auto !important; }
  #ane-content, #ane-content * { color: #111 !important; -webkit-text-fill-color: #111 !important; }
  .ane-doc { padding: 0 !important; }

  /* Pictures stay inside the page and aren't split. */
  img, svg, video { max-width: 100% !important; break-inside: avoid; }
}
