.kg-stories[hidden] { display: none !important; }
.kg-stories { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px; box-sizing: border-box; background: #15151e; color: #fff; direction: rtl; font-family: var(--kg-font,inherit); }
.kg-story-shell { display: flex; flex-direction: column; width: min(100%,440px); height: min(900px,calc(100dvh - 32px)); min-height: 0; border-radius: 30px; overflow: hidden; background: radial-gradient(ellipse at 20% 25%, color-mix(in srgb,var(--kg-primary) 40%,#252431),#1d1d28 65%); border: 1px solid #ffffff1f; box-shadow: 0 28px 90px #0006; }
.kg-story-shell:focus { outline: none; }
.kg-story-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px 10px; flex-shrink: 0; }
.kg-story-brand { font-size: 1rem; font-weight: 800; }
.kg-story-brand small { display: block; font-size: .68rem; font-weight: 400; color: #d2ced8; margin-top: 2px; }
.kg-story-tools { display: flex; gap: 8px; }
.kg-stories button { font: inherit; border: 0; cursor: pointer; color: #fff; }
.kg-story-tools button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #ffffff12; font: 22px/1 sans-serif; }
.kg-story-tools .kg-story-pause { font-size: 16px; }
.kg-stories button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.kg-story-bars { display: flex; gap: 5px; margin: 0 20px; flex-shrink: 0; }
.kg-story-bars > span { flex: 1; height: 3px; background: #ffffff2b; border-radius: 8px; overflow: hidden; }
.kg-story-bars i { display: block; width: 100%; height: 100%; background: #fff; transform-origin: right; transform: scaleX(0); }
.kg-story-visual { flex: 1; min-height: 100px; position: relative; display: flex; justify-content: center; padding: 18px 20px 4px; overflow: hidden; }
.kg-story-device { position: relative; min-height: 0; height: 100%; width: min(88%,300px); display: flex; justify-content: center; border-radius: 24px; overflow: hidden; box-shadow: 0 14px 30px #0005; }
.kg-story-image { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: top; border-radius: 22px; }
.kg-story-image[hidden], .kg-story-image-error[hidden] { display: none; }
.kg-story-image-error { padding: 25px; align-self: center; text-align: center; font-size: .9rem; line-height: 1.9; }
.kg-story-glow { position: absolute; inset: 10% 5%; background: radial-gradient(ellipse,color-mix(in srgb,var(--kg-primary) 35%,transparent),transparent 65%); animation: kg-story-glow 6s ease-in-out infinite alternate; }
.kg-story-tag { position: absolute; bottom: 10px; right: 22px; padding: 6px 14px; border-radius: 30px; background: #fff; color: #38303f; font-size: .74rem; font-weight: 750; box-shadow: 0 6px 18px #0003; }
.kg-story-caption { padding: 12px 22px 20px; flex-shrink: 0; }
.kg-story-counter { font-size: .72rem; color: #c5c0d0; }
.kg-story-caption h2 { font-size: clamp(1.2rem,4.8vw,1.6rem); line-height: 1.5; color: #fff; margin: 6px 0 8px; }
.kg-story-caption p { font-size: .86rem; line-height: 1.9; color: #e0dce6; margin: 0 0 16px; }
.kg-story-actions { display: flex; align-items: center; gap: 12px; }
.kg-story-actions button { padding: 12px 18px; border-radius: 14px; font-weight: 750; }
.kg-story-actions .kg-story-next { flex: 1; background: #fff; color: #302838; display: flex; align-items: center; justify-content: center; gap: 16px; }
.kg-story-prev { background: #ffffff12; }
.kg-story-prev:disabled { opacity: .3; cursor: default; }
.kg-story-hint { display: block; color: #b9b2c5; font-size: .62rem; text-align: center; margin-top: 12px; }
.kg-tour-replay { display: block; margin: 24px auto 0; padding: 13px 24px; background: var(--kg-cream); color: var(--kg-primary-deep); border: 1px solid var(--kg-primary-soft); border-radius: 16px; font: inherit; cursor: pointer; }
.is-paused .kg-story-glow { animation-play-state: paused; }
@keyframes kg-story-glow { from { opacity: .45; transform: scale(.94); } to { opacity: 1; transform: scale(1.08); } }
@media (max-width:480px) { .kg-stories { padding: 0; } .kg-story-shell { height: 100dvh; width: 100%; border: 0; border-radius: 0; padding-block: env(safe-area-inset-top) env(safe-area-inset-bottom); box-sizing: border-box; } }
@media (max-height:580px) and (min-width:600px) { .kg-story-shell { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr; width: min(900px,100%); } .kg-story-top,.kg-story-bars { grid-column: 1 / -1; } .kg-story-visual { grid-column: 2; grid-row: 3; } .kg-story-caption { grid-column: 1; grid-row: 3; align-self: center; } }
@media (prefers-reduced-motion:reduce) { .kg-stories *, .kg-stories *::before, .kg-stories *::after { animation: none !important; transition: none !important; } }
