/* Отчёт для печати / PDF (A4). На экране — предпросмотр поверх приложения. */
.report-overlay { position: fixed; inset: 0; z-index: 5000; background: #d9d9de; overflow: auto; -webkit-overflow-scrolling: touch; }
.report-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(246,246,248,.92); backdrop-filter: blur(12px); border-bottom: 0.5px solid rgba(0,0,0,.12); }
.report-bar .r-status { flex: 1; font-size: 13px; color: #6e6e73; min-width: 0; }
.report-bar .btn { width: auto; flex: none; }
.r-sheet { padding: 20px 12px 40px; }
.r-page .r-map { overflow: hidden; }
.r-page { width: 776px; max-width: 100%; box-sizing: border-box; margin: 0 auto; background: #fff; color: #1d1d1f; padding: 34px 38px; box-shadow: 0 6px 30px rgba(0,0,0,.18); border-radius: 4px;
  font: 12px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
body.report-open { overflow: hidden; }

.r-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid #1d1d1f; padding-bottom: 10px; margin-bottom: 12px; }
.r-brand { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #0071e3; font-weight: 700; }
.r-head h1 { font-size: 21px; line-height: 1.2; margin: 3px 0 2px; font-weight: 700; }
.r-muted { color: #6e6e73; }
.r-small { font-size: 10.5px; margin: 4px 0 0; }
.r-pill { flex: none; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.r-pill.good { background: #e3f6e8; color: #1b7f3b; } .r-pill.warn { background: #fff1dc; color: #a75800; } .r-pill.bad { background: #fde7e7; color: #c4231b; }

.r-kpi { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.r-kpi > div { background: #f5f5f7; border-radius: 8px; padding: 8px 10px; min-width: 0; }
.r-kpi b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.r-kpi span { font-size: 10.5px; color: #6e6e73; }
.r-kpi .good b { color: #1b7f3b; } .r-kpi .warn b { color: #a75800; } .r-kpi .bad b { color: #c4231b; }

.r-map { margin-bottom: 4px; }
.smap { position: relative; overflow: hidden; border-radius: 8px; background: #eef0f3; max-width: 100%; }
.smap-tiles img { position: absolute; max-width: none; image-rendering: auto; }
.smap-cell { position: absolute; overflow: hidden; }
.smap-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.smap-attr { position: absolute; right: 0; bottom: 0; font-size: 9px; background: rgba(255,255,255,.8); padding: 1px 5px; border-top-left-radius: 4px; color: #333; }
.sm-halo { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.sm-line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.sm-line.good { stroke: #28a745; } .sm-line.warn { stroke: #f08c00; } .sm-line.bad { stroke: #e03131; }
.sm-pt { stroke: #fff; stroke-width: 2.5; } .sm-pt.a { fill: #0071e3; } .sm-pt.b { fill: #f08c00; } .sm-pt.sat { fill: #8e44ad; }
.sm-pt-t { fill: #fff; font: 700 11px sans-serif; text-anchor: middle; }
.sm-aim-halo { stroke: #fff; stroke-width: 3.6; stroke-linecap: round; opacity: .75; }
.sm-aim { stroke: #ff2d2d; stroke-width: 1.7; stroke-linecap: round; }
.sm-label { font: 700 13px sans-serif; fill: #1d1d1f; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.sm-north { fill: #1d1d1f; stroke: #fff; stroke-width: 2; paint-order: stroke; }
.sm-north-t { font: 700 11px sans-serif; text-anchor: middle; fill: #1d1d1f; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.sm-scale-bg { fill: rgba(255,255,255,.85); }
.sm-scale { stroke: #1d1d1f; stroke-width: 2.5; }
.sm-scale-t { font: 600 10px sans-serif; text-anchor: middle; fill: #1d1d1f; }

.r-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 10.5px; color: #6e6e73; margin: 4px 0 10px; align-items: center; }
.r-legend span { display: inline-flex; align-items: center; gap: 5px; }
.r-legend i { display: inline-block; }
.r-legend i.grad { width: 60px; height: 7px; border-radius: 4px; background: linear-gradient(90deg, hsl(0 80% 44%), hsl(34 80% 44%), hsl(68 80% 44%), hsl(101 80% 44%), hsl(135 80% 44%)); margin-right: 4px; }
.r-legend i.ln { width: 16px; border-top: 2px solid; } .r-legend i.los { border-color: #e03131; } .r-legend i.f1 { border-color: #0071e3; } .r-legend i.f60 { border-color: #0071e3; border-top-style: dashed; }
.r-legend i.box { width: 12px; height: 9px; border-radius: 2px; } .r-legend i.terr { background: #c9a77c; } .r-legend i.veg { background: rgba(52,199,89,.45); } .r-legend i.hard { background: rgba(142,142,147,.45); }

.r-h2, .r-sec h2 { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: #6e6e73; font-weight: 700; margin: 12px 0 5px; }
.r-chart { position: relative; width: 100%; height: 210px; }
.r-chart-sm { height: 170px; }
.r-grid tr, .r-kv tr { break-inside: avoid; }
.r-chart .chart-svg, .r-chart svg { width: 100%; height: 100%; display: block; }
.r-chart .chart-tip, .r-chart .chart-msg { display: none !important; }

.r-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.r-cols .r-sec { break-inside: avoid; }
.r-kv, .r-grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.r-kv th, .r-kv td, .r-grid th, .r-grid td { text-align: left; vertical-align: top; padding: 4px 0; border-bottom: 0.5px solid #e5e5ea; }
.r-kv th { font-weight: 400; color: #6e6e73; width: 42%; padding-right: 10px; }
.r-grid th { font-weight: 400; color: #6e6e73; padding-right: 10px; }
.r-grid thead th { color: #1d1d1f; font-weight: 700; border-bottom: 1px solid #1d1d1f; }
.r-grid td { padding-right: 10px; }
.r-grid tbody th { width: 30%; }
.r-sc { margin-top: 8px; }
.r-sc tbody th { width: 40%; }
.r-near td { text-align: right; }
.r-kv b, .r-grid b { font-weight: 700; }
b.good { color: #1b7f3b; } b.warn { color: #a75800; } b.bad { color: #c4231b; }
.r-notes { margin: 0; white-space: normal; }
.r-foot { margin-top: 16px; padding-top: 8px; border-top: 0.5px solid #d2d2d7; font-size: 9.5px; color: #86868b; display: grid; gap: 2px; }
.r-foot a { color: #86868b; word-break: break-all; }

@media (max-width: 760px) {
  .r-page { padding: 18px 14px; }
  .r-kpi { grid-template-columns: repeat(2, 1fr); }
  .r-cols { grid-template-columns: 1fr; }
  .report-bar .r-status { display: none; }
}

@page { size: A4; margin: 11mm 12mm; }
@media print {
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body.report-open > *:not(.report-overlay) { display: none !important; }
  .report-overlay { position: static; overflow: visible; background: none; }
  .report-bar { display: none; }
  .r-sheet { padding: 0; }
  .r-page { width: auto; max-width: none; padding: 0; margin: 0; box-shadow: none; border-radius: 0; }
  .r-kpi { grid-template-columns: repeat(5, 1fr); }
  .r-cols { grid-template-columns: 1fr 1fr; }
  .r-break-avoid, .r-map, .r-chart { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* наведение по снимкам */
.r-pagebreak { break-before: page; }
.r-aim { break-inside: avoid; }
.r-aim.r-pagebreak { margin-top: 26px; padding-top: 18px; border-top: 1px dashed #c7c7cc; }
.r-h1 { font-size: 17px; margin: 0 0 3px; }
.r-h3 { font-size: 12.5px; margin: 12px 0 6px; font-weight: 700; }
.r-intro { margin: 0 0 4px; font-size: 11px; }
.r-aim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.r-aim-grid.one { grid-template-columns: 1fr; }
.r-fig { margin: 0; min-width: 0; }
.r-fig figcaption { font-size: 9.5px; color: #86868b; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-tick { stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
.sm-tick-t { font: 700 10px sans-serif; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.75); stroke-width: 3px; stroke-linejoin: round; }
.sm-pt.a { fill: #0071e3; } .sm-pt.b { fill: #f08c00; }
.r-fig .sm-label { font-size: 12px; }
@media print { .r-aim.r-pagebreak { margin-top: 0; padding-top: 0; border-top: 0; } }

/* повёрнутые снимки «цель сверху» */
.smap-frame { position: relative; overflow: hidden; background: #3a3a3c; contain: strict; clip-path: inset(0); }
.smap-inner { position: absolute; transform-origin: 50% 50%; overflow: hidden; }
.smap-inner .smap-tiles img { position: absolute; max-width: none; }
.sm-beam { fill: rgba(255,255,255,.14); stroke: rgba(255,255,255,.75); stroke-width: 1; stroke-dasharray: 4 3; }
.sm-ring { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 1; stroke-dasharray: 2 4; }
.sm-compass { fill: rgba(255,255,255,.85); stroke: rgba(0,0,0,.25); }
.sm-label-sm { font-size: 11px !important; }
.r-fig figcaption { display: flex; gap: 8px; align-items: center; }
.r-fig figcaption > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.r-zoom { display: inline-flex; gap: 4px; }
.r-zoom-b { width: 22px; height: 20px; border: 0.5px solid #c7c7cc; border-radius: 5px; background: #fff; font: 600 13px/1 sans-serif; color: #0071e3; cursor: pointer; padding: 0; }
@media print { .r-noprint { display: none !important; } }
.sm-pill { fill: rgba(255,255,255,.9); stroke: rgba(0,0,0,.15); stroke-width: .5; }
.sm-pill-t { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 700; fill: #1d1d1f; }
