/* Story (roadmap item 29, src/story-ui.js): the story book window, the story part of the NPC card, the touch button. */
.story-journal{width:min(560px,calc(100vw - 24px));max-height:min(86vh,720px);padding:0;border:2px solid #b8943f;border-radius:16px;background:linear-gradient(180deg,#fbf3dc,#f1e2b8);color:#3a2c14;box-shadow:0 18px 48px #0008;overflow:hidden;display:none;flex-direction:column}
.story-journal[open]{display:flex}
.story-journal::backdrop{background:#0d1a1299}
.story-journal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px;background:linear-gradient(180deg,#2f5a3a,#24472d);color:#fff4cf;border-bottom:2px solid #b8943f}
.story-journal-head h2{margin:0;font-size:1.15rem;letter-spacing:.02em}
.story-journal-close{width:34px;height:34px;border-radius:50%;border:1px solid #e8cf86;background:#173322;color:#fff4cf;font-size:1.2rem;cursor:pointer}
.story-journal-note{margin:0;padding:6px 16px 0;font-size:.82rem;color:#7a5a1d;min-height:0}
.story-journal-note:empty{display:none}
.story-journal-list{overflow:auto;padding:10px 14px 16px;display:grid;gap:12px}
.story-empty{margin:18px 4px;text-align:center;color:#6c5a33}
.story-chapter{border:1px solid #d6bd7a;border-radius:12px;background:#fffaf0cc;padding:10px 12px;display:grid;gap:6px}
.story-chapter-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.story-chapter-head h3{margin:0;font-size:1.02rem;color:#2b4b2f}
.story-chapter-art{width:100%;max-height:140px;object-fit:cover;border-radius:8px;border:1px solid #d6bd7a}
.story-tag{flex:none;font-size:.72rem;padding:2px 8px;border-radius:999px;background:#e9dcb4;color:#5a4416;white-space:nowrap}
.story-tag.active,.story-tag.ready{background:#2f6b3f;color:#fff6d6}
.story-tag.done{background:#8c7a4a;color:#fff6d6}
.story-tag.available,.story-tag.offer{background:#d9a72e;color:#2d2006}
.story-text,.story-line span,.story-line-text{white-space:pre-line;overflow-wrap:anywhere}
.story-text{margin:0;font-size:.88rem;line-height:1.5}
.story-step{border-top:1px dashed #d6bd7a;padding-top:6px}
.story-step summary{display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer;list-style:none}
.story-step summary::-webkit-details-marker{display:none}
.story-line{margin:6px 0;padding:6px 10px;border-left:3px solid #b8943f;background:#f6ecd0;border-radius:0 8px 8px 0;font-size:.86rem;display:grid;gap:2px}
.story-line small{color:#7a5a1d;font-weight:700}
.story-objectives{list-style:none;margin:6px 0;padding:0;display:grid;gap:4px}
.story-objective{display:flex;justify-content:space-between;gap:8px;padding:4px 8px;border-radius:6px;background:#efe3c0;font-size:.85rem}
.story-objective.done{background:#d8ead0;color:#24472d}
.story-objective.done .story-objective-label::before{content:'✓ ';font-weight:700}
.story-who,.story-reward{margin:2px 0;font-size:.82rem;color:#5a4416}
.story-reward{color:#2f6b3f;font-weight:700}
/* Inside the NPC card (#city-npc-dialog .city-npc-panel, #school-dialog .school-panel). */
.story-npc{margin:8px 0;display:grid;gap:8px}
.story-npc[hidden]{display:none}
.story-npc-quest{border:1px solid #c9a84f;border-radius:10px;background:#fff8e4;color:#3a2c14;padding:8px 10px;display:grid;gap:4px}
.story-npc-chapter{color:#7a5a1d;font-size:.75rem}
.story-npc-title{color:#2b4b2f}
.story-line-text{margin:0;font-size:.86rem;line-height:1.45}
.story-npc-action{justify-self:start;min-height:38px;padding:6px 16px;border-radius:999px;border:1px solid #8a6a1c;background:linear-gradient(180deg,#f3cf62,#d9a72e);color:#2d2006;font-weight:700;cursor:pointer}
.story-npc-action.complete{background:linear-gradient(180deg,#5aa86a,#2f6b3f);color:#fff6d6;border-color:#24472d}
.story-npc-action:disabled{opacity:.55;cursor:default}
.story-npc-note{font-size:.75rem;color:#7a5a1d}
.story-npc-message{margin:0;padding:6px 10px;border-radius:8px;background:#e8f2df;color:#24472d;font-size:.86rem;white-space:pre-line}
.hud-utility.story-utility[hidden]{display:none}
@media (max-width:600px){
 .story-journal{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:12px}
 .story-journal-list{padding:8px 10px 12px}
 .story-objective{font-size:.8rem}
}
@media (max-height:420px){.story-journal{max-height:calc(100dvh - 12px)}.story-chapter-art{display:none}}
