:root{
  --bg:#0b0b0f;
  --card:#141421;
  --card2:#1a1a2c;
  --text:#ffffff;
  --muted:rgba(255,255,255,.72);
  --border:rgba(255,255,255,.10);
  --grad:linear-gradient(135deg,#DECA8F 0%,#D4B5A1 45%,#5F7374 100%);
}
*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background:rgba(11,11,15,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.brand{font-weight:800; letter-spacing:.4px}
.right{display:flex; align-items:center; gap:10px}
.pill{
  padding:7px 10px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  border-radius:999px;
  font-size:12px;
  color:var(--muted);
  max-width:45vw;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.main{padding:18px; max-width:1100px; margin:0 auto}
.screen{display:none}
.screen.active{display:block}
.step{
  padding:18px;
  border:1px solid var(--border);
  background:var(--card);
  border-radius:18px;
  margin-bottom:14px;
}
h1{margin:0 0 12px; font-size:20px}
h2{margin:0 0 10px; font-size:16px; color:var(--muted)}
.carousel{
  display:flex;
  gap:12px;
  overflow:auto;
  padding-bottom:8px;
  scroll-snap-type:x mandatory;
}
.card{
  flex:0 0 auto;
  width:min(280px,70vw);
  border:1px solid var(--border);
  background:var(--card2);
  border-radius:18px;
  padding:14px;
  scroll-snap-align:start;
  cursor:pointer;
}
.card.selected{
  outline:2px solid rgba(222,202,143,.7);
}
.cardTitle{font-weight:700; margin-bottom:8px}
.cardImg{
  width:100%;
  height:180px;
  object-fit:contain;
  border-radius:12px;
  background:rgba(0,0,0,.15);
}
.upload input{width:100%}
.ratios{display:flex; gap:10px; flex-wrap:wrap}
.ratio{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  border-radius:999px;
  padding:10px 12px;
  cursor:pointer;
  color:var(--muted);
  font-size:13px;
}
.ratio.selected{background:rgba(222,202,143,.16); color:#fff}
.actions{display:flex; align-items:center; gap:12px; margin-top:12px; flex-wrap:wrap}
.btn{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:#fff;
  padding:11px 14px;
  border-radius:12px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.btn-primary{
  background:var(--grad);
  border-color:rgba(255,255,255,.18);
  color:#0b0b0f;
  font-weight:800;
}
.btn-ghost{background:rgba(255,255,255,.04)}
.btn:disabled{opacity:.45; cursor:not-allowed}
.btn.disabled{opacity:.45; cursor:not-allowed}
.hint{color:var(--muted); font-size:12px; line-height:1.35}
.notice{
  margin-top:12px;
  padding:12px 12px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(255,255,255,.04);
}
.noticeTitle{font-weight:800; margin-bottom:6px}
.noticeText{color:var(--muted); font-size:13px; line-height:1.45; margin-bottom:10px}
.ctaRow{display:flex; gap:10px; flex-wrap:wrap}
.result img{
  width:100%;
  border-radius:18px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
}

.modal{
  position:fixed; inset:0;
  background:rgba(0,0,0,.6);
  display:flex; align-items:center; justify-content:center;
  padding:18px;
}
.modalCard{
  width:min(520px, 92vw);
  border:1px solid var(--border);
  background:var(--card);
  border-radius:18px;
  padding:16px;
}
.modalTop{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px}
.modalTitle{font-weight:800}
.label{display:block; color:var(--muted); font-size:12px; margin:10px 0 6px}
.input{
  width:100%;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:#fff;
  border-radius:12px;
  padding:12px;
  outline:none;
}
.textarea{
  min-height:88px;
  resize:vertical;
  font-family:inherit;
  line-height:1.4;
}

.historyTop{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px}
.historyList{display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px}
.historyItem{
  border:1px solid var(--border);
  background:var(--card);
  border-radius:18px;
  padding:12px;
}
.historyItem img{width:100%; border-radius:12px; border:1px solid var(--border)}
.historyMeta{margin-top:10px; color:var(--muted); font-size:12px; line-height:1.35}
.historyActions{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}

