/* Cybatar Public UI v2 — Research Estate
   Checkpoint 3. Deliberately scoped to .crg-research-* so legacy application UI is untouched. */

:root {
    --crg-research-ink: #07111f;
    --crg-research-ink-2: #111c2d;
    --crg-research-slate: #526173;
    --crg-research-muted: #758294;
    --crg-research-line: #dbe3ec;
    --crg-research-soft: #f3f6f9;
    --crg-research-paper: #fbfcfd;
    --crg-research-blue: #2d86b6;
    --crg-research-blue-soft: #e8f4fa;
    --crg-research-gold: #a67a2c;
    --crg-research-gold-soft: #f7f0e3;
    --crg-research-green: #24755b;
    --crg-research-red: #9b3d46;
}

.crg-research-page {
    background: var(--crg-research-paper);
    color: var(--crg-research-ink);
}

.crg-research-page main {
    overflow: clip;
}

.crg-research-subnav {
    position: sticky;
    top: var(--crg-v2-header-height, 72px);
    z-index: 40;
    background: rgba(251, 252, 253, .95);
    border-bottom: 1px solid var(--crg-research-line);
    backdrop-filter: blur(16px);
}

.crg-research-subnav__inner {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 50px;
    overflow-x: auto;
    scrollbar-width: none;
}

.crg-research-subnav__inner::-webkit-scrollbar { display: none; }

.crg-research-subnav a {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 999px;
    color: #465468;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.crg-research-subnav a:hover,
.crg-research-subnav a:focus-visible,
.crg-research-subnav a.is-active {
    background: #eaf1f6;
    color: var(--crg-research-ink);
}

.crg-research-hero {
    position: relative;
    padding: clamp(72px, 8vw, 126px) 0 clamp(58px, 7vw, 96px);
    background:
        radial-gradient(circle at 80% 12%, rgba(45, 134, 182, .13), transparent 32%),
        linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--crg-research-line);
}

.crg-research-hero--detail { padding-bottom: clamp(48px, 6vw, 78px); }

.crg-research-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .65fr);
    gap: clamp(44px, 7vw, 96px);
    align-items: end;
}

.crg-research-hero__copy { max-width: 880px; }

.crg-research-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--crg-research-blue);
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.crg-research-kicker--inverse { color: #86c4e4; }

.crg-research-hero h1 {
    max-width: 980px;
    margin: 0;
    font-size: clamp(44px, 5.3vw, 78px);
    line-height: .99;
    letter-spacing: -.048em;
    color: var(--crg-research-ink);
}

.crg-research-hero--detail h1 { font-size: clamp(42px, 4.7vw, 68px); }

.crg-research-lead {
    max-width: 850px;
    margin: 26px 0 0;
    color: #445267;
    font-size: clamp(18px, 1.65vw, 22px);
    line-height: 1.62;
}

.crg-research-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.crg-research-hero__aside,
.crg-research-side-card,
.crg-research-card,
.crg-research-definition,
.crg-research-methodology {
    border: 1px solid var(--crg-research-line);
    background: rgba(255,255,255,.86);
    box-shadow: 0 20px 70px rgba(7,17,31,.055);
}

.crg-research-hero__aside {
    padding: 28px;
    border-radius: 2px;
}

.crg-research-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--crg-research-line);
    border-left: 1px solid var(--crg-research-line);
}

.crg-research-stat-grid > div {
    min-height: 108px;
    padding: 18px;
    border-right: 1px solid var(--crg-research-line);
    border-bottom: 1px solid var(--crg-research-line);
}

.crg-research-stat-grid strong {
    display: block;
    font-size: 28px;
    letter-spacing: -.035em;
}

.crg-research-stat-grid span {
    display: block;
    margin-top: 5px;
    color: var(--crg-research-muted);
    font-size: 12px;
    line-height: 1.4;
}

.crg-research-note,
.crg-research-caption {
    color: var(--crg-research-muted);
    font-size: 12px;
    line-height: 1.58;
}

.crg-research-note { margin: 16px 0 0; }

.crg-research-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 26px;
    color: #59677a;
    font-size: 13px;
}

.crg-research-meta span { display: inline-flex; gap: 6px; align-items: center; }

.crg-research-meta strong { color: var(--crg-research-ink); }

.crg-research-section {
    padding: clamp(66px, 8vw, 116px) 0;
}

.crg-research-section--soft { background: var(--crg-research-soft); }
.crg-research-section--white { background: #fff; }
.crg-research-section--ink { background: var(--crg-research-ink); color: #f5f8fb; }

.crg-research-section__heading {
    max-width: 830px;
    margin-bottom: 42px;
}

.crg-research-section__heading h2,
.crg-research-editorial-grid h2,
.crg-research-content h2 {
    margin: 0;
    font-size: clamp(31px, 3.4vw, 50px);
    line-height: 1.06;
    letter-spacing: -.04em;
}

.crg-research-section__heading > p {
    margin: 16px 0 0;
    color: #566478;
    font-size: 17px;
    line-height: 1.7;
}

.crg-research-property-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--crg-research-line);
    border-left: 1px solid var(--crg-research-line);
}

.crg-research-property {
    position: relative;
    min-height: 360px;
    padding: clamp(28px, 3vw, 44px);
    border-right: 1px solid var(--crg-research-line);
    border-bottom: 1px solid var(--crg-research-line);
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}

.crg-research-property:hover,
.crg-research-property:focus-visible {
    z-index: 2;
    transform: translateY(-3px);
    background: #fcfdff;
    box-shadow: 0 28px 70px rgba(7,17,31,.09);
}

.crg-research-property__index {
    position: absolute;
    top: 26px;
    right: 28px;
    color: #a3adba;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}

.crg-research-property h3,
.crg-research-card h3 {
    margin: 2px 0 12px;
    color: var(--crg-research-ink);
    font-size: clamp(23px, 2vw, 31px);
    line-height: 1.12;
    letter-spacing: -.03em;
}

.crg-research-property p,
.crg-research-card p,
.crg-research-content p {
    color: #526075;
    line-height: 1.68;
}

.crg-research-property blockquote {
    margin: 28px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--crg-research-line);
    color: #2d3b4e;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.55;
}

.crg-research-inline-link {
    display: inline-flex;
    margin-top: 24px;
    color: var(--crg-research-blue);
    font-weight: 720;
    text-decoration: none;
}

.crg-research-inline-link--light { color: #fff; }

.crg-research-editorial-grid {
    display: grid;
    grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr);
    gap: clamp(44px, 7vw, 100px);
}

.crg-research-principles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
}

.crg-research-principles article {
    padding: 28px;
    border-top: 1px solid rgba(255,255,255,.16);
}

.crg-research-principles strong { color: #79b9db; font-size: 12px; letter-spacing: .1em; }
.crg-research-principles h3 { margin: 12px 0 8px; color: #fff; font-size: 20px; }
.crg-research-principles p { margin: 0; color: #aab6c5; line-height: 1.65; }

.crg-research-definition {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    margin-bottom: 42px;
    padding: 30px;
}

.crg-research-definition h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.crg-research-definition p { margin: 0; color: #364457; font-size: 17px; line-height: 1.65; }

.crg-research-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}

.crg-research-grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.crg-research-grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.crg-research-card {
    padding: 26px;
    border-radius: 2px;
}

.crg-research-card--link { color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.crg-research-card--link:hover { transform: translateY(-2px); box-shadow: 0 22px 55px rgba(7,17,31,.09); }

.crg-research-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 14px 0;
    color: var(--crg-research-muted);
    font-size: 12px;
}

.crg-research-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid #d5dee8;
    border-radius: 999px;
    background: #f8fafc;
    color: #3f4f62;
    font-size: 11px;
    font-weight: 720;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.crg-research-chip--measured { background: #e9f6f0; border-color: #bddfce; color: #22664f; }
.crg-research-chip--reported { background: #f8f1e4; border-color: #e5d2a9; color: #75561f; }
.crg-research-chip--risk { background: #f9ecee; border-color: #e6c7cb; color: #873841; }

.crg-research-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1.3fr) repeat(2, minmax(160px,.7fr)) auto auto;
    gap: 10px;
    margin-bottom: 28px;
    padding: 14px;
    border: 1px solid var(--crg-research-line);
    background: #fff;
}

.crg-research-toolbar--compact { grid-template-columns: repeat(3,minmax(170px,1fr)) auto; }

.crg-research-toolbar input,
.crg-research-toolbar select {
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid #ccd6e1;
    background: #fff;
    color: var(--crg-research-ink);
    font: inherit;
}

.crg-research-toolbar button,
.crg-research-toolbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid var(--crg-research-ink);
    background: var(--crg-research-ink);
    color: #fff;
    font-weight: 720;
    text-decoration: none;
}

.crg-research-toolbar a { background: #fff; color: var(--crg-research-ink); }

.crg-research-table-wrap {
    position: relative;
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--crg-research-line);
    background: #fff;
}

.crg-research-table-wrap.is-scrollable::after {
    content: 'Scroll to inspect →';
    position: sticky;
    left: 14px;
    bottom: 8px;
    display: inline-block;
    margin: 8px;
    padding: 4px 8px;
    background: rgba(7,17,31,.86);
    color: #fff;
    font-size: 10px;
}

.crg-research-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 13px;
}

.crg-research-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 13px 15px;
    border-bottom: 1px solid #cfd8e3;
    background: #eef3f7;
    color: #415064;
    text-align: left;
    font-size: 10px;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.crg-research-table td {
    padding: 15px;
    border-bottom: 1px solid #e6ebf0;
    color: #354357;
    vertical-align: top;
}

.crg-research-table tbody tr:hover { background: #fafcfd; }
.crg-research-table a { color: #176c99; font-weight: 700; text-decoration: none; }
.crg-research-table small { color: var(--crg-research-muted); }

.crg-research-metric {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: baseline;
    padding-top: 16px;
    border-top: 1px solid var(--crg-research-line);
}

.crg-research-metric strong { font-size: 25px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.crg-research-metric span { color: var(--crg-research-muted); font-size: 12px; }

.crg-research-detail-grid {
    display: grid;
    grid-template-columns: minmax(0,1.55fr) minmax(280px,.55fr);
    gap: clamp(38px, 6vw, 78px);
    align-items: start;
}

.crg-research-side {
    display: grid;
    gap: 16px;
    position: sticky;
    top: calc(var(--crg-v2-header-height,72px) + 70px);
}

.crg-research-side-card { padding: 24px; }
.crg-research-side-card h3 { margin: 0 0 14px; font-size: 18px; }
.crg-research-side-card p { color: #556376; line-height: 1.6; }

.crg-research-content > * + * { margin-top: 24px; }
.crg-research-content h2 { margin-top: 54px; }
.crg-research-content h3 { margin: 26px 0 8px; font-size: 21px; letter-spacing: -.02em; }

.crg-research-list {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.crg-research-list > li,
.crg-research-item {
    padding: 20px;
    border: 1px solid var(--crg-research-line);
    background: #fff;
}

.crg-research-source {
    padding: 18px 20px;
    border-left: 3px solid var(--crg-research-blue);
    background: #f0f6f9;
    color: #425064;
    font-size: 13px;
    line-height: 1.65;
}

.crg-research-methodology {
    padding: 26px;
}

.crg-research-methodology strong { display: block; margin-bottom: 8px; font-size: 17px; }

.crg-research-briefing {
    padding: 0 0 clamp(72px, 8vw, 112px);
    background: var(--crg-research-paper);
}

.crg-research-briefing__panel {
    display: grid;
    grid-template-columns: minmax(0,1.4fr) auto;
    gap: 34px;
    align-items: end;
    padding: clamp(34px, 5vw, 66px);
    background:
        radial-gradient(circle at 95% 0, rgba(65,159,207,.22), transparent 34%),
        var(--crg-research-ink);
    color: #fff;
}

.crg-research-briefing h2 { max-width: 780px; margin: 0; color: #fff; font-size: clamp(30px,3.2vw,46px); letter-spacing: -.04em; }
.crg-research-briefing p { max-width: 760px; margin: 14px 0 0; color: #b6c2d0; line-height: 1.65; }
.crg-research-briefing__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

.crg-research-pagination { margin-top: 28px; }
.crg-research-pagination nav { display: flex; justify-content: center; }

.crg-research-empty {
    padding: 38px;
    border: 1px dashed #c9d3df;
    background: #fff;
    text-align: center;
}

.crg-research-score {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.crg-research-divider { height: 1px; margin: 34px 0; background: var(--crg-research-line); }

@media (max-width: 1100px) {
    .crg-research-hero__grid,
    .crg-research-detail-grid,
    .crg-research-editorial-grid,
    .crg-research-briefing__panel { grid-template-columns: 1fr; }
    .crg-research-grid--4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .crg-research-side { position: static; }
    .crg-research-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
    .crg-research-subnav { top: 64px; }
    .crg-research-hero { padding-top: 58px; }
    .crg-research-hero h1 { font-size: clamp(39px, 12vw, 55px); }
    .crg-research-property-grid,
    .crg-research-grid,
    .crg-research-grid--2,
    .crg-research-grid--4,
    .crg-research-principles,
    .crg-research-stat-grid,
    .crg-research-definition,
    .crg-research-toolbar,
    .crg-research-toolbar--compact { grid-template-columns: 1fr; }
    .crg-research-property { min-height: 0; }
    .crg-research-definition { gap: 12px; padding: 22px; }
    .crg-research-actions { align-items: stretch; }
    .crg-research-actions > * { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .crg-research-property,
    .crg-research-card--link { transition: none; }
}
