:root {
  font-family: "DM Sans", sans-serif;
  color: #20211e;
  background: #184b78;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #20211e;
  --muted: #737b82;
  --line: #dedfd7;
  --paper: #fff;
  --lime: #ffdf4f;
  --orange: #f27951;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #184b78;
}

button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 72px;
  padding: 0 6.2vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font: 800 17px "Manrope", sans-serif;
}

.brand-mark {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  font-size: 13px;
  letter-spacing: -1px;
}

.topbar-note { color: #e5edf3; font-size: 12px; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--lime); }

.workspace { width: min(1100px, 88vw); margin: 0 auto; }
.intro { padding: 44px 0 29px; animation: arrive .55s both; }
.eyebrow { margin: 0 0 12px; color: #dce6ee; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.eyebrow span { padding: 0 7px; color: #a9aaa1; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font: 800 clamp(37px, 5vw, 55px)/1.04 "Manrope", sans-serif; letter-spacing: 0; }
h1 { color: #fff; }
h1 em { color: var(--lime); font-style: normal; }
.intro-copy { margin-bottom: 0; color: #dce6ee; font-size: 14px; }

.editor {
  display: grid;
  grid-template-columns: minmax(260px, 350px) minmax(0, 1fr);
  min-height: 430px;
  background: var(--paper);
  border: 1px solid #e7e8e1;
  border-radius: 7px;
  box-shadow: 0 16px 45px rgba(35, 38, 27, .07);
  overflow: hidden;
  animation: arrive .65s .08s both;
}

.details-panel { padding: 27px 27px 22px; border-right: 1px solid #ecece7; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; }
.step-number { flex: 0 0 auto; display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: var(--lime); font-size: 10px; font-weight: 700; }
h2 { margin: 2px 0 3px; font: 700 16px "Manrope", sans-serif; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
form { margin-top: 25px; }
.field-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
#person-name { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #dfe0da; border-radius: 4px; color: var(--ink); outline: none; font-size: 12px; transition: border-color .18s, box-shadow .18s; }
#person-name:focus { border-color: #809b3f; box-shadow: 0 0 0 3px rgba(215, 243, 106, .3); }
#person-name::placeholder { color: #a2a39c; }
.photo-label { margin-top: 22px; }
.upload-button { display: grid; flex: 1; place-items: center; }
.file-name { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.file-name:empty { display: none; }
.camera-actions { display: flex; gap: 8px; margin-top: 12px; }
.button { min-height: 39px; border: 0; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 700; transition: transform .15s, background .15s, opacity .15s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-secondary { flex: 1; border: 1px solid #dfe0da; background: white; color: var(--ink); }
.button-secondary:hover { background: #f8f9f4; }
.button-secondary span { padding-right: 5px; color: #184b78; font-size: 17px; vertical-align: -1px; }
.button-capture { flex: 1; background: var(--ink); color: white; }
.camera-close { padding: 0 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.form-note { min-height: 15px; margin: 11px 0 0; color: #818991; font-size: 10px; line-height: 1.5; }

.preview-panel { min-width: 0; padding: 27px 28px 18px; background: #fafaf7; }
.preview-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.preview-tag { display: inline-flex; align-items: center; gap: 6px; padding-top: 5px; color: #8d8f85; font-size: 9px; font-weight: 700; letter-spacing: .6px; }
.preview-tag span { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.canvas-wrap { position: relative; display: grid; min-height: 430px; height: min(72vh, 720px); margin-top: 20px; place-items: center; overflow: hidden; border: 1px solid rgba(255, 223, 79, .6); border-radius: 5px; background: #184b78; }
.canvas-wrap::before, .canvas-wrap::after { position: absolute; z-index: 0; width: 20px; height: 20px; content: ""; }
.canvas-wrap::before { top: 12px; left: 12px; border-top: 1px solid #b7baad; border-left: 1px solid #b7baad; }
.canvas-wrap::after { right: 12px; bottom: 12px; border-right: 1px solid #b7baad; border-bottom: 1px solid #b7baad; }
#composition { display: none; max-width: 100%; max-height: 100%; width: auto; height: 100%; object-fit: contain; }
.canvas-wrap.has-image #composition { display: block; }
.canvas-wrap.has-image .empty-state { display: none; }
.empty-state { z-index: 1; display: flex; flex-direction: column; align-items: center; color: #85877e; text-align: center; }
.empty-state p { max-width: 280px; margin: 12px 12px 7px; font-size: 11px; line-height: 1.5; }
.empty-frame { position: relative; width: 54px; height: 54px; border: 1px solid #c8cbc0; border-radius: 4px; }
.empty-frame::before { position: absolute; top: 7px; left: 7px; width: 7px; height: 7px; border-radius: 50%; background: #c8cbc0; content: ""; }
.empty-frame span { position: absolute; right: 6px; bottom: 6px; left: 6px; height: 24px; border: 1px solid #c8cbc0; clip-path: polygon(0 100%, 38% 25%, 58% 59%, 73% 43%, 100% 100%); }
.empty-frame i { position: absolute; top: 50%; left: 50%; width: 19px; height: 19px; border: 1px dashed #8d9d67; border-radius: 50%; transform: translate(-50%, -35%); }
.mask-picker { color: #627c27; cursor: pointer; font-size: 10px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; }
.preview-name { min-width: 0; overflow: hidden; color: #777970; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.button-download { flex: 0 0 auto; padding: 0 15px; background: var(--lime); color: var(--ink); }
.button-download:hover:not(:disabled) { background: #c8e857; }
.button-download span { padding-left: 8px; font-size: 14px; }
.button-download:disabled { cursor: not-allowed; opacity: .55; }
.page-footer { display: flex; justify-content: space-between; padding: 18px 2px 28px; color: #dce6ee; font-size: 9px; font-weight: 700; letter-spacing: 1px; }

@keyframes arrive { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .topbar { height: 62px; padding: 0 6vw; }
  .workspace { width: 88vw; }
  .intro { padding: 35px 0 22px; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .details-panel { padding: 23px 22px 14px; border-right: 0; border-bottom: 1px solid #ecece7; }
  .preview-panel { padding: 22px; }
  .canvas-wrap { height: min(68vh, 620px); min-height: 430px; }
}

@media (max-width: 390px) {
  .topbar-note { font-size: 10px; }
  .preview-panel, .details-panel { padding-right: 17px; padding-left: 17px; }
  .preview-footer { align-items: flex-start; flex-direction: column; }
  .button-download { align-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

html, body { width: 100%; height: 100%; overflow: hidden; }

body { min-width: 0; min-height: 0; }

.screen {
  position: relative;
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  place-items: center;
  overflow: hidden;
  background: #184b78;
}

.canvas-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.canvas-wrap::before, .canvas-wrap::after { content: none; }

.camera-preview {
  position: absolute;
  z-index: 0;
  display: block;
  max-width: none;
  max-height: none;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-preview[hidden] { display: none; }

#composition {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100%;
  object-fit: contain;
}

.camera-controls {
  position: fixed;
  z-index: 5;
  right: 0;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
}

.action-button {
  display: inline-flex;
  min-width: 148px;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 20px rgba(9, 34, 57, .24);
  color: #184b78;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transition: transform .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}

.action-button:first-child {
  border-color: #ffdf4f;
  background: #ffdf4f;
  color: #173b5b;
}

.action-button:active { transform: translateY(1px) scale(.98); }
.action-button:hover { background: #fff7d1; }
.action-button:first-child:hover { background: #ffe978; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.action-feedback {
  position: fixed;
  z-index: 6;
  right: 16px;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 62px);
  left: 16px;
  width: fit-content;
  max-width: min(440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 4px 16px rgba(9, 34, 57, .18);
  color: #184b78;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.action-feedback:empty { display: none; }

@media (max-width: 420px) {
  .camera-controls { gap: 8px; padding: 0 12px; }
  .action-button { min-width: 0; min-height: 48px; flex: 1; padding: 0 12px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .action-button { transition: none; }
}