:root {
  color-scheme: light;
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-soft: #fbfaf8;
  --text: #20242b;
  --muted: #6f737b;
  --line: #e7e2dc;
  --line-strong: #d5cec6;
  --accent: #e5322d;
  --accent-dark: #c9231e;
  --accent-soft: #fff1ef;
  --danger: #c62828;
  --shadow: 0 18px 50px rgba(35, 31, 27, 0.08);
  --shadow-hover: 0 24px 60px rgba(35, 31, 27, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 180px, rgba(255,255,255,.95), transparent 420px),
    var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(229,50,45,.2);
  outline-offset: 2px;
}

.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.app-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 52px);
  border-bottom: 1px solid rgba(45, 40, 35, .08);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-weight: 850;
  font-size: 18px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}
.brand-icon svg { width: 18px; height: 18px; stroke-width: 2.2; }

.privacy-note { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.privacy-note svg { width: 16px; height: 16px; color: #4f7d58; }

.app-main {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(42px, 7vh, 82px) 0 120px;
}

.screen { animation: enter .22s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }

.picker-heading, .upload-heading {
  max-width: 720px;
  margin: 0 auto 36px;
  text-align: center;
}

.eyebrow, .section-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.picker-heading h1, .upload-heading h1, .workspace-topbar h1 {
  margin: 0;
  letter-spacing: 0;
}

.picker-heading h1, .upload-heading h1 {
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.05;
}

.picker-heading p, .upload-heading p, .workspace-topbar p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.primary-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  min-height: 170px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  color: var(--text);
  text-align: left;
  box-shadow: 0 1px 0 rgba(35,31,27,.04);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: #f1b9b6;
  box-shadow: var(--shadow-hover);
}

.tool-symbol {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}
.tool-symbol svg { width: 22px; height: 22px; stroke-width: 1.9; }

.tool-card-copy { display: grid; gap: 8px; }
.tool-card-copy strong { font-size: 19px; }
.tool-card-copy small { color: var(--muted); line-height: 1.5; }
.tool-arrow { color: var(--muted); }
.tool-arrow svg { width: 19px; height: 19px; }

.secondary-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.mini-tool {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  color: var(--text);
  text-align: left;
}

.mini-tool:hover { background: #fff; border-color: var(--line-strong); }
.mini-tool > svg { width: 19px; height: 19px; color: var(--accent); flex: 0 0 auto; }
.mini-tool > span { display: grid; gap: 4px; }
.mini-tool small { color: var(--muted); font-size: 12px; }

.back-button, .text-button {
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}
.back-button:hover, .text-button:hover { color: var(--text); }
.back-button { margin-bottom: 28px; }
.danger-text { color: var(--danger); }

.upload-dropzone {
  min-height: 380px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px;
  border: 2px dashed #d9d2ca;
  border-radius: 8px;
  background: rgba(255,255,255,.84);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.upload-dropzone.is-dragging { border-color: var(--accent); background: #fff8f7; }
.upload-dropzone:hover { border-color: var(--line-strong); background: #fff; }
.upload-dropzone:focus-visible { outline: 3px solid rgba(229,50,45,.2); outline-offset: 4px; }
.upload-dropzone strong { font-size: 24px; }
.upload-dropzone > span { color: var(--muted); }
.upload-file-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}
.upload-file-icon svg { width: 30px; height: 30px; stroke-width: 1.8; }

.trust-row {
  max-width: 760px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 12px;
}
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row svg { width: 15px; height: 15px; color: #4f7d58; }

.primary-button, .secondary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border-radius: 8px;
  font-weight: 800;
}
.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 26px rgba(229,50,45,.22);
}
.primary-button:hover:not(:disabled) { background: var(--accent-dark); }
.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}
.secondary-button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-soft); }

.workspace-screen { display: grid; gap: 18px; }
.workspace-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 6px;
}
.workspace-topbar h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.06; }
.workspace-top-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.surface {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}

.surface-heading, .control-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.surface-heading strong { display: block; font-size: 17px; }
.surface-heading small { display: block; margin-top: 4px; color: var(--muted); }
.section-kicker { margin-bottom: 5px; color: #9a8d82; }
.control-title-row h2 { margin: 0; font-size: 24px; }

.doc-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.doc-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.doc-card.is-active { border-color: #f0aaa7; background: var(--accent-soft); }
.doc-select { display: grid; gap: 4px; padding: 0; background: transparent; color: var(--text); text-align: left; }
.doc-select strong { overflow-wrap: anywhere; }
.doc-select small { color: var(--muted); }
.doc-actions { display: flex; gap: 5px; }
.icon-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
}
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }

.tool-controls { display: grid; gap: 16px; }
.quick-controls { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.inline-field { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.inline-field input { width: 64px; }

.field { display: grid; gap: 7px; max-width: 520px; }
.field > span { color: var(--muted); font-size: 13px; font-weight: 750; }
input[type="text"], input[type="number"], select {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229,50,45,.12); }
.inline-field input[type="number"] { width: 64px; flex: 0 0 64px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.quality-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quality-card { position: relative; }
.quality-card input { position: absolute; opacity: 0; }
.quality-card span {
  min-height: 90px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.quality-card small { color: var(--muted); }
.quality-card input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(229,50,45,.09); }
.compression-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  gap: 28px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.compression-main { display: grid; gap: 13px; }
.compression-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.compression-heading-row > div { display: grid; gap: 4px; }
.compression-heading-row small, .compression-estimate small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.compression-strength { flex: 0 0 auto; color: var(--accent); font-size: 13px; font-weight: 850; }
.compression-slider {
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.compression-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent) 0 var(--compression-progress, 28%), #e8e3dd var(--compression-progress, 28%) 100%);
}
.compression-slider::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 3px solid #fff;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--accent);
  box-shadow: 0 2px 7px rgba(83, 39, 35, .22);
}
.compression-slider::-moz-range-track { height: 6px; border-radius: 999px; background: #e8e3dd; }
.compression-slider::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.compression-slider::-moz-range-thumb { width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 7px rgba(83, 39, 35, .22); }
.compression-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.compression-estimate {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 92px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}
.compression-estimate.is-estimating strong { color: var(--muted); }
.estimate-label { color: var(--muted); font-size: 12px; font-weight: 750; }
.compression-estimate strong { color: var(--text); font-size: 28px; letter-spacing: 0; }
.target-size-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
}
.target-size-field { max-width: none; }
.target-input-wrap { position: relative; }
.target-input-wrap input { padding-right: 46px; }
.target-input-wrap span { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--muted); font-size: 13px; font-weight: 750; pointer-events: none; }
.target-apply { min-width: 104px; }
.target-feedback { align-self: center; margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.notice { margin: 0; padding: 13px 14px; border-radius: 8px; background: #fff8ef; color: #74665a; font-size: 13px; line-height: 1.55; }

.split-plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.split-card { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.split-card-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 220px); gap: 10px; align-items: center; }
.split-card-title { font-weight: 850; }
.split-card-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.thumb-strip { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; }
.thumb { flex: 0 0 48px; display: grid; gap: 3px; justify-items: center; color: var(--muted); font-size: 10px; }
.thumb img, .thumb-placeholder { width: 44px; height: 58px; object-fit: contain; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.thumb-placeholder { display: grid; place-items: center; }

.selection-actions { display: flex; gap: 12px; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.page-card { display: grid; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.page-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.page-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229,50,45,.1); }
.page-card.is-removed { opacity: .48; background: #fff2f1; }
.page-preview { min-height: 210px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: #f3f0ec; }
.page-preview img { max-width: 100%; height: auto; background: #fff; box-shadow: 0 8px 22px rgba(35,31,27,.14); transform: rotate(var(--rotation,0deg)); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.page-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; }
.page-label input { width: 17px; height: 17px; accent-color: var(--accent); }
.page-badge { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 7px; border-radius: 999px; background: #f1eeea; color: var(--muted); font-size: 10px; }
.page-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.page-actions .icon-button { width: 100%; }
.cut-button { min-height: 36px; border-radius: 999px; background: #f4efea; color: #766b62; font-weight: 750; }
.cut-button:hover { background: var(--accent-soft); color: var(--accent); }
.cut-button.is-active { background: var(--accent); color: #fff; }

body[data-tool="split"] .page-label input,
body[data-tool="compress"] .page-label input,
body[data-tool="merge"] .page-label input,
body:not([data-tool="edit"]) .page-actions { display: none; }
body[data-tool="merge"] .pages-section,
body[data-tool="compress"] .pages-section { display: none; }

.output-section { border-color: #f2bbb8; }
.result-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.result-card { display: grid; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.result-card strong { overflow-wrap: anywhere; }
.result-card small { color: var(--muted); }
.download-link { text-decoration: none; }

.action-dock {
  position: sticky;
  bottom: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid rgba(45,40,35,.09);
  border-radius: 10px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(35,31,27,.14);
}
.status { display: flex; align-items: center; gap: 9px; min-width: 0; padding-left: 6px; color: var(--muted); font-size: 13px; }
.status[data-tone="error"] { color: var(--danger); }
.status[data-tone="ok"] { color: #43704b; }
.spinner { display: none; width: 17px; height: 17px; border: 2px solid rgba(229,50,45,.18); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.status.is-busy .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.action-button { min-width: 150px; min-height: 48px; }

@media (max-width: 820px) {
  .privacy-note { display: none; }
  .primary-tools { grid-template-columns: 1fr; }
  .tool-card { min-height: 118px; }
  .secondary-tools { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workspace-topbar { align-items: flex-start; flex-direction: column; }
  .form-grid, .quality-options { grid-template-columns: 1fr; }
  .compression-workbench, .target-size-row { grid-template-columns: 1fr; }
  .compression-estimate { min-height: 0; padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .target-feedback { margin: 0; }
  .split-card-head { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .app-main { width: min(100% - 20px, 1160px); padding-top: 34px; }
  .app-header { padding-inline: 14px; }
  .secondary-tools { grid-template-columns: 1fr; }
  .upload-dropzone { min-height: 330px; padding: 28px 18px; }
  .surface { padding: 16px; border-radius: 8px; }
  .page-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .page-preview { min-height: 150px; }
  .action-dock { align-items: stretch; flex-direction: column; }
  .action-button { width: 100%; }
}

/* ToolExact PDF product pages */
.pdf-product-page {
  --bg: #faf9f8;
  --surface: #ffffff;
  --surface-soft: #fbf8f7;
  --text: #1d2733;
  --muted: #667386;
  --line: #e7dfdb;
  --line-strong: #d8cbc5;
  --accent: #d94a38;
  --accent-dark: #b9382a;
  --accent-soft: #fff0ed;
  --danger: #b42318;
  --shadow: 0 18px 52px rgb(65 47 37 / 0.09);
  --shadow-hover: 0 22px 56px rgb(65 47 37 / 0.13);
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.pdf-product-page .site-header {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.pdf-product-page main.pdf-page-main {
  width: min(100% - 42px, 1180px);
  margin: 0 auto;
  padding-bottom: 84px;
}

.pdf-product-page .pdf-page-main .breadcrumb {
  display: none;
}

.pdf-product-page .pdf-page-main .breadcrumb a {
  color: #697686;
  text-decoration: none;
}

.pdf-product-hero {
  padding: clamp(24px, 4vw, 42px) 24px 24px;
  text-align: center;
}

.pdf-category-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 850;
}

.pdf-product-hero h1 {
  max-width: 900px;
  margin: 0 auto;
  color: var(--text);
  font-size: clamp(38px, 5vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.pdf-product-hero > div > p:last-child {
  max-width: 680px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.5;
}

.pdf-stage {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.pdf-stage-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.pdf-stage-heading > div {
  display: grid;
  gap: 6px;
}

.pdf-stage-heading span,
.section-kicker,
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.pdf-stage-heading h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
}

.pdf-stage-heading > p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.pdf-stage .upload-heading h2,
.workspace-topbar h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 4vw, 40px);
}

.pdf-stage .upload-heading {
  margin: 0;
}

.pdf-stage .upload-dropzone {
  max-width: 920px;
  min-height: 292px;
  gap: 10px;
  padding: 38px 28px;
  border: 1px solid #eadeda;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 54px rgb(65 47 37 / 0.1);
}

.pdf-stage .upload-dropzone:hover,
.pdf-stage .upload-dropzone.is-dragging {
  border-color: var(--accent);
  background: #fff9f7;
}

.pdf-stage .upload-file-icon {
  width: 58px;
  height: 58px;
  margin-bottom: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}

.pdf-stage .upload-dropzone strong {
  color: var(--text);
  font-size: clamp(21px, 2.2vw, 25px);
  letter-spacing: -0.01em;
}

.pdf-stage .upload-dropzone > span:not(.upload-file-icon):not(.primary-button) {
  color: var(--muted);
  font-size: 14px;
}

body.pdf-product-page .primary-button {
  border-radius: 10px;
  background-color: var(--accent);
  background-image: none;
  color: #ffffff;
  box-shadow: 0 10px 24px rgb(217 74 56 / 0.22);
}

body.pdf-product-page .primary-button:hover {
  background-color: var(--accent-dark);
}

body.pdf-product-page .upload-dropzone > .primary-button {
  min-height: 54px;
  margin-top: 8px;
  padding: 0 28px;
  background-color: var(--accent) !important;
  color: #ffffff !important;
  font-size: 16px;
}

body.pdf-product-page .secondary-button,
body.pdf-product-page .text-button {
  border-color: var(--line);
  background: #fff8f6;
  color: var(--accent-dark);
}

body.pdf-product-page .text-button {
  background: transparent;
}

.pdf-product-page .danger-button,
.pdf-product-page .danger-text {
  color: var(--danger);
}

.pdf-product-page .surface {
  border-color: var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
}

.pdf-product-page .workspace-screen {
  gap: 18px;
}

.pdf-product-page .workspace-topbar {
  padding: 0 2px 6px;
}

.pdf-product-page .control-title-row h3,
.image-options h3,
.html-options h3 {
  margin: 0;
  font-size: 23px;
}

.pdf-product-page input[type="text"],
.pdf-product-page input[type="number"],
.pdf-product-page select,
.pdf-product-page textarea {
  border-color: var(--line);
  background: #fbfdff;
}

.pdf-product-page input:focus,
.pdf-product-page select:focus,
.pdf-product-page textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(217 74 56 / 0.13);
}

.pdf-product-page .doc-card,
.pdf-product-page .split-card,
.pdf-product-page .result-card {
  border-color: var(--line);
  background: var(--surface-soft);
}

.pdf-product-page .doc-card.is-active {
  border-color: #e8a79f;
  background: var(--accent-soft);
}

.pdf-product-page .page-card {
  border-color: var(--line);
}

.pdf-product-page .page-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(217 74 56 / 0.11);
}

.pdf-product-page .page-preview {
  background: #f1eeec;
}

.pdf-product-page .page-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pdf-product-page .page-actions .icon-button {
  min-height: 31px;
  width: auto;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 750;
}

.pdf-product-page .action-dock {
  bottom: 16px;
  border-color: rgb(231 223 219 / 0.94);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.94);
  box-shadow: 0 16px 44px rgb(30 41 59 / 0.14);
}

.pdf-start-over {
  display: none;
}

.pdf-stage .trust-row {
  max-width: 920px;
  gap: 18px 28px;
  margin-top: 18px;
  color: #667085;
  font-size: 13px;
}

.pdf-stage .trust-row svg {
  color: #27835a;
}

.pdf-related-tools {
  width: 100%;
  max-width: 100%;
  margin: 64px 0 56px;
  padding: 36px 0 0;
  border: 0;
  border-top: 1px solid #e7dfdb !important;
  border-radius: 0;
  background: transparent !important;
  overflow: visible;
}

.pdf-related-tools h2 {
  color: var(--text);
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.02em;
}

.pdf-product-page .pdf-related-tools .mini-tool-grid {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.pdf-product-page .pdf-related-tools .mini-tool-grid a {
  min-width: 0;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: #485568;
  box-shadow: 0 1px 2px rgb(65 47 37 / 0.03);
  overflow-wrap: anywhere;
}

.pdf-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 34px;
}

.pdf-guide-grid article {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.pdf-guide-grid h3,
.pdf-use-case-list h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
}

.pdf-guide-grid p,
.pdf-use-case-list p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.pdf-use-case-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdf-use-case-list li {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.pdf-product-page .faq-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.pdf-product-page .faq-item {
  min-width: 0;
}

.pdf-product-page .pdf-related-tools .mini-tool-grid a + a {
  border-top: 1px solid var(--line);
}

.pdf-product-page .pdf-related-tools .mini-tool-grid a:hover {
  border-color: #e6b1aa;
  color: var(--accent-dark);
  transform: translateY(-1px);
}

.pdf-product-page .seo-section,
.pdf-product-page .faq-section {
  border-color: var(--line);
}

.pdf-product-page .seo-section h2,
.pdf-product-page .faq-section h2,
.pdf-product-page .seo-card h3,
.pdf-product-page .faq-item h3 {
  color: var(--text);
}

.pdf-product-page .seo-card,
.pdf-product-page .mistake-list li,
.pdf-product-page .faq-item {
  border-color: var(--line);
  background: #ffffff;
  box-shadow: none;
}

.pdf-product-page .mistake-list li::before {
  background: var(--accent);
}

.pdf-product-page .expanded-footer .footer-columns a:hover {
  color: var(--accent-dark);
}

.image-workspace,
.image-pdf-editor,
.html-pdf-editor {
  display: grid;
  gap: 22px;
}

.image-file-list {
  display: grid;
  gap: 10px;
}

.image-file-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.image-file-card > img {
  width: 88px;
  height: 72px;
  object-fit: contain;
  border-radius: 8px;
  background: #eef2f7;
}

.image-file-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.image-file-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-file-copy small {
  color: var(--muted);
}

.image-file-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.image-action {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #45546a;
  font-size: 12px;
  font-weight: 750;
}

.image-action:hover {
  border-color: var(--line-strong);
  color: var(--accent);
}

.image-action.is-danger {
  color: var(--danger);
}

.image-options,
.html-options {
  display: grid;
  gap: 20px;
}

.conversion-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.conversion-result > div {
  display: grid;
  gap: 5px;
}

.conversion-result small {
  color: var(--muted);
}

.conversion-result .primary-button {
  text-decoration: none;
}

.html-editor-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.html-editor-toolbar > div:first-child {
  display: grid;
  gap: 6px;
}

.html-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.html-source-field,
.html-preview-panel {
  overflow: hidden;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.html-source-field textarea {
  width: 100%;
  height: 100%;
  min-height: 480px;
  padding: 20px;
  border: 0;
  border-radius: 0;
  resize: vertical;
  color: #233047;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}

.html-preview-panel {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
}

.html-preview-panel .panel-label {
  border-bottom: 1px solid var(--line);
}

#html-pdf-preview {
  width: 100%;
  height: 100%;
  min-height: 430px;
  border: 0;
  background: #ffffff;
}

.html-render-surface {
  position: fixed;
  left: -20000px;
  top: 0;
  z-index: -1;
  overflow: visible;
  min-height: 1px;
  background: #ffffff;
}

.html-render-content {
  overflow: visible;
  min-height: 1px;
  background: #ffffff;
}

@media (max-width: 820px) {
  .pdf-product-page .site-header {
    grid-template-columns: auto 1fr;
  }

  .pdf-product-hero {
    grid-template-columns: 1fr;
  }

  .pdf-privacy-note {
    max-width: 520px;
  }

  .pdf-stage-heading,
  .html-editor-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .image-file-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .image-file-card > img {
    width: 72px;
    height: 62px;
  }

  .image-file-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .html-editor-grid {
    grid-template-columns: 1fr;
  }

  .pdf-product-page .pdf-related-tools .mini-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdf-guide-grid,
  .pdf-use-case-list,
  .pdf-product-page .faq-list {
    grid-template-columns: 1fr;
  }

  .html-source-field,
  .html-source-field textarea,
  .html-preview-panel {
    min-height: 380px;
  }

  #html-pdf-preview {
    min-height: 330px;
  }
}

@media (max-width: 560px) {
  .pdf-product-page main.pdf-page-main {
    width: min(100% - 20px, 1180px);
  }

  .pdf-product-page .pdf-page-main .breadcrumb {
    display: none;
  }

  .pdf-product-hero {
    padding: 28px 8px 20px;
  }

  .pdf-stage {
    padding: 0;
  }

  .pdf-product-hero h1 {
    font-size: clamp(34px, 11vw, 44px);
  }

  .pdf-stage .upload-dropzone {
    min-height: 260px;
    padding: 28px 18px;
  }

  .pdf-stage-heading > p {
    display: none;
  }

  .pdf-product-page .pdf-privacy-note,
  .pdf-product-page .pdf-stage-heading {
    display: none;
  }

  .conversion-result {
    align-items: stretch;
    flex-direction: column;
  }

  .pdf-related-tools {
    margin-top: 48px;
    padding-top: 28px;
  }

  .pdf-product-page .pdf-related-tools .mini-tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdf-product-page *,
  .pdf-product-page *::before,
  .pdf-product-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
