@charset "UTF-8";
:root {
  --paper: #f6f7f2;
  --surface: #fff;
  --ink: #18211e;
  --muted: #626e67;
  --green: #1f5947;
  --green-hover: #164334;
  --mint: #e8efe7;
  --line: #dce2d9;
  --radius: 20px;
  --shadow: 0 12px 40px #1f352008;
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #47957b;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  padding: 0;
}
a {
  color: inherit;
}
svg.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  background: var(--green);
  color: white;
  padding: 12px;
  z-index: 20;
}
.skip-link:focus {
  top: 12px;
}
.app-header {
  max-width: 1240px;
  margin: auto;
  padding: 20px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.7px;
}
.brand-light {
  font-weight: 450;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  border-radius: 10px;
  width: 34px;
  height: 34px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 650;
  transition:
    background 0.15s,
    box-shadow 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--green-hover);
  box-shadow: 0 4px 14px #1f594722;
}
.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-outline:hover:not(:disabled) {
  background: var(--mint);
}
.btn-small {
  font-size: 13px;
  min-height: 44px;
  padding: 10px 13px;
}
.text-btn {
  border: 0;
  background: transparent;
  padding: 10px 5px;
  min-height: 44px;
  color: var(--green);
  font-size: 13px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.app-main {
  max-width: 1160px;
  margin: auto;
  padding: 12px 20px 0;
}
.welcome {
  display: grid;
  gap: 32px;
}
.hero-copy {
  padding: 20px 0 0;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.9px;
  color: var(--green);
}
.tiny-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
h1 {
  font-size: clamp(42px, 10vw, 68px);
  line-height: 1.06;
  font-weight: 550;
  letter-spacing: -2.7px;
}
.hero-copy h1 {
  margin-top: 20px;
}
.hero-copy h1 em {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  color: var(--green);
}
.hero-description {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}
.trust-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.trust-line .icon {
  width: 16px;
  height: 16px;
}
.upload-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.upload-card.dragover {
  outline: 3px dashed var(--green);
  background: var(--mint);
}
.signature-sample {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 160px;
  margin-bottom: 20px;
  background-color: #f6f8f3;
  background-image:
    linear-gradient(#dfe8df88 1px, transparent 1px),
    linear-gradient(90deg, #dfe8df88 1px, transparent 1px);
  background-size: 24px 24px;
  border-radius: 12px;
  overflow: hidden;
}
.signature-sample svg {
  width: 80%;
  max-width: 300px;
  height: 100px;
  stroke: var(--green);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sample-tag {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 12px;
  color: #697a6c;
  margin-top: 4px;
}
.upload-divider {
  width: 30px;
  height: 2px;
  background: var(--line);
  margin: 0 auto 22px;
}
.upload-card h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.upload-card > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 8px;
}
.upload-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}
.upload-card .file-hint {
  font-size: 11px;
  margin-top: 16px;
}
.desktop-hint {
  display: none;
}
.steps {
  list-style: none;
  padding: 24px 0 0;
  margin: 0;
  display: grid;
  gap: 24px;
  border-top: 1px solid var(--line);
}
.steps li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.steps li > span {
  font-family: Georgia, serif;
  color: #626e67;
  font-size: 20px;
  line-height: 1.2;
}
.steps h3 {
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
}
.steps p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.workspace-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 18px 0 24px;
}
.workspace-heading h1 {
  font-size: 34px;
  letter-spacing: -1.5px;
  margin-top: 9px;
}
.workspace-heading .eyebrow {
  font-size: 9px;
}
.editor-grid {
  display: grid;
  gap: 20px;
}
.preview-column {
  min-width: 0;
}
.result-card,
.source-card,
.controls-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  gap: 10px;
}
.card-heading h2 {
  font-size: 14px;
  font-weight: 650;
}
.badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  background: var(--mint);
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--green);
  white-space: nowrap;
}
.badge .tiny-dot {
  width: 4px;
  height: 4px;
}
.result-stage {
  height: 260px;
  margin: 0 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #e1e5de;
  border-radius: 10px;
  padding: 28px;
}
.checkerboard {
  background-color: #fbfcfa;
  background-image:
    linear-gradient(45deg, #e7ebe5 25%, transparent 25%),
    linear-gradient(-45deg, #e7ebe5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e7ebe5 75%),
    linear-gradient(-45deg, transparent 75%, #e7ebe5 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
}
.result-stage[data-background='white'] {
  background: #fff;
}
.result-stage[data-background='dark'] {
  background: #222b28;
}
.result-stage canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.result-stage[aria-busy='true'] canvas {
  opacity: 0.35;
}
.preview-placeholder {
  position: absolute;
  color: var(--muted);
  font-size: 13px;
  background: #ffffffed;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
  max-width: 90%;
}
.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  color: var(--muted);
  font-size: 11px;
}
.background-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}
.background-btn {
  width: 32px;
  height: 32px;
  border: 5px solid white;
  border-radius: 50%;
  outline: 1px solid var(--line);
  background: repeating-conic-gradient(#cbd4c8 0% 25%, white 0% 50%) 0/10px 10px;
}
.background-btn.selected {
  outline: 2px solid var(--green);
}
.bg-white {
  background: #fff;
}
.bg-dark {
  background: #222b28;
}
.source-card {
  margin-top: 16px;
}
.source-card > summary,
.advanced-section > summary {
  cursor: pointer;
  padding: 18px 20px;
  font-size: 13px;
  font-weight: 600;
}
.source-card > summary span {
  float: right;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}
.source-content {
  padding: 0 18px 18px;
}
.muted {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.crop-stage {
  margin: 12px 0;
  position: relative;
  background: #eef1eb;
  height: 230px;
  border-radius: 10px;
  overflow: hidden;
}
.crop-stage canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.crop-stage.cropping {
  touch-action: none;
  cursor: crosshair;
}
.crop-selection {
  position: absolute;
  border: 2px solid var(--green);
  background: #1f594715;
  box-shadow: 0 0 0 2000px #17271d55;
  pointer-events: none;
}
.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.crop-controls {
  margin-top: 20px;
}
.crop-controls legend {
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
}
.crop-ranges {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0;
}
.crop-ranges label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.crop-ranges output {
  color: var(--muted);
}
.photo-tip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 16px 6px;
}
.photo-tip .icon {
  width: 17px;
  height: 17px;
}
.controls-panel {
  padding-bottom: 20px;
}
.controls-panel .card-heading {
  padding-bottom: 8px;
}
.control-group {
  padding: 16px 20px 0;
}
.control-group legend {
  float: left;
  width: 100%;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 12px;
}
.toggle-group {
  display: flex;
  gap: 8px;
  clear: both;
}
.toggle-btn {
  flex: 1;
  min-height: 66px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}
.toggle-btn span {
  display: block;
  font-weight: 400;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.toggle-btn.active {
  border-color: var(--green);
  background: var(--mint);
  box-shadow: inset 0 0 0 1px var(--green);
}
.color-options {
  clear: both;
  display: flex;
  align-items: center;
  gap: 12px;
}
.color-swatch {
  width: 38px;
  height: 38px;
  border: 5px solid white;
  border-radius: 50%;
  outline: 1px solid var(--line);
}
.color-swatch.selected {
  outline: 2px solid var(--green);
}
.ink-black {
  background: #18211e;
}
.ink-blue {
  background: #173b78;
}
.ink-green {
  background: #1f5947;
}
.custom-color {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
}
input[type='color'] {
  width: 32px;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  cursor: pointer;
}
.control-section {
  display: grid;
  gap: 22px;
  padding: 24px 20px 0;
}
.slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.slider-row label {
  font-size: 12px;
  font-weight: 550;
}
.slider-val {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.slider-row input,
.slider-row p {
  grid-column: 1/-1;
}
.slider-row p,
.export-size p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.slider-row p {
  margin-top: -4px;
}
input[type='range'] {
  accent-color: var(--green);
  width: 100%;
  min-height: 28px;
  margin: 0;
  cursor: pointer;
}
.advanced-section {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.advanced-section .control-section {
  padding-top: 0;
  padding-bottom: 20px;
}
.export-size {
  padding: 20px 20px 0;
  display: grid;
  gap: 10px;
}
.export-size label {
  font-size: 12px;
  font-weight: 650;
}
select {
  appearance: auto;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbf8;
  color: var(--ink);
  padding: 10px;
  font-size: 12px;
}
.export-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 24px -20px 0;
  background: #ffffffee;
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px max(14px, env(safe-area-inset-bottom));
}
.export-copy {
  display: none;
}
.export-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.export-actions > .btn-primary {
  flex: 1;
}
.export-actions .btn {
  font-size: 13px;
}
.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 14px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}
.status-bar.error {
  color: #a13224;
}
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid #c9d7ca;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.app-footer {
  max-width: 1160px;
  margin: 22px auto 0;
  padding: 22px 20px max(22px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.app-footer > div {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.app-footer .text-btn {
  font-size: 11px;
}
.footer-dot {
  margin: 0 6px;
  color: #a0ada2;
}
.notice {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--mint);
  font-size: 12px;
  line-height: 1.6;
}
.update-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.update-notice > span:last-child {
  color: var(--muted);
  font-size: 11px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  max-width: 440px;
  width: calc(100% - 40px);
  color: var(--ink);
  box-shadow: 0 20px 70px #10291c30;
}
dialog::backdrop {
  background: #14281fb3;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
dialog h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
}
dialog p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  margin: 20px 0;
}
dialog > .btn-primary {
  width: 100%;
}
@media (min-width: 600px) {
  .app-header {
    padding: 24px 32px;
  }
  .app-main {
    padding: 20px 32px 0;
  }
  .upload-actions {
    flex-direction: row;
  }
  .upload-actions .btn {
    flex: 1;
  }
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .result-stage {
    height: 340px;
    margin: 0 20px;
  }
  .export-bar {
    margin-left: 0;
    margin-right: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 20px;
  }
  .export-copy {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .export-copy strong,
  .export-copy span {
    display: block;
    font-size: 12px;
  }
  .export-copy span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
  }
  .export-actions {
    width: auto;
  }
  .app-footer {
    flex-direction: row;
    justify-content: space-between;
  }
  .app-footer > div {
    gap: 24px;
  }
  .crop-ranges {
    grid-template-columns: 80px 1fr;
    align-items: center;
  }
  .workspace-heading h1 {
    font-size: 40px;
  }
  .badge {
    font-size: 11px;
  }
  .brand {
    font-size: 22px;
  }
  .desktop-hint {
    display: inline;
  }
}
@media (min-width: 900px) {
  .welcome {
    grid-template-columns: 1fr 1fr;
    column-gap: 80px;
    row-gap: 58px;
    padding-top: 36px;
  }
  .hero-copy {
    align-self: center;
    padding: 0;
  }
  .hero-copy h1 {
    font-size: 68px;
  }
  .hero-description {
    font-size: 16px;
  }
  .upload-card {
    padding: 28px;
  }
  .signature-sample {
    height: 185px;
  }
  .trust-line {
    margin-top: 30px;
    font-size: 12px;
  }
  .steps {
    grid-column: 1/-1;
    padding-top: 30px;
  }
  .editor-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
  }
  .result-stage {
    height: 380px;
  }
  .controls-panel {
    position: sticky;
    top: 20px;
  }
  .workspace-heading {
    margin-bottom: 30px;
  }
  .crop-stage {
    height: 300px;
  }
  .app-footer {
    margin-top: 40px;
  }
  .workspace {
    padding-top: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
