html, body {
    height: 100%;
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f8f9fa;
    color: #212529;
}

/* ── Header ─────────────────────────────────────────── */

.bp-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: #1a1a2e;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.bp-logo {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #e94560;
}

.bp-tagline {
    font-size: 0.85rem;
    color: #adb5bd;
}

/* ── Page shell ──────────────────────────────────────── */

.bp-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.bp-main {
    flex: 1;
    overflow: hidden;
    padding: 1rem 1.5rem;
}

/* ── Wizard ──────────────────────────────────────────── */

.bp-wizard {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bp-wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding-bottom: 0.75rem;
}

.bp-wizard-step {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.875rem;
    color: #adb5bd;
}

.bp-wizard-step--active {
    color: #0d6efd;
    font-weight: 600;
}

.bp-wizard-step--done {
    color: #198754;
}

.bp-wizard-step-num {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.bp-wizard-step--active .bp-wizard-step-num {
    background: #0d6efd;
    color: #fff;
}

.bp-wizard-step--done .bp-wizard-step-num {
    background: #198754;
    color: #fff;
}

.bp-wizard-connector {
    height: 2px;
    width: 3rem;
    background: #dee2e6;
    margin: 0 0.6rem;
    flex-shrink: 0;
}

.bp-wizard-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.bp-wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid #dee2e6;
}

/* ── Plan step ───────────────────────────────────────── */

.bp-step-plan {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-width: 870px;
    margin: 0 auto;
    width: 100%;
}

.bp-step-plan-main {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
}

.bp-step-plan-main .bp-yaml-input--fill {
    flex: 1;
    min-height: 0;
    resize: none;
    max-height: none;
}

.bp-example-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 110px;
    flex-shrink: 0;
    overflow-y: auto;
}

.bp-example-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.3;
    text-align: left;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    color: #495057;
    transition: background 0.1s, border-color 0.1s;
    width: 100%;
}

.bp-example-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

/* ── Settings step ───────────────────────────────────── */

.bp-step-settings {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* ── Output step – full log ──────────────────────────── */

.bp-step-output-log {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.bp-log--grow {
    flex: 1;
    min-height: 0;
    margin-top: 0;
}

/* ── Output step – split ─────────────────────────────── */

.bp-step-output-split {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.bp-step-output-split .bp-log {
    margin-top: 0;
    min-height: 0;
}

.bp-svg-area {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.bp-svg-area .bp-svg-page {
    flex: 1;
    min-height: 0;
}

/* ── Shared section card ─────────────────────────────── */

.bp-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
}

.bp-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    margin: 0 0 0.75rem 0;
}

/* ── Log panel ───────────────────────────────────────── */

.bp-log {
    overflow-y: auto;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.72rem;
    line-height: 1.5;
}

.bp-log-empty {
    color: #4b5563;
}

.bp-log-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.bp-log-normal { color: #d1d5db; }
.bp-log-dim    { color: #6b7280; }
.bp-log-warn   { color: #fbbf24; }

.bp-yaml-input {
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    resize: vertical;
    min-height: 220px;
    max-height: 400px;
}

.bp-error {
    font-size: 0.85rem;
    white-space: pre-wrap;
}

/* ── Output panel ────────────────────────────────────── */

.bp-output-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.bp-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0;
    margin-bottom: -2px;
}

.bp-tab {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    transition: background 0.15s;
}

.bp-tab:hover {
    background: #e9ecef;
}

.bp-tab-active {
    background: #fff;
    color: #0d6efd;
    border-color: #dee2e6;
    border-bottom-color: #fff;
    z-index: 1;
}

.bp-svg-page {
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bp-svg-page-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.bp-svg-preview {
    padding: 0.75rem;
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.bp-svg-preview svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Syntax reference panel ──────────────────────────── */

.bp-step-plan-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}

.bp-syntax-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    text-decoration: none !important;
}

.bp-syntax-btn:hover {
    color: #0d6efd !important;
}

.bp-syntax-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.bp-syntax-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

.bp-syntax-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(600px, 92vw);
    background: #fff;
    z-index: 201;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.bp-syntax-panel--open {
    transform: translateX(0);
}

.bp-syntax-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
    background: #f8f9fa;
}

.bp-syntax-panel-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.bp-syntax-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Markdown content styles (scoped to panel) */
.bp-syntax-panel-body h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #dee2e6;
}

.bp-syntax-panel-body h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #dee2e6;
    color: #343a40;
}

.bp-syntax-panel-body h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 1.1rem 0 0.4rem 0;
    color: #495057;
}

.bp-syntax-panel-body h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0.9rem 0 0.3rem 0;
    color: #6c757d;
}

.bp-syntax-panel-body p {
    margin: 0 0 0.6rem 0;
}

.bp-syntax-panel-body code {
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    padding: 0.1em 0.35em;
    color: #c7254e;
}

.bp-syntax-panel-body pre {
    background: #1e2433;
    border-radius: 6px;
    padding: 0.85rem 1rem;
    overflow-x: auto;
    margin: 0.5rem 0 0.75rem 0;
}

.bp-syntax-panel-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: #cdd9e5;
    font-size: 0.78rem;
    line-height: 1.5;
}

.bp-syntax-panel-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin: 0.5rem 0 0.75rem 0;
}

.bp-syntax-panel-body th {
    background: #f1f3f5;
    font-weight: 600;
    text-align: left;
    padding: 0.4rem 0.6rem;
    border: 1px solid #dee2e6;
    white-space: nowrap;
}

.bp-syntax-panel-body td {
    padding: 0.35rem 0.6rem;
    border: 1px solid #dee2e6;
    vertical-align: top;
}

.bp-syntax-panel-body tr:nth-child(even) td {
    background: #f8f9fa;
}

.bp-syntax-panel-body blockquote {
    border-left: 3px solid #dee2e6;
    margin: 0.5rem 0;
    padding: 0.4rem 0.75rem;
    color: #6c757d;
    font-size: 0.82rem;
}

.bp-syntax-panel-body blockquote p {
    margin: 0;
}

.bp-syntax-panel-body ul,
.bp-syntax-panel-body ol {
    padding-left: 1.5rem;
    margin: 0 0 0.5rem 0;
}

.bp-syntax-panel-body li {
    margin-bottom: 0.2rem;
}

.bp-syntax-panel-body hr {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 1.25rem 0;
}

/* ── Blazor loading / error ──────────────────────────── */

.loading-progress {
    position: relative;
    display: block;
    width: 6rem;
    height: 6rem;
    margin: 25vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #e94560;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(25vh + 3rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    border-top: 1px solid #ffc107;
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.5rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.875rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.4rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}
