@media print {
  .app-sidebar, #chat-input-area, .chat-input, .chat-plus-menu,
  .blod-bolge-overlay, .chat-header-actions, .voice-overlay,
  #ss-scroll-bottom-fab, .sofia-sidebar, .chat-conv-header,
  .calm-chooser, .onboarding-overlay, .bb-mobile-nav,
  .chat-category-chips, .chat-msg-actions,
  .skip-link, #chat-profile {
    display: none !important;
  }

  #chat-messages {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  .chat-message-bubble {
    break-inside: avoid;
  }

  body, html {
    height: auto !important;
    overflow: visible !important;
  }

  #chat-conversation-panel {
    overflow: visible !important;
    height: auto !important;
  }

  #chat-app, .chat-main, .chat-body {
    height: auto !important;
    overflow: visible !important;
  }

  /* ── Dark-mode print reset ──
     Force light backgrounds and dark text so print output is always readable. */
  html[data-theme="dark"] {
    --cream: #FAF7F3 !important;
    --white: #FFFEFB !important;
    --warm-text: #5C4D43 !important;
    --warm-text-light: #8A7E72 !important;
    --color-bg: #FAFAF8 !important;
    --color-bg-rgb: 250, 250, 248 !important;
    --color-card: #ffffff !important;
    --color-text: #384551 !important;
    --color-text-primary: #384551 !important;
    --color-text-secondary: #646e78 !important;
    --color-border: #e4e6e8 !important;
    color-scheme: light !important;
  }

  /* Beat the :has(#chat-app) dark rule in chat-ny-blod-bolge.css (higher specificity) */
  html[data-theme="dark"]:has(#chat-app) {
    --color-bg: #FAFAF8 !important;
    --color-bg-rgb: 250, 250, 248 !important;
    --app-dark-canvas: #FAFAF8 !important;
    background: #FAFAF8 !important;
  }

  [data-theme="dark"] body,
  [data-theme="dark"] body.chat-ny-in-conversation,
  [data-theme="dark"] .app,
  [data-theme="dark"] body.chat-ny-in-conversation .app {
    background: #FFFEFB !important;
    color: #5C4D43 !important;
  }

  [data-theme="dark"] .app::before {
    display: none !important;
  }

  [data-theme="dark"] body.chat-ny-in-conversation .chat-header {
    background: linear-gradient(to bottom,
      #FFFEFB 0%,
      #FFFEFB 72%,
      rgba(255, 254, 251, 0.82) 88%,
      rgba(255, 254, 251, 0) 100%) !important;
    color: #384551 !important;
  }

  [data-theme="dark"] .card,
  [data-theme="dark"] .input-card,
  [data-theme="dark"] .chat-input-box,
  [data-theme="dark"] .chat-prompt-item,
  [data-theme="dark"] .chat-bubble-file-chip,
  [data-theme="dark"] .chat-code-block {
    background: #ffffff !important;
    border-color: #e4e6e8 !important;
    color: #384551 !important;
    box-shadow: none !important;
  }

  [data-theme="dark"] body.chat-ny-in-conversation .chat-message.received .chat-bubble,
  [data-theme="dark"] body.chat-ny-in-conversation .chat-message.assistant .chat-bubble,
  [data-theme="dark"] body.chat-ny-in-conversation .chat-message--assistant .chat-bubble,
  [data-theme="dark"] .chat-message.received .chat-bubble {
    color: #384551 !important;
  }

  [data-theme="dark"] body.chat-ny-in-conversation .chat-message.sent .chat-bubble,
  [data-theme="dark"] body.chat-ny-in-conversation .chat-message.user .chat-bubble,
  [data-theme="dark"] body.chat-ny-in-conversation .chat-message--user .chat-bubble,
  [data-theme="dark"].v-voksen .chat-message.sent .chat-bubble {
    background: rgb(239, 238, 235) !important;
    color: #384551 !important;
  }

  [data-theme="dark"] body.chat-ny-in-conversation .chat-message-time,
  [data-theme="dark"] .chat-message-time {
    color: #8A7E72 !important;
  }

  [data-theme="dark"] .chat-message.sent .chat-bubble code,
  [data-theme="dark"].v-voksen .chat-message.sent .chat-bubble code {
    background: rgba(0, 0, 0, 0.05) !important;
    color: rgb(141, 37, 37) !important;
  }

  [data-theme="dark"] .chat-message.received .chat-bubble code {
    background: rgba(0, 0, 0, 0.05) !important;
  }
}
