.zfg {
    --zfg-line: #dce1df;
    --zfg-text: #202a27;
    margin: 0;
    min-width: 0;
    color: var(--zfg-text);
}

.zfg-frame {
    position: relative;
    border: 1px solid var(--zfg-line);
    border-radius: 12px;
    overflow: hidden;
    background: #f7f7f6;
}

.zfg-stage {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    max-height: 560px;
    touch-action: pan-y;
    cursor: zoom-in;
}

.zfg-stage img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.zfg-step, .zfg-rotate {
    display: grid;
    place-items: center;
    min-height: 44px;
    border: 1px solid var(--zfg-line);
    border-radius: 24px;
    background: #fff;
    color: var(--zfg-text);
    cursor: pointer;
}
.zfg [hidden] { display: none; }
.zfg-step {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    font-size: 26px;
    line-height: 1;
}
.zfg-prev { left: 8px; }
.zfg-next { right: 8px; }
.zfg-rotate { padding: 5px 14px; font-size: 13px; font-weight: 700; text-align: center; }
.zfg-step:hover, .zfg-rotate:hover { background: #eef4df; }
.zfg-caption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-block: 8px; font-size: 13px; }
.zfg-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 3px; margin-inline: -3px; }
.zfg-thumb {
    position: relative;
    display: block;
    flex: 0 0 clamp(48px, 13vw, 68px);
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--zfg-line);
    border-radius: 8px;
    background: #fafafa;
}
.zfg-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.zfg-thumb[aria-current] { border-color: #557018; box-shadow: inset 0 0 0 1px #557018; }
.zfg-thumb span { position: absolute; bottom: 2px; right: 3px; border-radius: 4px; background: #fff; color: #202a27; padding: 0 4px; font-size: 11px; font-weight: 700; }
.zfg-note { margin: 8px 0 0; font-size: 12px; line-height: 1.4; }
.zfg :focus-visible { outline: 2px solid #557018; outline-offset: 2px; }
