@charset "UTF-8";
/* Resources use the first card's glass; full pages keep the original video.
   Content controls never add a nested blur or animate a backdrop ancestor. */
#view { --cv-soft:rgba(245,230,246,.035); --cv-soft-hover:rgba(245,230,246,.065); --cv-border:rgba(233,217,242,.13); }
#view .cv-head { margin:0 0 18px; padding-right:34px; }
#view .cv-title { font:500 26px/1.5 var(--serif); letter-spacing:.035em; margin:0; overflow-wrap:anywhere; }
#view .cv-back { display:inline-flex; align-items:center; gap:5px; min-height:38px; margin:0 0 8px; color:var(--muted); font-size:11px; }
#view .cv-back .icon { width:14px; height:14px; }
#view .cv-back:hover { color:var(--ink); }
#view .cv-disclaimer { margin:0 0 19px; padding:9px 12px; border-left:2px solid rgba(229,186,206,.45); color:var(--muted); background:rgba(229,186,206,.025); font-size:11px; line-height:1.9; }

/* One small control expands into a search field and category chips. */
#view .cv-filter-box { margin:0 0 19px; }
#view .cv-filter-bar { display:flex; align-items:center; }
#view .cv-filter-toggle { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:36px; padding:7px 12px; border:1px solid var(--cv-border); border-radius:30px; background:var(--cv-soft); color:var(--muted); font-size:11px; transition:color .2s,border-color .2s,background .2s; }
#view .cv-filter-toggle .icon { width:15px; height:15px; }
#view .cv-filter-toggle:hover,#view .cv-filter-toggle[aria-expanded="true"] { color:var(--ink); border-color:rgba(229,186,206,.36); background:var(--cv-soft-hover); }
#view .cv-filter-badge { display:grid; place-items:center; min-width:18px; height:18px; padding-inline:4px; border-radius:20px; background:rgba(229,186,206,.15); color:var(--accent); font:500 10px/1 var(--sans); font-variant-numeric:tabular-nums; }
#view .cv-filter-panel { display:grid; grid-template-rows:0fr; transition:grid-template-rows .34s cubic-bezier(.22,.65,.25,1); }
#view .cv-filter-box.is-open .cv-filter-panel { grid-template-rows:1fr; }
#view .cv-filter-inner { min-height:0; overflow:hidden; opacity:0; transition:opacity .22s ease; }
#view .is-open .cv-filter-inner { opacity:1; }
#view .cv-search { display:block; width:100%; min-height:40px; margin:13px 0 12px; padding:9px 13px; border:1px solid var(--cv-border); border-radius:10px; background:rgba(17,13,25,.3); color:var(--ink); font-size:12px; outline-offset:2px; }
#view .cv-search::placeholder { color:var(--muted); opacity:.8; }
#view .cv-filter-bottom { display:flex; align-items:flex-start; gap:12px; padding-bottom:3px; }
#view .cv-filter-chips { display:flex; flex:1; flex-wrap:wrap; gap:6px; min-width:0; }
#view .cv-filter-chip { min-height:32px; border:1px solid var(--cv-border); border-radius:22px; padding:5px 12px; background:transparent; color:var(--muted); font-size:10px; transition:background .2s,color .2s,border-color .2s; }
#view .cv-filter-chip[aria-pressed="true"] { border-color:rgba(229,186,206,.48); background:rgba(229,186,206,.13); color:#f4d8e7; }
#view .cv-filter-chip:hover { border-color:rgba(229,186,206,.4); }
#view .cv-filter-clear { flex-shrink:0; min-height:32px; border-radius:18px; padding:5px 8px; color:var(--accent); background:none; font-size:10px; }
#view .cv-filter-clear:hover { background:var(--cv-soft); }

#view .cv-list-meta { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 0 12px; }
#view .cv-count { color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
#view .cv-submission { display:inline-flex; align-items:center; min-height:32px; color:var(--accent); font-size:11px; text-decoration:underline; text-decoration-color:rgba(229,186,206,.25); text-underline-offset:4px; }
#view .cv-submission:hover { text-decoration-color:currentColor; }
#view .cv-fic-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#view .cv-fic-card { display:flex; flex-direction:column; min-width:0; border:1px solid var(--cv-border); border-radius:14px; background:var(--cv-soft); transition:border-color .22s,background .22s; }
#view .cv-fic-card:hover { border-color:rgba(229,186,206,.34); background:var(--cv-soft-hover); }
#view .cv-fic-main { display:block; padding:17px 18px 10px; border-radius:14px 14px 6px 6px; }
#view .cv-fic-main:focus-visible { outline-offset:-3px; }
#view .cv-fic-title { display:flex; align-items:baseline; gap:7px 9px; flex-wrap:wrap; }
#view .cv-fic-title h3 { font:500 19px/1.55 var(--serif); letter-spacing:.02em; margin:0; overflow-wrap:anywhere; }
#view .cv-tag { display:inline-block; flex-shrink:0; padding:1px 7px; border:1px solid rgba(229,186,206,.25); border-radius:16px; color:var(--accent); font-size:9px; line-height:1.9; }
#view .cv-fic-preview { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; color:var(--muted); font-size:12px; line-height:1.9; margin:9px 0 0; overflow-wrap:anywhere; }
#view .cv-fic-meta { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; padding:0 18px 16px; margin:0; }
#view .cv-author { display:inline-flex; align-items:baseline; gap:4px; margin:0; }
#view .cv-author-label { color:rgba(215,200,224,.64); font-size:10px; }
#view .cv-author-name { color:var(--ink); font-size:12px; font-weight:600; letter-spacing:.025em; }
#view a.cv-author-name { text-decoration:underline; text-decoration-color:rgba(233,217,242,.18); text-underline-offset:4px; }
#view a.cv-author-name:hover { color:var(--accent); text-decoration-color:currentColor; }
#view .cv-word-count { display:inline-block; flex-shrink:0; padding:2px 8px; border:1px solid var(--cv-border); border-radius:20px; color:var(--muted); background:rgba(245,230,246,.025); font-size:9px; line-height:1.7; font-variant-numeric:tabular-nums; }
#view .cv-empty { grid-column:1/-1; padding:30px 0; color:var(--muted); font-size:12px; text-align:center; }

/* The reader uses the scroll context supplied when the route mounts. */
#view .cv-reader { width:100%; max-width:720px; margin:auto; padding:0 0 12px; }
#view .cv-reader .cv-title { font-size:29px; }
#view .cv-reader-meta { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:0 0 8px; }
#view .cv-source { color:var(--muted); font-size:10px; margin:0; }
#view .cv-reader-controls { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:12px 0; margin:19px 0 26px; border-block:1px solid var(--cv-border); }
#view .cv-reader-controls label { display:inline-flex; align-items:center; gap:9px; color:var(--muted); font-size:11px; }
#view .cv-reader-controls input { width:95px; height:4px; }
#view .cv-size-value { min-width:17px; font-size:10px; font-variant-numeric:tabular-nums; }
#view .cv-resume { display:inline-flex; align-items:center; gap:7px; min-height:32px; border:1px solid var(--cv-border); border-radius:20px; padding:5px 10px; background:var(--cv-soft); color:var(--muted); font-size:10px; }
#view .cv-resume .icon { width:14px; height:14px; }
#view .cv-resume:hover { color:var(--ink); border-color:rgba(229,186,206,.38); }
#view .cv-reader-body { font:var(--reading-size,19px)/2.05 var(--serif); letter-spacing:.025em; overflow-wrap:anywhere; }
#view .cv-reader-body p { margin:0 0 1.4em; }
#view .cv-reader-body mark { color:var(--accent); background:none; }
#view .cv-reader-nav { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:30px; padding-top:18px; border-top:1px solid var(--cv-border); }
#view .cv-reader-nav a { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:6px 10px; font-size:11px; color:var(--muted); border-radius:20px; }
#view .cv-reader-nav a:hover { background:var(--cv-soft-hover); color:var(--ink); }

/* Four direct choices, with format selection expanding inside the novel row. */
#view .cv-resource-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:12px; }
#view .cv-resource-option { display:flex; align-items:center; gap:16px; width:100%; min-width:0; min-height:88px; padding:18px 20px; border:1px solid var(--cv-border); border-radius:14px; color:var(--ink); background:var(--cv-soft); text-align:left; transition:border-color .22s,background .22s; }
#view .cv-resource-option:hover { border-color:rgba(229,186,206,.36); background:var(--cv-soft-hover); }
#view .cv-resource-option>.icon { width:24px; height:24px; color:var(--accent); }
#view .cv-resource-copy { display:flex; flex:1; min-width:0; flex-direction:column; gap:4px; }
#view .cv-resource-copy strong { font-size:16px; font-weight:500; letter-spacing:.035em; }
#view .cv-resource-copy>span { color:var(--muted); font-size:11px; }
#view .cv-novel-block { min-width:0; border:1px solid var(--cv-border); border-radius:14px; background:var(--cv-soft); }
#view .cv-novel-block .cv-novel-toggle { border:0; background:none; }
#view .cv-novel-block.is-open { border-color:rgba(229,186,206,.36); }
#view .cv-expand-mark { position:relative; width:12px; height:12px; flex-shrink:0; color:var(--muted); }
#view .cv-expand-mark::before,#view .cv-expand-mark::after { content:""; position:absolute; top:5px; left:1px; width:10px; height:1px; background:currentColor; }
#view .cv-expand-mark::after { transform:rotate(90deg); transition:transform .28s ease; }
#view .is-open .cv-expand-mark::after { transform:rotate(0); }
#view .cv-format-panel { display:grid; grid-template-rows:0fr; transition:grid-template-rows .34s cubic-bezier(.22,.65,.25,1); }
#view .cv-novel-block.is-open .cv-format-panel { grid-template-rows:1fr; }
#view .cv-format-inner { min-height:0; overflow:hidden; }
#view .cv-format-links { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:0 14px 14px; }
#view .cv-format-link { display:grid; grid-template-columns:1fr auto; gap:2px 7px; align-items:center; padding:10px 11px; border:1px solid var(--cv-border); border-radius:10px; background:rgba(17,13,25,.2); }
#view .cv-format-link:hover { border-color:rgba(229,186,206,.45); }
#view .cv-format-link strong { font-size:11px; font-weight:500; color:var(--accent); }
#view .cv-format-link>span:not(.icon) { font-size:9px; color:var(--muted); grid-column:1; }
#view .cv-format-link .icon { grid-column:2; grid-row:1/3; width:15px; height:15px; color:var(--muted); }


/* Full pages have a navigation bar and ordinary document scrolling, with no
   outer modal frame. Only individual entries and the reading paper are tinted. */
#view:not(.content-scroll) { --cv-soft:rgba(30,24,44,.66); --cv-soft-hover:rgba(40,31,55,.74); --cv-border:rgba(216,160,200,.23); }
#view.cv-fanfic-view { max-width:1040px; }
#view.cv-reader-view { max-width:800px; }
#view:not(.content-scroll) .cv-disclaimer { padding:10px 14px; font-size:12px; background:rgba(24,18,34,.54); }
#view:not(.content-scroll) .cv-fic-main { padding:20px 22px 12px; }
#view:not(.content-scroll) .cv-fic-title h3 { font-size:21px; }
#view:not(.content-scroll) .cv-fic-preview { font-size:13px; }
#view:not(.content-scroll) .cv-fic-meta { padding:0 22px 18px; }
#view:not(.content-scroll) .cv-author-name { font-size:13px; }
#view:not(.content-scroll) .cv-reader { max-width:760px; border:1px solid var(--cv-border); border-radius:20px; padding:24px 28px 28px; background:linear-gradient(168deg,rgba(30,24,44,.84),rgba(16,13,24,.89) 60%); }
#view:not(.content-scroll) .cv-reader .cv-back { display:none; }
#view:not(.content-scroll) .cv-reader .cv-disclaimer { margin-top:18px; }
@media(max-width:650px) {
  #view .cv-head { margin-bottom:14px; }
  #view .cv-title { font-size:23px; }
  #view .cv-disclaimer { font-size:10px; padding:8px 10px; margin-bottom:15px; }
  #view .cv-fic-grid { grid-template-columns:1fr; gap:10px; }
  #view .cv-fic-main { padding:15px 15px 9px; }
  #view .cv-fic-meta { padding:0 15px 14px; }
  #view .cv-fic-title h3 { font-size:19px; }
  #view .cv-fic-preview { font-size:11px; }
  #view .cv-resource-list { grid-template-columns:1fr; gap:10px; }
  #view .cv-resource-option { min-height:76px; padding:15px 16px; }
  #view .cv-resource-copy strong { font-size:15px; }
  #view .cv-resource-copy>span { font-size:10px; }
  #view .cv-reader .cv-title { font-size:25px; }
  #view .cv-reader-controls { margin:17px 0 23px; }
  #view:not(.content-scroll) .cv-fic-main { padding:17px 17px 10px; }
  #view:not(.content-scroll) .cv-fic-title h3 { font-size:20px; }
  #view:not(.content-scroll) .cv-fic-meta { padding:0 17px 16px; }
  #view:not(.content-scroll) .cv-fic-preview { font-size:12px; }
  #view:not(.content-scroll) .cv-disclaimer { font-size:11px; }
  #view:not(.content-scroll) .cv-reader { border-radius:16px; padding:18px 16px 22px; }
}
@media(prefers-reduced-motion:reduce) {
  #view .cv-filter-panel,#view .cv-filter-inner,#view .cv-format-panel,#view .cv-expand-mark::after { transition:none; }
}

/* A compact format picker shares the homepage's night palette. The tinted
   paper symbols, format names and quiet download marks have distinct roles. */
#dialog.novel-download {
  width:min(436px,calc(100% - 28px));
  max-height:calc(100dvh - 32px);
  padding:24px;
  border:1px solid #dac6df40;
  border-radius:22px;
  background:linear-gradient(155deg,#30283cf5,#1b1725fa 70%);
  box-shadow:0 28px 100px #07030f80,inset 0 1px 0 #f3e8f00c;
}
#dialog.novel-download::backdrop { background:#0b071369; -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); }
#dialog.novel-download .novel-download-head { min-height:44px; align-items:center; gap:18px; margin:0; padding:0; border:0; }
#dialog.novel-download .dialog-head h2 { margin:0; color:#f1e8f1; font:500 23px/1.4 var(--serif); letter-spacing:.04em; }
#dialog.novel-download .novel-download-close { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; margin-right:-8px; padding:14px; border:1px solid transparent; border-radius:12px; color:#dfd2e59c; background:transparent; transition:color .2s,background .2s,border-color .2s; }
#dialog.novel-download .novel-download-close .icon { width:16px; height:16px; }
#dialog.novel-download .novel-download-close:hover { color:#f6eef5; border-color:#e6d9e61c; background:#e8d8eb08; }
#dialog.novel-download .novel-download-note { margin:3px 0 23px; color:#ccbdd19e; font-size:12px; line-height:1.6; letter-spacing:.025em; }
#dialog.novel-download .novel-download-options { display:grid; gap:11px; }
#dialog.novel-download .novel-download-link { --format-tint:#adcbe8; display:flex; align-items:center; gap:15px; min-height:92px; min-width:0; padding:17px 15px; border:1px solid #dac6df2e; border-radius:15px; background:linear-gradient(110deg,#b9cce809,#f1e7f003 78%); box-shadow:inset 0 1px 0 #ffffff05; transition:border-color .22s,background .22s; }
#dialog.novel-download .novel-download-link.is-txt { --format-tint:#dfbad1; background:linear-gradient(110deg,#dfbad109,#f1e7f003 78%); }
#dialog.novel-download .novel-format-symbol { display:grid; place-items:center; flex:0 0 42px; width:42px; height:50px; border:1px solid #d9d3e52b; border-radius:10px; color:var(--format-tint); background:#dcd8f008; }
#dialog.novel-download .novel-format-symbol .icon { width:21px; height:21px; }
#dialog.novel-download .novel-format-copy { display:flex; flex:1; min-width:0; flex-direction:column; gap:5px; }
#dialog.novel-download .novel-format-copy strong { color:#f2eaf2; font:600 17px/1.35 var(--sans); letter-spacing:.075em; }
#dialog.novel-download .novel-format-copy>span { color:#cdbfd3a8; font:400 11px/1.6 var(--sans); }
#dialog.novel-download .novel-format-action { display:grid; place-items:center; flex:0 0 28px; width:28px; height:32px; color:#c9b9d38c; transition:color .22s,transform .22s; }
#dialog.novel-download .novel-format-action .icon { width:17px; height:17px; }
#dialog.novel-download .novel-download-link:hover { border-color:#c6c8e570; background:#d3c9e30d; }
#dialog.novel-download .novel-download-link:hover .novel-format-action { color:var(--format-tint); transform:translateY(2px); }
#dialog.novel-download .novel-download-link:focus-visible { outline:2px solid var(--accent-2); outline-offset:3px; }
@media(max-width:440px) {
  #dialog.novel-download { padding:19px 18px 20px; border-radius:19px; }
  #dialog.novel-download .dialog-head h2 { font-size:22px; }
  #dialog.novel-download .novel-download-note { margin-bottom:19px; }
  #dialog.novel-download .novel-download-link { gap:12px; min-height:88px; padding:15px 13px; border-radius:13px; }
  #dialog.novel-download .novel-format-symbol { flex-basis:36px; width:36px; height:46px; }
  #dialog.novel-download .novel-format-copy strong { font-size:16px; }
  #dialog.novel-download .novel-format-copy>span { font-size:10px; }
  #dialog.novel-download .novel-format-action { flex-basis:22px; width:22px; }
}
@media(prefers-reduced-motion:reduce) {
  #dialog.novel-download .novel-download-link,#dialog.novel-download .novel-download-close,#dialog.novel-download .novel-format-action { transition:none; }
}

/* Original page navigation: a full-width glass strip and one circular back.
   Titles stay available to assistive navigation without adding visible chrome. */
body[data-route="fanfic"] .page-topbar,body[data-route="emotes"] .page-topbar { z-index:50; background:rgba(14,12,22,.42); border-bottom:1px solid rgba(216,160,200,.16); -webkit-backdrop-filter:blur(16px) saturate(1.2); backdrop-filter:blur(16px) saturate(1.2); }
body[data-route="fanfic"] .page-topbar-inner { display:flex; align-items:center; gap:clamp(10px,1.8vw,16px); width:100%; min-height:calc(54px + env(safe-area-inset-top)); margin:0; padding:env(safe-area-inset-top) clamp(14px,3.6vw,30px) 0; }
body[data-route="fanfic"] #page-label,.has-gallery-tools>#page-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
body[data-route="fanfic"] .page-home,.has-gallery-tools>.page-home { display:none; }
body[data-route="fanfic"] #page-back,.has-gallery-tools>#page-back { display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; min-height:36px; padding:0; border-radius:50%; color:rgba(239,235,242,.82); background:rgba(216,160,200,.1); border:1px solid rgba(216,160,200,.26); transition:transform .45s cubic-bezier(.2,.7,.2,1),background .35s,color .35s,border-color .35s; }
body[data-route="fanfic"] #page-back svg,.has-gallery-tools>#page-back svg { width:16px; height:16px; }
body[data-route="fanfic"] #page-back>span,.has-gallery-tools>#page-back>span { display:none; }
body[data-route="fanfic"] #page-back:hover,body[data-route="fanfic"] #page-back:focus-visible,.has-gallery-tools>#page-back:hover,.has-gallery-tools>#page-back:focus-visible { background:rgba(216,160,200,.24); color:#fff; border-color:rgba(216,160,200,.55); transform:translateX(-3px); }

/* Gallery tools share the existing sticky bar. Its blur is stationary. */
html.emotes-open,html.emotes-open body { overscroll-behavior-y:contain; }
.page-topbar-inner.has-gallery-tools { display:flex; align-items:center; gap:clamp(10px,1.8vw,16px); width:100%; min-height:0; margin:0; padding:calc(env(safe-area-inset-top) + 9px) clamp(16px,4vw,34px) 9px; }
.gallery-toolbar { display:flex; flex:1; align-items:center; gap:clamp(10px,1.8vw,16px); min-width:0; }
.gallery-toolbar .gallery-categories { display:flex; flex:0 1 auto; align-items:center; flex-wrap:wrap; gap:8px; margin:0; }
.gallery-primary,.gallery-secondary { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.gallery-toolbar .chip { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:8px 16px; border-radius:999px; border:1px solid rgba(216,160,200,.2); background:rgba(239,235,242,.06); color:rgba(239,235,242,.72); font-size:13px; line-height:1.5; letter-spacing:.08em; white-space:nowrap; transition:background .38s,border-color .38s,color .38s,transform .38s cubic-bezier(.2,.7,.2,1),box-shadow .38s; }
.gallery-toolbar .chip.active { color:#fff; border-color:rgba(216,160,200,.62); background:linear-gradient(150deg,rgba(216,160,200,.34),rgba(216,160,200,.16)); box-shadow:0 8px 26px rgba(216,160,200,.22),inset 0 1px 0 rgba(255,255,255,.14); transform:translateY(-1px); }
.gallery-toolbar .chip:hover:not(.active) { border-color:rgba(216,160,200,.5); color:var(--ink); }
.gallery-toolbar .chip:active { transform:scale(.94); }
.gallery-toolbar .gallery-refresh { flex:0 0 36px; width:36px; height:36px; padding:9px; border:1px solid rgba(216,160,200,.26); border-radius:50%; color:rgba(239,235,242,.86); background:rgba(216,160,200,.1); transition:background .35s,color .35s,border-color .35s,transform .45s cubic-bezier(.2,.7,.2,1); }
.gallery-refresh .icon { width:17px; height:17px; }
.gallery-toolbar .gallery-refresh:hover,.gallery-toolbar .gallery-refresh:focus-visible { color:#fff; border-color:rgba(216,160,200,.55); background:rgba(216,160,200,.24); }
.gallery-refresh.is-refreshing .icon { animation:gallery-refresh-turn .65s cubic-bezier(.22,.8,.25,1); }
@keyframes gallery-refresh-turn { to { transform:rotate(360deg); } }
#view.gallery-page .gallery-local-tools { display:flex; position:sticky; top:0; align-items:center; gap:10px; margin:0 0 20px; padding:10px 0; background:#201a2bf0; border:0; border-radius:0; z-index:10; }
#view.gallery-page .gallery-back { flex:0 0 44px; }
#view.gallery-page .gallery-grid { clear:both; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
#view.gallery-page .emote-card { padding:8px; border-radius:14px; }
#view.gallery-page .emote-card>span { font-size:10px; margin:7px 0 0; }
#view.gallery-page .emote-missing { display:grid; place-items:center; width:100%; aspect-ratio:1; white-space:normal; color:var(--muted); font-size:11px; }
#view.gallery-page .gallery-sentinel { margin-top:16px; }
#view.gallery-page .gallery-credit { margin:24px 0 6px; font-size:11px; }
.gallery-pull { --pull-height:0px; height:var(--pull-height); display:flex; align-items:center; justify-content:center; gap:9px; overflow:hidden; color:var(--muted); font-size:12px; transition:height .24s ease; pointer-events:none; }
.gallery-pull .icon { width:17px; height:17px; transition:transform .2s,color .2s; }
.gallery-pull.is-ready { color:var(--accent-2); }
.gallery-pull.is-ready .icon { transform:rotate(180deg); }
.gallery-pull.is-complete { color:var(--accent); }

/* One original image and one understated download action. */
#dialog.emote-preview { width:min(560px,calc(100% - 28px)); padding:19px 22px 18px; border-radius:22px; background:linear-gradient(160deg,#282032f5,#17131ff7); border:1px solid #d8a0c840; box-shadow:0 24px 80px #08041070; }
#dialog.emote-preview .dialog-head { position:relative; min-height:40px; gap:14px; margin:0 0 12px; padding:0; }
#dialog.emote-preview .dialog-head h2 { color:#e9dfe9c9; font-size:12px; font-weight:400; letter-spacing:.025em; }
#dialog.emote-preview .emote-close { flex:0 0 40px; width:40px; height:40px; padding:11px; border:1px solid transparent; background:none; color:#dbcddd9e; border-radius:12px; }
#dialog.emote-preview .emote-close .icon { width:17px; height:17px; }
#dialog.emote-preview .emote-close:hover { background:#d8a0c80c; border-color:#d8a0c82b; color:#fff1fa; }
#dialog.emote-preview .emote-stage { min-height:120px; padding:10px 0; background:transparent; border:0; border-radius:0; }
#dialog.emote-preview .emote-original { display:block; max-width:100%; max-height:min(57dvh,490px); width:auto; height:auto; object-fit:contain; background:transparent; }
#dialog.emote-preview .dialog-actions { margin:16px 0 0; }
#dialog.emote-preview .emote-download { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:8px 20px; border:1px solid #d8a0c852; border-radius:999px; background:#e5bace09; color:#f0e4ef; font-size:13px; line-height:1.5; }
#dialog.emote-preview .emote-download .icon { width:17px; height:17px; color:var(--accent-2); }
#dialog.emote-preview .emote-download:hover { border-color:var(--live-color,var(--accent-2)); background:#e5bace15; }
#dialog.emote-preview .gallery-credit { text-align:center; font-size:10px; color:#c6b7cd94; margin:18px 0 0; }

@media(max-width:768px) {
  body[data-route="fanfic"] .page-topbar { background:transparent; border-bottom-color:transparent; -webkit-backdrop-filter:none; backdrop-filter:none; transition:background .28s ease,border-color .28s ease; }
  body[data-route="fanfic"].is-content-scrolled .page-topbar { background:rgba(14,12,22,.6); border-bottom-color:rgba(216,160,200,.16); -webkit-backdrop-filter:blur(16px) saturate(1.2); backdrop-filter:blur(16px) saturate(1.2); }
  body[data-route="fanfic"] .page-topbar-inner { min-height:calc(73px + env(safe-area-inset-top)); align-items:flex-start; padding:calc(env(safe-area-inset-top) + clamp(14px,3.6vw,20px)) clamp(14px,3.6vw,20px) 0; }
  body[data-route="fanfic"] #page-back,.has-gallery-tools>#page-back { flex-basis:44px; width:44px; height:44px; min-height:44px; }
  body[data-route="fanfic"] #page-back svg,.has-gallery-tools>#page-back svg { width:19px; height:19px; }
  body[data-route="emotes"] .page-topbar { background:rgba(18,14,26,.34); border:0; -webkit-backdrop-filter:blur(16px) saturate(1.15); backdrop-filter:blur(16px) saturate(1.15); }
  .page-topbar-inner.has-gallery-tools { position:relative; display:block; width:100%; padding:calc(env(safe-area-inset-top) + clamp(14px,3.6vw,20px)) clamp(14px,3.6vw,20px) 10px; }
  .has-gallery-tools>#page-back { position:absolute; top:calc(env(safe-area-inset-top) + clamp(14px,3.6vw,20px)); left:clamp(14px,3.6vw,20px); }
  .gallery-toolbar { display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:start; gap:7px 8px; }
  .gallery-toolbar .gallery-categories { display:contents; }
  .gallery-toolbar .gallery-primary { grid-column:1; grid-row:1; justify-content:center; flex-wrap:nowrap; gap:7px; padding-left:50px; }
  .gallery-toolbar .gallery-secondary { display:grid; grid-column:1/-1; grid-row:2; grid-template-columns:minmax(0,1.4fr) repeat(3,minmax(0,1fr)); gap:5px; }
  .gallery-toolbar .gallery-refresh { grid-column:2; grid-row:1; justify-self:end; flex-basis:44px; width:44px; height:44px; padding:11px; }
  .gallery-toolbar .gallery-refresh .icon { width:20px; height:20px; }
  .gallery-toolbar .chip { min-height:44px; padding:8px 12px; font-size:13px; letter-spacing:.02em; }
  .gallery-toolbar .gallery-primary .chip { padding-inline:11px; }
  .gallery-toolbar .gallery-secondary .chip { min-width:0; padding-inline:7px; letter-spacing:0; }
  #view.gallery-page .gallery-local-tools { display:block; padding-top:0; }
  #view.gallery-page .gallery-local-tools>.gallery-back { position:absolute; top:0; left:0; }
  #view.gallery-page .gallery-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
  #view.gallery-page .emote-card { padding:6px; border-radius:12px; }
  #dialog.emote-preview { padding:14px 16px 16px; border-radius:18px; }
}
