/* Advanced field renderers: still document-fit, full-width and without cards or footers. */
.gfr--widget {
    display: block;
    width: 100%;
    max-width: none;
}

.gfr-widget__host,
.gfr-widget__host.galgo-widget-host {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.gfr-asset {
    display: grid;
    width: 100%;
    max-width: none;
    gap: 7px;
    align-items: start;
}

.gfr-asset iframe,
.gfr-asset video {
    display: block;
    width: 100%;
    height: min(var(--gfr-asset-height, 260px), 70vh);
    margin: 0;
    border: 0;
    border-radius: var(--gfr-radius-sm);
    background: var(--gfr-surface-soft);
    object-fit: contain;
}

.gfr-asset img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(var(--gfr-asset-image-max-height, 720px), 70vh);
    margin: 0;
    border: 0;
    border-radius: var(--gfr-radius-sm);
    background: var(--gfr-surface-soft);
    object-fit: contain;
}

.gfr-asset audio {
    display: block;
    width: min(100%, 640px);
    min-height: 42px;
}

.gfr--cell.gfr-asset img,
.gfr--cell.gfr-asset video {
    width: 84px;
    height: 52px;
}

.gfr--cell.gfr-asset iframe {
    display: none;
}

.gfr-asset__fallback {
    color: var(--gfr-muted);
    font-size: .88em;
    font-weight: 550;
}

.gfr-elapsed {
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    color: var(--gfr-tone);
    font-variant-numeric: tabular-nums lining-nums;
}

.gfr-elapsed__content {
    display: inline-flex;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px 6px;
}

.gfr-elapsed__label {
    color: var(--gfr-muted);
    font-size: .82em;
    font-weight: 600;
}

.gfr-elapsed__value {
    color: var(--gfr-ink);
    font-size: 1.08em;
    font-weight: 750;
    letter-spacing: -.012em;
}

.gfr-elapsed__unit {
    color: var(--gfr-muted);
    font-size: .86em;
    font-weight: 600;
}

.gfr-elapsed__threshold {
    overflow: hidden;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--gfr-tone-soft);
    color: var(--gfr-tone);
    font-size: .76em;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gfr-elapsed--invalid {
    color: var(--gfr-danger);
    font-size: .88em;
    font-weight: 650;
}

.gfr-elapsed--empty {
    color: var(--gfr-muted);
    font-size: .88em;
    font-weight: 600;
}

@media (max-width: 560px) {
    .gfr-asset iframe,
    .gfr-asset video {
        height: min(var(--gfr-asset-height, 220px), 56vh);
    }

    .gfr-asset img {
        height: auto;
        max-height: min(var(--gfr-asset-image-max-height, 720px), 56vh);
    }
}

@media print {
    .gfr-asset iframe,
    .gfr-asset audio,
    .gfr-asset video {
        display: none;
    }

    .gfr-asset img {
        width: 100%;
        height: auto;
        max-height: 55mm;
    }

    .gfr-elapsed__threshold {
        border: 1px solid currentColor;
    }
}

/* Native players and attachment links need the same visible keyboard focus
 * as primitive field actions, including within clipped document cells. */
.gfr-asset :is(a[href], audio, video, iframe):focus-visible {
    outline: 2px solid var(--gfr-focus);
    outline-offset: -2px;
}

.gfr-elapsed__content {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Keep the full threshold available in detail/mini views at narrow widths;
 * repeated cells retain their intentionally compact presentation. */
.gfr-elapsed:not(.gfr--cell) .gfr-elapsed__threshold {
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (forced-colors: active) {
    .gfr-asset :is(a[href], audio, video, iframe):focus-visible {
        outline-color: Highlight;
    }
}
