:root {
    --bg: #f6f6f6;
    --text: #222;
    --panel-bg: #ffffff;
    --code-bg: #f0f0f0;
    --accent: #333;
}

body.dark {
    --bg: #121212;
    --text: #e6e6e6;
    --panel-bg: #1d1d1d;
    --code-bg: #161616;
    --accent: #ddd;
}

body {
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font-family: system-ui, sans-serif;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-bg);
    padding: 15px 20px;
    border-bottom: 1px solid #4444;
}

.toolbar {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    align-items: center;
    flex-wrap: wrap;
}

button, .button {
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .button:hover {
    opacity: 0.8;
}

input[type="text"] {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #6666;
    background: var(--panel-bg);
    color: var(--text);
}

.panel {
    margin: 20px;
    background: var(--panel-bg);
    padding: 15px 20px;
    border-radius: 8px;
}

pre {
    background: var(--code-bg);
    padding: 15px;
    border-radius: 6px;
    max-height: 65vh;
    overflow: auto;
}

.collapsible {
    cursor: pointer;
    position: relative;
    padding-right: 20px;
}

.collapsible::after {
    content: "▼";
    position: absolute;
    right: 0;
    transition: transform 0.25s;
}

.collapsible.active::after {
    transform: rotate(-180deg);
}

.content {
    display: none;
    padding-top: 10px;
}

.content.open {
    display: block;
}

.highlight {
    background: #ffe08a;
    padding: 2px 4px;
    border-radius: 4px;
}

body.dark .highlight {
    background: #6b5200;
}

/* метрики */

.metrics-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.metric-card {
    flex: 1 1 150px;
    min-width: 150px;
    background: var(--code-bg);
    border-radius: 8px;
    padding: 10px 12px;
}

.metric-label {
    font-size: 12px;
    opacity: 0.8;
}

.metric-value {
    font-size: 20px;
    font-weight: 600;
    margin-top: 4px;
}

.chart-wrapper {
    max-width: 600px;
}
