/* Stories share the plan’s audience and keep their own media lifecycle. */
.plan-stories-rail { min-width:0; padding:23px 0 22px; margin:0 0 12px; border-bottom:1px solid var(--line); }
.plan-stories-heading,.plan-story-archive>header { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; }
.plan-stories-heading h2 { margin:0; font-size:21px; letter-spacing:-.6px; }
.plan-stories-heading p,.plan-story-archive header p { margin:4px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.story-add-link { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:44px; flex-shrink:0; padding:9px 15px; border:1px solid var(--ink); border-radius:999px; background:var(--brand-cyan); color:var(--ink); font-size:13px; font-weight:750; }
.story-add-link .icon { width:17px; height:17px; }
.plan-stories-list { display:flex; gap:20px; overflow-x:auto; overscroll-behavior-x:contain; padding:4px 3px 6px; scrollbar-width:thin; scroll-snap-type:x proximity; }
.plan-story-circle { display:flex; flex:0 0 88px; flex-direction:column; align-items:center; gap:9px; min-width:0; padding:0; color:var(--ink); scroll-snap-align:start; }
.plan-story-ring { position:relative; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); place-items:center; width:84px; height:84px; padding:4px; border:2px solid var(--ink); border-radius:50%; background:conic-gradient(var(--brand-cyan),var(--brand-coral),var(--brand-yellow),var(--brand-cyan)); }
.plan-story-ring>img,.plan-story-ring>span:not(.plan-story-play) { display:grid; place-items:center; width:100%; height:100%; min-width:0; min-height:0; aspect-ratio:1; border:3px solid var(--paper); border-radius:50%; object-fit:cover; background:var(--cyan-soft); font-size:24px; font-weight:800; }
.plan-story-play { position:absolute; right:-2px; bottom:-1px; display:grid; place-items:center; width:25px; height:25px; border:2px solid var(--paper); border-radius:50%; color:#fff; background:var(--ink); font-size:10px; }
.story-playback-glyph { display:block; flex-shrink:0; width:24px; height:24px; fill:currentColor; pointer-events:none; }
.plan-story-play>.story-playback-glyph { width:14px; height:14px; }
.plan-story-name { width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:650; line-height:1.5; }
.plan-stories-empty,.story-archive-note { margin:0; padding:7px 0; color:var(--muted); font-size:13px; line-height:1.6; }
.plan-story-archive { min-width:0; margin:25px 0; padding-top:22px; border-top:1px solid var(--line); }
.plan-story-archive h3 { margin:0; font-size:19px; letter-spacing:-.4px; }
.plan-story-archive>header .button { min-height:44px; padding:8px 13px; font-size:12px; }
.plan-story-archive-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.story-archive-item { display:flex; align-items:center; min-width:0; gap:10px; padding:9px; border:1px solid var(--line); border-radius:14px; background:#fff; text-align:left; }
.story-archive-cover { position:relative; flex:0 0 54px; width:54px; height:66px; overflow:hidden; border-radius:10px; background:var(--cyan-soft); }
.story-archive-cover>img { display:block; width:100%; height:100%; object-fit:cover; }
.story-archive-cover>span:first-child { display:grid; place-items:center; height:100%; font-weight:750; font-size:23px; }
.story-archive-cover>span:last-child { position:absolute; inset:0; display:grid; place-items:center; background:#123e4624; color:#fff; font-size:16px; text-shadow:0 1px 4px var(--ink); }
.story-archive-item>span:last-child { min-width:0; }
.story-archive-item strong,.story-archive-item small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.story-archive-item strong { font-size:12px; line-height:1.5; }
.story-archive-item small { margin-top:3px; color:var(--muted); font-size:11px; line-height:1.5; }
.story-archive-pages { display:flex; flex-wrap:wrap; gap:9px; margin-top:14px; }
.story-archive-pages .button { min-height:44px; padding:8px 13px; font-size:12px; }
#plan-story-add-dialog { max-width:570px; }
#plan-story-add-dialog h2 { padding-right:32px; font-size:28px; }
#plan-story-add-dialog .dialog-description { margin-bottom:18px; }
#plan-story-add-dialog .social-media-fieldset { margin:0; }
#plan-story-add-dialog input:not([type=file]):not([type=range]),#plan-story-add-dialog select,#plan-story-add-dialog textarea { font-size:16px; }
#plan-story-add-dialog .dialog-close { width:44px; height:44px; }
#plan-story-add-dialog .short-video-preview { max-height:240px; }
#plan-story-add-dialog #story-publish { min-height:48px; }
#plan-story-viewer-dialog { position:fixed; inset:0; margin:0; width:100vw; max-width:none; height:100dvh; max-height:none; padding:0; border:0; border-radius:0; overflow:hidden; background:#0b161b; color:#fff; animation:none; }
#plan-story-viewer-dialog::backdrop { background:#0b161b; }
.story-viewer-shell { position:relative; width:100%; max-width:580px; height:100%; margin:auto; overflow:hidden; background:#071014; }
.story-viewer-stage { position:relative; width:100%; height:100%; }
#story-viewer-video { display:block; width:100%; height:100%; object-fit:contain; background:#071014; }
#story-viewer-tap { position:absolute; inset:0; z-index:1; width:100%; height:100%; padding:0; border:0; border-radius:0; background:transparent; color:#fff; touch-action:manipulation; }
#plan-story-viewer-dialog #story-viewer-tap::before,#plan-story-viewer-dialog #story-viewer-tap::after { content:none; display:none; }
#plan-story-viewer-dialog #story-viewer-tap,#plan-story-viewer-dialog #story-viewer-tap:hover,#plan-story-viewer-dialog #story-viewer-tap:active { appearance:none; -webkit-appearance:none; transform:none; box-shadow:none; text-shadow:none; }
.story-viewer-play-indicator { position:absolute; inset:0; display:grid; place-items:center; width:64px; height:64px; margin:auto; border:1px solid #ffffff60; border-radius:50%; background:#07101466; color:#fff; box-shadow:0 6px 24px #0003; backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px); opacity:0; visibility:hidden; pointer-events:none; }
.story-viewer-play-indicator>.story-playback-glyph { width:32px; height:32px; }
#plan-story-viewer-dialog[data-playing=false] .story-viewer-play-indicator { opacity:1; visibility:visible; }
.story-viewer-header { position:absolute; inset:0 0 auto; z-index:3; padding:12px 16px 35px; padding-top:max(12px,env(safe-area-inset-top)); background:linear-gradient(#071014dd,#07101488 70%,transparent); pointer-events:none; }
.story-viewer-progress { display:flex; gap:4px; margin-bottom:11px; }
.story-progress-segment { display:block; flex:1; min-width:0; height:3px; border-radius:4px; overflow:hidden; background:#ffffff40; }
.story-progress-segment>i { display:block; width:0; height:100%; background:var(--brand-yellow); }
.story-viewer-heading { display:flex; align-items:center; gap:12px; }
.story-viewer-heading>div { flex:1; min-width:0; }
#story-viewer-title { margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#fff; font-size:17px; letter-spacing:-.2px; line-height:1.5; }
.story-viewer-byline { display:flex; align-items:center; gap:9px; min-width:0; }
#plan-story-viewer-dialog #story-viewer-author { display:block; min-width:0; min-height:44px; padding:8px 0; border:0; border-radius:6px; color:#fff; background:transparent; font-size:14px; font-weight:750; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; text-decoration:underline; text-underline-offset:4px; pointer-events:auto; }
#story-viewer-date { flex-shrink:0; color:#ffffffa8; font-size:11px; }
.plan-story-circle.has-unwatched .plan-story-ring { border-color:var(--brand-teal); background:conic-gradient(var(--brand-cyan),var(--brand-coral),var(--brand-yellow),var(--brand-cyan)); box-shadow:0 0 0 2px var(--cyan-soft); }
.plan-story-circle.is-watched .plan-story-ring { border-color:#8da6ad; background:var(--line); box-shadow:none; }
.plan-story-circle.is-watched .plan-story-play { background:var(--muted); font-size:14px; }
.plan-story-status { display:block; margin-top:-7px; color:var(--teal-deep); font-size:10px; font-weight:800; line-height:1.4; }
.plan-story-circle.is-watched .plan-story-status { color:var(--muted); font-weight:550; }
.story-archive-watched { display:inline-block; margin-left:4px; color:var(--teal-deep); font-size:10px; font-weight:750; }
.story-archive-item.has-unwatched { border-left:3px solid var(--brand-coral); }
.story-archive-item.is-watched .story-archive-watched { color:var(--muted); font-weight:550; }
#plan-story-viewer-dialog .story-viewer-icon { display:grid; place-items:center; flex:0 0 44px; width:44px; min-width:44px; height:44px; min-height:44px; margin:0; padding:8px; border:1px solid #ffffff40; border-radius:50%; background:#0b161b80; color:#fff; font-size:19px; line-height:1; cursor:pointer; pointer-events:auto; }
.story-viewer-icon .icon { width:21px; height:21px; }
#plan-story-viewer-dialog .story-viewer-icon .story-playback-glyph { width:22px; height:22px; transform:none; }
#plan-story-viewer-dialog .story-viewer-arrow { position:absolute; top:45%; z-index:2; display:grid; place-items:center; width:44px; height:64px; padding:0; border:0; border-radius:14px; color:#fff; background:#0b161b44; pointer-events:auto; }
.story-viewer-prev { left:8px; }.story-viewer-next { right:8px; }
.story-viewer-arrow .icon { width:22px; height:22px; }
#plan-story-viewer-dialog button:disabled { cursor:default; opacity:.25; }
.story-viewer-footer { position:absolute; inset:auto 0 0; z-index:3; padding:50px 16px max(20px,env(safe-area-inset-bottom)); background:linear-gradient(transparent,#071014bb 35%,#071014f0); pointer-events:none; }
#story-viewer-caption { margin:0 0 16px; max-height:25dvh; overflow-y:auto; color:#fff; font-size:15px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; pointer-events:auto; }
#story-viewer-caption:empty { display:none; }
.story-social-actions { display:flex; align-items:center; gap:17px; margin:0 0 10px; pointer-events:auto; }
#plan-story-viewer-dialog .story-social-button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-width:44px; min-height:44px; padding:8px 2px; color:#fff; background:transparent; border:0; border-radius:8px; font-size:13px; font-weight:700; }
.story-social-button svg { width:26px; height:26px; flex-shrink:0; }
#plan-story-viewer-dialog #story-like[aria-pressed=true] { color:var(--brand-coral); }
#story-like[aria-pressed=true] svg { fill:currentColor; }
#plan-story-viewer-dialog .story-share-button { margin-left:auto; padding-inline:8px; }
.story-social-status { margin:0 0 10px; color:#fff; font-size:12px; line-height:1.5; pointer-events:auto; }
.story-share-fallback { margin-bottom:12px; pointer-events:auto; }
.story-share-fallback[hidden] { display:none; }
.story-share-fallback>label { display:block; margin-bottom:6px; color:#fff; font-size:12px; }
.story-share-fallback>div { display:flex; gap:8px; }
#plan-story-viewer-dialog #story-share-link { flex:1; min-width:0; min-height:44px; border:1px solid #ffffff50; border-radius:10px; padding:9px; background:var(--ink); color:#fff; font-size:16px; }
#plan-story-viewer-dialog #story-share-copy { flex-shrink:0; min-height:44px; padding:9px 12px; border:0; border-radius:10px; background:var(--brand-cyan); color:var(--ink); font-size:12px; font-weight:750; }
.story-comments-panel { position:absolute; z-index:8; inset:auto 0 0; display:flex; flex-direction:column; height:min(72dvh,650px); max-height:calc(100dvh - 20px - env(safe-area-inset-top)); min-height:220px; border-radius:24px 24px 0 0; background:var(--paper); color:var(--ink); box-shadow:0 -16px 60px #0007; overflow:hidden; }
.story-comments-panel[hidden] { display:none; }
.story-comments-panel>header { display:flex; flex-shrink:0; align-items:center; justify-content:space-between; gap:16px; padding:12px 16px 9px; border-bottom:1px solid var(--line); }
.story-comments-panel h3 { margin:0; font-size:18px; letter-spacing:-.35px; }
#plan-story-viewer-dialog #story-comments-close { display:grid; place-items:center; width:44px; height:44px; padding:10px; border:0; border-radius:50%; background:var(--cyan-soft); color:var(--ink); }
#story-comments-close svg { width:22px; height:22px; }
.story-comments-list { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:4px 18px; }
.story-comment { padding:15px 0 10px; border-bottom:1px solid var(--line); }
.story-comment:last-child { border-bottom:0; }
.story-comment-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; }
#plan-story-viewer-dialog .story-comment-heading>button { min-width:0; min-height:44px; padding:8px 0; border:0; background:none; color:var(--ink); font-size:14px; font-weight:750; text-align:left; overflow-wrap:anywhere; }
.story-comment-heading time { flex-shrink:0; color:var(--muted); font-size:11px; }
.story-comment p { margin:0; color:var(--ink); font-size:14px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.story-comment-actions { display:flex; gap:10px; margin-top:2px; }
#plan-story-viewer-dialog .story-comment-actions button { min-height:44px; padding:8px 0; color:var(--muted); font-size:11px; font-weight:650; }
.story-comments-empty { margin:28px 0; color:var(--muted); font-size:14px; text-align:center; }
.story-comments-error { flex-shrink:0; margin:8px 18px; color:var(--danger); font-size:13px; line-height:1.5; }
.story-comments-pagination { display:flex; flex-shrink:0; justify-content:center; gap:12px; padding:0 16px; }
#plan-story-viewer-dialog .story-comments-pagination button { min-height:44px; padding:8px 13px; border-radius:9px; color:var(--teal-deep); font-size:13px; font-weight:700; }
.story-comment-form { display:flex; flex-shrink:0; align-items:flex-end; gap:10px; padding:12px 14px max(14px,env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:var(--paper); }
.story-comment-form .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
#plan-story-viewer-dialog #story-comment-body { flex:1; min-width:0; min-height:48px; max-height:130px; resize:none; margin:0; padding:12px; border:1px solid var(--line); border-radius:17px; background:#fff; color:var(--ink); font-size:16px; line-height:1.4; }
#plan-story-viewer-dialog #story-comment-send { flex-shrink:0; min-height:48px; padding:10px 15px; border:0; border-radius:16px; color:var(--ink); background:var(--brand-cyan); font-size:13px; font-weight:750; }
#plan-story-viewer-dialog .story-comments-panel button:disabled { opacity:.5; }
#plan-story-viewer-dialog .story-comments-panel button:focus-visible,#story-comment-body:focus-visible { outline:3px solid var(--teal-deep); outline-offset:2px; }
.story-viewer-controls { display:flex; flex-wrap:wrap; align-items:center; gap:9px; }
#plan-story-viewer-dialog .story-viewer-plan { display:flex; align-items:center; justify-content:center; gap:7px; min-height:44px; margin-left:auto; padding:10px 16px; border:1px solid var(--brand-cyan); border-radius:999px; background:var(--brand-cyan); color:var(--ink); font-size:13px; font-weight:750; pointer-events:auto; }
.story-viewer-plan .icon { width:16px; height:16px; }
#plan-story-viewer-dialog .story-viewer-text { min-height:44px; padding:8px; color:#fff; font-size:12px; text-decoration:underline; text-underline-offset:3px; pointer-events:auto; }
.story-viewer-status { position:absolute; top:36%; left:50%; z-index:4; width:calc(100% - 100px); max-width:340px; margin:0; padding:14px; transform:translateX(-50%); border:1px solid #ffffff40; border-radius:13px; background:#0b161bee; color:#fff; font-size:14px; line-height:1.5; text-align:center; pointer-events:none; }
.story-delete-confirm { margin-top:12px; padding:14px; border:1px solid #ffffff50; border-radius:14px; background:var(--ink); pointer-events:auto; }
.story-delete-confirm p { margin:0 0 8px; color:#fff; font-size:13px; }
.story-delete-confirm button { min-height:44px; padding:8px 12px; color:#fff; border:1px solid #ffffff50; border-radius:10px; margin-right:6px; font-size:12px; }
#story-delete-confirm-button { background:var(--coral-soft); color:var(--danger); }
#plan-story-viewer-dialog button:focus-visible { outline:3px solid var(--brand-cyan); outline-offset:3px; }
#plan-story-viewer-dialog #story-viewer-tap:focus-visible { outline-offset:-6px; }
.plan-story-circle:focus-visible,.story-archive-item:focus-visible { outline:3px solid var(--brand-teal); outline-offset:3px; }
@media(hover:hover) { .plan-story-circle:hover .plan-story-ring { border-color:var(--brand-teal); } .story-archive-item:hover { background:var(--cyan-soft); border-color:var(--brand-teal); } }
@media(max-width:600px) { .plan-stories-rail { padding:18px 0; } .plan-stories-heading { gap:9px; margin-bottom:12px; } .plan-stories-heading h2 { font-size:19px; } .plan-stories-heading p { font-size:11px; } .story-add-link { padding:8px 11px; font-size:12px; } .plan-stories-list { gap:14px; } .plan-story-circle { flex-basis:76px; } .plan-story-ring { width:74px; height:74px; } .plan-story-name { font-size:11px; } .plan-story-archive-list { grid-template-columns:minmax(0,1fr); } #plan-story-add-dialog { padding:25px 18px; max-height:calc(100dvh - 20px); } #plan-story-add-dialog h2 { font-size:25px; } .story-viewer-controls { gap:7px; } }
@media(max-width:380px) { .story-viewer-controls { gap:5px; } #plan-story-viewer-dialog .story-viewer-text { font-size:11px; padding:6px; } #plan-story-viewer-dialog .story-viewer-plan { padding:9px 12px; font-size:12px; } }
@media(prefers-reduced-motion:reduce) { .plan-story-circle,.plan-story-ring,.story-archive-item { transition:none; animation:none; } }
