:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: #172033; background: #f5f7fb; }
* { box-sizing: border-box; }
body { margin: 0; }
.demo-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 4rem; }
.demo-heading { display: flex; gap: 1rem; justify-content: space-between; align-items: end; margin-bottom: 1.5rem; }
.demo-heading h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.05em; }
.demo-heading p { max-width: 42rem; margin: .5rem 0 0; color: #5d6678; }
.mode-pill { background: #e7efff; color: #194aa6; border-radius: 999px; padding: .5rem .8rem; white-space: nowrap; }
.demo-card { background: white; border: 1px solid #e1e5ec; border-radius: 14px; padding: 1rem; box-shadow: 0 12px 35px rgb(31 48 82 / 8%); }
.demo-status { min-height: 1.5rem; margin: 1rem 0 0; color: #5d6678; }
.demo-controls { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin: .75rem 0 1rem; }
.demo-control-label { margin: 0 .25rem 0 .75rem; color: #5d6678; font-size: .85rem; }
.demo-controls .demo-control-label:first-child { margin-left: 0; }
.demo-btn { background: #eef1f6; border: 1px solid #dfe4ec; color: #172033; border-radius: 6px; padding: .3rem .7rem; cursor: pointer; font: inherit; }
.demo-btn.active { background: #194aa6; border-color: #194aa6; color: white; }
.demo-btn.primary { background: #194aa6; border-color: #194aa6; color: white; }
.demo-btn.primary:hover { background: #123f8c; }
@media (max-width: 650px) { .demo-heading { display: block; } .mode-pill { display: inline-block; margin-top: 1rem; } }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgb(15 23 42 / 45%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}
.modal {
    background: white;
    border: 1px solid #e1e5ec;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgb(31 48 82 / 25%);
    width: min(480px, 100%);
    padding: 1.25rem 1.5rem 1.5rem;
}
.modal h2 { margin: 0 0 .25rem; font-size: 1.35rem; }
.modal-range { margin: 0 0 1rem; color: #5d6678; font-size: .9rem; }
.modal-field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; font-size: .85rem; color: #5d6678; }
.modal-field input,
.modal-field textarea {
    font: inherit;
    font-size: .95rem;
    color: #172033;
    border: 1px solid #d8dde3;
    border-radius: 6px;
    padding: .45rem .6rem;
    width: 100%;
}
.modal-field textarea { min-height: 4.5rem; resize: vertical; }
.modal-field input:focus,
.modal-field textarea:focus { outline: 2px solid #194aa6; outline-offset: 1px; border-color: #194aa6; }
.modal-row { display: flex; gap: .8rem; }
.modal-row .modal-field { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

.modal-color { border: 0; padding: 0; margin: 0 0 .8rem; }
.modal-color legend { font-size: .85rem; color: #5d6678; margin-bottom: .35rem; padding: 0; }
.color-swatches { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.color-swatch {
    --swatch: #2563eb;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--swatch);
    border: 2px solid white;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgb(16 24 40 / 15%);
    transition: transform .1s ease, box-shadow .15s ease;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active {
    border-color: white;
    box-shadow: 0 0 0 2px #172033, 0 0 0 4px var(--swatch);
}
.color-custom { display: flex; align-items: center; gap: .5rem; margin-top: .65rem; font-size: .85rem; color: #5d6678; }
.color-custom input[type="color"] {
    width: 2.4rem;
    height: 1.9rem;
    padding: 2px;
    border: 1px solid #d8dde3;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}
.color-hex {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8rem;
    color: #172033;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: .6rem 3rem .7rem 1.25rem;
    background: #fff7d6;
    border-top: 1px solid #e5d9a0;
    box-shadow: 0 -1px 2px rgb(0 0 0 / 15%);
    z-index: 1000;
}
#blazor-error-ui.show { display: block; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
