/* Printable signal cards — screen setup/preview plus an A4 cut-and-fold layout. */

.print-page {
  height: auto;
  min-height: 100%;
  overflow: auto;
  display: block;
}

.print-header-inner { max-width: 1040px; }
.print-page .back-link {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  padding-bottom: 3px;
}

.print-page #main {
  overflow: visible;
  min-height: 0;
  padding: 22px 18px 48px;
}

.print-controls,
.print-preview-head {
  max-width: 1040px;
  margin: 0 auto;
}

.print-controls {
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 5px solid var(--orange);
}

.print-setup-copy { padding: 20px 20px 16px; }
.print-setup-copy h2,
.print-preview-head h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.02em; }
.print-setup-copy p { max-width: 720px; margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }

.print-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-block: 1px solid var(--line);
}
.print-filter { flex: 1 1 auto; }

.print-layout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.print-layout-row > div:first-child { min-width: 0; }
.print-layout-row b,
.print-layout-row small { display: block; }
.print-layout-row b { margin-bottom: 2px; font-size: 13.5px; }
.print-layout-row small { color: var(--text-2); font-size: 11.5px; line-height: 1.35; }
.print-layout { flex: 0 0 auto; overflow: visible; }

.print-check {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.print-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.print-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 13px 20px 0;
  color: var(--text-2);
  font-size: 13.5px;
}
.print-summary strong { color: var(--text); font-size: 15px; }

.print-instructions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
  padding: 14px 20px;
  list-style: none;
}
.print-instructions li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.print-instructions li > span {
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 800;
}
.print-instructions b,
.print-instructions small { display: block; }
.print-instructions b { margin-bottom: 3px; font-size: 13px; }
.print-instructions small { color: var(--text-2); font-size: 11.5px; line-height: 1.35; }

.print-note {
  margin: 0;
  padding: 12px 20px 14px;
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
}
.print-note b { color: var(--text); }

.print-preview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 2px 12px;
}
.print-preview-head h2 { margin-bottom: 0; }

.print-sheets {
  max-width: 1120px;
  margin: 0 auto;
}
.print-sheet {
  margin: 0 auto 24px;
  padding: 18px;
  background: #fff;
  color: #172b4d;
  border-radius: 5px;
  box-shadow: 0 5px 26px rgba(23, 43, 77, .16);
}
.print-sheet-label {
  margin: 0 0 10px;
  color: #697386;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.print-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.fold-card {
  min-width: 0;
  min-height: 300px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  background: #fff;
  border: 1px solid #7b8491;
  color: #172b4d;
}
.fold-card-face {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 13px 14px 20px;
}
.fold-card-back { border-left: 2px dotted #8e96a2; }

.fold-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #d95316;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.fold-card-art {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  margin: 8px 0 7px;
  background: #eef0f3;
  border-radius: 7px;
}
.signal-svg.print-card-signal { width: 66px; height: 118px; }
.fold-card-prompt {
  margin: 0;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.28;
  text-align: center;
}

.fold-card-answer-copy {
  margin: auto 0;
  text-align: left;
}
.fold-card-answer-copy h3 {
  margin: 0 0 8px;
  color: #d95316;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -.01em;
}
.fold-card-answer,
.fold-card-explain { margin: 0 0 7px; line-height: 1.38; }
.fold-card-answer { font-size: 12px; font-weight: 800; }
.fold-card-explain { color: #4f5968; font-size: 10.5px; }
.fold-card-tip {
  margin-top: 7px;
  padding: 6px 7px;
  border-left: 3px solid #f36c21;
  background: #fff0e7;
  color: #303a49;
  font-size: 9.5px;
  line-height: 1.35;
}
.fold-card-tip b { color: #d95316; }
.fold-card-safety {
  margin: auto 0 0;
  padding-top: 7px;
  color: #737c88;
  font-size: 7.5px;
  line-height: 1.2;
}
.fold-card-side-label {
  position: absolute;
  right: 7px;
  bottom: 5px;
  color: #8a929d;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.fold-card-long .fold-card-answer-copy h3 { font-size: 15px; }
.fold-card-long .fold-card-answer { font-size: 10.5px; }
.fold-card-long .fold-card-explain { font-size: 9.3px; }
.fold-card-long .fold-card-tip { font-size: 8.5px; }

.print-sheet-grid.duplex-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.duplex-card {
  min-width: 0;
  min-height: 300px;
  display: flex;
  overflow: hidden;
  background: #fff;
  color: #172b4d;
  border: 1px solid #7b8491;
}
.duplex-card .fold-card-face { flex: 1 1 auto; }
.duplex-card .fold-card-back { border-left: 0; }
.duplex-card-empty { background: #fff; }

.print-empty {
  margin: 20px auto;
  padding: 30px;
  max-width: 620px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--text-2);
  text-align: center;
}

@media screen and (max-width: 760px) {
  .print-header-inner { gap: 10px; }
  .print-header-inner .training-badge { display: none; }
  .print-header-inner .pill-btn { padding-inline: 14px; font-size: 13px; }
  .print-filter-row { align-items: flex-start; flex-direction: column; }
  .print-filter { width: 100%; }
  .print-layout-row { align-items: flex-start; flex-direction: column; }
  .print-instructions { grid-template-columns: 1fr; }
  .print-sheet-grid,
  .print-sheet-grid.duplex-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 480px) {
  .print-page #main { padding-inline: 10px; }
  .print-setup-copy,
  .print-filter-row,
  .print-layout-row,
  .print-summary,
  .print-instructions,
  .print-note { padding-inline: 14px; }
  .print-preview-head { align-items: flex-start; }
  .print-preview-head .pill-btn { padding-inline: 14px; }
  .print-sheet { padding: 8px; }
  .fold-card { min-height: 275px; }
}

@page {
  size: A4 landscape;
  margin: 8mm;
}

@media print {
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body.print-page {
    width: auto;
    height: auto;
    min-height: 0;
    overflow: visible;
    display: block;
    background: #fff;
  }

  .screen-only { display: none !important; }
  .print-page #main { padding: 0; overflow: visible; }
  .print-sheets { max-width: none; margin: 0; }

  .print-sheet {
    width: 281mm;
    height: 194mm;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }
  .print-sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  .print-sheet-grid {
    position: relative;
    width: 281mm;
    height: 194mm;
    grid-template-columns: repeat(2, 140.5mm);
    grid-template-rows: repeat(2, 97mm);
    gap: 0;
    background: #fff;
    box-shadow: inset 0 0 0 .3mm #666f7a;
  }
  .print-sheet-grid::before,
  .print-sheet-grid::after {
    content: "";
    position: absolute;
    z-index: 5;
    pointer-events: none;
    background: #666f7a;
  }
  .print-sheet-grid::before {
    top: 0;
    bottom: 0;
    left: calc(50% - .15mm);
    width: .3mm;
  }
  .print-sheet-grid::after {
    left: 0;
    right: 0;
    top: calc(50% - .15mm);
    height: .3mm;
  }
  .print-sheet-grid.duplex-grid {
    grid-template-columns: repeat(4, 70.25mm);
    grid-template-rows: repeat(2, 97mm);
  }
  .print-sheet-grid.duplex-grid::before {
    left: calc(25% - .15mm);
    box-shadow: 70.25mm 0 #666f7a, 140.5mm 0 #666f7a;
  }

  .fold-card {
    width: 140.5mm;
    height: 97mm;
    min-height: 0;
    border: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .fold-card-face {
    background: #fff !important;
  }
  .duplex-card {
    width: 70.25mm;
    height: 97mm;
    min-height: 0;
    border: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .duplex-card .fold-card-face { height: 97mm; }
  .duplex-card .fold-card-back { border-left: 0; }
  .fold-card-back { border-left-width: .45mm; }
  .fold-card-face { padding: 3.5mm 4mm 5mm; }
  .fold-card-meta { font-size: 6.5pt; }
  .fold-card-art { margin: 2mm 0 1.5mm; border-radius: 1.5mm; }
  .signal-svg.print-card-signal { width: 19mm; height: 34mm; }
  .fold-card-prompt { font-size: 8.8pt; }
  .fold-card-answer-copy h3 { margin-bottom: 2mm; font-size: 12.5pt; }
  .fold-card-answer { margin-bottom: 1.5mm; font-size: 8.5pt; }
  .fold-card-explain { margin-bottom: 1.5mm; font-size: 7.6pt; }
  .fold-card-tip { margin-top: 1.5mm; padding: 1.4mm 1.8mm; font-size: 7pt; }
  .fold-card-safety { padding-top: 1.5mm; font-size: 5.6pt; }
  .fold-card-side-label { right: 2mm; bottom: 1.4mm; font-size: 5.2pt; }
  .fold-card-long .fold-card-answer-copy h3 { font-size: 11pt; }
  .fold-card-long .fold-card-answer { font-size: 7.5pt; }
  .fold-card-long .fold-card-explain { font-size: 6.7pt; }
  .fold-card-long .fold-card-tip { font-size: 6.2pt; }
}
