:root {
    --bg: #0f172a;
    --panel: #111827;
    --panel-2: #0b1220;
    --border: #334155;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --accent: #93c5fd;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
    --blue: #3b82f6;
    --shadow: rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 32rem),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.10), transparent 28rem),
    var(--bg);
    color: var(--text);
}

header {
    padding: 32px 24px 16px;
    max-width: 1280px;
    margin: 0 auto;
}

main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px 48px;
}

h1, h2, h3 {
    margin: 0;
}

h1 {
    font-size: 32px;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

h3 {
    font-size: 15px;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 10px;
}

p {
    color: var(--muted);
    line-height: 1.5;
}

.subhead {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 10px;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(11, 18, 32, 0.96));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 18px 40px var(--shadow);
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 16px;
    margin-bottom: 16px;
}

.signal {
    font-size: 54px;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin: 12px 0 8px;
}

.signal.buy {
    color: var(--green);
}

.signal.sell {
    color: var(--red);
}

.signal.no_trade {
    color: var(--yellow);
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.metric {
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 14px;
}

.metric .label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.metric .value {
    font-size: 22px;
    font-weight: 700;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--muted);
    font-size: 12px;
    background: rgba(15, 23, 42, 0.76);
}

.badge.buy {
    color: var(--green);
    border-color: rgba(34, 197, 94, 0.45);
}

.badge.sell {
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.45);
}

.badge.no_trade {
    color: var(--yellow);
    border-color: rgba(245, 158, 11, 0.45);
}

.section {
    margin-top: 16px;
}

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

button {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(147, 197, 253, 0.35);
    color: var(--text);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
}

button:hover {
    background: rgba(59, 130, 246, 0.22);
}

button.active {
    background: rgba(59, 130, 246, 0.42);
    border-color: rgba(147, 197, 253, 0.72);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    text-align: right;
    white-space: nowrap;
}

th:first-child, td:first-child {
    text-align: left;
}

th {
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
}

tr.clickable {
    cursor: pointer;
}

tr.clickable:hover {
    background: rgba(59, 130, 246, 0.08);
}

.table-wrap {
    overflow-x: auto;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.detail-box {
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 12px;
}

.detail-box .label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.detail-box .value {
    font-weight: 700;
}

.muted {
    color: var(--muted);
}

.error {
    color: #fecaca;
    background: rgba(127, 29, 29, 0.35);
    border: 1px solid rgba(248, 113, 113, 0.35);
    padding: 12px;
    border-radius: 12px;
}

.loading {
    color: var(--muted);
}

@media (max-width: 900px) {
    .hero,
    .grid-2,
    .grid-3 {
    grid-template-columns: 1fr;
    }

    .metric-row,
    .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .signal {
    font-size: 42px;
    }
}

@media (max-width: 520px) {
    .metric-row,
    .detail-grid {
    grid-template-columns: 1fr;
    }

    header,
    main {
    padding-left: 14px;
    padding-right: 14px;
    }
}