@font-face {
  font-family: Manrope;
  src: url('/assets/manrope.woff2') format('woff2');
  font-display: swap;
  font-weight: 200 800;
}
:root {
  color-scheme: light;
  font-family: Manrope, system-ui, sans-serif;
  --paper: #f3f0f7;
  --ink: #251d32;
  --muted: #60566e;
  --line: #d9d0e2;
  --control: #82738e;
  --plum: #352545;
  --proof-text: #faf3ff;
  --proof-muted: #e2d2ee;
  --gold: #f8d786;
  --accent: #563374;
  color: var(--ink);
  background: var(--paper);
  accent-color: var(--accent);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--gold); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p, ol { margin: 0; }
h2 { font-size: 1.5rem; line-height: 1.24; }
h3 { font-size: 1.16rem; line-height: 1.3; }
p, li { line-height: 1.6; }
a { color: var(--accent); text-underline-offset: .2em; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 14px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; }
.brand img { flex: none; }
.sharing { position: relative; }
.share-panel { position: absolute; z-index: 2; top: calc(100% + 8px); right: 0; width: min(290px, calc(100vw - 35px)); padding: 14px; border: 1px solid var(--control); border-radius: 10px; background: #fff; }
.share-panel input { width: 100%; min-height: 44px; margin-top: 6px; padding: 8px; border: 1px solid var(--control); border-radius: 7px; font: inherit; }
.intro { padding-block: clamp(32px, 6vw, 62px) clamp(24px, 4vw, 38px); }
.intro h1 { font-size: clamp(2.55rem, 6vw, 5.25rem); line-height: .99; letter-spacing: -.04em; }
.intro p { max-width: 58ch; margin-top: 16px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.175rem); }

.workspace { display: grid; grid-template-columns: 1.08fr 1fr; align-items: start; gap: 18px; }
.workbench, .proof { min-width: 0; padding: clamp(16px, 3vw, 27px); border-radius: 16px; }
.workbench { border: 1px solid var(--line); background: #fff; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 14px; }

.button, select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--control);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
  font-weight: 800;
}
.button { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; text-align: center; line-height: 1.35; cursor: pointer; }
.button:hover { background: #f1eaf7; }
.button:disabled, .page-name:disabled { cursor: default; opacity: .61; }
.primary, .primary:hover { color: #221731; background: var(--gold); border-color: #9a6b24; }
.primary:hover { background: #ffe6a9; }
.primary:disabled { opacity: .7; }

.dropzone { min-height: 104px; display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px dashed var(--control); border-radius: 12px; background: #faf7fc; }
.dropzone.dragging, .dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; background: #f0e8f7; }
.pick-label { display: inline-block; color: var(--accent); font-weight: 800; font-size: 1.13rem; cursor: pointer; text-decoration: underline; text-underline-offset: .21em; }
.dropzone p, .order-note, .actions p, .download p { color: var(--muted); font-size: .9rem; }
.dropzone p { margin-top: 6px; }
.upload-icon { position: relative; flex: 0 0 30px; width: 30px; height: 37px; border: 2px solid var(--accent); border-radius: 5px; }
.upload-icon::before, .upload-icon::after { position: absolute; content: ''; top: 50%; left: 50%; translate: -50% -50%; background: var(--accent); border-radius: 1px; }
.upload-icon::before { width: 14px; height: 2px; }
.upload-icon::after { width: 2px; height: 14px; }
.problem { margin-top: 14px; padding: 10px 12px; border: 1px solid #a15362; border-radius: 8px; color: #812a3d; background: #fff0f1; overflow-wrap: anywhere; }
.order-note { margin-block: 14px 7px; }
.file-list { list-style: none; max-height: 21rem; overflow: auto; padding: 0 4px; scroll-padding-block: 7px; scrollbar-color: var(--control) #faf7fc; border-top: 1px solid var(--line); }
.preview-jump { display: none; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 10px; padding-block: 6px; border-bottom: 1px solid var(--line); }
.page-name { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 46px; padding: 5px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-weight: 800; font-size: .88rem; text-align: left; cursor: pointer; }
.page-name:hover, .page-name[aria-current='true'] { background: #f0e8f7; border-color: #a990b9; }
.page-num { min-width: 1.4em; color: var(--accent); font-variant-numeric: tabular-nums; }
.page-name img { flex: 0 0 27px; width: 27px; height: 31px; border-radius: 4px; object-fit: cover; }
.filename, #preview-name { overflow-wrap: anywhere; }
.row-controls { display: flex; flex-wrap: wrap; gap: 4px; }
.row-controls .button { padding-inline: 9px; font-size: .8rem; }
.remove-page { color: #6c2b42; }
.settings { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.settings label, .share-panel label { font-weight: 800; font-size: .9rem; }
.select-wrap { position: relative; max-width: 100%; }
.select-wrap::after { content: ''; width: 7px; height: 7px; position: absolute; right: 14px; top: 16px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); pointer-events: none; }
select { appearance: none; padding-right: 33px; max-width: 100%; }
.actions, .download { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.download p { font-weight: 800; color: var(--ink); }
.download-link { background: var(--plum); border-color: var(--plum); color: var(--proof-text); }
.download-link:hover { background: #4f3866; }

.proof { background: var(--plum); color: var(--proof-text); }
.proof :focus-visible { outline-color: var(--gold); }
.proof .panel-header span, .proof-footer p { font-size: .88rem; color: var(--proof-muted); }
.preview-stage { display: grid; place-items: center; min-height: 310px; padding: 16px; border: 1px solid #775e8d; border-radius: 10px; background: #473559; }
.empty-proof { display: grid; justify-items: center; gap: 12px; text-align: center; color: var(--proof-muted); }
.paper-stack { position: relative; width: 175px; height: 178px; }
.paper-front, .paper-back { position: absolute; width: 107px; height: 138px; border-radius: 7px; box-shadow: 0 7px 14px #21192e65; }
.paper-back { top: 15px; left: 48px; background: #d7c0e8; transform: rotate(13deg); }
.paper-front { top: 17px; left: 21px; padding: 12px; transform: rotate(-9deg); background: #fff9f0; }
.paper-photo { height: 54px; margin-bottom: 13px; border-radius: 4px; background: linear-gradient(148deg, #e3a369 15%, #f4cc90 65%); }
.paper-front i { display: block; width: 100%; height: 4px; margin-top: 7px; border-radius: 2px; background: #a28eb7; }
.paper-front i:last-child { width: 58%; }
.sheet { position: relative; width: min(100%, calc(275px * var(--ratio)), 325px); aspect-ratio: var(--ratio); background: #fff; box-shadow: 0 9px 22px #1f152d75; }
.sheet img { display: block; position: absolute; object-fit: fill; }
.proof-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 13px; }
.proof-footer p { min-width: 0; flex: 1 1 100px; }
.stepper { display: flex; flex-wrap: wrap; gap: 7px; }
.stepper .button { color: var(--proof-text); background: transparent; border-color: #ab93bb; }
.stepper .button:hover { background: #4f3866; }

.guide { max-width: 72ch; padding-block: clamp(32px, 6vw, 64px) 32px; }
.guide ol { padding-inline-start: 1.5em; margin-top: 10px; }
.guide li + li { margin-top: 5px; }
.guide p, .guide li { color: var(--muted); }
.guide strong { color: var(--ink); }
.guide h3 { margin-top: 22px; }
.guide p { margin-top: 7px; }
.footer { padding-block: 20px 35px; border-top: 1px solid var(--line); font-size: .9rem; font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; top: 8px; left: 8px; z-index: 2; padding: 10px; background: white; transform: translateY(-140%); }
.skip:focus { transform: none; }

@media (max-width: 850px) {
  .workspace { grid-template-columns: 1fr; }
  .wrap { width: calc(100% - 36px); }
  .preview-stage { min-height: 260px; }
  .preview-jump { display: inline; font-weight: 800; }
  .proof .preview-jump { color: var(--proof-text); font-size: .88rem; }
}
@media (max-width: 480px) {
  .file-row { grid-template-columns: minmax(0, 1fr); }
  .row-controls { margin-inline-start: 8px; }
  .panel-header .button { padding-inline: 9px; }
}
@media (max-width: 350px) {
  .wrap { width: calc(100% - 24px); }
  .workbench, .proof { padding: 13px; }
  .intro { padding-block-start: 25px; }
  .dropzone { gap: 10px; padding: 12px; }
  .button { font-size: .82rem; }
}
