.page-industry-detail .top-nav-shell {
    margin-bottom: 4px;
}

.industry-detail-state-panel {
    margin-top: 14px;
}

.industry-detail-state-panel h1,
.industry-detail-state-panel h2 {
    margin: 0;
}

.industry-detail-code-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--ui-text-muted);
    font-size: 0.92rem;
}

.industry-detail-trend-panel,
.industry-detail-company-panel {
    display: grid;
    gap: 12px;
}

.industry-detail-trend-panel {
    padding-block: 14px;
}

.industry-detail-company-panel {
    padding-block: 14px;
}

.industry-detail-trend-panel__header,
.industry-detail-company-panel__header {
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.industry-detail-trend-panel__header > div:first-child,
.industry-detail-company-panel__header > div:first-child {
    flex: 0 0 auto;
    min-width: 0;
}

.industry-detail-metric-group,
.industry-detail-year-group {
    flex: 1 1 520px;
    min-width: 0;
    max-width: none;
}

.industry-detail-metric-selector,
.industry-detail-company-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    width: fit-content;
    max-width: 100%;
}

.industry-detail-trend-panel .panel-note {
    max-width: 48rem;
}

.industry-detail-trend-chart-card {
    padding: 10px 12px 12px;
}

.industry-detail-finance-note {
    margin-top: 6px;
    max-width: 52rem;
}

.industry-detail-metric-group__buttons {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
}

.industry-detail-metric-group .toggle {
    padding-left: 10px;
    padding-right: 10px;
}

.industry-detail-metric-more {
    position: relative;
    flex: 0 0 auto;
}

.industry-detail-metric-more > summary {
    list-style: none;
}

.industry-detail-metric-more > summary::-webkit-details-marker {
    display: none;
}

.industry-detail-metric-more-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5;
    width: min(520px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    align-content: start;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--ui-border-soft);
    border-radius: 14px;
    background: var(--ui-surface);
    box-shadow: 0 18px 36px var(--ui-shadow-3);
}

.industry-detail-metric-more[open] .industry-detail-metric-more-menu {
    display: grid;
}

.industry-detail-metric-more > summary.ranking-metric-chip--more {
    position: relative;
    padding: 0 30px 0 14px;
}

.industry-detail-metric-more > summary.ranking-metric-chip--more::after {
    content: "▾";
    position: absolute;
    right: 10px;
    font-size: 0.72rem;
}

.industry-detail-metric-more.is-active > summary {
    border-color: var(--color-border-strong);
    background: var(--color-surface-warm);
    color: var(--color-accent);
    box-shadow: inset 0 0 0 1px var(--ui-selected-inset);
}

.industry-detail-trend-chart {
    width: 100%;
    height: 420px;
}

.industry-detail-year-group {
    flex: 0 1 240px;
}

.industry-detail-year-note {
    margin: 4px 0 0;
}

.industry-detail-company-controls {
    justify-content: space-between;
    align-items: flex-end;
}

.industry-detail-company-panel .panel-note {
    margin-top: -2px;
    max-width: 46rem;
}

.industry-detail-company-panel__header {
    margin-bottom: 2px;
}

.industry-detail-table-grid .tabulator .tabulator-tableholder {
    overflow: auto;
}

.industry-detail-table-grid .tabulator .tabulator-cell {
    white-space: nowrap;
}

.industry-detail-table-grid .tabulator .industry-detail-metric-cell.is-active {
    background: var(--color-surface-warm);
    color: var(--color-accent);
    font-weight: 700;
}

.industry-detail-table-grid .tabulator .tabulator-row:hover .industry-detail-metric-cell.is-active {
    background: var(--color-surface-warm);
}

@media (max-width: 640px) {
    .company-hero {
        border-radius: 14px;
        padding: 16px;
    }

    .company-hero-top {
        flex-direction: column;
    }

    .company-hero-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .company-hero-actions > .button {
        width: 100%;
        justify-content: center;
    }

    .button-primary {
        width: 100%;
        justify-content: center;
    }

    .company-hero h1 {
        font-size: 1.5rem;
    }

    .industry-detail-metric-group,
    .industry-detail-year-group {
        width: 100%;
        min-width: 0;
        flex-basis: 100%;
    }

    .industry-detail-metric-more-menu {
        grid-template-columns: 1fr;
    }

    .industry-detail-trend-chart {
        height: 360px;
    }

    .industry-detail-company-controls {
        align-items: flex-start;
    }

    .industry-detail-trend-panel,
    .industry-detail-company-panel {
        padding-block: 12px;
    }

    .industry-detail-finance-note {
        max-width: none;
    }
}
