body.home-body {
    min-height: 100vh;
    background: var(--bg);
}

/* ---- Navbar search ---- */
.nav-search {
    flex: 0 1 520px;
    max-width: 520px;
    position: relative;
}

.nav-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.nav-search input::placeholder {
    color: var(--text-muted);
}

.nav-search::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 50%;
    width: 13px;
    height: 13px;
    margin-top: -8px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    opacity: 0.7;
}

.nav-search::after {
    content: "";
    position: absolute;
    left: 25px;
    top: 50%;
    width: 6px;
    height: 2px;
    margin-top: 3px;
    background: var(--text-muted);
    transform: rotate(45deg);
    opacity: 0.7;
}

.nav-search input:focus {
    border-color: var(--brand);
}

/* ---- Layout ---- */
.home {
    flex: 1 1 auto;
    width: 100%;
    padding: 24px 16px 56px;
}

.home__hero {
    margin: 4px 0 20px;
}

.home__hero h1 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.home__subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.home__subtitle a {
    color: var(--link);
    text-decoration: none;
}

/* ---- Controls ---- */
.home__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.quote-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.chip {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.chip:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.chip.is-active {
    background: var(--bg-soft);
    color: var(--link);
}

.home__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    color: var(--text-muted);
    font-size: 13px;
}

.home__page-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home__page-size select {
    padding: 7px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
}

.home__updated {
    white-space: nowrap;
}

/* ---- Table ---- */
.table-wrap {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: clip;
    min-height: 60vh;
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.market-table thead th {
    position: sticky;
    top: 65px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.market-table thead th.col-num,
.market-table thead th.col-rank {
    text-align: right;
}

.market-table thead th.col-spark,
.market-table thead th.col-star,
.market-table thead th.col-chevron {
    cursor: default;
}

.market-table thead th.col-spark {
    text-align: center;
}

.market-table thead th[data-sort]:hover {
    color: var(--text);
}

.market-table th.sorted-asc::after {
    content: " \25B2";
    font-size: 8px;
    color: var(--text-muted);
}

.market-table th.sorted-desc::after {
    content: " \25BC";
    font-size: 8px;
    color: var(--text-muted);
}

.market-body-row {
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s ease;
}

.market-body-row:last-child {
    border-bottom: none;
}

.market-body-row:hover {
    background: var(--bg-soft);
}

.market-body-row td {
    padding: 12px 16px;
    vertical-align: middle;
}

.col-star {
    width: 34px;
    text-align: center;
}

.col-rank {
    width: 44px;
    color: var(--text-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}

.col-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.col-num.price {
    font-weight: 600;
}

.col-spark {
    width: 155px;
    text-align: center;
}

.col-chevron {
    width: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 16px;
}

/* ---- Star ---- */
.star {
    display: inline-block;
    width: 18px;
    height: 18px;
    cursor: pointer;
    color: transparent;
    -webkit-text-stroke: 1.4px var(--text-muted);
    font-size: 17px;
    line-height: 1;
    vertical-align: middle;
}

.star:hover {
    -webkit-text-stroke-color: #f0b90b;
}

.star.is-active {
    color: #f0b90b;
    -webkit-text-stroke: 1.4px #f0b90b;
}

/* ---- Asset cell ---- */
.asset {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asset__avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
    text-transform: uppercase;
}

.asset__names {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.asset__base {
    font-weight: 600;
    color: var(--text);
}

.asset__pair {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

/* ---- Percentage pills ---- */
.pct {
    display: inline-block;
    min-width: 66px;
    text-align: right;
    padding: 4px 8px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.pct.up {
    color: var(--bid);
    background: rgba(22, 199, 132, 0.1);
}

.pct.down {
    color: var(--ask);
    background: rgba(234, 57, 67, 0.1);
}

.pct.flat {
    color: var(--text-muted);
}

/* ---- Sparkline ---- */
.spark {
    display: block;
    margin: 0 auto;
}

.spark__line {
    fill: none;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.spark__area {
    stroke: none;
}

.spark__line.up {
    stroke: var(--bid);
}

.spark__line.down {
    stroke: var(--ask);
}

.spark__area.up {
    fill: rgba(22, 199, 132, 0.08);
}

.spark__area.down {
    fill: rgba(234, 57, 67, 0.08);
}

.spark-loading {
    color: var(--text-muted);
    letter-spacing: 2px;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 22px;
}

.page-btn {
    padding: 9px 20px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--brand);
}

.page-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.page-info {
    color: var(--text-muted);
    font-size: 13px;
}

.market-error {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

.market-empty {
    padding: 48px;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 860px) {
    .nav-search {
        display: none;
    }

    .home {
        padding: 16px 12px 40px;
    }

    .col-spark,
    .market-table th.col-spark {
        display: none;
    }

    .home__meta {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .market-table thead th {
        position: static;
    }
}
