/* Market chart */
body {
    font-size: 13px;
    color: #666;
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.hr {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, .1);
    margin: 8px 0;
}
.market-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 12px;
}
.market-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    width: 135px;
}
.market-form input,
.market-form button,
#toggle-trades-table {
    font: inherit;
    color: #666;
    background: #fff;
    border: 1px solid #dce1e6;
    border-radius: 4px;
}
.market-form input {
    min-width: 0;
    padding: 5px 8px;
    color: #333;
}
.market-form button {
    padding: 5px 12px;
    cursor: pointer;
}
.market-form button:hover,
#toggle-trades-table:hover {
    background: #f5f7f9;
}
.market-form input:focus-visible,
.market-form button:focus-visible,
#toggle-trades-table:focus-visible {
    outline: 2px solid #0868b0;
    outline-offset: 3px;
}
.session-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
#connection-status { font-size: 12px; }
.session-controls #reset-zoom { white-space: nowrap; }
#connection-status[data-state="live"] { color: #25845c; }
#connection-status[data-state="retry"] { color: #976000; }
#stats-since { color: #888; font-weight: normal; }
@media (max-width: 600px) {
    .market-form { flex-wrap: wrap; }
    .session-controls { flex-shrink: 1; min-width: 0; }
}
.chart {
    position: relative;
    height: 50vh;
}
.trades-header { display: flex; justify-content: space-between; align-items: center; min-height: 28px; margin-bottom: 3px; }
#toggle-trades-table { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; cursor: pointer; }
#toggle-trades-table[aria-expanded="true"] .trades-plus, #trades-table[hidden] { display: none; }
.table {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    border-collapse: separate;
    border-spacing: 0;
}
.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
}
.table tbody > tr:first-child > * { border-top: 0; }
.table-responsive {
    position: relative;
    height: 40vh;
    overflow: auto;
    border-top: .25rem solid #fff;
}
.table-responsive::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background-color: #eee;
    border: 2px solid #fff;
}
.trade-tooltip {
    position: fixed;
    z-index: 1050;
    width: 430px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    overflow: auto;
    padding: 14px 16px;
    background: #fff;
    color: #333;
    border: 1px solid #dce1e6;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    line-height: 1.5;
}
.trade-tooltip[hidden] {
    display: none;
}
.trade-side {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.trade-side.buy {
    background: #e6f3ff;
    color: #0868b0;
}
.trade-side.sell {
    background: #fff0f3;
    color: #b72547;
}
.trade-tooltip-details {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 8px 14px;
    margin: 0;
}
.trade-tooltip-details dt {
    font-weight: normal;
    color: #666;
}
.trade-tooltip-details dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
}
.trade-tooltip-details a {
    overflow-wrap: anywhere;
    word-break: break-all;
    font-family: Consolas, monospace;
    font-size: 12px;
}
.trade-tooltip-details a,
#trades-tbody a,
#stats-tbody a {
    color: #0868b0;
    text-decoration: underline;
}
#trades-tbody td {
    vertical-align: middle;
}
.trade-tooltip a:focus-visible {
    outline: 2px solid #0868b0;
    outline-offset: 3px;
}
