/* ============================================================
   YesGov Open Data — directory + detail
   Pairs with the editorial design system in style.css
   ============================================================ */

/* ============ Sub-navigation ============ */
.od-subnav {
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.od-subnav-inner {
    display: flex; gap: 0;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 32px;
    white-space: nowrap;
}
.od-subnav a {
    color: var(--ink-2);
    text-decoration: none;
    padding: 14px 16px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    flex-shrink: 0;
}
.od-subnav a:hover { color: var(--ink); }
.od-subnav a.active { color: var(--brand-ink); border-bottom-color: var(--brand); font-weight: 600; }
@media (max-width: 720px) { .od-subnav-inner { padding: 0 20px; } }

/* ============ Open Data page-frame ============ */
.od-page-header {
    background: linear-gradient(180deg, var(--bg), var(--paper));
    border-bottom: 1px solid var(--rule);
    padding: 56px 0 48px;
}
.od-page-header .container { max-width: var(--maxw); }
.od-page-header .crumbs {
    font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3);
    display: flex; gap: 10px; align-items: center;
    flex-wrap: wrap;
}
.od-page-header .crumbs a { color: var(--ink-2); text-decoration: none; }
.od-page-header .crumbs a:hover { color: var(--ink); }
.od-page-header .crumbs .sep { color: var(--ink-3); }
.od-page-header h1 {
    font-family: var(--display);
    font-size: clamp(34px, 4.2vw, 56px); line-height: 1.05;
    margin: 18px 0 14px;
    letter-spacing: -0.025em; font-weight: 500;
    max-width: 22ch;
    color: var(--ink);
}
.od-page-header h1 em {
    color: var(--brand-ink); font-style: italic; font-weight: 500;
}
.od-page-header .lede {
    font-size: 16px; color: var(--ink-2);
    max-width: 70ch; line-height: 1.6;
}
.od-page-header .lede b { color: var(--ink); }

/* Hero stats grid (page header bottom) */
.od-hero-stats {
    margin-top: 36px;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    border: 1px solid var(--ink); border-radius: 10px;
    overflow: hidden; background: var(--bg-raised);
}
.od-hero-stats > div { padding: 18px 22px; border-right: 1px solid var(--rule); }
.od-hero-stats > div:last-child { border-right: 0; }
.od-hero-stats .k {
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3);
}
.od-hero-stats .v {
    font-family: var(--display); font-size: 36px;
    font-weight: 500; letter-spacing: -0.025em;
    line-height: 1; margin-top: 8px;
}
.od-hero-stats .v.risk { color: var(--g-f); }
.od-hero-stats .v.ok { color: var(--g-a); }
.od-hero-stats .v.small { font-size: 22px; padding-top: 14px; }
.od-hero-stats .d { color: var(--ink-2); font-size: 12.5px; margin-top: 6px; line-height: 1.4; }
@media (max-width: 980px) { .od-hero-stats { grid-template-columns: repeat(2, 1fr); }
    .od-hero-stats > div:nth-child(2) { border-right: 0; } }
@media (max-width: 560px) { .od-hero-stats { grid-template-columns: 1fr; }
    .od-hero-stats > div { border-right: 0; border-bottom: 1px solid var(--rule); }
    .od-hero-stats > div:last-child { border-bottom: 0; } }

/* ============ Filter bar ============ */
.fbar {
    background: var(--bg-raised);
    border-bottom: 1px solid var(--rule);
    padding: 14px 0;
}
.fbar .container {
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.fbar .group { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.fbar .pill {
    padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px;
    font-size: 12px; color: var(--ink-2); background: #fff; cursor: pointer;
    text-decoration: none;
}
.fbar .pill:hover { color: var(--ink); border-color: var(--rule-strong); }
.fbar .pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fbar .search {
    flex: 1; min-width: 220px;
    padding: 8px 14px; border: 1px solid var(--rule-strong); border-radius: 8px;
    font-family: var(--mono); font-size: 13px;
    background: var(--bg);
    color: var(--ink);
}
.fbar .right { margin-left: auto; display: inline-flex; gap: 10px; }
.fbar select {
    border: 1px solid var(--rule-strong); border-radius: 8px; padding: 7px 10px;
    background: #fff; font-size: 12.5px; color: var(--ink-2);
    width: auto;
}

/* ============ Index list ============ */
.list-wrap { padding: 32px 0 64px; }
.list-wrap .container { max-width: var(--maxw); }
.list-head {
    display: grid;
    grid-template-columns: 1.6fr 1fr 220px 220px 220px;
    padding: 14px 4px;
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3);
    border-bottom: 1px solid var(--rule);
}
@media (max-width: 1100px) { .list-head { display: none; } }

/* Variant A row — colored grade tile + label + score (default chosen) */
.row-a {
    display: grid;
    grid-template-columns: 1.6fr 1fr 220px 220px 220px;
    align-items: center; gap: 16px;
    padding: 18px 8px;
    border-bottom: 1px solid var(--rule);
    background: var(--bg-raised);
    transition: background .15s;
    text-decoration: none;
    color: inherit;
}
.row-a:hover { background: var(--bg); }
.row-a .who { display: grid; gap: 4px; min-width: 0; }
.row-a .who .domain {
    font-family: var(--mono); font-size: 14px;
    color: var(--ink); font-weight: 500;
    text-decoration: none;
    overflow: hidden; text-overflow: ellipsis;
}
.row-a .who .name { font-size: 12.5px; color: var(--ink-2); }
.row-a .when { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 1100px) {
    .row-a { grid-template-columns: 1fr; gap: 10px; }
}

/* Rating tile */
.rtile {
    display: grid; grid-template-columns: 38px 1fr;
    border-radius: 6px; overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--rule);
    align-items: stretch;
    text-decoration: none;
    color: inherit;
}
.rtile .grade {
    display: grid; place-items: center;
    color: #fff; font-family: var(--sans);
    font-weight: 800; font-size: 17px; letter-spacing: -0.04em;
    line-height: 1;
}
.rtile .body { padding: 7px 10px; display: grid; gap: 1px; }
.rtile .body .label { font-size: 12px; color: var(--ink); font-weight: 600; }
.rtile .body .score { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }

.rtile .grade.gA, .grade.gA, .chip-grade.gA { background: var(--g-a); }
.rtile .grade.gB, .grade.gB, .chip-grade.gB { background: var(--g-b); }
.rtile .grade.gC, .grade.gC, .chip-grade.gC { background: var(--g-c); }
.rtile .grade.gD, .grade.gD, .chip-grade.gD { background: var(--g-d); }
.rtile .grade.gF, .grade.gF, .chip-grade.gF { background: var(--g-f); }
.rtile .grade.gNA { background: var(--ink-3); }

/* Compact pill grade (alt variant B) */
.pill-grade {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--rule);
    font-size: 12px; color: var(--ink-2);
    text-decoration: none;
}
.pill-grade .g {
    width: 22px; height: 22px; border-radius: 999px;
    color: #fff; display: grid; place-items: center;
    font-weight: 800; font-size: 12px; letter-spacing: -0.03em;
}
.pill-grade .lbl { white-space: nowrap; }
.pill-grade .score { font-family: var(--mono); color: var(--ink); }

/* Compact chip grade (alt variant C) */
.chip-grade {
    width: 56px; padding: 5px 0;
    text-align: center;
    border-radius: 6px;
    color: #fff; font-weight: 800; font-size: 13px;
    letter-spacing: -0.03em;
    display: grid; gap: 0; line-height: 1;
}
.chip-grade .s {
    font-family: var(--mono); font-size: 9.5px;
    font-weight: 500; opacity: 0.92;
    margin-top: 3px; letter-spacing: 0.04em;
}

/* ============ Section title (open data) ============ */
.od-section-title {
    font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3);
    margin: 32px 0 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--rule);
    font-weight: 500;
}
.od-section-title:first-child { margin-top: 0; }

/* ============ Detail page ============ */
.detail-hero {
    padding: 48px 0 40px;
}
.detail-hero .container {
    display: grid; grid-template-columns: 1.4fr 1fr;
    gap: 56px; align-items: end;
    max-width: var(--maxw);
}
.detail-hero .kicker {
    font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3);
}
.detail-hero h1 {
    font-family: var(--display); font-size: clamp(34px, 4vw, 48px);
    letter-spacing: -0.025em; font-weight: 500; line-height: 1.05;
    margin: 12px 0 4px; color: var(--ink);
}
.detail-hero .domain {
    font-family: var(--mono); font-size: 18px; color: var(--brand-ink);
}
.detail-hero .meta {
    margin-top: 22px;
    display: grid; grid-template-columns: repeat(3, auto); gap: 22px 32px;
    font-size: 13px; color: var(--ink-2);
}
.detail-hero .meta .k {
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3);
}
.detail-hero .meta b {
    color: var(--ink); display: block; font-weight: 500;
    font-family: var(--sans); font-size: 14px;
}
@media (max-width: 980px) {
    .detail-hero .container { grid-template-columns: 1fr; gap: 32px; }
    .detail-hero .meta { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 560px) {
    .detail-hero .meta { grid-template-columns: 1fr; }
}

.overall-card {
    background: var(--bg-raised);
    border: 1px solid var(--rule);
    border-radius: 12px;
    padding: 24px 26px;
    display: grid; grid-template-columns: auto 1fr;
    gap: 22px; align-items: center;
}
.overall-card .big-grade {
    width: 92px; height: 92px;
    display: grid; place-items: center;
    color: #fff; font-family: var(--sans);
    font-weight: 800; font-size: 56px;
    letter-spacing: -0.06em; line-height: 1;
    border-radius: 12px;
}
.overall-card .big-grade.gA, .overall-card .big-grade.grade-a { background: var(--g-a); }
.overall-card .big-grade.gB, .overall-card .big-grade.grade-b { background: var(--g-b); }
.overall-card .big-grade.gC, .overall-card .big-grade.grade-c { background: var(--g-c); }
.overall-card .big-grade.gD, .overall-card .big-grade.grade-d { background: var(--g-d); }
.overall-card .big-grade.gF, .overall-card .big-grade.grade-f { background: var(--g-f); }
.overall-card .big-grade.gNA { background: var(--ink-3); }
.overall-card .meta { display: grid; gap: 4px; }
.overall-card .meta .lbl {
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3);
}
.overall-card .meta .head {
    font-family: var(--display); font-size: 24px;
    font-weight: 600; letter-spacing: -0.02em;
    color: var(--ink);
}
.overall-card .meta .head em { color: var(--g-f); font-style: normal; }
.overall-card .meta .head em.ok { color: var(--g-a); }
.overall-card .meta .why { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.5; }

/* ============ Detail body ============ */
.detail-body {
    padding: 24px 0 80px;
}
.detail-body .container {
    display: grid; grid-template-columns: 1fr 320px;
    gap: 48px; max-width: var(--maxw);
}
@media (max-width: 980px) {
    .detail-body .container { grid-template-columns: 1fr; gap: 32px; }
}

.check-row {
    display: grid;
    grid-template-columns: 28px 1fr 110px 86px;
    gap: 14px; align-items: center;
    padding: 14px 8px;
    border-bottom: 1px solid var(--rule);
}
.check-row .status {
    width: 18px; height: 18px; border-radius: 5px;
    display: grid; place-items: center;
    color: #fff; font-size: 11px;
}
.check-row .status.pass { background: var(--g-a); }
.check-row .status.warn { background: var(--g-c); }
.check-row .status.fail { background: var(--g-f); }
.check-row .status.na { background: var(--ink-3); }
.check-row .label { font-size: 14px; }
.check-row .label .name { font-weight: 500; color: var(--ink); }
.check-row .label .desc { font-size: 12px; color: var(--ink-2); margin-top: 2px; line-height: 1.5; }
.check-row .impact {
    font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.04em; color: var(--ink-2);
}
.check-row .impact.high { color: var(--g-f); }
.check-row .impact.med { color: var(--g-d); }
.check-row .fix {
    text-align: right;
    font-family: var(--mono); font-size: 11px;
    color: var(--brand-ink);
    text-decoration: underline; text-underline-offset: 3px;
}

/* Sidebar */
.sidebar { display: grid; gap: 16px; align-content: start; }
.side-card {
    background: var(--bg-raised);
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 18px;
}
.side-card h3 {
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3); margin: 0 0 12px;
    font-weight: 500;
}
.kv {
    display: grid; grid-template-columns: 1fr auto;
    gap: 10px; padding: 8px 0;
    border-bottom: 1px dashed var(--rule);
    font-size: 13px;
}
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-2); }
.kv .v { font-family: var(--mono); color: var(--ink); }

.cta-card {
    background: var(--ink);
    color: #fff;
    border-radius: 10px;
    padding: 22px;
}
.cta-card h4 {
    font-family: var(--display); font-size: 19px;
    font-weight: 600; letter-spacing: -0.015em;
    margin: 0 0 8px; line-height: 1.2; color: #fff;
}
.cta-card p { font-size: 13px; color: rgba(255,255,255,0.75); margin: 0 0 14px; line-height: 1.5; }
.cta-card .btn {
    display: inline-block;
    background: #fff; color: var(--ink);
    padding: 8px 14px; border-radius: 6px;
    text-decoration: none;
    font-weight: 600; font-size: 12.5px;
    white-space: nowrap;
}

/* Download links inside side-card */
.side-card .download-link {
    padding: 8px 12px; border: 1px solid var(--rule-strong); border-radius: 6px;
    font-family: var(--mono); font-size: 12px;
    text-decoration: none; color: var(--ink);
    display: flex; justify-content: space-between;
    margin-top: 8px;
}
.side-card .download-link:hover { background: var(--paper); }
.side-card .download-link .file { color: var(--ink-3); }

/* ============ Tables (open data dataset) ============ */
.od-table-wrap { margin: 16px 0 32px; overflow-x: auto; }
.od-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-size: 14px;
}
.od-table th {
    font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3); background: var(--paper);
    padding: 12px 16px; text-align: left;
    font-weight: 500; white-space: nowrap;
    border-bottom: 1px solid var(--rule);
}
.od-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
}
.od-table tr:last-child td { border-bottom: 0; }
.od-table tr:hover td { background: var(--bg); }
.od-table a { color: var(--brand-ink); font-weight: 500; text-decoration: none; }
.od-table a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Stat cards (legacy /open-data home) - re-skinned */
.od-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0 32px;
}
.od-stat {
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    color: var(--ink);
    background: var(--bg-raised);
    border: 1px solid var(--rule);
}
.od-stat h2 {
    color: var(--ink); margin: 0;
    font-family: var(--display); font-size: 38px; font-weight: 500;
    border: none; line-height: 1; letter-spacing: -0.025em;
}
.od-stat p {
    margin: 8px 0 0;
    color: var(--ink-2); font-size: 14px;
}
.od-stat-blue, .od-stat-green, .od-stat-red, .od-stat-dark {
    background: var(--bg-raised); color: var(--ink);
}
.od-stat-blue h2 { color: var(--brand-ink); }
.od-stat-green h2 { color: var(--ok-ink); }
.od-stat-red h2 { color: var(--risk-ink); }

/* Metric cards (security posture) */
.od-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px; margin-top: 14px;
}
.od-metrics-5 { grid-template-columns: repeat(5, 1fr); }
.od-metric {
    border-radius: var(--radius-lg);
    padding: 18px;
    background: var(--bg-raised);
    border: 1px solid var(--rule);
    text-align: left;
}
.od-metric h3 {
    margin: 0;
    font-family: var(--display); font-size: 30px;
    font-weight: 500; line-height: 1; border: none;
    letter-spacing: -0.025em;
    color: var(--ink);
}
.od-metric .od-metric-label {
    font-weight: 600;
    font-size: 13px; margin: 8px 0 4px;
    color: var(--ink);
}
.od-metric .od-metric-label a { color: inherit; text-decoration: none; }
.od-metric .od-metric-label a:hover { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.od-metric .od-metric-detail {
    font-family: var(--mono);
    font-size: 11px; color: var(--ink-3);
    letter-spacing: 0.04em;
    margin: 0;
}
.od-bar {
    height: 6px; border-radius: 999px;
    background: var(--paper); margin-top: 10px;
    overflow: hidden;
}
.od-bar-fill { height: 100%; border-radius: 999px; }
.od-green { color: var(--ok-ink); } .od-green .od-bar-fill { background: var(--ok); }
.od-yellow { color: var(--gold-ink); } .od-yellow .od-bar-fill { background: var(--gold); }
.od-red { color: var(--risk-ink); } .od-red .od-bar-fill { background: var(--risk); }
@media (max-width: 980px) { .od-metrics, .od-metrics-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .od-metrics, .od-metrics-5 { grid-template-columns: 1fr; } }

/* Card grids */
.od-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 18px 0;
}
.od-card {
    background: var(--bg-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 22px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s, transform .15s;
}
.od-card:hover {
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}
.od-card h3 {
    margin: 0 0 6px;
    font-family: var(--display); font-size: 19px; font-weight: 600;
    letter-spacing: -0.01em;
    border: none;
    color: var(--ink);
}
.od-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.od-card-body { font-size: 14px; color: var(--ink-2); }
.od-card-body small { color: var(--ink-3); }

/* Pagination */
.od-pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 6px; margin-top: 28px; flex-wrap: wrap;
    font-size: 13px;
}
.od-pagination a, .od-pagination span {
    padding: 8px 14px;
    border: 1px solid var(--rule-strong); border-radius: 8px;
    text-decoration: none;
    color: var(--ink); font-weight: 500;
    background: var(--bg-raised);
}
.od-pagination a:hover { background: var(--paper); }
.od-pagination .current {
    background: var(--ink); color: #fff;
    border-color: var(--ink);
}
.od-pagination .ellipsis { border: none; color: var(--ink-3); padding: 8px 4px; background: transparent; }

/* Filter form */
.od-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; align-items: end;
    margin: 18px 0;
    padding: 18px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
}
.od-filter label {
    display: block; font-weight: 500;
    font-size: 12px; margin-bottom: 6px;
    color: var(--ink-2);
    text-transform: uppercase; letter-spacing: 0.06em;
    font-family: var(--mono);
}
.od-filter input, .od-filter select {
    width: 100%;
}

/* Alert / CTA boxes */
.od-alert {
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    margin-top: 28px;
    border: 1px solid var(--rule);
    background: var(--bg-raised);
    color: var(--ink-2);
    font-size: 15px; line-height: 1.6;
}
.od-alert h3 {
    margin: 0 0 10px;
    color: var(--ink);
    font-family: var(--display); font-size: 19px; font-weight: 600;
    letter-spacing: -0.01em;
    border: none;
}
.od-alert p { margin: 0 0 8px; }
.od-alert p:last-child { margin-bottom: 0; }
.od-alert strong { color: var(--ink); }
.od-alert-danger {
    background: var(--risk-soft);
    border-color: color-mix(in oklab, var(--risk) 22%, transparent);
}
.od-alert-danger h3 { color: var(--risk-ink); }
.od-alert-info {
    background: var(--brand-soft);
    border-color: color-mix(in oklab, var(--brand) 22%, transparent);
}
.od-alert-info h3 { color: var(--brand-ink); }
.od-alert .btn { margin-right: 6px; }

/* Profile table (government detail) */
.od-profile-table { width: 100%; border-collapse: collapse; }
.od-profile-table th {
    text-align: left; padding: 10px 16px 10px 0;
    color: var(--ink-3); font-weight: 500;
    font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.12em; text-transform: uppercase;
    white-space: nowrap; width: 150px; vertical-align: top;
    border-bottom: 1px solid var(--rule);
}
.od-profile-table td {
    padding: 10px 0;
    font-size: 14.5px;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
}

/* Generic badges */
.od-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.od-badge-blue { background: var(--brand-soft); color: var(--brand-ink); }
.od-badge-red { background: var(--risk-soft); color: var(--risk-ink); }
.od-badge-green { background: var(--ok-soft); color: var(--ok-ink); }

.od-meta { font-size: 13px; color: var(--ink-3); margin: 6px 0 12px; font-family: var(--mono); letter-spacing: 0.02em; }

/* Letter-grade circular badges (legacy + new) */
.od-grade-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px;
    border-radius: 50%;
    font-size: 1.2rem; font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    flex-shrink: 0;
    font-family: var(--sans);
}
.od-grade-badge.od-grade-sm { width: 36px; height: 36px; font-size: 0.9rem; border-radius: 8px; }
.od-grade-badge.od-grade-lg { width: 72px; height: 72px; font-size: 1.6rem; border-radius: 12px; }
.grade-a, .od-grade-badge.grade-a { background: var(--g-a); }
.grade-b, .od-grade-badge.grade-b { background: var(--g-b); }
.grade-c, .od-grade-badge.grade-c { background: var(--g-c); }
.grade-d, .od-grade-badge.grade-d { background: var(--g-d); }
.grade-f, .od-grade-badge.grade-f { background: var(--g-f); }
.grade-na, .od-grade-badge.grade-na { background: var(--ink-3); }

/* Group grade hover popup (table in directory) */
.gg-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; min-width: 320px; }
.gg-cell {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px;
    background: var(--bg);
    border-radius: 6px; border: 1px solid var(--rule);
    cursor: default; position: relative;
}
.gg-grade {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 26px;
    padding: 0 6px; border-radius: 4px;
    font-size: 11.5px; font-weight: 800;
    color: #fff; flex-shrink: 0;
}
.gg-info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.gg-label { font-size: 11.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gg-count { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }

.gg-popup {
    display: none; position: fixed; z-index: 9999;
    min-width: 200px;
    background: var(--bg-raised);
    border: 1px solid var(--rule);
    border-radius: 8px;
    box-shadow: var(--shadow-2);
    padding: 8px 0;
}
.gg-popup.gg-popup-visible { display: block; }
.gg-popup-title {
    font-size: 11.5px; font-weight: 700; color: var(--ink);
    padding: 4px 12px 6px;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 4px;
    font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
}
.gg-popup-row {
    font-size: 12px; padding: 4px 12px;
    white-space: nowrap; color: var(--ink-2);
    font-family: var(--mono);
}
.gg-popup-row:hover { background: var(--paper); }
.gg-p { color: var(--ok-ink); font-weight: 700; }
.gg-f { color: var(--risk-ink); font-weight: 700; }

/* Check badges (mini) */
.check-badge {
    display: inline-block;
    padding: 2px 6px; border-radius: 4px;
    font-size: 11px; font-weight: 600;
    margin: 1px;
    white-space: nowrap;
}
.check-badge a { color: inherit; text-decoration: none; }
.badge-pass { background: var(--ok-soft); color: var(--ok-ink); }
.badge-fail { background: var(--risk-soft); color: var(--risk-ink); }
.badge-na { background: var(--paper); color: var(--ink-3); }

/* Share buttons */
.share-buttons {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin: 14px 0 18px;
}
.share-btn {
    display: inline-flex; align-items: center;
    padding: 7px 14px; border-radius: 999px;
    font-size: 12.5px; font-weight: 500;
    cursor: pointer; text-decoration: none;
    border: 1px solid var(--rule-strong);
    background: var(--bg-raised);
    color: var(--ink);
    font-family: var(--sans);
}
.share-btn:hover { background: var(--paper); color: var(--ink); }

/* Breadcrumb */
.od-breadcrumb {
    font-family: var(--mono); font-size: 11px;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-3);
    margin: 0 0 16px;
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.od-breadcrumb a { color: var(--ink-2); text-decoration: none; }
.od-breadcrumb a:hover { color: var(--ink); }

/* Histogram chart (scores) */
.score-histogram {
    display: flex; align-items: flex-end; gap: 3px;
    height: 220px; margin: 18px 0 24px;
    padding: 0 4px;
    border-bottom: 1px solid var(--rule);
}
.sh-bar-wrap {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    height: 100%; justify-content: flex-end;
    text-decoration: none; gap: 2px;
}
.sh-bar-wrap:hover .sh-bar { opacity: 0.85; }
.sh-count { font-size: 11px; font-weight: 600; color: var(--ink-2); white-space: nowrap; font-family: var(--mono); }
.sh-bar { width: 80%; border-radius: 3px 3px 0 0; min-height: 3px; transition: opacity .15s; }
.sh-label { font-size: 12px; font-weight: 700; color: var(--brand-ink); padding-top: 4px; font-family: var(--mono); }

.score-pct-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.score-pct-fill { height: 12px; border-radius: 3px; min-width: 2px; }
.score-pct-text { font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; font-family: var(--mono); }

.od-score-chart { display: flex; align-items: flex-end; gap: 4px; height: 200px; margin: 18px 0; padding: 0 6px; border-bottom: 1px solid var(--rule); }
.od-score-bar-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.od-score-bar { width: 80%; border-radius: 3px 3px 0 0; transition: height .3s ease; min-height: 4px; }
.od-score-label { font-size: 11px; font-weight: 600; margin-top: 4px; color: var(--ink); font-family: var(--mono); }
