.stories { min-width: 0; flex: 1 1 auto; position: relative; z-index: 4; }
.stories__strip { box-sizing: border-box; display: flex; align-items: center; justify-content: flex-end; gap: 3px; width: 100%; min-height: 50px; border: 1px solid transparent; border-radius: 18px; touch-action: pan-x; user-select: none; transition: min-height .24s ease, padding .24s ease, border-color .24s ease, border-radius .24s ease, background-color .24s ease, box-shadow .18s ease; }
.stories__items { display: flex; align-items: center; justify-content: flex-end; gap: 5px; min-width: 0; padding-block: 4px; overflow: hidden; transition: gap .24s ease; }
.stories__items:not(.stories__items--expanded) { padding-inline: 4px; }
.stories__own, .stories__author { position: relative; display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; gap: 4px; }
.stories__own-avatar { position: relative; display: block; flex: 0 0 auto; width: max-content; height: max-content; }
.stories__author, .stories__avatar-button { border: 0; padding: 0; color: inherit; background: transparent; cursor: pointer; }
.stories__avatar-button { position: relative; display: block; }
.stories__avatar-button--label { cursor: pointer; }
.stories__avatar { box-sizing: border-box; position: relative; isolation: isolate; width: 30px; height: 30px; display: grid; place-items: center; overflow: visible; border-radius: 50%; background: transparent; color: var(--color-text-secondary); font-size: 12px; font-weight: 700; transition: width .24s ease, height .24s ease, font-size .24s ease; }
.stories__avatar-face { box-sizing: border-box; position: relative; z-index: 1; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; border: 2px solid var(--color-border); border-radius: 50%; background: var(--color-surface-soft, #f1efed); color: var(--color-text-secondary); }
.stories__avatar-face img { width: 100%; height: 100%; object-fit: cover; }
.stories__avatar--own .stories__avatar-face { border-color: var(--color-primary, #c97854); }
.stories__avatar--has-story::before { content: ""; position: absolute; z-index: 0; inset: -3px; border-radius: 50%; background: conic-gradient(from 0deg, var(--color-primary, #c97854) 0deg 286deg, color-mix(in srgb, var(--color-primary, #c97854) 45%, white) 286deg 340deg, var(--color-primary, #c97854) 340deg 360deg); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); animation: stories-avatar-pulse 2.8s ease-in-out infinite; }
.stories__avatar--has-story .stories__avatar-face { border-color: var(--color-surface, #fff); }
@keyframes stories-avatar-pulse {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 0 transparent); }
  50% { opacity: .94; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--color-primary, #c97854) 48%, transparent)); }
}
.stories__avatar-plus { position: absolute; right: -3px; bottom: -2px; width: 14px; height: 14px; display: grid; place-items: center; border: 1.5px solid var(--color-surface, #fff); border-radius: 50%; background: #c76b47; color: #fff; font-size: 12px; line-height: 1; font-weight: 700; }
.stories__avatar-plus--lock { font-size: 9px; }
.stories__add-more { position: absolute; z-index: 1; right: -1px; bottom: -1px; width: 17px; height: 17px; display: grid; place-items: center; border: 2px solid var(--color-surface, #fff); border-radius: 50%; background: #c76b47; color: white; font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer; }
.stories__expand { width: 23px; height: 30px; padding: 3px; border: 0; border-radius: 10px; background: transparent; color: var(--color-text-secondary); cursor: pointer; transition: transform .22s ease, background .18s ease; }
.stories__expand:hover { background: var(--color-surface-soft, #f4f2f0); }
.stories__expand svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .22s ease; }
.stories__strip--expanded { justify-content: flex-start; min-height: 104px; padding: 7px 10px 6px; border-color: var(--color-border); border-radius: 18px; background: var(--color-surface, #fff); box-shadow: 0 8px 24px #24201d12; }
.stories__items--expanded { justify-content: flex-start; flex: 1; gap: 13px; overflow-x: auto; scrollbar-width: none; }
.stories__items--expanded::-webkit-scrollbar { display: none; }
.stories__items--expanded > .stories__own, .stories__items--expanded > .stories__author { padding: 4px; }
.stories__strip--expanded .stories__avatar { width: 62px; height: 62px; font-size: 18px; }
.stories__strip--expanded .stories__avatar-plus { width: 22px; height: 22px; right: -2px; bottom: -2px; font-size: 17px; }
.stories__strip--expanded .stories__avatar-plus--lock { font-size: 12px; }
.stories__strip--expanded .stories__add-more { right: -1px; bottom: -1px; width: 22px; height: 22px; font-size: 17px; }
.stories__strip--expanded .stories__expand svg { transform: rotate(180deg); }
.stories__name { max-width: 78px; overflow: hidden; color: var(--color-text-secondary); font-size: 11px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.stories__name--own { max-width: none; overflow: visible; text-overflow: clip; }
.stories__pro-hint { display: flex; justify-content: space-between; width: 100%; margin-top: 5px; padding: 7px 10px; border: 0; border-radius: 11px; background: #c9785414; color: var(--color-text-secondary); font-size: 11px; text-align: left; }
.stories__pro-hint span { color: #b75c38; font-weight: 700; white-space: nowrap; }
.stories__file-status { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 11px; border-radius: 12px; background: var(--color-surface-soft, #f4f2f0); color: var(--color-text-secondary); font-size: 12px; line-height: 1.4; }
.stories__file-status-icon { flex: 0 0 auto; color: #287b49; font-size: 16px; font-weight: 800; }
.stories__spinner { box-sizing: border-box; width: 17px; height: 17px; flex: 0 0 auto; border: 2px solid #c66b4740; border-top-color: #c66b47; border-radius: 50%; animation: stories-spin .7s linear infinite; }
.stories__publish-success { display: flex; align-items: center; gap: 7px; width: fit-content; max-width: 100%; margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: #287b4914; color: #287b49; font-size: 13px; font-weight: 700; animation: stories-status-in .18s ease-out; }
.stories__publish-success span { font-size: 16px; }
@keyframes stories-spin { to { transform: rotate(360deg); } }
@keyframes stories-status-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.stories__file-input { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; clip-path: inset(50%) !important; }
.stories__modal-backdrop { position: fixed; z-index: 2400; inset: 0; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); background: #1714119c; backdrop-filter: blur(5px); }
.stories__composer, .stories__pro-modal { box-sizing: border-box; flex: 0 0 auto; width: min(100%, 430px); max-height: calc(100vh - 24px); max-height: min(calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px), 760px); margin: auto 0; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--color-border); border-radius: 24px; padding: 16px; background: var(--color-surface, #fff); color: var(--color-text, #262321); box-shadow: 0 24px 80px #0004; }
.stories__composer { display: flex; min-height: 0; flex-direction: column; overflow: hidden; }
.stories__composer header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stories__composer h2, .stories__pro-modal h2 { margin: 0; font-size: 20px; font-weight: 800; }
.stories__composer-progress { flex: 0 0 auto; margin: 1px 0 12px; }
.stories__composer-progress-track { height: 4px; overflow: hidden; border-radius: 4px; background: var(--color-border); }
.stories__composer-progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--color-primary, #c97854); transition: width .25s ease; }
.stories__composer-progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; font-size: 12px; }
.stories__composer-progress-copy strong { color: var(--color-text); font-weight: 750; }
.stories__composer-progress-copy > span { color: var(--color-text-secondary); }
.stories__composer-stage { min-height: 0; max-height: min(48dvh, 430px); flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.stories__composer-slide { min-height: 0; animation: stories-composer-slide-in .2s ease-out both; }
.stories__composer-slide--backward { --composer-slide-start: -14px; }
.stories__composer-slide--forward { --composer-slide-start: 14px; }
@keyframes stories-composer-slide-in { from { opacity: 0; transform: translateX(var(--composer-slide-start, 14px)); } to { opacity: 1; transform: translateX(0); } }
.stories__photo-step { display: flex; flex-direction: column; align-items: stretch; }
.stories__composer header button, .stories__modal-close { border: 0; background: transparent; color: var(--color-text-secondary); font-size: 27px; line-height: 1; }
.stories__preview { display: block; width: 100%; max-height: min(26vh, 220px); max-height: min(26dvh, 220px); object-fit: contain; border-radius: 16px; background: #161616; }
.stories__preview--video { height: min(30dvh, 240px); }
.stories__composer label { display: block; margin-top: 10px; font-size: 13px; font-weight: 700; }
.stories__composer label span { color: var(--color-text-secondary); font-weight: 400; }
.stories__composer textarea { width: 100%; min-height: 64px; margin-top: 6px; resize: vertical; border: 1px solid var(--color-border); border-radius: 13px; padding: 10px 12px; background: var(--color-surface, white); color: var(--color-text); font: inherit; font-size: 14px; }
.stories__composer-note { margin-top: 10px; color: var(--color-text-secondary); font-size: 12px; line-height: 1.4; }
.stories__error { margin: 9px 0 0; color: #b42318; font-size: 13px; }
.stories__inline-error { margin: 5px 0; color: #b42318; font-size: 12px; }
.stories__confirm-actions { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.stories__danger { min-height: 42px; border: 0; border-radius: 14px; padding: 0 16px; background: #b42318; color: white; font-weight: 700; }
.stories__composer footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.stories__composer-footer .stories__secondary { min-width: 104px; }
.stories__composer-footer .stories__publish { min-width: 132px; margin-left: auto; }
.stories__secondary, .stories__publish { min-height: 42px; border: 0; border-radius: 14px; padding: 0 16px; font-weight: 700; }
.stories__secondary { background: var(--color-surface-soft, #f1efed); color: var(--color-text-secondary); }
.stories__publish { background: var(--color-primary, #c66b47); color: white; }
.stories__publish:disabled { opacity: .6; }
.stories__pro-modal { position: relative; padding: 30px 22px 22px; text-align: center; }
.stories__modal-close { position: absolute; top: 14px; right: 15px; }
.stories__pro-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 18px; background: #c9785419; color: #c66b47; font-size: 28px; }
.stories__pro-modal p { margin: 12px 0 20px; color: var(--color-text-secondary); font-size: 14px; line-height: 1.5; }
.stories__viewer { position: fixed; z-index: 2300; inset: 0; display: flex; flex-direction: column; align-items: center; overflow: hidden; background: #111; color: white; transform: translate3d(0, var(--story-drag-offset, 0px), 0); opacity: var(--story-drag-opacity, 1); transition: transform .2s ease, opacity .2s ease; touch-action: pan-x; will-change: transform, opacity; }
.stories__viewer-progress { position: absolute; z-index: 2; top: max(7px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 4px; height: 3px; }
.stories__viewer-progress-segment { display: block; flex: 1 1 0; min-width: 0; height: 100%; overflow: hidden; border-radius: 9px; background: #ffffff60; }
.stories__viewer-progress-segment > span { display: block; height: 100%; background: white; transition: width .1s linear; }
.stories__viewer-header { position: absolute; z-index: 3; top: calc(max(14px, env(safe-area-inset-top)) + 8px); left: 12px; right: 10px; display: flex; align-items: center; gap: 10px; min-height: 42px; }
.stories__viewer-author { display: flex; align-items: center; gap: 8px; margin-right: auto; border: 0; background: transparent; color: white; font-weight: 700; text-align: left; }
.stories__viewer-author img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.stories__viewer-author time { color: #ffffffbd; font-size: 12px; font-weight: 500; }
.stories__view-count, .stories__viewer-delete, .stories__viewer-close { border: 0; background: transparent; color: #fff; font-size: 21px; }
.stories__viewer-sound { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #ffffff55; border-radius: 50%; background: #171717cc; color: white; box-shadow: 0 2px 8px #0005; }
.stories__viewer-sound svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stories__viewer-delete svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stories__viewer-menu-button { border: 0; background: transparent; color: white; font-size: 16px; letter-spacing: 2px; }
.stories__viewer-menu { position: absolute; z-index: 5; top: calc(max(58px, env(safe-area-inset-top) + 52px)); right: 12px; display: flex; flex-direction: column; min-width: 210px; overflow: hidden; border: 1px solid #ffffff2b; border-radius: 14px; background: #292725f5; box-shadow: 0 12px 36px #0007; }
.stories__viewer-menu button { border: 0; border-bottom: 1px solid #ffffff17; padding: 12px 14px; background: transparent; color: white; text-align: left; font-size: 14px; }
.stories__viewer-menu button:last-child { border-bottom: 0; }
.stories__viewer-feedback { position: absolute; z-index: 6; top: 75px; left: 50%; transform: translateX(-50%); max-width: 90%; padding: 9px 14px; border-radius: 14px; background: #272523eb; color: white; font-size: 13px; }
.stories__view-count { font-size: 13px; }
.stories__viewer-image { width: 100%; height: 100%; object-fit: contain; }
.stories__viewer-video { background: #080808; }
.stories__viewer-caption { position: absolute; z-index: 2; bottom: calc(98px + env(safe-area-inset-bottom)); width: min(92%, 560px); margin: 0; padding: 11px 14px; border-radius: 16px; background: #0007; color: white; font-size: 16px; line-height: 1.4; text-align: center; pointer-events: none; }
.stories__viewer-tap { position: absolute; top: 65px; bottom: 100px; width: 32%; border: 0; background: transparent; }
.stories__viewer-tap--left { left: 0; }
.stories__viewer-tap--right { right: 0; }
.stories__reactions { position: absolute; z-index: 3; bottom: max(20px, env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: clamp(7px, 2vw, 14px); width: 100%; padding: 8px 12px; }
.stories__reaction { width: clamp(42px, 11vw, 52px); height: clamp(42px, 11vw, 52px); border: 1px solid #ffffff38; border-radius: 50%; background: #171717a8; color: white; font-size: clamp(20px, 6vw, 26px); transition: transform .15s ease, background .15s ease; }
.stories__reaction:active { transform: scale(.9); }
.stories__reaction--selected { border-color: white; background: #c66b47; }
.stories__owner-reactions { position: absolute; z-index: 3; bottom: max(25px, env(safe-area-inset-bottom)); display: flex; gap: 9px; }
.stories__owner-reactions span { padding: 8px 11px; border-radius: 18px; background: #0009; }
.stories__strip--expanded ~ .stories__pro-hint { margin-bottom: 4px; }
@media (max-width: 420px) {
  .stories__items:not(.stories__items--expanded) { gap: 3px; }
  .stories__avatar { width: 27px; height: 27px; }
  .stories__expand { width: 19px; }
  .stories__viewer-author { gap: 6px; padding: 0 2px; }
  .stories__viewer-author time { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .stories *, .stories *::before, .stories *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
.stories__link-picker { margin: 0; padding: 11px; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface-soft, #f7f5f3); }
.stories__link-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.stories__link-picker-heading > span:last-child { color: var(--color-text-secondary); font-size: 11px; font-weight: 500; }
.stories__link-tabs { display: flex; gap: 4px; margin-bottom: 8px; padding: 3px; border-radius: 12px; background: var(--color-surface, #fff); }
.stories__link-tab { flex: 1; min-height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--color-text-secondary); font: inherit; font-size: 12px; cursor: pointer; }
.stories__link-tab--active { background: #c97854; color: white; font-weight: 700; box-shadow: 0 2px 6px #71381e30; }
.stories__link-options { display: flex; min-height: 0; flex-direction: column; gap: 2px; max-height: min(30dvh, 220px); overflow-y: auto; overscroll-behavior: contain; }
.stories__link-option { box-sizing: border-box; display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 7px 8px; border: 1px solid transparent; border-bottom-color: var(--color-border); border-radius: 12px; background: var(--color-surface, #fff); color: var(--color-text); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stories__link-option:last-child { border-bottom-color: transparent; }
.stories__link-option--selected { border-color: color-mix(in srgb, var(--color-primary, #c97854) 45%, transparent); background: color-mix(in srgb, var(--color-primary, #c97854) 8%, var(--color-surface, #fff)); }
.stories__link-option-avatar, .stories__link-option-avatar.async-image { box-sizing: border-box; width: 38px; height: 38px; overflow: hidden; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface-soft, #f1efed); }
.stories__link-option-avatar-img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.stories__link-option-avatar--placeholder { display: grid; place-items: center; color: var(--color-primary, #c97854); font-size: 19px; font-weight: 700; }
.stories__link-option-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stories__link-option-title { display: -webkit-box; overflow: hidden; max-width: 100%; color: var(--color-text); font-size: 13px; font-weight: 700; line-height: 1.28; white-space: normal; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.stories__link-option-meta { display: -webkit-box; overflow: hidden; color: var(--color-text-secondary); font-size: 10px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.stories__link-option-check { color: var(--color-primary, #c97854); font-size: 15px; font-weight: 800; text-align: center; }
.stories__link-state { display: flex; align-items: center; gap: 8px; min-height: 38px; color: var(--color-text-secondary); font-size: 12px; }
.stories__link-state--error { justify-content: space-between; color: #a33434; }
.stories__link-state--error button { border: 0; background: transparent; color: #a33434; font: inherit; font-weight: 700; text-decoration: underline; }
.stories__link-selection { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding: 8px 9px; border: 1px solid color-mix(in srgb, var(--color-primary, #c97854) 20%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--color-primary, #c97854) 7%, var(--color-surface, #fff)); color: var(--color-primary, #986044); font-size: 11px; }
.stories__link-selection > span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stories__link-selection button { border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1; }
.stories__caption-step label { display: block; margin: 0; font-size: 13px; font-weight: 700; }
.stories__caption-step label span { color: var(--color-text-secondary); font-weight: 400; }
.stories__caption-step textarea { display: block; width: 100%; min-height: 116px; margin-top: 7px; resize: vertical; border: 1px solid var(--color-border); border-radius: 13px; padding: 11px 12px; background: var(--color-surface, white); color: var(--color-text); font: inherit; font-size: 14px; }
.stories__caption-step textarea:focus { border-color: var(--color-primary, #c97854); outline: 3px solid color-mix(in srgb, var(--color-primary, #c97854) 16%, transparent); }
.stories__viewer-event { position: absolute; z-index: 4; bottom: calc(164px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; width: min(92%, 520px); min-height: 62px; padding: 8px 11px; border: 1px solid #ffffff32; border-radius: 17px; background: linear-gradient(115deg, #221f20ed, #49372ff0); color: white; box-shadow: 0 10px 30px #0005; font: inherit; text-align: left; cursor: pointer; appearance: none; -webkit-tap-highlight-color: transparent; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.stories__viewer-event > img { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 11px; object-fit: cover; background: #ffffff20; }
.stories__viewer-event-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.stories__viewer-event-label { color: #ffc89d; font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.stories__viewer-event-copy strong { overflow: hidden; font-size: 13px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.stories__viewer-event-copy > span:last-child { overflow: hidden; color: #ffffffbd; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.stories__viewer-event-open { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid #ffffff30; border-radius: 50%; color: white; font-size: 23px; line-height: 1; }
.stories__viewer-event:hover { border-color: #ffffff60; box-shadow: 0 14px 34px #0007; }
.stories__viewer-event:active { transform: scale(.985); }
.stories__viewer-event:focus-visible { outline: 3px solid var(--color-primary, #e07a5f); outline-offset: 3px; }
@media (max-width: 420px) { .stories__viewer-event { bottom: calc(157px + env(safe-area-inset-bottom)); gap: 8px; padding: 7px 9px; } }
