:root {
  --ink: #172a3a;
  --muted: #687681;
  --paper: #f7f8f6;
  --card: #ffffff;
  --line: #dce2df;
  --teal: #087f78;
  --teal-dark: #05645f;
  --teal-pale: #e5f5f2;
  --ochre: #e4a640;
  --shadow: 0 18px 55px rgba(23, 42, 58, .09);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button, label, select, input[type="range"] { -webkit-tap-highlight-color: transparent; }
.topbar { height: 70px; padding: 0 max(24px, calc((100vw - 1380px)/2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(247,248,246,.93); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 38px; color: white; background: var(--teal); border-radius: 3px; font-family: Georgia, serif; font-size: 19px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.1); }
.privacy { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.privacy-dot { width: 8px; height: 8px; border-radius: 50%; background: #36a269; box-shadow: 0 0 0 4px #ddf2e7; }
main { max-width: 1380px; padding: 54px 24px 72px; margin: 0 auto; }
.intro { display: grid; grid-template-columns: 1.6fr 1fr; align-items: end; gap: 48px; margin-bottom: 36px; }
.eyebrow { margin: 0 0 12px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5.5vw, 74px); line-height: .98; letter-spacing: -.045em; font-weight: 500; }
h1 em { color: var(--teal); font-weight: 500; }
.intro-copy { max-width: 470px; margin: 0 0 6px; color: var(--muted); line-height: 1.7; font-size: 16px; }
.workspace { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(430px, 1.12fr); align-items: start; gap: 18px; }
.panel { border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); border-radius: 10px; padding: 24px; }
.panel-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.step { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid #a9c9c4; border-radius: 50%; color: var(--teal); font-size: 12px; font-weight: 800; }
.panel-heading h2 { margin: 0 0 3px; font-family: Georgia, serif; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.dropzone { min-height: 410px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; cursor: pointer; border: 1.5px dashed #9ebbb7; border-radius: 7px; background: linear-gradient(145deg, #f5fbfa, #fbfcfb); transition: .2s ease; }
.dropzone:hover, .dropzone:focus, .dropzone.dragover { border-color: var(--teal); background: var(--teal-pale); outline: none; transform: translateY(-1px); }
.upload-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 8px; border-radius: 50%; background: var(--teal); color: white; font-size: 26px; font-weight: 300; }
.dropzone strong { font-size: 16px; }
.dropzone span:last-child { color: var(--muted); font-size: 13px; }
.image-progress { margin: 14px 0; padding: 12px 14px; border: 1px solid #cfe0dc; border-radius: 7px; background: #f4faf8; }
.image-progress div { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.image-progress progress { display: block; width: 100%; height: 8px; accent-color: var(--teal); }
.recent-drafts { margin-top: 14px; }
.recent-drafts p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.recent-draft-list { display: flex; gap: 8px; flex-wrap: wrap; }
.recent-draft-list button { width: 56px; height: 72px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; }
.recent-draft-list img { display: block; width: 100%; height: 100%; object-fit: cover; }
.crop-wrap { display: grid; gap: 14px; text-align: center; }
#cropCanvas { display: block; width: min(100%, 396px); aspect-ratio: 7/9; margin: 0 auto; background: #d7dfdc; border-radius: 5px; touch-action: none; cursor: grab; }
#cropCanvas.dragging { cursor: grabbing; }
#cropCanvas.gesturing { cursor: zoom-in; }
.crop-actions { display: flex; align-items: center; gap: 14px; }
.adjustment-controls { display: grid; flex: 1; gap: 10px; }
.range-control { display: grid; grid-template-columns: 72px 1fr 40px; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.range-control:first-child { grid-template-columns: 72px 1fr 40px; }
.range-control input { width: 100%; accent-color: var(--teal); }
.range-control output { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.gesture-hint { margin: -4px 0 0; color: var(--muted); font-size: 12px; }
.enhancement-card { display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; align-items: center; padding: 14px; border: 1px solid #cfe0dc; border-radius: 7px; background: #f4faf8; text-align: left; }
.enhancement-copy { display: flex; flex-direction: column; gap: 3px; }
.enhancement-copy strong { font-size: 13px; }
.enhancement-copy span, .enhancement-status { color: var(--muted); font-size: 11px; line-height: 1.4; }
.enhance-button { --progress: 0; min-height: 38px; padding: 0 13px; border: 0; border-radius: 5px; background: var(--teal); color: white; cursor: pointer; font-size: 12px; font-weight: 750; white-space: nowrap; }
.enhance-button:hover:not(:disabled) { background: var(--teal-dark); }
.enhance-button.needs-attention { animation: prepare-attention 1.8s ease-in-out infinite; box-shadow: 0 0 0 4px rgba(8,127,120,.17); }
.enhance-button.needs-attention:focus-visible { animation: none; }
@keyframes prepare-attention { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(8,127,120,.25); } 50% { transform: scale(1.025); box-shadow: 0 0 0 6px rgba(8,127,120,0); } }
@media (prefers-reduced-motion: reduce) { .enhance-button.needs-attention { animation: none; box-shadow: 0 0 0 4px rgba(8,127,120,.17); } }
.enhance-button[aria-busy="true"] { background: linear-gradient(90deg, #05645f 0 calc(var(--progress) * 1%), #4f9c97 calc(var(--progress) * 1%) 100%); cursor: wait; }
.enhance-button:disabled:not([aria-busy="true"]) { opacity: .55; cursor: not-allowed; }
.enhancement-status { grid-column: 1 / -1; margin: 0; }
.enhancement-status[data-state="success"] { color: #23724d; }
.enhancement-status[data-state="error"] { color: #a13a32; }
.quality-advice { grid-column: 1 / -1; margin: 0; padding: 8px 10px; border-left: 3px solid var(--ochre); background: #fff8e9; color: #765310; font-size: 11px; line-height: 1.45; }
.quality-advice[data-state="warning"] { border: 1px solid #d99b32; border-left: 5px solid #bd6d14; background: #fff3d9; color: #6b3e0c; font-size: 12px; font-weight: 600; }
.quality-advice[data-state="ready"] { border-left-color: #2e8c61; background: #eff9f3; color: #216445; }
.reset-enhancement { grid-column: 2; margin: -3px 0 0; justify-self: center; }
.cancel-preparation { grid-column: 2; margin: -3px 0 0; justify-self: center; color: #a13a32; }
.crop-links { display: flex; justify-content: center; gap: 18px; }
.crop-links .text-button { margin: 0; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); cursor: pointer; font-size: 20px; }
.icon-button:hover { border-color: var(--teal); color: var(--teal); }
.text-button { margin-top: 10px; border: 0; background: none; color: var(--teal); cursor: pointer; font-size: 13px; font-weight: 700; }
.framing-note { display: flex; gap: 11px; margin-top: 18px; padding: 14px; background: #f0f6f5; border-radius: 6px; color: #4b6060; }
.note-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--teal); color: white; font: 700 12px Georgia, serif; }
.framing-note p { margin: 0; font-size: 12px; line-height: 1.55; }
.field-group { margin-bottom: 18px; }
.field-group > label, .two-fields label { display: flex; flex-direction: column; gap: 7px; color: #53616b; font-size: 13px; font-weight: 700; }
select, input[type="number"] { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #cfd8d5; border-radius: 5px; background: white; color: var(--ink); outline: none; }
select:focus, input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,127,120,.12); }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: -5px 0 18px; }
.two-fields.compact { margin-top: 0; }
.paper-choice { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding: 14px 15px; border: 1px solid #9bc4be; border-radius: 6px; background: var(--teal-pale); }
.paper-choice div { display: flex; flex-direction: column; gap: 3px; }
.paper-choice div span { color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.paper-choice strong { font-size: 14px; }
.selected-mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: white; font-size: 13px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 1px solid var(--line); }
.toggle-row div { display: flex; flex-direction: column; gap: 3px; }
.toggle-row strong { font-size: 14px; }
.toggle-row span { color: var(--muted); font-size: 12px; }
.switch { position: relative; }
.switch input { position: absolute; opacity: 0; }
.switch span { display: block; width: 42px; height: 24px; background: #bdc8c5; border-radius: 20px; cursor: pointer; transition: .2s; }
.switch span:after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; background: white; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span:after { transform: translateX(18px); }
.sheet-summary { display: flex; justify-content: space-between; align-items: end; margin: 20px 0; padding: 15px; background: #f7f9f8; border-radius: 6px; }
.sheet-summary div { display: flex; flex-direction: column; gap: 2px; }
.sheet-summary span { color: var(--muted); font-size: 12px; }
.sheet-summary strong { font-family: Georgia, serif; color: var(--teal); font-size: 25px; font-weight: 600; }
.primary-button, .secondary-button { width: 100%; min-height: 50px; border-radius: 5px; cursor: pointer; font-weight: 750; }
.primary-button { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; border: 0; background: var(--teal); color: white; }
.primary-button small { opacity: .75; font-size: 11px; }
.primary-button:hover:not(:disabled) { background: var(--teal-dark); }
.primary-button:disabled, .secondary-button:disabled { opacity: .45; cursor: not-allowed; }
.secondary-button { margin-top: 10px; border: 1px solid #aebdb9; background: white; color: var(--ink); }
.secondary-button:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.print-tip { margin: 12px 5px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.preview-panel { position: relative; }
.preview-heading { align-items: center; }
.preview-heading > div { flex: 1; }
.settings-menu { position: relative; margin-left: auto; }
.settings-menu summary { min-height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid #c7d2cf; border-radius: 6px; background: white; color: var(--ink); cursor: pointer; list-style: none; font-size: 13px; font-weight: 750; user-select: none; }
.settings-menu summary::-webkit-details-marker { display: none; }
.settings-menu summary:hover, .settings-menu[open] summary { border-color: var(--teal); color: var(--teal); }
.settings-menu summary span { font-size: 15px; }
.settings-popover { position: absolute; z-index: 12; top: calc(100% + 9px); right: 0; width: min(340px, calc(100vw - 44px)); padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: 0 22px 55px rgba(23,42,58,.2); }
.settings-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.settings-title strong { font-family: Georgia, serif; font-size: 18px; }
.settings-title span { color: var(--muted); font-size: 12px; }
.paper-stage { min-height: 425px; padding: 24px; display: grid; place-items: center; position: relative; border-radius: 7px; background-color: #e6e9e6; background-image: linear-gradient(45deg, #dfe3df 25%, transparent 25%), linear-gradient(-45deg, #dfe3df 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #dfe3df 75%), linear-gradient(-45deg, transparent 75%, #dfe3df 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }
#sheetCanvas { display: block; max-width: 100%; max-height: 470px; width: auto; height: auto; background: white; box-shadow: 0 8px 26px rgba(23,42,58,.18); }
.empty-preview { position: absolute; text-align: center; color: #71807a; }
.empty-preview span { display: block; font-size: 52px; font-weight: 200; line-height: 1; transform: scaleX(.72); }
.empty-preview p { margin: 10px 0 0; font-family: Georgia, serif; font-size: 17px; line-height: 1.35; }
.preview-footer { display: grid; grid-template-columns: 1fr 1.08fr; align-items: stretch; gap: 12px; margin-top: 14px; }
.preview-footer .sheet-summary { margin: 0; }
.action-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-buttons[hidden] { display: none; }
.action-buttons .secondary-button { width: 100%; min-width: 82px; margin: 0; padding: 0 14px; }
.download-jpeg { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
.download-jpeg small { color: var(--muted); font-size: 11px; }
.action-buttons .print-button { width: 100%; }
.resolution-row { display: flex; justify-content: space-between; padding-top: 13px; color: var(--muted); font-size: 12px; }
.resolution-row strong { color: var(--ink); }
.requirements { margin-top: 70px; padding-top: 40px; border-top: 1px solid var(--line); }
.requirements-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.requirements-title h2 { margin: 0; font-family: Georgia, serif; font-size: 33px; font-weight: 500; }
.requirements-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.requirements article { min-height: 190px; padding: 22px; border-left: 3px solid var(--teal); background: white; }
.requirements article span { color: var(--ochre); font-family: Georgia, serif; font-size: 24px; font-weight: 700; }
.requirements h3 { margin: 20px 0 8px; font-size: 15px; }
.requirements article p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.disclaimer { max-width: 900px; margin: 22px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.photo-guide { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; margin-top: 54px; padding: 36px; border-radius: 10px; background: white; }
.photo-guide h2 { margin: 0 0 20px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.photo-guide ol { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.7; }
.photo-faq { display: grid; gap: 18px; }
.photo-faq article { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.photo-faq article:last-child { padding-bottom: 0; border: 0; }
.photo-faq h3 { margin: 0 0 6px; font-size: 15px; }
.photo-faq p, .source-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.source-note { grid-column: 1 / -1; }
.source-note a { color: var(--teal-dark); }
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr 1fr; }
  .requirements-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .topbar { height: 60px; padding: 0 16px; }
  .privacy { font-size: 0; }
  main { padding: 36px 14px 52px; }
  .intro { grid-template-columns: 1fr; gap: 20px; }
  h1 { font-size: 45px; }
  .workspace { grid-template-columns: 1fr; }
  .panel { padding: 20px; }
  .dropzone { min-height: 330px; }
  .paper-stage { min-height: 430px; }
  .preview-heading { flex-wrap: wrap; }
  .settings-menu { width: calc(100% - 48px); margin: 6px 0 0 48px; }
  .settings-menu summary { justify-content: center; }
  .settings-popover { right: 0; width: 100%; }
  .preview-footer { grid-template-columns: 1fr; }
  .action-buttons { grid-template-columns: 1fr 1fr; }
  .action-buttons .print-button { grid-column: 1 / -1; width: 100%; }
  .range-control { grid-template-columns: 66px 1fr 38px; }
  .range-control:first-child { grid-template-columns: 66px 1fr 38px; }
  .enhancement-card { grid-template-columns: 1fr; }
  .enhance-button, .reset-enhancement, .cancel-preparation { grid-column: 1; width: 100%; }
  .requirements-title { display: block; }
  .requirements-title .eyebrow { margin-bottom: 8px; }
  .requirements-grid { grid-template-columns: 1fr; }
  .photo-guide { grid-template-columns: 1fr; padding: 24px; }
  .source-note { grid-column: 1; }
}
