.pdf-page {
  background:
    radial-gradient(circle at 82% 3%, rgba(231, 171, 143, .28), transparent 28rem),
    radial-gradient(circle at 7% 40%, rgba(159, 192, 177, .2), transparent 25rem),
    #f4f1ea;
}
.back-home { justify-self: end; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 750; }
.back-home span { color: var(--coral); margin-left: 4px; }
.pdf-main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 70px 0 110px; }
.pdf-hero { display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: center; gap: 70px; margin-bottom: 46px; }
.pdf-hero h1 { margin: 24px 0 17px; font-size: clamp(48px, 6vw, 76px); line-height: 1.02; letter-spacing: -.065em; }
.pdf-hero h1 em { color: #c95e43; font-family: Georgia, "Songti SC", serif; font-weight: 500; }
.pdf-hero > div > p { max-width: 680px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.paper-stack { position: relative; width: 200px; height: 190px; }
.paper { position: absolute; width: 132px; height: 168px; display: block; border: 1px solid rgba(83,69,60,.14); border-radius: 11px; background: #fffefa; box-shadow: 0 20px 42px rgba(59,45,37,.12); }
.paper i { position: absolute; right: 12px; bottom: 10px; color: #aaa198; font: italic 9px Georgia, serif; }
.paper-back { left: 45px; top: 5px; transform: rotate(9deg); background: #e7eee9; }
.paper-middle { left: 23px; top: 10px; transform: rotate(-5deg); background: #f3e4dc; }
.paper-front { left: 32px; top: 16px; padding: 22px 18px; transform: rotate(1deg); }
.paper-front b { display: inline-flex; border-radius: 7px; padding: 7px 8px; color: #fff; background: #d45f45; font-size: 12px; }
.paper-front em { display: block; width: 75%; height: 4px; margin-top: 14px; border-radius: 9px; background: #dad5cd; }
.paper-front em:nth-of-type(2) { width: 90%; margin-top: 8px; }
.paper-front em:nth-of-type(3) { width: 55%; margin-top: 8px; }

.pdf-workbench { position: relative; padding: 27px; border: 1px solid rgba(105,98,88,.2); border-radius: 28px; background: rgba(255,254,250,.84); box-shadow: 0 28px 75px rgba(54,47,37,.1), inset 0 1px #fff; backdrop-filter: blur(14px); }
.workbench-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 3px 4px 22px; }
.workbench-heading > div:first-child { display: grid; gap: 5px; }
.workbench-heading > div:first-child > span { color: #c05e47; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.workbench-heading h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.local-note { display: inline-flex; align-items: center; gap: 7px; color: #8c867e; font-size: 10px; }
.local-note i { width: 6px; height: 6px; border-radius: 50%; background: #4da57e; }
.pdf-empty[hidden], .pdf-editor[hidden], .import-status[hidden], .export-progress[hidden] { display: none; }
.pdf-drop-zone { min-height: 335px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #cfc7bc; border-radius: 21px; padding: 35px 20px; background: #f8f5ef; text-align: center; cursor: pointer; transition: border-color .18s, background .18s; }
.pdf-drop-zone:hover, .pdf-drop-zone.dragging { border-color: #cc6a50; background: #fff5f1; }
.pdf-drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-mark { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 19px 19px 19px 7px; color: #fff; background: #d7674e; box-shadow: 0 12px 25px rgba(197,83,58,.2); font-size: 28px; transform: rotate(-2deg); }
.pdf-drop-zone strong { font-size: 19px; letter-spacing: -.025em; }
.pdf-drop-zone p { margin: 8px 0 18px; color: #8d867d; font-size: 11px; }
.pdf-drop-zone em { border-radius: 9px; padding: 10px 15px; color: #fff; background: #292725; font-size: 10px; font-style: normal; font-weight: 800; }
.pdf-drop-zone small { margin-top: 12px; color: #aaa39a; font-size: 8px; }
.demo-button { display: flex; align-items: center; gap: 7px; border: 0; margin: 10px auto 0; padding: 7px 10px; color: #817a72; background: transparent; font-size: 9px; font-weight: 750; cursor: pointer; }
.demo-button span { color: #ca624a; }
.demo-button:hover { color: #b6533d; }
.empty-capabilities { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.empty-capabilities > span { min-height: 84px; display: grid; grid-template-columns: 33px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 10px; border: 1px solid #e4ded5; border-radius: 13px; padding: 12px; background: #fffefa; }
.empty-capabilities b { grid-row: 1 / 3; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #804333; background: #f0d4ca; font: 750 9px Georgia, serif; }
.empty-capabilities strong { align-self: end; font-size: 10px; }
.empty-capabilities small { align-self: start; margin-top: 3px; color: #9a938a; font-size: 8px; }

.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #e2ddd4; border-radius: 14px; padding: 11px 13px; background: #f7f4ee; }
.document-summary { display: flex; align-items: center; gap: 8px; }
.document-summary span, .document-summary small { border-radius: 7px; padding: 6px 8px; color: #777169; background: #ece8e1; font-size: 9px; }
.document-summary strong { color: #b6533d; font-size: 12px; }
.toolbar-actions { display: flex; gap: 6px; }
.toolbar-actions button, .add-files { min-height: 32px; display: inline-flex; align-items: center; border: 1px solid #d9d3ca; border-radius: 8px; padding: 0 10px; color: #615c55; background: #fffefa; font-size: 9px; font-weight: 800; cursor: pointer; }
.toolbar-actions button:disabled { opacity: .42; cursor: default; }
.add-files { color: #fff; background: #292725; border-color: #292725; }
.range-toolbar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin-top: 10px; border: 1px solid #e4ded5; border-radius: 14px; padding: 12px 13px; background: #fffefa; }
.range-toolbar > div:first-child { display: grid; gap: 3px; }
.range-toolbar > div:first-child strong { font-size: 10px; }
.range-toolbar > div:first-child span { color: #979087; font-size: 8px; }
.range-toolbar > div:nth-child(2) { display: grid; grid-template-columns: 170px auto; gap: 5px; }
.range-toolbar input { min-width: 0; height: 34px; border: 1px solid #d9d3ca; border-radius: 8px; outline: 0; padding: 0 10px; background: #f8f6f1; font-size: 9px; }
.range-toolbar input:focus { border-color: #cb6950; box-shadow: 0 0 0 3px rgba(203,105,80,.09); }
.range-toolbar button { border: 0; border-radius: 8px; padding: 0 11px; color: #fff; background: #bf5a43; font-size: 9px; font-weight: 800; cursor: pointer; }
.range-toolbar p { grid-column: 1 / -1; min-height: 0; margin: -4px 0 0; color: #c24734; font-size: 8px; }
.range-toolbar p:empty { display: none; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; gap: 12px; margin-top: 12px; }
.pages-panel, .export-panel { border: 1px solid #e1dcd3; border-radius: 18px; background: #fffefa; }
.pages-panel { min-width: 0; padding: 17px; }
.pages-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.pages-heading > div { display: grid; gap: 4px; }
.pages-heading span, .export-kicker { color: #c05e47; font-size: 8px; font-weight: 850; letter-spacing: .15em; }
.pages-heading h3, .export-panel h3 { margin: 0; font-size: 17px; }
.pages-heading small { color: #9b958d; font-size: 8px; }
.pages-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.page-card { position: relative; min-width: 0; border: 1px solid #ddd7ce; border-radius: 12px; padding: 7px; background: #f5f2ec; cursor: grab; transition: border-color .16s, transform .16s, box-shadow .16s; }
.page-card:hover { border-color: #c6bdb2; transform: translateY(-2px); box-shadow: 0 9px 20px rgba(51,44,36,.07); }
.page-card.dragging { opacity: .45; }
.page-card.drag-target { border-color: #c55f47; box-shadow: 0 0 0 3px rgba(197,95,71,.1); }
.page-thumb { position: relative; aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: #e7e2da; }
.page-thumb img { width: 100%; height: 100%; display: block; object-fit: contain; transition: transform .18s; }
.page-thumb img.rotate-90 { transform: rotate(90deg) scale(.74); }
.page-thumb img.rotate-180 { transform: rotate(180deg); }
.page-thumb img.rotate-270 { transform: rotate(270deg) scale(.74); }
.page-position { position: absolute; left: 5px; top: 5px; z-index: 2; min-width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: rgba(39,37,34,.84); font: 750 8px Georgia, serif; }
.page-type { position: absolute; right: 5px; top: 5px; z-index: 2; border-radius: 6px; padding: 4px 5px; color: #fff; background: rgba(191,90,67,.88); font-size: 6px; font-weight: 850; }
.page-meta { min-width: 0; display: grid; gap: 2px; padding: 8px 2px 6px; }
.page-meta strong { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.page-meta small { color: #9a938b; font-size: 7px; }
.page-actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.page-actions button { min-width: 0; height: 25px; border: 0; border-radius: 6px; color: #6f6961; background: #e9e5de; font-size: 9px; cursor: pointer; }
.page-actions button:hover { color: #fff; background: #3a3834; }
.page-actions button:disabled { opacity: .35; cursor: default; }
.page-actions .delete-page:hover { background: #c75640; }
.export-panel { position: sticky; top: 14px; padding: 20px; }
.export-panel h3 { margin-top: 6px; }
.export-panel > p { margin: 8px 0 20px; color: #8b857c; font-size: 9px; line-height: 1.6; }
.filename-field { display: grid; gap: 7px; color: #726c64; font-size: 8px; font-weight: 800; }
.filename-field > div { height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid #d9d3ca; border-radius: 10px; padding: 0 11px; background: #fff; }
.filename-field input { min-width: 0; border: 0; outline: 0; padding: 0; color: #45413b; background: transparent; font-size: 10px; }
.filename-field b { color: #aaa39a; font-size: 8px; }
.export-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.export-stats span { display: grid; gap: 4px; border-radius: 9px; padding: 10px; background: #f3f0ea; }
.export-stats small { color: #999289; font-size: 7px; }
.export-stats strong { color: #413d37; font: 750 16px Georgia, serif; }
.export-progress { margin: 10px 0; padding: 10px; border-radius: 9px; background: #f4f1eb; }
.export-progress > div { display: flex; justify-content: space-between; gap: 10px; color: #6c665f; font-size: 8px; }
.export-progress > p { height: 5px; overflow: hidden; margin: 7px 0 0; border-radius: 99px; background: #ddd7ce; }
.export-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: #c45d45; transition: width .2s; }
.export-button { width: 100%; min-height: 45px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 10px; color: #fff; background: #c45d45; font-size: 11px; font-weight: 850; cursor: pointer; box-shadow: 0 10px 22px rgba(186,78,55,.18); }
.export-button:hover { background: #ae4b36; }
.export-button:disabled { opacity: .58; cursor: wait; }
.export-button b { color: #ffd0c4; font-size: 15px; }
.export-note { display: block; margin-top: 10px; color: #aaa39a; font-size: 7px; line-height: 1.55; }
.import-status { position: absolute; inset: 76px 27px 27px; z-index: 10; display: flex; align-items: center; justify-content: center; gap: 14px; border: 1px solid rgba(222,215,205,.8); border-radius: 21px; background: rgba(255,254,250,.94); backdrop-filter: blur(8px); }
.import-spinner { width: 43px; height: 43px; border: 2px solid #e3ddd4; border-top-color: #c25c44; border-radius: 50%; animation: spin .8s linear infinite; }
.import-status div { display: grid; gap: 5px; }
.import-status strong { font-size: 12px; }
.import-status p { margin: 0; color: #918a82; font-size: 9px; }
.pdf-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.pdf-benefits article { min-height: 154px; padding: 21px; border: 1px solid rgba(111,103,92,.17); border-radius: 17px; background: rgba(255,254,250,.48); }
.pdf-benefits span { color: #c05e47; font: italic 11px Georgia, serif; }
.pdf-benefits strong { display: block; margin: 23px 0 7px; font-size: 14px; }
.pdf-benefits p { margin: 0; color: #7f7970; font-size: 11px; line-height: 1.65; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 30; padding: 11px 15px; border-radius: 10px; color: #fff; background: #242220; box-shadow: 0 12px 36px rgba(0,0,0,.2); font-size: 11px; font-weight: 750; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1040px) {
  .editor-layout { grid-template-columns: 1fr; }
  .export-panel { position: static; }
  .pages-grid { grid-template-columns: repeat(4, 1fr); }
  .export-panel { display: grid; grid-template-columns: 1.2fr 1fr; column-gap: 18px; }
  .export-panel > p, .export-note { grid-column: 1; }
  .filename-field, .export-stats, .export-progress, .export-button { grid-column: 2; }
  .filename-field { grid-row: 1 / 3; align-self: end; }
}
@media (max-width: 800px) {
  .empty-capabilities { grid-template-columns: repeat(2, 1fr); }
  .pages-grid { grid-template-columns: repeat(3, 1fr); }
  .range-toolbar { grid-template-columns: 1fr; }
  .range-toolbar > div:nth-child(2) { grid-template-columns: 1fr auto; }
  .pdf-hero { grid-template-columns: 1fr; }
  .paper-stack { display: none; }
}
@media (max-width: 620px) {
  .pdf-main { width: calc(100% - 24px); padding: 48px 0 76px; }
  .pdf-hero { margin-bottom: 30px; }
  .pdf-hero h1 { font-size: clamp(43px, 13vw, 61px); }
  .pdf-hero > div > p { font-size: 14px; }
  .pdf-workbench { padding: 13px; border-radius: 21px; }
  .workbench-heading { align-items: flex-start; flex-direction: column; padding: 8px 4px 17px; }
  .pdf-drop-zone { min-height: 300px; }
  .empty-capabilities { grid-template-columns: 1fr; }
  .editor-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions > * { flex: 1; justify-content: center; }
  .pages-grid { grid-template-columns: repeat(2, 1fr); }
  .pages-heading { align-items: flex-start; flex-direction: column; }
  .export-panel { display: block; }
  .filename-field, .export-stats, .export-progress, .export-button { margin-top: 10px; }
  .pdf-benefits { grid-template-columns: 1fr; }
  .pdf-benefits article { min-height: 130px; }
  .import-status { inset: 72px 13px 13px; }
}
@media (max-width: 400px) {
  .back-home { display: none; }
  .document-summary { flex-wrap: wrap; }
  .range-toolbar > div:nth-child(2) { grid-template-columns: 1fr; }
  .range-toolbar button { min-height: 34px; }
}
