/*
 * Signal views (signal.html). Layout and styles copied from the Signal design example
 * (public-examples/signal/index.html, owned by its own session and left untouched): metrics strip,
 * panels, provider rows, answers table and the "transparent coverage" note. Every rule is scoped to
 * sg- classes, and the example's fixed colours map to the portal tokens so an agency's white-label
 * brand colour applies. The example's smallest type (8-10px) is raised to 11-12px here for legibility.
 */
.sg { --sg-line: var(--line); --sg-ink: var(--ink-strong); --sg-body: var(--ink); --sg-muted: var(--ink-muted); }
.sg-tabs { display: flex; gap: 6px; margin: 0 0 18px; border-bottom: 1px solid var(--line); max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.sg-tab { flex: 0 0 auto; white-space: nowrap; padding: 9px 12px; font-size: 13px; font-weight: 550; color: var(--ink-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sg-tab[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }

.sg-overview-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 15px; }
.sg-overview-head h2 { font-size: 15px; line-height: 1.4; font-weight: 650; letter-spacing: -.015em; margin: 0; color: var(--sg-ink); }
.sg-overview-head p { color: var(--sg-muted); font-size: 12px; margin: 4px 0 0; }

.sg-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--sg-line); border-radius: 8px; margin-bottom: 20px; overflow: hidden; }
.sg-metric { padding: 18px 20px; position: relative; min-width: 0; }
.sg-metric:not(:last-child)::after { content: ''; position: absolute; top: 20px; bottom: 20px; right: 0; width: 1px; background: var(--sg-line); }
.sg-metric__name { font-size: 12px; color: var(--sg-muted); }
.sg-metric__value { display: flex; align-items: baseline; gap: 5px; font-size: 32px; letter-spacing: -.045em; font-weight: 600; margin: 7px 0 5px; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--sg-ink); }
.sg-metric__of { font-size: 13px; letter-spacing: 0; font-weight: 500; color: var(--sg-muted); }
.sg-metric__foot { font-size: 11px; color: var(--sg-muted); margin-top: 7px; }

.sg-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); gap: 18px; margin: 18px 0 0; }
.sg-panel { border: 1px solid var(--sg-line); border-radius: 7px; background: var(--surface); overflow: hidden; }
.sg-panel__header { min-height: 57px; border-bottom: 1px solid var(--sg-line); display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 15px 18px; }
.sg-panel__header h2 { font-size: 13px; font-weight: 650; margin: 0; color: var(--sg-ink); }
.sg-sub { font-size: 11px; color: var(--sg-muted); font-weight: 400; margin-left: 7px; }
.sg-scroll { overflow-x: auto; max-width: 100%; }
.sg-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.sg-table th { font-size: 11px; font-weight: 550; color: var(--sg-muted); background: var(--surface-subtle); white-space: nowrap; padding: 11px 15px; border-bottom: 1px solid var(--sg-line); }
.sg-table td { padding: 13px 15px; border-bottom: 1px solid var(--sg-line); color: var(--sg-body); vertical-align: middle; }
.sg-table tbody tr:hover { background: var(--surface-subtle); }
.sg-table--answers { min-width: 650px; }
.sg-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sg-strong { color: var(--sg-ink); font-weight: 550; }
.sg-muted { color: var(--sg-muted); }

.sg-providers { padding: 4px 17px 10px; }
.sg-provider { display: grid; grid-template-columns: 1fr 52px 64px 48px; align-items: center; gap: 7px; border-top: 1px solid var(--sg-line); padding: 14px 0; font-size: 12px; color: var(--sg-body); }
.sg-provider > span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.sg-provider--head { border-top: 0; padding: 12px 0; color: var(--sg-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.sg-note { font-size: 11px; color: var(--sg-muted); margin: 0; padding: 0 17px 15px; }

.sg-tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; padding: 3px 6px; font-size: 11px; line-height: 1.35; white-space: nowrap; }
.sg-tag--good { color: var(--success); background: var(--success-soft); }
.sg-tag--warn { color: var(--warning); background: var(--warning-soft); }
.sg-tag--neutral { color: var(--sg-muted); background: var(--neutral-soft); }
.sg-tag--blue { color: var(--brand); background: var(--brand-soft); }

.sg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--sg-line); border-radius: 5px; background: var(--surface); color: var(--sg-body); padding: 7px 11px; font-size: 12px; font-weight: 550; text-decoration: none; white-space: nowrap; cursor: pointer; }
.sg-btn--quiet { border-color: transparent; color: var(--brand); }
.sg-link { border: 0; background: none; padding: 0; color: var(--sg-ink); font: inherit; font-weight: 550; text-align: left; cursor: pointer; }
.sg-link:hover { color: var(--brand); text-decoration: underline; }

.sg-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--sg-line); flex-wrap: wrap; }
.sg-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sg-search input { min-width: 200px; border: 1px solid var(--sg-line); border-radius: 5px; padding: 7px 10px; font-size: 12px; color: var(--sg-body); background: var(--surface); }
.sg-select { font-size: 12px; border: 1px solid var(--sg-line); color: var(--sg-body); border-radius: 4px; padding: 6px 8px; background: var(--surface); }
.sg-footer { padding: 11px 16px; display: flex; justify-content: space-between; align-items: center; gap: 15px; font-size: 11px; color: var(--sg-muted); flex-wrap: wrap; }

.sg-info { border: 1px solid var(--sg-line); padding: 14px 17px; background: var(--surface); border-radius: 6px; color: var(--sg-muted); font-size: 12px; display: flex; gap: 13px; align-items: flex-start; margin-top: 18px; }
.sg-info b { color: var(--sg-body); font-weight: 550; }
.sg-info__icon { flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--sg-line); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }

@media (max-width: 1050px) { .sg-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .sg-metrics { grid-template-columns: 1fr 1fr; }
  .sg-metric:nth-child(2)::after { display: none; }
  .sg-metric__value { font-size: 26px; }
  .sg-overview-head { flex-direction: column; align-items: flex-start; }
  .sg-search input { min-width: 0; width: 100%; }
  .sg-search, .sg-filters { width: 100%; }
}

/* A recorded answer can quote a long URL; it wraps inside the sheet instead of widening the page. */
body[data-page="signal"] .cr-report-callout { overflow-wrap: anywhere; }
.sg-table td { overflow-wrap: anywhere; }

/* Signal slice 4: fix cards */
.sg-fix { padding: 15px 18px; border-bottom: 1px solid var(--sg-line); }
.sg-fix p { margin: 6px 0; font-size: 13px; color: var(--sg-body); overflow-wrap: anywhere; }
.sg-fix__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.sg-fix__claim { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sg-fix__claim .cr-input { flex: 1 1 14rem; min-width: 0; }
.sg-fix__actions { padding: 12px 18px 0; }
.sg-code { margin: 8px 0; padding: 10px 12px; background: var(--surface-subtle); border-radius: 6px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
