/* Partner QA — report styles. Used by the Partner QA page AND embedded in the standalone HTML export, so it defines its own tokens. */

:root {
  --rp-bg: #f6f7f9;
  --rp-surface: #ffffff;
  --rp-surface-2: #f2f4f7;
  --rp-border: #e3e6eb;
  --rp-text: #1b2430;
  --rp-muted: #667085;
  --rp-accent: #f6821f;
  --rp-accent-soft: #fff1e3;
  --rp-excellent: #12a150;
  --rp-good: #4cb782;
  --rp-fair: #e5a100;
  --rp-poor: #d92d20;
  --rp-full: #12a150;
  --rp-half: #e5a100;
  --rp-zero: #d92d20;
  --rp-na: #c5cad3;
  --rp-info: #2f6fed;
  --rp-radius: 12px;
  --rp-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.08);
  --rp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --rp-bg: #0f141b;
    --rp-surface: #171d26;
    --rp-surface-2: #1e2531;
    --rp-border: #2a3341;
    --rp-text: #e8ecf2;
    --rp-muted: #9aa5b5;
    --rp-accent-soft: #3a2a18;
    --rp-na: #475062;
    --rp-shadow: none;
  }
}
:root[data-theme="dark"] {
  --rp-bg: #0f141b;
  --rp-surface: #171d26;
  --rp-surface-2: #1e2531;
  --rp-border: #2a3341;
  --rp-text: #e8ecf2;
  --rp-muted: #9aa5b5;
  --rp-accent-soft: #3a2a18;
  --rp-na: #475062;
  --rp-shadow: none;
}

body.report-standalone {
  margin: 0;
  background: var(--rp-bg);
  color: var(--rp-text);
  font-family: var(--rp-font);
}

.rp, .rp * { box-sizing: border-box; }
.rp {
  --gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  color: var(--rp-text);
  font-family: var(--rp-font);
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.rp h1, .rp h2, .rp h3, .rp h4, .rp p { margin: 0; }
.rp button { font-family: inherit; }

/* header */
.rp-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--rp-border); }
.rp-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rp-accent); }
.rp-eyebrow::before { content: ''; width: 18px; height: 3px; border-radius: 2px; background: var(--rp-accent); }
.rp h1 { font-size: 28px; line-height: 1.2; margin-top: 6px; font-weight: 700; letter-spacing: -0.01em; }
.rp-meta { margin-top: 6px; color: var(--rp-muted); font-size: 13px; }
.rp-meta span + span::before { content: '·'; margin: 0 8px; }
.rp-btn { border: 1px solid var(--rp-border); background: var(--rp-surface); color: var(--rp-text); border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 500; cursor: pointer; }
.rp-btn:hover { border-color: var(--rp-accent); color: var(--rp-accent); }

/* section nav */
.rp-nav { position: sticky; top: var(--rp-nav-top, 0px); z-index: 5; display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; margin-bottom: 8px; background: var(--rp-bg); border-bottom: 1px solid var(--rp-border); scrollbar-width: none; }
.rp-nav::-webkit-scrollbar { display: none; }
.rp-nav a { flex: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--rp-muted); text-decoration: none; }
.rp-nav a:hover { background: var(--rp-surface-2); color: var(--rp-text); }

.rp-section { margin-top: 28px; scroll-margin-top: calc(var(--rp-nav-top, 0px) + 64px); } /* clear the sticky section menu (and the app header when embedded) */
.rp-section > h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.005em; }
.rp-section > .rp-sub { margin-top: 2px; color: var(--rp-muted); font-size: 13px; }
.rp-section > .rp-grid, .rp-section > .rp-card, .rp-section > .rp-table-wrap { margin-top: 12px; }

.rp-grid { display: grid; gap: var(--gap); }
.rp-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rp-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rp-grid.hero { grid-template-columns: 280px minmax(0, 1fr); }
@media (max-width: 860px) {
  .rp-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-grid.cols-3, .rp-grid.cols-2, .rp-grid.hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) { .rp-grid.cols-4 { grid-template-columns: minmax(0, 1fr); } .rp h1 { font-size: 23px; } }

.rp-card { background: var(--rp-surface); border: 1px solid var(--rp-border); border-radius: var(--rp-radius); padding: 16px; box-shadow: var(--rp-shadow); min-width: 0; }
.rp-card > h3 { font-size: 13px; font-weight: 600; color: var(--rp-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px; }

/* hero */
.rp-ring-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.rp-ring { position: relative; width: 176px; height: 176px; }
.rp-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rp-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rp-ring-value { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.rp-ring-of { font-size: 12px; color: var(--rp-muted); margin-top: 4px; }
.rp-band { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; }
.rp-headline { font-size: 18px; font-weight: 600; line-height: 1.35; }
.rp-bullets { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rp-bullets li { position: relative; padding-left: 18px; color: var(--rp-text); }
.rp-bullets li::before { content: ''; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--rp-accent); }

/* KPIs */
.rp-kpi .label { font-size: 12px; color: var(--rp-muted); font-weight: 500; }
.rp-kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.1; }
.rp-kpi .value small { font-size: 14px; font-weight: 500; color: var(--rp-muted); margin-left: 2px; }
.rp-kpi .note { margin-top: 6px; font-size: 12px; color: var(--rp-muted); }
.rp-delta.up { color: var(--rp-excellent); font-weight: 600; }
.rp-delta.down { color: var(--rp-poor); font-weight: 600; }

/* bars */
.rp-bars { display: grid; gap: 14px; }
.rp-bar-row .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 5px; }
.rp-bar-row .name { font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.rp-bar-row .val { font-weight: 650; flex: none; }
.rp-bar-row .hint { color: var(--rp-muted); font-size: 12px; margin-top: 3px; }
.rp-track { position: relative; height: 10px; border-radius: 999px; background: var(--rp-surface-2); overflow: visible; }
.rp-fill { height: 100%; border-radius: 999px; }
.rp-target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--rp-text); opacity: 0.35; border-radius: 1px; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--rp-muted); }
.rp-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: baseline; }

.rp-stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--rp-surface-2); gap: 2px; }
.rp-stack > span { display: block; height: 100%; min-width: 0; }
.rp-stack-row { margin-top: 14px; }
.rp-stack-row:first-of-type { margin-top: 0; }
.rp-stack-row .cap { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.rp-stack-row .cap b { font-weight: 600; }

/* charts */
.rp-chart { width: 100%; height: auto; display: block; overflow: visible; }
.rp-chart text { fill: var(--rp-muted); font-size: 11px; font-family: var(--rp-font); }
.rp-chart .grid { stroke: var(--rp-border); stroke-width: 1; }
.rp-chart .target { stroke: var(--rp-text); stroke-opacity: 0.4; stroke-width: 1.5; stroke-dasharray: 4 4; }
.rp-chart .axis-label { font-size: 11px; }

/* tables */
.rp-table-wrap { overflow-x: auto; background: var(--rp-surface); border: 1px solid var(--rp-border); border-radius: var(--rp-radius); box-shadow: var(--rp-shadow); }
.rp-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.rp-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--rp-muted); padding: 10px 12px; border-bottom: 1px solid var(--rp-border); white-space: nowrap; background: var(--rp-surface); }
.rp-table th.sortable { cursor: pointer; user-select: none; }
.rp-table th.sortable:hover { color: var(--rp-text); }
.rp-table td { padding: 10px 12px; border-bottom: 1px solid var(--rp-border); vertical-align: top; }
.rp-table tr:last-child td { border-bottom: none; }
.rp-table .num { text-align: right; white-space: nowrap; }
.rp-table tr.clickable { cursor: pointer; }
.rp-table tr.clickable:hover td { background: var(--rp-surface-2); }
.rp-table .muted { color: var(--rp-muted); }
.rp-table .small { font-size: 12px; }
.rp-table .rule-name { font-weight: 550; }
.rp-table .rule-cat { font-size: 12px; color: var(--rp-muted); }
.rp-inline-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.rp-inline-bar .rp-track { flex: 1; height: 8px; }

.rp-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.rp-chip.excellent { background: color-mix(in srgb, var(--rp-excellent) 16%, transparent); color: var(--rp-excellent); }
.rp-chip.good { background: color-mix(in srgb, var(--rp-good) 20%, transparent); color: #2c8a5c; }
.rp-chip.fair { background: color-mix(in srgb, var(--rp-fair) 20%, transparent); color: #a87400; }
.rp-chip.poor { background: color-mix(in srgb, var(--rp-poor) 16%, transparent); color: var(--rp-poor); }
.rp-chip.flag { background: color-mix(in srgb, var(--rp-poor) 14%, transparent); color: var(--rp-poor); }
.rp-chip.neutral { background: var(--rp-surface-2); color: var(--rp-muted); }
:root[data-theme="dark"] .rp-chip.good, :root:not([data-theme="light"]) .rp-chip.good { color: #7bd9a6; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .rp-chip.good { color: #2c8a5c; } }

/* insights */
.rp-insight { display: grid; gap: 12px; align-content: start; }
.rp-insight h4 { font-size: 15px; font-weight: 650; }
.rp-insight .pctline { font-size: 13px; color: var(--rp-muted); }
.rp-reco { background: var(--rp-accent-soft); border-left: 3px solid var(--rp-accent); padding: 10px 12px; border-radius: 6px; font-size: 13px; }
.rp-reco b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--rp-accent); margin-bottom: 2px; }
.rp-quote { margin: 0; padding: 10px 12px; background: var(--rp-surface-2); border-radius: 8px; border-left: 3px solid var(--rp-border); }
.rp-quote .q { font-size: 13.5px; overflow-wrap: anywhere; }
.rp-quote .t { margin-top: 4px; font-size: 13px; color: var(--rp-muted); font-style: italic; overflow-wrap: anywhere; }
.rp-quote .by { margin-top: 6px; font-size: 12px; color: var(--rp-muted); }
.rp-quote .by a { color: var(--rp-accent); cursor: pointer; text-decoration: none; font-weight: 600; }
.rp-quote.good { border-left-color: var(--rp-excellent); }
.rp-quote.bad { border-left-color: var(--rp-poor); }
.rp-list { display: grid; gap: 12px; }
.rp-crit { display: grid; gap: 8px; }
.rp-crit .head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.rp-crit .head b { font-weight: 650; }
.rp-crit .reason { color: var(--rp-muted); font-size: 13px; }

.rp-empty { color: var(--rp-muted); padding: 8px 0; }
.rp-method dl { margin: 0; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 6px 16px; }
.rp-method dt { color: var(--rp-muted); }
.rp-method dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .rp-method dl { grid-template-columns: minmax(0, 1fr); } .rp-method dt { margin-top: 6px; } }

.rp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rp-filters input, .rp-filters select { border: 1px solid var(--rp-border); background: var(--rp-surface); color: var(--rp-text); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; min-width: 0; }
.rp-filters input { flex: 1 1 200px; }

.rp-foot { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--rp-border); color: var(--rp-muted); font-size: 12px; }

/* transcript modal */
.rp-modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 27, 0.55); display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; }
.rp-modal { width: 100%; max-width: 1040px; background: var(--rp-surface); color: var(--rp-text); border-radius: 14px; border: 1px solid var(--rp-border); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); }
.rp-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--rp-border); }
.rp-modal-head h3 { font-size: 16px; font-weight: 650; }
.rp-modal-head .sub { color: var(--rp-muted); font-size: 13px; margin-top: 2px; }
.rp-modal-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; }
@media (max-width: 800px) { .rp-modal-body { grid-template-columns: minmax(0, 1fr); } }
.rp-modal-col { padding: 16px 18px; min-width: 0; }
.rp-modal-col + .rp-modal-col { border-left: 1px solid var(--rp-border); }
@media (max-width: 800px) { .rp-modal-col + .rp-modal-col { border-left: none; border-top: 1px solid var(--rp-border); } }
.rp-modal-col h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--rp-muted); margin-bottom: 10px; }
.rp-chat { display: grid; gap: 8px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.rp-msg { max-width: 92%; padding: 8px 11px; border-radius: 10px; font-size: 13.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.rp-msg .who { display: block; font-size: 11px; font-weight: 600; color: var(--rp-muted); margin-bottom: 2px; }
.rp-msg.customer { background: var(--rp-surface-2); justify-self: start; }
.rp-msg.agent { background: color-mix(in srgb, var(--rp-info) 12%, var(--rp-surface)); justify-self: end; }
.rp-msg.bot { background: transparent; border: 1px dashed var(--rp-border); justify-self: start; color: var(--rp-muted); }
.rp-msg.system { justify-self: center; font-size: 12px; color: var(--rp-muted); background: transparent; }
.rp-msg.hl { outline: 2px solid var(--rp-accent); }
.rp-ruleres { display: grid; gap: 10px; max-height: 62vh; overflow-y: auto; }
.rp-ruleres .item { border: 1px solid var(--rp-border); border-radius: 8px; padding: 9px 11px; }
.rp-ruleres .item .t1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 550; font-size: 13px; }
.rp-ruleres .item .why { font-size: 13px; color: var(--rp-muted); margin-top: 3px; }
.rp-dec { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 4px; color: #fff; white-space: nowrap; align-self: flex-start; }
.rp-dec.full, .rp-dec.pass { background: var(--rp-full); }
.rp-dec.half { background: var(--rp-half); }
.rp-dec.zero, .rp-dec.flag, .rp-dec.hard_fail { background: var(--rp-zero); }
.rp-dec.na { background: var(--rp-na); }

@media print {
  body.report-standalone { background: #fff; }
  .rp { max-width: none; padding: 0; }
  .rp-nav, .rp-actions, .rp-filters, .rp-modal-back { display: none !important; }
  .rp-card, .rp-table-wrap, .rp-quote, .rp-crit { break-inside: avoid; box-shadow: none; }
  .rp-section { break-inside: auto; }
  .rp-table-wrap { overflow: visible; }
  .rp-table { min-width: 0; }
  .rp-table tr { break-inside: avoid; }
}
