:root {
  --pdfi-ink: #171717;
  --pdfi-muted: #6f7075;
  --pdfi-paper: #f8f7f3;
  --pdfi-card: #fff;
  --pdfi-line: #e6e3dc;
  --pdfi-blue: #315cff;
  --pdfi-blue-dark: #244bd9;
  --pdfi-blue-soft: #edf2ff;
  --pdfi-lime: #b8f23d;
  --pdfi-green: #177a55;
  --pdfi-red: #b44040;
  --pdfi-shadow: 0 18px 48px rgba(30, 50, 90, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--pdfi-ink);
  background: radial-gradient(circle at 8% 17%, rgba(203, 222, 255, .48), transparent 20rem), radial-gradient(circle at 91% 8%, rgba(222, 232, 255, .55), transparent 19rem), var(--pdfi-paper);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", "Noto Sans SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { touch-action: manipulation; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(49, 92, 255, .32); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.wrap { width: min(1200px, calc(100% - 32px)); margin-inline: auto; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(248, 247, 243, .9); border-bottom: 1px solid rgba(230, 227, 220, .8); backdrop-filter: blur(14px); }
.nav { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 20px; }
.navlinks { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.navlinks a { padding: 8px 11px; border-radius: 9px; color: var(--pdfi-muted); text-decoration: none; }
.navlinks .lang { color: var(--pdfi-ink); font-weight: 700; }

.hero { padding: clamp(40px, 6vw, 66px) 0 34px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(38px, 6vw, 62px); line-height: 1.06; letter-spacing: -.055em; }
.hero p { max-width: 700px; margin: 16px auto 0; color: var(--pdfi-muted); font-size: clamp(16px, 2vw, 18px); line-height: 1.7; }
.trust-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 23px; }
.trust-tag { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid #e5e7ec; border-radius: 999px; background: rgba(255, 255, 255, .76); color: #556070; font-size: 13px; }
.trust-tag b { color: var(--pdfi-green); font-size: 14px; }

.workspace { margin-bottom: 56px; overflow: hidden; border: 1px solid var(--pdfi-line); border-radius: 24px; background: rgba(255, 255, 255, .94); box-shadow: var(--pdfi-shadow); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); }
.upload-side, .control-side { min-width: 0; padding: 28px; }
.upload-side { border-right: 1px solid var(--pdfi-line); }
.section-title { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; font-size: 18px; letter-spacing: -.02em; }
.section-number { display: inline-grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: var(--pdfi-blue-soft); color: var(--pdfi-blue); font-size: 13px; }
.upload-zone { display: grid; min-height: 232px; place-items: center; padding: 28px; border: 1.5px dashed #b9cdfb; border-radius: 17px; background: linear-gradient(135deg, #fbfdff, #f5f8ff); text-align: center; transition: .18s ease; }
.upload-zone.is-dragging { border-color: var(--pdfi-blue); background: #edf3ff; transform: scale(.995); }
.upload-zone.is-hidden { display: none; }
.upload-icon { display: grid; width: 50px; height: 50px; place-items: center; margin: 0 auto 10px; border-radius: 14px; background: var(--pdfi-blue-soft); color: var(--pdfi-blue); font-size: 24px; font-weight: 800; }
.upload-zone h2 { margin: 0; font-size: 19px; }
.upload-zone p, .upload-formats { margin: 6px 0 15px; color: var(--pdfi-muted); font-size: 14px; }
.upload-formats { margin: 12px 0 0; font-size: 12px; }
.primary-button, .secondary-button, .ghost-button, .icon-button, .tile-button { border: 0; border-radius: 11px; font-weight: 750; cursor: pointer; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.primary-button { padding: 12px 18px; color: #fff; background: var(--pdfi-blue); box-shadow: 0 7px 17px rgba(49, 92, 255, .22); }
.primary-button:hover { background: var(--pdfi-blue-dark); transform: translateY(-1px); }
.secondary-button { padding: 12px 16px; color: var(--pdfi-blue); border: 1px solid #b8c9f7; background: #fff; }
.secondary-button:hover { background: #f4f7ff; }
.ghost-button { padding: 8px 11px; color: #596475; border: 1px solid var(--pdfi-line); background: #fff; }
.ghost-button:hover { color: var(--pdfi-blue); border-color: #b8c9f7; }
.primary-button:disabled, .secondary-button:disabled, .ghost-button:disabled, .tile-button:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.file-panel { display: none; }
.file-panel.is-visible { display: block; }
.file-summary { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 16px; border: 1px solid #dfe6f4; border-radius: 16px; background: #f8faff; }
.file-icon { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 13px; color: var(--pdfi-blue); background: #eaf0ff; font-size: 22px; font-weight: 800; }
.file-summary strong, .result-meta strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.file-summary span, .result-meta span { display: block; margin-top: 3px; color: var(--pdfi-muted); font-size: 12px; }
.file-actions { display: flex; gap: 8px; }
.status, .progress-copy { min-height: 21px; margin: 13px 0 0; color: var(--pdfi-muted); font-size: 13px; line-height: 1.5; }
.status[data-state="error"] { color: var(--pdfi-red); font-weight: 700; }
.status[data-state="success"] { color: var(--pdfi-green); font-weight: 700; }
.status[data-state="warning"] { color: #9a6700; }
.progress-shell { display: none; margin-top: 16px; }
.progress-shell.is-visible { display: block; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e8edf8; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--pdfi-blue); transition: width .2s ease; }

.setting-group + .setting-group { margin-top: 23px; padding-top: 22px; border-top: 1px solid var(--pdfi-line); }
.setting-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.setting-heading h3 { margin: 0; font-size: 15px; }
.setting-heading p { margin: 0; color: var(--pdfi-muted); font-size: 12px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segment { min-height: 50px; padding: 8px; border: 1px solid #e1e5ed; border-radius: 12px; color: #536176; background: #fff; cursor: pointer; text-align: center; }
.segment:hover { border-color: #aabefb; background: #f8faff; }
.segment.is-active { border-color: var(--pdfi-blue); box-shadow: 0 0 0 2px rgba(49, 92, 255, .1); color: var(--pdfi-blue); background: #f8faff; }
.segment strong { display: block; font-size: 13px; }
.segment small { display: block; margin-top: 2px; color: var(--pdfi-muted); font-size: 11px; }
.page-mode-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-button { min-height: 44px; padding: 8px; border: 1px solid #e1e5ed; border-radius: 11px; color: #536176; background: #fff; cursor: pointer; font-size: 13px; font-weight: 700; }
.mode-button.is-active { border-color: var(--pdfi-blue); box-shadow: 0 0 0 2px rgba(49, 92, 255, .1); color: var(--pdfi-blue); background: #f8faff; }
.range-field { display: none; margin-top: 11px; }
.range-field.is-visible { display: block; }
.range-field label { display: block; margin-bottom: 6px; color: #566174; font-size: 12px; font-weight: 700; }
.range-field input { width: 100%; padding: 11px 12px; border: 1px solid #d7dfea; border-radius: 10px; color: var(--pdfi-ink); background: #fff; }
.range-help { min-height: 18px; margin: 7px 0 0; color: var(--pdfi-muted); font-size: 12px; }
.range-help.is-error { color: var(--pdfi-red); font-weight: 600; }
.selection-tools { display: none; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; }
.selection-tools.is-visible { display: flex; }
.selection-tools p { margin: 0; color: var(--pdfi-muted); font-size: 12px; }
.selection-tools div { display: flex; gap: 6px; }
.small-action { padding: 6px 8px; border: 0; color: var(--pdfi-blue); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.convert-area { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 24px; }
.convert-area .primary-button { min-height: 52px; }
.convert-area .secondary-button { min-height: 52px; }

.thumb-section { padding: 0 28px 28px; border-top: 1px solid var(--pdfi-line); }
.thumb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-top: 22px; }
.thumb-head .section-title { margin-bottom: 0; }
.selection-summary { color: var(--pdfi-muted); font-size: 13px; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 11px; margin-top: 15px; }
.thumb-card { position: relative; min-height: 152px; overflow: hidden; border: 1px solid #e2e6ee; border-radius: 12px; background: #f3f5f9; cursor: pointer; text-align: left; }
.thumb-card:hover { border-color: #aabefb; }
.thumb-card.is-selected { border-color: var(--pdfi-blue); box-shadow: 0 0 0 2px rgba(49, 92, 255, .18); }
.thumb-card img { display: block; width: 100%; height: 124px; object-fit: contain; background: #edf0f5; }
.thumb-card .thumb-number { display: flex; align-items: center; justify-content: space-between; padding: 8px 9px; color: var(--pdfi-muted); font-size: 12px; font-weight: 700; }
.thumb-card .thumb-check { display: grid; width: 18px; height: 18px; place-items: center; border: 1px solid #c7cedc; border-radius: 50%; color: transparent; background: #fff; font-size: 11px; }
.thumb-card.is-selected .thumb-check { border-color: var(--pdfi-blue); color: #fff; background: var(--pdfi-blue); }
.thumbnail-pending { display: grid; min-height: 152px; place-items: center; color: var(--pdfi-muted); border: 1px dashed #d7dce5; border-radius: 12px; font-size: 12px; }

.results { padding: 56px 0 72px; }
.results-shell { display: none; }
.results-shell.is-visible { display: block; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.results-heading h2 { margin: 0; font-size: clamp(26px, 4vw, 32px); letter-spacing: -.035em; }
.results-heading p { margin: 0; color: var(--pdfi-muted); font-size: 13px; }
.results-actions { display: flex; gap: 9px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 14px; }
.result-card { overflow: hidden; border: 1px solid var(--pdfi-line); border-radius: 15px; background: #fff; }
.result-card img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: contain; background: #f0f2f6; }
.result-meta { padding: 12px; }
.tile-button { width: 100%; margin-top: 10px; padding: 9px; color: var(--pdfi-blue); border: 1px solid #b8c9f7; background: #fff; font-size: 12px; }
.tile-button:hover { background: #f4f7ff; }

.content { padding: 8px 0 70px; }
.content-card { max-width: 920px; margin: 0 auto; padding: 38px; border: 1px solid var(--pdfi-line); border-radius: 21px; background: rgba(255, 255, 255, .86); }
.content-card + .content-card { margin-top: 18px; }
.content h2 { margin: 0 0 12px; font-size: clamp(25px, 4vw, 32px); letter-spacing: -.035em; }
.content h3 { margin: 28px 0 8px; font-size: 17px; }
.content p, .content li { color: #555e6b; font-size: 15px; line-height: 1.75; }
.content p { margin: 0; }
.content ol, .content ul { margin: 10px 0 0; padding-left: 1.25rem; }
.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 23px; }
.format-grid article { padding: 16px; border: 1px solid #e7eaf0; border-radius: 14px; background: #fbfcff; }
.format-grid strong { display: block; margin-bottom: 5px; font-size: 15px; }
.format-grid span { color: var(--pdfi-muted); font-size: 13px; line-height: 1.55; }
.privacy-box { margin-top: 23px; padding: 16px 18px; border: 1px solid #ccebdd; border-radius: 14px; color: #35715a; background: #f5fcf8; font-size: 14px; line-height: 1.65; }
.privacy-box strong { color: #1a6044; }
.faq { border-top: 1px solid var(--pdfi-line); }
.faq details { padding: 16px 0; border-bottom: 1px solid var(--pdfi-line); }
.faq summary { position: relative; padding-right: 28px; cursor: pointer; font-size: 16px; font-weight: 750; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { position: absolute; right: 2px; content: "+"; color: var(--pdfi-blue); font-size: 20px; font-weight: 500; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 10px; }
.related-link { display: inline-flex; margin-top: 19px; padding: 10px 13px; border-radius: 10px; color: var(--pdfi-blue); background: #f0f4ff; font-size: 14px; font-weight: 750; text-decoration: none; }
.footer { padding: 32px 0 52px; border-top: 1px solid var(--pdfi-line); color: var(--pdfi-muted); font-size: 13px; text-align: center; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--pdfi-blue); }
.brand-foot { color: var(--pdfi-ink); font-weight: 800; }
.ad-slot[hidden] { display: none !important; }

@media (max-width: 860px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .upload-side { border-right: 0; border-bottom: 1px solid var(--pdfi-line); }
}
@media (max-width: 640px) {
  .wrap { width: min(100% - 22px, 1200px); }
  .nav { gap: 8px; }
  .navlinks { gap: 2px; }
  .navlinks a { padding: 7px 8px; }
  .hero { padding-top: 32px; }
  .hero p { font-size: 15px; }
  .trust-tags { gap: 7px; }
  .trust-tag { padding: 6px 9px; font-size: 12px; }
  .workspace { margin-bottom: 34px; border-radius: 18px; }
  .upload-side, .control-side { padding: 18px 14px; }
  .thumb-section { padding: 0 14px 18px; }
  .section-title { font-size: 16px; }
  .upload-zone { min-height: 210px; }
  .file-summary { grid-template-columns: 44px minmax(0, 1fr); }
  .file-icon { width: 44px; height: 44px; }
  .file-actions { grid-column: 1 / -1; }
  .file-actions button { flex: 1; }
  .segmented, .page-mode-group { gap: 6px; }
  .segment, .mode-button { min-height: 54px; }
  .segment strong, .mode-button { font-size: 12px; }
  .selection-tools { align-items: flex-start; flex-direction: column; }
  .convert-area { grid-template-columns: 1fr; }
  .thumb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thumb-card { min-height: 171px; }
  .thumb-card img { height: 141px; }
  .results { padding: 42px 0 50px; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .results-actions { width: 100%; }
  .results-actions button { flex: 1; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .content { padding-bottom: 48px; }
  .content-card { padding: 25px 19px; border-radius: 17px; }
  .format-grid { grid-template-columns: 1fr; }
}
