/* AlphaRelay after-action report print layout.
 * Kept separate from the application theme so PDF output is a document, not a
 * screenshot of Mission Overwatch. This stylesheet is also embedded in the
 * standalone report inside offline mission packages.
 */

@media print {
  @page {
    size: letter portrait;
    margin: 0.42in 0.48in 0.48in;
  }

  html,
  body {
    width: 100%;
    min-width: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    color: #16202a !important;
  }

  body {
    box-sizing: border-box;
    padding: 0 !important;
    font-family: "Helvetica Neue", Arial, sans-serif !important;
    font-size: 9.25pt !important;
    line-height: 1.42 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* The in-app action applies this class before opening the print dialog. */
  body.aar-modal-print-session > *:not(#aarPrintRoot) {
    display: none !important;
  }

  body.aar-modal-print-session::before,
  body.aar-modal-print-session::after {
    display: none !important;
    content: none !important;
  }

  body.aar-modal-print-session #aarPrintRoot {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #16202a !important;
    box-shadow: none !important;
    transform: none !important;
  }

  body.aar-modal-print-session #afterActionReportModalOverlay,
  body.aar-modal-print-session #afterActionReportModalOverlay .aar-modal-panel,
  body.aar-modal-print-session #afterActionReportModalOverlay .aar-modal-scroll {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  body.aar-modal-print-session #afterActionReportModalOverlay .aar-modal-header,
  body.aar-modal-print-session #afterActionReportModalOverlay .aar-modal-no-print,
  body.aar-print-document .ar-aar-toolbar,
  .report .no-print,
  .report button,
  .report video,
  .report .aar-review-history {
    display: none !important;
  }

  body.aar-print-document {
    display: block !important;
  }

  body.aar-print-document > .report,
  body.aar-modal-print-session .report {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #16202a !important;
    box-shadow: none !important;
  }

  .report > .aar-report-title {
    display: none !important;
  }

  .report .aar-print-only {
    display: block !important;
  }

  .report .aar-print-masthead {
    position: relative;
    margin: 0 0 0.2in !important;
    padding: 0 0 0.16in !important;
    border: 0 !important;
    border-bottom: 2.5px solid #143c62 !important;
    background: #fff !important;
    break-inside: avoid;
  }

  .report .aar-print-masthead::after {
    position: absolute;
    right: 0;
    bottom: -2.5px;
    width: 1.2in;
    height: 2.5px;
    background: #4a90c7;
    content: "";
  }

  .report .aar-print-brand {
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.2in;
    color: #143c62 !important;
    font-size: 6.5pt !important;
    font-weight: 750 !important;
    letter-spacing: 0.13em !important;
    text-transform: uppercase;
  }

  .report .aar-print-brand strong {
    color: #143c62 !important;
    font-size: 11pt !important;
    letter-spacing: 0.17em !important;
  }

  .report .aar-print-document-type {
    margin-top: 0.17in !important;
    color: #52616f !important;
    font-size: 7pt !important;
    font-weight: 800 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase;
  }

  .report .aar-print-masthead h1 {
    margin: 0.035in 0 0 !important;
    color: #111a23 !important;
    font-size: 22pt !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.08 !important;
  }

  .report .aar-print-document-meta {
    display: grid !important;
    grid-template-columns: 0.8fr 1fr 1.45fr !important;
    gap: 0.16in !important;
    margin-top: 0.16in !important;
    color: #263441 !important;
    font-size: 7.5pt !important;
  }

  .report .aar-print-document-meta span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .report .aar-print-document-meta b {
    display: block;
    margin-bottom: 2px;
    color: #697682 !important;
    font-size: 6pt !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase;
  }

  .report .aar-print-footer {
    position: static !important;
    display: flex !important;
    justify-content: space-between;
    gap: 0.2in;
    margin-top: 0.18in !important;
    padding-top: 0.055in !important;
    border-top: 1px solid #c8d1d9 !important;
    color: #65727e !important;
    font-size: 6pt !important;
    letter-spacing: 0.035em !important;
  }

  .report .aar-report-overview {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 0 !important;
    margin: 0 0 0.18in !important;
    overflow: hidden !important;
    border: 1px solid #b9c5cf !important;
    border-radius: 3px !important;
    background: #fff !important;
    break-inside: avoid;
  }

  .report .aar-report-overview-item {
    grid-column: span 2 !important;
    padding: 0.085in 0.1in !important;
    border: 0 !important;
    border-right: 1px solid #d9e0e6 !important;
    border-bottom: 1px solid #d9e0e6 !important;
    background: #fff !important;
  }

  .report .aar-report-overview-item--mission {
    grid-column: span 4 !important;
  }

  .report .aar-report-overview-item--status {
    grid-column: span 2 !important;
    border-right: 0 !important;
  }

  .report .aar-report-overview-item:nth-child(n + 3) {
    border-bottom: 0 !important;
  }

  .report .aar-report-overview dt,
  .report .aar-report-eyebrow,
  .report .aar-photo-notes-label,
  .report .aar-photo-meta {
    color: #64727f !important;
    font-size: 6.25pt !important;
    font-weight: 800 !important;
    letter-spacing: 0.075em !important;
    text-transform: uppercase;
  }

  .report .aar-report-overview dd {
    margin-top: 2px !important;
    color: #16202a !important;
    font-size: 8.25pt !important;
    font-weight: 650 !important;
    line-height: 1.28 !important;
  }

  .report .aar-report-section {
    margin: 0.18in 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #16202a !important;
    box-shadow: none !important;
    break-inside: auto;
  }

  .report .aar-report-section-heading {
    display: flex !important;
    align-items: end !important;
    justify-content: space-between !important;
    gap: 0.15in !important;
    margin: 0 0 0.085in !important;
    padding: 0 0 0.05in !important;
    border-bottom: 1.5px solid #143c62 !important;
    break-after: avoid-page;
  }

  .report .aar-report-section-heading h4 {
    margin-top: 1px !important;
    color: #111a23 !important;
    font-size: 12pt !important;
    line-height: 1.15 !important;
  }

  .report .aar-report-section-count,
  .report .aar-report-status,
  .report .aar-custody-status,
  .report .aar-photo-category,
  .report .aar-event-offset {
    min-height: 0 !important;
    padding: 2px 6px !important;
    border: 1px solid #99a7b3 !important;
    border-radius: 999px !important;
    background: #f3f6f8 !important;
    color: #293844 !important;
    font-size: 6.5pt !important;
    font-weight: 750 !important;
    line-height: 1.25 !important;
    white-space: nowrap;
  }

  .report .aar-report-section-intro,
  .report .aar-custody-asof {
    margin: -0.02in 0 0.09in !important;
    color: #4f5d69 !important;
    font-size: 8pt !important;
    line-height: 1.4 !important;
  }

  .report .aar-narrative-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.1in 0.16in !important;
  }

  .report .aar-narrative-card {
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #16202a !important;
    break-inside: avoid;
  }

  .report .aar-narrative-card--wide,
  .report .aar-narrative-card--attention {
    grid-column: 1 / -1 !important;
  }

  .report .aar-narrative-card--attention {
    padding: 0.075in 0.09in !important;
    border: 1px solid #dec98e !important;
    border-left: 3px solid #b58218 !important;
    background: #fffaf0 !important;
  }

  .report .aar-narrative-card h5 {
    color: #143c62 !important;
    font-size: 7pt !important;
    font-weight: 800 !important;
    letter-spacing: 0.045em !important;
    text-transform: uppercase;
  }

  .report .aar-narrative-block .aar-prose-para,
  .report .aar-narrative-card p {
    margin: 0.035in 0 0 !important;
    color: #1c2832 !important;
    font-size: 9pt !important;
    line-height: 1.46 !important;
  }

  .report .aar-custody-table-wrap {
    overflow: visible !important;
    border: 1px solid #c7d0d8 !important;
    border-radius: 2px !important;
  }

  .report .aar-custody-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 6.75pt !important;
  }

  .report .aar-custody-table thead {
    display: table-header-group;
  }

  .report .aar-custody-table tr {
    break-inside: avoid;
  }

  .report .aar-custody-table th,
  .report .aar-custody-table td {
    padding: 0.055in 0.06in !important;
    border: 0 !important;
    border-bottom: 1px solid #d9e0e6 !important;
    color: #1c2832 !important;
    text-align: left !important;
    vertical-align: top !important;
  }

  .report .aar-custody-table th {
    background: #eaf0f4 !important;
    color: #334452 !important;
    font-size: 6pt !important;
    font-weight: 800 !important;
    letter-spacing: 0.045em !important;
    text-transform: uppercase;
  }

  .report .aar-custody-table th:nth-child(1),
  .report .aar-custody-table td:nth-child(1) { width: 11% !important; }
  .report .aar-custody-table th:nth-child(2),
  .report .aar-custody-table td:nth-child(2) { width: 23% !important; }
  .report .aar-custody-table th:nth-child(3),
  .report .aar-custody-table td:nth-child(3) { width: 44% !important; }
  .report .aar-custody-table th:nth-child(4),
  .report .aar-custody-table td:nth-child(4) { width: 13% !important; }
  .report .aar-custody-table th:nth-child(5),
  .report .aar-custody-table td:nth-child(5) { width: 9% !important; }

  .report .aar-custody-hash {
    color: #334452 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    font-size: 5.8pt !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .report .aar-custody-status[data-tone="positive"] {
    border-color: #75a082 !important;
    background: #edf7ef !important;
    color: #235b31 !important;
  }

  .report .aar-custody-status[data-tone="warning"] {
    border-color: #b58e3d !important;
    background: #fff8e8 !important;
    color: #6b4a08 !important;
  }

  .report .aar-custody-status[data-tone="negative"] {
    border-color: #be7772 !important;
    background: #fff0ef !important;
    color: #79221d !important;
  }

  .report .aar-event-timeline {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    counter-reset: aar-event;
  }

  .report .aar-event-card {
    position: relative;
    counter-increment: aar-event;
    margin: 0 !important;
    padding: 0.075in 0 0.085in 0.27in !important;
    overflow: visible !important;
    border: 0 !important;
    border-bottom: 1px solid #d6dee5 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #16202a !important;
    box-shadow: none !important;
    break-inside: avoid-page !important;
    page-break-inside: avoid !important;
  }

  .report .aar-event-card::before {
    position: absolute !important;
    top: 0.075in !important;
    left: 0 !important;
    display: grid !important;
    width: 0.21in !important;
    height: 0.21in !important;
    place-items: center;
    border-radius: 50% !important;
    background: #143c62 !important;
    color: #fff !important;
    content: counter(aar-event) !important;
    font-size: 6.5pt !important;
    font-weight: 800 !important;
  }

  .report .aar-event-header,
  .report .aar-event-note {
    break-after: avoid-page;
  }

  .report .aar-event-time {
    color: #143c62 !important;
    font-size: 7.25pt !important;
    font-weight: 800 !important;
  }

  .report .aar-event-note {
    margin: 0.025in 0 0 !important;
    color: #16202a !important;
    font-size: 8.25pt !important;
    font-weight: 680 !important;
    line-height: 1.35 !important;
  }

  .report .aar-event-content {
    display: grid !important;
    grid-template-columns: minmax(1.45in, 1.7in) minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 0.1in !important;
    margin-top: 0.05in !important;
  }

  .report .aar-event-content > :only-child {
    grid-column: 1 / -1 !important;
  }

  .report .aar-event-media,
  .report .aar-event-content > .event-openai-analysis {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    border: 1px solid #cbd4dc !important;
    border-radius: 2px !important;
    background: #fff !important;
    color: #16202a !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .report .aar-event-media-header,
  .report .aar-photo-media-header {
    min-height: 0 !important;
    padding: 0.045in 0.065in !important;
    border-bottom: 1px solid #d6dee5 !important;
    color: #5b6874 !important;
    font-size: 6pt !important;
    line-height: 1.25 !important;
  }

  .report .event-openai-analysis,
  .report .event-openai-analysis-detail p,
  .report .event-openai-analysis-heading strong {
    color: #1c2832 !important;
  }

  .report .event-openai-analysis {
    padding: 0.06in 0.075in !important;
    font-size: 7pt !important;
    line-height: 1.3 !important;
  }

  .report .event-openai-analysis-heading,
  .report .event-openai-analysis-heading > strong {
    font-size: 7.25pt !important;
    line-height: 1.25 !important;
  }

  .report .event-openai-analysis p,
  .report .event-openai-analysis ul,
  .report .event-openai-analysis-detail p {
    margin: 0.025in 0 0 !important;
    font-size: 7pt !important;
    line-height: 1.3 !important;
  }

  .report .event-openai-analysis ul {
    padding-left: 0.14in !important;
  }

  .report .event-openai-analysis-observations,
  .report .event-openai-analysis-details {
    margin-top: 0.045in !important;
  }

  .report .event-openai-analysis-details {
    gap: 0.04in 0.08in !important;
    padding-top: 0.04in !important;
  }

  .report .event-openai-analysis-label {
    font-size: 5.75pt !important;
  }

  .report img.event-screenshot {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: 1.25in !important;
    margin: 0 auto !important;
    object-fit: contain !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #f2f4f6 !important;
    break-inside: avoid;
  }

  .report .aar-photo-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.12in !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .report .aar-photo-card {
    min-width: 0;
    margin: 0 !important;
    overflow: hidden !important;
    border: 1px solid #c7d0d8 !important;
    border-radius: 2px !important;
    background: #fff !important;
    color: #16202a !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .report .aar-photo-card-header {
    padding: 0.075in 0.085in 0 !important;
  }

  .report .aar-photo-card-header strong {
    color: #16202a !important;
    font-size: 8pt !important;
  }

  .report .aar-photo-meta {
    margin: 0.035in 0.085in 0 !important;
  }

  .report .aar-photo-notes {
    margin: 0.06in 0.085in 0 !important;
    padding: 0.055in 0.065in !important;
    border: 0 !important;
    border-left: 2px solid #7aa5ca !important;
    border-radius: 0 !important;
    background: #f5f8fa !important;
    color: #263441 !important;
    font-size: 7.25pt !important;
    line-height: 1.35 !important;
  }

  .report .aar-photo-media {
    margin-top: 0.07in !important;
    border-top: 1px solid #d6dee5 !important;
    background: #f2f4f6 !important;
  }

  .report .aar-photo-media .event-screenshot {
    max-height: 2.1in !important;
  }

  .report .footage-qr-block,
  .report .aar-approval-banner,
  .report .aar-approval-note,
  .report .aar-analysis-review-callout,
  .report .aar-footage-list > li {
    border-color: #c7d0d8 !important;
    border-radius: 2px !important;
    background: #f6f8fa !important;
    color: #16202a !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .report .footage-qr-block {
    grid-template-columns: 1.05in minmax(0, 1fr) !important;
    gap: 0.14in !important;
    padding: 0.1in !important;
  }

  .report .footage-qr-svg svg {
    width: 0.86in !important;
    height: 0.86in !important;
  }

  .report .footage-qr-url {
    overflow-wrap: anywhere;
    font-size: 7pt !important;
  }

  .report .footage-qr-url a {
    color: #143c62 !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
  }

  .report > :last-child {
    break-after: auto !important;
    page-break-after: auto !important;
  }
}
