*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #fef9c3, #ecfdf5 40%, #f9fafb 100%);
  color: #0f172a;
}

/* App layout */
.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px;
}

/* Header */
.app-header {
  padding: 4px 2px 10px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-weight: 700;
  font-size: 18px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.brand-sub {
  font-size: 11px;
  color: #6b7280;
}

.badge {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(248, 250, 252, 0.9);
  color: #475569;
}

.header-tagline {
  margin: 6px 0 0;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* Main layout */
.main-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Visual / analysis area */
.visual-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Foot visual card */
.foot-visual-card {
  border-radius: 20px;
  padding: 10px 10px 10px;
  background: linear-gradient(135deg, #e0f2fe, #fefce8);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Image area */
.foot-image-wrap {
  position: relative;
  border-radius: 18px;
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.4);
  overflow: hidden;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.foot-image {
  max-width: 100%;
  max-height: 100%;
  display: none;
  object-fit: contain;
}

.foot-image-placeholder {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
}

.placeholder-graphic {
  margin-bottom: 6px;
  position: relative;
  width: 72px;
  height: 72px;
  margin-inline: auto;
}

.foot-shape {
  position: absolute;
  inset: 11px 16px 4px 6px;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(145deg, #a5b4fc, #4ade80);
  opacity: 0.9;
}

.foot-shadow {
  position: absolute;
  bottom: 6px;
  left: 16px;
  right: 10px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at center, #c4b5fd 0, transparent 70%);
  opacity: 0.5;
}

/* Analyzing overlay */
.analyzing-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(224, 242, 254, 0.9)
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.analyzing-overlay p {
  margin: 0;
  font-size: 13px;
  color: #0f172a;
}

.analyzing-chip {
  display: inline-flex;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  border: 1px solid rgba(125, 211, 252, 0.9);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #0ea5e9;
  opacity: 0.5;
}

.dot1 {
  animation: blink 1.1s infinite ease-in-out;
}
.dot2 {
  animation: blink 1.1s infinite ease-in-out 0.2s;
}
.dot3 {
  animation: blink 1.1s infinite ease-in-out 0.4s;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* Mode selector pills */
.mode-selector {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.mode-pill {
  flex: 1;
  border-radius: 999px;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(248, 250, 252, 0.8);
  font-size: 11px;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.mode-pill.selected {
  border-color: #22c55e;
  background: linear-gradient(135deg, #bbf7d0, #a7f3d0);
  color: #166534;
}

/* Mode gallery (thumbnail cards like LMSM) */
.mode-gallery {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.mode-card {
  flex: 1;
  border-radius: 14px;
  padding: 4px;
  background: rgba(249, 250, 251, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out,
    border-color 0.12s ease-out, background 0.12s ease-out;
}

.mode-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.4);
}

.mode-card.selected {
  border-color: #22c55e;
  background: #ecfdf5;
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.25);
}

/* we only show image, no text label */
.mode-thumb-wrap {
  width: 100%;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Result card */
.result-card {
  border-radius: 18px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.result-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.result-subtitle {
  margin: 0 0 8px;
  font-size: 12px;
  color: #6b7280;
}

/* NEW: result images row (Right/Left) */
.result-images-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.result-images-row.single-image {
  justify-content: center;
}

.result-images-row.single-image .result-image-wrapper {
  max-width: 70%;
}

.result-image-wrapper {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
}

.result-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.angles-grid {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.angle-box {
  flex: 1;
  border-radius: 14px;
  padding: 8px;
  background: #eff6ff;
  border: 1px solid rgba(129, 140, 248, 0.6);
}

.angle-label {
  font-size: 11px;
  color: #4b5563;
  margin-bottom: 2px;
}

.angle-value {
  font-size: 16px;
  font-weight: 700;
  color: #1d4ed8;
}

.result-hint {
  margin: 2px 0 6px;
  font-size: 11px;
  color: #4b5563;
}

.result-disclaimer {
  margin: 0;
  font-size: 10px;
  color: #9ca3af;
  line-height: 1.4;
}

/* CTA */
.cta-panel {
  margin-top: auto;
  padding-top: 4px;
}

.cta-button {
  width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  color: #f9fafb;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.35);
}

.cta-button:active {
  transform: translateY(1px);
  box-shadow: 0 5px 12px rgba(34, 197, 94, 0.4);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Small height tweak */
@media (max-height: 640px) {
  .header-tagline {
    font-size: 11px;
  }
  .result-title {
    font-size: 14px;
  }
  .angle-value {
    font-size: 15px;
  }
}
