/* A-series interiors: readable letters and compact game settings. */
dialog#modal[data-view="story"] :is(.story-prologue,.story-layout,.story-letter-paper,.story-letter-list),
dialog#modal[data-view="settings"] :is(.settings-row,.release-settings){min-width:0;box-sizing:border-box}

dialog#modal[data-view="story"] .story-prologue{gap:16px;margin:0 0 22px;padding:20px;background:#edf7fa;border:1px solid #c9e0e7;border-radius:18px;color:#07506d;box-shadow:none}
dialog#modal[data-view="story"] .story-prologue>div{min-width:0;flex:1}
dialog#modal[data-view="story"] .story-prologue h3{margin:5px 0 9px;color:#07506d;font-size:22px;line-height:1.35;letter-spacing:0}
dialog#modal[data-view="story"] .story-prologue p{margin:0;color:#456977;font-size:14px;line-height:1.8}
dialog#modal[data-view="story"] .story-prologue .eyebrow{color:#488299;font-size:11px}
dialog#modal[data-view="story"] .story-cover-mark{flex-basis:54px;width:54px}
dialog#modal[data-view="story"] .story-cover-mark .ui-sprite{width:54px;height:54px}
dialog#modal[data-view="story"] .story-chapter-count{flex-basis:70px;color:#587c8b;font-size:11px;line-height:1.6}
dialog#modal[data-view="story"] .story-chapter-count b{color:#0789aa;font-size:32px;line-height:1.2}

dialog#modal[data-view="story"] .story-layout{grid-template-columns:210px minmax(0,1fr);gap:22px}
dialog#modal[data-view="story"] .story-letter-list{padding:2px;scrollbar-color:#7eafc0 #e8f2f4}
dialog#modal[data-view="story"] .story-letter-list section+section{margin-top:19px}
dialog#modal[data-view="story"] .story-letter-list h4{margin:0 0 9px;padding:0 9px;color:#608595;font-size:11px;line-height:1.6;letter-spacing:.02em}
dialog#modal[data-view="story"] .story-letter{gap:9px;min-height:62px;margin:5px 0;padding:11px 10px;border:1px solid transparent;border-image:none;border-radius:12px;background:transparent;color:#315e71;box-shadow:none;text-shadow:none}
dialog#modal[data-view="story"] .story-letter>span:last-child{min-width:0}
dialog#modal[data-view="story"] .story-letter b{font-size:13px;line-height:1.5}
dialog#modal[data-view="story"] .story-letter small{margin-top:3px;color:#6a8792;font-size:10px;line-height:1.6}
dialog#modal[data-view="story"] .story-letter.selected{border-color:#a0cedd;background:#deeff5;box-shadow:inset 3px 0 #199bbe;color:#07506d}
dialog#modal[data-view="story"] .story-letter.selected small{color:#3f788c}
dialog#modal[data-view="story"] .story-letter:disabled{opacity:1;color:#87999f}
dialog#modal[data-view="story"] .story-letter:disabled small{color:#8f9fa5}
dialog#modal[data-view="story"] .story-letter-dot{width:25px;height:25px;flex-basis:25px;border:1px solid #b4d1dc;background:#fffdf4;color:#588192;font-size:13px}
dialog#modal[data-view="story"] .story-letter.selected .story-letter-dot{border-color:#159ab8;background:#159ab8;color:white}
dialog#modal[data-view="story"] .story-letter.complete .story-letter-dot{border-color:#2b95b0;background:#2b95b0;color:white}

dialog#modal[data-view="story"] .story-letter-paper.paper-frame{min-height:0;padding:24px!important;border:1px solid #d1e1e4;border-image:none;border-radius:20px;background:#fffdf5;color:#07506d;box-shadow:0 4px 0 #07506d0b}
dialog#modal[data-view="story"] .story-sender{gap:15px;padding:0 0 19px;margin:0 0 21px;border-bottom:1px solid #d9e6e8}
dialog#modal[data-view="story"] .story-avatar{width:76px;height:78px;flex:0 0 76px;background:#d7eef4;border:2px solid #fff;border-radius:19px;box-shadow:0 3px 0 #aecfda;transform:none}
dialog#modal[data-view="story"] .story-sender>div{min-width:0}
dialog#modal[data-view="story"] .story-sender small{display:block;color:#5f8090;font-size:12px;line-height:1.6}
dialog#modal[data-view="story"] .story-sender h3{margin:5px 0 0;color:#07506d;font-size:23px;line-height:1.3}
dialog#modal[data-view="story"] .story-postmark{display:none}
dialog#modal[data-view="story"] .story-letter-paper>.eyebrow{color:#668894;font-size:11px;line-height:1.6;letter-spacing:.04em}
dialog#modal[data-view="story"] .story-letter-paper>h2{margin:7px 0 18px;color:#07506d;font-size:25px;line-height:1.4;letter-spacing:0}
dialog#modal[data-view="story"] .story-dialogue{box-sizing:border-box;min-width:0;min-height:0;margin:0;padding:22px 24px;background:#fff9e9;border:1px solid #e7dec9;border-radius:15px;color:#355d6d;font-size:15px;line-height:1.85;overflow-wrap:anywhere}
dialog#modal[data-view="story"] .story-dialogue p{margin:0 0 16px;color:inherit;font-size:inherit;line-height:inherit}
dialog#modal[data-view="story"] .story-dialogue p:last-child{margin-bottom:0}
dialog#modal[data-view="story"] .story-objective{gap:14px;margin-top:20px;padding:17px 18px;background:#eaf5f8;border:1px solid #d2e7ed;border-radius:14px}
dialog#modal[data-view="story"] .story-objective>div{min-width:0}
dialog#modal[data-view="story"] .story-objective span{margin-bottom:6px;color:#668a99;font-size:11px;line-height:1.5}
dialog#modal[data-view="story"] .story-objective b{color:#165773;font-size:14px;line-height:1.6}
dialog#modal[data-view="story"] .story-objective strong{color:#158ba9;font-size:26px;font-variant-numeric:tabular-nums}
dialog#modal[data-view="story"] .story-objective strong small{color:#6d96a4;font-size:13px}
dialog#modal[data-view="story"] .story-progress{height:6px;margin:10px 2px 22px;background:#dbeaf0}
dialog#modal[data-view="story"] .story-progress i{background:linear-gradient(90deg,#168caf,#46c3d3)}
dialog#modal[data-view="story"] .story-reward{gap:18px;flex-wrap:wrap;align-items:center}
dialog#modal[data-view="story"] .story-reward>span{grid-template-columns:32px auto;column-gap:7px;min-width:0}
dialog#modal[data-view="story"] .story-reward .ui-sprite{width:32px;height:32px}
dialog#modal[data-view="story"] .story-reward b{color:#906624;font-size:15px;line-height:1.6}
dialog#modal[data-view="story"] .story-reward small{color:#77909a;font-size:11px;line-height:1.6}
dialog#modal[data-view="story"] .story-reward button{flex:0 1 180px;min-width:130px;min-height:48px;padding:12px 20px;font-size:14px}
dialog#modal[data-view="story"] .story-reward>.owned-badge{display:block;width:auto;padding:10px 15px;border:1px solid #c4dee8;border-radius:12px;background:#e8f4f7;color:#21718b;font-size:13px;font-weight:700}
dialog#modal[data-view="story"] .story-person{margin-top:24px;padding-top:15px;border-top:1px solid #d9e6e8;color:#51798a;font-size:13px;line-height:1.8}
dialog#modal[data-view="story"] .story-person summary{min-height:44px;box-sizing:border-box;padding:9px 3px;color:#1d6986;font-weight:650;line-height:1.8;cursor:pointer}
dialog#modal[data-view="story"] .story-person p{margin:10px 0 0;padding:17px 18px;background:#edf6f8;border-radius:12px;color:#456b7b;font-size:14px;line-height:1.85}
dialog#modal[data-view="story"] .story-ending{margin:18px 0 0;padding:18px;border:1px solid #d8e9ed;border-radius:12px;background:#eef7f8;color:#3e7287;font-size:14px;line-height:1.8}
dialog#modal[data-view="story"] #modal-body>.settings-small{margin:20px 3px 2px;color:#6c8792;font-size:11px;line-height:1.8}

dialog#modal[data-view="settings"] .settings-row{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:16px;row-gap:8px;margin:0;padding:19px 3px;border-bottom:1px solid #d6e5e8;align-items:center}
dialog#modal[data-view="settings"] .settings-row:first-child{padding-top:3px}
dialog#modal[data-view="settings"] .settings-row>div{display:contents}
dialog#modal[data-view="settings"] .settings-row b{grid-column:1;grid-row:1;color:#07506d;font-size:15px;line-height:1.5;font-weight:750}
dialog#modal[data-view="settings"] .settings-row p{grid-column:1/-1;grid-row:2;margin:0;color:#587887;font-size:13px;line-height:1.8}
dialog#modal[data-view="settings"] .settings-row>button{grid-column:2;grid-row:1;min-width:108px;min-height:44px;margin:0;padding:10px 14px;border:1px solid #c2dee7;border-image:none;border-radius:13px;background:#e3f2f6;box-shadow:0 2px 0 #b6d8e3;color:#116784;font-size:12px;line-height:1.4;font-weight:750;text-shadow:none;filter:none}
dialog#modal[data-view="settings"] .settings-row>button[aria-checked=true]{border-color:#188cae;background:#138dab;color:#fff;box-shadow:inset 0 1px #8fe3ed77,0 2px 0 #08657f}
dialog#modal[data-view="settings"] .settings-row>button[role=switch]::before{width:7px;height:7px;margin-right:6px;background:#8cabb8;box-shadow:none;vertical-align:1px}
dialog#modal[data-view="settings"] .settings-row>button[aria-checked=true]::before{background:#bdf9ef;box-shadow:0 0 5px #b3fff877}
dialog#modal[data-view="settings"] .settings-row>button:active{transform:translateY(1px)}
dialog#modal[data-view="settings"] .release-settings{margin:22px 0 5px;padding:20px;border:1px solid #c8e1ea;border-radius:17px;background:#edf7fa;box-shadow:none}
dialog#modal[data-view="settings"] .release-settings>b{color:#07506d;font-size:15px;line-height:1.5}
dialog#modal[data-view="settings"] .release-settings>p{margin:9px 0 17px;color:#587887;font-size:13px;line-height:1.8}
dialog#modal[data-view="settings"] .release-settings>div{display:grid;grid-template-columns:1fr 1fr;gap:12px}
dialog#modal[data-view="settings"] .release-settings button{min-width:0;min-height:46px;font-size:13px}
dialog#modal[data-view="settings"] .settings-row:has(#reset-setting){padding-top:19px;border-bottom:0}
dialog#modal[data-view="settings"] #reset-setting{min-height:44px;border:1px solid #e9c6b5;border-radius:13px;background:#fff1e7!important;color:#b66043!important;box-shadow:none;text-shadow:none}
dialog#modal[data-view="settings"] #modal-body>.settings-small{margin:15px 3px 2px;padding-top:15px;border-top:1px solid #d6e5e8;color:#6d8792;font-size:11px;line-height:1.8}

@media(max-width:700px){
  dialog#modal[data-view="story"] .story-prologue{gap:12px;padding:18px;margin-bottom:19px;align-items:flex-start}
  dialog#modal[data-view="story"] .story-prologue h3{font-size:20px}
  dialog#modal[data-view="story"] .story-cover-mark{display:none}
  dialog#modal[data-view="story"] .story-chapter-count{flex-basis:48px;margin-top:4px;font-size:10px}
  dialog#modal[data-view="story"] .story-chapter-count b{font-size:28px}
  dialog#modal[data-view="story"] .story-layout{grid-template-columns:minmax(0,1fr);gap:17px}
  dialog#modal[data-view="story"] .story-letter-list{display:flex;gap:12px;margin:0;padding:2px 2px 11px;overflow-x:auto;scroll-snap-type:x proximity}
  dialog#modal[data-view="story"] .story-letter-list section{flex:0 0 194px;scroll-snap-align:start}
  dialog#modal[data-view="story"] .story-letter-list section+section{margin-top:0}
  dialog#modal[data-view="story"] .story-letter-paper.paper-frame{padding:20px!important;border-radius:17px}
  dialog#modal[data-view="story"] .story-letter-paper>h2{font-size:24px}
  dialog#modal[data-view="story"] .story-sender{padding-bottom:17px;margin-bottom:18px}
  dialog#modal[data-view="story"] .story-avatar{width:68px;height:70px;flex-basis:68px;border-radius:17px}
  dialog#modal[data-view="story"] .story-sender h3{font-size:22px}
  dialog#modal[data-view="story"] .story-dialogue{padding:20px;font-size:14px;line-height:1.85}
  dialog#modal[data-view="story"] .story-reward button{flex:1}
}

@media(max-width:420px){
  dialog#modal[data-view="story"] .story-prologue{padding:17px;gap:9px}
  dialog#modal[data-view="story"] .story-prologue p{font-size:13px;line-height:1.8}
  dialog#modal[data-view="story"] .story-prologue h3{font-size:18px}
  dialog#modal[data-view="story"] .story-letter-paper.paper-frame{padding:18px!important}
  dialog#modal[data-view="story"] .story-letter-paper>h2{font-size:22px}
  dialog#modal[data-view="story"] .story-dialogue{padding:19px 18px}
  dialog#modal[data-view="story"] .story-sender{gap:12px}
  dialog#modal[data-view="story"] .story-avatar{width:60px;height:62px;flex-basis:60px;border-radius:15px}
  dialog#modal[data-view="story"] .story-sender small{font-size:11px}
  dialog#modal[data-view="story"] .story-sender h3{font-size:20px}
  dialog#modal[data-view="story"] .story-objective{padding:15px;gap:9px}
  dialog#modal[data-view="story"] .story-objective b{font-size:13px}
  dialog#modal[data-view="story"] .story-objective strong{font-size:24px}
  dialog#modal[data-view="story"] .story-reward{gap:14px}
  dialog#modal[data-view="story"] .story-reward button{min-width:0;width:100%;flex-basis:100%}
  dialog#modal[data-view="settings"] .settings-row{column-gap:10px;padding:18px 0}
  dialog#modal[data-view="settings"] .settings-row b{font-size:14px}
  dialog#modal[data-view="settings"] .settings-row>button{min-width:99px;padding:10px 11px;font-size:11px}
  dialog#modal[data-view="settings"] .release-settings{padding:18px}
  dialog#modal[data-view="settings"] .release-settings>div{gap:9px}
  dialog#modal[data-view="settings"] .release-settings button{padding-left:8px;padding-right:8px;font-size:12px}
}

@media(prefers-reduced-motion:reduce){
  dialog#modal[data-view="story"] :is(.story-letter,.story-progress i){transition:none}
}
