:root {
    --bg-main: #0d1117;
    --bg-card: #161b22;
    --bg-hover: #1f2630;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
}

.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand h1 {
    font-size: 1.25rem;
}

.live-badge {
    background: rgba(63, 185, 80, 0.15);
    color: var(--green);
    border: 1px solid rgba(63, 185, 80, 0.4);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.index-box {
    background: var(--bg-main);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    text-align: right;
}

.index-box span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.index-box strong {
    color: var(--accent);
    font-size: 1.1rem;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.chart-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-header h2 {
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 1px;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

#selected-best-price {
    font-size: 2rem;
    font-weight: 700;
}

.variation {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.variation.up { background: rgba(63, 185, 80, 0.15); color: var(--green); }
.variation.down { background: rgba(248, 81, 73, 0.15); color: var(--red); }
.variation.neutral { background: rgba(139, 148, 158, 0.15); color: var(--text-muted); }

.meta-info {
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.meta-info strong, .meta-info code {
    color: var(--text-primary);
}

.canvas-wrapper {
    position: relative;
    height: 320px;
    width: 100%;
}

.section-title {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}

.resource-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.resource-card:hover {
    background: var(--bg-hover);
}

.resource-card.active {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.card-offers {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-price {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-avg {
    font-size: 0.8rem;
    color: var(--text-muted);
}
