#dialog .pdf-studio{max-width:100%;min-width:0}.pdf-intro,.pdf-privacy{color:var(--muted,#9fa3aa);line-height:1.5}.pdf-privacy{font-size:12px;margin-top:20px}.pdf-tabs,.pdf-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:12px 0}.pdf-tabs button{flex:1}.pdf-tabs button[aria-pressed=true]{border-color:#a4a9e8;background:#39384d;color:#fff}.pdf-panel[hidden],.pdf-preview[hidden],#dialog .pdf-studio [hidden]{display:none!important}.pdf-field{display:flex;flex-direction:column;gap:7px;font-size:13px;margin:16px 0}.pdf-field input,.pdf-field textarea,.pdf-field select{box-sizing:border-box;width:100%;min-width:0;font:16px/1.5 system-ui;padding:12px;border:1px solid #53565e;border-radius:10px;background:var(--panel,#242528);color:var(--text,#eee)}.pdf-editor{min-height:220px;max-height:45vh;resize:vertical}#dialog .pdf-studio button,#dialog .pdf-studio a.primary{min-height:44px;padding:10px 15px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}#dialog .pdf-studio a.primary{text-decoration:none;display:inline-flex;align-items:center;border-radius:10px;background:#e9ebf4;color:#171820}.pdf-result{white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.6;max-height:45vh;overflow:auto;overscroll-behavior:contain}.pdf-file-info{overflow-wrap:anywhere}.pdf-status{font-size:13px;line-height:1.5;color:var(--text,#ddd)}.pdf-preview{padding:12px;background:#dfe3eb;border-radius:12px}.pdf-preview canvas{display:block;width:100%;height:auto;background:white}.pdf-preview .pdf-actions{justify-content:space-between;color:#202938}.pdf-preview button{background:white;color:#202938}#dialog .pdf-studio input[type=file]{font-size:14px}dialog:has(.pdf-studio){width:min(860px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain}@media(max-width:760px){dialog:has(.pdf-studio){width:calc(100vw - 20px);max-width:none;padding:20px 16px;max-height:calc(100dvh - 20px - env(safe-area-inset-top));box-sizing:border-box}.pdf-actions>*{flex:1 1 auto}.pdf-editor{min-height:180px}.pdf-result{max-height:40dvh}}

#dialog .pdf-studio textarea,#dialog .pdf-studio input,#dialog .pdf-studio select{font-family:system-ui,sans-serif!important}
#dialog .pdf-studio,#dialog .pdf-studio h3,#dialog .pdf-studio p,#dialog .pdf-studio label,#dialog .pdf-studio button,#dialog .pdf-studio a,#dialog .pdf-studio summary{font-family:system-ui,-apple-system,sans-serif!important}
dialog:has(.pdf-studio){max-width:860px}#dialog .pdf-studio .pdf-intro{font-size:14px!important}#dialog .pdf-studio button,#dialog .pdf-studio a.primary{font-size:14px!important;min-height:44px!important}#dialog .pdf-studio .pdf-image-actions button{font-size:12px!important}#dialog .pdf-studio .pdf-empty{padding:16px;font-size:13px}#dialog .pdf-studio .pdf-export-actions{background:var(--bg,#181818);border-radius:10px}
.pdf-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:20px 0 24px}
#dialog .pdf-studio .pdf-choice{display:flex;flex-direction:column;align-items:flex-start;gap:5px;text-align:left;min-width:0;padding:16px;border:1px solid var(--line,#45434b);border-radius:14px;background:transparent;color:var(--text,#eee);font-family:system-ui,sans-serif}
.pdf-choice strong{font-size:14px;font-weight:600}.pdf-choice span{font-size:12px;line-height:1.4;color:var(--muted,#aaa)}
#dialog .pdf-studio .pdf-choice[aria-pressed=true]{background:color-mix(in srgb,var(--text,#fff) 7%,transparent);border-color:var(--text,#eee)}
.pdf-panel{border-top:1px solid var(--line,#45434b);padding-top:20px;min-width:0}.pdf-panel h3{font:600 20px/1.3 system-ui;margin:0 0 8px}.pdf-panel>.pdf-intro{margin:0 0 20px;font-size:14px}
.pdf-options{margin:18px 0;color:var(--muted,#aaa);font-size:13px}.pdf-options summary{cursor:pointer;min-height:32px;padding:6px 0}.pdf-options[open]{padding-bottom:8px}
.pdf-upload-zone{display:flex;flex-direction:column;gap:12px;align-items:center;justify-content:center;min-height:110px;padding:20px;border:1px dashed var(--muted,#888);border-radius:14px;font:600 15px system-ui;background:color-mix(in srgb,var(--text,#fff) 3%,transparent)}
.pdf-upload-zone input{max-width:100%;min-width:0;font-weight:400}.pdf-upload-zone input::file-selector-button{border:0;border-radius:8px;padding:10px 12px;margin-right:10px;cursor:pointer;font:inherit}
.pdf-image-count{margin-right:auto;color:var(--muted,#aaa);font-size:13px}.pdf-empty{padding:28px 16px;text-align:center;color:var(--muted,#aaa);font-size:14px;line-height:1.6;border-radius:12px;background:color-mix(in srgb,var(--text,#fff) 3%,transparent)}
.pdf-image-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:0;margin:16px 0;list-style:none}.pdf-image-card{min-width:0;border:1px solid var(--line,#45434b);border-radius:12px;overflow:hidden;background:var(--panel,#242528)}
.pdf-image-card img{display:block;width:100%;height:150px;object-fit:contain;background:#ececee}.pdf-image-caption{display:flex;flex-direction:column;gap:4px;padding:10px 10px 4px;font:12px/1.4 system-ui;min-width:0}.pdf-image-caption strong{font-size:13px}.pdf-image-caption span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted,#aaa)}
.pdf-image-actions{display:flex;gap:2px;padding:4px}#dialog .pdf-studio .pdf-image-actions button{padding:7px;min-width:38px;flex:1;border:0;background:transparent;font-size:12px}.pdf-image-actions button:last-child{flex:2}#dialog .pdf-studio button:disabled{opacity:.45;cursor:default}#dialog .pdf-studio :focus-visible{outline:2px solid #aaa4e8;outline-offset:3px}.pdf-export-actions{position:sticky;bottom:0;padding:12px 0;background:var(--panel,#242528);z-index:1}.pdf-export-actions>.primary{flex:1;justify-content:center;text-align:center}
@media(max-width:760px){.pdf-choices{gap:8px;margin:12px 0 20px}#dialog .pdf-studio .pdf-choice{padding:12px}.pdf-image-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.pdf-image-card img{height:130px}.pdf-image-actions{gap:0}#dialog .pdf-studio .pdf-image-actions button{padding:6px;min-width:34px}.pdf-export-actions{padding-bottom:calc(10px + env(safe-area-inset-bottom));}.pdf-upload-zone{padding:16px 10px}}

/* PDF controls do not inherit fixed chat-button heights or text offsets. */
#dialog .pdf-studio button,#dialog .pdf-studio a.primary{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:auto!important;min-height:44px!important;min-width:0;max-width:100%;margin:0;padding:11px 16px!important;font:600 14px/1.4 system-ui,-apple-system,sans-serif!important;letter-spacing:normal!important;text-transform:none!important;text-align:center;white-space:normal;overflow-wrap:anywhere;vertical-align:middle}
#dialog .pdf-studio .pdf-choice{align-items:flex-start;justify-content:flex-start;text-align:left;padding:16px!important}
#dialog .pdf-studio .pdf-choice strong,#dialog .pdf-studio .pdf-choice span{display:block;line-height:1.4;max-width:100%}
#dialog .pdf-studio .pdf-image-actions button{padding:8px 5px!important;min-width:32px;font-size:12px!important}
#dialog .pdf-studio .pdf-actions{gap:10px}#dialog .pdf-studio .pdf-preview .pdf-actions{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
#dialog .pdf-studio .pdf-preview .pdf-actions span{text-align:center;font:13px/1.4 system-ui;color:#202938}
@media(max-width:420px){#dialog .pdf-studio .pdf-choice{padding:12px!important}#dialog .pdf-studio .pdf-actions>button,#dialog .pdf-studio .pdf-actions>a{flex:1 1 135px}#dialog .pdf-studio .pdf-preview .pdf-actions{gap:6px}#dialog .pdf-studio .pdf-preview button{padding:10px 6px!important}}

#dialog .pdf-studio .pdf-preview button{color:#202938!important;background:#fff!important;border:1px solid #aab1bf!important}
#dialog .pdf-studio .pdf-preview .pdf-actions span{font:13px/1.4 system-ui,sans-serif!important;color:#202938!important}
#dialog .pdf-studio input::file-selector-button{color:#202938;background:#e9ebf4;line-height:1.4;min-height:44px}
