:root {
    --bg: #f5f6fa;
    --card: #ffffff;
    --ink: #1f2430;
    --muted: #5b6472;
    --line: #e2e5ee;
    --accent: #4f46e5;
    --accent-ink: #ffffff;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--accent); }

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #1c2030;
    color: #f4f5fb;
}

.app-titles h1 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}

.app-titles p {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: #b4b9cc;
}

.app-titles a { color: #b9b2ff; }

.app-source {
    color: #cfd2e6;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid #3a4059;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
}

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(20, 24, 40, 0.04);
}

.card-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.card-header p {
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.toolbar .group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.toolbar .label {
    min-width: 6.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.btn {
    border: 1px solid var(--line);
    background: #f2f3f8;
    color: var(--ink);
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn:hover { background: #e8eaf3; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover { background: #4038c9; }

.input {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    width: 11rem;
}

.input-narrow { width: 5rem; }

.readout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 0 0 0.75rem;
}

.readout dt {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.readout dd {
    margin: 0.15rem 0 0;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 60ch;
}

.status {
    margin: 0;
    padding: 0.5rem 0.75rem;
    background: #eef0fb;
    border: 1px solid #dfe2f4;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #363b52;
}

.editor-card { padding: 0; overflow: hidden; }

#editor {
    height: 460px;
    width: 100%;
}

/* Range markers added from the toolbar (EditSession.addMarker). */
.demo-marker {
    position: absolute;
    background: rgba(79, 70, 229, 0.28);
    border-bottom: 1px solid rgba(79, 70, 229, 0.7);
}

/* Gutter decoration added from the toolbar (EditSession.addGutterDecoration). */
.demo-gutter {
    background: #ffe9a8;
    border-left: 3px solid #f0b429;
}
