:root {
  --blue: #1268f6;
  --blue-dark: #0953db;
  --ink: #0b1628;
  --muted: #61708a;
  --line: #e2eaf5;
  --soft-blue: #eff5ff;
  --shadow: 0 12px 32px rgba(31, 75, 141, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); font-family: Inter, Arial, sans-serif; background: radial-gradient(circle at 76% 19%, rgba(222, 236, 255, 0.68), transparent 24%), #fbfcff; }
button, input, select { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .dropzone:focus-visible { outline: 3px solid rgba(18, 104, 246, 0.32); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { width: 1em; height: 1em; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.site-shell { width: min(1300px, calc(100% - 64px)); margin: 0 auto; }
.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; }

.tool-header { position: relative; z-index: 10; height: 71px; border-bottom: 1px solid #e7edf6; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(13px); }
.header-inner { display: flex; align-items: center; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; font-size: 20px; font-weight: 800; letter-spacing: -0.8px; }
.brand > span:last-child span { color: var(--blue); }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; color: #fff; border-radius: 50%; background: linear-gradient(135deg, #247bff, #0951d6); box-shadow: 0 6px 14px rgba(18, 104, 246, 0.24); }
.brand-mark svg { width: 18px; height: 18px; }
.tool-nav { display: flex; align-items: center; gap: 34px; margin: 0 auto; font-size: 13px; font-weight: 600; }
.tool-nav a { display: inline-flex; align-items: center; gap: 4px; transition: color .2s ease; }
.tool-nav a:hover { color: var(--blue); }
.nav-down { width: 14px; height: 14px; }
.header-tools { display: flex; align-items: center; gap: 18px; }
.header-search { position: relative; display: flex; align-items: center; width: 358px; height: 39px; color: #71809a; border: 1px solid #d9e2ee; border-radius: 8px; background: #fff; }
.header-search input { width: 100%; height: 100%; padding: 0 39px 0 14px; color: var(--ink); font-size: 12px; border: 0; border-radius: inherit; background: transparent; outline: 0; }
.header-search input::placeholder { color: #78869d; }
.header-search svg { position: absolute; right: 13px; width: 18px; height: 18px; pointer-events: none; }
.login-button { min-width: 76px; height: 39px; padding: 0 16px; color: #fff; font-size: 12px; font-weight: 700; border: 0; border-radius: 7px; background: linear-gradient(135deg, #1d75fb, #105de8); box-shadow: 0 6px 13px rgba(18, 104, 246, .2); }
.mobile-menu { display: none; place-items: center; width: 38px; height: 38px; color: var(--ink); border: 0; border-radius: 7px; background: #f1f5fb; }
.mobile-menu svg { width: 21px; height: 21px; }

.breadcrumb { display: flex; align-items: center; gap: 13px; min-height: 55px; padding-top: 12px; color: #6c7d97; font-size: 12px; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb > svg { flex: 0 0 auto; width: 14px; height: 14px; color: #a1aec0; }
.breadcrumb a svg { width: 16px; height: 16px; }
.breadcrumb span[aria-current="page"] { color: #162137; font-weight: 600; }

.pdf-hero { padding: 39px 20px 24px; text-align: center; }
.tool-badge { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 15px; padding: 6px 11px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .03em; border-radius: 999px; background: #edf4ff; }
.tool-badge span { font-size: 9px; }
.pdf-hero h1 { max-width: 830px; margin: 0 auto; font-size: clamp(36px, 4vw, 51px); line-height: 1.1; letter-spacing: -2.3px; }
.pdf-hero h1 strong { color: var(--blue); font-weight: 800; }
.pdf-hero > p:not(.tool-badge) { max-width: 700px; margin: 14px auto 0; color: #5b6c87; font-size: 16px; line-height: 1.62; }
.format-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.format-pills span { padding: 6px 10px; color: #52647e; font-size: 10px; font-weight: 800; letter-spacing: .04em; border: 1px solid #e2eaf5; border-radius: 6px; background: rgba(255, 255, 255, .78); }

.converter-grid { display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 20px; align-items: stretch; }
.upload-card, .settings-card, .queue-card, .how-card, .uses-card { border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .96); box-shadow: var(--shadow); }
.upload-card { padding: 25px; }
.card-heading, .settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-heading > div, .settings-heading { min-width: 0; }
.card-heading > div:first-child, .settings-heading { display: flex; align-items: center; gap: 12px; }
.heading-icon, .settings-icon { display: grid; flex: 0 0 auto; place-items: center; width: 39px; height: 39px; color: var(--blue); border-radius: 11px; background: #eaf3ff; }
.heading-icon svg, .settings-icon svg { width: 22px; height: 22px; }
.card-heading h2, .settings-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.45px; }
.card-heading p, .settings-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.image-counter { flex: 0 0 auto; padding: 7px 9px; color: #4171b5; font-size: 10px; font-weight: 700; border-radius: 7px; background: #f0f6ff; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 246px; margin-top: 21px; padding: 25px; text-align: center; color: #5e6e88; border: 1.5px dashed #b7cbe8; border-radius: 11px; background: linear-gradient(135deg, #f7faff, #fbfdff); transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--blue); background: #eef6ff; }
.dropzone.is-dragging { transform: scale(1.01); }
.upload-symbol { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 13px; color: var(--blue); border-radius: 17px; background: #e8f2ff; box-shadow: 0 8px 18px rgba(18, 104, 246, .11); }
.upload-symbol svg { width: 29px; height: 29px; }
.dropzone strong { color: #18253b; font-size: 15px; }
.dropzone > span:not(.upload-symbol) { margin: 7px 0; color: #8492a6; font-size: 12px; }
.browse-button { display: inline-flex; align-items: center; height: 37px; padding: 0 16px; color: #fff; font-size: 12px; font-weight: 700; border-radius: 7px; background: linear-gradient(135deg, #2378fb, #0e5dea); box-shadow: 0 6px 12px rgba(18, 104, 246, .16); cursor: pointer; }
.dropzone small { margin-top: 13px; color: #7a89a0; font-size: 10px; }
.privacy-note { display: flex; align-items: center; gap: 8px; margin: 17px 0 0; color: #667690; font-size: 11px; line-height: 1.45; }
.privacy-note svg { flex: 0 0 auto; width: 17px; height: 17px; color: var(--blue); }
.privacy-note b { color: #36445a; }
.upload-status { min-height: 17px; margin: 8px 0 0; color: #61708a; font-size: 11px; text-align: center; }
.upload-status.is-error { color: #cc3550; }
.upload-status.is-success { color: #16764f; }

.settings-card { display: flex; flex-direction: column; padding: 25px; }
.settings-heading { align-items: center; }
.settings-fields { display: grid; gap: 15px; margin-top: 22px; }
.select-field, .name-field { display: grid; gap: 7px; color: #34435b; font-size: 11px; font-weight: 700; }
.select-field select, .name-field input { width: 100%; height: 42px; padding: 0 12px; color: #41516b; font-size: 12px; font-weight: 500; border: 1px solid #dbe5f1; border-radius: 7px; background: #fff; outline: 0; }
.select-field select { cursor: pointer; }
.select-field select:focus, .name-field input:focus { border-color: #7caeff; box-shadow: 0 0 0 3px rgba(18, 104, 246, .1); }
.name-field > div { position: relative; }
.name-field input { padding-right: 42px; }
.name-field b { position: absolute; top: 50%; right: 12px; color: #8794a7; font-size: 11px; font-weight: 600; transform: translateY(-50%); pointer-events: none; }
.generate-pdf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 45px; margin-top: auto; padding: 0 15px; color: #fff; font-size: 13px; font-weight: 700; border: 0; border-radius: 8px; background: linear-gradient(135deg, #2378fb, #0e5dea); box-shadow: 0 9px 17px rgba(18, 104, 246, .2); transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease; }
.generate-pdf svg { width: 19px; height: 19px; }
.generate-pdf:hover:not(:disabled) { box-shadow: 0 13px 22px rgba(18, 104, 246, .27); transform: translateY(-1px); }
.generate-pdf:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
.generate-pdf.is-loading svg { animation: spin 1s linear infinite; }
.settings-help { display: flex; align-items: flex-start; gap: 7px; margin: 13px 0 0; color: #697995; font-size: 10px; line-height: 1.45; }
.settings-help svg { flex: 0 0 auto; width: 14px; height: 14px; color: #187851; }

.queue-card { margin-top: 21px; padding: 24px; }
.queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.queue-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.5px; }
.queue-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.clear-button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; padding: 8px 10px; color: #a04a5a; font-size: 11px; font-weight: 700; border: 1px solid #f1dce1; border-radius: 7px; background: #fff8f9; }
.clear-button:hover { color: #8d3447; background: #fff1f3; }
.clear-button svg { width: 15px; height: 15px; }
.image-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 19px; }
.image-item { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 11px; align-items: center; min-width: 0; padding: 10px; border: 1px solid #e5edf7; border-radius: 10px; background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.image-item:hover { border-color: #c7dafa; box-shadow: 0 7px 18px rgba(31, 75, 141, .07); }
.image-thumb { display: grid; place-items: center; width: 76px; height: 76px; overflow: hidden; border-radius: 7px; background: repeating-conic-gradient(#edf2f9 0% 25%, #f9fbfe 0% 50%) 50% / 12px 12px; }
.image-thumb img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; transform: rotate(var(--image-turn, 0deg)); transition: transform .2s ease; }
.image-details { min-width: 0; }
.page-order { display: block; margin-bottom: 5px; color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.file-name { display: block; overflow: hidden; color: #26354c; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: block; margin-top: 4px; color: #7c8aa0; font-size: 10px; }
.item-actions { display: flex; gap: 5px; margin-top: 9px; }
.item-action { display: grid; place-items: center; width: 26px; height: 26px; color: #58708f; border: 1px solid #e2eaf5; border-radius: 6px; background: #f8fbff; }
.item-action:hover:not(:disabled) { color: var(--blue); border-color: #bdd5fb; background: #eef5ff; }
.item-action.remove:hover { color: #bd3d54; border-color: #f2d5dc; background: #fff4f5; }
.item-action:disabled { cursor: not-allowed; opacity: .35; }
.item-action svg { width: 15px; height: 15px; }

.ad-wrap { margin-top: 24px; }
.ad-slot { display: flex; align-items: center; justify-content: center; min-height: 52px; color: #94a1b5; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border: 1px dashed #dce6f2; border-radius: 10px; background: rgba(255, 255, 255, .5); }

.info-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: 20px; margin-top: 24px; }
.how-card, .uses-card { padding: 23px; }
.how-card h2, .uses-card h2 { margin: 0; font-size: 16px; letter-spacing: -.45px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.steps > div { position: relative; min-width: 0; padding-top: 47px; }
.steps > div:not(:last-child)::after { position: absolute; top: 20px; right: -8px; left: 48px; height: 1px; content: ""; border-top: 1px dashed #bdd3f3; }
.steps span { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 39px; height: 39px; color: var(--blue); font-size: 17px; font-weight: 800; border-radius: 50%; background: #eaf2ff; }
.steps b { display: block; color: #25344b; font-size: 11px; line-height: 1.3; }
.steps p { margin: 6px 0 0; color: #667691; font-size: 10px; line-height: 1.5; }
.uses-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 15px; }
.uses-grid > div { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid #e8eef7; border-radius: 9px; background: #fff; }
.uses-grid > div > span { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 9px; }
.uses-grid svg { width: 19px; height: 19px; }
.use-blue { color: var(--blue); background: #edf4ff; }
.use-purple { color: #8650e9; background: #f5efff; }
.use-green { color: #1aab69; background: #eafaf2; }
.uses-grid p { margin: 0; color: #697994; font-size: 10px; line-height: 1.45; }
.uses-grid b { display: block; margin-bottom: 2px; color: #25344b; font-size: 11px; }

.explore-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; margin-bottom: 30px; padding: 18px 70px; border-radius: 12px; background: linear-gradient(100deg, #eff6ff, #f8fbff); }
.explore-bar > div { display: flex; align-items: center; gap: 14px; }
.explore-mark { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; border-radius: 50%; background: linear-gradient(135deg, #2580ff, #0754df); }
.explore-mark svg { width: 19px; height: 19px; }
.explore-bar p { margin: 0; }
.explore-bar b { display: block; color: #1e2c43; font-size: 12px; }
.explore-bar b span { color: var(--blue); }
.explore-bar small { display: block; margin-top: 4px; color: #71809a; font-size: 10px; }
.explore-bar a { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; min-height: 39px; padding: 0 16px; color: #fff; font-size: 11px; font-weight: 700; border-radius: 7px; background: linear-gradient(135deg, #2378fb, #0e5dea); box-shadow: 0 7px 14px rgba(18, 104, 246, .17); }
.explore-bar a svg { width: 16px; height: 16px; }

.login-dialog { position: relative; width: min(390px, calc(100% - 32px)); padding: 34px; color: var(--ink); border: 0; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 16, 43, .3); }
.login-dialog::backdrop { background: rgba(2, 11, 25, .62); backdrop-filter: blur(3px); }
.login-dialog > button:first-child { position: absolute; top: 13px; right: 13px; display: grid; place-items: center; width: 35px; height: 35px; color: #5c6a80; border: 0; border-radius: 50%; background: #f2f6fb; }
.login-dialog > button:first-child svg { width: 18px; height: 18px; }
.dialog-icon { display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: 18px; color: #fff; border-radius: 13px; background: linear-gradient(145deg, #2582ff, #0753de); }
.dialog-icon svg { width: 28px; height: 28px; }
.login-dialog h2 { margin: 0; font-size: 22px; letter-spacing: -.8px; }
.login-dialog p { margin: 10px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-dialog > button:last-child { width: 100%; height: 44px; color: #fff; font-size: 13px; font-weight: 700; border: 0; border-radius: 8px; background: var(--blue); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; max-width: calc(100% - 32px); padding: 12px 18px; color: #fff; font-size: 13px; border-radius: 9px; background: #102039; box-shadow: 0 10px 30px rgba(0,0,0,.18); opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity .25s, transform .25s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .site-shell { width: min(1100px, calc(100% - 40px)); }
  .tool-nav { gap: 21px; }
  .header-search { width: 250px; }
  .image-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .tool-header { height: 62px; }
  .tool-nav { position: absolute; top: 62px; right: 0; left: 0; display: grid; gap: 0; max-height: 0; margin: 0; overflow: hidden; visibility: hidden; background: #09192b; box-shadow: 0 13px 25px rgba(0, 9, 20, .2); transition: max-height .28s ease, visibility .28s ease; }
  .tool-header.nav-open .tool-nav { max-height: 340px; visibility: visible; }
  .tool-nav a { padding: 14px 20px; color: #f5f8fd; border-bottom: 1px solid rgba(255,255,255,.07); }
  .header-tools { margin-left: auto; }
  .header-search { width: min(320px, 38vw); }
  .mobile-menu { display: grid; }
  .converter-grid { grid-template-columns: 1fr; }
  .settings-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .name-field { grid-column: span 2; }
  .generate-pdf { margin-top: 20px; }
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-shell { width: min(100% - 32px, 560px); }
  .brand { font-size: 18px; }
  .brand-mark { width: 27px; height: 27px; }
  .header-tools { gap: 10px; }
  .header-search { display: none; }
  .login-button { min-width: 64px; height: 36px; padding: 0 12px; }
  .breadcrumb { gap: 10px; min-height: 51px; overflow: auto; white-space: nowrap; }
  .breadcrumb > svg { width: 12px; height: 12px; }
  .pdf-hero { padding: 27px 0 20px; text-align: left; }
  .tool-badge { margin-bottom: 12px; }
  .pdf-hero h1 { font-size: clamp(34px, 10vw, 43px); letter-spacing: -1.8px; }
  .pdf-hero > p:not(.tool-badge) { margin-left: 0; font-size: 14px; }
  .format-pills { justify-content: flex-start; margin-top: 14px; }
  .upload-card, .settings-card, .queue-card, .how-card, .uses-card { border-radius: 12px; }
  .upload-card, .settings-card { padding: 18px; }
  .card-heading p, .settings-heading p { font-size: 11px; }
  .image-counter { display: none; }
  .dropzone { min-height: 225px; margin-top: 17px; padding: 20px; }
  .dropzone strong { font-size: 14px; }
  .settings-fields { grid-template-columns: 1fr; margin-top: 18px; }
  .name-field { grid-column: auto; }
  .queue-card { padding: 18px; }
  .queue-heading { align-items: flex-start; }
  .queue-heading p { font-size: 11px; line-height: 1.45; }
  .clear-button { padding: 7px; font-size: 0; }
  .clear-button svg { width: 17px; height: 17px; }
  .image-list { grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
  .image-item { grid-template-columns: 70px minmax(0, 1fr); }
  .image-thumb { width: 70px; height: 70px; }
  .info-grid { gap: 14px; margin-top: 18px; }
  .how-card, .uses-card { padding: 19px; }
  .steps { grid-template-columns: 1fr 1fr; gap: 18px 16px; }
  .steps > div { padding-top: 44px; }
  .steps > div:not(:last-child)::after { display: none; }
  .steps span { width: 36px; height: 36px; }
  .explore-bar { align-items: flex-start; flex-direction: column; margin-top: 15px; margin-bottom: 22px; padding: 18px; }
  .explore-bar a { width: 100%; justify-content: center; }
}

@media (max-width: 390px) {
  .site-shell { width: calc(100% - 24px); }
  .login-button { display: none; }
  .card-heading h2, .settings-heading h2 { font-size: 15px; }
  .heading-icon, .settings-icon { width: 35px; height: 35px; }
  .dropzone { min-height: 210px; }
  .format-pills { gap: 6px; }
  .format-pills span { padding: 5px 7px; font-size: 9px; }
  .privacy-note { align-items: flex-start; }
}
