/* Report page (extends main.css tokens) */
.report {
  --surface: #ffffff;
  --page: #f4f6fb;
  --text-primary: #0b1430;
  --text-secondary: #4a5470;
  --text-muted: #5f6b88;
  --grid: #e7ebf3;
  /* status (fixed, never themed) */
  --st-good: #0ca30c;
  --st-warning: #fab219;
  --st-serious: #ec835a;
  --st-critical: #d03b3b;
  /* chart series (validated pair) */
  --series-images: #eb6834;
  --series-rest: #2a78d6;
  background: var(--page);
  color: var(--text-primary);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.r-hero {
  color: #fff; padding: calc(22px + env(safe-area-inset-top)) 0 120px;
  background:
    radial-gradient(900px 420px at 80% 0%, rgba(18, 176, 90, .25), transparent 70%),
    linear-gradient(180deg, #0d1733, #070d1f);
}
.r-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 48px; }
.r-top img { height: 38px; width: auto; }
.r-actions { display: flex; align-items: center; gap: 10px; }
.r-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--green-400); font-weight: 800; font-size: .92rem; }
.r-hero h1 { margin: 12px 0 10px; font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 900; line-height: 1.2; text-wrap: balance; }
.r-sub { max-width: 60ch; color: rgba(226, 232, 245, .8); font-size: 1.1rem; }
.r-meta { margin-top: 14px; color: rgba(226, 232, 245, .6); font-size: .9rem; font-weight: 700; }

.r-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: -84px; padding-bottom: 80px; position: relative; }
.r-main > * { min-width: 0; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { background: var(--surface); border-radius: 20px; padding: 20px 22px; box-shadow: var(--shadow-1); }
.tile-label { color: var(--text-secondary); font-weight: 700; font-size: .92rem; }
.tile-value { margin-top: 6px; font-size: clamp(2rem, 3.4vw, 2.8rem); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-value small { margin-inline-start: 4px; font-size: .95rem; color: var(--text-muted); font-weight: 800; }
.tile-from { color: var(--text-muted); font-size: .88rem; font-weight: 600; margin-top: 4px; }
.tile-note { display: inline-block; margin-top: 10px; padding: 3px 10px; border-radius: 999px; background: var(--mint-50); color: var(--green-700); font-weight: 800; font-size: .82rem; }

.r-card { background: var(--surface); border-radius: 24px; padding: clamp(20px, 3vw, 36px); box-shadow: var(--shadow-1); }
.r-card h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 900; line-height: 1.3; }
.r-lead { margin-top: 6px; color: var(--text-secondary); }
.r-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.r-note { margin-top: 12px; color: var(--text-muted); font-size: .85rem; }

.seg-light { display: inline-flex; padding: 4px; border-radius: 999px; background: #eef2f8; }
.seg-light button { min-height: 38px; padding: 6px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--text-secondary); font-weight: 800; cursor: pointer; }
.seg-light button[aria-selected="true"] { background: #fff; color: var(--text-primary); box-shadow: 0 2px 8px rgba(11, 20, 48, .12); }

/* score rings */
.rings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ring-pair { padding: 18px 12px; border-radius: 18px; background: var(--page); text-align: center; }
.ring-pair h3 { font-size: 1rem; font-weight: 800; margin-bottom: 12px; }
.ring-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ring-arrow { color: var(--text-muted); flex: none; }
.ring { position: relative; margin: 0; width: 84px; display: grid; justify-items: center; }
.ring svg { display: block; }
.ring .track { fill: none; stroke: var(--grid); stroke-width: 8; }
.ring .arc { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray .8s var(--ease); }
.ring.good .arc { stroke: var(--st-good); }
.ring.needs .arc { stroke: var(--st-warning); }
.ring.poor .arc { stroke: var(--st-critical); }
.ring-val { position: absolute; top: 42px; left: 50%; translate: -50% -50%; font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.ring figcaption { margin-top: 6px; color: var(--text-muted); font-size: .82rem; font-weight: 700; }
.thresholds { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; color: var(--text-secondary); font-size: .86rem; font-weight: 600; }
.thresholds li { display: inline-flex; align-items: center; gap: 8px; }
.thresholds .sw { width: 12px; height: 12px; border-radius: 50%; }
.thresholds .good .sw { background: var(--st-good); }
.thresholds .needs .sw { background: var(--st-warning); }
.thresholds .poor .sw { background: var(--st-critical); }

/* weight bars */
.legend { display: flex; gap: 18px; margin: 18px 0 10px; color: var(--text-secondary); font-size: .88rem; font-weight: 700; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.s-img { background: var(--series-images); }
.s-rest { background: var(--series-rest); }
.wbars { display: grid; gap: 18px; }
.wlabel { font-weight: 800; margin-bottom: 6px; }
.wlabel span { color: var(--text-muted); font-weight: 600; font-size: .86rem; margin-inline-start: 8px; }
.wtrack { display: flex; align-items: center; height: 30px; }
.seg { height: 100%; min-width: 3px; }
.seg + .seg { margin-inline-start: 2px; }
.seg.s-rest { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.wval { margin-inline-start: 10px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* metrics table */
.table-wrap { overflow-x: auto; margin-top: 18px; }
.mtable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.mtable th, .mtable td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--grid); }
.mtable thead th { color: var(--text-muted); font-size: .82rem; font-weight: 800; }
.mtable tbody th { font-weight: 800; }
.mtable .num { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mtable .nxt { background: rgba(18, 176, 90, .06); }
.mtable .mean { color: var(--text-secondary); min-width: 220px; }

/* audit */
.sev-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.sev-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border: 0; border-radius: 999px;
  background: #eef2f8; color: var(--text-secondary); font-weight: 800; cursor: pointer;
}
.sev-btn b { color: var(--text-muted); }
.sev-btn[aria-selected="true"] { background: var(--navy-800); color: #fff; }
.sev-btn[aria-selected="true"] b { color: rgba(255, 255, 255, .7); }
.sev-btn.high svg, .sev.high svg { color: var(--st-critical); }
.sev-btn.medium svg, .sev.medium svg { color: var(--st-serious); }
.sev-btn.low svg, .sev.low svg { color: var(--st-warning); }
.agroup + .agroup { margin-top: 28px; }
.agroup h3 { font-size: 1.05rem; font-weight: 900; margin-bottom: 10px; }
.finding { border-radius: 14px; background: var(--page); margin-bottom: 8px; }
.finding summary {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none;
}
.finding summary::-webkit-details-marker { display: none; }
.finding[open] summary { padding-bottom: 6px; }
.sev {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-width: 88px; padding: 3px 10px; border-radius: 999px;
  background: #fff; color: var(--text-primary); font-size: .78rem; font-weight: 800; box-shadow: inset 0 0 0 1px var(--grid);
}
.ftitle { flex: 1; font-weight: 800; line-height: 1.5; }
.fid { color: var(--text-muted); font-size: .8rem; font-weight: 700; }
.fbody { padding: 0 16px 16px; display: grid; gap: 6px; color: var(--text-secondary); }
.fbody b { color: var(--text-primary); }

/* phases */
.phases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 20px; }
.phase { display: flex; gap: 14px; padding: 20px; border-radius: 18px; background: var(--page); }
.pnum { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-800); color: #fff; font-weight: 900; }
.phase h3 { font-size: 1.05rem; font-weight: 900; }
.phase p { color: var(--text-secondary); margin-top: 4px; }
.pcount { font-weight: 800; color: var(--green-700) !important; }
.pitems { margin-top: 8px; display: grid; gap: 4px; font-size: .88rem; color: var(--text-secondary); }
.pitems span { color: var(--text-muted); font-weight: 800; margin-inline-end: 4px; }

.r-method ul { margin-top: 12px; display: grid; gap: 8px; color: var(--text-secondary); padding-inline-start: 20px; list-style: disc; }

.tip {
  position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none;
  padding: 6px 10px; border-radius: 8px; background: var(--navy-900); color: #fff; font-size: .82rem; font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}

@media (max-width: 900px) {
  .tiles, .rings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phases { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .tiles, .rings { gap: 10px; }
  .tile { padding: 16px; }
  .ring-pair { padding: 14px 6px; }
  .ring-row { gap: 4px; }
  .ring, .ring svg { width: 62px; height: auto; }
  .ring-val { top: 31px; font-size: 1.05rem; }
  .ring-arrow { width: 16px; }
  .r-top .btn span { display: none; }
  .finding summary { flex-wrap: wrap; }
  .fid { display: none; }
}
