/* === Style Mirror Mobile Demo - Cream & Gold Theme === */
:root {
  --bg: #F5F0E8;
  --bg2: #EDE6DA;
  --ink: #2B2B2B;
  --muted: #8A8175;
  --rule: rgba(43,43,43,0.12);
  --surface: rgba(255,255,255,0.6);
  --surface2: rgba(255,255,255,0.85);
  --accent: #C8956C;
  --accent-dark: #A67A53;
  --accent-light: rgba(200,149,108,0.1);
  --success: #5B8C5A;
  --radius: 16px;
  --font: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
  --font-serif: Georgia, 'Songti SC', serif;
  --font-mono: 'SF Mono', 'Courier New', monospace;
  /* iOS safe area */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* === Phone Frame === */
.phone-frame {
  width: 100%;
  max-width: 390px;
  height: 844px;
  background: var(--bg);
  border-radius: 40px;
  border: 8px solid #2B2B2B;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

@media (max-width: 500px) {
  body { padding: 0; }
  .phone-frame { width: 100vw; max-width: 100vw; height: 100vh; border: none; border-radius: 0; }
}

@media (min-width: 501px) {
  .phone-frame { max-width: 420px; margin: 0 auto; }
}

@media (min-width: 801px) {
  .phone-frame { max-width: 460px; }
}

@media (min-width: 1201px) {
  .phone-frame { max-width: 480px; }
}

/* === Screen System === */
.phone-screen {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.screen {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: flex;
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === Screen Header === */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  padding-top: calc(1rem + var(--safe-top));
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  border-bottom: 1px solid var(--rule);
}

.back-btn {
  width: 44px; height: 44px;
  min-width: 44px; min-height: 44px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.back-btn:active {
  transform: scale(0.92);
  background: var(--surface2);
}

.share-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.screen-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* === Screen Body === */
.screen-body {
  padding: 1.5rem;
  padding-bottom: 4rem;
  flex: 1;
}

/* === Welcome Screen === */
.screen#screen-welcome {
  justify-content: center;
  align-items: center;
  background: var(--bg);
  position: relative;
}

.welcome-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
}

.welcome-logo {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  color: var(--muted);
}

.welcome-title {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--ink);
}

.welcome-title em {
  font-style: italic;
  display: block;
}

.welcome-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.welcome-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 280px;
  margin: 0 auto 2rem;
}

/* === Buttons === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  min-height: 48px;
  border: 1.5px solid var(--accent);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  font-weight: 600;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  z-index: -1;
}

/* Hover effects only on devices that support hover (desktop) - prevents sticky hover on touch */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled)::before {
    width: 400px; height: 400px;
  }
  .btn-primary:hover:not(:disabled) {
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(200,149,108,0.3);
  }
  .upload-area:hover {
    border-color: var(--accent);
    background: var(--surface2);
  }
  .tag-btn:hover:not(.active) {
    background: var(--surface2);
    border-color: var(--accent);
    color: var(--accent);
  }
  .outfit-card:hover .outfit-card-image img {
    transform: scale(1.05);
  }
  .outfit-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(200,149,108,0.12);
  }
  .shopping-item:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border-color: var(--accent);
  }
  .shopping-item:hover .shopping-buy-btn {
    background: var(--accent);
    color: #fff;
  }
}

/* Active/tap states work on all devices */
.btn-primary:active:not(:disabled) {
  transform: scale(0.96);
  transition: transform 0.1s;
}
.btn-primary:active:not(:disabled)::before {
  width: 400px; height: 400px;
}
.btn-primary:active:not(:disabled) {
  color: #fff;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary:disabled::before {
  display: none;
}

.btn-primary svg { width: 16px; height: 16px; }

.btn-full {
  width: 100%;
  justify-content: center;
  margin-top: 2rem;
  box-sizing: border-box;
}

/* === Upload Area === */
.upload-hint {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.upload-area {
  border: 2px dashed var(--rule);
  border-radius: var(--radius);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  cursor: pointer;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.upload-area.dragover {
  border-color: var(--ink);
  background: var(--surface2);
  transform: scale(1.02);
}

.upload-placeholder {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.upload-icon {
  margin-bottom: 1rem;
  color: var(--muted);
}

.upload-placeholder p {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.upload-formats {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  opacity: 0.7;
}

/* Photo Requirements */
.photo-requirements {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.req-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.req-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.req-list li {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.req-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #8B7355);
  color: #fff;
  font-size: 0.6rem;
  flex-shrink: 0;
}

/* Privacy Notice */
.privacy-notice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: rgba(139,115,85,0.06);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.privacy-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1;
}

.privacy-text strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.privacy-text p {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.upload-preview {
  width: 100%;
  height: 100%;
  position: relative;
}

.upload-preview img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
}

.upload-replace {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--ink);
  border-radius: 100px;
  font-size: 0.7rem;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

/* === Form === */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--ink);
}

.range-display {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--bg);
  box-shadow: 0 2px 10px rgba(200,149,108,0.35);
}

input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--bg);
}

/* BMI indicator */
.bmi-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding: 0.4rem 0.8rem;
  background: var(--accent-light);
  border-radius: 100px;
  font-size: 0.72rem;
  color: var(--accent-dark);
  font-weight: 600;
}
.bmi-indicator .bmi-value {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* === Tag Selector === */
.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag-btn {
  padding: 0.6rem 1.1rem;
  min-height: 44px;
  border: 1.5px solid var(--rule);
  border-radius: 100px;
  font-family: var(--font);
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
}

.tag-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(200,149,108,0.25);
  transform: scale(1.02);
}
.tag-btn.active::after {
  content: '✓';
  font-size: 0.75rem;
  font-weight: 700;
}

/* === Outfit Selection === */
.select-hint {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.outfit-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.loading-inline {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.outfit-card {
  background: var(--surface2);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.outfit-card-image {
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
}

.outfit-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.outfit-card-image-fallback,
.outfit-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--muted);
}

.outfit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1.2rem 0;
}

.outfit-card.selected {
  border-color: var(--accent);
  border-width: 2.5px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(200,149,108,0.18);
  transform: translateY(-2px);
}

.outfit-card-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.5rem 1.2rem 0;
}

.outfit-card-desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 0.5rem 1.2rem 0;
}

.outfit-select-btn {
  width: calc(100% - 2.4rem);
  margin: 0.8rem 1.2rem 1.2rem;
  padding: 0.6rem;
  border: 1px solid var(--ink);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.3s;
}

.outfit-card.selected .outfit-select-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Outfit selection action bar */
.outfit-action-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 1rem 1.5rem;
  padding-bottom: calc(1rem + var(--safe-bottom));
  background: linear-gradient(to top, rgba(245,240,232,0.98) 60%, rgba(245,240,232,0));
  z-index: 8;
  box-sizing: border-box;
}

/* Try-on again button */
.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: 1.5px solid var(--rule);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  cursor: pointer;
  transition: all 0.25s;
  min-height: 40px;
}
.btn-retry:active {
  transform: scale(0.95);
  border-color: var(--accent);
  color: var(--accent);
}

/* Quick outfit switcher */
.quick-switch {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quick-switch::-webkit-scrollbar { display: none; }
.quick-switch-item {
  flex-shrink: 0;
  width: 56px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--rule);
  cursor: pointer;
  transition: all 0.25s;
  background: var(--surface);
}
.quick-switch-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.quick-switch-item.active {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(200,149,108,0.3);
  transform: scale(1.08);
}
.quick-switch-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.outfit-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.outfit-card-style {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.2rem;
}

.match-score {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.match-score-bar {
  width: 60px;
  height: 6px;
  background: var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

.match-score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.match-score-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
}

.outfit-item-tag {
  padding: 0.25rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 100px;
  font-size: 0.65rem;
  color: var(--muted);
}

/* === Loading Screen === */
.screen#screen-loading {
  justify-content: center;
  align-items: center;
  background: var(--bg);
}

.loading-content {
  text-align: center;
  padding: 2rem;
  width: 100%;
  max-width: 320px;
}

.loading-spinner {
  width: 64px; height: 64px;
  border: 3px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 2rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.loading-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

.loading-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin-bottom: 2rem;
  overflow: hidden;
}
.loading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 2px;
  transition: width 0.5s ease;
  width: 0%;
}

.loading-fun-text {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.5rem;
  min-height: 2.4rem;
  line-height: 1.6;
}

.loading-steps {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
  transition: all 0.3s;
}

.loading-step.active {
  color: var(--accent);
  font-weight: 600;
}

.loading-step.done {
  color: var(--success);
}

.step-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  transition: all 0.3s;
}

.loading-step.done .step-icon {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.loading-step.active .step-icon {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  animation: stepPulse 1.2s ease-in-out infinite;
}
@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,149,108,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(200,149,108,0); }
}

/* === Tab Bar === */
.tab-bar {
  display: flex;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

/* Results page sticky header wrapper */
.results-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}
.results-header .screen-header {
  position: relative;
  border-bottom: none;
}

.tab-btn {
  flex: 1;
  padding: 0.8rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

.tab-content {
  display: none;
  padding: 1.5rem;
  padding-bottom: 4rem;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === Before/After Comparison Slider === */
.compare-slider {
  width: 100%;
  margin: 0 0 1rem 0;
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--surface);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid var(--rule);
}

.compare-slider-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 100px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  animation: hintPulse 2s ease-in-out;
}
@keyframes hintPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.compare-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.compare-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* After layer (AI image) - bottom layer, fully visible */
.compare-after {
  z-index: 1;
}

/* Before layer (original photo) - top layer, clipped by slider position via clip-path */
.compare-before {
  z-index: 2;
  /* Default: show left 50% (original), right 50% shows AI */
  clip-path: inset(0 50% 0 0);
}

/* Labels */
.compare-label {
  position: absolute;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 4;
  pointer-events: none;
}

.compare-label-after {
  right: 12px;
  background: rgba(0,0,0,0.5);
  color: #fff;
}

.compare-label-before {
  left: 12px;
  background: rgba(255,255,255,0.85);
  color: var(--ink);
}

/* Drag handle */
.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%; /* Will be set by JS, default to show AI image fully */
  width: 48px;
  z-index: 5;
  cursor: ew-resize;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(200,149,108,0.5);
  transform: translateX(-50%);
}

.compare-handle-circle {
  position: relative;
  z-index: 6;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 16px rgba(200,149,108,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.compare-handle-circle:active {
  transform: scale(1.1);
}

.compare-handle-circle svg {
  width: 20px;
  height: 20px;
}

/* Loading state */
.compare-slider.loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-slider.loading .compare-layer,
.compare-slider.loading .compare-handle {
  display: none;
}

.compare-slider:not(.loading) .image-placeholder {
  display: none;
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
}

.placeholder-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* === Outfit Info === */
.result-outfit-info {
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.outfit-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.outfit-style {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.outfit-color {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.outfit-skin-advice {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  color: var(--muted);
}

/* === Report Cards === */
.report-section {
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.report-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.report-section-icon {
  width: 32px; height: 32px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.report-recommendation {
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.report-reason {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.7;
}

.report-summary {
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--ink);
  line-height: 1.8;
}

.report-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.report-item-tag {
  padding: 0.3rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 100px;
  font-size: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}
.report-product-tag {
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .report-product-tag:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
  }
}

/* === Shopping List === */
.shopping-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.shopping-total-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

.shopping-total-price {
  font-size: 1.5rem;
  font-weight: 700;
}

.shopping-category {
  margin-bottom: 1rem;
}

.shopping-category-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.shopping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none !important;
  color: inherit !important;
  -webkit-tap-highlight-color: var(--accent-light);
}
.shopping-item:active {
  transform: scale(0.97);
  background: var(--accent-light);
}
.shopping-item:visited,
.shopping-item:hover,
.shopping-item:link {
  color: inherit;
  text-decoration: none;
}

.shopping-item-info {
  flex: 1;
  min-width: 0;
}

.shopping-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.shopping-item-meta {
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.shopping-item-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.shopping-item-price {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.shopping-buy-btn {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  background: transparent;
  border: 1.5px solid var(--accent, #8B7355);
  color: var(--accent, #8B7355);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.25s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.shopping-item-row {
  margin-bottom: 0.5rem;
}

.platform-badge {
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--muted);
}

/* === Scrollbar === */
.screen::-webkit-scrollbar,
.screen-body::-webkit-scrollbar,
.tab-content::-webkit-scrollbar {
  width: 0;
}

/* === Header Actions (multiple buttons in header) === */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* === Camera / Album Buttons === */
.camera-btn, .album-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.8rem;
  padding: 0.6rem 1.2rem;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
}
.camera-btn {
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
.album-btn {
  border: 1.5px solid var(--rule);
  background: transparent;
  color: var(--ink);
}
.camera-btn:active, .album-btn:active {
  transform: scale(0.96);
  opacity: 0.85;
}
.upload-btn-group {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* === Image Loading Shimmer (Issue #25) === */
.outfit-card-image img.img-loading {
  opacity: 0;
}
.outfit-card-image {
  position: relative;
}
.outfit-card-image .img-loading-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 1;
}
.outfit-card-image img.loaded + .img-loading-placeholder,
.outfit-card-image img:not(.img-loading) ~ .img-loading-placeholder {
  display: none;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Compare slider loading spinner */
.compare-slider.loading .image-placeholder {
  position: relative;
}
.compare-slider.loading .image-placeholder::before {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid var(--rule);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 0.8rem;
}
.compare-slider.loading .placeholder-icon {
  display: none;
}

/* === Black border fix (compare images) === */
.compare-layer img,
.compare-after img {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  object-fit: cover;
}

/* === Toast Notifications (Issue #30) === */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast-message {
  background: rgba(43,43,43,0.92);
  color: #F5F0E8;
  padding: 0.7rem 1.4rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-family: var(--font);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease, toastOut 0.3s ease forwards;
  animation-delay: 0s, var(--toast-duration, 2.5s);
  pointer-events: auto;
  max-width: 90vw;
  text-align: center;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-16px); }
}

/* === Landscape / Tablet Responsive (Issue #27) === */
@media (orientation: landscape) and (max-height: 500px) {
  .phone-frame {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border-width: 0;
    overflow-y: auto;
  }
  body {
    padding: 0;
    align-items: flex-start;
  }
  .screen-body {
    padding: 1rem;
    padding-bottom: 2rem;
  }
  .welcome-title {
    font-size: 2.2rem;
  }
  .welcome-desc {
    font-size: 0.78rem;
    margin-bottom: 1.2rem;
  }
  .screen-header {
    padding: 0.8rem 1rem;
    padding-top: 1.5rem;
  }
  .section-label {
    margin-top: 1rem;
    margin-bottom: 0.6rem;
  }
  .form-group {
    margin-bottom: 1rem;
  }
}

@media (min-width: 768px) {
  .tag-btn,
  .btn-primary,
  .back-btn,
  .outfit-select-btn,
  .camera-btn,
  .album-btn,
  .btn-retry {
    min-height: 44px;
  }
  .tag-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }
}

/* Ensure all interactive elements meet 44px touch target on mobile */
@media (max-width: 767px) {
  .btn-primary, .back-btn, .tag-btn, .camera-btn, .album-btn,
  .outfit-select-btn, .btn-retry, .tab-btn {
    min-height: 44px;
  }
  .screen-body {
    padding-bottom: calc(2rem + var(--safe-bottom));
  }
}

/* Upload loading overlay */
.upload-loading {
  position: absolute;
  inset: 0;
  background: rgba(245,240,232,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  z-index: 5;
  backdrop-filter: blur(4px);
}
.upload-loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.upload-loading-text {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

/* Restart confirm modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal-content {
  background: var(--bg);
  border-radius: 20px;
  padding: 1.8rem;
  margin: 1.5rem;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}
.modal-text {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.modal-actions {
  display: flex;
  gap: 0.6rem;
}
.modal-actions .btn-primary {
  flex: 1;
  justify-content: center;
  margin-top: 0;
}
.btn-secondary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.5rem;
  min-height: 48px;
  border: 1.5px solid var(--rule);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:active {
  transform: scale(0.96);
  background: var(--surface2);
}

/* Onboarding steps indicator */
.onboarding-steps {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
  transition: all 0.3s;
}
.onboarding-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--accent);
}
.onboarding-dot.done {
  background: var(--success);
}

/* AI generation failed notice */
.generation-failed-notice {
  background: rgba(220,80,60,0.08);
  border: 1px solid rgba(220,80,60,0.2);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: #a33;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Result actions row */
.result-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
  width: 100%;
  box-sizing: border-box;
}
.result-actions .btn-primary {
  flex: 1;
  justify-content: center;
  margin-top: 0;
  min-width: 0;
}
.result-actions .btn-retry {
  flex-shrink: 0;
  white-space: nowrap;
}
