.creation-shortcuts{display:flex;align-items:start;gap:clamp(14px,7vw,32px)}
.creation-oc-link{display:grid;justify-items:center;gap:8px;color:var(--writing-accent-text);text-decoration:none;font-size:12px;font-weight:700;white-space:nowrap}
.creation-oc-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;color:white;background:linear-gradient(135deg,var(--primary-light),var(--primary-color));box-shadow:0 4px 16px #fc704556}
.creation-oc-back{padding:8px;color:#414141;text-decoration:none;font-size:14px;font-weight:550;white-space:nowrap}
.chapter-tools-trigger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:35px;padding:6px 9px;border:1px solid var(--writing-accent-border);border-radius:9px;background:var(--writing-accent-soft);color:var(--writing-accent-text);font:inherit;font-size:13px;font-weight:700;white-space:nowrap;cursor:pointer}
.chapter-tools-trigger:hover{border-color:var(--primary-light)}
.chapter-context-bar{position:fixed;z-index:1100;transform:translateX(-50%);display:flex;align-items:center;gap:5px;max-width:calc(100vw - 24px);padding:4px;border:1px solid #e9e4e1;border-radius:14px;background:#fff;box-shadow:0 4px 18px #37200c21;white-space:nowrap}
.chapter-context-bar button{min-height:34px;flex:none;padding:4px 12px;border:0;border-radius:10px;background:var(--writing-accent-soft,#fff1e8);color:var(--writing-accent-text,#a9381a);font:inherit;font-size:13px;font-weight:750;cursor:pointer}
.chapter-context-bar button+button{background:white;color:#574744}
.chapter-context-bar button:nth-child(3){color:#624d83}
.chapter-context-bar button:only-child{padding-inline:14px}
.chapter-tools-drawer{box-sizing:border-box;position:fixed;inset:0 0 0 auto;width:min(460px,100%);max-width:none;height:100%;max-height:none;padding:0;margin:0;border:0;border-radius:18px 0 0 18px;background:white;color:#222026;overflow:hidden;box-shadow:-18px 0 66px #22161a24}
.chapter-tools-drawer::backdrop{background:#20191e60}
.chapter-tools-inner{height:100%;display:flex;flex-direction:column;font-family:inherit}
.chapter-tools-inner>header{display:flex;align-items:flex-start;gap:10px;padding:22px 20px 17px}
.chapter-tools-inner>header>div{flex:1;min-width:0}
.chapter-tools-inner h2,.chapter-tools-inner h3,.chapter-tools-inner p{margin:0}
.chapter-tools-inner>header h2{font-size:22px;line-height:1.3;font-weight:760;letter-spacing:.01em}
.chapter-tools-inner>header p{font-size:13px;color:#6e686e;margin-top:5px}
.chapter-tools-close,.chapter-tools-back{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;background:#f5f3f2;color:#4a4146;border:0;border-radius:50%;font-size:23px;cursor:pointer}
.chapter-tools-grip{display:none}
.chapter-tools-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 20px 12px}
.chapter-tools-home{display:grid;gap:2px}
.chapter-tools-tile{display:grid;grid-template-columns:40px minmax(0,1fr) 12px;align-items:center;gap:12px;min-height:67px;padding:8px 4px;border:0;border-bottom:1px solid #f4efeb;background:white;color:#271f23;text-align:left;font:inherit;cursor:pointer}
.chapter-tools-tile:last-child{border-bottom:0}
.chapter-tools-tile:hover{background:#fdf8f5}
.chapter-tools-tile>span:first-child{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#fff1e8;color:#a53d21;font-size:21px;font-weight:700}
.chapter-tools-tile:nth-child(even)>span:first-child{background:#f1eef8;color:#625092}
.chapter-tools-tile strong,.chapter-tools-tile small{display:block;overflow-wrap:anywhere}
.chapter-tools-tile strong{font-size:15px;font-weight:760}
.chapter-tools-tile small{margin-top:4px;color:#69636b;font-size:12px;line-height:1.4}
.chapter-tools-tile i,.chapter-tools-history span{font-size:20px;font-style:normal;color:#766d6c}
.chapter-tools-inner .chapter-tools-tip{margin:14px 0 8px;color:#6b6164;font-size:13px;line-height:1.6}
.chapter-tools-history{display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:12px;padding:9px 1px;border:0;border-top:1px solid #f3efee;background:white;color:#514851;font:inherit;font-size:13px;cursor:pointer;text-align:start}
.chapter-tools-message,.chapter-tools-progress{margin:0 0 12px!important;padding:9px 11px;border-radius:9px;color:#814026;background:#fff3eb;line-height:1.5;font-size:13px;overflow-wrap:anywhere}
.chapter-tools-progress{color:#5d535b;background:#f7f4f3}
.chapter-tools-inner .chapter-tools-intro{margin:0 0 15px;color:#544b54;font-size:15px;line-height:1.6}
.chapter-tools-inner .chapter-tools-selection-indicator{margin:0 0 13px;color:#795a50;font-size:12px}
.chapter-tools-field{display:block;margin:0 0 12px;color:#32282f;font-size:14px;font-weight:680}
.chapter-tools-field small{color:#6b6164;font-size:12px;font-weight:450;margin-left:7px}
.chapter-tools-field-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.chapter-tools-field-heading small{font-variant-numeric:tabular-nums}
.chapter-tools-field :is(textarea,input){display:block;box-sizing:border-box;width:100%;padding:11px 12px;margin-top:7px;border:1px solid #eae4e2;border-radius:10px;background:#fcfaf9;color:#211d23;font:inherit;font-size:16px;font-weight:400;line-height:1.45}
.chapter-tools-field textarea{resize:vertical}
.chapter-tools-field textarea+small{display:block;margin:6px 0 0}
.chapter-tools-field>.chapter-tools-field-error{display:block;margin:6px 0 0;color:#a13927}
.chapter-tools-length{margin-bottom:15px}
.chapter-tools-length .chapter-tools-field{margin-bottom:8px}
.chapter-tools-chapters{min-width:0;margin:0 0 15px;padding:9px 10px 10px;border:1px solid #eee8e5;border-radius:11px}
.chapter-tools-chapters legend{padding:0 4px;color:#403437;font-size:14px;font-weight:700}
.chapter-tools-scope-current{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px;border-radius:8px;background:#fff2e9;color:#713d29;font-size:13px;overflow-wrap:anywhere}
.chapter-tools-scope-current small{flex:none;color:#865442;font-size:11px;font-weight:650}
.chapter-tools-scope-list{max-height:190px;margin-top:6px;overflow:auto;overscroll-behavior:contain}
.chapter-tools-scope-list label{display:flex;align-items:center;gap:8px;min-height:37px;padding:5px 4px;border-bottom:1px solid #f3efed;color:#4d4448;font-size:13px;overflow-wrap:anywhere}
.chapter-tools-scope-list input{flex:none;width:16px;height:16px;margin:0;accent-color:var(--primary-color,#ff6b35)}
.chapter-tools-scope-list input:disabled+span{color:#827b7f}
.chapter-tools-scope-search{display:grid;gap:6px;margin-top:9px;color:#6b6063;font-size:12px}
.chapter-tools-scope-search input{width:100%;box-sizing:border-box;padding:7px 9px;border:1px solid #eee8e5;border-radius:8px;background:#fcfaf9;color:#403437;font:inherit;font-size:16px}
.chapter-tools-scope-total{display:block;margin-top:8px;color:#6b6063;font-size:12px}
.chapter-tools-inline{padding:0 4px;border:0;background:none;color:#973b22;font:inherit;font-weight:700;cursor:pointer}
.chapter-tools-presets{display:flex;gap:6px;flex-wrap:wrap}
.chapter-tools-presets button{padding:7px 10px;border:0;border-radius:17px;background:#f6f2ef;color:#5a4746;font:inherit;font-size:12px;cursor:pointer}
.chapter-tools-presets button[aria-pressed=true]{background:#ffede1;color:#98361b;font-weight:700}
.chapter-tools-offer{display:grid;gap:8px;padding:19px;border-radius:13px;background:#fff3eb;color:#793919}
.chapter-tools-offer>span,.chapter-tools-offer p{font-size:13px}
.chapter-tools-offer p{margin:0}
.chapter-tools-offer>strong{font-size:35px;font-weight:780;line-height:1;font-variant-numeric:tabular-nums}
.chapter-tools-offer>strong small{font-size:15px}
.chapter-tools-settlement{display:flex;align-items:center;gap:6px 12px;flex-wrap:wrap;margin-bottom:11px;padding:8px 10px;border-radius:9px;background:#f3f8f4;color:#425849;font-size:12px}
.chapter-tools-preview{padding:13px 14px;border:1px solid #f0e8e3;border-radius:12px;background:#fffbf8}
.chapter-tools-inner h3{font-size:15px;line-height:1.5}
.chapter-tools-preview p{margin-top:6px;color:#403941;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8;font-size:15px}
.chapter-tools-reference{display:inline;padding:0;border:0;background:transparent;color:#9d3b22;font:inherit;font-weight:700;text-decoration:underline;cursor:pointer}
.chapter-tools-result-list{display:grid;gap:11px;padding-bottom:5px}
.chapter-tools-result-card{min-width:0;padding:14px 15px;border:1px solid #efe8e3;border-radius:12px;background:#fffdfb}
.chapter-tools-result-card h3{margin-bottom:9px;color:#332929;font-size:16px;font-weight:740;overflow-wrap:anywhere}
.chapter-tools-result-line+.chapter-tools-result-line{margin-top:10px}
.chapter-tools-result-label{display:block;margin-bottom:3px;color:#975337;font-size:12px;font-weight:720}
.chapter-tools-result-line p{color:#403941;font-size:15px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.chapter-tools-edit-compare,.chapter-tools-review{display:grid;gap:12px}
.chapter-tools-edit-pane,.chapter-tools-review-summary{min-width:0;padding:13px 14px;border:1px solid #ebe5e2;border-radius:12px;background:#faf8f6}
.chapter-tools-edit-pane.is-candidate{border-color:#efdbcf;background:#fff9f5}
.chapter-tools-edit-pane h3{color:#655553;font-size:13px}
.chapter-tools-edit-pane.is-candidate h3{color:#974223}
.chapter-tools-edit-pane p,.chapter-tools-review-summary p,.chapter-tools-review-field p{margin-top:5px;color:#302931;font-size:15px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.chapter-tools-edit-pane mark{padding:0 1px;border-radius:3px;background:#f1e4df;color:inherit;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.chapter-tools-edit-pane.is-candidate mark{background:#ffdfcc;color:#642d18}
.chapter-tools-edit-outcome{display:flex;align-items:flex-start;gap:10px;padding:14px;border:1px solid #e2ece5;border-radius:12px;background:#f2f8f4;color:#304b39}
.chapter-tools-edit-check{display:grid;flex:none;place-items:center;width:28px;height:28px;border-radius:50%;background:#dceee1;color:#2d6544;font-weight:750}
.chapter-tools-edit-outcome p{margin-top:4px;color:#486252;font-size:13px}
.chapter-tools-edit-billing{margin:10px 0 0;background:#f7f4f2;color:#5f5553;font-variant-numeric:tabular-nums}
.chapter-tools-review-summary{border-color:#efdbcf;background:#fff8f2}
.chapter-tools-review-summary h3{color:#873d28}
.chapter-tools-review-title{display:flex;align-items:baseline;gap:8px;padding:2px 0 8px;color:#332c30}
.chapter-tools-review-title small{font-size:12px;font-weight:520;color:#716360}
.chapter-tools-review-list{display:grid;gap:10px;margin:0;padding:0;list-style:none;counter-reset:review-finding}
.chapter-tools-review-list li{min-width:0;padding:12px;border:1px solid #eee7e2;border-radius:12px;background:white;counter-increment:review-finding}
.chapter-tools-review-list h4{display:flex;align-items:baseline;gap:8px;margin:0 0 10px;color:#322b30;font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.chapter-tools-review-list h4::before{content:counter(review-finding);display:inline-grid;place-items:center;flex:none;width:22px;height:22px;border-radius:6px;background:#fff1e7;color:#8f4327;font-variant-numeric:tabular-nums;font-size:11px}
.chapter-tools-review-field+.chapter-tools-review-field{margin-top:10px}
.chapter-tools-review-field span{display:block;color:#6d5953;font-size:12px;font-weight:700;line-height:1.5}
.chapter-tools-review-field p{margin-top:3px}
.chapter-tools-review-field.is-excerpt{padding:7px 9px;border-left:2px solid #eac7b5;background:#faf8f6}
.chapter-tools-review-field.is-excerpt p{color:#554b4c}
.chapter-tools-review-field.is-suggestion{padding:8px 10px;border-radius:8px;background:#fff5ed}
.chapter-tools-review-field.is-suggestion span{color:#924527}
.chapter-tools-advice-index{margin-bottom:12px}
.chapter-tools-advice-index h3{display:flex;justify-content:space-between;align-items:center;padding:4px 0 9px;color:#342b2e}
.chapter-tools-advice-index h3 small,.chapter-tools-advice-crumb small{color:#77686d;font-size:12px;font-weight:450}
.chapter-tools-advice-item{display:grid;grid-template-columns:30px minmax(0,1fr) 11px;align-items:center;gap:10px;width:100%;min-height:61px;padding:9px 1px;border:0;border-top:1px solid #f1ece9;background:#fff;color:#373034;text-align:left;font:inherit;cursor:pointer}
.chapter-tools-advice-item:hover{background:#fdf8f5}
.chapter-tools-advice-item strong{display:block;font-size:14px;font-weight:720;line-height:1.45;overflow-wrap:anywhere}
.chapter-tools-advice-item small{display:-webkit-box;margin-top:3px;overflow:hidden;color:#6c6167;font-size:12px;line-height:1.4;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.chapter-tools-advice-number{display:grid;place-items:center;width:29px;height:28px;border-radius:8px;background:#fff2e9;color:#a34725;font-size:11px;font-weight:700}
.chapter-tools-advice-chevron{justify-self:end;color:#89777c;font-size:20px}
.chapter-tools-advice-crumb{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:9px}
.chapter-tools-all-advice{display:block;min-height:36px;margin:3px auto 0;padding:7px 9px;border:0;background:#fff;color:#974328;font:inherit;font-size:12px;font-weight:700;cursor:pointer}
.chapter-tools-history-list{margin-bottom:15px}
.chapter-tools-history-list button{display:flex;width:100%;justify-content:space-between;gap:6px;padding:10px 0;border:0;border-bottom:1px solid #f1ebe7;background:white;color:#51444c;text-align:start;font:inherit;font-size:13px;cursor:pointer}
.chapter-tools-history-list small{font-size:11px;color:#726568}
.chapter-tools-footer{display:flex;flex-shrink:0;gap:8px;padding:10px 20px max(15px,env(safe-area-inset-bottom));border-top:1px solid #f3eeec;background:white}
.chapter-tools-primary,.chapter-tools-secondary{min-height:42px;padding:6px 12px;border:0;border-radius:11px;background:#f6f1ee;color:#564449;font:inherit;font-size:14px;font-weight:700;cursor:pointer}
.chapter-tools-primary{flex:1;background:var(--primary-color,#ff6b35);color:#fff}
.chapter-tools-primary:not(:disabled):hover{background:var(--primary-dark,#ed5529)}
.chapter-tools-inner button:disabled{cursor:default;opacity:.55}
.chapter-tools-inner :is(button,a,textarea):focus-visible,.chapter-context-bar button:focus-visible,.chapter-tools-confirm button:focus-visible{outline:2px solid var(--primary-color,#ff6b35);outline-offset:2px}
.chapter-tools-confirm{box-sizing:border-box;position:fixed;inset:0;width:min(400px,calc(100vw - 32px));max-height:calc(100dvh - 36px);padding:0;margin:auto;border:0;border-radius:17px;background:#fff;color:#30292b;box-shadow:0 18px 56px #23171338;overscroll-behavior:contain}
.chapter-tools-confirm::backdrop{background:#20171d66}
.chapter-tools-confirm-content,.chapter-tools-wait{padding:20px}
.chapter-tools-confirm h2{margin:0;color:#30292b;font-size:20px;font-weight:760;line-height:1.4}
.chapter-tools-confirm-task{margin:4px 0 13px;color:#716267;font-size:13px}
.chapter-tools-confirm-note{margin:11px 0 0;color:#5f5359;font-size:13px;line-height:1.6}
.chapter-tools-confirm-actions{display:grid;grid-template-columns:1fr 1.4fr;gap:8px;margin-top:15px}
.chapter-tools-wait{text-align:center;padding-block:26px}
.chapter-tools-wait-mark{width:38px;height:38px;box-sizing:border-box;margin:0 auto 15px;border:3px solid #ffe5d8;border-top-color:var(--primary-color,#ff6b35);border-radius:50%;animation:chapter-tools-turn .85s linear infinite}
.chapter-tools-wait h2{font-size:17px;outline:none}
.chapter-tools-wait p{margin:7px auto 0;max-width:245px;color:#655a5f;font-size:13px;line-height:1.65}
@keyframes chapter-tools-turn{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.chapter-tools-wait-mark{animation-duration:1.8s}}

.chapter-clue-search{margin:0 0 16px;padding:12px;border:1px solid #efe8e3;border-radius:11px;background:#fff;color:#392d29}
.chapter-clue-search>label{display:block;margin-bottom:6px;font-size:13px;font-weight:700}
.chapter-clue-input{display:flex;align-items:center;gap:8px;padding:0 9px;border-radius:8px;background:#f8f6f5}
.chapter-clue-input input{box-sizing:border-box;flex:1;min-width:0;min-height:37px;padding:3px 0;border:0;background:transparent;color:#322923;font:inherit;font-size:13px}
.chapter-clue-input input::-webkit-search-cancel-button{display:none}
.chapter-clue-input button,.chapter-clue-results button{border:0;background:transparent;color:var(--writing-accent-text);font:inherit;cursor:pointer}
.chapter-clue-input button,.chapter-clue-results button>span:last-child{font-size:12px;white-space:nowrap}
.chapter-clue-results{max-height:220px;overflow:auto}
.chapter-clue-results button{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:8px 0;border-bottom:1px solid #f2eeeb;text-align:left}
.chapter-clue-results button:last-child{border-bottom:0}
.chapter-clue-results button>span:first-child{min-width:0}
.chapter-clue-results strong,.chapter-clue-results small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#362d29;font-size:13px}
.chapter-clue-results small,.chapter-clue-search>p{color:#70655e;font-size:11px}
.chapter-clue-search>p{margin:8px 0 0}

.drawer-content.chapter-wizard-frame {
    height:calc(100vh - 60px);
    height:calc(100dvh - 60px);
    max-height:none;
}
.modal-content.chapter-wizard-frame {
    height:min(780px,calc(100vh - 40px));
    height:min(780px,calc(100dvh - 40px));
    max-height:none;
}
.chapter-wizard-frame > .drawer-body,
.chapter-wizard-frame > .modal-body {
    min-height:0;
    padding:0;
    overflow:hidden;
}
.chapter-wizard {
    display:flex;
    flex-direction:column;
    height:100%;
    min-height:0;
}
.chapter-wizard-scroll {
    flex:1;
    min-height:0;
    padding:20px 20px 0;
    overflow:auto;
    overscroll-behavior:contain;
}
.chapter-wizard-actions {
    display:flex;
    flex-wrap:wrap;
    flex:none;
    align-items:center;
    gap:9px;
    box-sizing:border-box;
    padding:12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    background:white;
    border-top:1px solid #f0e9e5;
}
.chapter-wizard-actions button {
    border:0;
    border-radius:12px;
    min-height:44px;
    padding:8px 10px;
    font:inherit;
    font-size:14px;
    font-weight:600;
    line-height:1.3;
    cursor:pointer;
}
.chapter-wizard-actions .chapter-wizard-primary {
    flex:2 1 0;
    min-width:0;
    background:linear-gradient(135deg,#ff6b35,#ff8c5a);
    color:white;
}
.chapter-wizard-actions .chapter-wizard-secondary {
    flex:1 1 0;
    min-width:0;
    background:#f5f3f2;
    color:#554a45;
}
.chapter-wizard-actions .chapter-wizard-link {
    flex:0 0 100%;
    min-height:32px;
    padding:5px 10px;
    background:transparent;
    color:var(--writing-accent-text,#ab4019);
    font-size:13px;
}
.chapter-wizard-actions button:disabled {cursor:default;opacity:.55}
.chapter-wizard-actions .chapter-wizard-primary:disabled {background:#c4bfbc}
.chapter-wizard-recommend-spinner {
    position:absolute;
    inset:0;
    border:4px solid transparent;
    border-top-color:#ff6b35;
    border-radius:50%;
    animation:chapter-tools-turn 1s linear infinite;
}
@media(prefers-reduced-motion:reduce){.chapter-wizard-recommend-spinner{animation-duration:1.8s}}
@media(max-width:360px){.chapter-wizard-actions,.chapter-wizard-scroll{padding-inline:14px}}

@media(max-width:650px){
    .chapter-tools-drawer{inset:auto 0 0;height:min(78vh,660px);height:min(78dvh,660px);border-radius:22px 22px 0 0}
    .chapter-tools-drawer.is-task{height:min(60vh,510px);height:min(60dvh,510px)}
    .chapter-tools-drawer.is-advice-index{height:min(57vh,480px);height:min(57dvh,480px)}
    .chapter-tools-drawer.is-selection-result{height:auto;max-height:min(78vh,660px);max-height:min(78dvh,660px)}
    .chapter-tools-drawer.is-selection-result .chapter-tools-inner{height:auto;max-height:inherit}
    .chapter-tools-drawer.is-selection-result .chapter-tools-scroll{flex:0 1 auto}
    .chapter-tools-drawer.is-task.has-chapter-scope{height:min(78vh,660px);height:min(78dvh,660px)}
    .chapter-tools-grip{display:block;align-self:center;width:34px;height:4px;margin-top:7px;border-radius:999px;background:#e8e1dd}
    .chapter-tools-inner>header{padding:12px 16px 10px}
    .chapter-tools-scroll{padding-inline:16px}
    .chapter-tools-footer{padding-inline:16px}
    .chapter-tools-trigger{gap:3px;padding-inline:6px;font-size:12px}
    .chapter-tools-trigger svg{width:13px;height:13px}
}
