/* Shared tool-page presentation architecture. Functional PHP/JS stays untouched.
   Loaded after legacy styles to resolve competing fixed widths and tiny inherited text. */
html body.tool-view{--tool-page:#f5f8ff;--tool-card:#fff;--tool-raised:#f7f9ff;--tool-ink:#101a33;--tool-sub:#60718f;--tool-line:#dce5f4;--tool-blue:#1455f5;--tool-shadow:0 8px 25px rgba(28,50,100,.07);font-size:16px;zoom:1}
html[data-theme="dark"] body.tool-view{--tool-page:#0b1228;--tool-card:#17243f;--tool-raised:#1b2a48;--tool-ink:#f5f8ff;--tool-sub:#c9d6ec;--tool-line:#354766;--tool-blue:#4388ff;--tool-shadow:0 8px 25px rgba(0,0,0,.2)}
html body.tool-view .tool-page{background:var(--tool-page)!important;color:var(--tool-ink)!important;padding:20px 0 55px!important}
html body.tool-view .tool-page .tool-container{width:min(1240px,calc(100% - 36px))!important;max-width:1240px!important;padding:0!important;margin-inline:auto!important;font-size:16px!important;transform:none;zoom:1}
html body.tool-view .tool-page .gtl-unified-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:16px!important;min-width:0}
html body.tool-view .gtl-unified-workspace{width:100%;min-width:0;max-width:none}
html body.tool-view .gtl-unified-workspace>.tool-panel,html body.tool-view .gtl-unified-workspace>.panel{width:100%;max-width:none;background:var(--tool-card)!important;color:var(--tool-ink)!important;border:1px solid var(--tool-line)!important;border-radius:13px!important;padding:clamp(16px,2vw,26px)!important;box-shadow:var(--tool-shadow)!important}
html body.tool-view .gtl-unified-workspace :is(h1,h2,h3,label){color:var(--tool-ink)!important}
html body.tool-view .gtl-unified-workspace h1{font-size:clamp(25px,2.5vw,33px)!important;line-height:1.2!important}
html body.tool-view .gtl-unified-workspace :is(p,label,small){line-height:1.5}
html body.tool-view .gtl-unified-aside{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
html body.tool-view .gtl-unified-sidecard{background:var(--tool-card)!important;color:var(--tool-ink)!important;border-color:var(--tool-line)!important}
html body.tool-view .gtl-unified-sidecard :is(h2,a){color:var(--tool-ink)!important}
html body.tool-view .gtl-unified-workspace :is(textarea,input:not([type="checkbox"]):not([type="radio"]),select){background:var(--tool-card);color:var(--tool-ink);border-color:var(--tool-line);font-size:clamp(14px,1vw,16px)}
html body.tool-view .gtl-unified-workspace :is(textarea,input)::placeholder{color:var(--tool-sub);opacity:1}
html body.tool-view .gtl-unified-workspace :is(.tool-actions,.row,.batch-toolbar){gap:10px;flex-wrap:wrap}
html body.tool-view .gtl-unified-workspace :is(button,.button){min-height:40px}
html body.tool-view .gtl-unified-workspace :is(button,.button):focus-visible{outline:3px solid #4388ff;outline-offset:2px}
html body.tool-view .gtl-unified-workspace :is(.gtl-five-text-grid,.gtl-five-json-grid,.gtl-five-meta-grid){display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:18px;align-items:stretch}
html body.tool-view .gtl-five-json-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
html body.tool-view .gtl-five-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
html body.tool-view .gtl-five-json-grid textarea{min-height:340px;font:14px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace}
html body.tool-view .gtl-five-json-grid>.tool-actions,html body.tool-view .gtl-five-json-grid>.status,html body.tool-view .gtl-five-json-grid>.qc-json-meta{grid-column:1/-1}
html body.tool-view .gtl-five-workspace :is(.gtl-five-json-pane,.gtl-five-editor,.gtl-five-meta-input,.gtl-five-meta-result){background:var(--tool-raised);border:1px solid var(--tool-line);border-radius:12px;padding:16px;min-width:0}
html body.tool-view .gtl-five-workspace .gtl-five-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
html body.tool-view .gtl-five-workspace .stat{background:var(--tool-raised);border-color:var(--tool-line)}
html body.tool-view .gtl-five-workspace .gtl-merge-panel{grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr)}
html body.tool-view .gtl-five-workspace .gtl-merge-drop{min-height:275px}
html body.tool-view .gtl-five-workspace .batch-layout{grid-template-columns:minmax(0,1.5fr) minmax(265px,1fr)}
html body.tool-view .gtl-five-workspace :is(.gtl-five-selected,.batch-settings,.batch-workspace){background:var(--tool-raised);border-color:var(--tool-line)}
html body.tool-view .tool-container>.content-section{width:100%;max-width:none;background:var(--tool-card);color:var(--tool-ink);border-color:var(--tool-line)}
html body.tool-view .tool-container>.content-section :is(h2,h3){color:var(--tool-ink)}
html body.tool-view .tool-container .breadcrumbs{font-size:13px!important;color:var(--tool-sub)!important}
html[data-theme="dark"] body.tool-view .gtl-unified-workspace :is(.notice,.qc-priority-answer,.status){background:var(--tool-raised)!important;color:var(--tool-sub)!important;border-color:var(--tool-line)!important}
@media(max-width:800px){html body.tool-view .gtl-five-workspace :is(.gtl-five-text-grid,.gtl-five-json-grid,.gtl-five-meta-grid,.batch-layout,.gtl-merge-panel){grid-template-columns:minmax(0,1fr)!important}html body.tool-view .gtl-five-workspace .gtl-merge-panel>*{grid-column:1!important;grid-row:auto!important}html body.tool-view .gtl-unified-aside{grid-template-columns:1fr}}
@media(max-width:480px){html body.tool-view .tool-page .tool-container{width:calc(100% - 24px)!important}html body.tool-view .gtl-unified-workspace>.tool-panel{padding:14px!important}html body.tool-view .gtl-five-workspace .gtl-five-stats{grid-template-columns:repeat(2,minmax(0,1fr))}html body.tool-view .gtl-unified-workspace :is(button,.button){min-height:42px}}
