/* Служебная страница отчёта и его вид при сохранении в PDF */
.report-page { max-width: 860px; padding: 32px 16px 72px; }
.report-form h1 { font-size: 1.4rem; margin: 0 0 4px; }
.report-form .field { margin-top: 12px; }
.report-form .card-actions { padding-top: 6px; }

.report { margin-top: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px; }
.report-cover { border-bottom: 2px solid var(--accent); padding-bottom: 18px; margin-bottom: 8px; }
.report-logo { height: 34px; width: auto; display: block; margin-bottom: 18px; }
/* Логотип под тему: тёмные буквы на светлом фоне, светлые — на тёмном; в PDF всегда тёмные */
.report-logo.on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .report-logo.on-light { display: none; }
  :root:not([data-theme="light"]) .report-logo.on-dark { display: block; }
}
:root[data-theme="dark"] .report-logo.on-light { display: none; }
:root[data-theme="dark"] .report-logo.on-dark { display: block; }
.report-kicker { margin: 0; font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.report-cover h1 { margin: 6px 0; font-size: 1.8rem; overflow-wrap: anywhere; }
.report-client, .report-date { margin: 0; color: var(--text-2); font-size: .9rem; }
.report-section { padding: 18px 0; border-bottom: 1px solid var(--grid); }
.report-section h2 { font-size: 1.2rem; margin: 0 0 10px; }
.report-section h3 { font-size: 1rem; margin: 14px 0 6px; }
.report-section p { margin: 0 0 8px; }
.report-summary { font-size: 1.05rem; color: var(--text); font-weight: 600; }
.report-table { margin: 8px 0 12px; }
.report-table td:first-child { width: 28px; color: var(--muted); }
.lvl { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; white-space: nowrap; }
.lvl.bad { background: var(--bad); }
.lvl.warn { background: var(--series-4); color: #1a1300; }
.report-howto { font-size: .9rem; color: var(--text-2); }
.report-finding { border-left: 4px solid var(--muted); padding-left: 16px; margin: 6px 0; }
.report-finding.bad { border-left-color: var(--bad); }
.report-finding.warn { border-left-color: var(--series-4); }
.report-facts { display: grid; grid-template-columns: 190px 1fr; gap: 6px 14px; margin: 0; }
.report-facts dt { font-weight: 600; font-size: .875rem; color: var(--text-2); }
.report-facts dd { margin: 0; overflow-wrap: anywhere; }
.report-fine { color: var(--bad); font-weight: 600; }
.report-steps { margin: 0; padding-left: 20px; }
.report-steps li { margin-bottom: 6px; color: var(--text-2); }
.report-footer { padding-top: 16px; font-size: .8rem; color: var(--muted); }
.report-footer p { margin: 0 0 6px; }
@media (max-width: 620px) {
  .report { padding: 20px 16px; }
  .report-facts { grid-template-columns: 1fr; }
}

@media print {
  /* :not(#…) поднимает специфичность выше правил тёмной темы — PDF всегда светлый, даже из тёмной темы браузера */
  :root:not(#print-light) {
    color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f3f3f1; --text: #000; --text-2: #222; --muted: #555;
    --grid: #ddd; --border: #ccc; --accent: #2a78d6; --bad: #c62828; --good: #1b7f1b; --series-4: #e0a100;
  }
  body { background: #fff; }
  .no-print, .demo-bar { display: none !important; }
  .report-page { max-width: none; padding: 0; }
  .report { border: 0; padding: 0; margin: 0; }
  .report-facts, .report-steps li, .report-table tr { break-inside: avoid; }
  .report-section h2, .report-section h3 { break-after: avoid; }
  a { color: inherit; }
  /* Цветные плашки и полосы печатаются даже при выключенной «Фоновой графике» */
  .lvl, .report-finding { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-logo.on-light { display: block !important; }
  .report-logo.on-dark { display: none !important; }
  @page { margin: 16mm 14mm; }
}
.keys-admin { margin-top: 20px; }
.keys-admin h2 { font-size: 1.15rem; margin: 0 0 4px; }
.keys-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; margin: 12px 0; }
.keys-form .field { margin: 0; }
@media (max-width: 720px) { .keys-form { grid-template-columns: 1fr 1fr; } .keys-form .field:first-child { grid-column: 1 / -1; } }
.keys-admin .table-wrap { margin: 8px 0; }
/* Страница примера отчёта */
.sample-intro h1 { margin: 2px 0 8px; font-size: 1.5rem; }
.sample-intro p { color: var(--text-2); }
.sample-list { margin: 0 0 4px; padding-left: 20px; color: var(--text-2); }
.sample-list li { margin-bottom: 4px; }
.report.sample { position: relative; overflow: hidden; }
.report.sample::before {
  content: "ОБРАЗЕЦ"; position: absolute; top: 210px; left: 50%; transform: translateX(-50%) rotate(-24deg);
  font-size: clamp(3rem, 12vw, 7rem); font-weight: 800; letter-spacing: .1em; color: var(--accent); opacity: .07; pointer-events: none; white-space: nowrap;
}
