/* Share sheet: a floating dossier card on every screen size. */
.share-sheet{--sheet-red:#d8332a;--sheet-ink:#e9e5d6;--sheet-dim:#8f9284;--sheet-line:#34372f;--serif:'Noto Serif JP',serif;position:fixed;inset:0;margin:auto;width:calc(100% - 24px);max-width:440px;height:max-content;max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;scrollbar-width:none;padding:0;border:1px solid #4a1f1b;border-radius:14px;color:var(--sheet-ink);background:url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E"),radial-gradient(120% 70% at 100% 0%,#5a1410b3,#0000 60%),radial-gradient(90% 60% at 0% 100%,#3d0e0b99,#0000 65%),#0c0e0b;box-shadow:0 0 0 1px #00000080,0 30px 90px #000000e6,0 0 60px #c41f1626}
.share-sheet::-webkit-scrollbar{display:none}
.share-sheet::backdrop{background:#050605e6;backdrop-filter:blur(6px)}

.sheet-hero{position:relative;height:172px;overflow:hidden;border-bottom:1px solid #5b1d18;isolation:isolate}
.sheet-hero img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 40%;filter:grayscale(1) contrast(1.15) brightness(.55);z-index:-2}
.sheet-hero:before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#0c0e0bf2 0%,#0c0e0bb3 45%,#0c0e0b33 100%),linear-gradient(0deg,#0c0e0b 0%,#0c0e0b00 55%),radial-gradient(80% 120% at 100% 0%,#b3221a99,#0000 70%);mix-blend-mode:normal}
.sheet-brand{position:absolute;left:24px;top:22px}
.sheet-brand b{position:relative}
.sheet-brand b{display:block;font:800 46px/.86 var(--display);letter-spacing:-.5px;color:var(--sheet-red);text-shadow:0 2px 0 #00000080}
.sheet-brand span{display:block;margin-top:9px;font:700 11px var(--display);letter-spacing:4.6px;color:#e08a76}
.sheet-tagline{position:absolute;left:24px;bottom:15px;margin:0;display:grid;font:8px/1.9 var(--mono);letter-spacing:1.8px;color:#b8b7aa}
.sheet-close{position:absolute;top:14px;right:14px;z-index:4;width:40px;height:40px;display:grid;place-items:center;border-radius:50%;border:1px solid #ffffff40;background:#0c0e0b99;color:var(--sheet-ink);backdrop-filter:blur(4px)}
.sheet-close:hover{background:#1c1f1acc;border-color:#ffffff70}
.sheet-close .ui-icon{width:19px;height:19px}

.sheet-body{position:relative;z-index:1;padding:22px 22px 18px}
.sheet-heading .mono{color:#e06a55;font-size:8px;letter-spacing:2.4px}
.sheet-heading h2{margin:9px 0 0;font:800 22px/1.45 var(--serif);letter-spacing:.01em;color:#f1eee3}
.sheet-heading h2:focus{outline:none}
.sheet-heading h2:after{content:'';display:block;width:44px;height:3px;margin-top:13px;background:var(--sheet-red)}

.share-preview{margin:20px 0 0;border:1px solid #2f322b;background:#0a0b09;box-shadow:0 14px 30px #00000080}
.share-preview img{display:block;width:100%;height:auto;aspect-ratio:1200/630;object-fit:cover;background:#151713}
.preview-caption{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 13px;border-top:1px solid #2f322b;background:#121410}
.preview-caption>span{display:flex;align-items:center;gap:9px;font-size:9px;letter-spacing:.12em;color:var(--sheet-dim)}
.preview-caption>span:before{content:'';width:3px;height:14px;background:repeating-linear-gradient(0deg,var(--sheet-red) 0 2px,#0000 2px 4px)}
.preview-caption b{font-size:12px;font-weight:700;color:var(--sheet-ink);white-space:nowrap}

.post-label{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:22px 0 9px;font-size:12px;font-weight:700;color:#e6e2d4}
.post-label>span{font-size:9px;font-weight:400;color:var(--sheet-dim);letter-spacing:.06em;white-space:nowrap}
.post-label .post-edit{font-style:normal}
.post-label .post-count.over{color:#ff7a62}
.share-sheet textarea{display:block;width:100%;box-sizing:border-box;resize:vertical;min-height:124px;max-height:220px;padding:13px 14px;border:1px solid var(--sheet-line);border-radius:4px;background:#0f110e;color:#cfcbbd;font:16px/1.7 var(--jp);box-shadow:inset 0 1px 0 #ffffff08}
.share-sheet textarea{transition:border-color .2s,box-shadow .3s}
.share-sheet textarea:focus-visible{outline:none;border-color:#9d3428;box-shadow:0 0 0 3px #d8332a33}

.sheet-main{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:8px;margin-top:16px}
.sheet-main>*{display:flex;align-items:center;justify-content:center;gap:8px;min-height:54px;min-width:0;padding:12px 10px;border-radius:4px;border:1px solid #3d4037;background:#151713;color:var(--sheet-ink);font-size:13px;font-weight:700;letter-spacing:.04em;text-decoration:none;transition:background .18s,border-color .18s,transform .18s}
.sheet-main>*{position:relative;overflow:hidden;isolation:isolate}
.sheet-main>*:hover{background:#1f221c;border-color:#5a5d52}
.sheet-main .primary{border-color:#e0473b;background:linear-gradient(180deg,#d8342a,#b4241c);color:#fff4ec;box-shadow:0 8px 22px #c41f1640,inset 0 1px 0 #ffffff26}
.sheet-main .primary:hover{background:linear-gradient(180deg,#e43c31,#c02820);border-color:#f0594c}
.sheet-main svg{width:18px;height:18px;flex:none}
.sheet-main span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.sheet-secondary{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:8px;margin-top:8px}
.sheet-secondary button{display:flex;align-items:center;justify-content:center;gap:5px;min-height:46px;min-width:0;padding:10px 4px;border:1px solid var(--sheet-line);border-radius:4px;background:#0f110e;color:#bdbaad;font-size:11px;white-space:nowrap}
.sheet-secondary button:hover{background:#1a1c17;color:var(--sheet-ink)}
.sheet-secondary .ui-icon{width:16px;height:16px;flex:none}
.sheet-main .done{background:linear-gradient(180deg,#3f7a35,#2c5b25);border-color:#5d9a50}
.sheet-secondary button.done{border-color:#4d6b3f;background:#121a0f;color:#d6ebc9}
.preview-caption .count-up{font-variant-numeric:tabular-nums}

.share-sheet .sheet-status{margin:12px 0 0;padding:10px 12px;border-left:2px solid var(--sheet-red);background:#1a0f0d;font-size:11px;line-height:1.8;color:#f0b3a5}
.share-sheet .sheet-status:empty{display:none}
.share-sheet .sheet-footnote{margin:14px 0 0;font-size:9px;line-height:1.9;color:#73766a}
.sheet-footer{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:18px;padding-top:14px;border-top:1px solid #23251f}
.sheet-footer p{margin:0;white-space:nowrap;font:600 12px var(--serif);letter-spacing:.24em;color:#6f7166}
.sheet-footer span{display:flex;align-items:center;gap:8px;font:700 12px var(--display);letter-spacing:5px;color:#5c5e55}
.sheet-footer span:after{content:'';width:26px;height:2px;background:var(--sheet-red)}

@media(max-width:360px){.post-label .post-edit{display:none}.sheet-footer p{letter-spacing:.1em;font-size:11px}.sheet-footer span{letter-spacing:3px}.sheet-body{padding:20px 17px 16px}.sheet-brand{left:18px}.sheet-tagline{left:18px}.sheet-brand b{font-size:40px}.sheet-heading h2{font-size:19px}.sheet-main>*{font-size:12px;gap:6px;padding:12px 6px}.sheet-secondary button{font-size:10px;gap:4px}.sheet-secondary .ui-icon{display:none}}

/* Motion: everything below is skipped when the viewer prefers reduced motion. */
@media(prefers-reduced-motion:no-preference){
.share-sheet[open]{animation:sheet-in .72s cubic-bezier(.16,1,.3,1) both}
.share-sheet[open]::backdrop{animation:backdrop-in .45s ease both}
.share-sheet.closing{animation:sheet-out .3s cubic-bezier(.55,0,.75,.2) both}
.share-sheet.closing::backdrop{animation:backdrop-out .3s ease both}

.share-sheet[open] .sheet-hero img{animation:hero-in 1.5s cubic-bezier(.16,1,.3,1) both,hero-drift 16s 1.5s ease-in-out infinite alternate}
.share-sheet[open] .sheet-hero:after{content:'';position:absolute;left:0;right:0;top:0;height:54px;pointer-events:none;background:linear-gradient(180deg,#0000,#e2392d33 70%,#ff8a7a88 97%,#0000);animation:hero-scan 1.15s .22s cubic-bezier(.45,0,.2,1) both}
.share-sheet[open] .sheet-brand b{animation:wipe .8s .2s cubic-bezier(.77,0,.18,1) both}
.share-sheet[open] .sheet-brand:before{content:'';position:absolute;top:-2px;height:44px;width:5px;background:#ff5143;box-shadow:0 0 14px #ff3b2e;animation:wipe-cursor .8s .2s cubic-bezier(.77,0,.18,1) both}
.share-sheet[open] .sheet-brand span{animation:spread .9s .55s cubic-bezier(.16,1,.3,1) both}
.share-sheet[open] .sheet-tagline span{animation:type .5s steps(26) both}
.share-sheet[open] .sheet-tagline span:nth-child(1){animation-delay:.75s}
.share-sheet[open] .sheet-tagline span:nth-child(2){animation-delay:1s}
.share-sheet[open] .sheet-tagline span:nth-child(3){animation-delay:1.25s}
.share-sheet[open] .sheet-tagline span:last-child:after{content:'';display:inline-block;width:5px;height:9px;margin-left:5px;vertical-align:-1px;background:var(--sheet-red);animation:caret 1s 1.75s steps(1) infinite both}
.share-sheet[open] .sheet-close{animation:close-in .55s .4s cubic-bezier(.34,1.56,.64,1) both}
.sheet-close .ui-icon{transition:transform .35s cubic-bezier(.34,1.56,.64,1)}
.sheet-close:hover .ui-icon{transform:rotate(90deg)}

.share-sheet[open] .sheet-body>*:not(.sheet-status){animation:rise .65s cubic-bezier(.16,1,.3,1) both}
.share-sheet[open] .sheet-body>:nth-child(1){animation-delay:.3s}
.share-sheet[open] .sheet-body>:nth-child(2){animation-delay:.38s}
.share-sheet[open] .sheet-body>:nth-child(3){animation-delay:.46s}
.share-sheet[open] .sheet-body>:nth-child(4){animation-delay:.51s}
.share-sheet[open] .sheet-body>:nth-child(5){animation-delay:.57s}
.share-sheet[open] .sheet-body>:nth-child(6){animation-delay:.63s}
.share-sheet[open] .sheet-body>:nth-child(8){animation-delay:.69s}
.share-sheet[open] .sheet-body>:nth-child(9){animation-delay:.75s}
.share-sheet[open] .sheet-heading h2:after{transform-origin:left;animation:grow .8s .62s cubic-bezier(.16,1,.3,1) both}
.share-sheet[open] .sheet-footer span:after{transform-origin:left;animation:grow .8s 1.05s cubic-bezier(.16,1,.3,1) both}

.share-preview{position:relative;overflow:hidden}
.share-sheet[open] .share-preview img{animation:develop 1.4s .5s ease-out both}
.share-sheet[open] .share-preview:after{content:'';position:absolute;left:0;right:0;top:0;height:34%;pointer-events:none;background:linear-gradient(180deg,#0000,#ffffff10 78%,#ffd2c860 98%,#0000);animation:preview-scan 1.3s .62s cubic-bezier(.45,0,.2,1) both}
.share-sheet[open] .preview-caption>span:before{animation:blink .45s 1.05s steps(1) 4 both}

.sheet-main>*,.sheet-secondary button{transition:transform .25s cubic-bezier(.34,1.56,.64,1),background .2s,border-color .2s,color .2s,box-shadow .25s}
.sheet-main>*:hover,.sheet-secondary button:hover{transform:translateY(-2px)}
.sheet-main>*:active,.sheet-secondary button:active{transform:translateY(0) scale(.97);transition-duration:.08s}
.sheet-main .primary:hover{box-shadow:0 12px 30px #c41f1666,inset 0 1px 0 #ffffff33}
.sheet-main svg,.sheet-secondary .ui-icon{transition:transform .3s cubic-bezier(.34,1.56,.64,1)}
.sheet-main>*:hover svg{transform:scale(1.14) rotate(-6deg)}
.sheet-secondary button:hover .ui-icon{transform:translateY(-1px) scale(1.1)}
.sheet-main .primary:after{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(105deg,#0000 30%,#ffffff3d 50%,#0000 70%);transform:translateX(-130%);animation:sheen 1.1s 1.35s cubic-bezier(.4,0,.2,1) both}
.sheet-main .primary:hover:after{animation:sheen-hover .8s cubic-bezier(.4,0,.2,1) both}
.sheet-secondary button.done .ui-icon{animation:pop .45s cubic-bezier(.34,1.8,.64,1) both}

.share-sheet .sheet-status.show{animation:status-in .45s cubic-bezier(.16,1,.3,1) both}
.post-count.shake{animation:shake .42s cubic-bezier(.36,.07,.19,.97) both}
}

@keyframes sheet-in{0%{opacity:0;transform:translateY(52px) scale(.92) rotate(-1.4deg);filter:brightness(2.2) blur(4px)}45%{opacity:1;filter:brightness(1.15) blur(0)}70%{transform:translateY(-3px) scale(1.004) rotate(.15deg)}100%{opacity:1;transform:none;filter:none}}
@keyframes sheet-out{to{opacity:0;transform:translateY(26px) scale(.95) rotate(.8deg);filter:blur(3px) brightness(.6)}}
@keyframes hero-in{0%{transform:scale(1.28);filter:grayscale(1) contrast(1.15) brightness(0)}28%{filter:grayscale(1) contrast(1.15) brightness(.95)}34%{filter:grayscale(1) contrast(1.15) brightness(.2)}44%{filter:grayscale(1) contrast(1.15) brightness(.8)}100%{transform:scale(1.04);filter:grayscale(1) contrast(1.15) brightness(.55)}}
@keyframes hero-drift{from{transform:scale(1.04)}to{transform:scale(1.12) translateX(-2.5%)}}
@keyframes hero-scan{0%{transform:translateY(-60px);opacity:0}12%{opacity:1}100%{transform:translateY(190px);opacity:0}}
@keyframes wipe{from{clip-path:inset(-10% 100% -10% 0)}to{clip-path:inset(-10% -2% -10% 0)}}
@keyframes wipe-cursor{0%{left:0;opacity:1}88%{left:calc(100% - 2px);opacity:1}100%{left:calc(100% - 2px);opacity:0}}
@keyframes spread{from{opacity:0;letter-spacing:14px;filter:blur(3px)}to{opacity:1;letter-spacing:4.6px;filter:none}}
@keyframes type{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes caret{0%{opacity:1}50%{opacity:0}}
@keyframes close-in{from{opacity:0;transform:scale(.4) rotate(-120deg)}to{opacity:1;transform:none}}
@keyframes grow{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes develop{0%{filter:grayscale(1) brightness(.3) contrast(1.7) blur(2px)}60%{filter:grayscale(.4) brightness(1.15) contrast(1.1) blur(0)}100%{filter:none}}
@keyframes preview-scan{0%{transform:translateY(-110%);opacity:1}100%{transform:translateY(320%);opacity:0}}
@keyframes blink{0%{opacity:1}50%{opacity:.15}}
@keyframes sheen{from{transform:translateX(-130%)}to{transform:translateX(130%)}}
@keyframes sheen-hover{from{transform:translateX(-130%)}to{transform:translateX(130%)}}
@keyframes pop{0%{transform:scale(0) rotate(-30deg)}100%{transform:none}}
@keyframes status-in{from{opacity:0;transform:translateY(8px);clip-path:inset(0 100% 0 0)}to{opacity:1;transform:none;clip-path:inset(0 0 0 0)}}
@keyframes shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(2px)}30%,50%,70%{transform:translateX(-3px)}40%,60%{transform:translateX(3px)}}

/* Phone save viewer: long-press the card to save straight to Photos/Gallery. */
.save-viewer{position:fixed;inset:0;margin:auto;width:calc(100% - 24px);max-width:440px;height:max-content;max-height:calc(100dvh - 24px);overflow:auto;padding:18px 16px 16px;border:1px solid #4a1f1b;border-radius:14px;color:#e9e5d6;background:#0c0e0b;box-shadow:0 30px 90px #000000e6;text-align:center}
.save-viewer::backdrop{background:#050605e6;backdrop-filter:blur(6px)}
.save-viewer img{display:block;width:100%;height:auto;border-radius:8px;-webkit-touch-callout:default;user-select:auto;-webkit-user-select:auto}
.save-viewer p{margin:14px 4px 2px;font:500 13px/1.7 var(--jp);color:#b8b7aa}
.save-viewer p b{color:#e9e5d6}
.save-viewer-close{position:absolute;top:8px;right:8px;z-index:2;width:36px;height:36px;border-radius:50%;border:1px solid #ffffff40;background:#0c0e0bb3;color:#e9e5d6;font-size:20px;line-height:1}
