:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --soft: #f8fafc;
  --card: #ffffff;
  --line: #e5e7eb;
  --accent: #111827;
  --purple: #7c3aed;
  --gold: #f1c27d;
  --green: #047857;
  --red: #b91c1c;
  --shadow: 0 18px 48px rgba(17, 24, 39, .10);
  --radius: 24px;
  --nav-height: 72px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #fffaf4; }
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(241,194,125,.32), transparent 23rem),
    radial-gradient(circle at bottom right, rgba(124,58,237,.11), transparent 26rem),
    #fffaf4;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, video, canvas { max-width: 100%; }
.skip-link { position: absolute; left: -999px; top: 12px; z-index: 100; background: #fff; color: #111827; padding: 10px 14px; border-radius: 999px; }
.skip-link:focus { left: 12px; }
.app-shell { min-height: 100svh; padding: max(16px, env(safe-area-inset-top)) 14px calc(var(--nav-height) + 18px + env(safe-area-inset-bottom)); }
.app-container { width: min(1080px, 100%); margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.logo-lockup { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-lockup img { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 10px 28px rgba(17,24,39,.14); }
.logo-lockup strong { display: block; font-size: 1.42rem; letter-spacing: -.05em; line-height: 1; }
.logo-lockup span { display: block; color: var(--muted); font-size: .78rem; font-weight: 750; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.8); border-radius: 999px; padding: 8px 12px; color: #344054; font-size: .84rem; font-weight: 800; white-space: nowrap; }
.status-dot { width: 9px; height: 9px; border-radius: 999px; background: #d0d5dd; }
.status-dot.ready { background: var(--green); }
.status-dot.warn { background: #d97706; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; align-items: stretch; }
.card, .hero-card, .panel { background: rgba(255,255,255,.9); border: 1px solid rgba(17,24,39,.08); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card { padding: clamp(22px, 5vw, 42px); min-height: 420px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { color: var(--purple); font-size: .76rem; line-height: 1.2; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 14px; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1 { font-size: clamp(2.6rem, 10vw, 5.9rem); line-height: .9; letter-spacing: -.08em; margin: 0 0 18px; }
h2 { font-size: clamp(1.45rem, 4vw, 2.25rem); line-height: 1; letter-spacing: -.05em; margin: 0 0 14px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
p { color: var(--muted); line-height: 1.55; }
.hero-card p { font-size: 1.05rem; max-width: 620px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn { min-height: 46px; border: 0; border-radius: 999px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 850; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .nav-item:focus-visible { outline: 3px solid rgba(124,58,237,.55); outline-offset: 3px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 14px 32px rgba(17,24,39,.20); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost { background: #f3f4f6; color: #1f2937; }
.btn.danger { background: #fee2e2; color: var(--red); }
.btn.full { width: 100%; }
.btn.small { min-height: 38px; padding: 0 13px; font-size: .88rem; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 26px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.step span { width: 30px; height: 30px; border-radius: 999px; background: #111827; color: #fff; display: inline-grid; place-items: center; font-weight: 900; margin-bottom: 10px; }
.step p { margin: 0; font-size: .93rem; }
.preview-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.fit-photo-placeholder { min-height: 260px; border-radius: 24px; overflow: hidden; background: linear-gradient(145deg,#111827,#7c3aed 64%,#f1c27d); display: grid; place-items: center; position: relative; color: #fff; }
.fit-photo-placeholder::before { content: ""; width: 92px; height: 92px; border-radius: 50%; background: rgba(255,255,255,.92); position: absolute; top: 52px; }
.fit-photo-placeholder::after { content: ""; width: 190px; height: 190px; border-radius: 50% 50% 0 0; border: 38px solid rgba(255,255,255,.88); border-bottom: 0; position: absolute; top: 150px; }
.result-mini { background: #111827; color: #fff; border-radius: 22px; padding: 18px; }
.result-mini span { color: var(--gold); font-weight: 900; text-transform: uppercase; font-size: .74rem; letter-spacing: .1em; }
.result-mini strong { display: block; font-size: 2.4rem; letter-spacing: -.07em; margin: 4px 0; }
.result-mini p { color: rgba(255,255,255,.8); margin: 0; }
.nav-shell { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(255,250,244,.96), rgba(255,250,244,.74)); backdrop-filter: blur(18px); border-top: 1px solid rgba(17,24,39,.08); }
.nav { width: min(620px, 100%); height: var(--nav-height); margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: #fff; border: 1px solid rgba(17,24,39,.08); border-radius: 26px; padding: 8px; box-shadow: 0 15px 45px rgba(17,24,39,.14); }
.nav-item { border-radius: 18px; color: #667085; text-decoration: none; font-size: .76rem; font-weight: 850; display: grid; place-items: center; gap: 3px; }
.nav-item.active { background: #111827; color: #fff; }
.nav-item b { font-size: 1.05rem; line-height: 1; }
.screen { display: grid; gap: 16px; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 2px; }
.section-header p { margin: 4px 0 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: grid; gap: 7px; }
.form-field label { font-size: .87rem; font-weight: 850; color: #344054; }
.input, select, textarea { width: 100%; border: 1px solid #d0d5dd; background: #fff; color: #111827; border-radius: 16px; padding: 12px 13px; min-height: 46px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.panel { padding: clamp(16px, 4vw, 24px); }
.capture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.capture-option { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 16px; min-height: 138px; text-align: left; display: grid; gap: 8px; align-content: start; }
.capture-option strong { font-size: 1rem; }
.capture-option span { color: var(--muted); line-height: 1.35; font-size: .9rem; }
.capture-option input { display: none; }
.image-preview { border-radius: 24px; border: 1px solid var(--line); background: #fff; padding: 10px; display: grid; gap: 10px; }
.image-preview img { width: 100%; max-height: 540px; object-fit: contain; border-radius: 18px; background: #f3f4f6; }
.preview-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.loading-card { display: grid; gap: 14px; place-items: center; text-align: center; padding: 36px; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 5px solid #e5e7eb; border-top-color: #111827; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-card { background: #fff; border: 1px solid rgba(17,24,39,.08); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
.result-hero { padding: 22px; background: #111827; color: #fff; display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: center; }
.score-ring { width: 100px; height: 100px; border-radius: 50%; border: 9px solid rgba(241,194,125,.96); display: grid; place-items: center; color: #fff; font-size: 2.1rem; font-weight: 950; letter-spacing: -.07em; }
.result-hero h2 { color: #fff; margin-bottom: 8px; }
.result-hero p { color: rgba(255,255,255,.76); margin: 0; }
.result-body { padding: 18px; display: grid; gap: 14px; }
.main-fix { border: 2px solid #111827; border-radius: 22px; padding: 18px; background: #fffbeb; }
.main-fix span, .mini-label { display: block; color: #7c3aed; text-transform: uppercase; letter-spacing: .11em; font-size: .72rem; font-weight: 950; margin-bottom: 8px; }
.main-fix strong { font-size: clamp(1.18rem, 3vw, 1.55rem); line-height: 1.2; }
.result-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
ul.clean { margin: 0; padding-left: 20px; color: #374151; line-height: 1.65; }
.kc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kc-box { border-radius: 18px; border: 1px solid var(--line); background: #fff; padding: 14px; }
.kc-box h3 { font-size: .88rem; text-transform: uppercase; letter-spacing: .08em; color: #667085; }
.note-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.note { border-radius: 18px; background: #f8fafc; border: 1px solid var(--line); padding: 14px; }
.note p { margin: 0; font-size: .92rem; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.looks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.look-card { border: 1px solid var(--line); border-radius: 22px; background: #fff; padding: 14px; display: grid; gap: 10px; box-shadow: 0 10px 30px rgba(17,24,39,.06); }
.look-thumb { aspect-ratio: 3 / 4; border-radius: 18px; background: #f3f4f6; overflow: hidden; display: grid; place-items: center; color: #667085; font-weight: 800; }
.look-thumb img { width: 100%; height: 100%; object-fit: cover; }
.look-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.look-meta strong { font-size: 1.6rem; letter-spacing: -.06em; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #f3f4f6; color: #344054; padding: 6px 10px; font-size: .78rem; font-weight: 850; }
.empty-state { border: 1px dashed #cbd5e1; border-radius: 24px; padding: 30px; text-align: center; background: rgba(255,255,255,.7); }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.switch-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: #fff; }
.switch-row p { margin: 3px 0 0; font-size: .9rem; }
.switch { position: relative; display: inline-block; width: 54px; height: 32px; flex: 0 0 54px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #d0d5dd; transition: .2s; border-radius: 999px; }
.slider:before { content: ""; position: absolute; height: 26px; width: 26px; left: 3px; bottom: 3px; background: white; transition: .2s; border-radius: 50%; box-shadow: 0 4px 12px rgba(17,24,39,.16); }
.switch input:checked + .slider { background: #111827; }
.switch input:checked + .slider:before { transform: translateX(22px); }
.auth-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 22px; padding: 14px; background: #fff; }
.auth-card form { display: flex; gap: 8px; align-items: center; min-width: min(480px,100%); }
.auth-card input { min-width: 0; }
.camera-overlay { position: fixed; inset: 0; z-index: 40; padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom)); background: rgba(17,24,39,.86); display: grid; place-items: center; }
.camera-card { width: min(620px, 100%); background: #fff; border-radius: 28px; padding: 16px; display: grid; gap: 12px; box-shadow: 0 28px 80px rgba(0,0,0,.35); }
.camera-view { background: #111827; border-radius: 22px; overflow: hidden; min-height: 320px; display: grid; place-items: center; color: #fff; }
.camera-view video { width: 100%; max-height: 70svh; object-fit: contain; display: block; }
.install-panel { border: 1px solid #d6bbfb; background: #f4f3ff; border-radius: 22px; padding: 16px; margin-bottom: 14px; }
.install-panel h2 { font-size: 1.2rem; margin-bottom: 8px; }
.install-panel p, .install-panel li { color: #475467; line-height: 1.55; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-height) + 30px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(30px); z-index: 60; max-width: min(520px, calc(100% - 28px)); padding: 12px 16px; border-radius: 999px; background: #111827; color: #fff; box-shadow: 0 16px 44px rgba(17,24,39,.24); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; font-weight: 800; font-size: .92rem; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.offline-card { width: min(540px, calc(100% - 28px)); margin: 14vh auto; background: #fff; border-radius: 28px; padding: 28px; box-shadow: var(--shadow); }
@media (max-width: 860px) {
  .hero-grid, .form-grid, .result-columns, .note-grid, .compare-grid { grid-template-columns: 1fr; }
  .looks-grid { grid-template-columns: repeat(2, 1fr); }
  .capture-grid { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: 1fr; }
  .auth-card, .auth-card form { align-items: stretch; flex-direction: column; }
}
@media (max-width: 520px) {
  :root { --nav-height: 68px; }
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .topbar { align-items: flex-start; }
  .status-pill { max-width: 48vw; white-space: normal; justify-content: center; text-align: center; }
  .hero-card { min-height: auto; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .nav { height: var(--nav-height); border-radius: 22px; padding: 7px; gap: 4px; }
  .nav-item { font-size: .68rem; border-radius: 16px; }
  .section-header { display: grid; align-items: start; }
  .result-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .kc-grid { grid-template-columns: 1fr 1fr; }
  .looks-grid { grid-template-columns: 1fr; }
  .action-row { display: grid; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


.voice-advice-card {
  border: 1px solid rgba(124, 58, 237, .22);
  background: linear-gradient(135deg, #f5f3ff, #fff7ed);
  border-radius: 22px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.voice-advice-card p { margin: 0; color: #344054; line-height: 1.55; }
.voice-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 620px) {
  .voice-advice-card { grid-template-columns: 1fr; }
  .voice-controls { justify-content: stretch; }
}

.premium-hero {
  border: 1px solid rgba(124, 58, 237, .22);
  background: radial-gradient(circle at 10% 10%, rgba(241, 194, 125, .34), transparent 34%), linear-gradient(135deg, #111827, #3b0764);
  color: #fff;
  border-radius: 30px;
  padding: clamp(20px, 5vw, 34px);
  box-shadow: var(--shadow);
}
.premium-hero h1 { color: #fff; max-width: 780px; }
.premium-hero p { color: rgba(255,255,255,.78); max-width: 780px; }
.premium-hero .privacy-note { color: rgba(255,255,255,.72); }
.stylist-panel { display: grid; gap: 16px; }
.stylist-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr); gap: 16px; align-items: start; }
.stylist-camera { background: #111827; border-radius: 24px; overflow: hidden; min-height: 420px; display: grid; place-items: center; color: #fff; }
.stylist-camera video { width: 100%; height: 100%; max-height: 68svh; object-fit: contain; display: block; }
.camera-placeholder { padding: 28px; text-align: center; display: grid; gap: 8px; }
.camera-placeholder span { color: rgba(255,255,255,.72); }
.stylist-side { display: grid; gap: 12px; }
.checkpoint-list { display: grid; gap: 8px; }
.checkpoint { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 10px; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; text-align: left; }
.checkpoint span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #f3f4f6; color: #344054; font-weight: 950; }
.checkpoint strong { font-size: .92rem; }
.checkpoint.active { border-color: #111827; box-shadow: 0 0 0 3px rgba(17,24,39,.08); }
.checkpoint.done span { background: #dcfce7; color: #166534; }
.captured-preview { border: 1px solid var(--line); border-radius: 18px; padding: 10px; background: #fff; display: grid; gap: 10px; }
.captured-preview img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 14px; background: #f3f4f6; }
.premium-result .result-hero { background: linear-gradient(135deg, #111827, #581c87); }
.stylist-notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 861px) {
  .nav { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 860px) {
  .stylist-layout, .stylist-notes-grid { grid-template-columns: 1fr; }
  .stylist-camera { min-height: 340px; }
}
@media (max-width: 520px) {
  .nav { grid-template-columns: repeat(6, 1fr); }
  .nav-item { font-size: .61rem; }
  .nav-item b { font-size: .92rem; }
}

.nav { grid-template-columns: repeat(6, 1fr); }

.auth-gate h1 { font-size: clamp(2.1rem, 7vw, 4.5rem); max-width: 820px; }
.auth-required-card { border-color: rgba(124,58,237,.28); background: linear-gradient(135deg, #ffffff, #f5f3ff); }

.camera-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 4px;
}
.camera-facing-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f0ff;
  color: #5b21b6;
  font-size: 0.88rem;
  font-weight: 800;
  border: 1px solid rgba(91, 33, 182, 0.18);
}

@media (max-width: 560px) {
  .camera-tools { display: grid; grid-template-columns: 1fr; }
  .camera-facing-pill { justify-content: center; width: 100%; }
}
