.story-page{width:min(1420px,calc(100% - 28px))}.story-page header p{color:var(--muted)}
.story-controls{display:flex;flex-wrap:wrap;align-items:end;justify-content:center;gap:16px;padding:18px;border:1px solid var(--line);border-radius:7px;background:var(--panel)}
.story-controls label{display:flex;flex-direction:column;gap:6px;text-transform:none;letter-spacing:0;font-size:13px}.story-controls select{max-width:290px}.story-controls button,.story-locked button{padding:9px 14px;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:5px;font:600 13px system-ui,sans-serif;cursor:pointer}.story-controls button:hover{background:var(--paper)}
.story-controls .story-all{flex-direction:row;align-items:center;padding-bottom:9px}.story-note{text-align:center;margin:18px 0}.story-scroll{overflow:auto;max-height:72vh;max-height:72dvh;border:1px solid var(--line);border-radius:7px;background:var(--panel)}
.story-table{border-collapse:separate;border-spacing:0;width:100%;table-layout:fixed}.story-table caption{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.story-table th,.story-table td{padding:14px;vertical-align:top;border-bottom:1px solid var(--line);border-right:1px solid var(--line)}.story-table thead th{position:sticky;top:0;z-index:3;background:var(--paper);font-size:17px;font-weight:400;border-top:4px solid var(--party-colour,var(--line))}.story-table .story-date{width:100px;position:sticky;left:0;background:var(--panel);z-index:2;font:600 13px system-ui,sans-serif}.story-table thead .story-date{z-index:4;background:var(--paper)}.story-table .story-date a{color:var(--ink);text-decoration:none}.story-table .story-date a:hover{text-decoration:underline}.story-table tr:last-child>*{border-bottom:0}.story-table tr>*:last-child{border-right:0}.story-table tr.story-selected>.story-date{box-shadow:inset 4px 0 var(--accent)}
.story-cell{min-width:0}.story-cell details{border:0;border-left:3px solid var(--party-colour);padding:2px 0 2px 10px;margin:0 0 14px}.story-cell details:last-child{margin-bottom:0}.story-cell summary{font:500 16px/1.4 Georgia,serif;list-style:none;position:relative;padding-right:18px}.story-cell summary::-webkit-details-marker{display:none}.story-cell summary:after{content:'+';position:absolute;right:0;top:0;color:var(--muted);font:16px system-ui,sans-serif}.story-cell details[open]>summary:after{content:'−'}.story-party{display:block;font:600 11px/1.4 system-ui,sans-serif;color:var(--muted);margin-bottom:5px}.story-full{font-size:15px;line-height:1.6}.story-full p{margin:10px 0}.story-full a{color:var(--muted);font:12px system-ui,sans-serif}.story-location{font-style:italic;color:var(--muted)}.story-empty{color:var(--muted);font-size:13px}.story-locked{text-align:center;padding:30px;background:var(--panel);border:1px solid var(--line);border-radius:7px}.story-mobile-controls{display:none}.story-cell.shared{--party-colour:#7d8253}.story-cell.ring{--party-colour:#55735f}.story-cell.west{--party-colour:#9a6748}.story-cell.merry,.story-cell.gandalf,.story-cell.healing{--party-colour:#6f789c}
[data-theme=dark] .story-cell.shared{--party-colour:#c4cc96}[data-theme=dark] .story-cell.ring{--party-colour:#a7c0a8}[data-theme=dark] .story-cell.west{--party-colour:#d6aa86}[data-theme=dark] .story-cell.merry,[data-theme=dark] .story-cell.gandalf,[data-theme=dark] .story-cell.healing{--party-colour:#b5bfdf}
@media(max-width:800px){.story-mobile-controls{display:none}.story-mobile-controls label{flex:1;min-width:0}.story-mobile-controls select{width:100%;font-size:13px}.story-controls{gap:12px}.story-controls>label:first-child{flex:1}.story-table th,.story-table td{padding:10px}.story-table .story-date{width:75px;font-size:12px}.story-cell summary{font-size:15px}.story-table thead th{font-size:15px}.story-scroll{max-height:70dvh}.story-page h1{font-size:34px}.story-controls select{max-width:100%}}

.story-cell details.story-friends{--party-colour:#654730}[data-theme=dark] .story-cell details.story-friends{--party-colour:#c6a17a}

#storyThrough{font-weight:400}

.story-scroll{scroll-margin-top:20px}

.story-cell.early{--party-colour:var(--map-stop-border)}
.story-table .party-stage{display:block}
.story-table .party-transition-arrow{display:block;color:var(--muted);font:500 20px/1.1 system-ui,sans-serif;margin:4px 0}
.story-table thead th{text-align:center;vertical-align:middle;line-height:1.3}

.story-table thead th:not(.story-date){padding-bottom:34px}
.story-hide-column{position:absolute;right:7px;bottom:6px;display:flex;align-items:center;justify-content:center;gap:5px;width:auto;height:24px;padding:3px 6px;font:500 11px system-ui,sans-serif;border:0;border-radius:4px;background:none;color:var(--muted);cursor:pointer;opacity:.65}
.story-hide-column:hover,.story-hide-column:focus-visible{opacity:1;background:var(--panel);color:var(--ink)}
.story-hide-column svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
#storyShowAllColumns[hidden]{display:none}
.story-no-columns{padding:30px;text-align:center;color:var(--muted);border:1px solid var(--line);border-radius:7px;background:var(--panel)}

.story-table td.story-cell-empty{background:var(--button-dim)}

.story-controls{display:block;background:none;border:0;padding:0}
.story-controls .story-date-control{margin:20px 0 18px}
.story-controls .story-date-control label{display:block;font:600 12px system-ui,sans-serif;text-transform:uppercase;letter-spacing:.1em;color:var(--muted)}
.story-controls .story-date-control select{max-width:min(100%,420px);font:15px Georgia,serif}
.story-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:10px}
.story-table tr.story-future{--future-ink:color-mix(in srgb,var(--ink) 45%,#fff 55%);--future-muted:color-mix(in srgb,var(--muted) 55%,#fff 45%);--future-panel:color-mix(in srgb,var(--panel) 32%,#fff 68%)}
html[data-theme="dark"] .story-table tr.story-future{--future-ink:color-mix(in srgb,var(--ink) 45%,var(--panel) 55%);--future-muted:color-mix(in srgb,var(--muted) 55%,var(--panel) 45%);--future-panel:color-mix(in srgb,var(--panel) 70%,var(--paper) 30%)}
.story-table tr.story-future>td,.story-table tr.story-future>.story-date{background:var(--future-panel);color:var(--future-ink)}
.story-table tr.story-future .story-cell details{border-left-color:color-mix(in srgb,var(--party-colour) 32%,#fff 68%)}
html[data-theme="dark"] .story-table tr.story-future .story-cell details{border-left-color:color-mix(in srgb,var(--party-colour) 32%,var(--panel) 68%)}
.story-table tr.story-future summary{color:var(--future-ink)}
.story-table tr.story-future .story-party,.story-table tr.story-future summary:after,.story-table tr.story-future .story-location{color:var(--future-muted)}
html .story-table tr.story-future a{color:var(--future-muted)}
html .story-table tr.story-future a:hover,html .story-table tr.story-future a:focus{color:var(--ink)}

/* Empty cells retain the darker surface even in future-day rows. */
.story-table tr>td.story-cell-empty,.story-table tr.story-future>td.story-cell-empty{background:var(--button-dim)}

/* Story actions use the established neutral button palette. */
.story-controls .story-actions button{background:var(--panel);color:var(--muted);border-color:var(--line)}
.story-controls .story-actions button:hover,.story-controls .story-actions button:focus{background:var(--button-dim);color:var(--ink)}

@media(min-width:801px){.story-page{width:calc(100% - 28px)}.story-scroll{height:144vh;height:144dvh;max-height:none}}
