@font-face {
  font-family: "Covered By Your Grace";
  src: url("/assets/signature.woff2") format("woff2");
  font-display: swap;
}
:root {
  color-scheme: dark;
  --page: #101112;
  --panel: #191b1b;
  --ink: #f4f3ed;
  --muted: #adafa7;
  --stroke: #383b37;
  --accent: #d5f868;
  --accent-hover: #e1ff8e;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(1200px, calc(100% - 72px)); margin-inline: auto; }
.site-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--stroke);
}
.wordmark {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  font: 800 17px/1 var(--mono);
  letter-spacing: -.05em;
}
.wordmark-dot { color: var(--accent); }
.mark {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: 7px;
}
.mark i {
  width: 15px;
  height: 11px;
  border: 2px solid #171b0e;
  border-radius: 3px;
  transform: rotate(-14deg);
  box-shadow: -3px 3px 0 -1px var(--accent), -4px 4px 0 -1px #171b0e;
}
.header-actions { display: flex; gap: 14px; align-items: center; }
.history-button { color: var(--muted); font-size: 12px; border: 0; background: none; padding: 7px 4px; }
.history-button:hover { color: var(--ink); }
.language { background: #1b1d1c; border: 1px solid var(--stroke); border-radius: 7px; padding: 7px 12px; font-size: 12px; }
.intro { padding: 47px 0 31px; }
.intro h1 {
  margin: 0 0 10px;
  font-weight: 820;
  font-size: clamp(35px, 5.1vw, 68px);
  letter-spacing: -.075em;
  line-height: 1.1;
}
.intro h1 span { color: var(--accent); margin-left: .12em; }
.intro p { margin: 0; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.56fr) minmax(330px, 1fr); gap: 18px; }
.preview, .editor {
  min-width: 0;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
}
.preview { display: flex; flex-direction: column; }
.preview-bar, .preview-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 53px;
  padding: 11px 18px;
  font-size: 12px;
  color: var(--muted);
}
.preview-bar > span:first-child { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.preview-bar i { width: 7px; height: 7px; border-radius: 50%; background: #bda7f6; }
.preview-footer { min-height: 47px; font-size: 11px; }
#character-caption { color: var(--ink); font: 600 11px/1.3 var(--mono); overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; }
.muted { color: var(--muted); }
.card-stage {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 400px;
  padding: clamp(19px, 4vw, 57px);
  background-image:
    linear-gradient(#cab9f00b 1px, transparent 1px),
    linear-gradient(90deg, #cab9f00b 1px, transparent 1px),
    radial-gradient(ellipse at 20% 10%, #4a3967, transparent 70%),
    linear-gradient(150deg, #212035, #201e25 64%, #303920);
  background-size: 25px 25px, 25px 25px, auto, auto;
  border-block: 1px solid #4c4757;
}
#card-preview {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  aspect-ratio: 1.58;
  border-radius: clamp(9px, 2.4vw, 27px);
  background: #e4e6db;
  box-shadow: 0 22px 55px #08090ab2;
}
.editor { padding: 23px; }
.editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 23px; }
.editor h2, .dialog-heading h2 { margin: 0; font-size: 21px; line-height: 1.25; }
.locale-code { color: #bfc4a9; font-size: 12px; }
.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.field-row label, .photo-section > label { display: block; font-size: 13px; font-weight: 600; }
.field-row label { grid-column: 1 / -1; }
select, .button { min-height: 43px; border-radius: 8px; font-weight: 650; }
select {
  min-width: 0;
  width: 100%;
  background: #131414;
  color: var(--ink);
  border: 1px solid var(--stroke);
  padding: 7px 32px 7px 12px;
  font-size: 13px;
}
.button { padding: 8px 14px; border: 1px solid var(--stroke); transition: background-color .15s, border-color .15s; }
.secondary { color: var(--ink); background: #262928; font-size: 13px; }
.secondary:hover:not(:disabled) { background: #343836; border-color: #666e5b; }
.photo-section { margin-top: 19px; }
.drop-zone {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 69px;
  margin-top: 8px;
  padding: 12px;
  border: 1px dashed #5b6551;
  border-radius: 9px;
  background: #161816;
  text-align: left;
}
.drop-zone:hover:not(:disabled), .drop-zone.dragging { border-color: var(--accent); background: #242b1b; }
.plus {
  width: 33px;
  height: 33px;
  display: grid;
  flex: none;
  place-items: center;
  border: 1px solid #63734b;
  border-radius: 8px;
  color: var(--accent);
  font-size: 23px;
  font-weight: 400;
}
.drop-copy { min-width: 0; }
.drop-copy strong, .drop-copy small { display: block; }
.drop-copy strong { font-size: 13px; overflow-wrap: anywhere; }
.drop-copy small { margin-top: 2px; font: 11px/1.3 var(--mono); color: var(--muted); }
.quiet { color: var(--muted); background: none; border: 0; padding: 3px 0; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.quiet:hover { color: var(--ink); }
#sample { margin-top: 7px; }
.consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}
input[type="checkbox"] { width: 16px; height: 16px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.export-block { border-top: 1px solid var(--stroke); margin-top: 17px; padding-top: 15px; }
.export-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: 13px; }
.export-heading strong { font-size: 19px; letter-spacing: -.035em; white-space: nowrap; }
.export-heading small { color: var(--muted); font: 11px var(--mono); letter-spacing: 0; }
.export-links { display: flex; gap: 5px 16px; flex-wrap: wrap; margin-top: 5px; }

.primary {
  border-color: transparent;
  background: var(--accent);
  color: #1b2310;
  width: 100%;
  min-height: 47px;
}
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:disabled { background: #32372b; color: #adafa4; }
.status { color: var(--muted); margin: 8px 0 0; font-size: 12px; }
.status:empty { margin: 0; }
.status[data-error="true"] { color: #ffc69f; }
.site-footer {
  margin-top: 23px;
  padding: 15px 0 23px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
.site-footer span:last-child { font: 600 11px/1.5 var(--mono); white-space: nowrap; }
dialog {
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100dvh - 24px);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 15px;
  padding: 22px;
}
dialog::backdrop { background: #09090cd9; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; }
#crop-canvas { display: block; width: min(270px, 100%, 42vh); aspect-ratio: 3 / 4; height: auto; margin: 0 auto; touch-action: none; cursor: grab; border-radius: 8px; background: #25283a; }
#crop-canvas:active { cursor: grabbing; }
.zoom-row { display: grid; grid-template-columns: auto 1fr 42px; align-items: center; gap: 10px; margin: 14px 0; }
.zoom-row input { width: 100%; accent-color: var(--accent); }
.zoom-row output { text-align: right; font: 11px/1 var(--mono); }
.dialog-actions { display: flex; align-items: center; gap: 8px; }
.dialog-actions .primary { flex: 1; width: auto; }
.payment-dialog { width: min(780px, calc(100vw - 28px)); color: #18201b; background: #fff; color-scheme: light; }
.payment-dialog .quiet { color: #454a47; }
.payment-dialog .quiet:hover { color: #18201b; }
#stripe-checkout { min-height: 370px; }
.result-dialog { width: min(710px, calc(100vw - 28px)); }
#result-img { display: block; width: 100%; height: auto; border-radius: 12px; }
.result-actions { margin-top: 15px; }
.history-list { margin: 0; padding: 0; list-style: none; }
.history-list button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 7px;
  text-align: left;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #1d201e;
}
.history-list button:hover { border-color: var(--accent); }
.history-list img { display: block; width: 76px; height: auto; border-radius: 4px; }
.history-list span { overflow-wrap: anywhere; font: 12px/1.4 var(--mono); }
@media (max-width: 900px) {
  .shell { width: calc(100% - 40px); }
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(300px, .95fr); }
  .card-stage { min-height: 320px; padding: 22px; }
  .editor { padding: 18px; }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 28px); }
  .site-header { height: 64px; }
  .wordmark { font-size: 14px; gap: 7px; }
  .mark { width: 24px; height: 24px; }
  .header-actions { gap: 8px; }
  .history-button { font-size: 11px; }
  .intro { padding: 28px 0 18px; }
  .intro p { font-size: 13px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .card-stage { min-height: 0; padding: 23px; }
  .preview-bar, .preview-footer { min-height: 39px; padding: 8px 11px; }
  .editor { padding: 17px; }
  .site-footer { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
