/* ==================== Print Report — Alien/Tech Edition ====================
   White paper (print-friendly), strong cyan accents, monospace tech labels,
   alien glyphs in tool headers. Feels like a report from the wireframe UI. */

/* Hidden in screen view, visible when .printing-report is on body */
#print-report-root {
  display: none;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #0a1628;
  font-size: 9.5pt;
  line-height: 1.5;
}

/* Triggered via JS class on body — no @media print dependency.
   This makes the hide rule reliable across browsers and SW cache states. */
body.printing-report > *:not(#print-report-root) {
  display: none !important;
}
body.printing-report {
  background: #ffffff !important;
  color: #0a1628 !important;
}
body.printing-report #print-report-root {
  display: block !important;
}

/* @page still controls the actual print sheet (size, margins) */
@page {
  size: A4;
  margin: 16mm 14mm 18mm 14mm;
}

/* Page breaks only matter when actually printing */
@media print {
  .print-cover { page-break-after: always; }
  .print-tool  { page-break-after: always; }
  .print-tool:last-of-type { page-break-after: auto; }
}

/* ==================== Shared Tech Decor ==================== */
:root { /* (variables fallback if @page unsupported) */ }

/* ==================== Cover Page ==================== */
.print-cover {
  position: relative;
  text-align: center;
  padding: 18mm 0 16mm;
  overflow: hidden;
  /* Fill the printable area so the glyph row sits at the very bottom */
  min-height: 240mm;
  display: flex;
  flex-direction: column;
}

.print-cover__content {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.print-cover__spacer {
  flex: 1 1 auto;
}

.print-cover__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160mm;
  height: 160mm;
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: 0.18;
  pointer-events: none;
}
.print-cover__ring circle {
  fill: none;
  stroke: #00b8d4;
  stroke-width: 0.5;
}
.print-cover__ring .ring-outer { stroke-dasharray: 2 4; }
.print-cover__ring .ring-mid   { stroke-width: 0.6; }
.print-cover__ring .ring-inner { stroke-width: 0.7; }
.print-cover__ring .ring-pulse { fill: #00b8d4; stroke: none; }

.print-cover__content {
  position: relative;
  z-index: 1;
}

.print-cover__logo {
  display: block;
  width: 90mm;
  height: auto;
  margin: 0 auto 12mm;
}

.print-cover__id {
  display: inline-block;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8pt;
  letter-spacing: 0.18em;
  color: #00b8d4;
  padding: 1.5mm 4mm;
  border: 1px solid #00b8d4;
  border-radius: 2px;
  margin-bottom: 6mm;
}

.print-cover h1 {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 26pt;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 5mm;
  color: #0a1628;
  text-transform: uppercase;
}

.print-cover__date {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9pt;
  color: #5a6b80;
  margin: 0 0 14mm;
  letter-spacing: 0.08em;
}

.print-cover__bar {
  width: 60mm;
  height: 3px;
  background: #00b8d4;
  margin: 0 auto 12mm;
  position: relative;
}
.print-cover__bar::before,
.print-cover__bar::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #00b8d4;
  transform: translateY(-50%);
}
.print-cover__bar::before { left: -6px; }
.print-cover__bar::after  { right: -6px; }

.print-cover__label {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8.5pt;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5a6b80;
  margin: 0 0 2mm;
  display: block;
}

.print-cover__count {
  display: block;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9pt;
  color: #00b8d4;
  margin: 0 0 5mm;
}

.print-toc {
  list-style: none;
  padding: 0;
  margin: 0 auto 0;
  text-align: left;
  display: block;
  min-width: 130mm;
  max-width: 150mm;
}
.print-toc li {
  display: grid;
  grid-template-columns: 18mm 1fr auto;
  align-items: baseline;
  gap: 3mm;
  padding: 2.8mm 0;
  border-bottom: 1px solid #e1e8ef;
  font-size: 11pt;
  color: #0a1628;
  page-break-inside: avoid;
}
.print-toc li:last-child { border-bottom: none; }
.print-toc__num {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8.5pt;
  color: #00b8d4;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.print-toc__name { font-weight: 500; }
.print-toc__cat {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 7.5pt;
  color: #8a99ad;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.print-cover__empty {
  color: #8a99ad;
  font-style: italic;
  margin: 6mm 0;
}

/* Cover footer with glyphs */
.print-cover__glyphs {
  display: flex;
  justify-content: center;
  gap: 12mm;
  margin: 0;
  z-index: 1;
  position: relative;
  flex: 0 0 auto;
}
.print-cover__glyphs svg {
  width: 9mm;
  height: 9mm;
  color: #00b8d4;
  opacity: 0.45;
}

/* ==================== Tool Page ==================== */
.print-tool {
  position: relative;
  padding: 2mm 0 0;
  page-break-inside: avoid;
}

.print-tool__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4mm;
  margin-bottom: 4mm;
  padding-bottom: 3mm;
  border-bottom: 2px solid #00b8d4;
  position: relative;
}

.print-tool__id {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8pt;
  color: #5a6b80;
  letter-spacing: 0.16em;
  white-space: nowrap;
}
.print-tool__id strong {
  color: #00b8d4;
  font-weight: 700;
}

.print-tool__title {
  font-size: 19pt;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: #0a1628;
  line-height: 1.1;
}

.print-tool__glyph {
  width: 14mm;
  height: 14mm;
  color: #00b8d4;
  flex-shrink: 0;
}

.print-tool__usecase {
  font-size: 9pt;
  color: #5a6b80;
  font-style: italic;
  margin: 0 0 6mm;
  max-width: 165mm;
  line-height: 1.4;
}

.print-tool__section {
  margin: 6mm 0 2mm;
}

.print-tool__section-head {
  display: flex;
  align-items: center;
  gap: 3mm;
  margin-bottom: 2.5mm;
}

.print-tool__section-label {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #00b8d4;
  white-space: nowrap;
}
.print-tool__section-label::before {
  content: "//";
  margin-right: 2mm;
  color: #8a99ad;
}

.print-tool__section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, #00b8d4 0%, #00b8d4 30%, #e1e8ef 100%);
}

/* ==================== Key-Value Table ==================== */
.print-kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5pt;
  page-break-inside: avoid;
  border-left: 2px solid #e1e8ef;
}
.print-kv tr {
  border-bottom: 1px solid #f0f3f7;
  page-break-inside: avoid;
}
.print-kv tr:last-child { border-bottom: none; }
.print-kv th,
.print-kv td {
  text-align: left;
  padding: 2.4mm 4mm;
  vertical-align: top;
}
.print-kv th {
  width: 40%;
  font-weight: 500;
  color: #5a6b80;
  font-size: 9pt;
}
.print-kv td {
  font-weight: 600;
  color: #0a1628;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5pt;
}

/* ==================== Group-Color Accents ==================== */
.print-tool[data-group="group-image"]  .print-tool__head,
.print-tool[data-group="group-image"]  .print-tool__glyph { border-bottom-color: #00bfff; color: #00bfff; }
.print-tool[data-group="group-image"]  .print-tool__section-label { color: #00bfff; }
.print-tool[data-group="group-image"]  .print-kv { border-left-color: #00bfff; }
.print-tool[data-group="group-image"]  .print-tool__id strong { color: #00bfff; }

.print-tool[data-group="group-power"]  .print-tool__head { border-bottom-color: #ff8c00; }
.print-tool[data-group="group-power"]  .print-tool__glyph { color: #ff8c00; }
.print-tool[data-group="group-power"]  .print-tool__section-label { color: #ff8c00; }
.print-tool[data-group="group-power"]  .print-kv { border-left-color: #ff8c00; }
.print-tool[data-group="group-power"]  .print-tool__id strong { color: #ff8c00; }

.print-tool[data-group="group-signal"] .print-tool__head { border-bottom-color: #00d4a0; }
.print-tool[data-group="group-signal"] .print-tool__glyph { color: #00d4a0; }
.print-tool[data-group="group-signal"] .print-tool__section-label { color: #00d4a0; }
.print-tool[data-group="group-signal"] .print-kv { border-left-color: #00d4a0; }
.print-tool[data-group="group-signal"] .print-tool__id strong { color: #00d4a0; }

.print-tool[data-group="group-light"]  .print-tool__head { border-bottom-color: #8e2de2; }
.print-tool[data-group="group-light"]  .print-tool__glyph { color: #8e2de2; }
.print-tool[data-group="group-light"]  .print-tool__section-label { color: #8e2de2; }
.print-tool[data-group="group-light"]  .print-kv { border-left-color: #8e2de2; }
.print-tool[data-group="group-light"]  .print-tool__id strong { color: #8e2de2; }

.print-tool[data-group="group-audio"]  .print-tool__head { border-bottom-color: #ff416c; }
.print-tool[data-group="group-audio"]  .print-tool__glyph { color: #ff416c; }
.print-tool[data-group="group-audio"]  .print-tool__section-label { color: #ff416c; }
.print-tool[data-group="group-audio"]  .print-kv { border-left-color: #ff416c; }
.print-tool[data-group="group-audio"]  .print-tool__id strong { color: #ff416c; }

/* ==================== Page Footer ==================== */
.print-footer {
  position: fixed;
  bottom: -8mm;
  left: 0;
  right: 0;
  text-align: center;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 7.5pt;
  color: #8a99ad;
  letter-spacing: 0.12em;
  padding: 1.5mm 0;
  border-top: 1px solid #e1e8ef;
}
