/* Shared styles for tools/pdf-studio.html and tools/doc-converter.html (ds-* components). */
.ds-ops { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.ds-op { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .5rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer; }
.ds-op:hover { color: var(--text-primary); border-color: var(--border-medium); }
.ds-op[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--bg-surface-raised); font-weight: 650; box-shadow: inset 0 -2px 0 var(--accent); }
.ds-panel { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: clamp(1rem, 3vw, 1.5rem); }
.ds-drop { display: grid; justify-items: center; gap: .5rem; text-align: center; border: 2px dashed var(--border-medium); border-radius: var(--radius-lg); background: var(--bg-surface-raised); padding: 1.75rem 1rem; margin-bottom: 1.25rem; transition: border-color .15s, background .15s; }
.ds-drop.is-over { border-color: var(--accent); background: var(--bg-surface-hover); }
.ds-drop h2 { font-size: 1.1rem; margin: 0; }
.ds-drop p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.ds-files { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .4rem; }
.ds-file { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-base); font-size: .88rem; }
.ds-file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ds-file-size { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-icon-btn { min-width: 36px; min-height: 36px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary); font: inherit; cursor: pointer; }
.ds-icon-btn:hover:not(:disabled) { color: var(--text-primary); border-color: var(--border-medium); }
.ds-icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.ds-icon-btn[aria-pressed="true"] { color: var(--danger, #b91c1c); border-color: currentColor; }
.ds-opts { border-top: 1px solid var(--border-subtle); padding-top: 1.1rem; }
.ds-opts > p { color: var(--text-secondary); font-size: .92rem; margin: 0 0 .9rem; max-width: 70ch; }
.ds-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.ds-field label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: .3rem; }
.ds-field .hint { display: block; font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.ds-input { width: 100%; min-height: 44px; padding: .5rem .7rem; border-radius: var(--radius-sm); border: 1px solid var(--border-medium); background: var(--bg-base); color: var(--text-primary); font: inherit; }
textarea.ds-input { min-height: 280px; font-family: var(--font-mono); font-size: .88rem; line-height: 1.5; resize: vertical; }
.ds-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.ds-status { margin-top: 1rem; display: grid; gap: .5rem; }
.ds-status progress { width: 100%; height: .5rem; accent-color: var(--accent); }
.ds-msg { font-size: .9rem; color: var(--text-secondary); }
.ds-error { border: 1px solid var(--danger, #b91c1c); border-left-width: 4px; border-radius: var(--radius-sm); padding: .7rem .9rem; background: var(--bg-surface-raised); color: var(--text-primary); display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.ds-ok { border-left: 4px solid var(--success, #15803d); padding: .6rem .9rem; background: var(--bg-surface-raised); border-radius: var(--radius-sm); }
.ds-thumbs { list-style: none; margin: 0; padding: .5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; max-height: 560px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-base); }
.ds-thumb { border: 1px solid var(--border-medium); border-radius: var(--radius-sm); background: var(--bg-surface); padding: .45rem; display: grid; gap: .4rem; justify-items: center; }
.ds-thumb.is-deleted { opacity: .45; }
.ds-thumb.is-deleted img { filter: grayscale(1); }
.ds-thumb img { width: 100%; height: auto; background: #fff; border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .2s; }
.ds-thumb-label { font-size: .8rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ds-thumb-tools { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: center; }
.ds-previews { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }
.ds-previews a { display: block; width: 110px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: hidden; }
.ds-previews img { width: 100%; display: block; background: #fff; }
@media (prefers-reduced-motion: reduce) { .ds-thumb img { transition: none; } }

/* Document Converter additions */
.ds-panel + .ds-panel { margin-top: 1.5rem; }
.ds-h2 { font-size: 1.25rem; margin: 0 0 .4rem; }
.ds-lead { color: var(--text-secondary); font-size: .93rem; margin: 0 0 1.1rem; max-width: 72ch; }
.ds-drop h3 { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; }
.ds-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-secondary); margin: 0 0 .35rem; }
.ds-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.ds-side { display: grid; align-content: start; gap: 1rem; }
.ds-preview { min-height: 280px; max-height: 520px; overflow: auto; padding: 1rem; background: var(--bg-base); border: 1px solid var(--border-medium); border-radius: var(--radius-sm); color: var(--text-primary); line-height: 1.6; overflow-wrap: anywhere; }
.ds-preview img { max-width: 100%; height: auto; }
.ds-preview table { border-collapse: collapse; }
.ds-preview td, .ds-preview th { border: 1px solid var(--border-medium); padding: .3rem .5rem; }
.ds-warn { margin: 0 0 1rem; padding: .6rem .9rem; border: 1px solid var(--border-subtle); border-left: 4px solid var(--warning, #b45309); border-radius: var(--radius-sm); background: var(--bg-surface-raised); font-size: .88rem; }
.ds-warn summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.ds-warn ul { margin: .5rem 0 0; padding-left: 1.2rem; max-height: 200px; overflow: auto; color: var(--text-secondary); }
.hint { font-size: .8rem; color: var(--text-muted); margin: .3rem 0 0; }
@media (max-width: 760px) { .ds-split { grid-template-columns: 1fr; } }
