/* Task journey: tactile ink-and-paper status, motion with reduced-motion support */
.hw-task-journey{position:fixed;z-index:11000;right:24px;bottom:24px;width:min(390px,calc(100vw - 32px));padding:18px 20px 16px;background:var(--ic-panel-solid,#fffdf8);color:var(--ic-ink,#25211d);border:1px solid var(--ic-border,#dcd2c4);box-shadow:0 18px 64px rgba(48,34,23,.18),0 2px 10px rgba(48,34,23,.07);border-radius:18px;animation:hw-task-rise .34s cubic-bezier(.21,.85,.28,1.08);font-family:inherit}
.hw-task-journey.is-hidden{display:none}
.hw-task-head{display:flex;align-items:center;gap:12px;min-width:0}
.hw-task-symbol{display:flex;align-items:center;justify-content:center;width:42px;height:42px;flex:none;background:#f7e4d9;color:#b63b25;border-radius:14px;font-size:24px;font-weight:800}
.hw-task-identity{display:flex;flex:1;flex-direction:column;gap:3px;min-width:0}
.hw-task-identity strong{font-size:14px;line-height:1.4}
.hw-task-identity span{font-size:12px;opacity:.65;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.hw-task-minimize{border:0;background:transparent;color:inherit;opacity:.6;cursor:pointer;font-size:24px;padding:3px 6px;align-self:start}
.hw-task-minimize:focus-visible,.hw-task-action:focus-visible{outline:3px solid #b9432f;outline-offset:3px}
.hw-task-track{position:relative;height:8px;overflow:hidden;border-radius:999px;background:#e6ddd1;margin-top:18px}
.hw-task-track-fill{height:100%;width:0;background:linear-gradient(90deg,#b93e2c,#e79050);border-radius:999px;transition:width .4s ease}
.hw-task-track-fill.is-indeterminate{width:35%;animation:hw-task-sweep 1.6s ease-in-out infinite}
.hw-task-stats{display:flex;justify-content:space-between;gap:10px;font-size:12px;margin-top:10px;opacity:.78;font-variant-numeric:tabular-nums}
.hw-task-note{font-size:12px;line-height:1.6;margin:12px 0 0;color:#775c3b}
.hw-task-note.is-error{color:#a12323}
.hw-task-footnote{font-size:11px;line-height:1.55;opacity:.65;margin:11px 0 0}
.hw-task-action{margin-top:14px;border:0;background:#b9412c;color:white;padding:9px 15px;border-radius:9px;cursor:pointer;font-weight:700}
@keyframes hw-task-sweep{0%{transform:translateX(-110%)}100%{transform:translateX(310%)}}
@keyframes hw-task-rise{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:600px){.hw-task-journey{right:12px;bottom:12px;padding:16px}}
@media(prefers-reduced-motion:reduce){.hw-task-journey{animation:none}.hw-task-track-fill{transition:none}.hw-task-track-fill.is-indeterminate{animation:none;width:100%;opacity:.5}}
.hw-task-journey.reduce-motion,.hw-task-journey.reduce-motion .hw-task-track-fill{animation:none;transition:none}

.hw-task-steps{list-style:none;display:flex;justify-content:space-between;gap:4px;padding:0;margin:18px 0 0}
.hw-task-steps li{min-width:0;flex:1;display:flex;flex-direction:column;align-items:center;gap:5px;text-align:center;font-size:10px;opacity:.47}
.hw-task-step-dot{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;border:1px solid #c7bdb0;font-variant-numeric:tabular-nums;font-weight:750}
.hw-task-steps li.is-passed{opacity:.86;color:#657959}.hw-task-steps li.is-passed .hw-task-step-dot{background:#e0e8d9;border-color:#b8c9ae}
.hw-task-steps li.is-current{opacity:1;color:#a63c29;font-weight:800}.hw-task-steps li.is-current .hw-task-step-dot{background:#b9412c;border-color:#b9412c;color:#fff;box-shadow:0 0 0 4px #f5dfd7}
.hw-task-journey.is-collapsed{width:auto;padding:0;overflow:hidden;border-radius:999px}
.hw-task-reopen{padding:13px 18px;background:transparent;border:0;color:inherit;font-weight:800;font-size:12px;cursor:pointer}
.hw-task-reopen:focus-visible{outline:3px solid #b9412c;outline-offset:-4px}

.hw-activity-trace{position:fixed;z-index:10990;right:24px;top:24px;display:flex;gap:10px;align-items:center;min-width:230px;max-width:min(340px,calc(100vw - 32px));padding:12px 16px;background:var(--ic-panel-solid,#fffdf8);border:1px solid var(--ic-border,#ddd1c3);border-radius:13px;box-shadow:0 12px 40px rgba(38,28,17,.15);animation:hw-task-rise .3s ease-out}
.hw-activity-pulse{width:30px;height:30px;display:grid;place-items:center;flex:none;border-radius:10px;background:#f7e4d9;color:#b9412c;animation:hw-activity-breathe 1.7s ease-in-out infinite}
.hw-activity-label{min-width:0;display:flex;flex-direction:column;gap:3px}.hw-activity-label strong{font-size:12px}.hw-activity-label small{font-size:11px;opacity:.65}
.hw-activity-trace.is-finished .hw-activity-pulse{animation:none}
@keyframes hw-activity-breathe{50%{box-shadow:0 0 0 7px rgba(185,65,44,.09);transform:rotate(8deg)}}
@media(max-width:600px){.hw-activity-trace{right:12px;top:12px}}
@media(prefers-reduced-motion:reduce){.hw-activity-pulse{animation:none}}

/* Review gate: all imported content stays read-only until explicit approval. */
.hw-document-review-overlay{position:fixed;inset:0;z-index:12000;display:grid;place-items:center;background:rgba(23,20,17,.63);padding:16px;backdrop-filter:blur(5px)}
.hw-document-review{width:min(790px,100%);max-height:min(88vh,880px);overflow:auto;display:flex;flex-direction:column;gap:16px;background:#fffdf8;border-radius:20px;padding:26px 30px;box-shadow:0 28px 90px rgba(20,12,6,.27);color:#29231f}
.hw-document-review-head{display:flex;flex-direction:column;gap:7px}.hw-document-review-kicker{font-size:10px;letter-spacing:.18em;color:#a74331;font-weight:800}.hw-document-review-head h2{margin:0;font-size:23px}.hw-document-review-head p{margin:0;line-height:1.6;font-size:13px;color:#766f68}
.hw-document-review-meta{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}.hw-document-review-meta>div{background:#f6f0e7;border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:5px;min-width:0}.hw-document-review-meta small{font-size:11px;color:#89796a}.hw-document-review-meta strong{font-size:12px;overflow-wrap:anywhere;line-height:1.5}
.hw-document-review-warning,.hw-document-review-protect{padding:12px 14px;background:#fff2dd;border-left:3px solid #c88b27;border-radius:6px;color:#79511a;font-size:12px;line-height:1.6;margin:0}
.hw-document-review-protect{background:#f3f0e9;border-left-color:#a5a096;color:#665b4c}
.hw-document-review-preview-label{font-size:12px;font-weight:800}.hw-document-review-preview{margin:0;padding:18px;background:#faf7f0;border:1px solid #e3d8c8;min-height:140px;max-height:30vh;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.75 ui-monospace,SFMono-Regular,Consolas,monospace}
.hw-document-review-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}
.hw-document-review-actions button{border:1px solid #d8cabe;border-radius:9px;padding:9px 14px;font:inherit;font-size:12px;font-weight:750;cursor:pointer;background:#fffdf8;color:#45362d}
.hw-document-review-actions .hw-document-review-primary{background:#b9412c;color:#fff;border-color:#b9412c}
.hw-document-review-actions button:focus-visible{outline:3px solid #df9371;outline-offset:2px}
@media(max-width:650px){.hw-document-review{padding:18px;max-height:94vh}.hw-document-review-meta{grid-template-columns:1fr}.hw-document-review-actions button{flex:1}.hw-document-review-preview{max-height:25vh}}
@media(prefers-reduced-motion:reduce){.hw-document-review-overlay{backdrop-filter:none}}

.hw-article-sync-retry{margin-left:5px;border:0;background:transparent;color:#b9412c;cursor:pointer;font-size:11px;font-weight:800;text-decoration:underline;text-underline-offset:3px;padding:4px}
.hw-article-sync-retry[hidden]{display:none}
.hw-article-sync-retry:focus-visible{outline:2px solid #b9412c;outline-offset:2px}

.hw-task-recovery-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.hw-task-recovery-actions .hw-task-action{margin-top:14px}
.hw-task-recovery-actions .hw-task-secondary{background:transparent;border:1px solid #ccae9d;color:#9a4433}
.hw-task-recovery-actions button:focus-visible{outline:3px solid #df9371;outline-offset:2px}

/* Article generation consent: paper-and-ink pricing sheet. */
.hw-article-charge-overlay{position:fixed;inset:0;z-index:12100;display:grid;place-items:center;padding:16px;background:rgba(26,21,16,.58);backdrop-filter:blur(4px)}
.hw-article-charge-dialog{width:min(460px,100%);max-height:90vh;overflow:auto;background:#fffdf8;color:#29221d;border:1px solid #dfd1c4;border-radius:20px;padding:26px;box-shadow:0 24px 80px rgba(25,15,10,.23)}
.hw-article-charge-kicker{font-size:11px;letter-spacing:.13em;color:#ad4933;font-weight:800}
.hw-article-charge-dialog h2{font-size:22px;margin:10px 0}
.hw-article-charge-help{font-size:13px;line-height:1.65;color:#6a6057;margin:0 0 20px}
.hw-article-charge-rows{display:flex;flex-direction:column;gap:12px;background:#f7f0e8;border-radius:13px;padding:15px}
.hw-article-charge-rows>div{display:flex;justify-content:space-between;gap:10px;font-size:13px}
.hw-article-charge-rows strong{font-variant-numeric:tabular-nums}
.hw-article-charge-total{border-top:1px solid #dacbbd;padding-top:12px;font-weight:800;color:#a23c28}
.hw-article-charge-note,.hw-article-charge-error{font-size:12px;line-height:1.65;margin:14px 0 0;color:#695d50}
.hw-article-charge-error{color:#a12720}
.hw-article-charge-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:24px}
.hw-article-charge-actions button{padding:10px 16px;font-size:13px;font-weight:800;border-radius:9px;border:1px solid #d2c0b2;background:transparent;color:inherit;cursor:pointer}
.hw-article-charge-actions .hw-article-charge-primary{background:#b9412c;color:#fff;border-color:#b9412c}
.hw-article-charge-actions button:disabled{opacity:.45;cursor:not-allowed}
.hw-article-charge-actions button:focus-visible{outline:3px solid #d7856f;outline-offset:3px}
@media(max-width:600px){.hw-article-charge-dialog{padding:19px}.hw-article-charge-actions button{flex:1}}
@media(prefers-reduced-motion:reduce){.hw-article-charge-overlay{backdrop-filter:none}}

/* P1: AI plan decisions and document fidelity compare. */
.hw-article-plan-review-overlay{position:fixed;inset:0;z-index:12300;display:grid;place-items:center;padding:16px;background:rgba(25,20,17,.65);backdrop-filter:blur(4px)}
.hw-article-plan-review{width:min(750px,100%);max-height:90vh;overflow:auto;background:#fffdf8;color:#29231e;border-radius:20px;padding:26px;box-shadow:0 25px 80px #20170c44}
.hw-art-review-kicker{font-size:11px;color:#b9412c;letter-spacing:.12em;font-weight:850}
.hw-article-plan-review h2{margin:8px 0;font-size:23px}
.hw-article-plan-review header p{margin:0;line-height:1.65;color:#756b61;font-size:13px}
.hw-art-review-tags{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}
.hw-art-review-tags span{background:#f3e8db;border-radius:30px;padding:5px 10px;font-size:11px}
.hw-art-review-list{display:flex;flex-direction:column;gap:10px;max-height:50vh;overflow:auto;margin:20px 0}
.hw-art-review-choice{display:flex;gap:13px;border:1px solid #dfd2c4;border-radius:12px;padding:13px;cursor:pointer}
.hw-art-review-choice:has(input:checked){border-color:#c78d72;background:#fff8f2}
.hw-art-review-choice input{margin-top:4px;accent-color:#b9412c}
.hw-art-review-main{display:flex;flex-direction:column;gap:6px;min-width:0}
.hw-art-review-main strong{font-size:14px}
.hw-art-review-main small{color:#897a69;font-size:11px}
.hw-art-review-purpose,.hw-art-review-subject{font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.hw-art-review-purpose b,.hw-art-review-subject b{color:#a54a32}
.hw-art-review-summary{font-size:12px;color:#77685a}
.hw-article-plan-review footer{display:flex;gap:10px;justify-content:flex-end}
.hw-article-plan-review footer button{border:1px solid #d9c9b8;background:transparent;border-radius:9px;padding:10px 16px;font-weight:800;cursor:pointer}
.hw-article-plan-review footer .hw-art-review-apply{background:#b9412c;color:#fff;border-color:#b9412c}
.hw-article-plan-review button:disabled{opacity:.45;cursor:not-allowed}
.hw-article-plan-review :focus-visible{outline:3px solid #e6a686;outline-offset:2px}
.ic-art-reason{font-size:11.5px;line-height:1.55;color:#776a58;margin:5px 0 0}
.ic-art-reason strong{color:#a64a31}
.hw-document-fidelity{padding:13px;border:1px solid #dfd2c4;background:#f8f3eb;border-radius:12px;font-size:12px;display:flex;flex-direction:column;gap:7px}
.hw-document-fidelity p{margin:0;line-height:1.6;color:#665c52}
.hw-document-fidelity-details summary{cursor:pointer;font-weight:750}
.hw-document-fidelity-segment{margin-top:12px;padding:12px;border:1px solid #e0d3c5;background:#fffdf9;border-radius:9px}
.hw-document-fidelity-segment h3{font-size:12px;margin:0 0 8px}
.hw-document-fidelity-issues{color:#a53d2d;margin:6px 0}
.hw-document-fidelity-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.hw-document-fidelity-columns>div{min-width:0}
.hw-document-fidelity-columns b{font-size:11px}
.hw-document-fidelity-columns pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto;background:#f7f1e8;padding:11px;border-radius:7px;font-size:11px;line-height:1.6}
@media(max-width:660px){.hw-article-plan-review{padding:17px}.hw-document-fidelity-columns{grid-template-columns:1fr}.hw-article-plan-review footer button{flex:1}}
@media(prefers-reduced-motion:reduce){.hw-article-plan-review-overlay{backdrop-filter:none}}

/* Document import: one genuinely spacious editing surface, no split panes. */
.hw-document-review-overlay{padding:clamp(8px,2vw,24px)}
.hw-document-review.hw-document-review-single,.hw-document-review:has(.hw-document-review-single-editor){
  width:min(1180px,100%);height:min(94dvh,1000px);max-height:94dvh;
  padding:clamp(16px,2vw,28px);overflow:hidden;gap:10px;
}
.hw-document-review-head{flex-shrink:0;gap:2px}
.hw-document-review-head h2{font-size:21px}
.hw-document-review-head p{font-size:12px}
.hw-document-review-meta-compact{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;flex-shrink:0}
.hw-document-review-meta-compact>div{padding:7px 11px}
.hw-document-review-warning,.hw-document-review-protect{font-size:11px;padding:6px 10px;flex-shrink:0}
.hw-document-review-hints{padding:7px 10px;border:1px solid #e3d4c2;border-radius:8px;background:#fbf4e9;font-size:11px;flex-shrink:0}
.hw-document-review-hints summary{cursor:pointer;font-weight:800}
.hw-document-review-hints p{margin:7px 0 0;line-height:1.5}
.hw-document-review-single-editor{display:flex;flex:1 1 auto;min-height:0;flex-direction:column;gap:7px}
.hw-document-review-single-editor>label,.hw-document-review-editor-head label{font-size:12px;font-weight:800}
.hw-document-review-single-editor input{width:100%;box-sizing:border-box;flex:none;border:1px solid #d6c9bc;background:#fff;padding:10px 12px;border-radius:8px;font:inherit;font-size:14px;color:inherit}
.hw-document-review-editor-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
#hw-doc-review-count{color:#806f5e;font-size:11px;font-variant-numeric:tabular-nums}
#hw-doc-review-editor{box-sizing:border-box;display:block;flex:1 1 auto;min-height:150px;width:100%;resize:none;padding:18px 20px;border:1px solid #d5c8ba;border-radius:10px;background:#fff;outline:none;color:#29231f;font:14px/1.85 ui-monospace,SFMono-Regular,Consolas,monospace;overflow:auto;white-space:pre-wrap}
#hw-doc-review-editor:focus-visible,.hw-document-review-single-editor input:focus-visible{outline:2px solid #b9412c;outline-offset:1px}
.hw-document-review-actions{flex-shrink:0;padding-top:8px;border-top:1px solid #e8ddd0}
@media(max-width:650px){
 .hw-document-review:has(.hw-document-review-single-editor){height:96dvh;max-height:96dvh;padding:12px;gap:7px}
 .hw-document-review-meta-compact{grid-template-columns:1fr}
 .hw-document-review-meta-compact>div{padding:5px 8px}
 .hw-document-review-actions{gap:6px}
 .hw-document-review-actions button{padding:9px 6px;font-size:11px}
 #hw-doc-review-editor{font-size:13px;padding:12px;min-height:100px}
}

/* Article picture selection and history reuse share a compact responsive gallery. */
.hw-article-p2-overlay{position:fixed;inset:0;z-index:12200;display:grid;place-items:center;padding:12px;background:rgba(25,20,17,.58)}
.hw-article-p2-dialog{box-sizing:border-box;width:min(790px,100%);max-height:92dvh;display:flex;flex-direction:column;gap:13px;overflow:hidden;padding:clamp(15px,2vw,26px);background:#fffdf8;border-radius:18px;box-shadow:0 22px 80px #251d193d;color:#2c251f}
.hw-article-p2-dialog header h2{font-size:22px;margin:6px 0}
.hw-article-p2-dialog header p{font-size:12px;line-height:1.6;color:#77695b;margin:0}
.hw-article-p2-kicker{font-size:11px;letter-spacing:.1em;color:#b9412c;font-weight:850}
.hw-article-p2-toolbar{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:12px}
.hw-article-p2-toolbar select{padding:6px;border:1px solid #dacabc;border-radius:7px;background:#fff}
.hw-article-p2-list{min-height:0;overflow:auto;display:flex;flex-direction:column;gap:8px}
.hw-article-p2-choice{display:flex;gap:10px;padding:12px;background:#f7f1e8;border:1px solid #e4d8cb;border-radius:9px;cursor:pointer}
.hw-article-p2-choice input{accent-color:#b9412c}
.hw-article-p2-choice span{display:flex;flex-direction:column;gap:4px}
.hw-article-p2-choice small{font-size:11px;color:#73685d}
.hw-article-p2-count{font-size:12px;color:#86674f}
.hw-article-p2-dialog footer{display:flex;justify-content:flex-end;gap:8px}
.hw-article-p2-dialog footer button{border:1px solid #d4c4b6;border-radius:8px;background:#fff;padding:10px 15px;cursor:pointer}
.hw-article-p2-dialog footer .hw-article-p2-primary{background:#b9412c;color:#fff;border-color:#b9412c}
.hw-article-p2-dialog :focus-visible{outline:2px solid #b9412c;outline-offset:2px}
.hw-article-p2-dialog button:disabled{opacity:.45}
.hw-article-p2-search{width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid #dacabc;border-radius:9px;background:#fff;font:inherit}
.hw-article-p2-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;min-height:0;overflow:auto}
.hw-article-p2-gallery-card{display:flex;flex-direction:column;gap:6px;min-width:0;padding:7px;background:#fff;border:1px solid #ddcfbe;border-radius:11px;cursor:pointer;text-align:left;color:inherit}
.hw-article-p2-gallery-card img{width:100%;height:126px;object-fit:cover;border-radius:6px;background:#eee2d2}
.hw-article-p2-gallery-card span,.hw-article-p2-gallery-card strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.hw-article-p2-gallery-card small,.hw-article-p2-empty{font-size:11px;color:#796d61}
.hw-article-generation-summary{border:1px solid #d9cbb8;background:#faf5ec;border-radius:11px;padding:13px;margin:10px 0;font-size:12px}
.hw-article-summary-head{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}
.hw-article-summary-meter{height:7px;border-radius:99px;background:#e8ddd0;overflow:hidden;margin:10px 0}
.hw-article-summary-meter>span{display:block;height:100%;background:#b9412c;transition:width .2s}
.hw-article-generation-summary p{margin:0;line-height:1.55;color:#756a61}
@media(max-width:650px){.hw-article-p2-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.hw-article-p2-gallery-card img{height:100px}}
@media(prefers-reduced-motion:reduce){.hw-article-summary-meter>span{transition:none}}
