:root {
    --bg: #f3f7fc;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #d9e3ee;
    --primary: #0f766e;
    --primary2: #0ea5a5;
    --kakao: #fee500;
}

body {
    background:
        radial-gradient(circle at 88% 10%, rgba(37, 99, 235, 0.16), transparent 38%),
        radial-gradient(circle at 12% 88%, rgba(16, 185, 129, 0.12), transparent 38%),
        var(--bg);
    color: var(--text);
}

.ft-market {
    max-width: 1200px;
    padding-inline: clamp(12px, 2vw, 20px);
}

.hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.26);
    background:
        radial-gradient(1100px 400px at -12% -20%, rgba(255, 255, 255, 0.28), transparent 56%),
        radial-gradient(900px 340px at 118% 120%, rgba(255, 255, 255, 0.2), transparent 60%),
        linear-gradient(135deg, #0f766e 0%, #0ea5a5 42%, #2563eb 100%);
    border-radius: 18px;
    padding: clamp(18px, 2.8vw, 24px);
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

.badge-text {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.24);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.34);
    font-size: 11px;
    font-weight: 700;
}

.hero h1 {
    margin: 8px 0;
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    color: #f8fafc;
}

.hero p {
    margin: 0;
    color: #e2e8f0;
    font-size: clamp(0.92rem, 1.2vw, 1rem);
}

.hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-content: flex-start;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    margin-bottom: 14px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.06rem;
}

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

.pm-btn {
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 12px;
    min-height: 42px;
    background: linear-gradient(120deg, var(--primary), var(--primary2));
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pm-btn.secondary {
    background: #0f172a;
    color: #fff;
}

.pm-btn.ghost {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

.pm-btn.kakao {
    background: var(--kakao);
    color: #191600;
    border-color: #efd900;
}

.table-share-actions {
    display: inline-flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.pm-btn.xs {
    min-height: 30px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
}

.search-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    color: var(--text);
    font-size: 15px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary2);
    box-shadow: 0 0 0 3px rgba(14, 165, 165, 0.15);
}

.table-wrap {
    max-height: 560px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.trade-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 13px;
}

.trade-table th,
.trade-table td {
    border-bottom: 1px solid #ebf0f7;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.trade-table tbody tr.market-row-link {
    cursor: pointer;
}

.trade-table tbody tr.market-row-link:hover td {
    background: #f8fbff;
}

.trade-table tbody tr.market-row-link:focus-visible {
    outline: 2px solid rgba(14, 165, 233, 0.6);
    outline-offset: 1px;
}

.trade-table thead th {
    background: #f8fbff;
    color: #334155;
    position: sticky;
    top: 0;
}

.market-fish-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    width: 100%;
}

.market-fish-thumb {
    width: 22px;
    height: 22px;
    border: 1px solid #dbe7f3;
    border-radius: 6px;
    background: linear-gradient(180deg, #f8fbff, #edf5ff);
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    flex: 0 0 auto;
}

.market-fish-image {
    width: 200%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: left center;
    display: block;
    image-rendering: pixelated;
}

.market-fish-fallback {
    color: #7c93ad;
    font-size: 10px;
    width: 100%;
    text-align: center;
}

.market-fish-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.pager {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-row {
    text-align: center;
    color: var(--muted);
    padding: 14px !important;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 2200;
    background: #0f172a;
    color: #fff;
    padding: 10px 12px;
    border-radius: 9px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.24s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 992px) {
    .hero,
    .panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .hero-actions .pm-btn {
        width: 100%;
        justify-content: center;
    }

    .search-toolbar {
        grid-template-columns: 1fr;
    }

    .search-toolbar .pm-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .ft-market {
        padding-inline: 10px;
    }

    .panel {
        padding: 12px;
    }

    .panel-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .pm-btn {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .table-wrap {
        max-height: none;
        overflow: visible;
    }

    .trade-table {
        min-width: 0;
        font-size: 12px;
        border-collapse: separate;
        border-spacing: 0;
    }

    .trade-table thead {
        display: none;
    }

    .trade-table tbody,
    .trade-table tr,
    .trade-table td {
        display: block;
        width: 100%;
    }

    .trade-table tbody tr > td {
        width: auto;
    }

    .trade-table tbody tr {
        border: 1px solid #dbe7f3;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
        padding: 8px 10px;
        margin-bottom: 8px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-areas:
            "fish fish fish share"
            "avg recent min max"
            "date date date date";
        gap: 5px 8px;
    }

    .trade-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .trade-table tbody tr.empty-row {
        border: 0;
        box-shadow: none;
        background: transparent;
        padding: 0;
    }

    .market-fish-thumb {
        width: 20px;
        height: 20px;
    }

    .trade-table td {
        border: 0;
        padding: 0;
        display: block;
    }

    .trade-table td::before {
        content: none;
    }

    .trade-table td[data-label="물고기"] {
        grid-area: fish;
        min-width: 0;
        align-self: center;
    }

    .trade-table td[data-label="평균 거래가"] {
        grid-area: avg;
    }

    .trade-table td[data-label="최저"] {
        grid-area: min;
    }

    .trade-table td[data-label="최고"] {
        grid-area: max;
    }

    .trade-table td[data-label="최근 거래가"] {
        grid-area: recent;
    }

    .trade-table td[data-label="평균 거래가"],
    .trade-table td[data-label="최저"],
    .trade-table td[data-label="최고"],
    .trade-table td[data-label="최근 거래가"] {
        display: flex;
        flex-direction: column;
        gap: 2px;
        background: #f8fbff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 4px 6px;
        line-height: 1.3;
        color: #0f172a;
        font-size: 12px;
    }

    .trade-table td[data-label="최저"] {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #1d4ed8;
    }

    .trade-table td[data-label="최고"] {
        background: #fef2f2;
        border-color: #fecaca;
        color: #b91c1c;
    }

    .trade-table td[data-label="평균 거래가"]::before,
    .trade-table td[data-label="최저"]::before,
    .trade-table td[data-label="최고"]::before,
    .trade-table td[data-label="최근 거래가"]::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 10px;
        font-weight: 700;
        line-height: 1.2;
    }

    .trade-table td[data-label="최저"]::before {
        color: #1d4ed8;
    }

    .trade-table td[data-label="최고"]::before {
        color: #b91c1c;
    }

    .trade-table td[data-label="최근 거래일"] {
        grid-area: date;
        color: #64748b;
        font-size: 11px;
        line-height: 1.35;
    }

    .trade-table td[data-label="최근 거래일"]::before {
        content: "최근 거래일 ";
        font-weight: 700;
    }

    .trade-table td[data-label="공유"] {
        grid-area: share;
        width: auto;
        display: flex;
        justify-content: flex-end;
        align-self: center;
        justify-self: end;
    }

    .trade-table td[data-label="공유"] .table-share-actions {
        margin-left: auto;
        justify-content: flex-end;
    }

    .trade-table td.empty-row {
        display: block;
        border: 1px dashed #dbe7f3;
        border-radius: 10px;
        padding: 10px;
        background: #fbfdff;
        text-align: left;
    }

    .trade-table td.empty-row::before {
        content: none;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    /* Market mobile layout (data-col based, UTF-8 safe override) */
    .trade-table tbody tr {
        grid-template-areas:
            "fish fish fish share"
            "avg recent volume max"
            "date date date date";
    }

    .trade-table td[data-col="fish"] {
        grid-area: fish;
        min-width: 0;
        align-self: center;
    }

    .trade-table td[data-col="avg"] { grid-area: avg; }
    .trade-table td[data-col="recent"] { grid-area: recent; }
    .trade-table td[data-col="volume"] { grid-area: volume; }
    .trade-table td[data-col="max"] { grid-area: max; }
    .trade-table td[data-col="date"] {
        grid-area: date;
        color: #64748b;
        font-size: 11px;
        line-height: 1.35;
    }
    .trade-table td[data-col="share"] {
        grid-area: share;
        width: auto;
        display: flex;
        justify-content: flex-end;
        align-self: center;
        justify-self: end;
    }

    .trade-table td[data-col="avg"],
    .trade-table td[data-col="recent"],
    .trade-table td[data-col="volume"],
    .trade-table td[data-col="max"] {
        display: flex;
        flex-direction: column;
        gap: 2px;
        background: #f8fbff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 4px 6px;
        line-height: 1.3;
        color: #0f172a;
        font-size: 12px;
    }

    .trade-table td[data-col="volume"] {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #1d4ed8;
    }

    .trade-table td[data-col="max"] {
        background: #fef2f2;
        border-color: #fecaca;
        color: #b91c1c;
    }

    .trade-table td[data-col="avg"]::before,
    .trade-table td[data-col="recent"]::before,
    .trade-table td[data-col="volume"]::before,
    .trade-table td[data-col="max"]::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 10px;
        font-weight: 700;
        line-height: 1.2;
    }

    .trade-table td[data-col="volume"]::before { color: #1d4ed8; }
    .trade-table td[data-col="max"]::before { color: #b91c1c; }
    .trade-table td[data-col="date"]::before {
        content: attr(data-label);
        font-weight: 700;
    }
}

/* Mobile market table hard-fix (Market page) */
@media (max-width: 768px) {
    .ft-market .table-wrap {
        max-height: none !important;
        overflow: visible !important;
    }

    .ft-market .trade-table {
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        table-layout: fixed;
    }

    .ft-market .trade-table thead {
        display: none !important;
    }

    .ft-market .trade-table tbody,
    .ft-market .trade-table tr,
    .ft-market .trade-table td {
        display: block !important;
        width: 100% !important;
    }

    .ft-market .trade-table tbody tr {
        box-sizing: border-box;
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-areas:
            "fish fish fish share"
            "avg recent min max"
            "date date date date";
        gap: 6px 8px;
        width: 100%;
        margin: 0 0 8px;
        padding: 8px 10px;
        border: 1px solid #dbe7f3;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
    }

    .ft-market .trade-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .ft-market .trade-table tbody tr.empty-row {
        border: 0;
        box-shadow: none;
        background: transparent;
        padding: 0;
        display: block !important;
    }

    .ft-market .trade-table td {
        min-width: 0;
        padding: 0 !important;
        border: 0 !important;
    }

    .ft-market .trade-table td::before {
        content: none !important;
    }

    .ft-market .trade-table td[data-col="fish"] {
        grid-area: fish !important;
        align-self: center;
    }

    .ft-market .trade-table td[data-col="avg"] {
        grid-area: avg !important;
    }

    .ft-market .trade-table td[data-col="recent"] {
        grid-area: recent !important;
    }

    .ft-market .trade-table td[data-col="min"] {
        grid-area: min !important;
    }

    .ft-market .trade-table td[data-col="max"] {
        grid-area: max !important;
    }

    .ft-market .trade-table td[data-col="avg"],
    .ft-market .trade-table td[data-col="recent"],
    .ft-market .trade-table td[data-col="min"],
    .ft-market .trade-table td[data-col="max"] {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: #f8fbff;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px;
        padding: 4px 6px !important;
        line-height: 1.3;
        color: #0f172a;
        font-size: 12px;
        text-align: center;
    }

    .ft-market .trade-table td[data-col="min"] {
        background: #eff6ff;
        border-color: #bfdbfe !important;
        color: #1d4ed8;
    }

    .ft-market .trade-table td[data-col="max"] {
        background: #fef2f2;
        border-color: #fecaca !important;
        color: #b91c1c;
    }

    .ft-market .trade-table td[data-col="avg"]::before,
    .ft-market .trade-table td[data-col="recent"]::before,
    .ft-market .trade-table td[data-col="min"]::before,
    .ft-market .trade-table td[data-col="max"]::before {
        display: block;
        font-size: 10px;
        font-weight: 700;
        line-height: 1.2;
        text-align: center;
        width: 100%;
        color: #64748b;
    }

    .ft-market .trade-table td[data-col="avg"]::before {
        content: "평균 거래가";
    }

    .ft-market .trade-table td[data-col="recent"]::before {
        content: "최근 거래가";
    }

    .ft-market .trade-table td[data-col="min"]::before {
        content: "최저";
        color: #1d4ed8;
    }

    .ft-market .trade-table td[data-col="max"]::before {
        content: "최고";
        color: #b91c1c;
    }

    .ft-market .trade-table td[data-col="date"] {
        grid-area: date !important;
        color: #64748b;
        font-size: 11px;
        line-height: 1.35;
    }

    .ft-market .trade-table td[data-col="date"]::before {
        content: "최근 거래일 ";
        font-weight: 700;
        color: inherit;
    }

    .ft-market .trade-table td[data-col="share"] {
        grid-area: share !important;
        display: flex !important;
        justify-content: flex-end;
        align-self: center;
        justify-self: end;
    }

    .ft-market .trade-table td[data-col="share"] .table-share-actions {
        margin-left: auto;
        justify-content: flex-end;
    }

    .ft-market .trade-table td.empty-row {
        display: block !important;
        border: 1px dashed #dbe7f3 !important;
        border-radius: 10px;
        padding: 10px !important;
        background: #fbfdff;
    }

    .ft-market .trade-table td.empty-row::before {
        content: none !important;
    }
}

@media (max-width: 576px) {
    .ft-market .trade-table tbody tr {
        padding: 7px 9px;
        gap: 4px 6px;
    }

    .ft-market .trade-table td[data-col="avg"],
    .ft-market .trade-table td[data-col="recent"],
    .ft-market .trade-table td[data-col="min"],
    .ft-market .trade-table td[data-col="max"] {
        padding: 3px 5px !important;
        font-size: 10px;
    }

    .ft-market .trade-table td[data-col="avg"]::before,
    .ft-market .trade-table td[data-col="recent"]::before,
    .ft-market .trade-table td[data-col="min"]::before,
    .ft-market .trade-table td[data-col="max"]::before {
        font-size: 9px;
    }
}

@media (max-width: 576px) {
    .hero-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trade-table tbody tr {
        padding: 7px 9px;
        gap: 4px 6px;
    }

    .trade-table td[data-label="평균 거래가"],
    .trade-table td[data-label="최저"],
    .trade-table td[data-label="최고"],
    .trade-table td[data-label="최근 거래가"] {
        padding: 3px 5px;
        font-size: 11px;
    }

    .trade-table td[data-label="평균 거래가"]::before,
    .trade-table td[data-label="최저"]::before,
    .trade-table td[data-label="최고"]::before,
    .trade-table td[data-label="최근 거래가"]::before {
        font-size: 9px;
    }
}

/* MOBILE_COMPACT_PRICE_CELLS */
@media (max-width: 768px) {
    .trade-table tbody tr > td:nth-child(2),
    .trade-table tbody tr > td:nth-child(3),
    .trade-table tbody tr > td:nth-child(4),
    .trade-table tbody tr > td:nth-child(5) {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        padding: 4px 5px;
        line-height: 1.2;
        font-size: 11px;
        white-space: nowrap;
    }

    .trade-table tbody tr > td:nth-child(2)::before,
    .trade-table tbody tr > td:nth-child(3)::before,
    .trade-table tbody tr > td:nth-child(4)::before,
    .trade-table tbody tr > td:nth-child(5)::before {
        content: attr(data-label);
        font-size: 9px;
        line-height: 1.1;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .trade-table tbody tr > td:last-child {
        justify-self: end;
    }

    .trade-table tbody tr > td:last-child .table-share-actions {
        margin-left: auto;
        justify-content: flex-end;
    }
}

@media (max-width: 576px) {
    .trade-table tbody tr > td:nth-child(2),
    .trade-table tbody tr > td:nth-child(3),
    .trade-table tbody tr > td:nth-child(4),
    .trade-table tbody tr > td:nth-child(5) {
        font-size: 10px;
        padding: 3px 4px;
    }

    .trade-table tbody tr > td:nth-child(2)::before,
    .trade-table tbody tr > td:nth-child(3)::before,
    .trade-table tbody tr > td:nth-child(4)::before,
    .trade-table tbody tr > td:nth-child(5)::before {
        font-size: 8px;
    }
}

/* MOBILE_MARKET_CARD_OVERRIDE */
@media (max-width: 768px) {
    .trade-table td:nth-child(1) {
        grid-area: fish !important;
        min-width: 0;
        align-self: center;
    }

    .trade-table td:nth-child(2) { grid-area: avg !important; }
    .trade-table td:nth-child(3) { grid-area: recent !important; }
    .trade-table td:nth-child(4) { grid-area: min !important; }
    .trade-table td:nth-child(5) { grid-area: max !important; }
    .trade-table td:nth-child(6) { grid-area: date !important; }
    .trade-table td:nth-child(7) {
        grid-area: share !important;
        justify-self: end;
        align-self: center;
    }

    .trade-table td:nth-child(2),
    .trade-table td:nth-child(3),
    .trade-table td:nth-child(4),
    .trade-table td:nth-child(5) {
        display: flex !important;
        flex-direction: column;
        gap: 2px;
        padding: 4px 6px !important;
        font-size: 13px !important;
        line-height: 1.3;
        border-radius: 8px;
    }

    .trade-table td:nth-child(2)::before,
    .trade-table td:nth-child(3)::before,
    .trade-table td:nth-child(4)::before,
    .trade-table td:nth-child(5)::before {
        content: attr(data-label);
        font-size: 11px !important;
        line-height: 1.2;
        font-weight: 700;
        color: #64748b;
    }

    .trade-table td:nth-child(6) {
        font-size: 12px !important;
        line-height: 1.35;
        color: #64748b;
    }

    .trade-table td:nth-child(6)::before {
        content: attr(data-label);
        font-weight: 700;
    }
}

@media (max-width: 576px) {
    .trade-table td:nth-child(2),
    .trade-table td:nth-child(3),
    .trade-table td:nth-child(4),
    .trade-table td:nth-child(5) {
        padding: 3px 5px !important;
        font-size: 12px !important;
    }

    .trade-table td:nth-child(2)::before,
    .trade-table td:nth-child(3)::before,
    .trade-table td:nth-child(4)::before,
    .trade-table td:nth-child(5)::before {
        font-size: 10px !important;
    }
}


/* Mobile typography tuning (non-DM) */
@media (max-width: 768px) {
    .ft-market {
        font-size: 14px;
    }

    .hero h1 {
        font-size: 1.42rem;
        line-height: 1.3;
    }

    .hero p {
        font-size: 14px;
        line-height: 1.55;
    }

    .panel-head h2 {
        font-size: 1.01rem;
        line-height: 1.35;
    }

    .result-info {
        font-size: 12px;
        line-height: 1.45;
    }

    .pm-btn {
        font-size: 13px;
    }

    .trade-table tbody tr > td:first-child {
        font-size: 12px;
        line-height: 1.35;
    }

    .trade-table tbody tr > td:nth-child(6) {
        font-size: 11px;
        line-height: 1.4;
    }

    .trade-table tbody tr > td:nth-child(2)::before,
    .trade-table tbody tr > td:nth-child(3)::before,
    .trade-table tbody tr > td:nth-child(4)::before,
    .trade-table tbody tr > td:nth-child(5)::before {
        font-size: 10px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 1.31rem;
    }

    .hero p {
        font-size: 13px;
    }

    .badge-text {
        font-size: 10px;
    }

    .panel-head h2 {
        font-size: 0.97rem;
    }

    .trade-table tbody tr > td:first-child {
        font-size: 11px;
    }

    .trade-table tbody tr > td:nth-child(6) {
        font-size: 10px;
    }
}

/* Layout polish */
.panel {
    border-radius: 15px;
    padding: 15px;
}

.panel-head {
    align-items: flex-start;
    gap: 12px;
}

.panel-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.search-toolbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
}

.table-wrap {
    border: 1px solid #e3edf8;
    border-radius: 12px;
    background: #fff;
}

.trade-table th,
.trade-table td {
    vertical-align: middle;
}

@media (max-width: 992px) {
    .panel {
        padding: 13px;
    }
}

@media (max-width: 768px) {
    .panel {
        padding: 12px;
    }

    .table-wrap {
        border-radius: 10px;
    }
}

@media (max-width: 576px) {
    .panel {
        padding: 10px;
    }

    .search-toolbar {
        grid-template-columns: 1fr;
    }
}

/* MOBILE_MARKET_CARD_TEXT_SCALE_110 */
@media (max-width: 768px) {
    .trade-table tbody tr > td:first-child {
        font-size: 13.2px !important;
        line-height: 1.42 !important;
    }

    .trade-table tbody tr > td:nth-child(2),
    .trade-table tbody tr > td:nth-child(3),
    .trade-table tbody tr > td:nth-child(4),
    .trade-table tbody tr > td:nth-child(5) {
        font-size: 13.2px !important;
        line-height: 1.35 !important;
    }

    .trade-table tbody tr > td:nth-child(2)::before,
    .trade-table tbody tr > td:nth-child(3)::before,
    .trade-table tbody tr > td:nth-child(4)::before,
    .trade-table tbody tr > td:nth-child(5)::before {
        font-size: 11px !important;
    }

    .trade-table tbody tr > td:nth-child(6) {
        font-size: 12.1px !important;
        line-height: 1.4 !important;
    }
}

@media (max-width: 576px) {
    .trade-table tbody tr > td:first-child {
        font-size: 12.1px !important;
        line-height: 1.4 !important;
    }

    .trade-table tbody tr > td:nth-child(2),
    .trade-table tbody tr > td:nth-child(3),
    .trade-table tbody tr > td:nth-child(4),
    .trade-table tbody tr > td:nth-child(5) {
        font-size: 12.1px !important;
        line-height: 1.33 !important;
    }

    .trade-table tbody tr > td:nth-child(2)::before,
    .trade-table tbody tr > td:nth-child(3)::before,
    .trade-table tbody tr > td:nth-child(4)::before,
    .trade-table tbody tr > td:nth-child(5)::before {
        font-size: 10px !important;
    }

    .trade-table tbody tr > td:nth-child(6) {
        font-size: 11px !important;
    }
}

/* Market table: robust column mapping/alignment */
@media (min-width: 769px) {
    .trade-table {
        table-layout: auto !important;
    }

    .trade-table td[data-col="fish"] {
        min-width: 220px;
        color: #0f172a !important;
        position: relative;
        z-index: 1;
        overflow: visible;
    }

    .trade-table td[data-col="fish"] .market-fish-inline {
        display: flex !important;
        align-items: center;
        gap: 8px;
        min-width: 0;
        white-space: nowrap;
    }

    .trade-table td[data-col="fish"] .market-fish-name {
        display: inline !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: inherit !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.trade-table th:nth-child(1),
.trade-table td:nth-child(1) { width: 28%; }
.trade-table th:nth-child(2),
.trade-table td:nth-child(2) { width: 12%; }
.trade-table th:nth-child(3),
.trade-table td:nth-child(3) { width: 12%; }
.trade-table th:nth-child(4),
.trade-table td:nth-child(4) { width: 12%; }
.trade-table th:nth-child(5),
.trade-table td:nth-child(5) { width: 12%; }
.trade-table th:nth-child(6),
.trade-table td:nth-child(6) { width: 14%; }
.trade-table th:nth-child(7),
.trade-table td:nth-child(7) { width: 10%; }

.trade-table td:nth-child(7) {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .trade-table td[data-col="fish"] { grid-area: fish !important; min-width: 0; align-self: center; }
    .trade-table td[data-col="avg"] { grid-area: avg !important; }
    .trade-table td[data-col="recent"] { grid-area: recent !important; }
    .trade-table td[data-col="max"] { grid-area: max !important; }
    .trade-table td[data-col="volume"] { grid-area: volume !important; }
    .trade-table td[data-col="date"] { grid-area: date !important; }
    .trade-table td[data-col="share"] {
        grid-area: share !important;
        justify-self: end;
        align-self: center;
    }

    .trade-table tbody tr > td:nth-child(1) { grid-area: fish !important; min-width: 0; }
    .trade-table tbody tr > td:nth-child(2) { grid-area: avg !important; }
    .trade-table tbody tr > td:nth-child(3) { grid-area: recent !important; }
    .trade-table tbody tr > td:nth-child(4) { grid-area: max !important; }
    .trade-table tbody tr > td:nth-child(5) { grid-area: volume !important; }
    .trade-table tbody tr > td:nth-child(6) { grid-area: date !important; }
    .trade-table tbody tr > td:nth-child(7) {
        grid-area: share !important;
        justify-self: end;
        align-self: center;
    }
}

/* FINAL_LOCK_20260303_END: Market page mobile stability */
@media (max-width: 768px) {
    .ft-market .trade-table thead { display: none !important; }
    .ft-market .trade-table tbody,
    .ft-market .trade-table tr,
    .ft-market .trade-table td { display: block !important; width: 100% !important; }
    .ft-market .trade-table tbody tr {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-template-areas: "fish fish fish share" "avg recent volume max" "date date date date" !important;
        gap: 6px 8px !important;
        padding: 8px 10px !important;
        margin: 0 0 8px !important;
        border: 1px solid #dbe7f3 !important;
        border-radius: 12px !important;
        background: #fff !important;
    }
    .ft-market .trade-table td { min-width: 0 !important; padding: 0 !important; border: 0 !important; }
    .ft-market .trade-table td::before { content: none !important; }
    .ft-market .trade-table td[data-col="fish"] { grid-area: fish !important; }
    .ft-market .trade-table td[data-col="avg"] { grid-area: avg !important; }
    .ft-market .trade-table td[data-col="recent"] { grid-area: recent !important; }
    .ft-market .trade-table td[data-col="max"] { grid-area: max !important; }
    .ft-market .trade-table td[data-col="volume"] { grid-area: volume !important; }
    .ft-market .trade-table td[data-col="date"] { grid-area: date !important; }
    .ft-market .trade-table td[data-col="share"] { grid-area: share !important; }
}
