:root {
    color-scheme: dark;
    --background: #111715;
    --background-elevated: #1a2320;
    --background-strong: #202b27;
    --background-soft: #293430;
    --surface-raised: var(--background-elevated);
    --surface-border: rgba(202, 214, 205, 0.12);
    --surface-border-strong: rgba(202, 214, 205, 0.2);
    --text-primary: #edf3ef;
    --text-secondary: #a8b4ad;
    --text-muted: #94a09a;
    --accent: #c38e38;
    --accent-strong: #e2ad57;
    --success: #4f9d69;
    --warning: #d6a046;
    --danger: #c56a55;
    --info: #5e8eb7;
    --font-display: "DM Serif Text", Georgia, serif;
    --font-mono: "JetBrains Mono", Consolas, "Lucida Console", monospace;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    --radius-large: 28px;
    --radius-medium: 18px;
    --radius-small: 12px;
    --page-width-wide: 1320px;
    --page-width-working: 1460px;
}

html,
body {
    margin: 0;
    min-height: 100%;
    width: 100%;
    max-width: 100%;
    font-family: "DM Sans", system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(195, 142, 56, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(89, 122, 94, 0.16), transparent 22%),
        linear-gradient(180deg, #0f1412 0%, #121917 100%);
    color: var(--text-primary);
}

body {
    min-height: 100vh;
    overflow-x: clip;
}

* {
    box-sizing: border-box;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 2px solid rgba(226, 173, 87, 0.55);
    outline-offset: 2px;
}

button,
input,
select,
textarea {
    font: inherit;
    max-width: 100%;
}

button {
    cursor: pointer;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-small);
    background: rgba(13, 18, 16, 0.65);
    color: var(--text-primary);
    padding: 0.9rem 1rem;
}

textarea {
    min-height: 6rem;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(226, 173, 87, 0.2);
    border-color: rgba(226, 173, 87, 0.7);
}

label {
    display: grid;
    gap: 0.6rem;
    color: var(--text-secondary);
}

/* Only style the first direct-child span — the field label text.
   Excludes toggle-field labels whose text is not wrapped in a span,
   and avoids accidentally styling spans nested deeper in label content. */
label > span:first-child {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p,
strong,
span,
a,
button,
summary {
    overflow-wrap: anywhere;
}

#app {
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.public-panel,
.landing-shell,
.landing-header,
.landing-hero,
.landing-section-grid,
.landing-section-sidebar,
.landing-workflow-grid,
.landing-product-frame,
.landing-product-stage,
.landing-product-columns,
.landing-product-card,
.app-shell,
.app-main,
.app-content,
.app-topbar,
.topbar-leading,
.page-header,
.page-actions,
.action-row,
.panel,
.detail-card,
.panel-header,
.content-grid-wide,
.two-column-grid,
.three-column-grid,
.metric-grid,
.detail-grid,
.stack-row,
.stack-row-button,
.selection-row,
.builder-tree-header,
.table-card {
    min-width: 0;
}

.public-footer,
.public-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    justify-content: center;
}

.initial-loader,
.loading-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    min-height: 220px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 999px;
    border: 2px solid rgba(237, 243, 239, 0.15);
    border-top-color: var(--accent-strong);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    from {
        background-position: -200% 0;
    }

    to {
        background-position: 200% 0;
    }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 1rem 1rem 1rem;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-small);
    background: rgba(197, 106, 85, 0.95);
    color: white;
    z-index: 1000;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    margin-left: 1rem;
    color: white;
}

