:root {
  --ink: #f1f1f1;
  --muted: rgba(214, 214, 214, 0.82);
  --line: rgba(240, 240, 240, 0.22);
  --line-strong: rgba(245, 245, 245, 0.58);
  --panel: rgba(10, 10, 10, 0.74);
  --panel-soft: rgba(12, 12, 12, 0.6);
  --surface: linear-gradient(165deg, rgba(20, 20, 20, 0.92), rgba(6, 6, 6, 0.96));
  --accent: #ffb97a;
  --accent-strong: #ff9a42;
  --accent-dark: #7b4b2a;
  --shadow-lg: 0 22px 48px rgba(0, 0, 0, 0.48);
  --radius-xl: 28px;
  --radius-lg: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", "Aptos", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 92%, rgba(0, 0, 0, 0.58), transparent 56%),
    radial-gradient(circle at 14% -2%, rgba(255, 154, 72, 0.42), transparent 42%),
    radial-gradient(circle at 82% 8%, rgba(255, 190, 136, 0.14), transparent 34%),
    linear-gradient(145deg, #7a3f1c 0%, #5b2d16 36%, #2a170f 58%, #111111 80%, #060606 100%);
  padding: 24px 16px 36px;
}

body.has-site-footer {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

body.has-site-footer .app {
  flex: 1 0 auto;
  min-height: 100svh;
}

/* Top navigation button visuals are shared in ../../src/styles/top-nav.global.css */

.app {
  max-width: 980px;
  margin: 22px auto 0;
}

.hero {
  text-align: center;
  margin-bottom: 22px;
}

.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffbf86;
  font-size: 0.74rem;
  margin: 0 0 8px;
}

h1 {
  margin: 0;
  color: #f7f4ef;
  font-size: clamp(1.65rem, 4vw, 2.38rem);
  line-height: 1.14;
}

.subtitle {
  margin: 12px auto 0;
  max-width: 700px;
  font-size: 18px;
  color: var(--muted);
  line-height: 1.58;
}

.donate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #005ea6;
  background: linear-gradient(180deg, #007fd1 0%, #0070ba 100%);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.donate-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #0089df 0%, #0078c8 100%);
  box-shadow: 0 10px 22px rgba(0, 69, 129, 0.36);
}

.donate-wrap {
  display: flex;
  justify-content: center;
  margin: 18px auto 20px;
}

@media (min-width: 769px) {
  .app {
    max-width: 1260px;
  }

  body.has-site-footer .app {
    padding-bottom: 46px;
  }

  .donate-wrap {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 44;
    display: block;
    margin: 0;
  }

  .donate-button {
    white-space: nowrap;
  }
}

.mobile_quick_nav {
  display: none;
}

.card {
  width: 100vw;
  max-width: 100vw;
  margin: 24px calc(50% - 50vw) 0;
  width: 100dvw;
  max-width: 100dvw;
  margin: 24px calc(50% - 50dvw) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  background:
    linear-gradient(162deg, rgba(11, 11, 13, 0.72), rgba(6, 6, 8, 0.84)),
    radial-gradient(circle at 88% 0%, rgba(248, 165, 86, 0.12), transparent 44%),
    radial-gradient(circle at 12% 110%, rgba(255, 255, 255, 0.04), transparent 42%);
  border: 1px solid rgba(236, 184, 123, 0.28);
  border-top-color: rgba(255, 227, 194, 0.4);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(9px);
  padding: clamp(16px, 4vw, 28px);
  padding-top: calc(clamp(16px, 4vw, 28px) + 36px);
  padding-bottom: calc(clamp(16px, 4vw, 28px) + 36px);
  color: var(--ink);
}

.card > .drop-zone,
.card > .preview-panel {
  margin-top: 0;
  min-height: 100%;
}

.drop-zone {
  min-height: 220px;
  border: 1px solid rgba(240, 178, 104, 0.44);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  background:
    linear-gradient(164deg, rgba(13, 20, 31, 0.92), rgba(9, 14, 23, 0.95)),
    radial-gradient(circle at 88% 0%, rgba(248, 165, 86, 0.12), transparent 44%);
  box-shadow:
    0 20px 38px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 230, 203, 0.08);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
  outline: none;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragover {
  border-color: rgba(255, 214, 167, 0.86);
  transform: translateY(-1px);
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.42),
    0 0 20px rgba(246, 167, 90, 0.2),
    inset 0 1px 0 rgba(255, 236, 212, 0.12);
}

.drop-content {
  text-align: center;
  padding: 16px;
}

.drop-title {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 650;
  color: #f5e2cc;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drop-title-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(240, 178, 104, 0.48);
  background:
    linear-gradient(160deg, rgba(13, 20, 31, 0.86), rgba(9, 14, 23, 0.9)),
    radial-gradient(circle at 14% 10%, rgba(248, 165, 86, 0.12), transparent 56%);
  box-shadow: inset 0 1px 0 rgba(255, 230, 203, 0.1);
}

.drop-title-icon {
  font-size: 1.35rem;
  color: rgba(244, 199, 139, 0.96);
  flex: 0 0 auto;
}

.drop-separator {
  margin: 10px 0;
  color: rgba(242, 234, 224, 0.78);
}

.pick-button,
.download-button,
.secondary-button {
  border: 1px solid rgba(240, 240, 240, 0.26);
  border-radius: 999px;
  font: inherit;
  font-weight: 620;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pick-button {
  padding: 10px 18px;
  border-radius: 12px;
  border-color: rgba(252, 193, 129, 0.86);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 232, 203, 0.22), transparent 56%),
    linear-gradient(150deg, rgba(44, 29, 21, 0.94), rgba(17, 26, 40, 0.9));
  color: #fff1d8;
  box-shadow:
    0 10px 20px rgba(5, 10, 18, 0.32),
    0 0 14px rgba(246, 167, 90, 0.18),
    inset 0 1px 0 rgba(255, 233, 204, 0.16);
}

.pick-button:hover,
.download-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  border-color: rgba(236, 247, 255, 0.7);
}

.list-panel,
.preview-panel {
  margin-top: 18px;
  background:
    linear-gradient(164deg, rgba(13, 20, 31, 0.88), rgba(9, 14, 23, 0.92)),
    radial-gradient(circle at 88% 0%, rgba(248, 165, 86, 0.1), transparent 44%);
  border: 1px solid rgba(240, 178, 104, 0.42);
  box-shadow:
    0 16px 28px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 230, 203, 0.1);
  border-radius: 14px;
  padding: 14px;
}

.list-panel h2,
.preview-panel h2 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(244, 209, 169, 0.94);
}

.page-summary {
  margin: 0 0 10px;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(242, 234, 224, 0.74);
}

.preview-panel h2 {
  width: 100%;
  text-align: center;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(236, 177, 109, 0.36);
  border-radius: 10px;
  background: rgba(17, 17, 17, 0.72);
}

.file-meta {
  min-width: 0;
}

.file-name {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f0f0f0;
}

.file-info {
  margin: 2px 0 0;
  color: rgba(196, 196, 196, 0.8);
  font-size: 0.76rem;
}

.file-remove {
  border: 1px solid rgba(240, 240, 240, 0.28);
  background: rgba(15, 15, 15, 0.92);
  color: #ededed;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.74rem;
  cursor: pointer;
}

.status-text {
  margin: 10px 0 0;
  font-size: 0.84rem;
  color: rgba(242, 234, 224, 0.72);
  width: 100%;
  text-align: center;
}

.list-status-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.list-status-row .status-text {
  margin: 0;
  flex: 1 1 auto;
  width: auto;
  text-align: left;
}

.list-clear-button {
  flex: 0 0 auto;
  margin-left: auto;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.76rem;
  border-radius: 999px;
  line-height: 1.1;
  white-space: nowrap;
}

.aspect-mode {
  width: 100%;
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(240, 178, 104, 0.32);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(13, 20, 31, 0.62), rgba(9, 14, 23, 0.74));
}

.aspect-mode[hidden] {
  display: none;
}

.aspect-mode legend {
  padding: 0 6px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(244, 209, 169, 0.94);
}

.aspect-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.84rem;
  line-height: 1.35;
  color: rgba(242, 234, 224, 0.82);
  cursor: pointer;
}

.aspect-mode-option:first-of-type {
  margin-top: 4px;
}

.aspect-mode-option input[type="radio"] {
  margin-top: 1px;
  accent-color: #7c4d2a;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.download-name-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 360px);
  min-height: 62px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.download-name-label {
  font-size: 1.08rem;
  color: rgba(210, 210, 210, 0.86);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.download-name {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.42rem;
  font-weight: 700;
  color: #f0f0f0;
}

.download-name-ext {
  opacity: 0.88;
}

.edit-name-button {
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #efefef;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}

.edit-name-button:hover {
  transform: translateY(-1px) scale(1.05);
  color: #ffffff;
}

.edit-name-button .material-symbols-outlined {
  font-size: 30px;
  line-height: 1;
}

.download-button {
  width: min(100%, 360px);
  min-height: 62px;
  padding: 0 16px;
  background: linear-gradient(180deg, #9b6338 0%, #7c4d2a 100%);
  color: #fff7ea;
  border-color: #6a3f21;
  font-size: 1.18rem;
}

.secondary-button {
  padding: 11px 18px;
  border-color: rgba(252, 193, 129, 0.72);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 232, 203, 0.2), transparent 56%),
    linear-gradient(150deg, rgba(44, 29, 21, 0.86), rgba(10, 10, 12, 0.9));
  color: #fff1d8;
  box-shadow:
    0 10px 18px rgba(5, 10, 18, 0.28),
    inset 0 1px 0 rgba(255, 233, 204, 0.14);
}

.preview-pdf-button {
  min-width: 250px;
}

.download-button:disabled,
.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.preview-download {
  width: 100%;
  margin-top: 12px;
}

.preview-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.preview-panel {
  min-height: 210px;
  display: flex;
  flex-direction: column;
}

.preview-panel img {
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(236, 177, 109, 0.34);
  background: linear-gradient(160deg, rgba(12, 16, 24, 0.86), rgba(8, 12, 18, 0.92));
  display: none;
}

.preview-panel img.has-image {
  display: block;
  background: linear-gradient(160deg, rgba(10, 15, 24, 0.9), rgba(7, 11, 18, 0.94));
  max-height: none;
  height: auto;
}

#previewCanvas {
  width: min(256px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid rgba(236, 177, 109, 0.36);
  display: block;
  margin: 0 auto;
  background: linear-gradient(160deg, rgba(12, 16, 24, 0.86), rgba(8, 12, 18, 0.92));
}

.actions {
  grid-column: 1 / -1;
}

@media (min-width: 769px) {
  .card {
    width: 100vw;
    max-width: 100vw;
    width: 100dvw;
    max-width: 100dvw;
    margin-top: 39px;
    grid-template-columns: repeat(2, minmax(0, clamp(360px, 42vw, 760px)));
    justify-content: center;
    gap: clamp(16px, 1.6vw, 24px);
    padding: clamp(22px, 2.6vw, 34px);
    padding-top: calc(clamp(22px, 2.6vw, 34px) + 38px);
    padding-bottom: calc(clamp(22px, 2.6vw, 34px) + 38px);
  }

  .drop-zone {
    min-height: 290px;
  }

  .preview-panel {
    min-height: 290px;
    padding: 18px;
  }

  .drop-title {
    font-size: clamp(1.28rem, 1.02rem + 0.85vw, 1.62rem);
  }

  .drop-separator {
    font-size: 1.04rem;
  }

  .pick-button {
    padding: 12px 24px;
    font-size: 1.02rem;
  }

  .preview-panel h2 {
    font-size: 1rem;
  }

  #previewCanvas {
    width: min(320px, 100%);
  }

  .status-text {
    font-size: 0.92rem;
  }

  .actions {
    margin-top: 22px;
  }

  .download-name-wrap {
    width: 360px;
    min-height: 64px;
    padding: 0 12px;
  }

  .download-button {
    width: 360px;
    min-height: 64px;
    padding: 0 16px;
    font-size: 1.18rem;
  }
}

@media (max-width: 760px) {
  .card {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 24px 0 0;
  }

  .card > .preview-panel {
    margin-top: 18px;
  }
  .mobile_quick_nav,
  .mobile_quick_nav * {
    box-sizing: border-box;
  }

  .app {
    width: 100%;
    max-width: 100%;
    margin-top: 56px;
    overflow-x: hidden;
  }
  .mobile_quick_nav {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile_quick_home {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(242, 176, 98, 0.58);
    background: linear-gradient(145deg, rgba(24, 17, 15, 0.86), rgba(13, 23, 41, 0.8));
    color: #f0c987;
    text-decoration: none;
    box-shadow: 0 7px 16px rgba(3, 8, 17, 0.3), 0 1px 0 rgba(255, 224, 189, 0.09) inset;
  }

  .mobile_quick_home .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
    color: #ffffff;
  }

  .mobile_quick_menu_wrap {
    position: relative;
  }

  .mobile_quick_toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(242, 176, 98, 0.58);
    background: linear-gradient(145deg, rgba(24, 17, 15, 0.86), rgba(13, 23, 41, 0.8));
    color: #f0c987;
    font-family: "Sora", "IBM Plex Sans", sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .mobile_quick_toggle .material-symbols-outlined {
    font-size: 19px;
    line-height: 1;
    color: #ffffff;
  }

  .mobile_quick_menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    right: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 146px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(240, 170, 88, 0.5);
    background:
      linear-gradient(155deg, rgba(18, 12, 10, 0.9), rgba(8, 14, 26, 0.86)),
      radial-gradient(circle at 14% 10%, rgba(237, 141, 52, 0.18), transparent 58%);
    box-shadow:
      0 12px 26px rgba(4, 9, 18, 0.38),
      0 1px 0 rgba(255, 219, 180, 0.09) inset;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
  }

  .mobile_quick_nav.open .mobile_quick_menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .mobile_quick_item {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    border: 1px solid rgba(242, 176, 98, 0.5);
    background: linear-gradient(145deg, rgba(33, 25, 22, 0.7), rgba(19, 31, 53, 0.62));
    box-shadow:
      0 6px 14px rgba(3, 8, 17, 0.28),
      0 1px 0 rgba(255, 224, 189, 0.08) inset;
    color: #ffd7ad;
    text-decoration: none;
    font-family: "Sora", "IBM Plex Sans", sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.045em;
    text-transform: uppercase;
  }

  .mobile_quick_item .material-symbols-outlined {
    font-size: 18px;
    color: #ffffff;
  }

  .drop-zone {
    min-height: 190px;
  }

  .actions {
    flex-direction: column;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .donate-wrap {
    position: static;
    top: auto;
    right: auto;
    margin-top: 16px;
    margin-bottom: 14px;
  }
}

/* PDF Merger specific */
.card {
  min-height: 78vh;
}

.card > .list-panel {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.pdf-preview-panel {
  margin-top: 0;
  min-height: 290px;
  display: flex;
  flex-direction: column;
}

.pdf-preview-scroller {
  width: 100%;
  min-height: 250px;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  border: 1px solid rgba(240, 178, 104, 0.36);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(12, 18, 28, 0.8), rgba(8, 12, 19, 0.9));
}

.pdf-preview-page {
  margin: 0 auto 14px;
  width: min(100%, 760px);
}

.pdf-preview-page:last-child {
  margin-bottom: 0;
}

.pdf-preview-page-label {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(244, 209, 169, 0.94);
}

.pdf-preview-canvas {
  width: 100%;
  height: auto;
  border: 1px solid rgba(236, 177, 109, 0.34);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(10, 15, 24, 0.9), rgba(7, 11, 18, 0.94));
  display: block;
}

.file-item {
  align-items: flex-start;
  flex-wrap: wrap;
  row-gap: 10px;
}

.file-meta {
  flex: 1 1 260px;
  min-width: 0;
}

.file-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}

.file-order-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.file-order-btn {
  border: 1px solid rgba(240, 240, 240, 0.26);
  border-radius: 8px;
  background: rgba(16, 16, 16, 0.84);
  color: rgba(233, 233, 233, 0.92);
  font-size: 0.8rem;
  line-height: 1;
  padding: 8px 14px;
  cursor: pointer;
}

.file-order-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.file-scale-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.file-scale-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(220, 220, 220, 0.8);
}

.file-scale-size {
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: rgba(228, 228, 228, 0.88);
}

.file-scale-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.file-scale-input {
  flex: 1 1 280px;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 6px;
  accent-color: #9b6338;
}

.file-scale-value {
  min-width: 56px;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(236, 236, 236, 0.92);
}

.file-remove {
  align-self: flex-start;
  max-width: 100%;
  padding: 8px 14px;
  font-size: 0.82rem;
}

.global-scale-wrap {
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid rgba(160, 126, 89, 0.38);
  border-radius: 12px;
  background: rgba(16, 16, 16, 0.62);
}

.global-scale-label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(224, 224, 224, 0.88);
}

.global-scale-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-scale-input {
  flex: 1;
  min-width: 220px;
  height: 6px;
  accent-color: #9b6338;
}

.global-scale-value {
  min-width: 58px;
  text-align: right;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(236, 236, 236, 0.94);
}

#downloadButton,
#previewPdfButton {
  min-height: 56px;
  padding: 0 18px;
}

#downloadButton {
  min-width: 320px;
}

.actions {
  margin-top: 24px;
  gap: 16px 14px;
  padding-bottom: 14px;
}

@media (min-width: 761px) {
  .file-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 48%);
    align-items: start;
    gap: 12px 22px;
    padding: 11px 13px;
  }

  .file-meta {
    grid-column: 1;
    align-self: start;
  }

  .file-item-controls {
    grid-column: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    width: 100%;
    margin-left: 0;
    gap: 8px 12px;
    align-items: start;
  }

  .file-order-row {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    justify-content: flex-end;
    justify-self: end;
    align-self: start;
    gap: 10px;
  }

  .file-scale-wrap {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    justify-self: start;
  }

  .file-remove {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: end;
  }
}

@media (max-width: 760px) {
  .card {
    min-height: 84vh;
  }

  .file-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .file-meta {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }

  .file-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .file-item-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    align-items: flex-start;
    margin-left: 0;
  }

  .file-order-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .file-scale-wrap {
    align-items: flex-start;
    width: 100%;
  }

  .file-scale-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .file-scale-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .file-scale-value {
    text-align: right;
  }

  .file-remove {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
  }

  .file-order-btn {
    width: 100%;
    justify-self: stretch;
  }
}



