* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --bg: #f7f8ff;
  --card: #ffffff;
  --text: #161b33;
  --muted: #727b91;
  --muted-2: #8a91a5;
  --border: #ececff;
  --primary: #6958ff;
  --primary-2: #836dff;
  --primary-soft: #f0edff;
  --danger: #ff5d5d;
  --success: #11b56d;
  --overlay-bg: #ebedf5;
}
body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top, rgba(105, 88, 255, 0.08), transparent 35%),
    var(--bg);
  color: var(--text);
  padding: 28px;
}
.container {
  max-width: 1200px;
  margin: auto;
}

/* ============ UPLOAD VIEW ============ */
.main-card {
  padding: 10px;
  padding-bottom: 0px !important;
}
.top {
  margin-bottom: 30px;
}
.title {
  display: flex;
  align-items: center;
  gap: 18px;
}
.icon-box {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--primary);
  flex-shrink: 0;
  margin-bottom: 17px;
}
.icon-box i {
  font-size: 56px;
}

h1 {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -2px;
  margin: 0px 0px !important;
}
.desc {
  margin-top: 0px;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
  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;
}

.tool-box {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 14px 35px rgba(99, 91, 255, 0.06);
}
.section-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}
.sub {
  font-size: 14px;
  color: var(--muted-2);
  margin-bottom: 22px;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.upload-zone {
  position: relative;
}
.zone-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.zone-label .label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.zone-label.original .label-dot {
  background: var(--danger);
}
.zone-label.modified .label-dot {
  background: var(--success);
}

.drop {
  min-height: 220px;
  border-radius: 20px;
  border: 2px dashed #d7d2ff;
  background: linear-gradient(180deg, #fff, #faf9ff);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  transition: 0.25s ease;
  cursor: pointer;
  position: relative;
}
.drop:hover,
.drop.drag-over {
  border-color: var(--primary);
  background: #f8f6ff;
}
.drop.drag-over {
  box-shadow: 0 0 0 4px rgba(105, 88, 255, 0.12);
}
.drop.has-file {
  border-style: solid;
  border-color: #dde1ef;
  background: #fcfcff;
  min-height: auto;
  padding: 0;
}

.upload-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--primary-2), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 14px 28px rgba(99, 91, 255, 0.28);
}
.drop h2 {
  font-size: 20px;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.drop p {
  color: var(--muted-2);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.7;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}
.browse-btn {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  height: 46px;
  padding: 0 20px;
  border-radius: 12px;
  background: linear-gradient(to right, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(99, 91, 255, 0.2);
  transition: 0.2s ease;
}
.browse-btn:hover {
  transform: translateY(-2px);
}
.browse-btn i {
  margin-right: 8px;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  width: 100%;
}
.file-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.file-icon.original {
  background: #fff1f1;
  color: var(--danger);
}
.file-icon.modified {
  background: #e8faf0;
  color: var(--success);
}
.file-meta {
  min-width: 0;
  flex: 1;
}
.file-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-size {
  color: var(--muted-2);
  font-size: 12px;
}
.trash {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #a0a8bc;
  cursor: pointer;
  transition: 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.trash:hover {
  background: #fff1f1;
  color: var(--danger);
}

.reorder {
  margin-top: 14px;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  line-height: 1.5;
  row-gap: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(154, 161, 184, 0.14);
  color: #8b93a8;
  font-size: 12px;
  font-weight: 600;
}
.reorder span {
  min-width: 0;
  word-break: break-word;
}

.settings {
  margin-top: 24px;
}
.setting-card {
  border: 1px solid rgba(224, 227, 242, 0.95);
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(180deg, #fff, #fbfbff);
  box-shadow: 0 14px 30px rgba(99, 91, 255, 0.05);
}
.format-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.format-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #4f566b;
}
.format-group select {
  width: 100%;
  height: 54px;
  border-radius: 16px;
  border: 1px solid #dde1ef;
  background: #fff;
  padding: 0 15px;
  outline: none;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: #2f3547;
  transition: 0.22s ease;
  appearance: auto;
}
.format-group select:focus {
  border-color: #6958ff;
  box-shadow: 0 0 0 4px rgba(105, 88, 255, 0.12);
}

.slider-group {
  margin-top: 20px;
}
.slider-group label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #4f566b;
}
.slider-group label span {
  color: var(--primary);
  font-weight: 800;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 4px 12px rgba(105, 88, 255, 0.3);
  cursor: pointer;
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 6px;
}

.progress-wrap {
  width: 100%;
  height: 10px;
  background: #ececff;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 22px;
  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;
}

.compare-btn {
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  height: 58px;
  border-radius: 16px;
  margin-top: 22px;
  background: linear-gradient(to right, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 18px 35px rgba(99, 91, 255, 0.24);
  transition: 0.22s ease;
}
.compare-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}
.compare-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.compare-btn i {
  margin-right: 8px;
}

/* ============ COMPARISON VIEWER ============ */
.viewer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 14px 35px rgba(99, 91, 255, 0.06);
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toolbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}
.back-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-nav button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}
.page-nav button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.page-nav button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.page-info {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  min-width: 90px;
  text-align: center;
}

.mode-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.mode-tab {
  height: 34px;
  padding: 0 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}
.mode-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 91, 255, 0.12);
}
.mode-tab:hover:not(.active) {
  color: var(--text);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(to right, var(--primary), var(--primary-2));
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(99, 91, 255, 0.2);
  transition: 0.2s ease;
}
.download-btn:hover {
  transform: translateY(-1px);
}

.viewer-body {
  background: var(--overlay-bg);
  min-height: 500px;
  position: relative;
  overflow: auto;
  padding: 24px;
}

.compare-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(235, 237, 245, 0.92);
  z-index: 10;
}
.compare-loading i {
  font-size: 40px;
  color: var(--primary);
}
.compare-loading p {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}

.side-by-side-view {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}
.compare-panel {
  flex: 1;
  min-width: 280px;
  max-width: 50%;
}
.panel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
}
.panel-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.panel-label.original .dot {
  background: var(--danger);
}
.panel-label.modified .dot {
  background: var(--success);
}
.panel-label.overlay-label .dot {
  background: #ffc107;
}
.panel-label.diff-label .dot {
  background: var(--primary);
}
.compare-panel canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  background: #fff;
  display: block;
}

.single-panel {
  max-width: 700px;
  margin: 0 auto;
}
.single-panel canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  background: #fff;
  display: block;
}

.viewer-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  gap: 10px;
}
.diff-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.diff-summary i {
  font-size: 14px;
}
.diff-summary .count {
  color: var(--primary);
  font-weight: 800;
}
.page-warn {
  background: #fff8e1;
  color: #e65100;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  display: none;
  align-items: center;
  gap: 8px;
}

.hidden {
  display: none !important;
}

/* =============================================================================
   LARGE SCREENS — 1200 px+
   Uses vw-based widths so content fills the viewport
============================================================================= */

@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: 26px;
    margin-bottom: 34px;
  }
  .icon-box i {
    font-size: 60px;
  }

  .features {
    gap: 16px;
    margin-top: 16px;
  }
  .feature {
    font-size: 14px;
    padding: 12px 18px;
    gap: 10px;
  }
  .feature i {
    font-size: 14px;
  }

  .tool-box {
    padding: 30px;
    border-radius: 30px;
  }

  .section-title {
    font-size: 22px;
  }
  .sub {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .upload-grid {
    gap: 24px;
    margin-bottom: 24px;
  }

  .zone-label {
    font-size: 14px;
    gap: 10px;
    margin-bottom: 12px;
  }
  .zone-label .label-dot {
    width: 10px;
    height: 10px;
  }

  .drop {
    min-height: 250px;
    border-radius: 22px;
    padding: 24px;
  }
  .upload-circle {
    width: 66px;
    height: 66px;
    font-size: 26px;
    margin-bottom: 18px;
  }
  .drop h2 {
    font-size: 22px;
    margin-bottom: 10px;
  }
  .drop p {
    font-size: 14px;
    margin-bottom: 20px;
    max-width: 340px;
  }

  .browse-btn {
    height: 50px;
    padding: 0 24px;
    font-size: 14px;
    border-radius: 14px;
  }

  .file-card {
    gap: 16px;
    padding: 20px 22px;
  }
  .file-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 22px;
  }
  .file-name {
    font-size: 15px;
    margin-bottom: 5px;
  }
  .file-size {
    font-size: 13px;
  }
  .trash {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .setting-card {
    padding: 28px;
    border-radius: 28px;
  }
  .format-row {
    gap: 20px;
  }
  .format-group label {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .format-group select {
    height: 56px;
    font-size: 15px;
    border-radius: 18px;
  }

  .slider-group {
    margin-top: 24px;
  }
  .slider-group label {
    font-size: 14px;
    margin-bottom: 12px;
  }
  input[type="range"] {
    height: 10px;
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
  }
  .slider-labels {
    font-size: 12px;
    margin-top: 8px;
  }

  .progress-wrap {
    height: 12px;
    margin-top: 26px;
  }
  .progress-text {
    margin-top: 12px;
    font-size: 14px;
  }

  .compare-btn {
    height: 62px;
    border-radius: 18px;
    margin-top: 26px;
    font-size: 16px;
  }

  .reorder {
    margin-top: 16px;
    padding: 10px 16px;
    font-size: 13px;
    gap: 9px;
  }

  /* Viewer */
  .viewer-card {
    border-radius: 30px;
  }
  .viewer-toolbar {
    padding: 18px 28px;
    gap: 14px;
  }
  .toolbar-left {
    gap: 14px;
  }
  .toolbar-center {
    gap: 10px;
  }
  .toolbar-right {
    gap: 12px;
  }
  .back-btn {
    height: 44px;
    padding: 0 22px;
    font-size: 14px;
    border-radius: 14px;
  }
  .page-nav {
    gap: 8px;
  }
  .page-nav button {
    width: 40px;
    height: 40px;
    font-size: 14px;
    border-radius: 12px;
  }
  .page-info {
    font-size: 14px;
    min-width: 100px;
  }
  .mode-tabs {
    border-radius: 14px;
    padding: 4px;
  }
  .mode-tab {
    height: 38px;
    padding: 0 20px;
    font-size: 13px;
    border-radius: 12px;
  }
  .download-btn {
    height: 44px;
    padding: 0 22px;
    font-size: 14px;
    border-radius: 14px;
  }

  .viewer-body {
    min-height: 560px;
    padding: 28px;
  }
  .compare-loading i {
    font-size: 48px;
  }
  .compare-loading p {
    font-size: 16px;
  }

  .side-by-side-view {
    gap: 24px;
  }
  .compare-panel {
    min-width: 320px;
  }
  .panel-label {
    font-size: 14px;
    margin-bottom: 14px;
    padding: 10px 16px;
    border-radius: 12px;
  }
  .panel-label .dot {
    width: 10px;
    height: 10px;
  }
  .compare-panel canvas,
  .single-panel canvas {
    border-radius: 14px;
  }

  .single-panel {
    max-width: 780px;
  }

  .viewer-footer {
    padding: 18px 28px;
    gap: 12px;
  }
  .diff-summary {
    font-size: 14px;
    gap: 10px;
  }
  .diff-summary i {
    font-size: 16px;
  }
  .page-warn {
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 12px;
  }
}

/* ——— 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: 28px;
    margin-bottom: 38px;
  }
  .icon-box i {
    font-size: 66px;
  }

  .title {
    gap: 22px;
    margin-bottom: 20px;
  }
  .top {
    margin-bottom: 36px;
  }

  .features {
    gap: 18px;
    margin-top: 18px;
  }
  .feature {
    font-size: 15px;
    padding: 13px 20px;
  }

  .tool-box {
    padding: 34px;
    border-radius: 32px;
  }

  .section-title {
    font-size: 24px;
    margin-bottom: 10px;
  }
  .sub {
    font-size: 15.5px;
    margin-bottom: 28px;
  }

  .upload-grid {
    gap: 28px;
    margin-bottom: 28px;
  }

  .zone-label {
    font-size: 14.5px;
  }

  .drop {
    min-height: 270px;
    border-radius: 24px;
    padding: 28px;
  }
  .upload-circle {
    width: 72px;
    height: 72px;
    font-size: 28px;
    margin-bottom: 20px;
  }
  .drop h2 {
    font-size: 24px;
  }
  .drop p {
    font-size: 14.5px;
    max-width: 360px;
  }

  .browse-btn {
    height: 54px;
    padding: 0 26px;
    font-size: 15px;
  }

  .file-card {
    gap: 18px;
    padding: 22px 24px;
  }
  .file-icon {
    width: 54px;
    height: 54px;
    font-size: 24px;
    border-radius: 18px;
  }
  .file-name {
    font-size: 16px;
  }
  .file-size {
    font-size: 13.5px;
  }
  .trash {
    width: 46px;
    height: 46px;
    font-size: 18px;
    border-radius: 12px;
  }

  .setting-card {
    padding: 32px;
    border-radius: 30px;
  }
  .format-row {
    gap: 22px;
  }
  .format-group label {
    font-size: 14.5px;
  }
  .format-group select {
    height: 58px;
    font-size: 15px;
  }

  .slider-group label {
    font-size: 14.5px;
  }

  .progress-wrap {
    height: 14px;
  }

  .compare-btn {
    height: 66px;
    font-size: 17px;
    border-radius: 20px;
  }

  .reorder {
    padding: 11px 18px;
    font-size: 13.5px;
  }

  /* Viewer */
  .viewer-card {
    border-radius: 32px;
  }
  .viewer-toolbar {
    padding: 20px 32px;
  }
  .back-btn {
    height: 48px;
    padding: 0 24px;
    font-size: 14.5px;
  }
  .page-nav button {
    width: 44px;
    height: 44px;
    font-size: 15px;
  }
  .page-info {
    font-size: 15px;
    min-width: 110px;
  }
  .mode-tab {
    height: 40px;
    padding: 0 22px;
    font-size: 13.5px;
  }
  .download-btn {
    height: 48px;
    padding: 0 24px;
    font-size: 14.5px;
  }

  .viewer-body {
    min-height: 600px;
    padding: 32px;
  }
  .compare-loading i {
    font-size: 54px;
  }
  .compare-loading p {
    font-size: 17px;
  }

  .side-by-side-view {
    gap: 28px;
  }
  .panel-label {
    font-size: 15px;
    padding: 11px 18px;
  }
  .compare-panel canvas,
  .single-panel canvas {
    border-radius: 16px;
  }

  .single-panel {
    max-width: 840px;
  }

  .viewer-footer {
    padding: 20px 32px;
  }
  .diff-summary {
    font-size: 15px;
  }
  .page-warn {
    font-size: 13.5px;
  }
}

/* ——— 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 {
    margin-bottom: 40px;
  }

  .icon-box {
    width: 132px;
    height: 132px;
    border-radius: 30px;
    margin-bottom: 42px;
  }
  .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: 12px;
  }
  .sub {
    font-size: 17px;
    margin-bottom: 32px;
  }

  .upload-grid {
    gap: 32px;
    margin-bottom: 32px;
  }

  .zone-label {
    font-size: 15px;
    margin-bottom: 14px;
  }
  .zone-label .label-dot {
    width: 12px;
    height: 12px;
  }

  .drop {
    min-height: 300px;
    border-radius: 26px;
    padding: 32px;
    border-width: 3px;
  }
  .upload-circle {
    width: 84px;
    height: 84px;
    font-size: 32px;
    margin-bottom: 24px;
  }
  .drop h2 {
    font-size: 26px;
    margin-bottom: 12px;
  }
  .drop p {
    font-size: 15px;
    margin-bottom: 24px;
    max-width: 400px;
  }

  .browse-btn {
    height: 58px;
    padding: 0 30px;
    font-size: 16px;
    border-radius: 16px;
  }

  .file-card {
    gap: 20px;
    padding: 24px 28px;
  }
  .file-icon {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    font-size: 28px;
  }
  .file-name {
    font-size: 18px;
    margin-bottom: 6px;
  }
  .file-size {
    font-size: 14.5px;
  }
  .trash {
    width: 50px;
    height: 50px;
    font-size: 20px;
    border-radius: 14px;
  }

  .setting-card {
    padding: 36px;
    border-radius: 34px;
  }
  .format-row {
    gap: 26px;
  }
  .format-group label {
    font-size: 15px;
    margin-bottom: 14px;
  }
  .format-group select {
    height: 62px;
    font-size: 16px;
    border-radius: 20px;
    padding: 0 18px;
  }

  .slider-group {
    margin-top: 28px;
  }
  .slider-group label {
    font-size: 15px;
    margin-bottom: 14px;
  }
  input[type="range"] {
    height: 12px;
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 30px;
    height: 30px;
  }
  .slider-labels {
    font-size: 13px;
    margin-top: 10px;
  }

  .progress-wrap {
    height: 16px;
    margin-top: 30px;
  }
  .progress-text {
    margin-top: 14px;
    font-size: 15px;
  }

  .compare-btn {
    height: 72px;
    border-radius: 22px;
    margin-top: 30px;
    font-size: 18px;
  }

  .reorder {
    margin-top: 20px;
    padding: 12px 20px;
    font-size: 14px;
    gap: 10px;
  }

  /* Viewer */
  .viewer-card {
    border-radius: 36px;
  }
  .viewer-toolbar {
    padding: 22px 36px;
    gap: 16px;
  }
  .toolbar-left {
    gap: 16px;
  }
  .toolbar-right {
    gap: 14px;
  }
  .back-btn {
    height: 52px;
    padding: 0 28px;
    font-size: 15px;
    border-radius: 16px;
  }
  .page-nav {
    gap: 10px;
  }
  .page-nav button {
    width: 48px;
    height: 48px;
    font-size: 16px;
    border-radius: 14px;
  }
  .page-info {
    font-size: 16px;
    min-width: 120px;
  }
  .mode-tabs {
    border-radius: 16px;
    padding: 4px;
    gap: 4px;
  }
  .mode-tab {
    height: 44px;
    padding: 0 24px;
    font-size: 14px;
    border-radius: 14px;
  }
  .download-btn {
    height: 52px;
    padding: 0 28px;
    font-size: 15px;
    border-radius: 16px;
  }

  .viewer-body {
    min-height: 680px;
    padding: 40px;
  }
  .compare-loading i {
    font-size: 62px;
  }
  .compare-loading p {
    font-size: 19px;
  }

  .side-by-side-view {
    gap: 32px;
  }
  .compare-panel {
    min-width: 380px;
  }
  .panel-label {
    font-size: 16px;
    margin-bottom: 16px;
    padding: 12px 20px;
    border-radius: 14px;
  }
  .panel-label .dot {
    width: 12px;
    height: 12px;
  }
  .compare-panel canvas,
  .single-panel canvas {
    border-radius: 18px;
  }

  .single-panel {
    max-width: 920px;
  }

  .viewer-footer {
    padding: 22px 36px;
    gap: 14px;
  }
  .diff-summary {
    font-size: 16px;
    gap: 12px;
  }
  .diff-summary i {
    font-size: 18px;
  }
  .page-warn {
    font-size: 14px;
    padding: 12px 18px;
    border-radius: 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 {
    margin-bottom: 56px;
  }

  .icon-box {
    width: 170px;
    height: 170px;
    border-radius: 36px;
    margin-bottom: 52px;
  }
  .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: 16px;
  }
  .sub {
    font-size: 21px;
    margin-bottom: 40px;
  }

  .upload-grid {
    gap: 40px;
    margin-bottom: 40px;
  }

  .zone-label {
    font-size: 18px;
    gap: 12px;
    margin-bottom: 18px;
  }
  .zone-label .label-dot {
    width: 14px;
    height: 14px;
  }

  .drop {
    min-height: 380px;
    border-radius: 32px;
    padding: 44px;
    border-width: 3px;
  }
  .upload-circle {
    width: 110px;
    height: 110px;
    font-size: 44px;
    margin-bottom: 32px;
  }
  .drop h2 {
    font-size: 34px;
    margin-bottom: 16px;
  }
  .drop p {
    font-size: 18px;
    margin-bottom: 32px;
    max-width: 500px;
    line-height: 1.8;
  }

  .browse-btn {
    height: 76px;
    padding: 0 42px;
    font-size: 20px;
    border-radius: 20px;
  }

  .file-card {
    gap: 26px;
    padding: 32px 36px;
  }
  .file-icon {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    font-size: 36px;
  }
  .file-name {
    font-size: 23px;
    margin-bottom: 8px;
  }
  .file-size {
    font-size: 18px;
  }
  .trash {
    width: 64px;
    height: 64px;
    font-size: 26px;
    border-radius: 18px;
  }

  .setting-card {
    padding: 48px;
    border-radius: 40px;
  }
  .format-row {
    gap: 32px;
  }
  .format-group label {
    font-size: 18px;
    margin-bottom: 18px;
  }
  .format-group select {
    height: 78px;
    font-size: 19px;
    border-radius: 24px;
    padding: 0 24px;
  }

  .slider-group {
    margin-top: 36px;
  }
  .slider-group label {
    font-size: 18px;
    margin-bottom: 18px;
  }
  input[type="range"] {
    height: 16px;
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 38px;
    height: 38px;
  }
  .slider-labels {
    font-size: 16px;
    margin-top: 14px;
  }

  .progress-wrap {
    height: 20px;
    margin-top: 36px;
  }
  .progress-text {
    margin-top: 18px;
    font-size: 18px;
  }

  .compare-btn {
    height: 88px;
    border-radius: 28px;
    margin-top: 36px;
    font-size: 23px;
    box-shadow: 0 24px 48px rgba(99, 91, 255, 0.28);
  }

  .reorder {
    margin-top: 26px;
    padding: 16px 26px;
    font-size: 18px;
    gap: 12px;
    border-radius: 999px;
  }

  /* Viewer */
  .viewer-card {
    border-radius: 44px;
  }
  .viewer-toolbar {
    padding: 28px 48px;
    gap: 20px;
  }
  .toolbar-left {
    gap: 20px;
  }
  .toolbar-center {
    gap: 14px;
  }
  .toolbar-right {
    gap: 18px;
  }
  .back-btn {
    height: 66px;
    padding: 0 36px;
    font-size: 19px;
    border-radius: 20px;
    gap: 12px;
  }
  .page-nav {
    gap: 12px;
  }
  .page-nav button {
    width: 60px;
    height: 60px;
    font-size: 20px;
    border-radius: 18px;
  }
  .page-info {
    font-size: 20px;
    min-width: 150px;
  }
  .mode-tabs {
    border-radius: 20px;
    padding: 5px;
    gap: 6px;
  }
  .mode-tab {
    height: 54px;
    padding: 0 32px;
    font-size: 18px;
    border-radius: 18px;
  }
  .download-btn {
    height: 66px;
    padding: 0 36px;
    font-size: 19px;
    border-radius: 20px;
    gap: 12px;
  }

  .viewer-body {
    min-height: 860px;
    padding: 56px;
  }
  .compare-loading i {
    font-size: 80px;
  }
  .compare-loading p {
    font-size: 24px;
  }
  .compare-loading {
    gap: 24px;
  }

  .side-by-side-view {
    gap: 44px;
  }
  .compare-panel {
    min-width: 480px;
  }
  .panel-label {
    font-size: 20px;
    margin-bottom: 20px;
    padding: 16px 24px;
    border-radius: 18px;
    gap: 12px;
  }
  .panel-label .dot {
    width: 14px;
    height: 14px;
  }
  .compare-panel canvas,
  .single-panel canvas {
    border-radius: 24px;
  }

  .single-panel {
    max-width: 1200px;
  }

  .viewer-footer {
    padding: 28px 48px;
    gap: 18px;
  }
  .diff-summary {
    font-size: 20px;
    gap: 14px;
  }
  .diff-summary i {
    font-size: 22px;
  }
  .diff-summary .count {
    font-weight: 800;
  }
  .page-warn {
    font-size: 18px;
    padding: 16px 24px;
    border-radius: 18px;
    gap: 12px;
  }
}

/* =============================================================================
   STRUCTURAL BREAKPOINTS (layout changes)
============================================================================= */

@media (max-width: 950px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }
  .format-row {
    grid-template-columns: 1fr;
  }
  .side-by-side-view {
    flex-direction: column;
    align-items: center;
  }
  .compare-panel {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .icon-box {
    display: none;
  }
  .feature {
    padding: 11px 16px 11px 0px;
  }
}

@media (max-width: 650px) {
  body {
    padding: 14px;
  }
  .tool-box,
  .viewer-card {
    padding: 18px;
    border-radius: 22px;
  }
  .title {
    flex-direction: column;
    align-items: flex-start;
  }
  .icon-box {
    width: 80px;
    height: 80px;
  }
  .icon-box i {
    font-size: 42px;
  }
  h1 {
    font-size: 34px;
  }
  .drop {
    min-height: 180px;
  }
  .drop h2 {
    font-size: 18px;
  }
  .viewer-toolbar {
    padding: 12px 16px;
  }
  .mode-tabs {
    overflow-x: auto;
  }
  .mode-tab {
    font-size: 11px;
    padding: 0 10px;
  }
  .viewer-body {
    padding: 16px;
  }
  .reorder {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 11px;
  }
}

/* =============================================================================
   DARK THEME SUPPORT
============================================================================= */

body.dark {
  color-scheme: dark;
  --bg: #0b1020;
  --card: #11172a;
  --text: #e6ebff;
  --muted: #a8b1cc;
  --muted-2: #8d97b4;
  --border: #24304a;
  --primary: #8b7bff;
  --primary-2: #a18fff;
  --primary-soft: #1a2140;
  --danger: #ff6b6b;
  --success: #32d583;
  --overlay-bg: #0f162a;
}

body.dark {
  background:
    radial-gradient(circle at top, rgba(139, 123, 255, 0.14), transparent 35%),
    var(--bg);
  color: var(--text);
}

body.dark .tool-box,
body.dark .setting-card,
body.dark .viewer-card {
  background: rgba(17, 23, 42, 0.96);
  border-color: var(--border);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);
}

body.dark .drop {
  background: linear-gradient(180deg, #11172a, #0e1526);
  border-color: #2a3550;
}

body.dark .drop:hover,
body.dark .drop.drag-over {
  background: #121b33;
  border-color: var(--primary);
}

body.dark .drop.has-file {
  background: #11192d;
  border-color: #2a3550;
}

body.dark .section-title,
body.dark h1,
body.dark .panel-label,
body.dark .diff-summary {
  color: var(--text);
}

body.dark .desc,
body.dark .sub,
body.dark .file-size,
body.dark .page-info,
body.dark .progress-text,
body.dark .slider-group label,
body.dark .format-group label,
body.dark .zone-label,
body.dark .feature {
  color: var(--muted);
}

body.dark .feature {
  border-radius: 999px;
}

body.dark .browse-btn,
body.dark .compare-btn,
body.dark .download-btn {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

body.dark .back-btn,
body.dark .page-nav button,
body.dark .format-group select {
  background: #10182d;
  color: var(--text);
  border-color: var(--border);
}

body.dark .back-btn:hover,
body.dark .page-nav button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

body.dark .mode-tabs {
  background: #0c1326;
}

body.dark .mode-tab {
  color: var(--muted);
}

body.dark .mode-tab.active {
  background: #17213a;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

body.dark .viewer-body {
  background: var(--overlay-bg);
}

body.dark .panel-label {
  background: rgba(255, 255, 255, 0.04);
}

body.dark .page-warn {
  background: #3a2b10;
  color: #ffd08a;
}

body.dark .progress-wrap {
  background: #1b2540;
}

body.dark .progress-text {
  color: var(--muted);
}

body.dark .trash:hover {
  background: rgba(255, 93, 93, 0.12);
}

body.dark .reorder {
  background: rgba(139, 123, 255, 0.12);
  color: #c8cfff;
}

body.dark .compare-loading {
  background: rgba(15, 22, 42, 0.92);
}

body.dark .compare-loading p {
  color: var(--muted);
}

body.dark .compare-panel canvas,
body.dark .single-panel canvas {
  background: #ffffff;
}

body.dark .format-group select:focus {
  box-shadow: 0 0 0 4px rgba(139, 123, 255, 0.16);
}
/* ===== Dark Mode — Missing Overrides ===== */

/* File icon backgrounds */
body.dark .file-icon.original {
  background: rgba(255, 107, 107, 0.12);
  color: var(--danger);
}
body.dark .file-icon.modified {
  background: rgba(50, 213, 131, 0.12);
  color: var(--success);
}

/* Drop zone inner text */
body.dark .drop h2 {
  color: var(--text);
}
body.dark .drop p {
  color: var(--muted-2);
}

/* Upload circle shadow in dark mode */
body.dark .upload-circle {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

/* Feature badge backgrounds */
body.dark .feature {
  background: rgba(139, 123, 255, 0.08);
  color: var(--muted);
}

/* File card subtle background for separation */
body.dark .file-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
}

/* Icon box in dark mode */
body.dark .icon-box {
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Drop zone dashed border — softer in dark */
body.dark .drop {
  border-color: #2a3550;
}

/* Slider track in dark mode */
body.dark input[type="range"] {
  background: #1b2540;
}

/* Select dropdown arrow visibility */
body.dark .format-group select {
  background-image: none;
}

/* =============================================================================
   SMALL SCREENS — mobile compaction
============================================================================= */

/* ——— 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;
  }

  .upload-grid {
    gap: 14px;
    margin-bottom: 14px;
  }

  .zone-label {
    font-size: 11px;
    margin-bottom: 8px;
    gap: 6px;
  }
  .zone-label .label-dot {
    width: 6px;
    height: 6px;
  }

  .drop {
    min-height: 160px;
    border-radius: 16px;
    padding: 16px;
  }
  .upload-circle {
    width: 48px;
    height: 48px;
    font-size: 20px;
    margin-bottom: 12px;
  }
  .drop h2 {
    font-size: 18px;
    margin-bottom: 6px;
  }
  .drop p {
    font-size: 12px;
    margin-bottom: 14px;
    max-width: 260px;
  }

  .browse-btn {
    height: 42px;
    padding: 0 16px;
    font-size: 12px;
    border-radius: 10px;
  }

  .file-card {
    gap: 10px;
    padding: 14px 16px;
  }
  .file-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 17px;
  }
  .file-name {
    font-size: 13px;
    margin-bottom: 3px;
  }
  .file-size {
    font-size: 11px;
  }
  .trash {
    width: 34px;
    height: 34px;
    font-size: 13px;
    border-radius: 8px;
  }

  .setting-card {
    padding: 14px;
    border-radius: 18px;
  }
  .format-row {
    gap: 12px;
  }
  .format-group label {
    font-size: 12px;
    margin-bottom: 6px;
  }
  .format-group select {
    height: 44px;
    font-size: 13px;
    border-radius: 12px;
  }

  .slider-group {
    margin-top: 16px;
  }
  .slider-group label {
    font-size: 12px;
    margin-bottom: 8px;
  }
  input[type="range"] {
    height: 6px;
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
  }
  .slider-labels {
    font-size: 10px;
    margin-top: 4px;
  }

  .progress-wrap {
    height: 8px;
    margin-top: 16px;
  }
  .progress-text {
    margin-top: 8px;
    font-size: 12px;
  }

  .compare-btn {
    height: 50px;
    font-size: 13px;
    border-radius: 14px;
    margin-top: 16px;
  }

  .reorder {
    margin-top: 10px;
    padding: 6px 10px;
    font-size: 11px;
    gap: 5px;
  }

  /* Viewer */
  .viewer-card {
    border-radius: 18px;
  }
  .viewer-toolbar {
    padding: 10px 14px;
    gap: 8px;
  }
  .toolbar-left {
    gap: 8px;
  }
  .toolbar-center {
    gap: 6px;
  }
  .toolbar-right {
    gap: 6px;
  }
  .back-btn {
    height: 36px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 10px;
    gap: 5px;
  }
  .page-nav {
    gap: 4px;
  }
  .page-nav button {
    width: 32px;
    height: 32px;
    font-size: 11px;
    border-radius: 8px;
  }
  .page-info {
    font-size: 11px;
    min-width: 70px;
  }
  .mode-tabs {
    border-radius: 10px;
  }
  .mode-tab {
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 8px;
  }
  .download-btn {
    height: 36px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 10px;
    gap: 5px;
  }

  .viewer-body {
    min-height: 380px;
    padding: 14px;
  }
  .compare-loading i {
    font-size: 32px;
  }
  .compare-loading p {
    font-size: 13px;
  }
  .compare-loading {
    gap: 10px;
  }

  .side-by-side-view {
    gap: 14px;
  }
  .compare-panel {
    min-width: 100%;
  }
  .panel-label {
    font-size: 11px;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    gap: 5px;
  }
  .panel-label .dot {
    width: 6px;
    height: 6px;
  }
  .compare-panel canvas,
  .single-panel canvas {
    border-radius: 10px;
  }

  .single-panel {
    max-width: 100%;
  }

  .viewer-footer {
    padding: 12px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .diff-summary {
    font-size: 11px;
    gap: 6px;
  }
  .diff-summary i {
    font-size: 12px;
  }
  .page-warn {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 8px;
    gap: 5px;
  }
}

/* ——— 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;
  }

  .upload-grid {
    gap: 12px;
    margin-bottom: 12px;
  }

  .zone-label {
    font-size: 10.5px;
    margin-bottom: 6px;
  }

  .drop {
    min-height: 145px;
    border-radius: 14px;
    padding: 14px;
  }
  .upload-circle {
    width: 42px;
    height: 42px;
    font-size: 18px;
    margin-bottom: 10px;
  }
  .drop h2 {
    font-size: 17px;
  }
  .drop p {
    font-size: 11px;
    margin-bottom: 12px;
    max-width: 230px;
  }

  .browse-btn {
    height: 40px;
    padding: 0 14px;
    font-size: 12px;
    border-radius: 10px;
  }

  .file-card {
    padding: 12px 14px;
    gap: 8px;
  }
  .file-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 15px;
  }
  .file-name {
    font-size: 12px;
    margin-bottom: 2px;
  }
  .file-size {
    font-size: 10.5px;
  }
  .trash {
    width: 30px;
    height: 30px;
    font-size: 12px;
    border-radius: 8px;
  }

  .setting-card {
    padding: 12px;
    border-radius: 16px;
  }
  .format-group label {
    font-size: 11.5px;
    margin-bottom: 5px;
  }
  .format-group select {
    height: 42px;
    font-size: 12px;
    border-radius: 10px;
  }

  .slider-group label {
    font-size: 11.5px;
  }

  .compare-btn {
    height: 46px;
    font-size: 12.5px;
    border-radius: 12px;
  }

  .reorder {
    font-size: 10.5px;
    padding: 5px 9px;
  }

  /* Viewer */
  .viewer-card {
    border-radius: 16px;
  }
  .viewer-toolbar {
    padding: 8px 12px;
  }
  .back-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }
  .page-nav button {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }
  .page-info {
    font-size: 10.5px;
    min-width: 60px;
  }
  .mode-tab {
    height: 28px;
    padding: 0 8px;
    font-size: 10px;
  }
  .download-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }

  .viewer-body {
    min-height: 340px;
    padding: 12px;
  }
  .compare-loading i {
    font-size: 28px;
  }
  .compare-loading p {
    font-size: 12px;
  }

  .side-by-side-view {
    gap: 12px;
  }
  .panel-label {
    font-size: 10.5px;
    padding: 5px 8px;
    margin-bottom: 6px;
  }

  .viewer-footer {
    padding: 10px 12px;
  }
  .diff-summary {
    font-size: 10.5px;
  }
  .page-warn {
    font-size: 10px;
    padding: 5px 8px;
  }
}

/* ——— 325 px ——— */
@media (max-width: 325px) {
  body {
    padding: 6px;
    font-size: 12px;
  }

  .tool-box {
    padding: 10px;
    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;
  }

  .upload-grid {
    gap: 10px;
    margin-bottom: 10px;
  }

  .zone-label {
    font-size: 10px;
    letter-spacing: 0.3px;
  }

  .drop {
    min-height: 130px;
    border-radius: 12px;
    padding: 12px;
    border-width: 1.5px;
  }
  .upload-circle {
    width: 38px;
    height: 38px;
    font-size: 16px;
    margin-bottom: 8px;
  }
  .drop h2 {
    font-size: 15px;
    margin-bottom: 4px;
  }
  .drop p {
    font-size: 10.5px;
    margin-bottom: 10px;
    max-width: 200px;
  }

  .browse-btn {
    height: 38px;
    padding: 0 12px;
    font-size: 11.5px;
    border-radius: 10px;
  }

  .file-card {
    padding: 10px 12px;
    gap: 6px;
  }
  .file-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 14px;
  }
  .file-name {
    font-size: 11.5px;
  }
  .file-size {
    font-size: 10px;
  }
  .trash {
    width: 28px;
    height: 28px;
    font-size: 11px;
    border-radius: 6px;
  }

  .setting-card {
    padding: 10px;
    border-radius: 14px;
  }
  .format-row {
    gap: 8px;
  }
  .format-group label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .format-group select {
    height: 40px;
    font-size: 11.5px;
    border-radius: 10px;
    padding: 0 10px;
  }

  .slider-group {
    margin-top: 12px;
  }
  .slider-group label {
    font-size: 11px;
    margin-bottom: 6px;
  }
  input[type="range"] {
    height: 5px;
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
  }
  .slider-labels {
    font-size: 9.5px;
  }

  .progress-wrap {
    height: 6px;
    margin-top: 12px;
  }
  .progress-text {
    font-size: 10.5px;
    min-height: 14px;
  }

  .compare-btn {
    height: 42px;
    font-size: 12px;
    border-radius: 10px;
    margin-top: 12px;
  }

  .reorder {
    font-size: 10px;
    padding: 4px 8px;
    gap: 4px;
  }

  /* Viewer */
  .viewer-card {
    border-radius: 14px;
  }
  .viewer-toolbar {
    padding: 6px 10px;
    gap: 6px;
  }
  .toolbar-left,
  .toolbar-center,
  .toolbar-right {
    gap: 4px;
  }
  .back-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 10.5px;
    border-radius: 8px;
    gap: 4px;
  }
  .page-nav {
    gap: 3px;
  }
  .page-nav button {
    width: 28px;
    height: 28px;
    font-size: 10px;
    border-radius: 6px;
  }
  .page-info {
    font-size: 10px;
    min-width: 54px;
  }
  .mode-tabs {
    border-radius: 8px;
    padding: 2px;
  }
  .mode-tab {
    height: 26px;
    padding: 0 7px;
    font-size: 9.5px;
    border-radius: 7px;
  }
  .download-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 10.5px;
    border-radius: 8px;
    gap: 4px;
  }

  .viewer-body {
    min-height: 300px;
    padding: 10px;
  }
  .compare-loading i {
    font-size: 24px;
  }
  .compare-loading p {
    font-size: 11px;
  }

  .side-by-side-view {
    gap: 10px;
  }
  .panel-label {
    font-size: 10px;
    padding: 4px 7px;
    margin-bottom: 5px;
    border-radius: 6px;
    gap: 4px;
  }
  .panel-label .dot {
    width: 5px;
    height: 5px;
  }
  .compare-panel canvas,
  .single-panel canvas {
    border-radius: 8px;
  }

  .viewer-footer {
    padding: 8px 10px;
    gap: 6px;
  }
  .diff-summary {
    font-size: 10px;
    gap: 4px;
  }
  .diff-summary i {
    font-size: 11px;
  }
  .page-warn {
    font-size: 9.5px;
    padding: 4px 7px;
    border-radius: 6px;
    gap: 4px;
  }
}
/* =============================================================================
   FILE CARD (.drop.has-file) — under 425 px
============================================================================= */

@media (max-width: 425px) {
  .drop.has-file {
    border-radius: 13px;
    border-width: 1.5px;
    padding: 0;
  }

  .drop.has-file .file-card {
    gap: 8px;
    padding: 10px 12px;
  }

  .drop.has-file .file-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 14px;
  }

  .drop.has-file .file-icon.original {
    background: #fff1f1;
    color: var(--danger);
  }

  .drop.has-file .file-icon.modified {
    background: #e8faf0;
    color: var(--success);
  }

  .drop.has-file .file-meta {
    min-width: 0;
    flex: 1;
  }

  .drop.has-file .file-name {
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .drop.has-file .file-size {
    font-size: 10px;
    color: var(--muted-2);
  }

  .drop.has-file .trash {
    width: 30px;
    height: 30px;
    font-size: 11px;
    border-radius: 7px;
    flex-shrink: 0;
  }
}

@media (max-width: 375px) {
  .drop.has-file {
    border-radius: 12px;
    border-width: 1.5px;
  }

  .drop.has-file .file-card {
    gap: 7px;
    padding: 8px 10px;
  }

  .drop.has-file .file-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 13px;
  }

  .drop.has-file .file-name {
    font-size: 11px;
    margin-bottom: 1px;
  }

  .drop.has-file .file-size {
    font-size: 9.5px;
  }

  .drop.has-file .trash {
    width: 28px;
    height: 28px;
    font-size: 10px;
    border-radius: 7px;
  }
}

@media (max-width: 340px) {
  .drop.has-file {
    border-radius: 10px;
    border-width: 1px;
  }

  .drop.has-file .file-card {
    gap: 6px;
    padding: 7px 8px;
    flex-wrap: wrap;
  }

  .drop.has-file .file-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: 11px;
  }

  .drop.has-file .file-meta {
    flex: 1;
    min-width: 0;
  }

  .drop.has-file .file-name {
    font-size: 10px;
    margin-bottom: 0;
  }

  .drop.has-file .file-size {
    font-size: 8.5px;
    width: 100%;
    order: 2;

    margin-top: 1px;
  }

  .drop.has-file .trash {
    width: 24px;
    height: 24px;
    font-size: 9px;
    border-radius: 6px;
    align-self: flex-start;
  }
}

@media (max-width: 300px) {
  .drop.has-file {
    border-radius: 8px;
    border-width: 1px;
  }

  .drop.has-file .file-card {
    gap: 4px;
    padding: 5px 6px;
    flex-wrap: wrap;
  }

  .drop.has-file .file-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    font-size: 9px;
  }

  .drop.has-file .file-name {
    font-size: 9px;
    flex: 1;
    min-width: 0;
  }

  .drop.has-file .file-size {
    font-size: 7.5px;
    width: 100%;
    order: 2;
  }

  .drop.has-file .trash {
    width: 20px;
    height: 20px;
    font-size: 8px;
    border-radius: 4px;
    align-self: flex-start;
  }
}

/* ---- Dark mode file card overrides under 425px ---- */

@media (max-width: 425px) {
  body.dark .drop.has-file {
    background: #11192d;
    border-color: #222d45;
  }

  body.dark .drop.has-file .file-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 9px;
  }

  body.dark .drop.has-file .file-icon.original {
    background: rgba(255, 107, 107, 0.1);
    color: var(--danger);
  }

  body.dark .drop.has-file .file-icon.modified {
    background: rgba(50, 213, 131, 0.1);
    color: var(--success);
  }

  body.dark .drop.has-file .trash:hover {
    background: rgba(255, 93, 93, 0.1);
    color: var(--danger);
  }
}

@media (max-width: 340px) {
  body.dark .drop.has-file {
    background: #0e162a;
    border-color: #1c2740;
  }

  body.dark .drop.has-file .file-card {
    background: rgba(255, 255, 255, 0.015);
    border-radius: 7px;
  }
}

/* ---- Touch target enforcement for file card actions ---- */

@media (pointer: coarse) and (max-width: 425px) {
  .drop.has-file .trash {
    min-width: 36px;
    min-height: 36px;
  }
}

@media (pointer: coarse) and (max-width: 340px) {
  .drop.has-file .trash {
    min-width: 32px;
    min-height: 32px;
  }
}

/* =============================================================================
   FILE CARD (.drop.has-file) — under 425 px
============================================================================= */

@media (max-width: 425px) {
  .drop.has-file {
    border-radius: 13px;
    border-width: 1.5px;
    padding: 0;
  }

  .drop.has-file .file-card {
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
  }

  .drop.has-file .file-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 15px;
    flex-shrink: 0;
  }

  .drop.has-file .file-icon.original {
    background: #fff1f1;
    color: var(--danger);
  }

  .drop.has-file .file-icon.modified {
    background: #e8faf0;
    color: var(--success);
  }

  .drop.has-file .file-meta {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .drop.has-file .file-name {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: calc(100vw - 130px);
  }

  .drop.has-file .file-size {
    font-size: 10.5px;
    color: var(--muted-2);
    line-height: 1.3;
  }

  .drop.has-file .trash {
    width: 32px;
    height: 32px;
    font-size: 12px;
    border-radius: 8px;
    flex-shrink: 0;
  }
}

@media (max-width: 375px) {
  .drop.has-file {
    border-radius: 12px;
    border-width: 1.5px;
  }

  .drop.has-file .file-card {
    gap: 8px;
    padding: 9px 10px;
    border-radius: 9px;
  }

  .drop.has-file .file-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 14px;
  }

  .drop.has-file .file-name {
    font-size: 11px;
    margin-bottom: 1px;
    max-width: calc(100vw - 110px);
  }

  .drop.has-file .file-size {
    font-size: 9.5px;
  }

  .drop.has-file .trash {
    width: 28px;
    height: 28px;
    font-size: 11px;
    border-radius: 7px;
  }
}

@media (max-width: 340px) {
  .drop.has-file {
    border-radius: 10px;
    border-width: 1px;
  }

  .drop.has-file .file-card {
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .drop.has-file .file-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 12px;
  }

  .drop.has-file .file-meta {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .drop.has-file .file-name {
    font-size: 10.5px;
    margin-bottom: 0;
    max-width: calc(100vw - 95px);
    line-height: 1.3;
  }

  .drop.has-file .file-size {
    font-size: 8.5px;
    display: block;
    width: 100%;
    order: 3;

    margin-top: 2px;
  }

  .drop.has-file .trash {
    width: 26px;
    height: 26px;
    font-size: 10px;
    border-radius: 6px;
    align-self: flex-start;
    margin-top: 1px;
  }
}

@media (max-width: 300px) {
  .drop.has-file {
    border-radius: 8px;
    border-width: 1px;
  }

  .drop.has-file .file-card {
    gap: 5px;
    padding: 6px;
    border-radius: 6px;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .drop.has-file .file-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 10px;
  }

  .drop.has-file .file-meta {
    flex: 1;
    min-width: 0;
  }

  .drop.has-file .file-name {
    font-size: 9.5px;
    max-width: calc(100vw - 78px);
    line-height: 1.25;
  }

  .drop.has-file .file-size {
    font-size: 8px;

    margin-top: 1px;
  }

  .drop.has-file .trash {
    width: 22px;
    height: 22px;
    font-size: 9px;
    border-radius: 5px;
    align-self: flex-start;
    margin-top: 1px;
  }
}

/* ---- File card dark mode — under 425px ---- */

@media (max-width: 425px) {
  body.dark .drop.has-file {
    background: #11192d;
    border-color: #222d45;
  }

  body.dark .drop.has-file .file-card {
    background: rgba(255, 255, 255, 0.025);
  }

  body.dark .drop.has-file .file-icon.original {
    background: rgba(255, 107, 107, 0.1);
    color: var(--danger);
  }

  body.dark .drop.has-file .file-icon.modified {
    background: rgba(50, 213, 131, 0.1);
    color: var(--success);
  }

  body.dark .drop.has-file .file-name {
    color: var(--text);
  }

  body.dark .drop.has-file .file-size {
    color: var(--muted-2);
  }

  body.dark .drop.has-file .trash {
    color: #6b7590;
  }

  body.dark .drop.has-file .trash:hover {
    background: rgba(255, 93, 93, 0.1);
    color: var(--danger);
  }
}

@media (max-width: 340px) {
  body.dark .drop.has-file {
    background: #0e162a;
    border-color: #1c2740;
  }

  body.dark .drop.has-file .file-card {
    background: rgba(255, 255, 255, 0.02);
  }
}

@media (max-width: 300px) {
  body.dark .drop.has-file {
    background: #0d1428;
    border-color: #192336;
  }

  body.dark .drop.has-file .file-card {
    background: rgba(255, 255, 255, 0.015);
  }
}

/* ---- File card touch targets — under 425px ---- */

@media (pointer: coarse) and (max-width: 425px) {
  .drop.has-file .trash {
    min-width: 38px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .drop.has-file .file-card {
    padding: 10px;
  }
}

@media (pointer: coarse) and (max-width: 375px) {
  .drop.has-file .trash {
    min-width: 36px;
    min-height: 36px;
  }

  .drop.has-file .file-card {
    padding: 8px 10px;
  }
}

@media (pointer: coarse) and (max-width: 340px) {
  .drop.has-file .trash {
    min-width: 32px;
    min-height: 32px;
  }
}

@media (pointer: coarse) and (max-width: 300px) {
  .drop.has-file .trash {
    min-width: 28px;
    min-height: 28px;
  }
}

/* =============================================================================
   REORDER — under 425 px
============================================================================= */

@media (max-width: 425px) {
  .reorder {
    margin-top: 10px;
    width: 100%;
    flex-wrap: wrap;
    row-gap: 3px;
    line-height: 1.35;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 600;
    gap: 5px;
  }

  .reorder i {
    font-size: 10.5px;
    flex-shrink: 0;
  }

  .reorder span {
    min-width: 0;
    word-break: break-word;
    font-size: 10.5px;
    line-height: 1.35;
  }
}

@media (max-width: 375px) {
  .reorder {
    margin-top: 8px;
    padding: 6px 9px;
    border-radius: 9px;
    font-size: 10px;
    gap: 4px;
    row-gap: 2px;
    line-height: 1.3;
  }

  .reorder i {
    font-size: 10px;
  }

  .reorder span {
    font-size: 10px;
    line-height: 1.3;
  }
}

@media (max-width: 340px) {
  .reorder {
    margin-top: 6px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 9.5px;
    gap: 3px;
    row-gap: 2px;
    line-height: 1.25;
  }

  .reorder i {
    font-size: 9px;
  }

  .reorder span {
    font-size: 9.5px;
    line-height: 1.25;
  }
}

@media (max-width: 300px) {
  .reorder {
    margin-top: 5px;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 8.5px;
    gap: 3px;
    row-gap: 1px;
    line-height: 1.2;
  }

  .reorder i {
    font-size: 8px;
  }

  .reorder span {
    font-size: 8.5px;
    line-height: 1.2;
  }
}

/* ---- Reorder dark mode — under 425px ---- */

@media (max-width: 425px) {
  body.dark .reorder {
    background: rgba(139, 123, 255, 0.08);
    color: #9ea5c0;
  }

  body.dark .reorder i {
    color: #8b92ab;
  }

  body.dark .reorder span {
    color: #9ea5c0;
  }
}

@media (max-width: 340px) {
  body.dark .reorder {
    background: rgba(139, 123, 255, 0.06);
    color: #8b93ad;
  }

  body.dark .reorder i {
    color: #7a82a0;
  }

  body.dark .reorder span {
    color: #8b93ad;
  }
}

@media (max-width: 300px) {
  body.dark .reorder {
    background: rgba(139, 123, 255, 0.05);
    color: #7f88a5;
  }

  body.dark .reorder i {
    color: #6d7593;
  }

  body.dark .reorder span {
    color: #7f88a5;
  }
}

/* ---- Reorder landscape — narrow height ---- */

@media (max-height: 500px) and (orientation: landscape) and (max-width: 425px) {
  .reorder {
    margin-top: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 9px;
    gap: 3px;
    line-height: 1.2;
  }

  .reorder i {
    font-size: 8px;
  }

  .reorder span {
    font-size: 9px;
    line-height: 1.2;
  }

  body.dark .reorder {
    background: rgba(139, 123, 255, 0.06);
    color: #8b93ad;
  }
}

/* ---- Reorder — very long text safety net ---- */

@media (max-width: 340px) {
  .reorder {
    max-height: 60px;
    overflow: hidden;
  }

  .reorder span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-width: 300px) {
  .reorder {
    max-height: 48px;
  }

  .reorder span {
    -webkit-line-clamp: 2;
  }
}
/* ============================================================
   .drop.has-file  — 600 px and below
   Keeps the card within .tool-box and all children in one row
   ============================================================ */

@media (max-width: 600px) {
  .drop.has-file {
    min-height: auto;
    padding: 0;
    border-style: solid;
    border-width: 1.5px;
    border-radius: 16px;
    overflow: hidden; /* clip children to rounded corners */
  }

  .drop.has-file .file-card {
    display: flex;
    flex-direction: row; /* force single row */
    flex-wrap: nowrap; /* never wrap trash to next line */
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0; /* allow children to shrink */
  }

  .drop.has-file .file-icon {
    flex-shrink: 0; /* icon never shrinks */
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 16px;
  }

  .drop.has-file .file-meta {
    flex: 1 1 0; /* takes all remaining space */
    min-width: 0; /* allows ellipsis to work */
    overflow: hidden;
  }

  .drop.has-file .file-name {
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .drop.has-file .file-size {
    font-size: 11px;
    color: var(--muted-2);
    white-space: nowrap;
  }

  .drop.has-file .trash {
    flex-shrink: 0; /* trash never shrinks or wraps */
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---- tighten further at 480 px ---- */
@media (max-width: 480px) {
  .drop.has-file .file-card {
    gap: 8px;
    padding: 10px 12px;
  }

  .drop.has-file .file-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 14px;
  }

  .drop.has-file .file-name {
    font-size: 12px;
  }

  .drop.has-file .file-size {
    font-size: 10.5px;
  }

  .drop.has-file .trash {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 12px;
  }
}

/* ---- tighten further at 380 px ---- */
@media (max-width: 380px) {
  .drop.has-file .file-card {
    gap: 7px;
    padding: 9px 10px;
  }

  .drop.has-file .file-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 13px;
  }

  .drop.has-file .file-name {
    font-size: 11px;
  }

  .drop.has-file .file-size {
    font-size: 9.5px;
  }

  .drop.has-file .trash {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 11px;
  }
}

/* ---- tighten further at 320 px ---- */
@media (max-width: 320px) {
  .drop.has-file .file-card {
    gap: 6px;
    padding: 8px;
  }

  .drop.has-file .file-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: 11px;
  }

  .drop.has-file .file-name {
    font-size: 10px;
  }

  .drop.has-file .file-size {
    font-size: 8.5px;
  }

  .drop.has-file .trash {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 10px;
  }
}

/* ---- coarse pointer (touch) — enforce minimum tap target ---- */
@media (pointer: coarse) and (max-width: 600px) {
  .drop.has-file .trash {
    min-width: 38px;
    min-height: 38px;
  }
}
/* ============================================================
   UPLOAD GRID + DROP.HAS-FILE — 520px down to 200px
   ============================================================ */

@media (max-width: 520px) {
  .upload-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .upload-zone {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .drop.has-file {
    min-height: auto !important;
    padding: 0 !important;
    border-style: solid !important;
    border-width: 1.5px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .drop.has-file .file-card {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .drop.has-file .file-icon {
    flex-shrink: 0 !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 11px !important;
    font-size: 16px !important;
  }

  .drop.has-file .file-meta {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .drop.has-file .file-name {
    font-size: 12.5px !important;
    font-weight: 700 !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .drop.has-file .file-size {
    font-size: 11px !important;
    white-space: nowrap !important;
    display: block !important;
  }

  .drop.has-file .trash {
    flex-shrink: 0 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* ============================================================
   475 px
   ============================================================ */

@media (max-width: 475px) {
  .upload-grid {
    gap: 12px !important;
  }

  .drop.has-file {
    border-radius: 14px !important;
  }

  .drop.has-file .file-card {
    gap: 9px !important;
    padding: 11px 12px !important;
  }

  .drop.has-file .file-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
  }

  .drop.has-file .file-name {
    font-size: 12px !important;
  }

  .drop.has-file .file-size {
    font-size: 10.5px !important;
  }

  .drop.has-file .trash {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
  }
}

/* ============================================================
   375 px
   ============================================================ */

@media (max-width: 375px) {
  .upload-grid {
    gap: 10px !important;
  }

  .drop.has-file {
    border-radius: 12px !important;
    border-width: 1px !important;
  }

  .drop.has-file .file-card {
    gap: 8px !important;
    padding: 9px 10px !important;
  }

  .drop.has-file .file-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
    font-size: 14px !important;
  }

  .drop.has-file .file-name {
    font-size: 11px !important;
  }

  .drop.has-file .file-size {
    font-size: 10px !important;
  }

  .drop.has-file .trash {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
  }
}

/* ============================================================
   320 px
   ============================================================ */

@media (max-width: 320px) {
  .upload-grid {
    gap: 8px !important;
  }

  .drop.has-file {
    border-radius: 10px !important;
    border-width: 1px !important;
  }

  .drop.has-file .file-card {
    gap: 6px !important;
    padding: 8px !important;
  }

  .drop.has-file .file-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
  }

  .drop.has-file .file-name {
    font-size: 10px !important;
  }

  .drop.has-file .file-size {
    font-size: 9px !important;
  }

  .drop.has-file .trash {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
  }
}

/* ============================================================
   200 px
   ============================================================ */

@media (max-width: 200px) {
  .upload-grid {
    gap: 6px !important;
  }

  .tool-box {
    padding: 10px !important;
    border-radius: 14px !important;
  }

  .drop.has-file {
    border-radius: 8px !important;
    border-width: 1px !important;
  }

  .drop.has-file .file-card {
    gap: 5px !important;
    padding: 6px !important;
  }

  .drop.has-file .file-icon {
    width: 22px !important;
    height: 22px !important;
    border-radius: 5px !important;
    font-size: 10px !important;
  }

  .drop.has-file .file-name {
    font-size: 8.5px !important;
  }

  .drop.has-file .file-size {
    font-size: 7.5px !important;
  }

  .drop.has-file .trash {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    border-radius: 5px !important;
    font-size: 9px !important;
  }
}

/* ============================================================
   Touch targets
   ============================================================ */

@media (pointer: coarse) and (max-width: 520px) {
  .drop.has-file .trash {
    min-width: 38px !important;
    min-height: 38px !important;
  }
}

@media (pointer: coarse) and (max-width: 320px) {
  .drop.has-file .trash {
    min-width: 32px !important;
    min-height: 32px !important;
  }
}
@media (max-width: 495px) {
  .toolbar-right {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Mode tabs take full width */
  .toolbar-right .mode-tabs {
    flex: 0 0 100%;
    width: 100%;
    order: 1;
  }

  /* Save PDF button goes to second row and fills width */
  .toolbar-right .download-btn {
    flex: 0 0 100%;
    width: 100%;
    order: 2;
    justify-content: center;
  }
}
@media (max-width: 495px) {
  .toolbar-right .mode-tabs {
    width: 100%;
    display: flex;
  }

  .toolbar-right .mode-tab {
    flex: 1;
    text-align: center;
  }
}
@media (max-width: 810px) {
  .toolbar-right {
    width: 100%;
  }

  .toolbar-right .mode-tabs {
    width: 100%;
    display: flex;
  }

  .toolbar-right .mode-tab {
    flex: 1;
    text-align: center;
  }
}
@media (max-width: 810px) {
  .toolbar-right {
    width: 100%;
  }

  .toolbar-right .mode-tabs {
    flex: 1;
    width: 100%;
  }
}
@media (max-width: 600px) {
  .page-container {
    padding-left: 0px !important;
    padding-right: 0px !important;
    padding-top: 0px !important;
  }
}
