* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    background: #f4f5f7;
    color: #1f2937;
    font-family: Arial, "Malgun Gothic", sans-serif;
    font-size: 13px;
}

body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.demo-nav {
    margin: 0 0 14px;
    font-size: 12px;
}

.demo-nav a {
    color: #2563eb;
    text-decoration: none;
}

.demo-nav a:hover {
    text-decoration: underline;
}

h2 {
    margin: 0 0 4px;
    font-size: 17px;
}

p.desc {
    margin: 0 0 12px;
    color: #6b7280;
}

.demo-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.demo-toolbar button, .demo-toolbar select, .demo-toolbar input[type="text"], .demo-toolbar input[type="number"] {
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12.5px;
}

.demo-toolbar button {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.demo-toolbar button.secondary {
    background: #fff;
    color: #374151;
    border-color: #9ca3af;
    cursor: pointer;
}

.demo-grid {
    width: 100%;
    height: 340px;
}

.demo-grid.short {
    height: 220px;
}

.demo-chart {
    width: 100%;
    height: 340px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
}

.demo-split {
    display: flex;
    gap: 12px;
}

.demo-split > .demo-grid, .demo-split > .demo-chart {
    flex: 1 1 50%;
}

.demo-hud {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 12px;
    color: #374151;
}

.demo-hud b {
    color: #111827;
}

.demo-note {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.demo-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 11px;
    vertical-align: middle;
}

.log-panel {
    flex: 0 0 140px;
    margin-top: 16px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #111827;
    color: #d1d5db;
    padding: 8px 16px;
    overflow-y: auto;
    font-family: Consolas, monospace;
    font-size: 11.5px;
    white-space: pre-wrap;
}
