:root,
body.theme-crimson {
    color-scheme: light;
    --ink: #101010;
    --muted: #5f6368;
    --line: #ded7d5;
    --surface: #ffffff;
    --soft: #f7f5f4;
    --teal: #e63228;
    --teal-dark: #a91414;
    --gold: #e63228;
    --rose: #c51f2f;
    --danger: #9f1239;
    --focus: #e63228;
    --shadow: 0 16px 38px rgba(16, 16, 16, 0.09);
    --brand: var(--teal);
    --brand-dark: var(--teal-dark);
    --text: var(--ink);
    --success-soft: #fff1ef;
    --success-line: #f4b8b1;
    --warning-soft: #fff8e7;
    --warning-line: #e8c878;
    --danger-soft: #fff0f3;
    --danger-line: #e8a1ad;
    --control-line: #d4cbc8;
    --disabled-surface: #eee9e7;
    --disabled-text: #706966;
    --app-logo-size: 48px;
    --app-logo-max-width: 180px;
    --app-logo-max-height: 48px;
    --organisation-logo-header-max-width: 180px;
    --organisation-logo-header-max-height: 52px;
    --organisation-logo-auth-max-width: 220px;
    --organisation-logo-auth-max-height: 64px;
}

html {
    background: var(--soft);
}

body.theme-crimson {
    background:
        linear-gradient(180deg, #ffffff 0, #faf8f7 340px),
        var(--soft);
}

.theme-crimson a {
    color: var(--teal-dark);
}

.theme-crimson .site-header,
.theme-crimson .site-footer {
    background: rgba(255, 255, 255, 0.98);
    border-color: #e7dfdc;
}

.theme-crimson .site-header {
    box-shadow: 0 8px 24px rgba(16, 16, 16, 0.08);
}

.theme-crimson .brand {
    color: #050505;
}

.theme-crimson .brand strong {
    color: #050505;
    font-size: 1.46rem;
    font-weight: 900;
}

.theme-crimson .brand-logo,
.theme-crimson .organisation-logo,
.theme-crimson .header-user-icon {
    filter: drop-shadow(0 8px 18px rgba(230, 50, 40, 0.13));
}

.theme-crimson .organisation-card strong,
.theme-crimson .footer-org strong {
    color: #050505;
}

.theme-crimson .page-shell {
    margin-top: 32px;
}

.theme-crimson .form-card,
.theme-crimson .panel,
.theme-crimson .admin-card,
.theme-crimson .permission-row,
.theme-crimson .form-gallery-card,
.theme-crimson .recipient-card,
.theme-crimson .recipient-form-card,
.theme-crimson .permission-group-card,
.theme-crimson .permission-summary,
.theme-crimson .permission-assignment-row,
.theme-crimson .submission-panel,
.theme-crimson .media-card,
.theme-crimson .config-section,
.theme-crimson .template-stage,
.theme-crimson .template-ai-panel,
.theme-crimson .template-outline-panel,
.theme-crimson .modal-panel {
    border-color: var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.theme-crimson .admin-shell > .panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.theme-crimson .form-card:hover,
.theme-crimson .form-card:focus-visible,
.theme-crimson .form-gallery-card:hover,
.theme-crimson .recipient-card:hover,
.theme-crimson .recipient-card:focus-visible,
.theme-crimson .submission-panel:hover,
.theme-crimson .submission-panel:focus-visible,
.theme-crimson .submission-file-list a:hover,
.theme-crimson .submission-file-list a:focus-visible {
    border-color: var(--teal);
    background: #fffdfc;
    box-shadow: 0 18px 42px rgba(169, 20, 20, 0.12);
}

.theme-crimson .button {
    border-color: var(--teal);
    background: linear-gradient(180deg, #f04a3f, #d72f25);
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(230, 50, 40, 0.2);
}

.theme-crimson .button:hover,
.theme-crimson .button:focus-visible {
    border-color: var(--teal-dark);
    background: linear-gradient(180deg, #d9352c, #a91414);
}

.theme-crimson .button-secondary {
    background: #ffffff;
    color: var(--teal-dark);
    box-shadow: none;
}

.theme-crimson .button-secondary:hover,
.theme-crimson .button-secondary:focus-visible {
    background: #fff3f1;
    color: var(--teal-dark);
}

.theme-crimson .button-danger {
    border-color: var(--danger-line);
    background: #ffffff;
    color: var(--danger);
    box-shadow: none;
}

.theme-crimson input,
.theme-crimson select,
.theme-crimson textarea,
.theme-crimson .code-editor,
.theme-crimson .signature-pad canvas {
    border-color: var(--control-line);
    background: #ffffff;
}

.theme-crimson input:focus,
.theme-crimson select:focus,
.theme-crimson textarea:focus,
.theme-crimson input[type="checkbox"]:focus,
.theme-crimson input[type="radio"]:focus {
    border-color: var(--focus);
    outline-color: rgba(230, 50, 40, 0.18);
}

.theme-crimson input:disabled,
.theme-crimson select:disabled,
.theme-crimson textarea:disabled,
.theme-crimson input[type="checkbox"]:disabled,
.theme-crimson input[type="radio"]:disabled {
    border-color: #ddd5d2;
    background-color: var(--disabled-surface);
    color: var(--disabled-text);
}

.theme-crimson input[type="checkbox"],
.theme-crimson input[type="radio"] {
    border-color: #bdb2ae;
    background-color: #ffffff;
}

.theme-crimson input[type="checkbox"]:hover:not(:disabled),
.theme-crimson input[type="radio"]:hover:not(:disabled) {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(230, 50, 40, 0.12);
}

.theme-crimson input[type="checkbox"]:checked,
.theme-crimson input[type="checkbox"]:indeterminate,
.theme-crimson input[type="radio"]:checked {
    border-color: var(--teal-dark);
    background-color: var(--teal);
}

.theme-crimson .user-chip,
.theme-crimson .status-pill.enabled,
.theme-crimson .flash,
.theme-crimson .wizard-preview-note,
.theme-crimson .tabs a.active,
.theme-crimson .subtabs a.active,
.theme-crimson .permission-group-card.active,
.theme-crimson .recipient-form-card.active,
.theme-crimson .recipient-card-tags em.enabled,
.theme-crimson .submission-panel-id,
.theme-crimson .template-current-summary,
.theme-crimson .template-validation.valid,
.theme-crimson .template-ai-result,
.theme-crimson .template-outline-status,
.theme-crimson .template-outline-page-tabs button.active,
.theme-crimson .template-stat-card.template-stat-ok,
.theme-crimson .repeater-total {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: var(--teal-dark);
}

.theme-crimson .status-pill,
.theme-crimson .recipient-card-tags em,
.theme-crimson .permission-group-tags em {
    border-color: var(--line);
    background: #ffffff;
    color: var(--muted);
}

.theme-crimson .status-pill.danger,
.theme-crimson .flash-error,
.theme-crimson .template-validation.invalid,
.theme-crimson .template-outline-status.invalid {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: #8a102a;
}

.theme-crimson .notice,
.theme-crimson .filter-banner,
.theme-crimson .template-stat-card.template-stat-warning {
    border-color: var(--warning-line);
    background: var(--warning-soft);
}

.theme-crimson .eyebrow,
.theme-crimson .formatted-preview {
    color: var(--teal-dark);
}

.theme-crimson .forms-view-filter label:not(.forms-search-filter),
.theme-crimson .public-only-toggle label,
.theme-crimson .choice-list label,
.theme-crimson .inline-choice,
.theme-crimson .display-text-field,
.theme-crimson .repeater-field,
.theme-crimson .uploaded-list,
.theme-crimson .permission-step-heading,
.theme-crimson .permission-public-note,
.theme-crimson .submission-detail-item,
.theme-crimson .media-folder-options label,
.theme-crimson .template-builder-action-bar,
.theme-crimson .template-outline-root,
.theme-crimson .template-outline-page,
.theme-crimson .template-outline-empty,
.theme-crimson .template-stat-card,
.theme-crimson .help-page pre {
    background: #fbf8f7;
    border-color: var(--line);
}

.theme-crimson .repeater-row,
.theme-crimson .template-outline-field,
.theme-crimson .form-options-box,
.theme-crimson .permission-filter-form,
.theme-crimson .media-upload-form,
.theme-crimson .media-view-options,
.theme-crimson .admin-filter-form {
    background: #ffffff;
    border-color: var(--line);
}

.theme-crimson .form-gallery-image,
.theme-crimson .form-selected-icon-preview img,
.theme-crimson .permission-assignment-icon,
.theme-crimson .submission-panel-icon,
.theme-crimson .media-preview,
.theme-crimson .media-preview-cell,
.theme-crimson .line-numbers {
    background: #f4efed;
    border-color: #e3d9d6;
}

.theme-crimson .template-progress-step {
    background: #ffffff;
    color: var(--muted);
}

.theme-crimson .template-progress-step span,
.theme-crimson .stepper span {
    background: #f4efed;
}

.theme-crimson .template-progress-step.active,
.theme-crimson .template-progress-step.done,
.theme-crimson .stepper .active span {
    border-color: var(--teal);
    background: var(--success-soft);
    color: var(--ink);
}

.theme-crimson .stepper .done span {
    background: #f7d9d5;
    color: var(--teal-dark);
}

.theme-crimson .template-mode-tabs {
    background: #f7f3f1;
}

.theme-crimson .template-mode-tabs button.active {
    background: #ffffff;
    color: var(--ink);
    box-shadow: inset 0 3px 0 var(--teal);
}

.theme-crimson .template-more-menu-panel {
    background: #ffffff;
    box-shadow: 0 18px 36px rgba(16, 16, 16, 0.16);
}

.theme-crimson .template-more-menu-panel button:hover,
.theme-crimson .template-more-menu-panel a:hover {
    background: #fff3f1;
}

.theme-crimson .template-ai-ready-title {
    color: var(--teal-dark);
}

.theme-crimson .template-ai-spinner {
    border-color: #f1d8d4;
    border-top-color: var(--teal);
}

.theme-crimson .modal-backdrop {
    background: rgba(16, 16, 16, 0.54);
}

.theme-crimson th {
    background: #f4efed;
    color: var(--ink);
}

.theme-crimson code,
.theme-crimson .media-card-body code {
    color: #3d3634;
}

