:root {
  color-scheme: light;
  --ink: #272c2b;
  --muted: #73786f;
  --line: #e7e7e1;
  --accent: #bb5739;
  --accent-dark: #9e452b;
  --sage: #89977a;
  --paper: #fff;
  --error: #a52c2c;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f5f4f0;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; font-size: 14px; line-height: 1.55; }
button, input, select { font: inherit; }
button, input, select { accent-color: var(--accent); }
button { cursor: pointer; }
button:disabled { opacity: .42; cursor: not-allowed; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #bb5739; outline-offset: 4px; }
.shell { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.site-header { background: #fafaf7; border-bottom: 1px solid var(--line); }
.nav { height: 82px; display: flex; align-items: center; gap: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 720; font-size: 25px; letter-spacing: -1.3px; text-decoration: none; line-height: 1; }
.brand-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: white; transform: rotate(-4deg); }
.brand-icon .icon { width: 25px; height: 25px; }
.brand-period { color: var(--accent); }
.nav-links { display: flex; gap: 30px; height: 100%; align-items: stretch; }
.nav-links a { display: flex; align-items: center; font-size: 12px; text-decoration: none; color: #5b615b; border-bottom: 2px solid transparent; }
.nav-links .active { color: var(--ink); border-color: var(--accent); }
.privacy-pill { margin-left: auto; display: inline-flex; gap: 8px; padding: 8px 12px; border-radius: 30px; border: 1px solid #e6ebe4; background: #f0f4ef; color: #636f61; font-size: 10px; white-space: nowrap; }
.privacy-pill > span { color: #82957c; font-size: 8px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 34px 0 32px; min-height: 194px; }
.eyebrow { font-size: 9px; font-weight: 750; letter-spacing: .17em; color: var(--accent); margin: 0 0 16px; }
h1 { font-size: clamp(30px, 3.3vw, 42px); font-weight: 630; line-height: 1.18; letter-spacing: -1.7px; margin: 0 0 16px; }
h1 span { color: #81867c; }
.hero-copy { margin: 0; color: #656b63; font-size: 13px; }
.hero-art { width: 180px; height: 150px; flex-shrink: 0; margin-right: 30px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.input-column { display: grid; gap: 18px; min-width: 0; }
.panel { background: var(--paper); border: 1px solid #e9e9e4; border-radius: 15px; padding: 24px; }
.panel-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.step { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; color: #787f73; background: #f1f2ed; font-size: 10px; font-weight: 650; flex-shrink: 0; }
h2 { font-size: 14px; font-weight: 650; letter-spacing: -.3px; line-height: 1.4; margin: 0; }
.panel-heading p { color: var(--muted); margin: 5px 0 0; font-size: 12px; }
.heading-icon { margin-left: auto; margin-top: 8px; color: #8d9585; }
.dropzone { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 188px; background: #fafbf7; border: 1.5px dashed #d7ddcf; border-radius: 10px; padding: 23px 14px 18px; text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.dragging, .stamp-dropzone:hover, .stamp-dropzone.dragging { border-color: var(--sage); background: #f4f6ef; }
.dropzone[aria-disabled="true"], .stamp-dropzone[aria-disabled="true"] { opacity: .6; cursor: wait; }
.upload-illustration { width: 39px; height: 46px; border: 1px solid #e6e9df; border-radius: 7px; display: grid; place-items: center; color: #7c8872; background: white; box-shadow: -4px 3px 0 #f0f2e9; transform: rotate(-6deg); position: relative; margin-bottom: 15px; }
.upload-illustration > span { position: absolute; width: 16px; height: 16px; border: 2px solid #fafbf7; background: var(--sage); color: white; border-radius: 50%; display: grid; place-items: center; bottom: -2px; right: -7px; font-size: 12px; line-height: 1; }
.dropzone strong { font-size: 13px; font-weight: 550; }
.dropzone > span:not(.upload-illustration) { color: #74796e; font-size: 12px; margin-top: 2px; }
.text-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.dropzone small { font-size: 10px; color: #7f857a; margin-top: 15px; }
.file-summary { font-size: 11px; color: var(--muted); margin: 12px 0 0; }
.file-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.file-list:empty { margin: 0; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.file-number { color: #91978b; font-size: 10px; font-variant-numeric: tabular-nums; }
.file-main { min-width: 0; flex: 1; }
.file-name { overflow-wrap: anywhere; font-size: 12px; font-weight: 600; }
.file-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.file-actions { display: flex; gap: 3px; }
.icon-btn { min-width: 32px; height: 32px; display: inline-grid; place-items: center; background: white; border: 1px solid #e9ebe4; border-radius: 6px; color: #68735e; }
.icon-btn:hover:enabled { background: #f4f5ef; }
.danger { color: #ac533b; }
.stamp-dropzone { border: 1px dashed var(--line); border-radius: 9px; display: flex; align-items: center; gap: 12px; padding: 16px; cursor: pointer; }
.stamp-plus { width: 34px; height: 36px; background: #faf7ef; color: #a0977d; border: 1px solid #eee9dd; border-radius: 7px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.stamp-dropzone > span:nth-child(3) { min-width: 0; flex: 1; }
.stamp-dropzone strong { display: block; font-size: 12px; font-weight: 550; }
.stamp-dropzone small { color: var(--muted); font-size: 10px; }
.stamp-dropzone > .icon { color: #8c9385; width: 17px; }
.stamp-detail { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.stamp-preview { flex-shrink: 0; width: 68px; height: 44px; border: 1px solid #ecece5; border-radius: 6px; display: grid; place-items: center; background: repeating-conic-gradient(#f2f3ee 0 25%,white 0 50%) 50% / 10px 10px; padding: 5px; overflow: hidden; }
.stamp-preview.empty { background: #fafbf7; color: #a0a896; }
.stamp-preview canvas { max-width: 100%; max-height: 32px; object-fit: contain; }
.muted, .hint { color: var(--muted); font-size: 11px; }
#stampSummary { overflow-wrap: anywhere; min-width: 0; }
.hint { margin: 12px 0 0; line-height: 1.6; }
.option-card { padding: 14px; background: #fafbf8; border: 1px solid #eceee6; border-radius: 9px; }
.switch-row { display: flex; align-items: center; gap: 16px; justify-content: space-between; cursor: pointer; }
.switch-row span { display: grid; gap: 4px; }
.switch-row strong { font-size: 12px; font-weight: 550; }
.switch-row small { color: var(--muted); font-size: 10px; }
.switch-row input { appearance: none; width: 36px; height: 21px; border-radius: 20px; background: #c4cbbd; position: relative; flex-shrink: 0; margin: 0; cursor: pointer; }
.switch-row input::before { content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%; left: 3px; top: 3px; background: white; transition: transform .15s; }
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::before { transform: translateX(15px); }
.compression-controls { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.compression-controls label { display: grid; gap: 8px; font-size: 12px; }
.local-note { display: flex; align-items: center; gap: 8px; font-size: 10px; color: #79816f; margin: 16px 0 0; }
.local-note .icon { width: 13px; height: 13px; }
.preview-column { min-width: 0; }
.preview-panel { padding: 0; overflow: hidden; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 22px; }
.preview-heading h2 { font-size: 13px; }
.live-badge { color: #737b6d; font-size: 10px; white-space: nowrap; }
.live-badge span { font-size: 7px; color: #99a28d; margin-right: 5px; }
.document-preview { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; height: 342px; padding: 22px 28px; background-color: #f1f2eb; background-image: radial-gradient(#c6ccbb60 .6px,transparent .6px); background-size: 6px 6px; overflow: hidden; }
.preview-empty { width: 100%; height: 100%; display: grid; place-items: center; position: relative; }
.paper-placeholder { position: relative; height: 100%; aspect-ratio: .71; background: white; box-shadow: 0 4px 16px #414a3820; padding: 38px 22px; }
.paper-placeholder > span { display: block; background: #eef0e9; height: 4px; margin-bottom: 8px; }
.paper-placeholder > span:first-child { width: 44%; height: 8px; margin-bottom: 24px; }
.paper-placeholder > span:nth-child(4) { width: 65%; }
.paper-placeholder > div { position: absolute; border: 1px dashed #bb5739; border-radius: 3px; color: #bb5739; display: grid; place-items: center; overflow: hidden; }
.paper-placeholder small { font-size: 5px; }
.paper-placeholder .icon { width: 16px; height: 16px; }
.empty-caption { position: absolute; width: min(255px, 100%); top: 50%; left: 50%; transform: translate(-50%,-50%); display: grid; justify-items: center; gap: 5px; padding: 20px 12px; border: 1px solid #efefea; border-radius: 12px; background: #fffffff5; text-align: center; box-shadow: 0 8px 24px #4a4f3510; }
.empty-caption .icon { color: #8f9b80; margin-bottom: 4px; }
.empty-caption strong { font-size: 11px; font-weight: 500; }
.empty-caption span { font-size: 10px; color: #858c7d; }
#documentCanvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: white; box-shadow: 0 4px 18px #3b453020; }
.document-preview[aria-busy="true"] #documentCanvas { opacity: .4; }
.preview-message { position: absolute; bottom: 10px; left: 12px; right: 12px; margin: 0; padding: 8px 12px; border-radius: 6px; text-align: center; font-size: 11px; color: var(--ink); background: #fffffff5; box-shadow: 0 2px 8px #0000000d; }
.preview-message.error { color: var(--error); }
.preview-navigation { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 18px; border-bottom: 1px solid var(--line); background: #fafbf8; }
.preview-navigation > div { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
#previewFile { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#previewPageCount { min-width: 42px; font-size: 11px; text-align: center; color: #717969; font-variant-numeric: tabular-nums; }
.preview-navigation .icon-btn { border: 0; background: transparent; font-size: 21px; }
.controls { padding: 20px 22px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.controls label { display: grid; gap: 9px; font-size: 11px; font-weight: 550; min-width: 0; }
.position-control, .width-control { grid-column: 1 / -1; }
.position-control > span, .width-control > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.position-control small { color: #858c7d; font-weight: 400; font-size: 10px; }
.position-control { display: grid; gap: 9px; min-width: 0; font-size: 11px; font-weight: 550; }
.position-selector { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #f6f7f2; }
.controls .position-option { position: relative; display: block; cursor: pointer; }
.position-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.position-card { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 7px 4px; border: 1px solid transparent; border-radius: 5px; color: #737b6d; }
.position-option input:checked + .position-card { color: var(--accent); border-color: #bb573960; background: white; box-shadow: 0 1px 3px #272c2b12; }
.position-option:hover input:not(:disabled) + .position-card { background: #fffaf5; }
.position-option input:focus-visible + .position-card { outline: 3px solid var(--accent); outline-offset: 2px; }
.position-option input:disabled + .position-card { opacity: .42; cursor: not-allowed; }
.position-page { position: relative; display: block; flex-shrink: 0; width: 16px; height: 20px; border: 1px solid currentColor; border-radius: 2px; }
.position-page::after { content: ''; position: absolute; bottom: 3px; width: 5px; height: 4px; border-radius: 1px; background: currentColor; }
.position-left::after { left: 2px; }
.position-center::after { left: 50%; transform: translateX(-50%); }
.position-right::after { right: 2px; }
select { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #e3e7dc; border-radius: 7px; background: #fafbf7; color: var(--ink); }
.range-row { display: grid; grid-template-columns: minmax(0,1fr) 39px; gap: 8px; align-items: center; }
input[type="range"] { width: 100%; min-height: 24px; margin: 0; cursor: pointer; }
output { font-variant-numeric: tabular-nums; text-align: right; color: #747d69; font-weight: 400; }
.preview-note { margin: 18px 22px 20px; display: flex; gap: 8px; font-size: 10px; line-height: 1.6; color: #808777; }
.preview-note .icon { width: 14px; height: 14px; margin-top: 2px; }
.preview-note strong { font-weight: 550; color: #637258; }
.actions { display: flex; align-items: stretch; gap: 10px; margin-top: 16px; }
.primary { display: flex; justify-content: center; align-items: center; gap: 10px; flex: 1; border: 1px solid var(--accent); border-radius: 9px; color: white; background: var(--accent); padding: 13px 16px; font-size: 13px; font-weight: 550; }
.primary > .icon { width: 17px; height: 17px; }
.primary > .icon:last-child { margin-left: auto; }
.primary:hover:enabled { background: var(--accent-dark); }
.secondary { border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; background: white; color: var(--muted); font-size: 12px; }
.status { font-size: 11px; text-align: center; color: var(--muted); min-height: 18px; margin: 12px 0 0; overflow-wrap: anywhere; }
.error { color: var(--error); }
.export-privacy { display: flex; align-items: center; justify-content: center; gap: 6px; color: #808a73; font-size: 10px; margin: 12px 0 0; }
.export-privacy .icon { width: 12px; height: 12px; }
.result { margin-top: 14px; border: 1px solid #dbe4d5; background: #f0f5ed; border-radius: 9px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.result strong { font-size: 12px; }
.result a { color: white; background: #52694a; text-decoration: none; border-radius: 6px; padding: 10px 12px; font-size: 12px; white-space: nowrap; }
.how { padding: 62px 0 46px; }
.how .eyebrow { color: #7b826d; }
.how > h2 { font-size: 25px; font-weight: 600; letter-spacing: -.8px; }
.how-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 40px; margin-top: 28px; }
.how article { position: relative; padding: 0 0 0 37px; }
.how article > span { position: absolute; left: 0; top: 0; color: #a1a88f; font-size: 11px; padding-top: 2px; }
.how h3 { font-size: 12px; font-weight: 600; margin: 0 0 7px; }
.how p { font-size: 11px; color: var(--muted); margin: 0; }
footer { padding-block: 25px; border-top: 1px solid #e0e2d9; display: flex; align-items: center; gap: 20px; }
footer .brand { font-size: 20px; gap: 0; }
footer > span { color: #858b7e; font-size: 10px; }
.footer-privacy { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.footer-privacy .icon { width: 13px; height: 13px; }
@media (max-width: 900px) {
  .shell { width: calc(100% - 40px); }
  .nav { gap: 30px; }
  .workspace { gap: 16px; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .panel { padding: 18px; }
  .preview-panel { padding: 0; }
  .controls { padding-inline: 16px; gap: 16px 12px; }
  .document-preview { height: 300px; padding: 20px; }
  .hero-art { margin-right: 0; width: 140px; }
  .nav-links { gap: 20px; }
  .file-actions { flex-wrap: wrap; justify-content: flex-end; }
  .file-row { flex-wrap: wrap; }
  .file-main { min-width: 60%; }
  .file-actions { margin-left: auto; }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 28px); }
  .nav { height: 72px; flex-wrap: wrap; gap: 12px; }
  .brand { font-size: 23px; }
  .brand-icon { width: 34px; height: 34px; }
  .nav-links { margin-left: auto; height: 100%; }
  .nav-links .active { display: none; }
  .nav .privacy-pill { display: none; }
  .hero { padding: 30px 0 26px; min-height: 0; }
  .hero-art { display: none; }
  .eyebrow { font-size: 8px; margin-bottom: 13px; }
  h1 { font-size: clamp(28px, 7.5vw, 39px); letter-spacing: -1.2px; }
  .hero-copy { font-size: 12px; line-height: 1.7; }
  .workspace { grid-template-columns: 1fr; gap: 18px; }
  .panel { padding: 20px; }
  .preview-panel { padding: 0; }
  .panel-heading { margin-bottom: 20px; gap: 12px; }
  h2 { font-size: 15px; }
  .panel-heading p { font-size: 12px; }
  .dropzone { min-height: 185px; }
  .dropzone small { font-size: 10px; max-width: 240px; }
  .icon-btn { min-width: 44px; height: 44px; }
  .file-name { font-size: 13px; }
  .document-preview { height: 340px; padding: 22px; }
  .controls { padding: 20px 20px 0; }
  .controls label { font-size: 12px; }
  select { min-height: 44px; font-size: 16px; }
  input[type="range"] { min-height: 40px; }
  .range-row { grid-template-columns: minmax(0,1fr) 36px; gap: 4px; }
  .preview-navigation { padding: 6px 14px; }
  .preview-navigation .icon-btn { min-width: 44px; }
  .primary, .secondary { min-height: 48px; }
  .status { font-size: 12px; }
  .result { flex-wrap: wrap; }
  .result a { min-height: 44px; display: inline-flex; align-items: center; }
  .how { padding: 42px 0 34px; }
  .how > h2 { font-size: 23px; }
  .how-grid { grid-template-columns: 1fr; gap: 24px; }
  .how h3 { font-size: 13px; }
  .how p { font-size: 12px; }
  footer { flex-wrap: wrap; gap: 12px 16px; }
  .footer-privacy { width: 100%; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .switch-row input::before { transition: none; }
}
