.discovery-filters.filter-panel {
    --discovery-control-height: 36px;
    position: sticky;
    top: var(--discovery-masthead, 138px);
    z-index: 25;
    grid-template-columns: minmax(160px, 2fr) minmax(110px, 1fr) minmax(150px, 1.2fr) auto;
    gap: 10px;
    align-items: end;
    padding: 10px 12px;
    background: #101a2a;
    box-shadow: 0 6px 18px #03060c40;
}
.discovery-filters label {
    display: grid;
    min-width: 0;
    gap: 4px;
    color: #b6c6da;
    font-size: 11px;
    font-weight: 600;
}
.discovery-filters :is(input, select) {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    height: auto;
    margin: 0;
    padding: 6px 9px;
    color: #edf3fc;
    background: #0a1422;
    border: 1px solid #344963;
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
}
.discovery-filter-actions { display: flex; align-items: end; gap: 8px; }
.discovery-filters.filter-panel .button,
.discovery-more > summary {
    display: grid;
    place-items: center;
    width: auto;
    height: auto;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 7px;
    white-space: nowrap;
    font-size: 12px;
}
.discovery-more > summary {
    cursor: pointer;
    border: 1px solid #344963;
    background: #162337;
    color: #d6e3f6;
}
.discovery-filter-fields {
    position: absolute;
    inset: calc(100% + 5px) 0 auto auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(420px, 100%);
    box-sizing: border-box;
    max-height: max(96px, calc(100dvh - var(--discovery-masthead, 138px) - 210px));
    overflow-y: auto;
    gap: 10px;
    padding: 12px;
    background: #101a2a;
    border: 1px solid #344963;
    border-radius: 10px;
    box-shadow: 0 12px 30px #03060c9c;
}
#discover { scroll-margin-top: 138px; }
.discovery-terminal.exchange-terminal { padding: clamp(10px, 1.5vw, 20px) !important; }
.discovery-feed-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.discovery-feed-heading h2 { margin: 0 0 4px; font-size: clamp(16px, 2vw, 22px); }
.discovery-feed-status { display: flex; flex-wrap: wrap; gap: 3px 14px; color: #9eb4c8; }
.discovery-feed-status span { font-size: 11px; }
.discovery-terminal .dex-table-wrap { overflow: visible; }
.discovery-terminal .dex-market-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
    white-space: normal;
    font-variant-numeric: tabular-nums;
}
.discovery-terminal .dex-market-table :is(th, td) {
    min-width: 0;
    max-width: none;
    padding: 6px 5px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    vertical-align: middle;
}
.discovery-terminal [data-market-column="token"] { width: 17%; }
.discovery-terminal [data-market-column="chart"] { width: 10%; }
.discovery-terminal [data-market-column="ownership"] { width: 13%; }
.discovery-terminal [data-market-column="m5"],
.discovery-terminal [data-market-column="h1"],
.discovery-terminal [data-market-column="h6"],
.discovery-terminal [data-market-column="h24"] { width: 5.5%; }
.discovery-terminal [data-market-column="age"] { width: 5%; }
.discovery-terminal .dex-market-table th [data-feed-column] {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 100%;
    min-height: 30px;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-transform: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}
.discovery-terminal th[aria-sort] [data-feed-column],
.discovery-terminal th [data-feed-column]:hover { color: #9aeacb; }
.discovery-terminal th [data-feed-column] span { color: #91a8c3; flex: none; }
.discovery-terminal th[aria-sort] [data-feed-column] span { color: inherit; }
.discovery-terminal .dex-token-identity { display: flex; align-items: center; gap: 7px; }
.discovery-terminal .dex-token-logo { width: 28px !important; height: 28px !important; }
.discovery-token-text { min-width: 0; }
.discovery-terminal .dex-token-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.discovery-terminal .discovery-token-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.discovery-terminal .discovery-token-meta .chain-with-logo { font-size: 9px; gap: 3px; }
.discovery-terminal .discovery-token-meta img { width: 12px; height: 12px; }
.discovery-terminal .live-spark-cell svg { display: block; width: 100%; min-width: 0; max-height: 32px; }
.discovery-terminal .dex-market-table small { line-height: 1.2; }
.discovery-terminal .dex-market-table td:last-child a { display: inline-block; margin: 3px 6px 0 0; }
.discovery-terminal .dex-feed-pagination { margin-block: 10px; }

@media (max-width: 1050px) {
    .discovery-terminal .dex-table-wrap { border: 0; }
    .discovery-terminal .dex-market-table { display: table; }
    .discovery-terminal .dex-market-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .discovery-terminal .dex-market-table thead:focus-within {
        position: static;
        display: table-header-group;
        width: auto;
        height: auto;
        clip: auto;
        clip-path: none;
    }
    .discovery-terminal .dex-market-table tbody { display: block; width: 100%; }
    .discovery-terminal .dex-market-table tbody tr {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0 6px;
        padding: 7px 9px;
        margin-bottom: 6px;
        border: 1px solid #283b52;
        border-radius: 8px;
    }
    .discovery-terminal .dex-market-table tbody td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 5px 0;
        border: 0;
    }
    .discovery-terminal .dex-market-table tbody td::before {
        display: block;
        margin-bottom: 3px;
        color: #91a8c3;
        content: attr(data-mobile-label);
        font-size: 9px;
    }
    .discovery-terminal .dex-market-table tbody td { grid-column: auto; text-align: left; }
    .discovery-terminal .dex-market-table tbody td:first-child { grid-column: span 2; }
    .discovery-terminal .dex-market-table .discovery-token-meta { display: flex; }
    .discovery-terminal .dex-market-table .area-graph-cell { grid-row: auto; }
    .discovery-terminal .dex-market-table tbody td:first-child::before { content: none; }
    .discovery-terminal .dex-market-table tbody td:nth-child(4) { grid-column: span 2; }
    .discovery-terminal .dex-market-table tbody td:last-child { grid-column: 1 / -1; }
    .discovery-terminal .dex-market-table td[colspan] { grid-column: 1 / -1; }
    .discovery-terminal .dex-market-table tbody tr { min-width: 0; }
}
/* Keep the primary controls on a common bottom edge, including the native chain fallback. */
.discovery-filters.filter-panel > :is(.discovery-search, .discovery-chain-field, label, .discovery-filter-actions) {
    align-self: end;
    min-width: 0;
    margin: 0;
}
.discovery-filters.filter-panel > label,
.discovery-filters.filter-panel :is(.discovery-search > label, .discovery-chain-field) {
    display: grid;
    grid-template-rows: auto var(--discovery-control-height);
    gap: 4px;
    margin: 0;
}
.discovery-filters.filter-panel .discovery-chain-field > label {
    margin: 0;
}
.discovery-filters.filter-panel > label > select,
.discovery-filters.filter-panel :is(.discovery-search input, .discovery-chain-field select:not(.chain-native-hidden)),
.discovery-filters.filter-panel .chain-picker .chain-picker-trigger,
.discovery-filters.filter-panel .discovery-filter-actions summary {
    box-sizing: border-box;
    block-size: var(--discovery-control-height);
    min-block-size: var(--discovery-control-height);
    margin: 0;
    padding-block: 0;
}
.discovery-filters .chain-picker { min-width: 0; }
.discovery-filters.filter-panel > .discovery-filter-actions { grid-column: auto; }
.discovery-filters .chain-picker-menu { max-height: min(240px, 40vh); }
.discovery-filters .chain-picker-trigger { border-radius: 7px; padding-inline: 9px; font-size: 13px; }
.discovery-filters .chain-picker-trigger > img { width: 17px; height: 17px; }
.discovery-filters .chain-picker-trigger > span:not(.chain-picker-chevron) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discovery-page-size, .discovery-page-size label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.discovery-page-size { gap: 12px; }
.discovery-page-size select {
    min-height: 34px;
    padding: 4px 8px;
    border: 1px solid #344963;
    border-radius: 7px;
    background: #0a1422;
    color: #edf3fc;
    font: inherit;
}

.discovery-search { position: relative; min-width: 0; }
.discovery-filters.filter-panel .discovery-search input { padding-inline-end: 40px; }
.discovery-search-submit {
    position: absolute;
    inset: auto 3px 3px auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #9fb7d1;
    cursor: pointer;
}
.discovery-search-submit:hover { background: #1b2c43; color: #edf3fc; }
.discovery-filters.filter-panel .discovery-filter-actions summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-inline: 9px;
    background: #0a1422;
    color: #b6c6da;
    list-style: none;
}
.discovery-more summary::-webkit-details-marker { display: none; }
.discovery-filter-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); }
.discovery-filter-fields > button { grid-column: 1 / -1; justify-self: end; }

@media (max-width: 720px) {
    .discovery-filters.filter-panel {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        gap: 7px;
        padding: 8px;
    }
    .discovery-filters.filter-panel > .discovery-search { grid-column: 1 / -1; }
    .discovery-filters.filter-panel > .discovery-filter-actions { grid-column: 3; }
    .discovery-filters :is(input, select) { font-size: 16px; }
    .discovery-filters.filter-panel .discovery-filter-actions summary { padding-inline: 6px; }
    .discovery-filters.filter-panel .discovery-filter-actions summary svg { display: none; }
}

/* Bound the graph within its column, overriding the older clarity stylesheet. */
.discovery-terminal .dex-market-table .area-graph-cell { min-width:0!important; overflow:hidden; }
.discovery-terminal .dex-market-table .area-graph-cell svg {
    display:block!important; width:100%!important; max-width:160px!important;
    min-width:0!important; height:42px!important; max-height:42px!important; overflow:hidden;
}
.discovery-terminal .dex-market-table .area-graph-cell>small {
    display:block; max-width:100%!important; overflow:hidden; text-overflow:ellipsis;
}
.discovery-terminal .dex-market-table td:not(:first-child):not(:last-child) { overflow-wrap:normal; white-space:nowrap; }
.discovery-terminal [data-market-column="chart"] { width:13%; }
.discovery-terminal [data-market-column="token"] { width:18%; }
.discovery-terminal [data-market-column="ownership"] { width:12%; }
.discovery-terminal .exchange-page-numbers a { display:grid; place-items:center; min-width:34px; height:34px; border:1px solid #607fa550; border-radius:9px; }
.discovery-terminal .exchange-page-numbers a[aria-current="page"] { background:#9ebcff; color:#0b1730; }
.discovery-filters.filter-panel { align-self:start; }
@media(max-width:1050px) {
    .discovery-terminal .dex-market-table tbody td { display:block!important; }
    .discovery-terminal .dex-market-table .area-graph-cell svg { max-width:none!important; }
    .discovery-terminal .dex-market-table [data-market-column] { width:auto; }
}
@media(prefers-reduced-motion:reduce) {
    .discovery-terminal .value-tick-up, .discovery-terminal .value-tick-down { animation:none; }
}
