:root {
  --bg: #f4efe6;
  --surface: #fffdf8;
  --ink: #1f1b16;
  --muted: #6b6257;
  --line: #e2d8c8;
  --accent: #9e2a2b;
  --accent-ink: #ffffff;
  --accent-soft: #f6e3df;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 27, 22, .06), 0 6px 20px rgba(31, 27, 22, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --surface: #1f1c17;
    --ink: #f1ebe0;
    --muted: #a99f90;
    --line: #36312a;
    --accent: #d0504f;
    --accent-soft: #3a2320;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 960px; margin: 0 auto; padding: 0 16px 32px; display: grid; gap: 16px; }
#female-flow { display: grid; gap: 16px; }

.site-header { max-width: 960px; margin: 0 auto; padding: 32px 16px 16px; }
.site-header h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(28px, 5vw, 40px); letter-spacing: .01em; }
.tagline { margin: 4px 0 0; color: var(--muted); }
.site-footer { max-width: 960px; margin: 0 auto; padding: 16px 16px 40px; color: var(--muted); font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 14px; }
.hint { margin: -4px 0 12px; color: var(--muted); font-size: 14px; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px 22px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: var(--accent); color: var(--accent-ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.construction { text-align: center; border: 2px dashed #d9a400; background: repeating-linear-gradient(45deg, transparent 0 18px, rgba(217, 164, 0, .08) 18px 36px), var(--surface); }
.construction h2 { justify-content: center; }
.construction-sign { font-size: 48px; }

.uploads { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.dropzone {
  position: relative; display: grid; place-items: center; min-height: 320px;
  border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; overflow: hidden;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone img { width: 100%; height: 100%; max-height: 420px; object-fit: contain; }
.dz-text { color: var(--muted); pointer-events: none; text-align: center; padding: 0 12px; }
.dz-text small { display: block; font-size: 12px; margin-top: 4px; }
.dropzone.paste-target { border-color: var(--accent); }
.dropzone.pasted { animation: pasted .6s ease-out; }
@keyframes pasted { from { box-shadow: 0 0 0 4px var(--accent); } to { box-shadow: 0 0 0 0 transparent; } }
.paste-btn {
  margin-top: 10px; width: 100%; padding: 8px 12px; font-size: 14px;
  background: transparent; color: var(--ink); border: 1px solid var(--line);
}
.paste-btn:hover { border-color: var(--accent); }
.dropzone.has-image .dz-text { display: none; }

.options { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 16px; }
.options label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.options label.check { display: flex; align-items: center; gap: 10px; color: var(--ink); cursor: pointer; align-self: end; padding-bottom: 6px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.check small { display: block; color: var(--muted); font-size: 12px; }
select, input[type=password] {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; min-width: 160px;
}

button, .button {
  font: inherit; font-weight: 600; border-radius: 10px; padding: 12px 24px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; display: inline-block;
}
.primary, .button { background: var(--accent); color: var(--accent-ink); }
.primary { width: 100%; font-size: 18px; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.secondary { background: transparent; color: var(--ink); border-color: var(--line); }

.status { min-height: 1.5em; margin: 12px 0 0; color: var(--muted); }
.status.error { color: var(--accent); font-weight: 600; }
.status.busy::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-wrap { display: grid; place-items: center; background: var(--bg); border-radius: 10px; overflow: hidden; }
.result-wrap img { max-width: 100%; max-height: 80vh; display: block; }
.result-actions { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

[hidden] { display: none !important; }
