* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f7f8ff;
  --card: #ffffff;
  --text: #161b33;
  --muted: #70788f;
  --muted-2: #8a91a5;
  --border: #e9ebf8;
  --primary: #6958ff;
  --primary-2: #836dff;
  --primary-soft: #f1eeff;
  --danger: #ff5d5d;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top, rgba(105, 88, 255, 0.08), transparent 36%),
    linear-gradient(180deg, #fafbff 0%, #f4f6ff 100%);
  color: var(--text);
  padding: 30px;
}

.container {
  max-width: 1440px;
  margin: auto;
}

.main-card {
  padding-bottom: 10px;
}

/* TOP */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  margin-bottom: 15px;
}

.title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.icon-box {
  width: 100px;
  height: 100px;
  border-radius: 18px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6958ff;
  font-size: 24px;
  margin-bottom: 7px;
}

.icon-box i {
  font-size: 60px;
}

h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 0px !important;
}

.desc {
  max-width: 560px;
  color: #727b91;
  line-height: 1.7;
  font-size: 15px;
  margin-top: 0px;
  margin-bottom: 20px !important;
}
.features {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  flex-wrap: wrap;
  margin-left: -15px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: #f7f8ff;
  font-size: 13px;
  font-weight: 500;
  color: #5d6478;
}

.feature i {
  font-size: 13px;
  border: 7px solid #fff;
  border-radius: 50%;
  background: #fff;
}

.feature:nth-child(1) i {
  color: #6958ff;
}
.feature:nth-child(2) i {
  color: #6958ff;
}
.feature:nth-child(3) i {
  color: #6958ff;
}
.feature:nth-child(4) i {
  color: #6958ff;
}

/* ========================= TOOLBOX & LAYOUT ========================= */
.tool-box {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(99, 91, 255, 0.06);
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.sub {
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 18px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: stretch;
  height: calc(100vh - 240px);
  min-height: 600px;
}

.panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  border: 1px solid #ececff;
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(99, 91, 255, 0.05);
  overflow: hidden;
}

/* ========================= LEFT PANEL (PREVIEW) ========================= */
.preview-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.panel-head p {
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 4px;
  margin-bottom: 0px !important;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f4f6ff;
  border: 1px solid #e6e9fb;
  color: #5f6881;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* ========================= UPLOAD STRIP ========================= */
.upload-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px dashed #d7d2ff;
  background: linear-gradient(180deg, #ffffff, #faf9ff);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.upload-mini {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(to bottom, var(--primary-2), var(--primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 14px 30px rgba(99, 91, 255, 0.2);
}

.upload-copy {
  min-width: 0;
  flex: 1;
}

.upload-copy strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.upload-copy span {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
}

.hidden-input {
  display: none;
}

/* ========================= FILE CARD (mirrors protect PDF style) ========================= */
.file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: white;
  border: 1px solid #ececff;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
  flex-shrink: 0;
  transition: 0.2s ease;
}

.file-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(99, 91, 255, 0.07);
}

.file-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.pdf-mini-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #fff1f1;
  color: #ff5d5d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.file-card-meta {
  min-width: 0;
}

.file-card-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.file-card-size {
  color: var(--muted-2);
  font-size: 12px;
}

.file-card-trash {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: #a0a8bc;
  cursor: pointer;
  transition: 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.file-card-trash:hover {
  background: #fff1f1;
  color: #ff5d5d;
}

/* ========================= CANVAS WRAP ========================= */
.canvas-wrap {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #ececff;
  background: linear-gradient(180deg, #f4f6ff 0%, #eef1ff 100%);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ========================= CANVAS HEADER with toolbar ========================= */
.canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid #ececff;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.canvas-header .left,
.canvas-header .right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Toolbar sits between nav buttons and page info inside canvas-header */
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
  justify-content: center;
}

/* ========================= VIEWER ========================= */
.viewer {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-stage {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
  position: relative;
  min-height: 0;
  background: linear-gradient(180deg, #f4f6ff 0%, #eef1ff 100%);
}

.page-stage::-webkit-scrollbar {
  width: 8px;
}
.page-stage::-webkit-scrollbar-track {
  background: transparent;
}
.page-stage::-webkit-scrollbar-thumb {
  background: var(--primary-2);
  border-radius: 10px;
}
.page-stage::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
.page-stage {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-2) transparent;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  color: var(--muted-2);
  background: transparent;
  border: none;
}

.empty-state i {
  font-size: 54px;
  color: var(--primary);
  margin-bottom: 14px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 22px;
  margin-bottom: 8px;
  font-weight: 800;
  color: var(--text);
}

.empty-state p {
  max-width: 420px;
  line-height: 1.7;
  font-size: 14px;
}

.page-shell {
  position: relative;
  display: inline-block;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(55, 71, 140, 0.12);
  flex-shrink: 0;
}

canvas {
  display: block;
  border-radius: 14px;
}

.preview-controls {
  flex-shrink: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 240px;
}

.range-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.zoom-pill {
  min-width: 64px;
  text-align: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: #f4f6ff;
  border: 1px solid #e6e9fb;
  font-size: 12px;
  font-weight: 700;
  color: #5f6881;
}

/* ========================= BUTTONS ========================= */
.browse-btn,
.convert-btn,
.ghost-btn,
.toolbar-btn,
.nav-btn,
.reset-link,
.icon-btn {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

.browse-btn,
.convert-btn {
  background: linear-gradient(to right, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(99, 91, 255, 0.2);
}

.browse-btn {
  height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 13px;
  white-space: nowrap;
}

.browse-btn i,
.convert-btn i,
.ghost-btn i,
.toolbar-btn i,
.nav-btn i {
  margin-right: 8px;
}

.ghost-btn,
.toolbar-btn,
.nav-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #e4e8f6;
  background: #fff;
  color: #4f566b;
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s ease;
  white-space: nowrap;
}

.ghost-btn:hover,
.toolbar-btn:hover,
.nav-btn:hover {
  transform: translateY(-1px);
  border-color: #d5d8ef;
}

.toolbar-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(105, 88, 255, 0.16);
}

/* ========================= RIGHT PANEL (SETTINGS) ========================= */
.side-panel {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.section-block {
  padding: 16px 0;
  border-top: 1px solid #eef0fb;
}
.section-block:first-of-type {
  border-top: none;
  padding-top: 0;
}

.section-title-sm {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 10px;
}

.radio-row {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #475069;
  font-weight: 600;
}

.radio-row input {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #4f566b;
}

.field select {
  width: 100%;
  height: 50px;
  border-radius: 15px;
  border: 1px solid #dde1ef;
  background: white;
  padding: 0 14px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: #2f3547;
  transition: 0.22s ease;
}

.field select:focus {
  border-color: #6958ff;
  box-shadow: 0 0 0 4px rgba(105, 88, 255, 0.12);
}

.switches {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid #ececff;
  background: #fff;
}

.switch strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.switch span {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.metric {
  background: #fff;
  border: 1px solid #ececff;
  border-radius: 16px;
  padding: 12px;
}

.metric span {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  margin-bottom: 6px;
}

.metric strong {
  font-size: 14px;
}

.progress-wrap {
  width: 100%;
  height: 10px;
  background: #ececff;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
  display: none;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(to right, #6958ff, #836dff);
  transition: width 0.25s ease;
}

.progress-text {
  margin-top: 10px;
  color: #7f8799;
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
}

.convert-btn {
  width: 100%;
  height: 58px;
  border-radius: 16px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 800;
  transition: 0.22s ease;
}

.convert-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.convert-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.footer-note {
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.6;
}

.reset-link {
  background: transparent;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.choose {
  border-top: 1px solid #eef0fb;
  padding-top: 10px;
  margin-top: 15px;
}

/* ========================= CROP FRAME ========================= */
.crop-frame {
  position: absolute;
  border: 2px solid #3d7bff;
  background: rgba(61, 123, 255, 0.08);
  cursor: move;
  user-select: none;
  touch-action: none;
  display: none;
}

.handle {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #3d7bff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.handle.nw {
  top: -7px;
  left: -7px;
  cursor: nwse-resize;
}
.handle.ne {
  top: -7px;
  right: -7px;
  cursor: nesw-resize;
}
.handle.sw {
  bottom: -7px;
  left: -7px;
  cursor: nesw-resize;
}
.handle.se {
  bottom: -7px;
  right: -7px;
  cursor: nwse-resize;
}
.handle.n {
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}
.handle.s {
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}
.handle.w {
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}
.handle.e {
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.crop-label {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #2e3a63;
  pointer-events: none;
}

/* ========================= DARK MODE ========================= */
body.dark {
  color-scheme: dark;
  --bg: #0b1020;
  --card: #11172a;
  --card-2: #0f1628;
  --text: #edf2ff;
  --muted: #a7b0ca;
  --muted-2: #8d97b4;
  --border: #24304a;
  --primary: #8b7bff;
  --primary-2: #a18fff;
  --overlay: rgba(0, 0, 0, 0.45);
  background:
    radial-gradient(circle at top, rgba(139, 123, 255, 0.12), transparent 35%),
    var(--bg);
  color: var(--text);
}

body.dark .tool-box,
body.dark .panel {
  background: rgba(17, 23, 42, 0.96);
  border-color: var(--border);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);
}

body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark .section-title,
body.dark .section-title-sm,
body.dark strong {
  color: var(--text);
}

body.dark .desc,
body.dark .sub,
body.dark p,
body.dark .footer-note,
body.dark .badge,
body.dark .upload-copy span,
body.dark .panel-head p,
body.dark .switch span,
body.dark .field label,
body.dark .metric span {
  color: var(--muted);
}

body.dark .feature {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--muted);
}

body.dark .browse-btn,
body.dark .convert-btn {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

body.dark .toolbar-btn,
body.dark .ghost-btn,
body.dark .nav-btn,
body.dark .reset-link {
  background: #10182d;
  color: var(--text);
  border-color: var(--border);
}

body.dark .toolbar-btn:hover,
body.dark .ghost-btn:hover,
body.dark .nav-btn:hover,
body.dark .reset-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

body.dark .toolbar-btn.active {
  background: rgba(139, 123, 255, 0.16);
  color: #ffffff;
  border-color: var(--primary);
}

body.dark .canvas-wrap {
  background: var(--card-2);
  border-color: var(--border);
}

body.dark .canvas-header {
  background: rgba(17, 23, 42, 0.9);
  border-color: var(--border);
}

body.dark .page-stage {
  background: var(--card-2);
}

body.dark .page-stage::-webkit-scrollbar-thumb {
  background: var(--primary);
}

body.dark .page-stage {
  scrollbar-color: var(--primary) var(--card-2);
}

body.dark .preview-controls {
  background: var(--card);
  border-color: var(--border);
}

body.dark .page-shell {
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark .empty-state {
  color: var(--muted);
}

body.dark .empty-state h3 {
  color: var(--text);
}

body.dark .empty-state i {
  color: var(--primary);
}

body.dark .crop-frame {
  border-color: #ffffff;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.45),
    0 0 0 2px rgba(255, 255, 255, 0.95);
}

body.dark .crop-label {
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
}

body.dark .handle {
  background: #ffffff;
  border-color: var(--primary);
}

body.dark select,
body.dark input[type="text"],
body.dark input[type="number"] {
  background: #10182d;
  color: var(--text);
  border-color: var(--border);
}

body.dark select:focus,
body.dark input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(139, 123, 255, 0.14);
}

body.dark .switch {
  background: #10182d;
  border-color: var(--border);
}

body.dark .switch strong {
  color: var(--text);
}

body.dark .metric {
  background: #10182d;
  border-color: var(--border);
}

body.dark .metric strong {
  color: var(--primary);
}

body.dark .badge {
  background: rgba(139, 123, 255, 0.12);
  border-color: rgba(139, 123, 255, 0.2);
}

body.dark .progress-wrap {
  background: #1b2540;
}

body.dark .progress-text {
  color: var(--muted);
}

body.dark input[type="range"] {
  background: #1b2540;
}

body.dark .zoom-pill {
  background: #10182d;
  color: var(--text);
  border-color: var(--border);
}

body.dark .upload-strip {
  background: #10182d;
  border-color: var(--border);
}

body.dark .upload-mini {
  background: rgba(139, 123, 255, 0.12);
  color: var(--primary);
}

/* Dark mode: file card */
body.dark .file-card {
  background: #10182d;
  border-color: var(--border);
}

body.dark .file-card-name {
  color: var(--text);
}

body.dark .file-card-size {
  color: var(--muted-2);
}

body.dark .pdf-mini-icon {
  background: rgba(255, 93, 93, 0.12);
  color: #ff7070;
}

body.dark .file-card-trash {
  background: transparent;
  color: var(--muted-2);
}

body.dark .file-card-trash:hover {
  background: rgba(255, 93, 93, 0.12);
  color: #ff7070;
}

/* =============================================================================
   LARGE SCREENS — 1200 px+
============================================================================= */

@media (min-width: 1200px) {
  body {
    padding: 30px 3vw;
  }

  .page-container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .container {
    max-width: 94vw !important;
    width: 94vw !important;
  }
}

/* ——— 1440 px ——— */
@media (min-width: 1440px) {
  body {
    padding: 36px 3vw;
  }

  .container {
    max-width: 94vw !important;
    width: 94vw !important;
  }

  h1 {
    font-size: 50px;
    letter-spacing: -1.8px;
  }
  .desc {
    max-width: 55vw;
    font-size: 16px;
  }

  .icon-box {
    width: 108px;
    height: 108px;
    border-radius: 24px;
  }
  .icon-box i {
    font-size: 60px;
  }

  .title {
    gap: 20px;
    margin-bottom: 18px;
  }
  .features {
    gap: 16px;
    margin-top: 16px;
  }
  .feature {
    font-size: 14px;
    padding: 12px 18px;
    gap: 10px;
  }
  .feature i {
    font-size: 14px;
  }

  .tool-box {
    padding: 28px;
    border-radius: 30px;
  }
  .section-title {
    font-size: 22px;
  }
  .sub {
    font-size: 15px;
  }

  .layout {
    gap: 22px;
    height: calc(100vh - 260px);
  }
  .panel {
    border-radius: 26px;
  }
  .preview-panel {
    padding: 22px;
  }
  .panel-head h2 {
    font-size: 17px;
  }
  .panel-head p {
    font-size: 13px;
  }

  .badge {
    padding: 8px 12px;
    font-size: 13px;
  }

  .upload-strip {
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
    margin-bottom: 16px;
  }
  .upload-mini {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 22px;
  }
  .upload-copy strong {
    font-size: 15px;
  }
  .upload-copy span {
    font-size: 13px;
  }

  /* File card 1440 */
  .file-card {
    padding: 16px 18px;
    border-radius: 20px;
    margin-bottom: 16px;
  }
  .pdf-mini-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 20px;
  }
  .file-card-name {
    font-size: 15px;
  }
  .file-card-size {
    font-size: 13px;
  }
  .file-card-trash {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 15px;
  }

  /* Toolbar in header 1440 */
  .canvas-header {
    padding: 14px 18px;
  }
  .toolbar {
    gap: 10px;
  }
  .ghost-btn,
  .toolbar-btn,
  .nav-btn {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 13px;
  }

  .canvas-wrap {
    border-radius: 24px;
  }
  .page-stage {
    padding: 28px;
  }

  .empty-state i {
    font-size: 60px;
  }
  .empty-state h3 {
    font-size: 24px;
  }
  .empty-state p {
    font-size: 15px;
  }

  .preview-controls {
    padding: 16px 28px;
  }
  .zoom-pill {
    padding: 10px 14px;
    font-size: 13px;
  }

  .browse-btn {
    height: 50px;
    padding: 0 20px;
    font-size: 14px;
    border-radius: 15px;
  }

  .ghost-btn,
  .toolbar-btn,
  .nav-btn {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 13px;
  }

  .side-panel {
    padding: 22px;
  }
  .section-block {
    padding: 18px 0;
  }
  .section-title-sm {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .radio-row {
    gap: 14px;
    margin-bottom: 22px;
  }
  .radio-row label {
    font-size: 15px;
    gap: 12px;
  }
  .radio-row input {
    width: 20px;
    height: 20px;
  }

  .settings-grid {
    gap: 16px;
  }
  .field label {
    font-size: 14px;
    margin-bottom: 10px;
  }
  .field select {
    height: 54px;
    font-size: 15px;
    border-radius: 16px;
  }

  .switches {
    gap: 14px;
    margin-top: 14px;
  }
  .switch {
    padding: 16px 18px;
    border-radius: 18px;
  }
  .switch strong {
    font-size: 15px;
  }
  .switch span {
    font-size: 13px;
  }
  .switch input {
    width: 20px;
    height: 20px;
  }

  .metrics {
    gap: 12px;
    margin-top: 16px;
  }
  .metric {
    padding: 14px;
    border-radius: 18px;
  }
  .metric span {
    font-size: 13px;
  }
  .metric strong {
    font-size: 15px;
  }

  .progress-text {
    margin-top: 12px;
    font-size: 14px;
  }
  .convert-btn {
    height: 62px;
    border-radius: 18px;
    margin-top: 16px;
    font-size: 16px;
  }
  .footer-note {
    margin-top: 14px;
    font-size: 13px;
  }
  .crop-label {
    padding: 8px 12px;
    font-size: 13px;
  }
  .handle {
    width: 15px;
    height: 15px;
  }
}

/* ——— 1600 px ——— */
@media (min-width: 1600px) {
  body {
    padding: 38px 3vw;
  }

  h1 {
    font-size: 56px;
    letter-spacing: -2px;
  }
  .desc {
    font-size: 16.5px;
    line-height: 1.75;
  }

  .icon-box {
    width: 118px;
    height: 118px;
    border-radius: 26px;
  }
  .icon-box i {
    font-size: 66px;
  }
  .title {
    gap: 22px;
    margin-bottom: 20px;
  }
  .top {
    gap: 50px;
    margin-bottom: 36px;
  }
  .features {
    gap: 18px;
    margin-top: 18px;
  }
  .feature {
    font-size: 15px;
    padding: 13px 20px;
  }

  .tool-box {
    padding: 32px;
    border-radius: 32px;
  }
  .section-title {
    font-size: 24px;
    margin-bottom: 8px;
  }
  .sub {
    font-size: 15.5px;
    margin-bottom: 22px;
  }

  .layout {
    gap: 24px;
    height: calc(100vh - 280px);
  }
  .preview-panel {
    padding: 24px;
  }
  .panel-head h2 {
    font-size: 18px;
  }
  .panel-head p {
    font-size: 13.5px;
  }

  .badge {
    padding: 9px 14px;
    font-size: 13.5px;
  }

  .upload-strip {
    padding: 18px;
    border-radius: 22px;
    margin-bottom: 18px;
  }
  .upload-mini {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    font-size: 24px;
  }
  .upload-copy strong {
    font-size: 16px;
  }
  .upload-copy span {
    font-size: 13.5px;
  }

  /* File card 1600 */
  .file-card {
    padding: 18px 20px;
    border-radius: 22px;
    margin-bottom: 18px;
  }
  .pdf-mini-icon {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    font-size: 22px;
  }
  .file-card-name {
    font-size: 16px;
  }
  .file-card-size {
    font-size: 13.5px;
  }
  .file-card-trash {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  /* Toolbar in header 1600 */
  .canvas-header {
    padding: 16px 20px;
  }
  .toolbar {
    gap: 12px;
  }

  .canvas-wrap {
    border-radius: 26px;
  }
  .page-stage {
    padding: 32px;
  }

  .empty-state {
    padding: 36px;
  }
  .empty-state i {
    font-size: 66px;
    margin-bottom: 18px;
  }
  .empty-state h3 {
    font-size: 26px;
    margin-bottom: 10px;
  }
  .empty-state p {
    font-size: 16px;
  }

  .preview-controls {
    padding: 18px 32px;
  }
  .range-row {
    min-width: 280px;
  }
  .zoom-pill {
    padding: 10px 16px;
    font-size: 13.5px;
  }

  .browse-btn {
    height: 54px;
    padding: 0 24px;
    font-size: 15px;
  }

  .ghost-btn,
  .toolbar-btn,
  .nav-btn {
    height: 40px;
    padding: 0 16px;
    font-size: 13.5px;
    border-radius: 14px;
  }

  .side-panel {
    padding: 24px;
  }
  .section-block {
    padding: 20px 0;
  }
  .section-title-sm {
    font-size: 17px;
    margin-bottom: 14px;
  }
  .radio-row label {
    font-size: 15.5px;
  }
  .settings-grid {
    gap: 18px;
  }
  .field label {
    font-size: 14.5px;
  }
  .field select {
    height: 56px;
    font-size: 15px;
  }
  .switch {
    padding: 18px 20px;
  }
  .switch strong {
    font-size: 15.5px;
  }
  .switch span {
    font-size: 13.5px;
  }
  .metrics {
    gap: 14px;
    margin-top: 18px;
  }
  .metric {
    padding: 16px;
  }
  .metric span {
    font-size: 13.5px;
  }
  .metric strong {
    font-size: 16px;
  }
  .progress-text {
    margin-top: 12px;
    font-size: 14.5px;
  }
  .footer-note {
    margin-top: 14px;
    font-size: 13.5px;
  }
  .reset-link {
    font-size: 14px;
  }
}

/* ——— 1920 px ——— */
@media (min-width: 1920px) {
  body {
    padding: 42px 3vw;
  }

  h1 {
    font-size: 66px;
    letter-spacing: -2.2px;
  }
  .desc {
    max-width: 52vw;
    font-size: 18px;
    line-height: 1.75;
  }
  .title {
    gap: 24px;
    margin-bottom: 22px;
  }
  .top {
    gap: 60px;
    margin-bottom: 40px;
  }
  .icon-box {
    width: 132px;
    height: 132px;
    border-radius: 28px;
  }
  .icon-box i {
    font-size: 76px;
  }
  .features {
    gap: 20px;
    margin-top: 22px;
  }
  .feature {
    font-size: 16px;
    padding: 14px 22px;
    gap: 10px;
  }
  .feature i {
    font-size: 16px;
  }

  .tool-box {
    padding: 40px;
    border-radius: 36px;
  }
  .section-title {
    font-size: 26px;
    margin-bottom: 10px;
  }
  .sub {
    font-size: 17px;
    margin-bottom: 26px;
  }

  .layout {
    gap: 28px;
    height: calc(100vh - 300px);
    min-height: 700px;
  }
  .panel {
    border-radius: 30px;
  }
  .preview-panel {
    padding: 28px;
  }
  .panel-head {
    margin-bottom: 18px;
  }
  .panel-head h2 {
    font-size: 20px;
  }
  .panel-head p {
    font-size: 14px;
    margin-top: 6px;
  }

  .badge {
    padding: 10px 16px;
    font-size: 14px;
  }

  .upload-strip {
    gap: 18px;
    padding: 22px;
    border-radius: 24px;
    margin-bottom: 20px;
  }
  .upload-mini {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    font-size: 28px;
  }
  .upload-copy strong {
    font-size: 17px;
    margin-bottom: 6px;
  }
  .upload-copy span {
    font-size: 14px;
  }

  /* File card 1920 */
  .file-card {
    padding: 20px 24px;
    border-radius: 24px;
    margin-bottom: 20px;
    gap: 18px;
  }
  .file-card-left {
    gap: 16px;
  }
  .pdf-mini-icon {
    width: 58px;
    height: 58px;
    border-radius: 17px;
    font-size: 24px;
  }
  .file-card-name {
    font-size: 17px;
    margin-bottom: 6px;
  }
  .file-card-size {
    font-size: 14px;
  }
  .file-card-trash {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 18px;
  }

  /* Toolbar in header 1920 */
  .canvas-header {
    padding: 18px 22px;
    gap: 14px;
  }
  .toolbar {
    gap: 14px;
  }

  .ghost-btn,
  .toolbar-btn,
  .nav-btn {
    height: 44px;
    padding: 0 18px;
    font-size: 14px;
    border-radius: 15px;
  }

  .canvas-wrap {
    border-radius: 28px;
  }
  .page-stage {
    padding: 36px;
  }

  .empty-state {
    padding: 44px;
  }
  .empty-state i {
    font-size: 76px;
    margin-bottom: 22px;
  }
  .empty-state h3 {
    font-size: 30px;
    margin-bottom: 12px;
  }
  .empty-state p {
    max-width: 480px;
    font-size: 17px;
  }

  .page-shell {
    border-radius: 18px;
  }
  canvas {
    border-radius: 18px;
  }

  .preview-controls {
    padding: 20px 36px;
  }
  .range-row {
    min-width: 300px;
    gap: 14px;
  }
  .zoom-pill {
    min-width: 74px;
    padding: 11px 16px;
    font-size: 14px;
  }

  .browse-btn {
    height: 58px;
    padding: 0 30px;
    font-size: 16px;
    border-radius: 16px;
  }
  .convert-btn {
    height: 72px;
    border-radius: 20px;
    margin-top: 20px;
    font-size: 18px;
  }

  .side-panel {
    padding: 28px;
  }
  .section-block {
    padding: 22px 0;
  }
  .section-title-sm {
    font-size: 19px;
    margin-bottom: 16px;
  }
  .radio-row {
    gap: 16px;
    margin-bottom: 26px;
  }
  .radio-row label {
    font-size: 16px;
    gap: 14px;
  }
  .radio-row input {
    width: 22px;
    height: 22px;
  }
  .settings-grid {
    gap: 20px;
  }
  .field label {
    font-size: 15px;
    margin-bottom: 12px;
  }
  .field select {
    height: 60px;
    font-size: 16px;
    border-radius: 18px;
    padding: 0 18px;
  }
  .switches {
    gap: 16px;
    margin-top: 16px;
  }
  .switch {
    padding: 20px 22px;
    border-radius: 20px;
  }
  .switch strong {
    font-size: 16px;
    margin-bottom: 4px;
  }
  .switch span {
    font-size: 14px;
  }
  .switch input {
    width: 22px;
    height: 22px;
  }
  .metrics {
    gap: 16px;
    margin-top: 20px;
  }
  .metric {
    padding: 18px;
    border-radius: 20px;
  }
  .metric span {
    font-size: 14px;
    margin-bottom: 8px;
  }
  .metric strong {
    font-size: 17px;
  }
  .progress-wrap {
    height: 14px;
    margin-top: 14px;
  }
  .progress-text {
    margin-top: 14px;
    font-size: 15px;
  }
  .footer-note {
    margin-top: 16px;
    font-size: 14px;
  }
  .reset-link {
    font-size: 15px;
  }
  .crop-frame {
    border-width: 3px;
  }
  .handle {
    width: 17px;
    height: 17px;
    border-width: 3px;
  }
  .handle.nw {
    top: -9px;
    left: -9px;
  }
  .handle.ne {
    top: -9px;
    right: -9px;
  }
  .handle.sw {
    bottom: -9px;
    left: -9px;
  }
  .handle.se {
    bottom: -9px;
    right: -9px;
  }
  .handle.n {
    top: -9px;
  }
  .handle.s {
    bottom: -9px;
  }
  .handle.w {
    left: -9px;
  }
  .handle.e {
    right: -9px;
  }
  .crop-label {
    left: 14px;
    top: 14px;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* ——— 2560 px ——— */
@media (min-width: 2560px) {
  body {
    padding: 52px 3vw;
  }

  h1 {
    font-size: 84px;
    letter-spacing: -3px;
  }
  .desc {
    max-width: 50vw;
    font-size: 22px;
    line-height: 1.8;
  }
  .title {
    gap: 30px;
    margin-bottom: 28px;
  }
  .top {
    gap: 80px;
    margin-bottom: 56px;
  }
  .icon-box {
    width: 170px;
    height: 170px;
    border-radius: 34px;
  }
  .icon-box i {
    font-size: 100px;
  }
  .features {
    gap: 26px;
    margin-top: 28px;
  }
  .feature {
    font-size: 20px;
    padding: 18px 28px;
    gap: 14px;
  }
  .feature i {
    font-size: 20px;
    border-width: 10px;
  }

  .tool-box {
    padding: 56px;
    border-radius: 44px;
  }
  .section-title {
    font-size: 34px;
    margin-bottom: 14px;
  }
  .sub {
    font-size: 21px;
    margin-bottom: 34px;
  }

  .layout {
    gap: 36px;
    height: calc(100vh - 360px);
    min-height: 850px;
  }
  .panel {
    border-radius: 38px;
  }
  .preview-panel {
    padding: 36px;
  }
  .panel-head {
    margin-bottom: 22px;
  }
  .panel-head h2 {
    font-size: 26px;
  }
  .panel-head p {
    font-size: 17px;
    margin-top: 8px;
  }
  .badge {
    padding: 14px 20px;
    font-size: 17px;
    border-radius: 999px;
  }

  .upload-strip {
    gap: 22px;
    padding: 28px;
    border-radius: 30px;
    margin-bottom: 24px;
    border-width: 3px;
  }
  .upload-mini {
    width: 88px;
    height: 88px;
    border-radius: 28px;
    font-size: 36px;
  }
  .upload-copy strong {
    font-size: 21px;
    margin-bottom: 8px;
  }
  .upload-copy span {
    font-size: 17px;
  }

  /* File card 2560 */
  .file-card {
    padding: 26px 32px;
    border-radius: 30px;
    margin-bottom: 26px;
    gap: 24px;
  }
  .file-card-left {
    gap: 22px;
  }
  .pdf-mini-icon {
    width: 74px;
    height: 74px;
    border-radius: 22px;
    font-size: 32px;
  }
  .file-card-name {
    font-size: 22px;
    margin-bottom: 8px;
  }
  .file-card-size {
    font-size: 17px;
  }
  .file-card-trash {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 24px;
  }

  /* Toolbar in header 2560 */
  .canvas-header {
    padding: 22px 28px;
    gap: 18px;
  }
  .toolbar {
    gap: 18px;
  }
  .ghost-btn,
  .toolbar-btn,
  .nav-btn {
    height: 56px;
    padding: 0 24px;
    font-size: 17px;
    border-radius: 18px;
  }

  .canvas-wrap {
    border-radius: 34px;
  }
  .page-stage {
    padding: 48px;
  }
  .empty-state {
    padding: 56px;
  }
  .empty-state i {
    font-size: 96px;
    margin-bottom: 28px;
  }
  .empty-state h3 {
    font-size: 38px;
    margin-bottom: 16px;
  }
  .empty-state p {
    max-width: 560px;
    font-size: 21px;
  }
  .page-shell {
    border-radius: 22px;
    box-shadow: 0 14px 40px rgba(55, 71, 140, 0.16);
  }
  canvas {
    border-radius: 22px;
  }

  .preview-controls {
    padding: 24px 44px;
    gap: 18px;
  }
  .range-row {
    min-width: 380px;
    gap: 18px;
  }
  .zoom-pill {
    min-width: 90px;
    padding: 14px 20px;
    font-size: 17px;
  }
  .browse-btn {
    height: 76px;
    padding: 0 42px;
    font-size: 20px;
    border-radius: 20px;
  }
  .convert-btn {
    height: 88px;
    border-radius: 26px;
    margin-top: 28px;
    font-size: 23px;
    box-shadow: 0 24px 48px rgba(99, 91, 255, 0.28);
  }

  .side-panel {
    padding: 36px;
  }
  .section-block {
    padding: 28px 0;
  }
  .section-title-sm {
    font-size: 24px;
    margin-bottom: 20px;
  }
  .radio-row {
    gap: 20px;
    margin-bottom: 32px;
  }
  .radio-row label {
    font-size: 20px;
    gap: 16px;
  }
  .radio-row input {
    width: 26px;
    height: 26px;
  }
  .settings-grid {
    gap: 24px;
  }
  .field label {
    font-size: 18px;
    margin-bottom: 16px;
  }
  .field select {
    height: 76px;
    font-size: 19px;
    border-radius: 22px;
    padding: 0 24px;
  }
  .switches {
    gap: 20px;
    margin-top: 20px;
  }
  .switch {
    padding: 26px 28px;
    border-radius: 24px;
    gap: 18px;
  }
  .switch strong {
    font-size: 20px;
    margin-bottom: 6px;
  }
  .switch span {
    font-size: 17px;
  }
  .switch input {
    width: 26px;
    height: 26px;
  }
  .metrics {
    gap: 20px;
    margin-top: 24px;
  }
  .metric {
    padding: 22px;
    border-radius: 24px;
  }
  .metric span {
    font-size: 17px;
    margin-bottom: 10px;
  }
  .metric strong {
    font-size: 21px;
  }
  .progress-wrap {
    height: 18px;
    margin-top: 18px;
  }
  .progress-text {
    margin-top: 18px;
    font-size: 18px;
  }
  .footer-note {
    margin-top: 20px;
    font-size: 17px;
    line-height: 1.7;
  }
  .reset-link {
    font-size: 18px;
  }
  .crop-frame {
    border-width: 4px;
  }
  .handle {
    width: 22px;
    height: 22px;
    border-width: 4px;
  }
  .handle.nw {
    top: -12px;
    left: -12px;
  }
  .handle.ne {
    top: -12px;
    right: -12px;
  }
  .handle.sw {
    bottom: -12px;
    left: -12px;
  }
  .handle.se {
    bottom: -12px;
    right: -12px;
  }
  .handle.n {
    top: -12px;
  }
  .handle.s {
    bottom: -12px;
  }
  .handle.w {
    left: -12px;
  }
  .handle.e {
    right: -12px;
  }
  .crop-label {
    left: 18px;
    top: 18px;
    gap: 12px;
    padding: 14px 20px;
    font-size: 17px;
  }
}

/* =============================================================================
   STRUCTURAL BREAKPOINTS
============================================================================= */

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: unset;
  }

  .side-panel {
    position: static;
    max-height: none;
  }

  .canvas-wrap {
    min-height: 600px;
  }
}

@media (min-width: 1121px) {
  .tool-box {
    min-height: auto;
  }

  .layout {
    height: auto;
    min-height: calc(100vh - 220px);
    align-items: start;
  }

  .panel {
    height: 100%;
  }

  .preview-panel {
    min-height: max-content;
    display: flex;
    flex-direction: column;
  }

  .canvas-wrap {
    flex: 1;
    min-height: auto;
  }

  .side-panel {
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: max-content;
  }
}

/* =============================================================================
   CANVAS HEADER TOOLBAR — RESPONSIVE BREAKPOINTS
   Toolbar collapses gracefully as viewport narrows
============================================================================= */

/* Medium-large: toolbar stays inline but shrinks */
@media (max-width: 1400px) {
  .canvas-header {
    gap: 8px;
  }

  .ghost-btn,
  .toolbar-btn,
  .nav-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 11px;
  }

  /* Shorten text labels on toolbar at medium widths */
  .ghost-btn i,
  .toolbar-btn i,
  .nav-btn i {
    margin-right: 5px;
  }
}

/* Wrap toolbar to its own row when panel gets narrow */
@media (max-width: 1180px) {
  .canvas-header {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .toolbar {
    order: 3; /* Push toolbar below nav + badges */
    width: 100%;
    justify-content: flex-start;
    flex: none;
    border-top: 1px solid #ececff;
    padding-top: 10px;
    margin-top: 2px;
  }

  body.dark .toolbar {
    border-color: var(--border);
  }
}

/* =============================================================================
   SMALL SCREENS — tablet & mobile
============================================================================= */

@media (max-width: 768px) {
  body {
    padding: 14px;
  }

  .feature {
    padding: 11px 16px 11px 0px;
  }

  .tool-box {
    padding: 16px;
    border-radius: 22px;
  }

  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .icon-box {
    width: 78px;
    height: 78px;
  }
  .icon-box i {
    font-size: 38px;
  }
  h1 {
    font-size: 34px;
  }

  .preview-panel,
  .side-panel {
    padding: 14px;
  }

  .canvas-wrap {
    min-height: 500px;
  }

  .settings-grid,
  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .upload-strip {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .browse-btn {
    width: 100%;
  }
  .upload-mini {
    align-self: center;
  }

  /* File card on mobile */
  .file-card {
    padding: 12px 14px;
  }
  .pdf-mini-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  .file-card-name {
    font-size: 13px;
  }
  .file-card-size {
    font-size: 11px;
  }
  .file-card-trash {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  /* Toolbar on mobile: always wrap to new row */
  .canvas-header {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 12px 14px;
  }

  .toolbar {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    flex: none;
    border-top: 1px solid #ececff;
    padding-top: 10px;
  }

  body.dark .toolbar {
    border-color: var(--border);
  }

  .ghost-btn,
  .toolbar-btn,
  .nav-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 10px;
  }
}

@media (max-width: 650px) {
  .icon-box {
    display: none;
  }
}

@media (max-width: 520px) {
  .settings-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .preview-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .range-row {
    min-width: unset;
  }
}

@media (max-width: 480px) {
  /* On very small screens hide text in toolbar, show icons only */
  .toolbar-btn .fa-mouse-pointer + *,
  .toolbar-btn .fa-up-right-and-down-left-from-center + *,
  .ghost-btn .fa-expand + * {
    display: none;
  }

  .ghost-btn i,
  .toolbar-btn i,
  .nav-btn i {
    margin-right: 0;
  }

  .ghost-btn,
  .toolbar-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 440px) {
  .canvas-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .canvas-header .left,
  .canvas-header .right {
    justify-content: space-between;
  }

  .toolbar {
    border-top: 1px solid #ececff;
    padding-top: 10px;
  }
}

/* ——— 425 px ——— */
@media (max-width: 425px) {
  body {
    padding: 10px;
    font-size: 13px;
  }
  .main-card {
    padding-bottom: 0;
  }
  h1 {
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -1px;
  }
  .desc {
    font-size: 13px;
    line-height: 1.6;
  }
  .section-title {
    font-size: 17px;
  }
  .sub {
    font-size: 12px;
  }
  .feature {
    font-size: 12px;
    padding: 9px 12px;
    gap: 6px;
  }
  .feature i {
    font-size: 12px;
  }

  .tool-box {
    padding: 14px;
    border-radius: 18px;
  }
  .layout {
    gap: 14px;
  }
  .panel {
    border-radius: 20px;
  }
  .preview-panel,
  .side-panel {
    padding: 12px;
  }
  .panel-head h2 {
    font-size: 14px;
  }
  .panel-head p {
    font-size: 11px;
  }
  .badge {
    padding: 6px 9px;
    font-size: 11px;
  }

  .upload-strip {
    padding: 12px;
    border-radius: 14px;
    margin-bottom: 12px;
    gap: 10px;
  }
  .upload-mini {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 17px;
  }
  .upload-copy strong {
    font-size: 13px;
  }
  .upload-copy span {
    font-size: 11px;
  }

  /* File card 425 */
  .file-card {
    padding: 10px 12px;
    border-radius: 13px;
    margin-bottom: 12px;
  }
  .pdf-mini-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 14px;
  }
  .file-card-name {
    font-size: 12px;
  }
  .file-card-size {
    font-size: 10px;
  }
  .file-card-trash {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 12px;
  }

  /* Toolbar 425 */
  .canvas-header {
    padding: 10px 12px;
    gap: 8px;
  }
  .toolbar {
    gap: 6px;
    padding-top: 8px;
  }

  .canvas-wrap {
    border-radius: 18px;
    min-height: 420px;
  }
  .page-stage {
    padding: 16px;
  }
  .empty-state {
    padding: 20px;
  }
  .empty-state i {
    font-size: 42px;
    margin-bottom: 10px;
  }
  .empty-state h3 {
    font-size: 18px;
    margin-bottom: 6px;
  }
  .empty-state p {
    font-size: 12px;
  }
  .preview-controls {
    padding: 12px 16px;
  }
  .zoom-pill {
    padding: 7px 10px;
    font-size: 11px;
    min-width: 56px;
  }
  .browse-btn {
    height: 42px;
    font-size: 12px;
    border-radius: 12px;
  }
  .convert-btn {
    height: 50px;
    font-size: 13px;
    border-radius: 14px;
    margin-top: 12px;
  }
  .ghost-btn,
  .toolbar-btn,
  .nav-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 11px;
    border-radius: 10px;
  }
  .section-title-sm {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .radio-row label {
    font-size: 13px;
    gap: 8px;
  }
  .radio-row input {
    width: 16px;
    height: 16px;
  }
  .settings-grid {
    gap: 10px;
  }
  .field label {
    font-size: 12px;
    margin-bottom: 6px;
  }
  .field select {
    height: 44px;
    font-size: 13px;
    border-radius: 12px;
  }
  .switch {
    padding: 12px 13px;
    border-radius: 14px;
  }
  .switch strong {
    font-size: 13px;
  }
  .switch span {
    font-size: 11px;
  }
  .switch input {
    width: 16px;
    height: 16px;
  }
  .metrics {
    gap: 8px;
    margin-top: 10px;
  }
  .metric {
    padding: 10px;
    border-radius: 14px;
  }
  .metric span {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .metric strong {
    font-size: 13px;
  }
  .progress-wrap {
    height: 8px;
    margin-top: 8px;
  }
  .progress-text {
    margin-top: 8px;
    font-size: 12px;
  }
  .footer-note {
    margin-top: 10px;
    font-size: 11px;
  }
  .reset-link {
    font-size: 12px;
  }
  .crop-label {
    padding: 5px 8px;
    font-size: 11px;
    gap: 5px;
  }
  .handle {
    width: 11px;
    height: 11px;
  }
}

/* ——— 375 px ——— */
@media (max-width: 375px) {
  body {
    padding: 8px;
    font-size: 12.5px;
  }
  h1 {
    font-size: 23px;
    line-height: 1.2;
    letter-spacing: -0.8px;
  }
  .desc {
    font-size: 12px;
    line-height: 1.5;
  }
  .section-title {
    font-size: 15px;
  }
  .sub {
    font-size: 11.5px;
  }
  .title {
    gap: 10px;
  }
  .feature {
    font-size: 11.5px;
    padding: 8px 10px;
  }
  .feature i {
    font-size: 11px;
    border-width: 6px;
  }

  .tool-box {
    padding: 12px;
    border-radius: 16px;
  }
  .preview-panel,
  .side-panel {
    padding: 10px;
  }
  .panel {
    border-radius: 18px;
  }
  .panel-head h2 {
    font-size: 13px;
  }
  .panel-head p {
    font-size: 10.5px;
  }
  .badge {
    padding: 5px 8px;
    font-size: 10.5px;
  }

  .upload-strip {
    padding: 10px;
    border-radius: 12px;
    gap: 8px;
  }
  .upload-mini {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 15px;
  }
  .upload-copy strong {
    font-size: 12px;
  }
  .upload-copy span {
    font-size: 10.5px;
  }

  /* File card 375 */
  .file-card {
    padding: 9px 11px;
    border-radius: 12px;
    margin-bottom: 10px;
  }
  .pdf-mini-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 13px;
  }
  .file-card-name {
    font-size: 11.5px;
  }
  .file-card-size {
    font-size: 9.5px;
  }
  .file-card-trash {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 11px;
  }

  /* Toolbar 375 */
  .canvas-header {
    padding: 9px 11px;
    gap: 7px;
  }
  .toolbar {
    gap: 5px;
    padding-top: 7px;
  }
  .ghost-btn,
  .toolbar-btn,
  .nav-btn {
    height: 30px;
    padding: 0 7px;
    font-size: 10.5px;
    border-radius: 9px;
  }

  .canvas-wrap {
    border-radius: 16px;
    min-height: 380px;
  }
  .page-stage {
    padding: 14px;
  }
  .empty-state {
    padding: 16px;
  }
  .empty-state i {
    font-size: 36px;
    margin-bottom: 8px;
  }
  .empty-state h3 {
    font-size: 16px;
    margin-bottom: 5px;
  }
  .empty-state p {
    font-size: 11px;
  }
  .preview-controls {
    padding: 10px 14px;
  }
  .zoom-pill {
    padding: 6px 9px;
    font-size: 10.5px;
    min-width: 50px;
  }
  .browse-btn {
    height: 40px;
    font-size: 12px;
    border-radius: 10px;
    padding: 0 14px;
  }
  .convert-btn {
    height: 46px;
    font-size: 12.5px;
    border-radius: 12px;
  }
  .section-title-sm {
    font-size: 12.5px;
    margin-bottom: 7px;
  }
  .radio-row label {
    font-size: 12px;
  }
  .radio-row input {
    width: 15px;
    height: 15px;
  }
  .field label {
    font-size: 11.5px;
  }
  .field select {
    height: 42px;
    font-size: 12px;
    border-radius: 10px;
  }
  .switch {
    padding: 10px 11px;
    border-radius: 12px;
  }
  .switch strong {
    font-size: 12px;
  }
  .switch span {
    font-size: 10.5px;
  }
  .metric {
    padding: 8px;
    border-radius: 12px;
  }
  .metric span {
    font-size: 10.5px;
  }
  .metric strong {
    font-size: 12px;
  }
  .progress-text {
    font-size: 11px;
  }
  .footer-note {
    font-size: 10.5px;
  }
  .reset-link {
    font-size: 11.5px;
  }
  .crop-label {
    padding: 4px 7px;
    font-size: 10.5px;
  }
}

/* ——— 325 px ——— */
@media (max-width: 325px) {
  body {
    padding: 6px;
    font-size: 12px;
  }
  .tool-box {
    padding: 10px;
    border-radius: 14px;
  }
  .panel {
    border-radius: 14px;
  }
  h1 {
    font-size: 21px;
    line-height: 1.18;
    letter-spacing: -0.6px;
  }
  .desc {
    font-size: 11.5px;
    line-height: 1.45;
  }
  .section-title {
    font-size: 14px;
  }
  .sub {
    font-size: 10.5px;
  }
  .title {
    gap: 8px;
  }
  .feature {
    font-size: 10.5px;
    padding: 7px 9px;
    gap: 5px;
  }
  .feature i {
    font-size: 10px;
    border-width: 5px;
  }

  .preview-panel,
  .side-panel {
    padding: 8px;
  }

  .panel-head h2 {
    font-size: 12px;
  }
  .panel-head p {
    font-size: 10px;
  }
  .badge {
    padding: 4px 7px;
    font-size: 10px;
  }

  .upload-strip {
    padding: 8px;
    border-radius: 10px;
    gap: 6px;
  }
  .upload-mini {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 14px;
  }
  .upload-copy strong {
    font-size: 11px;
    margin-bottom: 2px;
  }
  .upload-copy span {
    font-size: 10px;
  }

  /* File card 325 */
  .file-card {
    padding: 8px 10px;
    border-radius: 11px;
    margin-bottom: 9px;
    gap: 8px;
  }
  .file-card-left {
    gap: 8px;
  }
  .pdf-mini-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 12px;
  }
  .file-card-name {
    font-size: 11px;
  }
  .file-card-size {
    font-size: 9px;
  }
  .file-card-trash {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 10px;
  }

  /* Toolbar 325 */
  .canvas-header {
    padding: 7px 9px;
    gap: 5px;
  }
  .toolbar {
    gap: 4px;
    padding-top: 6px;
  }

  .canvas-header .left,
  .canvas-header .right {
    gap: 5px;
  }

  .ghost-btn,
  .toolbar-btn,
  .nav-btn {
    height: 28px;
    padding: 0 6px;
    font-size: 10px;
    border-radius: 8px;
  }

  .ghost-btn i,
  .toolbar-btn i,
  .nav-btn i {
    margin-right: 4px;
  }

  .canvas-wrap {
    border-radius: 14px;
    min-height: 340px;
  }
  .page-stage {
    padding: 10px;
  }
  .empty-state {
    padding: 12px;
  }
  .empty-state i {
    font-size: 30px;
    margin-bottom: 6px;
  }
  .empty-state h3 {
    font-size: 15px;
    margin-bottom: 4px;
  }
  .empty-state p {
    font-size: 10.5px;
  }
  .page-shell {
    border-radius: 10px;
  }
  canvas {
    border-radius: 10px;
  }
  .preview-controls {
    padding: 8px 10px;
    gap: 8px;
  }
  .range-row {
    gap: 6px;
  }
  .zoom-pill {
    padding: 5px 7px;
    font-size: 10px;
    min-width: 44px;
  }
  .browse-btn {
    height: 38px;
    font-size: 11.5px;
    border-radius: 10px;
    padding: 0 12px;
  }
  .convert-btn {
    height: 42px;
    font-size: 12px;
    border-radius: 10px;
    margin-top: 10px;
  }
  .section-title-sm {
    font-size: 12px;
    margin-bottom: 6px;
  }
  .radio-row {
    gap: 8px;
    margin-bottom: 14px;
  }
  .radio-row label {
    font-size: 11.5px;
    gap: 6px;
  }
  .radio-row input {
    width: 14px;
    height: 14px;
  }
  .settings-grid {
    gap: 8px;
  }
  .field label {
    font-size: 11px;
    margin-bottom: 5px;
  }
  .field select {
    height: 40px;
    font-size: 11.5px;
    border-radius: 10px;
    padding: 0 10px;
  }
  .switches {
    gap: 8px;
    margin-top: 8px;
  }
  .switch {
    padding: 8px 9px;
    border-radius: 10px;
    gap: 8px;
  }
  .switch strong {
    font-size: 11.5px;
    margin-bottom: 1px;
  }
  .switch span {
    font-size: 10px;
  }
  .switch input {
    width: 14px;
    height: 14px;
  }
  .metrics {
    gap: 6px;
    margin-top: 8px;
  }
  .metric {
    padding: 7px;
    border-radius: 10px;
  }
  .metric span {
    font-size: 10px;
    margin-bottom: 3px;
  }
  .metric strong {
    font-size: 11.5px;
  }
  .progress-wrap {
    height: 6px;
    margin-top: 6px;
  }
  .progress-text {
    margin-top: 6px;
    font-size: 10.5px;
    min-height: 14px;
  }
  .footer-note {
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.45;
  }
  .reset-link {
    font-size: 11px;
  }
  .crop-frame {
    border-width: 1.5px;
  }
  .handle {
    width: 10px;
    height: 10px;
    border-width: 1.5px;
  }
  .handle.nw {
    top: -5px;
    left: -5px;
  }
  .handle.ne {
    top: -5px;
    right: -5px;
  }
  .handle.sw {
    bottom: -5px;
    left: -5px;
  }
  .handle.se {
    bottom: -5px;
    right: -5px;
  }
  .handle.n {
    top: -5px;
  }
  .handle.s {
    bottom: -5px;
  }
  .handle.w {
    left: -5px;
  }
  .handle.e {
    right: -5px;
  }
  .crop-label {
    left: 6px;
    top: 6px;
    gap: 4px;
    padding: 4px 6px;
    font-size: 10px;
  }
}
