/* Stories archive, full reading page, and studio editor. */
.stories-page{padding-block:3rem 5rem}
.stories-heading{display:flex;justify-content:space-between;align-items:center;gap:2rem;margin-bottom:1.5rem}
.stories-heading h1{font-size:clamp(2.4rem,4.6vw,4.5rem);line-height:1.1;letter-spacing:-.05em;margin-top:.8rem}
.stories-intro{max-width:48rem;color:var(--subtle);font-size:1.0625rem;line-height:1.75;margin-bottom:2.5rem}
.button-outline{border:1px solid var(--line);background:var(--panel);color:var(--paper)}
.button-outline:hover{border-color:var(--accent);color:var(--accent)}
.text-button{appearance:none;background:none;border:0;border-bottom:1px solid var(--line);color:var(--paper);padding:.65rem 0;font-size:.875rem;font-weight:700;min-height:44px;cursor:pointer}
.text-button:hover{color:var(--accent);border-color:var(--accent)}
.story-notice{font-size:1rem;color:var(--subtle);line-height:1.65;margin-block:1.3rem;white-space:pre-line}
.story-notice.is-error{color:var(--paper);border-left:3px solid var(--accent);padding-left:1rem}
.stories-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.4rem;margin-block:2rem}
.story-section-filters{display:flex;flex-wrap:wrap;gap:.65rem;padding-block:1rem 1.5rem;border-bottom:1px solid var(--line)}
.story-section-filter{display:inline-flex;align-items:center;gap:.8rem;min-height:44px;padding:.7rem 1rem;border:1px solid var(--line);background:var(--panel);font-size:1rem;line-height:1.4;overflow-wrap:anywhere}
.story-section-filter:hover{border-color:var(--accent)}
.story-section-filter[aria-current]{border-color:var(--accent);color:var(--accent)}
.story-section-count{font-family:var(--mono);font-size:.875rem;color:var(--subtle)}
.story-section-heading{font-size:1.125rem;font-weight:700;margin-top:1.5rem;overflow-wrap:anywhere}
.story-card-section,.story-section-link{font-size:.875rem;font-weight:700;line-height:1.5;color:var(--accent);overflow-wrap:anywhere}
.story-section-link{display:inline-block;text-decoration:underline;text-underline-offset:4px;margin-top:.75rem}
.story-card{display:flex;flex-direction:column;gap:1rem;border:1px solid var(--line);padding:2rem;background:var(--panel)}
.story-card:hover{border-color:var(--accent)}
.story-card h2{font-size:clamp(1.5rem,2.5vw,2.2rem);letter-spacing:-.035em;line-height:1.2;overflow-wrap:anywhere}
.story-card>p{color:var(--subtle);line-height:1.7;margin:0}
.story-card .story-card-date{font-family:var(--mono);font-size:.875rem;color:var(--accent)}
.story-card .story-card-action{margin-top:auto;padding-top:1rem;font-size:.875rem;font-weight:700}
.stories-empty{padding:3rem 2rem;border-block:1px solid var(--line);margin-block:2.5rem}
.stories-empty h2{font-size:1.5rem;line-height:1.3;letter-spacing:-.03em;margin-bottom:.8rem}
.stories-empty>p{color:var(--subtle)}
.stories-empty .text-link{margin-top:1rem}
.story-article{max-width:48rem;margin:3rem auto 4rem}
.story-article header{padding-bottom:2rem;border-bottom:1px solid var(--line);margin-bottom:2.5rem}
.story-article h1,.story-article h2{font-size:clamp(2.2rem,4.6vw,4.4rem);line-height:1.12;letter-spacing:-.045em;overflow-wrap:anywhere;margin-block:1rem}
.story-summary{font-size:1.25rem;line-height:1.6;color:var(--subtle);white-space:pre-wrap;overflow-wrap:anywhere}
.story-body{font-size:1.125rem;line-height:1.85;color:var(--paper);overflow-wrap:anywhere}
.story-body p{white-space:pre-wrap}
.story-body p+p{margin-top:1.5rem}
.story-reading-footer{display:flex;flex-wrap:wrap;align-items:center;gap:2rem;max-width:48rem;margin-inline:auto;padding-top:1.5rem;border-top:1px solid var(--line)}
.story-export-note{font-size:.875rem;color:var(--subtle);margin-top:3rem;line-height:1.6}
.story-export-note a{text-decoration:underline;text-underline-offset:3px}
.story-editor-grid{display:grid;grid-template-columns:minmax(13rem,1fr) minmax(0,3fr);gap:3rem;align-items:start;margin-top:2rem}
.story-editor-sidebar{position:sticky;top:calc(var(--perspective-bar-height) + 1.5rem);max-height:calc(100dvh - var(--perspective-bar-height) - 3rem);overflow-y:auto;padding:0 .5rem 1rem 0}
.story-editor-sidebar>.button{width:100%}
.story-editor-list{padding:0;list-style:none;margin:1.3rem 0 0}
.story-editor-list>li{border-bottom:1px solid var(--line)}
.story-editor-list button{width:100%;text-align:left;background:none;color:var(--paper);border:0;border-left:2px solid transparent;padding:1rem .8rem;cursor:pointer}
.story-editor-list button:hover,.story-editor-list button[aria-current]{background:var(--panel);border-left-color:var(--accent)}
.story-editor-list strong{display:block;line-height:1.45;font-size:1rem;overflow-wrap:anywhere}
.story-editor-list span{display:block;font-size:.875rem;line-height:1.4;color:var(--subtle);margin-top:.4rem}
.story-sections-manager{border-top:1px solid var(--line);margin-top:1.5rem;padding-top:1rem}
.story-sections-manager summary{font-size:1rem;font-weight:700;cursor:pointer;padding-block:.65rem;min-height:44px}
.story-sections-manager>.story-field-note{margin-top:.75rem}
.story-sections-list{padding:0;list-style:none;margin-top:1rem}
.story-sections-list li{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding-block:.4rem;border-bottom:1px solid var(--line)}
.story-sections-list li>span{font-size:1rem;line-height:1.4;overflow-wrap:anywhere;min-width:0}
.story-sections-list button{flex-shrink:0}
.story-sections-manager .story-form-actions{gap:.6rem;margin-top:1rem}
.story-sections-manager .button{padding-inline:1rem;white-space:normal}
.story-form{min-width:0}
.story-form-top{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.75rem}
.story-form-top h2{font-size:1.8rem;line-height:1.2;letter-spacing:-.035em}
.story-state{font-size:.875rem;color:var(--accent);padding:.35rem .65rem;border:1px solid var(--line)}
.story-form label{display:block;font-size:1rem;font-weight:700;line-height:1.5;margin:1.2rem 0 .6rem}
.story-form input,.story-form textarea,.story-form select{display:block;width:100%;font:inherit;font-size:1rem;line-height:1.6;color:var(--paper);background:var(--panel);border:1px solid var(--line);padding:.75rem .9rem;border-radius:0}
.story-form textarea{resize:vertical;min-height:6rem}
.story-form #story-input-body{min-height:24rem}
.story-form input:focus-visible,.story-form textarea:focus-visible,.story-form select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.story-form-row{display:grid;grid-template-columns:minmax(10rem,1fr) minmax(0,2fr);gap:1.5rem;align-items:end}
.story-field-note{font-size:.875rem;color:var(--subtle);line-height:1.55;margin:0 0 .6rem}
.field-optional{font-size:.875rem;color:var(--subtle);font-weight:400}
.story-form-actions{display:flex;flex-wrap:wrap;gap:1rem;align-items:center;margin-top:1.5rem}
.story-form button:disabled,.story-editor-sidebar button:disabled{opacity:.55;cursor:wait}
.story-preview{width:min(60rem,calc(100% - 2rem));max-height:calc(100dvh - 2rem);padding:1.5rem 2.5rem;background:var(--bg);color:var(--paper);border:1px solid var(--line);overflow-y:auto}
.story-preview::backdrop{background:#000c}
.story-preview-close{display:flex;justify-content:flex-end}
.story-preview .story-article{margin-top:1.5rem}
[hidden]{display:none!important}
@media(max-width:900px){.story-editor-grid{grid-template-columns:minmax(0,1fr);gap:2rem}.story-editor-sidebar{position:static;max-height:18rem}.story-editor-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 1rem}}
@media(max-width:760px){.stories-page{padding-block:2rem 4rem}.stories-heading{align-items:flex-start;flex-direction:column;gap:1.3rem}.stories-list{grid-template-columns:minmax(0,1fr)}.story-card{padding:1.5rem}.stories-empty{padding:2rem 0}.story-article{margin-block:2rem 3rem}.story-body{font-size:1.0625rem}.story-summary{font-size:1.125rem}.story-preview{padding:1rem 1.2rem}.story-form-row{grid-template-columns:minmax(0,1fr);gap:.5rem}.story-form-actions{gap:.8rem}.story-editor-list{grid-template-columns:minmax(0,1fr)}}
@media print{.stories-page{padding-block:1rem}.story-owner-only,.story-editor-page,.story-reading-footer,.stories-page .page-breadcrumb,.story-export-note{display:none!important}.story-article{margin:0;max-width:none}.story-body,.story-summary,.story-article .eyebrow{color:#000}.story-card{break-inside:avoid;background:#fff;color:#000}}
