.cgf-fallback {
    --cgf-accent: #5b5cf0;
    --cgf-accent-soft: color-mix(in srgb, var(--cgf-accent) 8%, transparent);
    --cgf-border: color-mix(in srgb, currentColor 13%, transparent);
    --cgf-border-strong: color-mix(in srgb, currentColor 20%, transparent);
    --cgf-muted: color-mix(in srgb, currentColor 58%, transparent);
    --cgf-surface: color-mix(in srgb, currentColor 3.5%, transparent);
    --cgf-surface-strong: color-mix(in srgb, currentColor 6%, transparent);
    container-type: inline-size;
    display: grid;
    gap: clamp(18px, 2.4vw, 30px);
    min-width: 0;
    color: inherit;
    font: inherit;
    line-height: 1.55;
}

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

.cgf-fallback-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.cgf-fallback-label {
    margin: 0;
    font-size: .72em;
    font-weight: 700;
    letter-spacing: .075em;
    line-height: 1.35;
    text-transform: uppercase;
    color: var(--cgf-muted);
}

.cgf-fallback-value {
    min-width: 0;
    overflow-wrap: anywhere;
}

.cgf-fallback-value > :first-child { margin-top: 0; }
.cgf-fallback-value > :last-child { margin-bottom: 0; }

.cgf-fallback-richtext > :first-child { margin-top: 0; }
.cgf-fallback-richtext > :last-child { margin-bottom: 0; }

.cgf-fallback-inline-link {
    color: inherit;
    text-decoration-color: color-mix(in srgb, currentColor 36%, transparent);
    text-underline-offset: .18em;
}

.cgf-fallback-section-card {
    min-width: 0;
    padding: clamp(16px, 2.2vw, 24px);
    border: 1px solid var(--cgf-border);
    border-radius: 16px;
    background: var(--cgf-surface);
}

.cgf-fallback-section-card--tab {
    display: grid;
    gap: 18px;
}

.cgf-fallback-section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--cgf-border);
}

.cgf-fallback-section-kicker,
.cgf-fallback-layout-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--cgf-accent-soft);
    color: var(--cgf-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cgf-fallback-section-title {
    margin: 0;
    font: inherit;
    font-size: clamp(1rem, 2cqi, 1.2rem);
    font-weight: 700;
    letter-spacing: -.015em;
}

.cgf-fallback-help {
    margin: 0;
    color: var(--cgf-muted);
    font-size: .9em;
}

.cgf-fallback-section-card--accordion {
    padding: 0;
    overflow: clip;
}

.cgf-fallback-section-card--accordion > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.cgf-fallback-section-card--accordion > summary::-webkit-details-marker { display: none; }
.cgf-fallback-section-card--accordion > summary::before {
    content: "+";
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 999px;
    background: var(--cgf-accent-soft);
    color: var(--cgf-accent);
    font-weight: 800;
    line-height: 1;
}
.cgf-fallback-section-card--accordion[open] > summary::before { content: "−"; }

.cgf-fallback-section-body {
    display: grid;
    gap: 18px;
    padding: 0 18px 18px;
}

.cgf-fallback-image {
    display: block;
    width: auto;
    max-width: min(100%, 360px);
    height: auto;
    max-height: 380px;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 1px 0 var(--cgf-border);
}

.cgf-fallback-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(135px, 100%), 1fr));
    gap: 10px;
}

.cgf-fallback-gallery-item {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--cgf-border);
    border-radius: 12px;
    background: var(--cgf-surface);
}

.cgf-fallback-gallery .cgf-fallback-image {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
}

.cgf-fallback-link,
.cgf-fallback-file {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--cgf-border-strong);
    border-radius: 10px;
    background: var(--cgf-surface);
    color: inherit;
    text-decoration: none;
}

.cgf-fallback-link:hover,
.cgf-fallback-file:hover {
    border-color: color-mix(in srgb, var(--cgf-accent) 50%, var(--cgf-border));
    background: var(--cgf-accent-soft);
}

.cgf-fallback-file-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 8px;
    background: var(--cgf-accent-soft);
    color: var(--cgf-accent);
    font-weight: 800;
}

.cgf-fallback-file-copy {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.cgf-fallback-file-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cgf-fallback-file-copy span {
    margin-top: 3px;
    color: var(--cgf-muted);
    font-size: .76em;
    font-weight: 700;
    letter-spacing: .06em;
}

.cgf-fallback-status,
.cgf-fallback-chip,
.cgf-fallback-user {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid var(--cgf-border);
    border-radius: 999px;
    background: var(--cgf-surface);
    line-height: 1.2;
}

.cgf-fallback-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}

.cgf-fallback-status.is-yes { color: #18864b; }
.cgf-fallback-status.is-no { color: var(--cgf-muted); }

.cgf-fallback-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.cgf-fallback-chips--terms .cgf-fallback-chip {
    border-color: color-mix(in srgb, var(--cgf-accent) 22%, var(--cgf-border));
    background: var(--cgf-accent-soft);
}

.cgf-fallback-user-avatar {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--cgf-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.cgf-fallback-color {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.cgf-fallback-swatch {
    width: 30px;
    height: 30px;
    border: 1px solid var(--cgf-border-strong);
    border-radius: 8px;
    background: var(--cgf-swatch);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 25%, transparent);
}

.cgf-fallback-color code {
    padding: 0;
    background: none;
    color: inherit;
    font: inherit;
}

.cgf-fallback-time { font-variant-numeric: tabular-nums; }

.cgf-fallback-complex,
.cgf-fallback-repeater,
.cgf-fallback-flex {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.cgf-fallback-group {
    padding: clamp(14px, 2cqi, 20px);
    border: 1px solid var(--cgf-border);
    border-left: 3px solid color-mix(in srgb, var(--cgf-accent) 52%, transparent);
    border-radius: 13px;
    background: var(--cgf-surface);
}

.cgf-fallback-row,
.cgf-fallback-layout {
    display: grid;
    gap: 16px;
    min-width: 0;
    padding: clamp(14px, 2.3cqi, 20px);
    border: 1px solid var(--cgf-border);
    border-radius: 14px;
    background: var(--cgf-surface);
}

.cgf-fallback-card-head {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--cgf-border);
}

.cgf-fallback-index {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 8px;
    background: var(--cgf-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.cgf-fallback-card-title {
    min-width: 0;
    overflow: hidden;
    font-size: .9em;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cgf-fallback-card-count {
    margin-left: auto;
    color: var(--cgf-muted);
    font-size: .75em;
    font-variant-numeric: tabular-nums;
}

.cgf-fallback-entity-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cgf-fallback-entity-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.cgf-fallback-entity-list a {
    color: inherit;
    text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
    text-underline-offset: .18em;
}

.cgf-fallback-entity-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 999px;
    background: var(--cgf-accent);
}

.cgf-fallback a { overflow-wrap: anywhere; }

.cgf-fallback-depth-2 .cgf-fallback-group,
.cgf-fallback-depth-3 .cgf-fallback-group,
.cgf-fallback-depth-4 .cgf-fallback-group,
.cgf-fallback-depth-5 .cgf-fallback-group,
.cgf-fallback-depth-6 .cgf-fallback-group {
    background: transparent;
}

@container (min-width: 660px) {
    .cgf-fallback > .cgf-fallback-field:not(.cgf-fallback-field--complex),
    .cgf-fallback > .cgf-fallback-section-card > .cgf-fallback-field:not(.cgf-fallback-field--complex),
    .cgf-fallback-section-body > .cgf-fallback-field:not(.cgf-fallback-field--complex) {
        grid-template-columns: minmax(135px, .34fr) minmax(0, 1fr);
        gap: 16px;
        align-items: start;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--cgf-border);
    }

    .cgf-fallback > .cgf-fallback-field:not(.cgf-fallback-field--complex):last-child,
    .cgf-fallback > .cgf-fallback-section-card > .cgf-fallback-field:not(.cgf-fallback-field--complex):last-child,
    .cgf-fallback-section-body > .cgf-fallback-field:not(.cgf-fallback-field--complex):last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .cgf-fallback > .cgf-fallback-field:not(.cgf-fallback-field--complex) > .cgf-fallback-label,
    .cgf-fallback > .cgf-fallback-section-card > .cgf-fallback-field:not(.cgf-fallback-field--complex) > .cgf-fallback-label,
    .cgf-fallback-section-body > .cgf-fallback-field:not(.cgf-fallback-field--complex) > .cgf-fallback-label {
        padding-top: .18em;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .cgf-fallback-link,
    .cgf-fallback-file { transition: background-color .16s ease, border-color .16s ease; }
}
