.ref-detail-page {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text-primary);
    padding: 1.4rem 1.5rem 2.4rem;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    z-index: 1;
    --ref-row-gap: 1.1rem;
    --ref-columns: 4;
    --ref-card-height: 320px;
    --ref-surface: rgba(14, 17, 21, 0.94);
    --ref-border: rgba(255, 255, 255, 0.08);
    --ref-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
}

.ref-detail-page > * {
    position: relative;
    z-index: 1;
}

:root[data-theme="light"] .ref-detail-page {
    --ref-surface: rgba(255, 255, 255, 0.9);
    --ref-border: rgba(15, 23, 42, 0.12);
    --ref-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}


@keyframes refDetailFade {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

.ref-status {
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
}

.ref-status--loading {
    border: 1px dashed var(--ref-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
}

:root[data-theme="light"] .ref-status--loading {
    background: rgba(255, 255, 255, 0.7);
}

.ref-status--error {
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-error);
}

.ref-detail-content {
    display: grid;
    grid-template-columns: repeat(var(--ref-columns), minmax(0, 1fr));
    grid-auto-rows: var(--ref-card-height);
    gap: var(--ref-row-gap);
    animation: refDetailFade 0.8s ease both;
    position: relative;
}

.ref-detail-content--locked .ref-chart-card {
    filter: blur(7px);
    opacity: 0.55;
    pointer-events: none;
}

.ref-detail-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    pointer-events: none;
    z-index: 3;
}

.ref-detail-lock[hidden] {
    display: none !important;
}

.ref-detail-lock__card {
    pointer-events: auto;
    background: var(--ref-surface);
    border: 1px solid var(--ref-border);
    border-radius: 16px;
    box-shadow: var(--ref-shadow);
    padding: 1.25rem 1.5rem;
    text-align: center;
    max-width: 360px;
    display: grid;
    gap: 0.6rem;
}

.ref-detail-lock__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.ref-detail-lock__copy {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.ref-detail-lock__actions {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.ref-detail-lock__note {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.ref-detail-dashboard {
    display: contents;
}

.ref-dashboard-grid {
    display: contents;
}

.ref-detail-hero {
    display: contents;
}

.ref-detail-card,
.ref-chart-card {
    width: 100%;
    min-width: 0;
    height: 100%;
}

.ref-detail-card {
    background: var(--ref-surface);
    border-radius: 16px;
    border: 1px solid var(--ref-border);
    padding: 0.85rem;
    box-shadow: var(--ref-shadow);
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.ref-detail-card--profile {
    padding: 0.85rem;
}

.ref-detail-card--select {
    display: flex;
    flex-direction: column;
    height: 100%;
    align-self: stretch;
    min-height: 0;
}

.ref-detail-profile {
    display: grid;
    gap: 0.6rem;
    justify-items: start;
}

.ref-detail-profile__media {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
}

.ref-detail-hero__image-wrap {
    position: relative;
    width: 112px;
    height: 112px;
}

.ref-detail-hero__image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.ref-detail-hero__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0;
}

.ref-detail-hero__title {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 800;
    margin: 0;
}

.ref-detail-hero__subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.ref-detail-profile__meta {
    display: grid;
    gap: 0.5rem;
}

.ref-detail-profile__stats {
    width: 100%;
}

.ref-detail-stat-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 0.8rem;
}

.ref-detail-stat-list--compact {
    gap: 0.3rem 0.7rem;
}

.ref-detail-stat {
    display: grid;
    gap: 0.15rem;
}

.ref-detail-stat__label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-tertiary);
}

.ref-detail-stat__label::after {
    content: ":";
}

.ref-detail-stat__value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--status-warning);
    line-height: 1.2;
}

.ref-detail-card__eyebrow {
    margin: 0 0 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.58rem;
    color: var(--text-tertiary);
    font-weight: 700;
}

.ref-detail-select {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
}

.ref-detail-select__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.ref-detail-select__eyebrow {
    margin: 0 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.55rem;
    color: var(--text-tertiary);
    font-weight: 700;
}

.ref-detail-select__search {
    display: grid;
    min-width: 140px;
}

.ref-detail-select__search input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid var(--ref-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.ref-detail-select__search input::placeholder {
    color: var(--text-tertiary);
}

.ref-detail-select__search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--divider-glow);
}

.ref-detail-page .form-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ref-border);
    color: var(--text-primary);
    padding: 0.65rem 2.2rem 0.65rem 0.85rem;
    border-radius: 10px;
    font-size: 0.9rem;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
        linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%),
        linear-gradient(to right, transparent, transparent);
    background-position:
        calc(100% - 18px) 55%,
        calc(100% - 12px) 55%,
        calc(100% - 2.5rem) 0.5rem;
    background-size: 6px 6px, 6px 6px, 1px 1.5rem;
    background-repeat: no-repeat;
}

.ref-detail-page .form-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px var(--divider-glow);
}

:root[data-theme="light"] .ref-detail-page .form-select {
    background: rgba(255, 255, 255, 0.95);
}

.ref-detail-select__fallback {
    display: none;
    gap: 0.35rem;
}

.ref-detail-select__fallback label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.ref-detail-officials {
    display: grid;
    gap: 0.45rem;
    min-height: 0;
    height: 100%;
    overflow: auto;
    padding-right: 0.3rem;
    align-content: start;
    overscroll-behavior: contain;
}

.ref-detail-official {
    border: 1px solid var(--ref-border);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 0.35rem 0.5rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
    align-items: center;
    text-align: left;
    color: inherit;
    font-family: inherit;
    line-height: 1.2;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ref-detail-official:hover {
    border-color: var(--primary-color);
    background: var(--panel-glow);
    transform: translateY(-1px);
}

.ref-detail-official:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.ref-detail-official.is-active {
    border-color: var(--primary-color);
    background: linear-gradient(120deg, var(--glow-blue), var(--panel-glow));
    box-shadow: 0 10px 20px var(--glow-blue);
}

.ref-detail-official__image {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.ref-detail-official__meta {
    display: grid;
    gap: 0.2rem;
}

.ref-detail-official__name {
    font-weight: 600;
    font-size: 0.84rem;
}

.ref-detail-official__label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-tertiary);
}

.ref-detail-officials__loading,
.ref-detail-officials__empty {
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px dashed var(--ref-border);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-align: center;
}

:root[data-theme="light"] .ref-detail-select__search input {
    background: rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .ref-detail-official {
    background: rgba(15, 23, 42, 0.03);
}

.ref-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ref-section-header {
    display: grid;
    gap: 0.6rem;
}

.ref-section-header__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
}

.ref-section-header h2 {
    font-family: "Space Grotesk", "Manrope", sans-serif;
    margin: 0;
    font-size: 1.8rem;
}

.ref-section-header__summary {
    margin: 0;
    color: var(--text-secondary);
    max-width: 48rem;
}

.ref-stats-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ref-stat-card {
    background: var(--ref-surface);
    border-radius: 18px;
    border: 1px solid var(--ref-border);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.ref-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.ref-stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--status-warning);
}

.ref-stat-sub {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-top: 0.4rem;
}

.ref-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ref-chart-grid {
    display: grid;
    gap: 1.5rem;
}

.ref-chart-grid--two {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.ref-chart-card {
    background: var(--ref-surface);
    border-radius: 14px;
    border: 1px solid var(--ref-border);
    padding: 0.95rem;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.ref-chart-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.6rem;
    padding-right: 2.6rem;
}

.ref-chart-card__header h3 {
    margin: 0;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
}

.ref-card-tag {
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.56rem;
    font-weight: 700;
    color: var(--text-tertiary);
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.ref-card-tag--foul {
    color: var(--primary-color);
    border-color: var(--glow-blue);
    background: var(--panel-glow);
}

.ref-card-tag--betting {
    color: var(--status-warning);
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.12);
}

.ref-chart-card__sub {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.3;
}

.ref-chart-card__body {
    height: 220px;
}

.ref-chart-card__body--compact {
    height: 180px;
}

.ref-chart-card__body--medium {
    height: 230px;
}

.ref-chart-card__body--tall {
    height: 270px;
}

.ref-chart-card__body--square {
    height: 100%;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.ref-chart-card--donut {
    overflow: visible;
}

.ref-chart-card--donut .ref-chart-card__body {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0.5rem;
}

.ref-chart-card--donut .ref-chart-card__body--square {
    max-width: 100%;
    width: 100%;
    height: 100%;
    margin: 0;
}

.ref-chart-card--donut .ref-chart-card__body--compact {
    height: calc(100% - 0.5rem);
}

.ref-chart-card canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.ref-chart-expand {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--ref-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ref-chart-expand svg {
    width: 16px;
    height: 16px;
}

.ref-chart-expand:hover {
    border-color: var(--primary-color);
    background: var(--panel-glow);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.ref-chart-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(5, 7, 10, 0.75);
    z-index: 2000;
}

.ref-chart-modal.is-open {
    display: flex;
}

.ref-chart-modal__content {
    width: min(90vw, 1080px);
    height: min(82vh, 760px);
    background: var(--ref-surface);
    border: 1px solid var(--ref-border);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    position: relative;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.ref-chart-modal__close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--ref-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ref-chart-modal__close:hover {
    border-color: rgba(251, 191, 36, 0.6);
    background: rgba(251, 191, 36, 0.12);
    color: var(--text-primary);
}

.ref-chart-modal__body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ref-chart-modal__body .ref-chart-card__body {
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: auto;
    margin: 0;
}

.ref-chart-modal__body .ref-chart-card__body--square {
    max-width: none;
}

.ref-chart-placeholder {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--ref-border);
}

body.is-modal-open {
    overflow: hidden;
}

@media (max-width: 1200px) {
    .ref-detail-page {
        --ref-columns: 3;
    }
}

@media (max-width: 980px) {
    .ref-detail-page {
        --ref-columns: 2;
    }

    .ref-detail-profile__media {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .ref-detail-select__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ref-detail-select__search {
        width: 100%;
        min-width: 0;
    }
}


@media (max-width: 720px) {
    .ref-chart-expand {
        display: none;
    }
}

@media (min-width: 720px) and (max-width: 991px) {

    .ref-detail-hero__image-wrap {
        width: 96px;
        height: 96px;
    }

    .ref-detail-stat__label {
        font-size: 0.56rem;
    }

    .ref-detail-stat__value {
        font-size: 0.88rem;
    }

    .ref-dashboard-grid {
        gap: 0.9rem;
    }

    .ref-chart-card {
        padding: 0.85rem;
    }

    .ref-chart-card__body {
        height: 200px;
    }

    .ref-chart-card__body--compact {
        height: 170px;
    }

    .ref-chart-card__body--medium {
        height: 215px;
    }

    .ref-chart-card__body--tall {
        height: 240px;
    }

    .ref-chart-card__body--square {
        max-width: 100%;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .ref-detail-page {
        padding: 1.4rem 1.3rem 2.4rem;
    }

    .ref-detail-card {
        padding: 0.85rem;
    }

    .ref-detail-hero__image-wrap {
        width: 96px;
        height: 96px;
    }

    .ref-detail-hero__subtitle {
        display: none;
    }

    .ref-detail-stat__label {
        font-size: 0.54rem;
    }

    .ref-detail-stat__value {
        font-size: 0.88rem;
    }

    .ref-detail-select__eyebrow {
        display: none;
    }

    .ref-dashboard-grid {
        gap: var(--ref-row-gap);
    }

    .ref-chart-card {
        padding: 0.75rem;
    }

    .ref-chart-card__body {
        height: 180px;
    }

    .ref-chart-card__body--compact {
        height: 145px;
    }

    .ref-chart-card__body--medium {
        height: 190px;
    }

    .ref-chart-card__body--tall {
        height: 200px;
    }

    .ref-chart-card__body--square {
        max-width: 100%;
    }

    .ref-section-header {
        gap: 0.35rem;
    }

    .ref-section-header h2 {
        font-size: 1.3rem;
    }

    .ref-section-header__summary {
        display: none;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .ref-detail-page {
        padding: 1.3rem 1.4rem 2.3rem;
    }

    .ref-detail-card {
        padding: 0.9rem;
    }

    .ref-detail-hero__image-wrap {
        width: 96px;
        height: 96px;
    }

    .ref-detail-hero__subtitle {
        display: none;
    }

    .ref-detail-hero__title {
        font-size: 2.1rem;
    }

    .ref-detail-stat__label {
        font-size: 0.54rem;
    }

    .ref-detail-stat__value {
        font-size: 0.88rem;
    }

    .ref-detail-select__eyebrow {
        display: none;
    }

    .ref-dashboard-grid {
        gap: var(--ref-row-gap);
    }

    .ref-chart-card {
        padding: 0.75rem;
    }

    .ref-chart-card__header h3 {
        font-size: 0.95rem;
    }

    .ref-chart-card__sub {
        font-size: 0.72rem;
    }

    .ref-chart-card__body {
        height: 170px;
    }

    .ref-chart-card__body--compact {
        height: 140px;
    }

    .ref-chart-card__body--medium {
        height: 180px;
    }

    .ref-chart-card__body--tall {
        height: 190px;
    }

    .ref-chart-card__body--square {
        max-width: 100%;
    }

    .ref-stat-card {
        padding: 0.85rem;
    }

    .ref-stat-label {
        font-size: 0.72rem;
    }

    .ref-stat-value {
        font-size: 1.2rem;
    }

    .ref-section-header {
        gap: 0.3rem;
    }

    .ref-section-header h2 {
        font-size: 1.25rem;
    }

    .ref-section-header__summary {
        display: none;
    }
}

@media (min-width: 1400px) {
    .ref-detail-page {
        padding: 1.1rem 1.4rem 2rem;
    }

    .ref-detail-hero__image-wrap {
        width: 88px;
        height: 88px;
    }

    .ref-detail-hero__eyebrow {
        display: none;
    }

    .ref-detail-hero__subtitle {
        display: none;
    }

    .ref-detail-stat__label {
        font-size: 0.52rem;
    }

    .ref-detail-stat__value {
        font-size: 0.86rem;
    }

    .ref-section-header {
        gap: 0.2rem;
    }

    .ref-section-header h2 {
        font-size: 1.2rem;
    }

    .ref-section-header__eyebrow {
        font-size: 0.58rem;
    }

    .ref-chart-card {
        padding: 0.7rem;
    }

    .ref-chart-card__header h3 {
        font-size: 0.92rem;
    }

    .ref-chart-card__header {
        margin-bottom: 0.5rem;
    }

    .ref-chart-card__sub {
        font-size: 0.7rem;
    }

    .ref-chart-card__body {
        height: 160px;
    }

    .ref-chart-card__body--compact {
        height: 135px;
    }

    .ref-chart-card__body--medium {
        height: 170px;
    }

    .ref-chart-card__body--tall {
        height: 180px;
    }

    .ref-chart-card__body--square {
        max-width: 100%;
    }
}

@media (min-width: 1600px) {
    .ref-chart-card__body {
        height: 155px;
    }

    .ref-chart-card__body--compact {
        height: 130px;
    }

    .ref-chart-card__body--medium {
        height: 165px;
    }

    .ref-chart-card__body--tall {
        height: 175px;
    }

    .ref-chart-card__body--square {
        max-width: 100%;
    }
}

@media (max-width: 720px) {
    .ref-detail-page {
        padding: 2rem 1.1rem 3rem;
        --ref-columns: 1;
        --ref-card-height: auto;
    }

    .ref-detail-card {
        padding: 0.95rem;
    }

    .ref-detail-card--profile {
        padding: 1rem;
    }

    .ref-detail-card--select {
        padding: 0.75rem;
    }

    .ref-detail-profile {
        gap: 0;
    }

    .ref-detail-profile__media {
        display: flex;
        flex-wrap: wrap;
        gap: 0.7rem;
        width: 100%;
        align-items: flex-start;
    }

    .ref-detail-hero__image-wrap {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
    }

    .ref-detail-hero__subtitle {
        display: none !important;
    }

    .ref-detail-profile__meta {
        flex: 1;
        min-width: 0;
        display: grid;
        gap: 0.5rem;
    }

    .ref-detail-profile__stats {
        width: 100%;
    }

    .ref-detail-stat-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 0.5rem 0.6rem;
    }

    .ref-detail-stat {
        display: grid;
        gap: 0.15rem;
    }

    .ref-detail-stat__label {
        font-size: 0.5rem;
        white-space: nowrap;
    }

    .ref-detail-stat__value {
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .ref-detail-select {
        gap: 0.5rem;
    }

    .ref-detail-select__header {
        align-items: flex-start;
    }

    .ref-detail-select__search,
    .ref-detail-officials {
        display: none;
    }

    .ref-detail-select__fallback {
        display: grid;
    }

    .ref-detail-select__fallback label {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }

    .ref-detail-page .form-select {
        padding: 0.5rem 2rem 0.5rem 0.7rem;
        font-size: 0.85rem;
    }

    .ref-dashboard-grid {
        gap: var(--ref-row-gap);
    }

    .ref-section-header__summary {
        display: none;
    }

    .ref-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ref-stat-card {
        padding: 1.1rem;
    }

    .ref-stat-value {
        font-size: 1.5rem;
    }

    .ref-chart-card {
        padding: 0.9rem;
    }

    .ref-chart-card__body {
        height: 220px;
    }

    .ref-chart-card__body--compact {
        height: 200px;
    }

    .ref-chart-card__body--medium {
        height: 230px;
    }

    .ref-chart-card__body--tall {
        height: 280px;
    }

    .ref-chart-card__body--square {
        max-width: 100%;
    }
}

@media (max-width: 540px) {
    .ref-detail-profile__media {
        gap: 0.75rem;
    }

    .ref-detail-hero__image-wrap {
        width: 90px;
        height: 90px;
    }

    .ref-detail-stat__label {
        font-size: 0.48rem;
    }

    .ref-detail-stat__value {
        font-size: 0.75rem;
    }

    .ref-stats-grid {
        grid-template-columns: 1fr;
    }

    .ref-detail-hero__title {
        font-size: 1.65rem;
    }

    .ref-section-header h2 {
        font-size: 1.3rem;
    }

    .ref-chart-card__body {
        height: 210px;
    }

    .ref-chart-card__body--tall {
        height: 250px;
    }
}

.ref-chart-card__body {
    flex: 1;
    height: auto;
    min-height: 190px;
}

.ref-chart-card__body--compact {
    height: auto;
    min-height: 160px;
}

.ref-chart-card__body--medium {
    height: auto;
    min-height: 210px;
}

.ref-chart-card__body--tall {
    height: auto;
    min-height: 250px;
}

.ref-chart-card__body--square {
    height: auto;
}
