:root {
    color-scheme: dark;
    --fc-bg: var(--fc-theme-page, #071426);
    --fc-bg-deep: var(--fc-theme-page, #020817);
    --fc-panel: var(--fc-theme-surface, rgba(15, 35, 62, 0.94));
    --fc-panel-soft: var(--fc-theme-surface-muted, rgba(17, 39, 68, 0.72));
    --fc-input: var(--fc-theme-surface-muted, rgba(2, 8, 23, 0.78));
    --fc-text: var(--fc-theme-ink, #edf5ff);
    --fc-muted: var(--fc-theme-ink-muted, #aebed3);
    --fc-line: color-mix(in srgb, var(--fc-theme-border, #a0ccff) 22%, transparent);
    --fc-primary: var(--fc-theme-primary, #55a2ff);
    --fc-primary-hover: var(--fc-theme-primary-hover, #83baff);
    --fc-primary-soft: var(--fc-theme-primary-soft, #172f4d);
    --fc-secondary: var(--fc-theme-secondary, #72e8f5);
    --fc-secondary-hover: var(--fc-theme-secondary-hover, #a3f1f8);
    --fc-secondary-soft: var(--fc-theme-secondary-soft, #12333f);
    --fc-tertiary: var(--fc-theme-tertiary, #7de3ac);
    --fc-tertiary-hover: var(--fc-theme-tertiary-hover, #a6f0c5);
    --fc-tertiary-soft: var(--fc-theme-tertiary-soft, #15392f);
    --fc-accent: var(--fc-theme-accent, #72e8f5);
    --fc-blue: var(--fc-theme-primary, #55a2ff);
    --fc-danger: var(--fc-theme-danger, #ff8b8b);
    --fc-danger-soft: var(--fc-theme-danger-soft, #481f28);
    --fc-success: var(--fc-theme-success, #7de3ac);
    --fc-success-soft: var(--fc-theme-success-soft, #15392f);
    --fc-warning: var(--fc-theme-warning, #ffc477);
    --fc-warning-soft: var(--fc-theme-warning-soft, #49351f);
    --fc-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --fc-radius: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--fc-theme-primary, #55a2ff) 15%, transparent), transparent 32rem),
        linear-gradient(135deg, var(--fc-bg-deep), var(--fc-bg) 52%, var(--fc-theme-page, #0d2340));
    color: var(--fc-text);
    font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.fc-workspace-page {
    background:
        radial-gradient(circle at 85% 0, color-mix(in srgb, var(--fc-theme-secondary, #72e8f5) 10%, transparent), transparent 34rem),
        linear-gradient(135deg, var(--fc-bg-deep), var(--fc-bg) 52%, var(--fc-theme-page, #0d2340));
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
.fc-button {
    border: 1px solid var(--fc-line);
    border-radius: 9px;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--fc-theme-primary, #1e4066) 35%, var(--fc-panel));
    color: var(--fc-text);
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

button:hover,
.fc-button:hover {
    border-color: color-mix(in srgb, var(--fc-secondary) 58%, transparent);
    background: color-mix(in srgb, var(--fc-theme-primary, #2a5684) 50%, var(--fc-panel));
}

button:active,
.fc-button:active {
    transform: translateY(1px);
}

button.primary,
.fc-button.primary {
    background: linear-gradient(100deg, color-mix(in srgb, var(--fc-primary) 65%, #2778de), color-mix(in srgb, var(--fc-secondary) 65%, #229dbd));
    border-color: transparent;
    color: #fff;
}

button.danger,
.fc-button.danger {
    background: color-mix(in srgb, var(--fc-danger) 28%, transparent);
    border-color: color-mix(in srgb, var(--fc-danger) 45%, transparent);
    color: var(--fc-danger);
}

button.subtle,
.fc-button.subtle {
    background: transparent;
    color: var(--fc-muted);
}

button:disabled,
.fc-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--fc-line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--fc-input);
    color: var(--fc-text);
}

input::placeholder,
textarea::placeholder {
    color: color-mix(in srgb, var(--fc-muted) 72%, transparent);
}

select {
    color: var(--fc-text);
    background-color: var(--fc-bg);
    color-scheme: dark;
}

select option {
    color: var(--fc-text);
    background-color: var(--fc-bg);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible,
[role="tab"]:focus-visible,
.fc-cell-value:focus-visible,
.fc-tree-toggle:focus-visible,
.fc-tree-label:focus-visible,
.fc-tree-node-row:focus-visible {
    outline: 2px solid var(--fc-accent);
    outline-offset: 2px;
}

.fc-hidden {
    display: none !important;
}

.fc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}