/* 剧情压缩: chat dividers and the 前情提要 dialog. */
.story-divider {display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 10px;margin:2px 0;padding:8px 4px;border-top:1px dashed var(--mint,#d9c3cf);border-bottom:1px dashed var(--mint,#d9c3cf);color:var(--text2);font-size:13px;line-height:1.5;text-align:center;animation:none;}
.story-divider-text {min-width:0;overflow-wrap:anywhere;}
.story-divider-action {min-height:36px;padding:4px 12px;border:1px solid var(--mint-light,#eadde4);border-radius:12px;background:var(--card-solid,var(--bg,#fff));color:var(--accent-deep,var(--text));font:inherit;font-size:13px;cursor:pointer;flex-shrink:0;}
.story-divider.story-dropped {color:var(--accent-deep,var(--text));border-top-style:solid;border-bottom-style:solid;}

#story-dialog {width:min(94vw,560px);height:min(86dvh,760px);font-size:16px;}
#story-dialog .dialog-content {flex:1;min-height:0;padding:14px 18px 20px;}
#story-dialog .dialog-bar h3 {font-size:17px;}
#story-dialog [hidden] {display:none!important;}
#story-dialog .dialog-content button {min-height:44px;font:inherit;font-size:15px;cursor:pointer;}
#story-dialog .dialog-content button:not(.pill) {border:1px solid var(--mint-light,#eadde4);border-radius:12px;background:var(--card-solid,var(--bg,#fff));color:var(--text);padding:8px 12px;}
#story-dialog .dialog-content button:disabled,#story-dialog textarea:disabled,#story-dialog input:disabled {opacity:.55;cursor:default;}
#story-dialog textarea {font-size:16px;line-height:1.6;}
#story-dialog #story-summary {min-height:220px;}
#story-dialog #story-note {min-height:84px;}
#story-dialog .dialog-content .field {margin-top:12px;}
#story-dialog .dialog-content .field > label {display:block;font-size:13px;color:var(--text2);margin-bottom:6px;}
#story-status:empty {display:none;}
/* Progress and errors stay in view while the options below are scrolled to. */
#story-status {position:sticky;top:-14px;z-index:1;margin:-14px -18px 8px;padding:10px 18px;background:var(--card-solid,var(--bg,#fff));border-bottom:1px solid var(--mint-light,#eadde4);font-size:14px;color:var(--accent-deep,var(--text));overflow-wrap:anywhere;}
.story-warning {font-size:14px;line-height:1.6;padding:10px 12px;border-radius:12px;background:var(--mint-light,#f7e5ed);color:var(--accent-deep,var(--text));}
.story-actions {display:flex;flex-wrap:wrap;gap:8px;}
.story-actions button {flex:1 1 30%;white-space:nowrap;}
#story-dialog .story-primary {display:block;width:100%;margin-top:16px;background:var(--accent,#cf789b)!important;color:var(--on-accent,#fff)!important;border-color:var(--accent,#cf789b)!important;font-weight:600;}
#story-dialog :focus-visible {outline:2px solid var(--accent-deep);outline-offset:3px;}
#layers-dialog .layer-story {display:block;width:100%;text-align:left;margin:0 0 14px;color:var(--accent-deep,var(--text));}
#story-targets {flex-wrap:nowrap;gap:6px;}
#story-dialog #story-targets .pill {flex:1;min-width:0;padding:8px 2px;white-space:nowrap;}
/* 隐藏前文: positions to hide by, faded messages that are not sent. */
.msg-index {font-size:11px;color:var(--text3);margin:0 6px;font-variant-numeric:tabular-nums;white-space:nowrap;}
.msg-wrapper.msg-hidden > :not(.msg-actions) {opacity:.45;}
.msg-hide-btn[aria-pressed="true"] {color:var(--accent-deep,var(--text2));}
.story-check {display:flex;align-items:center;gap:10px;margin-top:14px;font-size:15px;line-height:1.5;cursor:pointer;}
.story-check input {width:20px!important;height:20px;flex-shrink:0;accent-color:var(--accent);}
#story-dialog .story-wide {display:block;width:100%;margin-top:8px;color:var(--accent-deep,var(--text));}
#story-ranges {font-size:16px;}
/* Hidden stretches fold into one line; the line says which #N they are. */
.msg-wrapper.msg-folded {display:none!important;}
.story-divider.story-fold {border-top-style:dotted;border-bottom-style:dotted;}
.story-now {font-size:15px;line-height:1.6;color:var(--accent-deep,var(--text));margin:8px 0;overflow-wrap:anywhere;}
#story-manual-box {margin-top:14px;border-top:1px solid var(--mint-light,#eadde4);padding-top:6px;}
#story-manual-box > summary {min-height:44px;display:flex;align-items:center;gap:8px;cursor:pointer;color:var(--text);font-size:15px;list-style:none;}
#story-manual-box > summary::-webkit-details-marker {display:none;}
/* + / − like the settings groups, so it reads as something that opens. */
#story-manual-box > summary::after {content:'+';margin-left:auto;color:var(--accent);font-size:22px;line-height:1;flex-shrink:0;}
#story-manual-box[open] > summary::after {content:'−';}
/* 看提要: the recap opens at its divider, like RikkaHub's checkpoint. */
.story-recap {flex-basis:100%;margin-top:6px;padding:12px 14px;border:1px solid var(--mint-light,#eadde4);border-radius:14px;background:var(--card-solid,var(--bg,#fff));color:var(--text);text-align:left;font-size:14px;line-height:1.7;}
.story-recap-hint {margin:0 0 6px;font-size:12px;color:var(--text3);}
.story-recap-text {overflow-wrap:anywhere;max-height:50vh;overflow-y:auto;overscroll-behavior:contain;}
.story-recap-text p {margin:0;}
.story-recap-head {display:block;margin:8px 0 2px;color:var(--accent-deep,var(--text));font-size:14px;}
.story-recap-head:first-child {margin-top:0;}
.story-recap-item {padding-left:1em;text-indent:-.8em;}
.story-recap-item::before {content:'• ';color:var(--accent);}
.story-recap .story-divider-action {margin-top:8px;}
