/* UI colors only: document canvases, image pixels and generated files are untouched. */
#workspace.simple-workflow .run-area{background:var(--ui-surface);border-color:var(--ui-border)}
.quick-workflow-summary{color:var(--ui-text)}
.quick-workflow-summary small{color:var(--ui-muted)}
#workspace #file-list.pdf-page-list>li{background:var(--ui-surface);border-color:var(--ui-border)}
#workspace #file-list.pdf-page-list>li.selected-preview{border-color:var(--ui-solid)}
#workspace #file-list.pdf-page-list>li.drop-target{background:var(--ui-tint);border-color:var(--ui-focus)}
#workspace #file-list.pdf-page-list .file-thumb{background:var(--ui-soft);border-color:var(--ui-border)}
.example-fields{border:1px solid var(--ui-border);border-radius:.75rem;padding:1rem;min-width:0;background:var(--ui-soft)}
.example-fields legend{font-size:1rem;font-weight:700;color:var(--ui-text)}
.example-fields p,.example-fields small,.example-panel p{font-size:.875rem;line-height:1.5;color:var(--ui-muted);overflow-wrap:anywhere}
.example-fields input[type=file]{max-width:100%;width:100%;font-size:.875rem}
.example-panel{margin-block:1rem;padding:1rem;border:1px solid var(--ui-border);border-radius:.75rem;background:var(--ui-soft);min-width:0}
.example-panel h3{font-size:1rem;margin-block:0 .5rem}
.example-panel .action-row{flex-wrap:wrap;gap:.75rem}
.example-panel button{justify-content:center;text-align:center;white-space:normal}
.result-feedback{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:1rem;padding:1rem;margin-block:1rem;border:1px solid var(--ui-border);border-radius:1rem;background:var(--ui-soft);color:var(--ui-text);min-width:0}
.result-feedback>div:first-child{flex:1 1 18rem;min-width:0}
.result-feedback h3{font-size:1rem;margin:0 0 .5rem;overflow-wrap:anywhere}
.result-feedback p{font-size:.875rem;line-height:1.5;margin:0 0 .5rem;color:var(--ui-muted)}
.result-feedback small{font-size:.75rem;line-height:1.5;color:var(--ui-muted)}
.result-feedback-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:1rem;flex-shrink:1}
.result-feedback .button{justify-content:center;text-align:center;white-space:normal}
@media(max-width:700px){.result-feedback{flex-direction:column;align-items:stretch}.result-feedback-actions{flex-shrink:1}.result-feedback .button{flex:1}}
.document-data-preview{margin-block:1rem;padding:1rem;border:1px solid var(--ui-border);border-radius:1rem;background:var(--ui-surface);color:var(--ui-text);min-width:0;max-width:100%}
.document-data-preview h3{font-size:1rem;overflow-wrap:anywhere}
.document-data-preview p{color:var(--ui-muted);font-size:.875rem}
.data-table-scroll{max-width:100%;max-height:24rem;overflow:auto}
.document-data-preview table{border-collapse:collapse;font-size:.875rem;width:100%}
.document-data-preview td{border:1px solid var(--ui-border);padding:.5rem;max-width:20rem;overflow-wrap:anywhere;white-space:pre-wrap}
.document-data-preview pre{font:inherit;font-size:.875rem;white-space:pre-wrap;overflow-wrap:anywhere;max-height:24rem;overflow:auto}
.section-heading .filter-row{flex-wrap:wrap;max-width:100%}
.how-section .trust-strip{grid-template-columns:repeat(auto-fit,minmax(min(100%,16.25rem),1fr))}
.trust-strip .step-copy{min-width:0;overflow-wrap:anywhere}
:where(.hero h1,.tool-intro h1,.tool-card h3,.quick-copy,.content-page h1,.content-page h2,.content-page h3,.operations-heading h1){overflow-wrap:anywhere}
.tool-card p{overflow-wrap:anywhere}
.quick-head{flex-wrap:wrap}
.quick-head>*{min-width:0;max-width:100%;overflow-wrap:anywhere}
.topbar .brand{min-width:0}
.topbar .brand strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:400px){:root:is([data-text-size="130"],[data-text-size="150"]) .tool-grid{grid-template-columns:minmax(0,1fr)}}
.quick-copy :is(strong,small){white-space:normal;overflow-wrap:anywhere}
:root{color-scheme:light;--ui-page:#fafafa;--ui-surface:#fff;--ui-soft:#f2f4fa;--ui-tint:#efedff;--ui-text:#19223a;--ui-muted:#5e6b83;--ui-border:#dce1ed;--ui-link:#5034ce;--ui-solid:#5538dc;--ui-solid-hover:#4329bd;--ui-focus:#6545e6;--ui-on-solid:#fff;--ui-selected:#252e48;--ui-success:#256d48;--ui-success-bg:#eef9f2;--ui-warning:#785019;--ui-warning-bg:#fff8e9;--ui-warning-border:#c59c56;--ui-error:#a72f3c;--ui-error-bg:#fff1f3;--ui-error-border:#d48993;--dock-bottom:max(16px,env(safe-area-inset-bottom));--dock-right:max(14px,env(safe-area-inset-right));--ui-input-border:#8a94aa;--ui-danger:#a72f3c;--ui-glow:rgb(85 56 220 / .1);--ui-google-bg:#fff;--ui-google-border:#747775;--ui-google-text:#1f1f1f;--ui-google-logo-bg:#fff}
:root[data-theme=dark]{color-scheme:dark;--ui-page:#101522;--ui-surface:#191f30;--ui-soft:#232c40;--ui-tint:#30284d;--ui-text:#f0f2fc;--ui-muted:#b5c0d5;--ui-border:#46516a;--ui-link:#c1b0ff;--ui-solid:#7050dd;--ui-solid-hover:#6242ca;--ui-focus:#c5b2ff;--ui-selected:#353051;--ui-success:#a2e9bf;--ui-success-bg:#153628;--ui-warning:#f6d398;--ui-warning-bg:#352b1b;--ui-warning-border:#b99a5e;--ui-error:#ffc0c7;--ui-error-bg:#40202d;--ui-error-border:#c98694;--ui-input-border:#6b7794;--ui-danger:#c2334f;--ui-glow:rgb(114 84 234 / .2);--ui-google-bg:#131314;--ui-google-border:#8e918f;--ui-google-text:#e3e3e3}
:root[data-contrast=strong]{--ui-page:#fff;--ui-surface:#fff;--ui-soft:#fff;--ui-tint:#efebff;--ui-text:#101010;--ui-muted:#252525;--ui-border:#52586a;--ui-link:#35209b;--ui-solid:#37208f;--ui-solid-hover:#241168;--ui-focus:#2e1799;--ui-input-border:#52586a;--ui-danger:#8a1426;--ui-glow:transparent}
:root[data-theme=dark][data-contrast=strong]{--ui-page:#07090e;--ui-surface:#0c1019;--ui-soft:#151b29;--ui-tint:#27203c;--ui-text:#fff;--ui-muted:#f0f0f5;--ui-border:#b7bfd1;--ui-link:#ded1ff;--ui-solid:#4b2da6;--ui-solid-hover:#392080;--ui-focus:#ffdd75;--ui-input-border:#b7bfd1;--ui-danger:#a3102c;--ui-glow:transparent}
/* From 1280 px up the page grows gently with the screen: 1x at 1280 px up to 1.125x at 1920 px,
   times the size chosen in the accessibility panel. Layout sizes are in rem, so proportions stay as designed. */
:root[data-text-size="100"]{font-size:clamp(100%,calc(100% + (100vw - 1280px) / 320),112.5%);--ui-text-factor:1}:root[data-text-size="115"]{font-size:clamp(115%,calc(115% + (100vw - 1280px) * 1.15 / 320),129.375%);--ui-text-factor:1.15}:root[data-text-size="130"]{font-size:clamp(130%,calc(130% + (100vw - 1280px) * 1.3 / 320),146.25%);--ui-text-factor:1.3}:root[data-text-size="150"]{font-size:clamp(150%,calc(150% + (100vw - 1280px) * 1.5 / 320),168.75%);--ui-text-factor:1.5}
/* The owner panel is a work tool: it keeps the regular size. */
:root[data-text-size]:has(body[data-page=admin]){font-size:calc(100% * var(--ui-text-factor))}
body{background:var(--ui-page);color:var(--ui-text)}
:root[data-theme] :where(h1,h2,h3,h4,legend,.brand strong,.dropzone strong,.options-panel h3,.file-label strong,.result-row strong,.preview-heading h3,.message p,td,.tool-guide summary){color:var(--ui-text)}
:root[data-theme] :where(.topbar nav,.preview-badge,.eyebrow,.hero-copy>p,.hero-points,.section-heading>p,.filter-caption,.filter span,.tool-card p,.trust-strip p,.step-number,.future-strip p,footer>span,footer>div,footer small,.work-heading p,.dropzone>span:not(.upload-icon),.dropzone small,.file-label small,.empty-hint,.options-panel label,.tool-note,.field-hint,.status,.result-row small,.results>small,dialog p,dialog li,.dialog-label,.plan-comparison small,.ad-placement>small,.ad-demo,.ad-demo small,.tool-intro p,.breadcrumbs,.tool-guide,.content-page,.compare-grid figcaption small,.language-menu-heading,.language-name,.language-code,.operations-heading p,.form-stack small,.action-row small,.ticket-meta,.message small,.stat-card small,th,.ticket-button small,.empty-state,.file-preview-detail,.preview-kind,.preview-heading small,.preview-caption,.reorder-hint,.preview-announcement,.vlibras-panel p,.vlibras-panel>small,.appearance-privacy){color:var(--ui-muted)}
:root[data-theme] :where(.topbar,footer,.filter-row,.trust-strip,.ad-placement,.tool-guide details,.panel-tabs,th,td,.ticket-button,.expense-row){border-color:var(--ui-border)}
:root[data-theme] :where(.tool-card,.workspace,.icon-button,.filter,dialog,.surface,.panel-tabs button,.stat-card,.ticket-button,.file-list.preview-list>li,.file-controls button,.preview-toolbar button,.language-trigger,.language-menu,.select-trigger,.select-menu,.vlibras-panel){background:var(--ui-surface);border-color:var(--ui-border);color:var(--ui-text)}
:root[data-theme] :where(.options-panel,.dropzone,.future-strip,.preview-badge,.plan-comparison>div,.ad-consent,.content-page .content-callout,.language-notice,.message,.file-viewer,.usage-controls,.ad-promotion){background:var(--ui-soft);border-color:var(--ui-border)}
:root[data-theme] :where(input:not([type=range]):not([type=checkbox]):not([type=radio]),select,textarea){background:var(--ui-surface);border-color:var(--ui-border);color:var(--ui-text)}
:root[data-theme] :where(input,select,textarea){accent-color:var(--ui-solid)}
:root[data-theme] :where(input,textarea)::placeholder{color:var(--ui-muted);opacity:1}
:root[data-theme] input:not([type=range]):not([type=checkbox]):not([type=radio]),:root[data-theme] textarea,:root[data-theme] select{background:var(--ui-surface);border-color:var(--ui-border);color:var(--ui-text)}
:root[data-theme] .file-list.preview-list>li,:root[data-theme] .file-list.preview-list .file-controls button{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-border)}
:root[data-theme] .file-list.preview-list>li.selected-preview{border-color:var(--ui-focus)}
:root[data-theme] .file-list.preview-list>li.drop-target{background:var(--ui-tint);border-color:var(--ui-focus)}
:root[data-theme] .trust-strip>div,:root[data-theme] .topbar .language-fallback{background:var(--ui-surface);border-color:var(--ui-border)}
:root[data-theme] .trust-strip .step-number,:root[data-theme] .options-panel .target-explanation{background:var(--ui-tint);color:var(--ui-link)}
:root[data-theme] .language-code{background:var(--ui-soft);color:var(--ui-muted)}
:root[data-theme] .target-outcome.met{background:var(--ui-success-bg);color:var(--ui-success)}
:root[data-theme] .target-outcome.missed{background:var(--ui-warning-bg);color:var(--ui-warning)}
:root[data-theme] .target-presets button:hover{background:var(--ui-tint);color:var(--ui-link);border-color:var(--ui-focus)}
:root[data-theme] :is(.tool-card,.quick-link).image .tool-icon{background:#fff2e4;color:#865322}
:root[data-theme=dark] :is(.tool-card,.quick-link).image .tool-icon{background:#3a2a1f;color:#f5c396}
:root[data-theme] :where(.primary,.button.primary,.vlibras-launcher,.accessibility-launcher){background:var(--ui-solid);color:var(--ui-on-solid)}
:root[data-theme] :where(.primary:hover,.button.primary:hover,.vlibras-launcher:hover,.accessibility-launcher:hover){background:var(--ui-solid-hover);color:var(--ui-on-solid)}
:root[data-theme] :where(.subtle,.target-presets button,.language-option:hover,.language-option:focus-visible,.select-option:hover,.select-option[data-active],.tool-icon,.tool-tag,.status-pill,.file-order-number,.upload-icon){background:var(--ui-tint);color:var(--ui-link);border-color:var(--ui-border)}
:root[data-theme] :where(.dark,.filter.active,.panel-tabs .active,.compare-toolbar [aria-pressed=true],.bar-level.high){background:var(--ui-selected);color:var(--ui-on-solid);border-color:var(--ui-border)}
:root[data-theme] :where(h1 span,.hero h1 .hero-brand,.hero h1>span:last-child,.tool-card:hover h3,.range-label output,.stat-card strong,.preview-heading .text-button,.ad-promotion a,.language-notice .text-button,.tool-guide a:not(.button),.content-page a:not(.button),.notice a,.form-stack a,.vlibras-panel a){color:var(--ui-link)}
:root[data-theme] .hero h1 .hero-brand,:root[data-theme] .hero h1>span:last-child,:root[data-theme] .tool-card:hover h3{color:var(--ui-link)}
:root[data-theme] .art-label{color:var(--ui-muted)}:root[data-theme] .art-label strong{color:var(--ui-text)}
:root[data-theme] :where(.text-button:hover,a:not(.button):hover){color:var(--ui-link)}
:root[data-theme] :where(.select-trigger:hover,.select-trigger[aria-expanded=true],.language-trigger:hover,.language-trigger[aria-expanded=true],.message.admin,.ticket-button.selected,.notice){background:var(--ui-tint);border-color:var(--ui-focus)}
:root[data-theme] .select-option[aria-selected=true],:root[data-theme] .language-option[aria-selected=true]{background:var(--ui-tint);color:var(--ui-link)}
:root[data-theme] .language-option[aria-selected=true] .language-code{background:var(--ui-surface);color:var(--ui-link)}
:root[data-theme] :where(.select-trigger>svg,.language-trigger .language-chevron,.card-arrow){color:var(--ui-muted)}
:root[data-theme] .select-trigger[aria-disabled=true]{background:var(--ui-soft)}
:root[data-theme] :where(.dropzone:hover,.dropzone.drag,.file-list.preview-list>li.drop-target){background:var(--ui-tint);border-color:var(--ui-focus)}
:root[data-theme] :where(.file-list.preview-list>li.selected-preview){border-color:var(--ui-focus)}
:root[data-theme] :where(.ad-demo){background:repeating-linear-gradient(135deg,var(--ui-surface),var(--ui-surface) 12px,var(--ui-soft) 12px,var(--ui-soft) 24px);border-color:var(--ui-border)}
:root[data-theme] :where(.ad-promotion strong){color:var(--ui-text)}
:root[data-theme] :where(.ad-promotion span,.ad-promotion small){color:var(--ui-muted)}
:root[data-theme] :where(.bar-level,.bar-level.medium){background:var(--ui-tint);border-color:var(--ui-border);color:var(--ui-link)}
:root[data-theme] :where(.saving,.target-outcome.met){color:var(--ui-success)}
:root[data-theme] :where(.quality-warning){background:var(--ui-warning-bg);border-color:var(--ui-warning-border)}
:root[data-theme] :where(.quality-warning,.quality-warning strong,.quality-warning p,.status.warning,.target-outcome.missed){color:var(--ui-warning)}
:root[data-theme] :where(.status.error,.select-error,.danger-button){color:var(--ui-error)}
:root[data-theme] .danger-button{background:var(--ui-error-bg);border-color:var(--ui-error-border)}
:root[data-theme] #page-status.error{color:var(--ui-error)}
:root[data-theme] .select-trigger[aria-invalid=true]{border-color:var(--ui-error-border);background:var(--ui-error-bg)}
:root[data-theme] :where(.preview-stage,.file-thumb,.compare-viewport){border-color:var(--ui-border);color:#25324a}
:root[data-theme] :is(a,button,input,select,textarea,summary,[role=combobox],[tabindex]):focus-visible{outline:3px solid var(--ui-focus);outline-offset:3px}
:root[data-link-emphasis=yes] a:not(.brand):not(.button):not(.tool-card),:root[data-link-emphasis=yes] a.tool-card h3{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:4px}

.accessibility-launcher{position:fixed;right:var(--dock-right);bottom:var(--dock-bottom);z-index:30;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 12px;border:1px solid var(--ui-border);border-radius:11px;background:var(--ui-solid);color:var(--ui-on-solid);font:650 .6875rem/1.3 system-ui,sans-serif;box-shadow:0 4px 14px #151c3320;max-width:calc(100vw - 28px)}
html[lang=pt-BR] .accessibility-launcher:not(.in-header){bottom:calc(var(--dock-bottom) + 52px)}
/* In the header the launcher is a compact icon button; its name comes from aria-label. */
.topbar .accessibility-launcher.in-header{position:static;flex:none;width:40px;height:36px;min-height:36px;padding:0;border-radius:11px;border:1px solid var(--ui-border);background:var(--ui-surface);color:var(--ui-text);box-shadow:none}
.topbar .accessibility-launcher.in-header:hover,.topbar .accessibility-launcher.in-header[aria-expanded=true]{background:var(--ui-tint);border-color:var(--ui-focus);color:var(--ui-link)}
.accessibility-launcher.in-header>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.accessibility-launcher>svg{width:20px;height:20px;flex:none}
.accessibility-panel{position:fixed;inset:calc(76px + env(safe-area-inset-top)) var(--dock-right) auto auto;width:380px;max-width:calc(100vw - 28px);max-height:calc(100dvh - 92px - env(safe-area-inset-top));overflow:auto;overscroll-behavior:contain;margin:0;padding:22px;border:1px solid var(--ui-border);border-radius:17px;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 16px 60px #11182e30}
.accessibility-panel::backdrop{background:#10182c55;backdrop-filter:blur(2px)}
.accessibility-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.accessibility-heading h2{margin:8px 0 0;font-size:1.25rem;line-height:1.3;letter-spacing:-.5px}
.accessibility-heading .dialog-label{font-size:.5625rem;letter-spacing:1px}
.accessibility-heading .icon-button{position:static;min-width:36px;width:36px;height:36px;flex:none}
.accessibility-panel #accessibility-description{font-size:.75rem;line-height:1.6;margin:14px 0 18px}
.accessibility-panel fieldset{min-width:0;border:0;padding:0;margin:0 0 18px}
.accessibility-panel legend{font-size:.8125rem;font-weight:650;margin-bottom:10px;padding:0}
.theme-options{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:6px}
.theme-options label{position:relative;display:flex;align-items:center;justify-content:center;min-height:44px;padding:9px 5px;border:1px solid var(--ui-border);border-radius:9px;font-size:.75rem;line-height:1.5;text-align:center;cursor:pointer;background:var(--ui-surface);color:var(--ui-muted)}
.theme-options input{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
.theme-options label:has(:checked){border-color:var(--ui-focus);background:var(--ui-tint);color:var(--ui-link);font-weight:650}
.theme-options label:has(:focus-visible){outline:3px solid var(--ui-focus);outline-offset:3px}
.appearance-theme>small{display:block;margin-top:9px;font-size:.6875rem;line-height:1.6;color:var(--ui-muted)}
.text-size-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--ui-border);border-radius:10px;padding:7px;background:var(--ui-soft)}
.text-size-controls .button{justify-content:center;min-width:52px;min-height:40px;padding:7px 12px;font-size:.9375rem}
.text-size-controls output{font-variant-numeric:tabular-nums;font-size:.8125rem;font-weight:650;color:var(--ui-text)}
.appearance-toggles{border-top:1px solid var(--ui-border)}
.appearance-toggles label{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 0;border-bottom:1px solid var(--ui-border);cursor:pointer}
.appearance-toggles strong{display:block;color:var(--ui-text);font-size:.8125rem;line-height:1.5;font-weight:650}
.appearance-toggles small{display:block;margin-top:4px;color:var(--ui-muted);font-size:.6875rem;line-height:1.6}
.appearance-toggles input{width:20px;height:20px;flex:none;accent-color:var(--ui-solid);cursor:pointer}
.accessibility-panel .appearance-system-note,.accessibility-panel .appearance-status{font-size:.6875rem;line-height:1.65;margin:13px 0;color:var(--ui-muted)}
.accessibility-panel .appearance-reset{justify-content:center;min-height:44px;padding:11px 15px;font-size:.75rem}
.appearance-status:empty{display:none}.appearance-privacy{display:block;font-size:.625rem;line-height:1.7;color:var(--ui-muted);margin-top:14px}
/* VLibras joins open dialogs to remain usable in the modal's top layer. */
.accessibility-panel>.vlibras{border-top:1px solid var(--ui-border);margin-top:16px;padding-top:14px}
.accessibility-panel .vlibras-launcher{position:static;box-shadow:none;min-height:42px}
/* Only the Libras launcher (PT) still floats, so only it needs room at the end of the page. */
footer{padding-bottom:calc(28px + env(safe-area-inset-bottom))}html[lang=pt-BR] footer{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
/* On desktop, leave room beside the dock instead of a tall empty footer. */
@media(min-width:701px){footer,html[lang=pt-BR] footer{padding-bottom:28px}}
@media(min-width:701px){html[lang=pt-BR] footer{padding-inline-end:max(120px,calc(7rem + 20px))}}
:root[data-text-size]:not([data-text-size="100"]) :where(.topbar nav,.hero-actions,.hero-points,.panel-tabs,.work-heading,.preview-heading,.preview-toolbar){flex-wrap:wrap}
:root[data-text-size]:not([data-text-size="100"]) :where(.tool-card p,.trust-strip p){max-width:none}
:root[data-reduced-motion=yes],:root[data-reduced-motion=yes] *,:root[data-reduced-motion=yes] *::before,:root[data-reduced-motion=yes] *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
@media(prefers-reduced-motion:reduce){html:not([data-reduced-motion=no]),html:not([data-reduced-motion=no]) *,html:not([data-reduced-motion=no]) *::before,html:not([data-reduced-motion=no]) *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
@media(max-width:480px){.accessibility-panel{padding:18px}.accessibility-launcher{right:max(10px,env(safe-area-inset-right))}.accessibility-heading .icon-button{min-width:32px;width:32px;height:32px}}
@media(forced-colors:active){.accessibility-panel,.accessibility-launcher,.theme-options label,.text-size-controls{border-color:ButtonText}.theme-options label:has(:checked){outline:2px solid Highlight}.theme-options label:has(:focus-visible){outline-color:Highlight}}
/* Document/image editors share appearance tokens; document pixels stay intact. */
.extra-editor { margin-block:1rem; min-width:0; padding:1rem; border:1px solid var(--ui-border); border-radius:.8rem; background:var(--ui-surface); color:var(--ui-text); }
.extra-editor fieldset { min-width:0; border:0; padding:0; margin:0; }
.extra-editor legend { font-size:1rem; font-weight:700; margin-block-end:.6rem; }
.extra-editor p { font-size:.875rem; line-height:1.5; overflow-wrap:anywhere; }
.extra-editor canvas { display:block; max-width:100%; height:auto; touch-action:none; cursor:crosshair; margin-block:.75rem; border:1px solid var(--ui-border); }
.page-grid { list-style:none; padding:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,10rem),1fr)); gap:.8rem; }
.page-grid li { min-width:0; padding:.6rem; border:1px solid var(--ui-border); border-radius:.5rem; background:var(--ui-surface); }
.page-grid strong,.page-grid small { display:block; font-size:.8rem; margin-block:.25rem; }
.page-image { display:flex; align-items:center; justify-content:center; aspect-ratio:1; overflow:hidden; background:var(--ui-soft); }
.page-image img { width:100%; height:100%; object-fit:contain; }
.page-controls { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.25rem; margin-block-start:.5rem; }
.page-controls button { display:inline-flex; align-items:center; justify-content:center; min-width:2.25rem; min-height:2.25rem; padding:.3rem; font:inherit; color:var(--ui-text); background:var(--ui-surface); border:1px solid var(--ui-border); border-radius:.4rem; }
.page-controls [data-drag-file] { margin-inline-end:auto; touch-action:none; }
.page-controls svg { width:1rem; height:1rem; }
.page-controls button:disabled { opacity:.45; }
.page-grid .is-dragging { opacity:.6; }
.page-grid .drop-target { outline:2px solid var(--ui-focus); }
.crop-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.6rem; }
@media (max-width:400px) { .crop-fields { grid-template-columns:1fr; } }
.audio-view { margin-block:1rem; padding:1rem; border:1px solid var(--ui-border); border-radius:.8rem; background:var(--ui-surface); color:var(--ui-text); min-width:0; }
.audio-view h3 { font-size:1rem; overflow-wrap:anywhere; }
.audio-view p { font-size:.875rem; line-height:1.5; }
.audio-view audio { display:block; width:100%; min-width:0; max-width:100%; margin-block:1rem; }
.tool-card.audio .tool-icon { background:var(--ui-tint); color:var(--ui-link); }

.audio-view audio[inert] { opacity:.6; }
.empty-hint:is([data-kind=audio],[data-kind=video]) .placeholder-stage { display:none; }
body:is([data-tool^=audio],[data-tool^=video]) .files-card { container-type:inline-size; }
@container (max-width:36rem){
  :root[data-theme] body:is([data-tool^=audio],[data-tool^=video]) .files-card .file-list.preview-list>li,
  :root[data-theme] body:is([data-tool^=audio],[data-tool^=video]) .files-card .file-list.preview-list>li:not(:has(.drag-file)) { grid-template-columns:3.5rem minmax(0,1fr); grid-template-areas:"thumb order" "label label" "controls controls"; }
  body:is([data-tool^=audio],[data-tool^=video]) .files-card .file-list.preview-list .file-controls { display:flex; grid-area:controls; justify-content:flex-end; gap:.25rem; }
  body:is([data-tool^=audio],[data-tool^=video]) .files-card .file-list.preview-list .file-controls button { width:max(2rem,44px); height:max(2rem,44px); }
  body:is([data-tool^=audio],[data-tool^=video]) .files-card .file-list.preview-list .file-controls .drag-file { margin-inline-end:auto; }
  body:is([data-tool^=audio],[data-tool^=video]) .files-card .file-label strong { white-space:normal; overflow-wrap:anywhere; }
}

.video-view { margin-block:1rem; padding:1rem; border:1px solid var(--ui-border); border-radius:.8rem; background:var(--ui-surface); color:var(--ui-text); min-width:0; }
.video-view h3 { font-size:1rem; overflow-wrap:anywhere; }
.video-view p { font-size:.875rem; line-height:1.5; }
.video-view video { display:block; width:100%; max-height:24rem; margin-block:1rem; background:var(--ui-soft); }
.video-view video[inert] { opacity:.6; }
.video-compression-progress { margin-block:1rem; padding:1rem; border:1px solid var(--ui-border); border-radius:.8rem; background:var(--ui-surface); color:var(--ui-text); min-width:0; }
.video-compression-progress > div { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem 1rem; font-size:1rem; }
.video-compression-progress > div > span { flex:1 1 10rem; min-width:0; overflow-wrap:anywhere; }
.video-compression-progress strong { flex:none; margin-inline-start:auto; }
.video-compression-progress progress { display:block; width:100%; height:.875rem; margin-block:.75rem; accent-color:var(--ui-link); }
.video-compression-progress p,.video-resource-warning { font-size:.875rem; line-height:1.6; overflow-wrap:anywhere; }
.video-input-warning { margin-block:0 1rem; padding:.75rem; border:1px solid var(--ui-border); border-radius:.5rem; background:var(--ui-soft); color:var(--ui-text); font-size:.875rem; line-height:1.6; overflow-wrap:anywhere; }
#options-fields > [data-video-time] { margin-block:0 1rem; max-width:100%; white-space:normal; text-align:center; justify-content:center; }
body[data-tool=videoframe] .preview-zoom-label { margin-inline-start:auto; min-width:0; max-width:100%; flex-wrap:wrap; justify-content:flex-end; }
body[data-tool=videoframe] .preview-zoom-label .select-control { max-width:100%; }
body:is([data-tool=videoframe],[data-tool=videorotate],[data-tool=videotrim],[data-tool=videocompress]) .result-row > .result-sizes { min-width:0; max-width:100%; flex-wrap:wrap; white-space:normal; }
body:is([data-tool=videoframe],[data-tool=videorotate],[data-tool=videotrim],[data-tool=videocompress]) .result-row > .result-main { flex-basis:12rem; overflow-wrap:anywhere; }
.tool-card.video .tool-icon { background:var(--ui-tint); color:var(--ui-link); }
/* Search stays beside the home heading; file-type filters keep their own row. */
#tools .section-heading>div:first-child { flex:1 1 19rem; min-width:0; }
#tools .section-heading .filter-row { flex-basis:100%; justify-content:flex-end; }
.tool-search { flex:1 1 19rem; min-width:0; max-width:26rem; }
.tool-search-field { position:relative; display:flex; align-items:center; }
.tool-search-field>svg { position:absolute; inset-inline-start:.875rem; width:1.125rem; height:1.125rem; color:var(--ui-muted); pointer-events:none; }
.tool-search input { width:100%; min-width:0; min-height:2.75rem; border:1px solid var(--ui-border); border-radius:.625rem; padding:.75rem 3rem .75rem 2.5rem; font:inherit; font-size:.9375rem; color:var(--ui-text); background:var(--ui-surface); }
.tool-search input::placeholder { color:var(--ui-muted); opacity:1; }
.tool-search input:focus-visible { outline:2px solid var(--ui-focus); outline-offset:3px; }
.tool-search input::-webkit-search-cancel-button { display:none; }
.tool-search button { position:absolute; inset-inline-end:.25rem; display:inline-flex; align-items:center; justify-content:center; width:2.25rem; height:2.25rem; padding:0; border:0; border-radius:.375rem; color:var(--ui-muted); background:transparent; cursor:pointer; }
.tool-search button svg { width:1rem; height:1rem; }
.tool-search button:hover { background:var(--ui-soft); color:var(--ui-text); }
.tool-search-status { margin:0 0 1rem; font-size:.9375rem; line-height:1.5; color:var(--ui-muted); }
#tool-grid>.tool-card[hidden],.tool-search[hidden],.tool-search button[hidden] { display:none; }
@media(max-width:700px){
 #tools .section-heading>div:first-child { flex-basis:100%; }
 .tool-search { flex-basis:100%; max-width:none; width:100%; }
 #tools .section-heading .filter-row { justify-content:flex-start; }
}

/* Native button keeps file selection available to keyboard and touch users. */
.dropzone .file-picker-button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;margin-inline-start:auto;min-height:2.75rem;white-space:normal;text-align:center}
@media(max-width:700px){.dropzone .file-picker-button{flex:1 1 100%;width:100%;margin-inline-start:0}}
/* File-type colors for the tool catalog, quick links and toasts. Text always names the type too. */
:root{--ui-type-pdf:#5034ce;--ui-type-pdf-bg:#efedff;--ui-type-image:#865322;--ui-type-image-bg:#fff2e4;--ui-type-video:#1d6aa8;--ui-type-video-bg:#e3f1fc;--ui-type-audio:#a8366f;--ui-type-audio-bg:#fce8f2;--ui-type-sheet:#21744a;--ui-type-sheet-bg:#e2f5ea}
:root[data-theme=dark]{--ui-type-pdf:#c1b0ff;--ui-type-pdf-bg:#30284d;--ui-type-image:#f5c396;--ui-type-image-bg:#3a2a1f;--ui-type-video:#86c8fa;--ui-type-video-bg:#16314a;--ui-type-audio:#f5a3cc;--ui-type-audio-bg:#3b1d33;--ui-type-sheet:#86dfad;--ui-type-sheet-bg:#173526}
:root[data-contrast=strong]{--ui-type-pdf:#35209b;--ui-type-image:#673a10;--ui-type-video:#0b4a80;--ui-type-audio:#7f1449;--ui-type-sheet:#0e5530}
:root[data-theme=dark][data-contrast=strong]{--ui-type-pdf:#ded1ff;--ui-type-image:#ffd9b0;--ui-type-video:#bfe4ff;--ui-type-audio:#ffcde6;--ui-type-sheet:#bff3d4}
:root[data-theme] :is(.tool-group,.tool-link,.quick-link,.tool-card).pdf .tool-icon{background:var(--ui-type-pdf-bg);color:var(--ui-type-pdf)}
:root[data-theme] :is(.tool-group,.tool-link,.quick-link,.tool-card).image .tool-icon{background:var(--ui-type-image-bg);color:var(--ui-type-image)}
:root[data-theme] :is(.tool-group,.tool-link,.quick-link,.tool-card).video .tool-icon{background:var(--ui-type-video-bg);color:var(--ui-type-video)}
:root[data-theme] :is(.tool-group,.tool-link,.quick-link,.tool-card).audio .tool-icon{background:var(--ui-type-audio-bg);color:var(--ui-type-audio)}
:root[data-theme] :is(.tool-group,.tool-link,.quick-link,.tool-card).sheet .tool-icon{background:var(--ui-type-sheet-bg);color:var(--ui-type-sheet)}
:root[data-theme] .tool-list .tool-link .tool-icon{background:none}
:root[data-theme] .tool-group-head:hover{background:var(--ui-soft)}
:root[data-theme] .tool-link:is(:hover,:focus-visible){background:var(--ui-soft)}
:root[data-theme=dark] .toast{box-shadow:0 .75rem 2rem rgba(0,0,0,.45)}
:root[data-reduced-motion=yes] .toast-progress{display:none}
