:root {
  --bg: #0f1410;
  --panel: #1a211c;
  --line: #2c362f;
  --text: #f3efe6;
  --muted: #9a9588;
  --accent: #c4a574;
  --accent-2: #6b8f71;
  --danger: #e8a0a0;
  --good: #9ec9a5;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background:
  radial-gradient(1200px 600px at 10% -10%, #243028 0%, transparent 55%),
  radial-gradient(900px 500px at 100% 0%, #2a2218 0%, transparent 50%),
  var(--bg);
  color: var(--text); font-family: "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 22px 60px; }
.nav { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; }
.nav .brand { font-family: Georgia, "Times New Roman", serif; font-size: 28px; margin-right: auto; letter-spacing: 0.04em; }
.nav .brand span { color: var(--accent); font-style: italic; }
.nav a, .nav button.link {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 8px 14px; font: inherit; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}
.nav a.active, .nav a:hover, .nav button.link:hover { color: var(--text); border-color: var(--accent); }
h1 { font-family: Georgia, serif; font-weight: 500; font-size: 34px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.card {
  background: rgba(26,33,28,0.92); border: 1px solid var(--line); padding: 20px; margin-bottom: 18px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }
input, select, textarea {
  width: 100%; background: #121712; border: 1px solid var(--line); color: var(--text);
  padding: 11px 12px; font: inherit; font-size: 14px;
}
textarea { min-height: 72px; resize: vertical; }
.btn {
  border: 0; cursor: pointer; font: inherit; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 12px 18px; background: var(--accent); color: #111; font-weight: 600;
}
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.good { background: var(--accent-2); color: #111; }
.btn:disabled { opacity: 0.45; cursor: wait; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.status { min-height: 20px; color: var(--muted); font-size: 13px; margin-top: 10px; }
.status.error { color: var(--danger); }
.status.ok { color: var(--good); }
.stat { text-align: center; padding: 16px; border: 1px solid var(--line); }
.stat b { display: block; font-size: 26px; font-family: Georgia, serif; color: var(--accent); }
.stat span { color: var(--muted); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.gcard {
  border: 1px solid var(--line); background: #121712; display: flex; flex-direction: column; overflow: hidden;
}
.gcard img { width: 100%; aspect-ratio: 3/4; object-fit: contain; background: #0a0d0a; }
.gcard .body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gcard .name { font-weight: 600; }
.gcard .meta { color: var(--muted); font-size: 12px; }
.gcard .price { color: var(--accent); font-family: Georgia, serif; font-size: 18px; }
.badge {
  display: inline-block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid var(--accent); color: var(--accent);
}
.section-title {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
  margin: 28px 0 12px; display: flex; align-items: baseline; gap: 12px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.preview {
  width: 100%; min-height: 280px; background: #0a0d0a; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.preview img { max-width: 100%; max-height: 420px; object-fit: contain; }
.drop-hint { color: var(--muted); text-align: center; padding: 24px; font-size: 13px; }
.login-box { max-width: 400px; margin: 10vh auto; }
.login-box h1 { text-align: center; }
.outfit {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: stretch;
  border: 1px solid var(--line); padding: 12px; margin-bottom: 12px; background: #121712;
}
.outfit img { width: 100%; aspect-ratio: 3/4; object-fit: contain; background: #0a0d0a; }
.outfit-actions {
  min-width: 180px; display: flex; flex-direction: column; justify-content: center; gap: 8px;
}
.outfit-actions .btn { width: 100%; }
@media (max-width: 700px) { .outfit { grid-template-columns: 1fr; } }
.cam-modal {
  display: none; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.85);
  align-items: center; justify-content: center; padding: 20px;
}
.cam-modal.open { display: flex; }
.cam-panel { width: min(480px, 100%); background: var(--panel); border: 1px solid var(--line); }
.cam-stage { position: relative; aspect-ratio: 3/4; background: #000; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-guide { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.cam-guide .frame { width: 72%; height: 88%; border: 1.5px solid rgba(196,165,116,0.9); box-shadow: 0 0 0 9999px rgba(0,0,0,0.35); }
.cam-actions { display: flex; gap: 8px; padding: 12px; }
.ai-box { font-size: 12px; color: var(--muted); max-height: 180px; overflow: auto; white-space: pre-wrap; background: #0a0d0a; padding: 10px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
td img { height: 56px; width: 42px; object-fit: cover; background: #0a0d0a; }

/* Horizontal recommendation rails */
.rail-head {
  display: flex; align-items: center; gap: 12px; margin: 28px 0 12px;
}
.rail-count { color: var(--accent); letter-spacing: 0.06em; text-transform: none; font-size: 12px; }
.rail-nav { display: flex; gap: 6px; flex-shrink: 0; }
.rail-btn {
  width: 36px; height: 36px; border: 1px solid var(--line); background: #121712; color: var(--text);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0;
}
.rail-btn:hover { border-color: var(--accent); color: var(--accent); }
.rail {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 18px; margin: 0 -4px 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); }
.rail-empty { padding: 12px; }
.slide-card {
  flex: 0 0 min(220px, 78vw); scroll-snap-align: start;
  border: 1px solid var(--line); background: #121712; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.slide-card img { width: 100%; aspect-ratio: 3/4; object-fit: contain; background: #0a0d0a; }
.slide-card .body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.slide-card .name { font-weight: 600; font-size: 14px; }
.slide-card .meta { color: var(--muted); font-size: 12px; }
.slide-card .price { color: var(--accent); font-family: Georgia, serif; font-size: 17px; }
.slide-card .btn { width: 100%; margin-top: auto; }
.rank-pill {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: rgba(15,20,16,0.88); border: 1px solid var(--accent); color: var(--accent);
  font-size: 11px; letter-spacing: 0.06em; padding: 3px 8px;
}
.fit-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fit-label { font-size: 12px; color: var(--good); }
.stars { letter-spacing: 1px; font-size: 14px; line-height: 1; }
.stars .on { color: var(--accent); }
.stars .off { color: #3a433c; }
.slide-outfit { flex-basis: min(280px, 88vw); }
.outfit-thumbs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: #0a0d0a;
}
.outfit-thumbs img { aspect-ratio: 3/4; width: 100%; object-fit: contain; }

/* Alankar GPU progress */
.progress-wrap {
  display: flex; align-items: center; gap: 14px; width: min(420px, 92%);
  padding: 18px 16px; text-align: left;
}
.progress-spin {
  width: 28px; height: 28px; flex-shrink: 0;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: alankar-spin 0.8s linear infinite;
}
@keyframes alankar-spin { to { transform: rotate(360deg); } }
.progress-copy { flex: 1; min-width: 0; }
.progress-title { font-size: 14px; color: var(--text); margin-bottom: 8px; }
.progress-bar {
  height: 8px; background: #0a0d0a; border: 1px solid var(--line); overflow: hidden;
}
.progress-bar > span {
  display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.35s ease;
}
.progress-meta { margin-top: 8px; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.progress-pct { color: var(--accent); font-weight: 600; }

/* Persistent try-on progress on the results card */
.preview.loading-card {
  position: relative; min-height: 420px;
  background:
    radial-gradient(500px 280px at 50% 30%, rgba(196,165,116,0.12), transparent 60%),
    #0a0d0a;
}
.progress-card {
  width: min(360px, 90%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 28px 18px; text-align: center;
}
.progress-card-spin {
  width: 44px; height: 44px;
  border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: alankar-spin 0.85s linear infinite;
}
.progress-card-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px; font-style: italic; color: var(--accent);
  letter-spacing: 0.02em;
}
.progress-card-pct {
  font-family: Georgia, serif;
  font-size: 56px; line-height: 1; color: var(--text);
  font-weight: 500; letter-spacing: 0.04em;
}
.progress-bar-lg {
  width: 100%; height: 12px;
}
.progress-card-phase {
  font-size: 13px; color: var(--muted); min-height: 1.2em;
}
