/* Use the treasure vault's title ornament on dialog title bars. */
:is(#scene-reader .scene-heading,#story-work-settings>header,#scene-history>header,#illustration-library>header,#home-settings>header,#home-calendar>header,#push-settings>header,.conversation-history-header,#rune-dialog .rune-heading){
 box-sizing:border-box;position:relative;inset:auto;width:100%;max-width:100%;margin:0;transform:none;isolation:isolate;display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:76px;padding:14px 18px 14px 28px;border-bottom:1px solid #ae795760;border-radius:19px 19px 0 0;background:linear-gradient(120deg,#231526,#17101e);flex-shrink:0;
}
:is(#scene-reader .scene-heading,#story-work-settings>header,#scene-history>header,#illustration-library>header,#home-settings>header,#home-calendar>header,#push-settings>header,.conversation-history-header,#rune-dialog .rune-heading)::before{
 content:"";position:absolute;top:3px;left:4px;width:80px;height:90px;background:url('assets/images/ui/dialogue-corner.svg') no-repeat left top / 80px auto;pointer-events:none;z-index:-1;
}
:is(#scene-reader .scene-heading,#story-work-settings>header,#scene-history>header,#illustration-library>header,#home-settings>header,#home-calendar>header,#push-settings>header,.conversation-history-header,#rune-dialog .rune-heading) h2{
 flex:1;min-width:0;margin:0;color:#f1dfcd;font-family:"Shippori Mincho", "Yu Mincho","Hiragino Mincho ProN",serif;font-size:clamp(22px,6vw,25px);font-weight:600;line-height:1.5;letter-spacing:.12em;overflow-wrap:anywhere;
}
:is(#scene-reader .scene-heading,#story-work-settings>header,#scene-history>header,#illustration-library>header,#home-settings>header,#home-calendar>header,#push-settings>header,.conversation-history-header,#rune-dialog .rune-heading) :is([data-close],button:last-child){
 flex:none;box-sizing:border-box;display:grid;place-items:center;width:44px;height:44px;min-height:44px;margin:0;padding:0;border:1px solid #c59a7d;border-radius:50%;background:linear-gradient(#432435,#201624);box-shadow:inset 0 0 0 3px #251927,inset 0 0 0 4px #c18a5a66;color:#f1dfcd;font:28px/1 system-ui,sans-serif;cursor:pointer;
}
:is(#scene-reader .scene-heading,#story-work-settings>header,#scene-history>header,#illustration-library>header,#home-settings>header,#home-calendar>header,#push-settings>header,.conversation-history-header,#rune-dialog .rune-heading) button:focus-visible{outline:2px solid #efc49a;outline-offset:3px}
@media(max-height:550px){#scene-reader .scene-heading{min-height:60px;padding-top:8px;padding-bottom:8px}}

#scene-reader .scene-heading h2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* Dialog headers must not inherit the room header's top/left/right offsets. */
#rune-dialog .rune-panel{padding:0 20px 16px}
#rune-dialog .rune-heading{width:calc(100% + 40px);max-width:none;margin:0 -20px 12px}
#conversation-history .conversation-history-header{width:calc(100% + 36px);max-width:none;margin:-18px -18px 0}

/* Work names stay quieter than the section headings. */
#scene-reader.story-reading-active .scene-heading h2{font-size:clamp(17px,4.8vw,20px);font-weight:400;letter-spacing:.08em}

/* Calendar-style section headings; reading pages keep their existing navigation. */
:is(#scene-reader .scene-heading,#illustration-library>header,#home-settings>header){
 display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:0 10px;
 min-height:78px;padding:12px 18px;
 background:#1d1224 url('/assets/images/ui/calendar-branch.svg') 8px center/96px auto no-repeat;
 border-bottom:1px solid #b98c65;
}
:is(#scene-reader .scene-heading,#illustration-library>header,#home-settings>header)::before{content:none;background:none}
:is(#scene-reader .scene-heading,#illustration-library>header,#home-settings>header) h2{
 grid-column:2;grid-row:1;align-self:end;margin:0;text-align:center;
 font:600 26px/1.5 "Shippori Mincho", 'Yu Mincho','Hiragino Mincho ProN',serif;letter-spacing:.18em;
}
:is(#scene-reader .scene-heading,#illustration-library>header,#home-settings>header)::after{
 content:var(--section-subtitle);grid-column:2;grid-row:2;min-width:0;
 text-align:center;color:#f2dfc8;font:11px/1.5 "Shippori Mincho", 'Yu Mincho',serif;letter-spacing:.08em;
}
#scene-reader .scene-heading{--section-subtitle:'言の葉に灯る、幾つもの世界'}
#illustration-library>header{--section-subtitle:'色褪せない景色を、いつまでも'}
#home-settings>header{--section-subtitle:'この居場所を、明日へ繋ぐ'}
:is(#scene-reader .scene-heading,#illustration-library>header,#home-settings>header) [data-close]{
 grid-column:3;grid-row:1/3;align-self:center;justify-self:center;
}
#scene-reader.story-reading-active .scene-heading h2{font-size:clamp(17px,4.8vw,20px);font-weight:400;letter-spacing:.08em}
@media(max-width:360px){
 :is(#scene-reader .scene-heading,#illustration-library>header,#home-settings>header){padding-left:12px;padding-right:12px;background-size:88px auto}
 :is(#scene-reader .scene-heading,#illustration-library>header,#home-settings>header) h2{font-size:24px}
 :is(#scene-reader .scene-heading,#illustration-library>header,#home-settings>header)::after{font-size:10px}
 #scene-reader.story-reading-active .scene-heading h2{font-size:17px}
}

/* A work's name needs its own space beyond the crescent, without a subtitle. */
#scene-reader.story-reading-active .scene-heading{grid-template-columns:96px minmax(0,1fr) 12px}
#scene-reader.story-reading-active .scene-heading::after{content:none}
#scene-reader.story-reading-active .scene-heading h2{
 grid-row:1;align-self:center;display:block;overflow:visible;
 -webkit-line-clamp:unset;font-size:16px;line-height:1.65;letter-spacing:.04em;text-align:right;
}

#push-settings:not(.manage-editor)>header{
 display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:0 10px;
 min-height:78px;padding:12px 18px;
 background:#1d1224 url('/assets/images/ui/calendar-branch.svg') 8px center/96px auto no-repeat;
 border-bottom:1px solid #b98c65;
}
#push-settings:not(.manage-editor)>header::before{content:none;background:none}
#push-settings:not(.manage-editor)>header h2{grid-column:2;align-self:center;text-align:center;font-size:22px;letter-spacing:.1em}
#push-settings>section>.push-door-back{display:block;width:100%;margin:30px 0 8px;padding:12px 0;border:0;border-radius:0;background:transparent;color:#e5b7c9;font:14px/1.7 "Shippori Mincho", 'Yu Mincho',serif;text-align:center}
@media(max-width:360px){
 #push-settings:not(.manage-editor)>header{padding-left:12px;padding-right:12px;background-size:88px auto}
 #push-settings:not(.manage-editor)>header h2{font-size:20px}
}
@media(max-width:360px){
 #scene-reader.story-reading-active .scene-heading{grid-template-columns:88px minmax(0,1fr) 8px}
 #scene-reader.story-reading-active .scene-heading h2{font-size:15px}
}

/* Conversation history has a centered title without a subtitle. */
:is(#conversation-history .conversation-history-header,#scene-history>header){
 display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:0 10px;
 min-height:78px;padding:12px 18px;
 background:#1d1224 url('/assets/images/ui/calendar-branch.svg') 8px center/96px auto no-repeat;
 border-bottom:1px solid #b98c65;
}
:is(#conversation-history .conversation-history-header,#scene-history>header)::before{content:none;background:none}
:is(#conversation-history .conversation-history-header,#scene-history>header) h2{grid-column:2;grid-row:1;align-self:center;text-align:center;font-size:22px;letter-spacing:.1em}
:is(#conversation-history .conversation-history-header,#scene-history>header) button{grid-column:3;grid-row:1;align-self:center;justify-self:center}
@media(max-width:360px){
 :is(#conversation-history .conversation-history-header,#scene-history>header){padding-left:12px;padding-right:12px;background-size:88px auto}
 :is(#conversation-history .conversation-history-header,#scene-history>header) h2{font-size:20px}
}

/* Keep the door and notification headings outside their scrolling content. */
#home-settings[open],#push-settings[open]:not(.manage-editor){display:flex;flex-direction:column;overflow:hidden}
#home-settings>header,#push-settings:not(.manage-editor)>header{flex:0 0 auto}
#home-settings>.home-menu-content,#push-settings:not(.manage-editor)>section{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-color:#986577 #241727}
#push-settings:not(.manage-editor)>header h2{grid-row:1;align-self:center;transform:translateY(4px)}

/* The daily talisman uses the same flower and crescent as the other sections. */
#rune-dialog .rune-heading{
 display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:0 10px;
 min-height:78px;padding:12px 18px;
 background:#1d1224 url('/assets/images/ui/calendar-branch.svg') 8px center/96px auto no-repeat;
 border-bottom:1px solid #b98c65;
}
#rune-dialog .rune-heading::before{content:none;background:none}
#rune-dialog .rune-heading h2{grid-column:2;grid-row:1;align-self:end;text-align:center;font-size:22px;letter-spacing:.1em}
#rune-dialog .rune-heading::after{content:'今日のお前に、言霊をひとつ';grid-column:2;grid-row:2;min-width:0;text-align:center;color:#f2dfc8;font:11px/1.5 "Shippori Mincho", 'Yu Mincho',serif;letter-spacing:.08em}
#rune-dialog .rune-heading #rune-close{grid-column:3;grid-row:1/3;align-self:center;justify-self:center}
@media(max-width:360px){
 #rune-dialog .rune-heading{padding-left:12px;padding-right:12px;background-size:88px auto}
 #rune-dialog .rune-heading h2{font-size:20px}
 #rune-dialog .rune-heading::after{font-size:10px}
}
