/* Story and reader experience v1.3.0 — built for doujin browsing and long-form reading. */
.d4-story-page{width:min(1220px,100%);padding:28px 24px 72px}
.d4-story-page .d4-detail-story{gap:42px}
.d4-story-hero{position:relative;isolation:isolate;display:grid;grid-template-columns:238px minmax(0,1fr);gap:38px;align-items:start;overflow:hidden;padding:30px;border:1px solid #3d3941;border-radius:20px;background:#18171b;box-shadow:0 28px 70px rgba(0,0,0,.28)}
.d4-story-backdrop{position:absolute;z-index:-3;inset:-25%;width:150%;height:150%;object-fit:cover;filter:blur(38px) saturate(.65) brightness(.36);opacity:.55}
.d4-story-shade{position:absolute;z-index:-2;inset:0;background:linear-gradient(100deg,rgba(18,18,21,.98) 0%,rgba(18,18,21,.92) 40%,rgba(34,21,28,.82) 100%),radial-gradient(circle at 92% 10%,rgba(245,121,144,.2),transparent 38%)}
.d4-story-hero .d4-detail-cover{width:100%;margin:0;aspect-ratio:2/3;border:1px solid rgba(255,255,255,.16);border-radius:12px;background:#242329;box-shadow:0 20px 44px rgba(0,0,0,.42)}
.d4-story-hero .d4-detail-cover>img,.d4-story-hero .d4-nocover{display:block;width:100%;height:100%;object-fit:cover}
.d4-story-copy{min-width:0;padding:2px 0 0}
.d4-story-eyebrow{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-bottom:12px}
.d4-story-eyebrow span{display:inline-flex;align-items:center;min-height:30px;padding:4px 11px;border:1px solid #76505b;border-radius:999px;background:#2d1c23;color:#f6a9b8;font-size:13px;font-weight:600}
.d4-story-eyebrow b{color:#d3cdd4;font-size:14px;font-weight:500}
.d4-story-copy h1{max-width:880px;margin:0;color:var(--text);font:700 clamp(31px,4vw,48px)/1.28 var(--font);letter-spacing:-.025em;text-wrap:balance;overflow-wrap:anywhere}
.d4-story-copy .d4-alt-title{max-width:72ch;margin:8px 0 0;color:#bdb7c1;font-size:15px;line-height:1.7}
.d4-story-tags{display:flex;flex-wrap:wrap;gap:7px;margin-top:17px}
.d4-story-tags a,.d4-story-tags span{display:inline-flex;align-items:center;min-height:32px;padding:4px 10px;border:1px solid #49454d;border-radius:7px;background:rgba(30,30,34,.78);color:#e6e1e7;font-size:13px}
.d4-story-tags a:hover{border-color:#9a5a6a;color:#f6a9b8}
.d4-story-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:22px 0 0;border-block:1px solid rgba(255,255,255,.1)}
.d4-story-facts>div{min-width:0;padding:14px 18px;border-right:1px solid rgba(255,255,255,.1)}
.d4-story-facts>div:first-child{padding-left:0}
.d4-story-facts>div:last-child{border-right:0}
.d4-story-facts dt{display:flex;align-items:center;gap:7px;color:#aaa4ae;font-size:13px}
.d4-story-facts dt svg{width:16px;height:16px;fill:none;stroke:#f08da0;stroke-width:1.8}
.d4-story-facts dd{margin:3px 0 0;color:#f3eff4;font-size:15px;font-weight:600;overflow-wrap:anywhere}
.d4-story-copy .d4-series-note{margin:14px 0 0;color:#d7d1d8}
.d4-story-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:24px}
.d4-story-actions>a,.d4-story-actions>button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:52px;padding:11px 17px;border:1px solid #4b4750;border-radius:9px;font:600 15px/1.4 var(--font);cursor:pointer;transition:transform .18s ease,border-color .18s ease,background .18s ease}
.d4-story-actions svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.9}
.d4-story-read{min-width:190px;border-color:#f57990!important;background:#f57990;color:#24131a}
.d4-story-latest,.d4-story-actions .d4-save-button{background:#242329;color:#f2edf2}
.d4-story-actions>a:hover,.d4-story-actions>button:hover{transform:translateY(-2px);border-color:#a85d70}
.d4-story-about{max-width:none;display:grid;grid-template-columns:minmax(220px,290px) minmax(0,1fr);gap:4px 34px;padding:26px 28px;border-radius:16px;background:linear-gradient(135deg,#1e1d22,#1a181e)}
.d4-story-about .d4-section-heading{grid-row:1/3;align-self:start;margin:0}
.d4-story-about .d4-about-copy{max-width:76ch}
.d4-story-about .d4-about-meta{grid-column:2;margin-top:12px}
.d4-story-preview .d4-preview-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.d4-story-preview .d4-preview-card{aspect-ratio:3/4;border-color:#3f3d45;border-radius:8px;background:#1e1d22}
.d4-story-preview .d4-preview-card:focus-visible{outline-offset:3px}
.d4-story-chapters{overflow:hidden;margin:0;padding:0;border:1px solid #3d3941;border-radius:16px;background:#19181c}
.d4-chapter-toolbar{position:relative;z-index:2;display:flex;align-items:end;justify-content:space-between;gap:22px;padding:22px 24px;border-bottom:1px solid #3d3941;background:#201e24}
.d4-chapter-title p{margin:0;color:#f08da0;font-size:12px;font-weight:700;letter-spacing:.08em}
.d4-chapter-title h2{margin:2px 0 0;font:700 27px/1.35 var(--font)}
.d4-chapter-title h2 span{color:#aaa4ae;font-weight:500}
.d4-chapter-tools{display:grid;grid-template-columns:minmax(220px,340px) auto;gap:9px;align-items:center}
.d4-chapter-search{display:flex;align-items:center;gap:9px;min-height:46px;padding:0 12px;border:1px solid #47434b;border-radius:8px;background:#151418}
.d4-chapter-search svg{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:#a9a3ad;stroke-width:1.8}
.d4-chapter-search input{width:100%;min-width:0;min-height:44px;padding:0;border:0;background:transparent;color:#f3eff4;font-size:15px;outline:0}
.d4-chapter-tools [data-chapter-sort]{min-height:46px;padding:9px 15px;border:1px solid #5d4b53;border-radius:8px;background:#2b2025;color:#f6a9b8;font-size:14px}
.d4-chapter-list{max-height:760px;overflow:auto;scrollbar-color:#6a4a55 #18171b;overscroll-behavior:contain}
.d4-chapter-row{display:grid;grid-template-columns:88px minmax(0,1fr) auto;align-items:center;gap:18px;min-height:72px;padding:11px 22px;border-bottom:1px solid #2f2d33;background:#19181c;transition:background .16s ease,border-color .16s ease}
.d4-chapter-row:last-child{border-bottom:0}
a.d4-chapter-row:hover{background:#231e23;border-color:#4b3740}
.d4-chapter-row>b{display:flex;align-items:baseline;gap:6px;color:#f08da0;font:700 21px/1 var(--font)}
.d4-chapter-row>b small{color:#8f8993;font-size:11px;font-weight:500}
.d4-chapter-row>span{min-width:0}
.d4-chapter-row>span strong{display:block;overflow:hidden;color:#eee9ef;font-size:15px;font-weight:600;white-space:nowrap;text-overflow:ellipsis}
.d4-chapter-row>span small{display:block;margin-top:2px;color:#918b95;font-size:12px}
.d4-chapter-row>em{display:flex;align-items:center;gap:7px;color:#f3a4b4;font-size:13px;font-style:normal;white-space:nowrap}
.d4-chapter-row>em svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2}
.d4-chapter-row.is-pending{opacity:.55}
.d4-chapter-empty{margin:0;padding:28px;text-align:center;color:#aaa4ae}

/* Reader */
.d4-reader-v130{--reader-width:100%;--reader-brightness:1;position:relative;min-height:100vh;background:#111114;color:#f2eef3;transition:background .2s ease}
.d4-reader-v130.is-black{background:#050506}
.d4-read-progress{position:fixed;z-index:80;bottom:0;left:0;width:var(--d4-read-progress,0%);height:3px;background:#f57990;box-shadow:0 0 14px rgba(245,121,144,.55);pointer-events:none}
.d4-reader-toolbar{position:sticky;z-index:35;top:84px;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:76px;padding:11px max(20px,calc((100vw - 1180px)/2));border-bottom:1px solid #37343b;background:rgba(24,23,27,.96);box-shadow:0 10px 24px rgba(0,0,0,.18);backdrop-filter:blur(14px);transition:transform .2s ease}
.admin-bar .d4-reader-toolbar{top:116px}
.d4-reader-context{display:flex;align-items:center;gap:11px;min-width:0;max-width:430px}
.d4-reader-back{display:grid;place-items:center;width:44px;height:44px;flex:0 0 44px;border:1px solid #4a4650;border-radius:8px;background:#1c1b20}
.d4-reader-back svg,.d4-reader-step svg,.d4-reader-focus svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2}
.d4-reader-context>div{min-width:0}
.d4-reader-context small,.d4-reader-context strong{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.d4-reader-context small{color:#aaa4ae;font-size:12px}
.d4-reader-context strong{color:#f3eff4;font-size:16px}
.d4-reader-controls{display:flex;align-items:center;justify-content:flex-end;gap:7px;min-width:0}
.d4-reader-step,.d4-reader-focus{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:46px;padding:9px 12px;border:1px solid #4a4650;border-radius:8px;background:#1c1b20;color:#eee9ef;font:500 14px/1.4 var(--font)}
.d4-reader-step.is-next{border-color:#f57990;background:#f57990;color:#24131a}
.d4-reader-step.is-disabled{color:#706b74;background:#17161a}
.d4-reader-focus{cursor:pointer}
.d4-reader-select-wrap{min-width:180px;max-width:320px;flex:1}
.d4-reader-select-wrap select{width:100%;height:46px;padding:8px 34px 8px 12px;border:1px solid #5b5058;border-radius:8px;background:#111114;color:#f3eff4;font:500 14px/1.4 var(--font);text-overflow:ellipsis}
.d4-reader-intro{display:grid;grid-template-columns:92px minmax(0,1fr) auto;gap:18px 22px;align-items:center;width:min(960px,calc(100% - 32px));margin:28px auto;padding:20px;border:1px solid #38353d;border-radius:14px;background:linear-gradient(135deg,#1d1b20,#17161a);box-shadow:0 18px 42px rgba(0,0,0,.2)}
.d4-reader-intro>img{width:92px;aspect-ratio:2/3;grid-row:1/3;object-fit:cover;border:1px solid #4b4650;border-radius:7px}
.d4-reader-intro-copy{min-width:0}
.d4-reader-intro-copy p{margin:0 0 3px;color:#f08da0;font-size:12px;font-weight:700;letter-spacing:.06em}
.d4-reader-intro-copy h1{margin:0;overflow:hidden;color:#f4f0f4;font:700 23px/1.4 var(--font);white-space:nowrap;text-overflow:ellipsis}
.d4-reader-intro-copy span{color:#aaa4ae;font-size:14px}
.d4-reader-save{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:9px 14px;border:1px solid #504b54;border-radius:8px;background:#252229;color:#f2edf2;font:500 14px var(--font)}
.d4-reader-save svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}
.d4-reader-save[aria-pressed=true]{border-color:#f57990;color:#f6a9b8}
.d4-page-jumps{grid-column:2/4;display:flex;gap:7px;overflow-x:auto;padding:2px 0 5px;scrollbar-width:thin}
.d4-page-jumps a{display:flex;align-items:center;gap:7px;min-width:max-content;min-height:42px;padding:7px 10px;border:1px solid #403c44;border-radius:7px;background:#141317;color:#bdb7c1;font-size:12px}
.d4-page-jumps a b{color:#f08da0;font-size:14px}
.d4-reader-settings{grid-column:1/-1;border-top:1px solid #35323a;padding-top:12px}
.d4-reader-settings summary{width:max-content;min-height:40px;padding:7px 0;color:#d8d3da;font-size:14px;cursor:pointer}
.d4-reader-settings>div{display:grid;grid-template-columns:minmax(170px,1fr) minmax(170px,1fr) auto;gap:16px;align-items:end;padding-top:10px}
.d4-reader-settings label{display:grid;gap:6px;color:#aaa4ae;font-size:12px}
.d4-reader-settings input{width:100%;accent-color:#f57990}
.d4-reader-settings button{min-height:44px;padding:8px 12px;border:1px solid #4b4650;border-radius:7px;background:#141317;color:#eee9ef;font:14px var(--font)}
.d4-reader-pages{width:var(--reader-width);max-width:960px;margin:0 auto;background:#09090b}
.d4-reader-pages figure{width:100%;margin:0;scroll-margin-top:168px;background:#17161a}
.d4-reader-pages img{display:block;width:100%;height:auto!important;min-height:120px;filter:brightness(var(--reader-brightness));background:#17161a;overflow-anchor:none}
.d4-reader-state{width:min(960px,calc(100% - 32px));margin:30px auto;padding:30px;border:1px solid #3e3942;border-radius:12px;background:#1b191e}
.d4-reader-end{width:min(960px,calc(100% - 32px));margin:0 auto;padding:48px 20px 92px;text-align:center}
.d4-reader-end>p{margin:0;color:#f08da0;font-size:12px;font-weight:700;letter-spacing:.08em}
.d4-reader-end h2{margin:4px 0 22px;font-size:28px}
.d4-reader-end-nav{display:flex;justify-content:center;flex-wrap:wrap;gap:9px}
.d4-reader-end-nav a{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:10px 16px;border:1px solid #47424b;border-radius:8px;background:#1d1b20;color:#f1edf2;font-weight:600}
.d4-reader-end-nav a.is-primary{border-color:#f57990;background:#f57990;color:#24131a}
.d4-reader-end-nav svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2}
.d4-hidden-ui .d4-reader-toolbar{transform:translateY(-160%)}

@media(max-width:980px){
 .d4-story-hero{grid-template-columns:210px minmax(0,1fr);gap:28px;padding:24px}
 .d4-story-facts{grid-template-columns:1fr}
 .d4-story-facts>div,.d4-story-facts>div:first-child{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;padding:9px 0;border-right:0;border-bottom:1px solid rgba(255,255,255,.08)}
 .d4-story-facts>div:last-child{border-bottom:0}
 .d4-story-facts dd{margin:0}
 .d4-story-about{grid-template-columns:1fr}
 .d4-story-about .d4-section-heading{grid-row:auto}
 .d4-story-about .d4-about-meta{grid-column:auto}
 .d4-story-preview .d4-preview-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .d4-reader-toolbar{align-items:stretch}
 .d4-reader-context{max-width:280px}
 .d4-reader-step span{display:none}
 .d4-reader-step{width:46px;padding:9px}
 .d4-reader-focus span{display:none}
 .d4-reader-focus{width:46px;padding:9px}
 .d4-reader-select-wrap{min-width:150px}
}

@media(max-width:680px){
 .d4-story-page{padding:16px 14px 56px}
 .d4-story-page .d4-breadcrumb{margin-bottom:12px}
 .d4-story-page .d4-detail-story{gap:34px}
 .d4-story-hero{grid-template-columns:112px minmax(0,1fr);gap:14px;padding:14px;border-radius:14px}
 .d4-story-hero .d4-detail-cover{grid-row:1/5;border-radius:8px}
 .d4-story-copy{display:contents}
 .d4-story-eyebrow,.d4-story-copy h1,.d4-story-copy .d4-alt-title,.d4-story-tags{grid-column:2}
 .d4-story-eyebrow{gap:6px;margin:0}
 .d4-story-eyebrow span{min-height:27px;padding:3px 8px;font-size:11px}
 .d4-story-eyebrow b{font-size:11px}
 .d4-story-copy h1{font-size:21px;line-height:1.4}
 .d4-story-copy .d4-alt-title{display:-webkit-box;margin:0;font-size:12px;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
 .d4-story-tags{gap:5px;margin:0}
 .d4-story-tags a,.d4-story-tags span{min-height:27px;padding:3px 7px;font-size:11px}
 .d4-story-facts,.d4-story-copy .d4-series-note,.d4-story-actions{grid-column:1/-1}
 .d4-story-facts{margin-top:12px}
 .d4-story-facts>div,.d4-story-facts>div:first-child{grid-template-columns:98px minmax(0,1fr);padding:9px 0}
 .d4-story-facts dt,.d4-story-facts dd{font-size:12px}
 .d4-story-actions{display:grid;grid-template-columns:1fr 1fr;margin-top:10px}
 .d4-story-actions>a,.d4-story-actions>button{width:100%;min-width:0;min-height:50px;padding:9px 8px;font-size:14px}
 .d4-story-read{grid-column:1/-1}
 .d4-story-about{gap:14px;padding:19px 17px}
 .d4-story-preview .d4-preview-grid{display:flex;grid-template-columns:none;gap:10px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x proximity}
 .d4-story-preview .d4-preview-card{flex:0 0 136px;scroll-snap-align:start}
 .d4-chapter-toolbar{display:block;padding:18px 16px}
 .d4-chapter-title h2{font-size:23px}
 .d4-chapter-tools{grid-template-columns:minmax(0,1fr) auto;margin-top:14px}
 .d4-chapter-search{min-width:0}
 .d4-chapter-list{max-height:680px}
 .d4-chapter-row{grid-template-columns:66px minmax(0,1fr);gap:12px;min-height:72px;padding:10px 14px}
 .d4-chapter-row>b{font-size:18px}
 .d4-chapter-row>span strong{font-size:14px}
 .d4-chapter-row>em{grid-column:2;font-size:12px}
 .d4-reader-toolbar{top:76px;display:block;min-height:0;padding:8px 10px}
 .admin-bar .d4-reader-toolbar{top:122px}
 .d4-reader-context{max-width:none;margin-bottom:7px}
 .d4-reader-back{width:40px;height:40px;flex-basis:40px}
 .d4-reader-context small{font-size:11px}
 .d4-reader-context strong{font-size:14px}
 .d4-reader-controls{display:grid;grid-template-columns:44px minmax(0,1fr) 44px 44px;gap:6px}
 .d4-reader-step,.d4-reader-focus{width:44px;min-height:44px;padding:8px}
 .d4-reader-select-wrap{min-width:0;max-width:none}
 .d4-reader-select-wrap select{height:44px;font-size:13px}
 .d4-reader-intro{grid-template-columns:74px minmax(0,1fr);gap:12px;width:calc(100% - 24px);margin:16px auto;padding:14px}
 .d4-reader-intro>img{width:74px;grid-row:1/2}
 .d4-reader-intro-copy h1{font-size:18px}
 .d4-reader-intro-copy span{font-size:12px}
 .d4-reader-save{grid-column:1/-1;width:100%}
 .d4-page-jumps{grid-column:1/-1}
 .d4-reader-settings{grid-column:1/-1}
 .d4-reader-settings>div{grid-template-columns:1fr;gap:12px}
 .d4-reader-pages{max-width:100%}
 .d4-reader-pages figure{scroll-margin-top:166px}
 .d4-reader-end{padding:38px 12px 74px}
 .d4-reader-end h2{font-size:24px}
 .d4-reader-end-nav{display:grid;grid-template-columns:1fr 1fr}
 .d4-reader-end-nav a{padding:9px 10px;font-size:14px}
 .d4-reader-end-nav a.is-primary{grid-column:1/-1}
}

@media(max-width:370px){
 .d4-story-hero{grid-template-columns:100px minmax(0,1fr);gap:11px;padding:11px}
 .d4-story-copy h1{font-size:19px}
 .d4-story-tags a:nth-child(n+3){display:none}
 .d4-chapter-tools{grid-template-columns:1fr}
 .d4-chapter-tools [data-chapter-sort]{width:100%}
}

@media(prefers-reduced-motion:reduce){.d4-story-actions>a,.d4-story-actions>button,.d4-chapter-row,.d4-reader-toolbar,.d4-reader-v130{transition:none!important}}
