/* V173 — two-sided district comparison presentation. */
.ia-v173-compare{--ia-v173-left:#1d4ed8;--ia-v173-right:#0f766e;--ia-v173-grid:minmax(0,1fr) minmax(150px,.52fr) minmax(0,1fr);display:grid;gap:20px;min-width:0}
.ia-v173-compare *{box-sizing:border-box;min-width:0}
.ia-v173-identities{position:sticky;top:calc(var(--ia-sticky-offset,0px) + 8px);z-index:4;display:grid;grid-template-columns:var(--ia-v173-grid);gap:12px;padding:12px;border:1px solid var(--ia-ds-border-subtle,#dbe4f0);border-radius:22px;background:color-mix(in srgb,var(--ia-ds-surface-card,#fff) 94%,transparent);box-shadow:0 14px 34px rgba(15,23,42,.09);backdrop-filter:blur(16px)}
.ia-v173-identity{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;padding:14px;border:1px solid var(--ia-ds-border-subtle,#dbe4f0);border-radius:17px;background:var(--ia-ds-surface-card,#fff)}
.ia-v173-identity--left{border-inline-start:4px solid var(--ia-v173-left)}
.ia-v173-identity--right{border-inline-end:4px solid var(--ia-v173-right)}
.ia-v173-identity__mark{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;color:#fff;font-weight:900;font-size:1.05rem;line-height:1}
.ia-v173-identity--left .ia-v173-identity__mark{background:var(--ia-v173-left)}
.ia-v173-identity--right .ia-v173-identity__mark{background:var(--ia-v173-right)}
.ia-v173-identity__body{display:grid;gap:3px}
.ia-v173-identity__body>span{color:var(--ia-ds-text-secondary,#475569);font-size:.75rem;font-weight:850;letter-spacing:.055em;text-transform:uppercase}
.ia-v173-identity__body strong{color:var(--ia-ds-text-primary,#0f172a);font-size:clamp(1rem,1.4vw,1.22rem);line-height:1.18;word-break:normal;overflow-wrap:break-word;text-wrap:balance}
.ia-v173-identity__body small{color:var(--ia-ds-text-secondary,#475569);line-height:1.35;word-break:normal;overflow-wrap:break-word}
.ia-v173-identity__body a{width:max-content;max-width:100%;color:var(--ia-ds-action-primary,#1d4ed8);font-size:.82rem;font-weight:850;text-decoration:none}
.ia-v173-identity__body a:hover,.ia-v173-identity__body a:focus-visible{text-decoration:underline;text-underline-offset:3px}
.ia-v173-versus{display:grid;place-items:center;align-content:center;gap:4px;padding:8px;text-align:center}
.ia-v173-versus strong{display:grid;place-items:center;width:46px;height:46px;border:1px solid var(--ia-ds-border-subtle,#cbd5e1);border-radius:50%;background:var(--ia-ds-surface-inverse,#0f2748);color:var(--ia-ds-text-on-dark,#fff);font-size:.86rem;letter-spacing:.04em}
.ia-v173-versus span{color:var(--ia-ds-text-secondary,#475569);font-size:.72rem;font-weight:800}
.ia-v173-table{display:grid;gap:16px;min-width:0}
.ia-v173-group{overflow:hidden;border:1px solid var(--ia-ds-border-subtle,#dbe4f0);border-radius:20px;background:var(--ia-ds-surface-card,#fff);box-shadow:0 12px 30px rgba(15,23,42,.055)}
.ia-v173-group__title{display:flex;align-items:center;gap:10px;margin:0;padding:13px 16px;border-bottom:1px solid var(--ia-ds-border-subtle,#e2e8f0);background:var(--ia-ds-bg-section,#f8fafc);color:var(--ia-ds-text-primary,#0f172a);font-size:.84rem;font-weight:900;letter-spacing:.055em;text-transform:uppercase}
.ia-v173-group__title::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--ia-ds-action-primary,#1d4ed8);box-shadow:0 0 0 5px color-mix(in srgb,var(--ia-ds-action-primary,#1d4ed8) 12%,transparent)}
.ia-v173-row{display:grid;grid-template-columns:var(--ia-v173-grid);align-items:stretch;min-height:74px;border-bottom:1px solid var(--ia-ds-border-subtle,#e2e8f0)}
.ia-v173-row:last-child{border-bottom:0}
.ia-v173-value,.ia-v173-metric{display:grid;align-content:center;padding:14px 16px;word-break:normal;overflow-wrap:break-word}
.ia-v173-value{position:relative;gap:4px;background:var(--ia-ds-surface-card,#fff)}
.ia-v173-value--left{text-align:right}
.ia-v173-value--right{text-align:left}
.ia-v173-value strong{color:var(--ia-ds-text-primary,#0f172a);font-size:clamp(.96rem,1.3vw,1.12rem);line-height:1.3;font-variant-numeric:tabular-nums lining-nums}
.ia-v173-value small{color:var(--ia-ds-text-secondary,#64748b);font-size:.76rem;line-height:1.3}
.ia-v173-value.is-higher strong{color:var(--ia-ds-text-primary,#0f172a)}
.ia-v173-value.is-higher::after{content:"↑";position:absolute;top:10px;width:22px;height:22px;display:grid;place-items:center;border-radius:50%;background:#ecfdf5;color:#047857;font-size:.72rem;font-weight:900}
.ia-v173-value--left.is-higher::after{left:10px}
.ia-v173-value--right.is-higher::after{right:10px}
.ia-v173-value.is-missing{background:color-mix(in srgb,var(--ia-ds-bg-section,#f8fafc) 72%,#fff)}
.ia-v173-value.is-missing strong{color:var(--ia-ds-text-secondary,#64748b);font-size:.9rem;font-weight:750;font-style:italic}
.ia-v173-metric{place-items:center;border-inline:1px solid var(--ia-ds-border-subtle,#e2e8f0);background:var(--ia-ds-bg-section,#f8fafc);text-align:center}
.ia-v173-metric strong{color:var(--ia-ds-text-primary,#0f172a);font-size:.88rem;line-height:1.3}
.ia-v173-metric small{margin-top:4px;color:var(--ia-ds-text-secondary,#64748b);font-size:.72rem;line-height:1.3}
.ia-v173-data-summary{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;padding:12px 15px;border:1px solid var(--ia-ds-border-subtle,#dbe4f0);border-radius:15px;background:var(--ia-ds-bg-section,#f8fafc);color:var(--ia-ds-text-secondary,#475569);font-size:.84rem}
.ia-v173-data-summary strong{color:var(--ia-ds-text-primary,#0f172a)}
.ia-v173-data-summary span{display:inline-flex;align-items:center;gap:6px}
.ia-v173-data-summary span::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--ia-ds-action-primary,#1d4ed8)}
.ia-v173-compare .compare-pro-insights{margin:0;grid-template-columns:repeat(3,minmax(0,1fr))}
.ia-v173-compare .compare-pro-toolbar{margin:0}
.ia-v173-compare .district-compare-results-actions{margin-top:0}
@media(max-width:820px){
 .ia-v173-compare{--ia-v173-grid:minmax(0,1fr) minmax(0,1fr)}
 .ia-v173-identities{position:relative;top:auto;grid-template-columns:repeat(2,minmax(0,1fr));padding:10px}
 .ia-v173-versus{display:none}
 .ia-v173-identity{grid-template-columns:1fr;align-content:start;padding:13px}
 .ia-v173-identity--left,.ia-v173-identity--right{border-inline-start:1px solid var(--ia-ds-border-subtle,#dbe4f0);border-inline-end:1px solid var(--ia-ds-border-subtle,#dbe4f0);border-top:4px solid var(--ia-v173-left)}
 .ia-v173-identity--right{border-top-color:var(--ia-v173-right)}
 .ia-v173-identity__mark{width:38px;height:38px}
 .ia-v173-row{grid-template-columns:repeat(2,minmax(0,1fr));min-height:0}
 .ia-v173-metric{grid-column:1/-1;grid-row:1;padding:10px 12px;border-inline:0;border-bottom:1px solid var(--ia-ds-border-subtle,#e2e8f0)}
 .ia-v173-value{grid-row:2;min-height:70px;padding:12px;text-align:left}
 .ia-v173-value--left{border-inline-end:1px solid var(--ia-ds-border-subtle,#e2e8f0)}
 .ia-v173-value::before{content:attr(data-district-label);display:block;margin-bottom:4px;color:var(--ia-ds-text-secondary,#64748b);font-size:.68rem;font-weight:850;line-height:1.25;text-transform:uppercase;letter-spacing:.035em;word-break:normal;overflow-wrap:break-word}
 .ia-v173-value--left.is-higher::after,.ia-v173-value--right.is-higher::after{top:9px;right:9px;left:auto}
 .ia-v173-compare .compare-pro-insights{grid-template-columns:1fr}
}
@media(max-width:430px){
 .ia-v173-identities{gap:8px}
 .ia-v173-identity__body strong{font-size:.94rem}
 .ia-v173-identity__body small{font-size:.76rem}
 .ia-v173-value,.ia-v173-metric{padding-inline:10px}
 .ia-v173-value strong{font-size:.9rem}
}
@media print{
 .ia-v173-identities{position:static;box-shadow:none;backdrop-filter:none}
 .ia-v173-group{break-inside:avoid;box-shadow:none}
 .ia-v173-value.is-higher::after{border:1px solid #64748b;background:#fff;color:#111827}
}
@media(prefers-reduced-motion:reduce){.ia-v173-compare *{scroll-behavior:auto!important;transition:none!important}}
@media(forced-colors:active){.ia-v173-identities,.ia-v173-group,.ia-v173-identity{border:2px solid CanvasText}.ia-v173-value.is-higher::after{border:1px solid Highlight;background:Canvas;color:CanvasText}}
