/* 4 tools: balanced grid for sidebar layout */
@media(min-width:1400px){.tool-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:801px) and (max-width:1399px){.tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* V3.3.89 · independent body/caption text proofreading */
#textproof .tp-workflow-note{background:#f7f4ef;border:1px solid #ddd6ca;border-radius:12px;padding:13px 16px;display:flex;flex-wrap:wrap;align-items:center;gap:5px 13px;margin-bottom:15px;font-size:12px;color:#4a4640}
#textproof .tp-workflow-note>b{color:#23211f}#textproof .tp-workflow-note>small{flex-basis:100%;color:#827b72;font-size:11px}
#textproof .tp-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:14px}
#textproof .tp-input-panel,#textproof .tp-ai-panel{display:flex;flex-direction:column;gap:9px;min-width:0}
#textproof .tp-panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px;gap:10px}
#textproof .tp-panel-head h3{font-size:15px;margin:0}#textproof .tp-panel-head span,#textproof .tp-panel-head small{font-size:11px;color:#817a71}
#textproof .field{margin-bottom:5px}
#textproof textarea{display:block;width:100%;max-width:100%;font-size:13px;line-height:1.75;resize:vertical;box-sizing:border-box}
#textproof .tp-article{min-height:340px}#textproof .tp-caption{min-height:132px}
#textproof .tp-prompt{min-height:285px}#textproof .tp-ai-response textarea,#textproof #tpAIResponse{min-height:180px}
#textproof .tp-actions{display:flex;flex-wrap:wrap;gap:8px}#textproof .tp-actions button{flex:1 1 auto}
#textproof .tp-date-field{max-width:210px}
#textproof .tp-status{font-size:11px;color:#817a71;margin:3px 0 0;line-height:1.55}
#textproof .tp-status.error{color:#a94335}#textproof .tp-status.success{color:#266c53}
#textproof .tp-results{margin-top:16px}#textproof .tp-results.hidden{display:none}
#textproof .tp-result-head{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:16px}
#textproof .tp-result-head h3{font-size:21px;margin:6px 0}#textproof .tp-result-head p{font-size:12px;color:#817a71;margin:0}
#textproof .tp-result-actions{justify-content:flex-end}#textproof .tp-result-actions button{font-size:11px;padding:9px 11px}
#textproof .tp-stats{display:flex;gap:8px;margin:16px 0}#textproof .tp-stats>div{flex:1;min-width:0;background:#f4f0ea;border-radius:9px;padding:12px;display:flex;flex-direction:column;gap:2px}
#textproof .tp-stats strong{font-size:22px}#textproof .tp-stats span{font-size:11px;color:#777069}
#textproof .tp-proof-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(250px,.8fr);align-items:start;gap:13px}
#textproof .tp-originals{display:flex;flex-direction:column;gap:12px;min-width:0}
#textproof .tp-paper{border:1px solid #ddd8d0;border-radius:10px;background:#fff;overflow:hidden}
#textproof .tp-paper-title{background:#f9f7f3;border-bottom:1px solid #e9e4dd;padding:11px 14px;font-weight:750;font-size:13px}
#textproof .tp-paper-title small{font-size:10px;color:#8b837a;font-weight:400;margin-left:6px}
#textproof .tp-paper-content{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.92;padding:18px 16px;font-size:13px;min-height:65px;max-height:720px;overflow-y:auto}
#textproof .tp-issue-highlight{background:#ffe0da;color:#8c2b20;border-radius:3px;padding:1px 1px;box-shadow:inset 0 -2px #d94736;cursor:pointer}
#textproof .tp-issue-highlight.review{background:#fff0cd;color:#78541c;box-shadow:inset 0 -2px #dca64a}
#textproof .tp-issue-highlight.active{outline:2px solid #303030;outline-offset:1px}
#textproof .tp-issue-highlight sup{font-size:8px;margin-left:2px}
#textproof .tp-applied{background:#e5f2ec;color:#216744;box-shadow:inset 0 -2px #579975}
#textproof .tp-issues{border:1px solid #ddd8d0;border-radius:10px;background:#fff;min-width:0;padding:12px;max-height:940px;overflow:auto}
#textproof .tp-issues>h4{font-size:13px;margin:2px 4px 10px}
#textproof .tp-issue-item{display:block;text-align:left;width:100%;border:1px solid #e6e1dc;border-radius:8px;padding:11px;background:#fcfaf7;margin-bottom:9px;color:#333;cursor:pointer;line-height:1.5}
#textproof .tp-issue-item.active{border-color:#50463a;background:#f7f0e8}
#textproof .tp-issue-item .tp-issue-top{display:flex;align-items:center;justify-content:space-between;font-size:11px;font-weight:750;margin-bottom:6px}
#textproof .tp-issue-item .tp-issue-type{color:#bd4935}#textproof .tp-issue-item.review .tp-issue-type{color:#a97425}
#textproof .tp-issue-item .tp-issue-loc{color:#888078}#textproof .tp-issue-item p{margin:3px 0;font-size:12px;overflow-wrap:anywhere}
#textproof .tp-issue-item small{display:block;color:#776f67;font-size:11px;margin-top:6px;line-height:1.55}
#textproof .tp-issue-item .tp-missing{color:#a94335;font-weight:650}
#textproof .tp-footnote{font-size:11px;color:#837a70;line-height:1.6;margin:14px 0 0}
#textproof .tp-noissues{padding:25px 12px;text-align:center;color:#777;font-size:12px}
#textproof .tp-empty{color:#aaa}
@media(max-width:1220px){#textproof .tp-workspace{grid-template-columns:1fr}#textproof .tp-proof-grid{grid-template-columns:1fr}#textproof .tp-article{min-height:240px}#textproof .tp-prompt{min-height:210px}}
@media(max-width:720px){#textproof .tp-result-actions{width:100%}#textproof .tp-result-actions button{flex:1}#textproof .tp-stats>div{padding:10px}#textproof .tp-stats strong{font-size:19px}#textproof .tp-paper-content{padding:12px}}

/* V3.3.91 compact text proofreading: leave both primary action buttons above fold on desktop. */
#textproof.view {padding-top:24px;}
#textproof .page-intro {margin-bottom:14px;}
#textproof .tp-workspace {gap:12px;}
#textproof .tp-input-panel, #textproof .tp-ai-panel {padding:17px 18px;gap:6px;}
#textproof .tp-panel-head {margin-bottom:1px;}
#textproof .field {margin-bottom:1px;}
#textproof .field label {margin-bottom:4px;}
#textproof textarea {line-height:1.55;}
#textproof .tp-article {height:clamp(135px,19vh,190px);min-height:135px;}
#textproof .tp-caption {height:85px;min-height:72px;}
#textproof .tp-prompt {height:clamp(125px,16vh,165px);min-height:120px;}
#textproof #tpAIResponse {height:clamp(120px,16vh,150px);min-height:115px;}
#textproof .tp-date-field {max-width:230px;}
#textproof .tp-ai-response {margin-top:2px;}
#textproof #tpBuildPrompt, #textproof #tpParseResult {margin-top:4px;}
#textproof .tp-status {margin-top:2px;}
#textproof .tp-raw-fallback {white-space:pre-wrap;word-break:break-word;max-height:340px;overflow:auto;text-align:left;background:#fbf8f2;padding:12px;border-radius:8px;font-size:12px;line-height:1.7;}
@media(min-width:801px){#textproof .tp-workspace{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
@media(max-width:800px){#textproof .tp-workspace{grid-template-columns:1fr}}
@media(max-width:660px){#textproof .tp-article{height:170px}#textproof .tp-prompt{height:145px}}

/* V3.3.92: clearly identify corrections whose AI location differed from the actual source. */
#textproof .tp-issue-item .tp-relocated{color:#326c86;font-weight:600;}

/* V3.3.94 · Unverified AI quotes must not appear as confirmed corrections. */
#textproof .tp-rejected{margin-top:10px;border:1px solid #e3d7ca;border-radius:8px;padding:10px;background:#fcfaf7;color:#685e54;font-size:12px;line-height:1.6}
#textproof .tp-rejected summary{cursor:pointer;font-weight:700;color:#87553d}
#textproof .tp-rejected p{margin:9px 0;font-size:11px}
#textproof .tp-rejected-row{border-top:1px solid #ede4db;padding:7px 0;display:flex;flex-direction:column;gap:2px;overflow-wrap:anywhere}
#textproof .tp-rejected-row b{font-size:10px;color:#985b43}
