/* GENERATED — do not edit.
 *
 * Produced by tools/gen-purchase.js from the reference dashboard. Change the generator and
 * re-run; an edit made here is lost on the next run and, worse, makes the port disagree
 * with the file it is supposed to be a copy of.
 *
 * The reference's own stylesheet, with the page frame dropped (body, its header, its tab bar,
 * <main> and the view switching — this host has all of them) and every remaining selector
 * prefixed with .pa-scope.
 * 
 * Its variable names are this host's own, so the token block goes on the scope rather than on
 * :root: inside the report the reference's palette wins and everywhere else the host's does.
 * The dark variant is driven by the host's own data-theme, which applyTheme stamps on <html>.
 * The reference also followed prefers-color-scheme; here the host's theme picker decides.
 */
.pa-scope {
  --surface-1:      #fcfcfb;
  --page-plane:     #f9f9f7;
  --surface-2:      #ffffff;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11,11,11,0.10);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;
  --seq-100:#cde2fb;
  --seq-200:#9ec5f4;
  --seq-300:#6da7ec;
  --seq-400:#3987e5;
  --seq-450:#2a78d6;
  --seq-500:#256abf;
  --seq-600:#184f95;
  --seq-700:#0d366b;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --success-text: #006300;
}

:root[data-theme="dark"] .pa-scope,
:root[data-theme="midnight"] .pa-scope,
:root[data-theme="ocean"] .pa-scope,
:root[data-theme="aurora"] .pa-scope {
  --surface-1: #1a1a19;
  --page-plane: #0d0d0d;
  --surface-2: #232322;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --gridline: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255,255,255,0.10);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --success-text: #0ca30c;
}

.pa-scope { color:var(--text-primary); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
/* The section the reference renders into sits where its <main> did, which does not come across. */
.pa-scope .pa-view { display:block; min-width:0; }

.pa-scope .section-intro { margin: 4px 0 18px; }
.pa-scope .section-intro h2 { font-size:19px; margin:0 0 4px; }
.pa-scope .section-intro p { font-size:13px; color:var(--text-secondary); margin:0; max-width:900px; line-height:1.55; }
.pa-scope .kpi-row { display:grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap:12px; margin-bottom:20px; }
.pa-scope .stat-tile {
  background: var(--surface-1); border:1px solid var(--border); border-radius:12px;
  padding:14px 16px;
}
.pa-scope .stat-tile .label { font-size:11.5px; color:var(--text-muted); margin-bottom:6px; }
.pa-scope .stat-tile .value { font-size:24px; font-weight:650; letter-spacing:-0.01em; }
.pa-scope .stat-tile .delta { font-size:12px; margin-top:4px; font-weight:600; }
.pa-scope .stat-tile .delta.good { color: var(--success-text); }
.pa-scope .stat-tile .delta.bad { color: var(--status-critical); }
.pa-scope .stat-tile .delta.neutral { color: var(--text-muted); }
.pa-scope .stat-tile .foot { font-size:11px; color:var(--text-muted); margin-top:4px; }
.pa-scope .grid-2 { display:grid; grid-template-columns: 1.3fr 1fr; gap:16px; margin-bottom:16px; }
.pa-scope .grid-2.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) {
  .pa-scope .grid-2,
.pa-scope .grid-2.even { grid-template-columns: 1fr; }
}
.pa-scope .card {
  background: var(--surface-1); border:1px solid var(--border); border-radius:12px;
  padding:16px 18px; margin-bottom:16px;
}
.pa-scope .card h3 { font-size:14px; margin:0 0 2px; font-weight:650; }
.pa-scope .card .card-sub { font-size:11.5px; color:var(--text-muted); margin:0 0 12px; line-height:1.5;}
.pa-scope .card .chart-wrap { position:relative; }
.pa-scope .card .chart-wrap.h280 { height:280px; }
.pa-scope .card .chart-wrap.h240 { height:240px; }
.pa-scope .card .chart-wrap.h320 { height:320px; }
.pa-scope .callout {
  background: color-mix(in srgb, var(--series-1) 8%, var(--surface-1));
  border:1px solid var(--border); border-left:3px solid var(--series-1);
  border-radius:8px; padding:10px 14px; font-size:12.5px; color:var(--text-secondary); margin-bottom:16px; line-height:1.55;
}
.pa-scope .callout.warn { border-left-color: var(--status-serious); }
.pa-scope .callout strong { color:var(--text-primary); }
.pa-scope table.data-table { width:100%; border-collapse:collapse; font-size:12.5px; }
.pa-scope table.data-table th {
  text-align:left; font-weight:600; color:var(--text-muted); font-size:11px; text-transform:uppercase; letter-spacing:.03em;
  padding:7px 10px; border-bottom:1px solid var(--gridline); position:sticky; top:0; background:var(--surface-1);
}
.pa-scope table.data-table td { padding:7px 10px; border-bottom:1px solid var(--gridline); color:var(--text-secondary); font-variant-numeric: tabular-nums; }
.pa-scope table.data-table tr:last-child td { border-bottom:none; }
.pa-scope table.data-table td.num,
.pa-scope table.data-table th.num { text-align:right; }
.pa-scope table.data-table tbody tr:hover { background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
.pa-scope .table-scroll { max-height:340px; overflow:auto; border:1px solid var(--gridline); border-radius:8px; }
.pa-scope .legend-row { display:flex; gap:14px; flex-wrap:wrap; margin-top:8px; font-size:11.5px; color:var(--text-secondary); }
.pa-scope .legend-item { display:flex; align-items:center; gap:6px; }
.pa-scope .legend-swatch { width:10px; height:10px; border-radius:2px; display:inline-block; }
.pa-scope .pill { display:inline-block; padding:2px 8px; border-radius:20px; font-size:11px; font-weight:600; }
.pa-scope .pill.good { background: color-mix(in srgb, var(--status-good) 15%, transparent); color: var(--success-text); }
.pa-scope .pill.warn { background: color-mix(in srgb, var(--status-warning) 20%, transparent); color: #8a5a00; }
.pa-scope .pill.bad { background: color-mix(in srgb, var(--status-critical) 15%, transparent); color: var(--status-critical); }
.pa-scope .controls-row { display:flex; gap:20px; flex-wrap:wrap; align-items:flex-end; margin-bottom:14px; padding:12px 14px; background:var(--surface-2); border:1px solid var(--border); border-radius:10px;}
.pa-scope .control { display:flex; flex-direction:column; gap:6px; min-width:170px; }
.pa-scope .control label { font-size:11.5px; color:var(--text-muted); font-weight:600; }
.pa-scope .control input[type=range] { width:100%; accent-color: var(--series-1); }
.pa-scope .control .val { font-size:13px; font-weight:650; color:var(--text-primary); }
.pa-scope .control select { padding:6px 8px; border-radius:6px; border:1px solid var(--border); background:var(--surface-1); color:var(--text-primary); font-size:12.5px; }
.pa-scope .result-strip { display:flex; gap:12px; flex-wrap:wrap; }
.pa-scope .result-chip { background: var(--surface-2); border:1px solid var(--border); border-radius:10px; padding:10px 14px; min-width:150px; }
.pa-scope .result-chip .l { font-size:11px; color:var(--text-muted); }
.pa-scope .result-chip .v { font-size:18px; font-weight:650; margin-top:2px; }
.pa-scope .footnote { font-size:11px; color:var(--text-muted); margin-top:6px; line-height:1.5; }
.pa-scope .dd-fx-orig { font-size:11px; color:var(--text-muted); font-weight:400; }
.pa-scope .trail-row td:first-child { display:flex; align-items:center; gap:6px; }
.pa-scope .trail-toggle { display:inline-block; width:1em; color:var(--text-muted); transition:transform .1s; }
.pa-scope .trail-row.open .trail-toggle { transform:rotate(90deg); }
.pa-scope tr.trail-detail td { background:color-mix(in srgb, var(--text-primary) 3%, transparent); padding:10px 14px 14px 30px; }
.pa-scope tr.trail-detail .data-table { font-size:12px; }
.pa-scope tr.trail-detail .table-scroll { max-height:220px; border-color:var(--gridline); }
.pa-scope tr.trail-row-highlight td { background: color-mix(in srgb, var(--series-1) 12%, transparent); font-weight:600; }
.pa-scope .two-col-table { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:900px) {
  .pa-scope .two-col-table { grid-template-columns:1fr; }
}
.pa-scope .badge-cat { display:inline-flex; align-items:center; gap:6px; }
.pa-scope .dot { width:8px; height:8px; border-radius:2px; display:inline-block; flex:none; }
.pa-scope /* ---- drill-down modal ---- */
.modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.5); display:none; align-items:flex-start; justify-content:center;
  z-index:200; padding:40px 20px; overflow-y:auto;
}
.pa-scope .modal-overlay.open { display:flex; }
.pa-scope .modal-panel {
  background:var(--surface-1); border:1px solid var(--border); border-radius:14px; max-width:820px; width:100%;
  box-shadow:0 20px 60px rgba(0,0,0,0.3); animation:modalIn .15s ease-out;
}
@keyframes modalIn { from{ opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);} }
.pa-scope .modal-header {
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  padding:18px 20px; border-bottom:1px solid var(--border);
}
.pa-scope .modal-header h2 { font-size:16px; margin:0 0 4px; }
.pa-scope .modal-header .modal-sub { font-size:12px; color:var(--text-muted); }
.pa-scope .modal-close {
  border:1px solid var(--border); background:var(--surface-2); color:var(--text-primary);
  width:30px; height:30px; border-radius:8px; cursor:pointer; font-size:15px; flex:none; line-height:1;
}
.pa-scope .modal-close:hover { border-color:var(--baseline); }
.pa-scope .modal-body { padding:18px 20px; max-height:74vh; overflow-y:auto; }
.pa-scope .dd-block { border:1px solid var(--border); border-radius:10px; padding:12px 14px; margin-bottom:12px; background:var(--surface-2); }
.pa-scope .dd-block:last-child { margin-bottom:0; }
.pa-scope .dd-block h4 { font-size:12.5px; margin:0 0 8px; display:flex; align-items:center; gap:6px; }
.pa-scope .dd-row { display:flex; justify-content:space-between; gap:10px; font-size:12.5px; padding:3px 0; color:var(--text-secondary); }
.pa-scope .dd-row b { color:var(--text-primary); font-variant-numeric:tabular-nums; }
.pa-scope .reason-table { width:100%; border-collapse:collapse; }
.pa-scope .reason-table tr { border-bottom:1px solid var(--gridline); }
.pa-scope .reason-table tr:last-child { border-bottom:none; }
.pa-scope .reason-table td { padding:9px 4px; font-size:12.5px; line-height:1.5; color:var(--text-secondary); vertical-align:top; }
.pa-scope .reason-table tr:first-child td { padding-top:0; }
.pa-scope .reason-table tr:last-child td { padding-bottom:0; }
.pa-scope .reason-table td.idx { color:var(--text-muted); font-weight:600; width:1%; white-space:nowrap; padding-right:8px; }
.pa-scope .reason-table td.pts { text-align:right; font-variant-numeric:tabular-nums; color:var(--text-primary); font-weight:700; white-space:nowrap; padding-left:14px; width:1%; }
.pa-scope .dd-scale { position:relative; height:28px; margin:10px 0 4px; }
.pa-scope .dd-scale .track { position:absolute; top:12px; left:0; right:0; height:4px; background:var(--gridline); border-radius:2px; }
.pa-scope .dd-scale .marker { position:absolute; top:4px; width:2px; height:20px; background:var(--baseline); }
.pa-scope .dd-scale .marker.this { background:var(--status-critical); width:3px; }
.pa-scope .dd-scale .lbl { position:absolute; top:-14px; font-size:9.5px; color:var(--text-muted); transform:translateX(-50%); white-space:nowrap; }
.pa-scope .clickable-row { cursor:pointer; }
.pa-scope .clickable-row:hover td { background:color-mix(in srgb, var(--series-1) 6%, transparent); }
.pa-scope .modal-panel.wide { max-width:1040px; }
.pa-scope .stat-tile.clickable-tile { cursor:pointer; transition:border-color .1s, background-color .1s; }
.pa-scope .stat-tile.clickable-tile:hover { border-color:var(--series-1); background:color-mix(in srgb, var(--series-1) 6%, transparent); }
.pa-scope .stat-tile.clickable-tile .label::after { content:" 🔍"; font-size:10px; opacity:.6; }
.pa-scope canvas.chart-clickable { cursor:pointer; }

/* The two dialogs live in a container of their own under <body>, outside every tab panel —
   a fixed element inside a hidden panel is hidden with it. They sit above the host's own
   drill modal (1500) because they are opened from inside the report. */
.pa-scope.pa-modals .modal-overlay { z-index: 1600; }

/* Phone: a chart keeps a readable scale and scrolls inside its card, as every chart here does. */
@media (max-width: 991.98px) {
  .pa-scope .chart-wrap { min-width: 520px; }
  .pa-scope .card { overflow-x: auto; }
}
