/* ============================================================
   PDF2WEB — Tools Workspace
   Workspace now lives inside .shell main .wrap (same as app.html).
   ============================================================ */

body[data-nav-standalone] {
  background: var(--bg);
}

/* ============================================================
   LANDING (tool grid) — lives inside .shell main .wrap
   ============================================================ */
.tools-landing {
  padding: 6px 0 40px;
}

.tools-landing h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 0 0 6px;
}
.tools-landing .meta {
  font-size: 14px;
  color: var(--text-soft);
  margin: 0 0 26px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  cursor: pointer;
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card .tool-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}
.tool-card b {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-dark);
}
.tool-card span {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-light);
}

/* ============================================================
   WORKSPACE (per-tool screen) — sits inside .wrap
   ============================================================ */
.tools-workspace {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
  margin: -6px 0 -40px;
}

.ws-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 18px;
  flex-shrink: 0;
}
.ws-topbar .ws-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.ws-topbar .ws-back:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.ws-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ws-title .ws-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ws-title h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}
.ws-title small {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
  line-height: 1.3;
  margin-top: 2px;
}

/* Body: controls + preview */
.ws-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.ws-controls {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  border-right: 1px solid var(--border);
}

.ws-preview {
  background: var(--bg);
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
}

/* ============================================================
   BOTTOM STICKY ACTION BAR
   ============================================================ */
.ws-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 12px;
  margin-top: 16px;
  background: var(--bg);
  flex-shrink: 0;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 40;
}
.ws-actions-left,
.ws-actions-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 900px) {
  .tools-workspace {
    min-height: auto;
    margin: 0;
  }
  .ws-body {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .ws-controls {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow: visible;
    min-height: 0;
  }
  .ws-preview {
    overflow: visible;
    min-height: 0;
  }
  .ws-preview { min-height: 320px; }

  .ws-actions {
    position: static;
    padding: 14px 0;
  }
  .ws-actions-left,
  .ws-actions-right {
    width: 100%;
  }
  .ws-actions-left .btn,
  .ws-actions-right .btn {
    flex: 1;
    justify-content: center;
  }
}

/* ============================================================
   UPLOAD ZONE + FILE LIST
   ============================================================ */
.ws-upload .btn.primary i {
  color: #fff !important;
}

.ws-upload {
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  padding: 26px 18px;
  text-align: center;
  transition: all .15s ease;
  background: var(--bg);
}
.ws-upload:hover,
.ws-upload.dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.ws-upload > i {
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 8px;
  display: block;
}
.ws-upload b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.ws-upload > span {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 12px;
}

/* File list (drag reorder) */
.ws-filelist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ws-filelist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: grab;
  transition: all .15s ease;
}
.ws-filelist li.dragging {
  opacity: 0.5;
  border-color: var(--primary);
  background: var(--primary-bg);
}
.ws-filelist li:hover { border-color: var(--primary-light); }
.ws-filelist .drag-handle {
  color: var(--text-light);
  font-size: 12px;
  cursor: grab;
}
.ws-filelist .file-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-filelist .file-size {
  font-size: 11.5px;
  color: var(--text-light);
  flex-shrink: 0;
}
.ws-filelist .file-remove {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.ws-filelist .file-remove:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ============================================================
   FIELDS / FORM INPUTS
   ============================================================ */
.ws-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ws-field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.ws-field input[type="text"],
.ws-field input[type="number"],
.ws-field input[type="email"],
.ws-field input[type="password"],
.ws-field select,
.ws-field textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.ws-field input:focus,
.ws-field select:focus,
.ws-field textarea:focus {
  outline: 0;
  border-color: var(--primary);
}
.ws-field small {
  font-size: 11.5px;
  color: var(--text-light);
  line-height: 1.4;
}
.ws-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Range slider */
.ws-field input[type="range"] {
  width: 100%;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 99px;
  background: var(--border);
}
.ws-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.ws-field input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  cursor: pointer;
}

/* ============================================================
   PREVIEW — file strip + canvas
   ============================================================ */
.preview-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 720px;
}
.preview-file i {
  font-size: 22px;
  color: var(--danger);
  flex-shrink: 0;
}
.preview-file div { flex: 1; min-width: 0; }
.preview-file b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-file span {
  font-size: 11.5px;
  color: var(--text-light);
}

.preview-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-md);
  max-width: 100%;
  text-align: center;
}
.preview-canvas canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* ============================================================
   PROGRESS + RESULT + EMPTY
   ============================================================ */
.ws-progress {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.ws-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ws-progress-bar i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  width: 0;
  transition: width .25s ease;
}
.ws-progress-label {
  font-size: 12.5px;
  color: var(--text-soft);
  text-align: center;
  margin: 0;
  font-weight: 600;
}

.ws-result {
  background: var(--primary-bg);
  border: 1px solid var(--primary-light);
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 720px;
  text-align: center;
  margin: 0 auto;
}
.ws-result .icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 12px;
  box-shadow: var(--shadow-sm);
}
.ws-result b {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.ws-result span {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.ws-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-light);
  max-width: 480px;
  margin: 0 auto;
}
.ws-empty i {
  font-size: 40px;
  color: var(--primary-light);
  display: block;
  margin-bottom: 14px;
}
.ws-empty b {
  display: block;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
}

/* ============================================================
   INFO CARD
   ============================================================ */
.info-card {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--primary-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-soft);
}
.info-card i {
  color: var(--primary);
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}
.info-card b {
  display: block;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 2px;
  font-size: 13px;
}

/* ============================================================
   SUMMARY BOX
   ============================================================ */
.summary-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-soft);
}
.summary-row b {
  font-size: 14px;
  font-weight: 800;
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.ws-toggle {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.ws-toggle-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.ws-toggle-label > span:first-child {
  flex: 1;
  min-width: 0;
}

.ws-toggle-label input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

.ws-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: var(--border-strong);
  transition: background .2s ease;
  flex-shrink: 0;
  cursor: pointer;
}

.ws-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  transition: transform .2s ease;
}

.ws-toggle-label input[type="checkbox"]:checked + .ws-switch {
  background: var(--primary);
}
.ws-toggle-label input[type="checkbox"]:checked + .ws-switch::after {
  transform: translateX(18px);
}

/* ============================================================
   RENAME DIALOG
   ============================================================ */
.rename-box {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 15, .55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rename-box .box {
  background: var(--surface);
  border-radius: 14px;
  padding: 24px 22px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.rename-box h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
}
.rename-box input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  margin-bottom: 14px;
}
.rename-box input:focus {
  outline: 0;
  border-color: var(--primary);
}
.rename-box .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============================================================
   DRAGGABLE OVERLAY STAGE
   ============================================================ */
.wm-stage {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: block;
  margin: 0 auto;
  user-select: none;
}
.wm-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wm-overlay {
  position: absolute;
  color: #4a4a4a;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  cursor: grab;
  transform-origin: center center;
  white-space: nowrap;
  padding: 6px 10px;
  border: 2px dashed transparent;
  border-radius: 6px;
  transition: border-color .15s ease, background .15s ease;
  pointer-events: auto;
  user-select: none;
}
.wm-overlay:hover {
  border-color: var(--primary);
  background: rgba(30, 107, 58, .05);
}
.wm-overlay.dragging {
  cursor: grabbing;
  border-color: var(--primary);
  background: rgba(30, 107, 58, .1);
}

.sig-overlay {
  position: absolute;
  cursor: grab;
  transform-origin: center center;
  pointer-events: auto;
  user-select: none;
  border: 2px dashed transparent;
  border-radius: 6px;
  transition: border-color .15s ease, background .15s ease;
}
.sig-overlay:hover {
  border-color: var(--primary);
  background: rgba(30, 107, 58, .06);
}
.sig-overlay.dragging {
  cursor: grabbing;
  border-color: var(--primary);
  background: rgba(30, 107, 58, .12);
}

.sig-date-ghost {
  position: absolute;
  pointer-events: none;
  color: #4a4a4a;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0.9;
  background: rgba(230, 126, 34, .15);
  border: 1px dashed rgba(230, 126, 34, .6);
  border-radius: 4px;
  padding: 2px 8px;
  transition: left .1s ease, top .1s ease;
  z-index: 5;
}

/* ============================================================
   SIZE COMPARE (compress)
   ============================================================ */
.size-compare {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 12px;
  max-width: 720px;
  width: 100%;
  justify-content: center;
}
.size-compare i {
  color: var(--text-light);
  font-size: 18px;
}
.size-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.size-col .size-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  font-weight: 700;
}
.size-col b {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-dark);
}
.size-col:last-child b {
  color: var(--primary);
}

/* ============================================================
   ROTATE BUTTONS
   ============================================================ */
.rotate-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.rotate-buttons .btn {
  flex-direction: column;
  padding: 12px 8px;
  gap: 6px;
  font-size: 12px;
}
.rotate-buttons .btn i {
  font-size: 18px;
  color: var(--primary);
}

/* ============================================================
   THUMBNAIL GRID  (split / extract / delete / pdf2jpg)
   ============================================================ */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.thumb-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.thumb-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}
.thumb-card.marked {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.thumb-card.marked.danger {
  border-color: var(--danger);
  background: #fdecec;
}
html[data-contrast=dark] .thumb-card.marked.danger {
  background: #3a1a1a;
}

.thumb-canvas-wrap {
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  border-radius: 6px;
  position: relative;
}
.thumb-canvas-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.thumb-loading {
  color: var(--text-light);
  font-size: 18px;
}

.thumb-number {
  text-align: center;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}
.thumb-card.marked .thumb-number {
  color: var(--primary-dark);
}
.thumb-card.marked.danger .thumb-number {
  color: var(--danger);
}

.thumb-card.marked::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.thumb-card.marked.danger::after {
  content: "\f00d";
  background: var(--danger);
}

/* Selected-pages summary line under the shortcut buttons */
#selectSummary {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-soft);
}
#selectSummary b {
  color: var(--primary-dark);
  font-weight: 800;
}

/* ============================================================
   SPLIT — QUICK SELECT BUTTON GRID
   ============================================================ */
.ws-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.ws-quick-grid .btn {
  justify-content: center;
  padding: 8px 10px;
  font-size: 12.5px;
  gap: 6px;
}
.ws-quick-grid .btn i {
  font-size: 12px;
}

@media (max-width: 520px) {
  .ws-quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   IMAGE GRID
   ============================================================ */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}
.image-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  cursor: grab;
  transition: all .15s ease;
  text-align: center;
  position: relative;
}
.image-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.image-card.dragging {
  opacity: 0.5;
  border-color: var(--primary);
  background: var(--primary-bg);
}
.image-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: var(--bg);
  border-radius: 6px;
  display: block;
  pointer-events: none;
}
.image-card b {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.image-card .image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  opacity: 0;
  transition: opacity .15s ease;
}
.image-card:hover .image-remove {
  opacity: 1;
}

/* ============================================================
   EXTRACTED IMAGES GRID (pdf2jpg result)
   ============================================================ */
.extracted-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}
.extracted-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  transition: all .15s ease;
}
.extracted-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.extracted-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: contain;
  background: var(--bg);
  display: block;
}
.extracted-card .extracted-foot {
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.extracted-card .extracted-foot a {
  color: var(--primary);
  font-size: 14px;
}

/* ============================================================
   SPLIT POINTS LIST
   ============================================================ */
.split-points {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.split-point {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-soft);
}
.split-point b {
  color: var(--primary-dark);
}

/* ============================================================
   TABLE (excel / conversion preview)
   ============================================================ */
.conv-table {
  width: 100%;
  max-width: 900px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  max-height: 400px;
}
.conv-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.conv-table th,
.conv-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.conv-table th {
  background: var(--bg);
  font-weight: 700;
  color: var(--primary-dark);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ============================================================
   SERVER STATUS CARD
   ============================================================ */
.server-status {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  max-width: 480px;
  margin: 20px auto;
}
.server-status .spin {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  margin: 0 auto 18px;
  animation: spin .8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.server-status b {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--primary-dark);
}
.server-status span {
  font-size: 12.5px;
  color: var(--text-light);
}

/* ============================================================
   REORDER HINT
   ============================================================ */
.reorder-hint {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 6px;
  text-align: center;
}
.reorder-hint i {
  margin-right: 4px;
}

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-box {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 15, .55);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.confirm-box .box {
  background: var(--surface);
  border-radius: 14px;
  padding: 24px 22px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.confirm-box .icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fdecec;
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 14px;
}
.confirm-box h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-dark);
}
.confirm-box p {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}
.confirm-box .actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.confirm-box .actions .btn {
  flex: 1;
  justify-content: center;
}

/* ============================================================
   PAGE SPLIT MARKER
   ============================================================ */
.page-split-marker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--primary-bg);
  border: 1px dashed var(--primary);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--primary-dark);
  font-weight: 600;
}
.page-split-marker i {
  color: var(--primary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .thumb-grid,
  .image-grid,
  .extracted-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .rotate-buttons {
    grid-template-columns: 1fr;
  }
  .size-compare {
    flex-direction: column;
    gap: 8px;
  }
  .size-compare i {
    transform: rotate(90deg);
  }
  .confirm-box .actions {
    flex-direction: column;
  }
}