/* Print-friendly report styles
   Two contexts:
   1. On screen, when "preview" mode is on — visible on top of the app.
   2. In the print dialog (window.print()).
*/

/* SCREEN: hidden by default; visible when in preview state */
.print-report {
  display: none;
  background: #fff;
  color: #111;
  font-family: var(--sans);
}

body.print-preview .app-stage { display: none !important; }
body.print-preview .print-report {
  display: block;
  padding: 40px 0;
  background: #E8E5DC;
}
body.print-preview .print-toolbar { display: flex !important; }

/* Toolbar shown in preview mode */
.print-toolbar {
  display: none;
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #141414;
  color: #FAFAF7;
  padding: 10px 14px;
  gap: 10px;
  align-items: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  font-family: var(--sans);
}
.print-toolbar .pt-title{
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9B9689;
  padding-right: 12px;
  border-right: 1px solid #2E2A23;
  margin-right: 4px;
}
.print-toolbar button {
  background: transparent;
  border: 1px solid #2E2A23;
  color: #FAFAF7;
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}
.print-toolbar button:hover { background: #2E2A23; }
.print-toolbar button.pt-primary { background: #FAFAF7; color: #141414; border-color: #FAFAF7; }
.print-toolbar button.pt-primary:hover { background: #fff; }

/* Page sheet: matches Letter at print dpi */
.p-page {
  width: 8.5in;
  min-height: 11in;
  background: #fff;
  margin: 0 auto 24px;
  padding: 0.7in 0.7in 0.7in;
  box-sizing: border-box;
  position: relative;
  page-break-after: always;
  break-after: page;
}
.p-page:last-child {
  page-break-after: auto;
  break-after: auto;
}

/* Type system */
.p-eyebrow{
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6E6A60;
  display: block;
  margin-bottom: 6px;
}
.p-display{
  font-family: var(--serif);
  font-size: 56px;
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0;
  color: #141414;
}
.p-display em{ font-style: italic; font-weight: 400; color: #D7261E; }
.p-h2{
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0 0 14px;
  color: #141414;
  text-wrap: pretty;
}
.p-h3{
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #141414;
  margin: 24px 0 12px;
}
.p-lead{
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.45;
  color: #2B2B2B;
  margin: 14px 0;
  text-wrap: pretty;
}
.p-headline{
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #141414;
  font-weight: 500;
  margin: 6px 0 16px;
  text-wrap: pretty;
}
.p-body{
  font-size: 12px;
  line-height: 1.55;
  color: #2B2B2B;
  margin: 0 0 12px;
  text-wrap: pretty;
}
.p-body-strong{ font-weight: 600; color: #141414; }

/* Running header on continuation pages */
.p-running-head{
  display:flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6E6A60;
  padding-bottom: 12px;
  margin-bottom: 22px;
  border-bottom: 1px solid #DCD8CE;
}
.p-running-head .p-tag{
  padding: 3px 8px;
  border: 1px solid #DCD8CE;
  color: #141414;
}
.p-running-head .p-tag-s1 { background: #D7261E; color: #fff; border-color: #D7261E; }
.p-running-head .p-tag-s2 { background: #F5C518; color: #141414; border-color: #C99A0A; }
.p-running-head .p-tag-s3 { background: #1F8A3C; color: #fff; border-color: #1F8A3C; }

/* COVER */
.p-cover{
  display:flex;
  flex-direction:column;
  justify-content: space-between;
  padding-top: 0.6in;
}
.p-cover-head{
  display:flex; justify-content: space-between; align-items:center;
  padding-bottom: 18px;
  border-bottom: 2px solid #141414;
}
.p-logo { height: 22px; width: auto; }
.p-cover-body { padding: 36px 0 24px; }
.p-cover-result{
  display:grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 30px;
  background: #141414;
  color: #FAFAF7;
  padding: 28px;
  margin-top: 8px;
}
.p-stage-name{
  font-family: var(--serif);
  font-size: 44px;
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 6px 0 8px;
}
.p-stage-atrisk{ color: #D7261E; }
.p-stage-exposed{ color: #F08641; }
.p-stage-aware{ color: #F5C518; }
.p-stage-governed{ color: #4DCB66; }
.p-stage-tag{
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.4;
  color: #C9C5BA;
  margin: 6px 0 0;
  max-width: 28ch;
}
.p-cover-result .p-eyebrow{ color: #9B9689; }
.p-total{ display:flex; align-items:flex-end; gap:6px; margin-bottom: 14px; }
.p-total-num{
  font-family: var(--serif);
  font-size: 64px;
  line-height: 0.85;
  font-weight: 400;
  letter-spacing: -0.04em;
}
.p-total-of{
  font-family: var(--mono);
  font-size: 11px;
  color: #9B9689;
  padding-bottom: 8px;
}
.p-spectrum{ margin-top: 6px; }
.p-spectrum-bar{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 12px;
  position: relative;
  margin-bottom: 6px;
  border: 1px solid #2E2A23;
}
.p-seg.p-atrisk{ background: #D7261E; }
.p-seg.p-exposed{ background: #E8771A; }
.p-seg.p-aware{ background: #F5C518; }
.p-seg.p-governed{ background: #1F8A3C; }
.p-spectrum-marker{
  position: absolute;
  top: -4px;
  width: 2px;
  height: 20px;
  background: #FAFAF7;
  transform: translateX(-1px);
}
.p-pin{
  position: absolute;
  top: -4px; left: -5px;
  width: 12px; height: 12px;
  background: #FAFAF7;
  border-radius: 50%;
  border: 2px solid #141414;
}
.p-pin-label{
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: #FAFAF7;
  white-space: nowrap;
}
.p-spectrum-labels{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 18px;
}
.p-stage-row{
  display:flex; flex-direction:column;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9B9689;
}
.p-stage-row.p-active { color: #FAFAF7; }
.p-stage-row.p-active .p-stage-label { font-weight: 600; }
.p-stage-label{ font-size: 9.5px; }
.p-stage-range{ font-size: 9px; margin-top: 1px; }

.p-cover-foot{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 24px;
  margin-top: 32px;
  border-top: 1px solid #DCD8CE;
}
.p-meta{ font-size: 12px; color: #141414; }

/* Callout box */
.p-callout{
  margin-top: 18px;
  padding: 16px 18px;
  background: #F1EFE9;
  border-left: 3px solid #141414;
}
.p-callout-tight{ padding: 12px 14px; margin-top: 12px; }

/* Score table */
.p-score-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 6px;
}
.p-score-table th{
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6E6A60;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #141414;
  font-weight: 500;
}
.p-score-table th:nth-child(3), .p-score-table th:nth-child(4){ text-align: right; }
.p-score-table td{
  padding: 10px;
  border-bottom: 1px solid #DCD8CE;
  vertical-align: middle;
}
.p-score-table .p-row-num{
  font-family: var(--mono);
  font-size: 10px;
  color: #6E6A60;
  width: 32px;
}
.p-score-table .p-row-q{ color: #141414; }
.p-score-table .p-row-pts{
  text-align: right;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  width: 80px;
}
.p-score-table .p-row-pts .p-row-of{
  font-family: var(--mono);
  font-size: 9.5px;
  color: #6E6A60;
  margin-left: 2px;
}
.p-score-table .p-row-lvl{
  text-align: right;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6E6A60;
  width: 110px;
}
.p-score-table .p-row-s1 .p-row-pts{ color: #D7261E; }
.p-score-table .p-row-s2 .p-row-pts{ color: #C99A0A; }
.p-score-table .p-row-s3 .p-row-pts{ color: #1F8A3C; }
.p-score-table .p-row-total td{
  border-top: 2px solid #141414;
  border-bottom: none;
  padding-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #141414;
}
.p-score-table .p-row-total .p-row-q{ font-weight: 600; }
.p-score-table .p-row-total .p-row-pts{ color: #141414; font-family: var(--serif); font-size: 18px;}

/* Question detail page */
.p-q-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 6px;
}
.p-opt{
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #DCD8CE;
}
.p-opt:last-child{ border-bottom: none; }
.p-opt-yours{
  background: #F1EFE9;
  margin: 0 -10px;
  padding: 10px;
  border-bottom: none;
  border-left: 3px solid #141414;
  padding-left: 10px;
}
.p-opt-badge{
  width: 24px; height: 24px;
  display:flex; align-items:center; justify-content:center;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}
.p-opt-s1{ background: #D7261E; }
.p-opt-s2{ background: #F5C518; color: #141414; }
.p-opt-s3{ background: #1F8A3C; }
.p-opt-label{
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #141414;
  margin-bottom: 3px;
  display:flex; align-items: center; gap: 8px;
}
.p-opt-flag{
  background: #141414;
  color: #FAFAF7;
  padding: 1px 6px;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  font-weight: 500;
}
.p-opt-desc{ font-size: 11.5px; line-height: 1.5; color: #2B2B2B; }
.p-signals{
  list-style: none;
  padding: 0;
  margin: 0;
}
.p-signals li{
  font-size: 12px;
  line-height: 1.45;
  padding: 7px 0 7px 18px;
  color: #2B2B2B;
  border-bottom: 1px solid #DCD8CE;
  position: relative;
}
.p-signals li:before{
  content: "";
  position: absolute;
  left: 0; top: 14px;
  width: 8px; height: 1px;
  background: #141414;
}
.p-signals li:last-child{ border-bottom: none; }

/* Action card on print */
.p-action{
  border: 1px solid #DCD8CE;
  padding: 22px 24px;
  margin-top: 18px;
  break-inside: avoid;
}
.p-action-targeted{
  background: #141414;
  color: #FAFAF7;
  border-color: #141414;
}
.p-action-targeted .p-eyebrow{ color: #9B9689; }
.p-action-targeted .p-body{ color: #C9C5BA; }
.p-action-targeted .p-action-title{ color: #FAFAF7; }
.p-action-targeted .p-action-firstmove{ border-top-color: #2E2A23; }

.p-action-head{
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.p-action-num{
  font-family: var(--serif);
  font-size: 44px;
  line-height: 0.85;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: #D7261E;
}
.p-action-targeted .p-action-num{ color: #F5C518; }
.p-action-title{
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 6px 0 6px;
  color: #141414;
}
.p-action-flag{
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #F5C518;
}
.p-action-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
}
.p-list{ list-style: none; padding: 0; margin: 0; }
.p-list li{
  font-size: 11.5px;
  line-height: 1.45;
  padding: 5px 0 5px 14px;
  position: relative;
}
.p-list li:before{
  content: "→";
  position: absolute;
  left: 0;
  color: #D7261E;
}
.p-action-targeted .p-list li:before{ color: #F5C518; }
.p-action-firstmove{
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #DCD8CE;
}

/* Closing */
.p-checklist{
  list-style: none;
  padding: 0;
  margin: 18px 0 32px;
  counter-reset: checklist;
}
.p-checklist li{
  counter-increment: checklist;
  padding: 16px 0 16px 56px;
  border-bottom: 1px solid #DCD8CE;
  position: relative;
  font-size: 13px;
  line-height: 1.55;
  color: #2B2B2B;
  text-wrap: pretty;
}
.p-checklist li:before{
  content: counter(checklist, decimal-leading-zero);
  position: absolute;
  left: 0; top: 14px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  color: #D7261E;
  letter-spacing: -0.02em;
}
.p-checklist li strong{ color: #141414; }
.p-cta{
  margin-top: 26px;
  padding: 22px 24px;
  background: #F1EFE9;
  border-left: 3px solid #D7261E;
}
.p-foot{
  display:flex; align-items:center; justify-content:space-between;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid #DCD8CE;
}
.p-foot-logo{ height: 18px; width: auto; }
.p-foot-meta{
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6E6A60;
  text-align: right;
  line-height: 1.6;
}

/* "Prepared for" block on print cover */
.p-prepared-for{
  margin-top: 16px;
  padding: 14px 16px;
  background: #F1EFE9;
  border-left: 3px solid #141414;
}
.p-prepared-row{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 4px;
}
.p-prepared-name{
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: #141414;
  letter-spacing: -0.01em;
}
.p-prepared-meta{
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6E6A60;
  margin-top: 3px;
}
.p-prepared-meta-right{
  font-family: var(--mono);
  font-size: 11px;
  color: #141414;
  text-align: right;
}

/* PRINT MEDIA: actually print */
@media print {
  @page { size: Letter; margin: 0; }
  body { background: #fff; }
  body .app-stage { display: none !important; }
  body .print-toolbar { display: none !important; }
  body .tweaks-panel-root, body [data-tweaks-panel] { display: none !important; }
  .print-report { display: block !important; padding: 0 !important; background: #fff !important; }
  .p-page {
    margin: 0 !important;
    box-shadow: none !important;
    page-break-after: always;
    break-after: page;
  }
  .p-page:last-child { page-break-after: auto; break-after: auto; }
  /* Force background colors to print */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
