.pdf-workspace { border: 1px solid var(--border-color, #d5ded9); border-radius: 20px; padding: clamp(16px, 3vw, 32px); background: var(--bg-2, #fff); color: var(--text-primary, #173c32); }
.pdf-workspace p { line-height: 1.55; overflow-wrap: anywhere; }
.pdf-workspace button, .pdf-workspace a { min-height: 40px; padding: 9px 12px; border: 1px solid var(--dark-border-soft, #bbcfc4); border-radius: 8px; background: var(--dark-paper-3, #eef5ef); color: var(--dark-ink, #173c32); cursor: pointer; font: inherit; text-decoration: none; }
.pdf-workspace button:disabled { opacity: .45; cursor: not-allowed; }
.pdf-workspace button:focus-visible, .pdf-workspace input:focus-visible, .pdf-workspace select:focus-visible, .pdf-workspace a:focus-visible { outline: 3px solid #448c73; outline-offset: 3px; }
.pdf-workspace input, .pdf-workspace select { display: block; min-width: 0; width: 100%; box-sizing: border-box; margin-top: 8px; padding: 10px; font: inherit; border: 1px solid var(--dark-border-soft, #bbcfc4); border-radius: 8px; background: var(--dark-field, #fff); color: var(--dark-ink, #173c32); }
.pdf-toolbar, .pdf-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pdf-toolbar { margin: 20px 0; }
.pdf-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 205px), 1fr)); gap: 16px; }
.pdf-page-card { padding: 12px; border: 1px solid var(--dark-border-soft, #c8d7ce); border-radius: 12px; min-width: 0; }
.pdf-thumbnail { height: 200px; display: grid; place-items: center; background: var(--dark-paper-3, #eaf0ec); border-radius: 6px; overflow: hidden; }
.pdf-thumbnail img { max-width: 185px; max-height: 185px; object-fit: contain; }
.pdf-page-actions button { font-size: 12px; padding: 7px; flex-grow: 1; }
.pdf-control-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 20px; }
.pdf-file-label { display: block; font-weight: 600; }
.pdf-workspace [hidden] { display: none !important; }
.pdf-thumbnail-frame { position: relative; display: inline-block; overflow: hidden; line-height: 0; }
.pdf-thumbnail-frame img { display: block; }
.pdf-workspace .crop-box { position: absolute; pointer-events: none; box-sizing: border-box; border: 2px solid #00857a; box-shadow: 0 0 0 200vmax rgba(13,24,35,.48); }
.pdf-crop-editor { margin: 16px 0; padding: 12px; border: 1px solid var(--dark-border-soft, #bbcfc4); border-radius: 10px; }
.pdf-crop-editor fieldset { min-width: 0; border: 0; padding: 0; margin: 12px 0; }
.pdf-crop-editor legend { font-weight: 650; }
.pdf-crop-editor .crop-stage { display: grid; place-items: center; background: var(--dark-paper-3, #eaf0ec); overflow: hidden; padding: 8px; }
.pdf-crop-editor .crop-surface { position: relative; display: inline-block; line-height: 0; max-width: 100%; overflow: hidden; cursor: crosshair; touch-action: none; user-select: none; }
.pdf-crop-editor canvas { display: block; max-width: 100%; max-height: min(62vh, 680px); width: auto; height: auto; }
.pdf-crop-editor .crop-edges { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,110px),1fr)); gap: 8px; margin: .6rem 0; }
.pdf-crop-editor .crop-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: .5rem; }
.pdf-crop-editor [data-crop="message"] { font-weight: 650; }

/* Space the page holds for this panel until it mounts (see .tool-view-placeholder in _workspace.css).
   The panel is shorter than the default reservation, so without these heights the guidance below
   would jump up when it mounts. Each is a little under the panel's measured height at that width;
   re-measure after changing the panel's layout (browser-tool-view-reservations test). */
.tool-view-placeholder[data-tool="pdf-organizer"] { min-height: 271px; }
@media (max-width: 999px) { .tool-view-placeholder[data-tool="pdf-organizer"] { min-height: 266px; } }
@media (max-width: 597px) { .tool-view-placeholder[data-tool="pdf-organizer"] { min-height: 286px; } }
@media (max-width: 363px) { .tool-view-placeholder[data-tool="pdf-organizer"] { min-height: 361px; } }
