/* ==========================================================================
   BRA SIZING & SHAPE PWA DESIGN SYSTEM (VANILLA CSS)
   Aesthetics: Premium Glassmorphism, Warm Rose Golds, Fluid Micro-interactions
   ========================================================================== */

/* ----------------------------------------------------
   1. Theme Variables & Custom Properties
   ---------------------------------------------------- */
:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: 'Outfit', 'SF Pro Display', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  /* HSL Tailored Color Palette */
  --primary-hue: 45;
  --primary: hsl(var(--primary-hue), 85%, 60%);      /* Rich Gold */
  --primary-dark: hsl(var(--primary-hue), 85%, 45%); /* Deeper Gold */
  --primary-glow: hsla(var(--primary-hue), 89%, 81%, 0.15);
  
  --secondary: #38bdf8;                              /* Sky Blue for hints/links */
  --success: #10b981;                                /* Success Green */
  --warning: #f59e0b;                                /* Amber Warning */
  
  /* Transition Constants */
  --ease-soft: cubic-bezier(0.25, 0.8, 0.25, 1);
  --trans-fast: 0.2s var(--ease-soft);
  --trans-med: 0.35s var(--ease-soft);
  
  /* Layout Dimensions */
  --header-height: 60px;
  --navbar-height: 64px;
  --max-width: 480px; /* Locked viewport width for high-end mobile app feel */
}

/* Dark Mode Variables (Default) */
.dark-mode {
  --bg-app: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 100%);
  --bg-panel: rgba(15, 23, 42, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --card-bg: rgba(30, 41, 59, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(15, 23, 42, 0.6);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-focus-border: var(--primary-dark);
  --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --nav-bg: rgba(15, 23, 42, 0.75);
  --header-bg: rgba(15, 23, 42, 0.75);
  --btn-sec-bg: rgba(255, 255, 255, 0.06);
  --btn-sec-text: #e2e8f0;
  --badge-bg: rgba(244, 63, 94, 0.15);
  --badge-text: #f43f5e;
}

/* Light Mode Variables Override */
.light-mode {
  --bg-app: radial-gradient(circle at 50% 0%, #fff1f2 0%, #f8fafc 100%);
  --bg-panel: rgba(248, 250, 252, 0.4);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(244, 63, 94, 0.12);
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-border: rgba(15, 23, 42, 0.08);
  --input-focus-border: var(--primary-dark);
  --shadow-main: 0 8px 32px 0 rgba(244, 63, 94, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --header-bg: rgba(255, 255, 255, 0.85);
  --btn-sec-bg: rgba(15, 23, 42, 0.05);
  --btn-sec-text: #334155;
  --badge-bg: rgba(244, 63, 94, 0.08);
  --badge-text: #e11d48;
}

/* ----------------------------------------------------
   2. Reset & Base Layout
   ---------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background: var(--bg-app);
  color: var(--text-main);
  transition: background 0.5s ease;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* App Container Wrapper: Locked for App Store Feel */
.app-viewport {
  width: 100%;
  max-width: var(--max-width);
  height: calc(100% - var(--header-height) - var(--navbar-height));
  margin-top: var(--header-height);
  margin-bottom: var(--navbar-height);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for clean App appearance */
.app-viewport::-webkit-scrollbar {
  display: none;
}

/* ----------------------------------------------------
   3. Header Navigation & Navigation Bar
   ---------------------------------------------------- */
.app-header {
  position: fixed;
  top: 0;
  width: 100%;
  max-width: var(--max-width);
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-dark);
}

.header-img-logo {
  animation: float 6s ease-in-out infinite;
}

.header-logo h1 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.header-svg-icon {
  animation: float 4s ease-in-out infinite;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans-fast);
}

.icon-btn:hover {
  background: var(--btn-sec-bg);
  transform: scale(1.05);
}

/* Bottom App Navigation Bar */
.app-navbar {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: var(--max-width);
  height: var(--navbar-height);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-tab {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--trans-fast);
  padding: 8px 16px;
  border-radius: 12px;
}

.nav-tab svg {
  transition: transform 0.3s ease;
}

.nav-tab span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-tab.active {
  color: var(--primary-dark);
}

.nav-tab.active svg {
  transform: translateY(-2px) scale(1.1);
  filter: drop-shadow(0 2px 8px var(--primary-glow));
}

/* ----------------------------------------------------
   4. Glassmorphism Design Tokens
   ---------------------------------------------------- */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-main);
  transition: var(--trans-med);
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.result-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  filter: blur(15px);
  opacity: 0.12;
  pointer-events: none;
}

/* ----------------------------------------------------
   5. Interactive Typography & Headings
   ---------------------------------------------------- */
h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.panel-hero {
  margin-bottom: 24px;
}

.panel-hero p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-title {
  margin: 32px 0 8px 0;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.section-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

/* ----------------------------------------------------
   6. Custom Input Controls
   ---------------------------------------------------- */
.control-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.control-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-select {
  width: 100%;
  height: 48px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  border-radius: 12px;
  padding: 0 16px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--trans-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
}

.custom-select:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Toggle Group for units */
.toggle-group {
  display: flex;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 4px;
  height: 48px;
}

.toggle-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--trans-fast);
}

.toggle-btn.active {
  background: var(--primary-dark);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}

/* Text & Number Fields */
.inputs-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.label-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  height: 52px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 0 48px 0 16px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: var(--trans-fast);
}

.input-wrapper input:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.unit-indicator {
  position: absolute;
  right: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
}

.error-msg {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 4px;
  display: none;
  font-weight: 500;
}

.input-field.error input {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.input-field.error .error-msg {
  display: block;
}

/* ----------------------------------------------------
   7. Buttons (Rose Gold / Glass effects)
   ---------------------------------------------------- */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border: none;
  height: 52px;
  border-radius: 14px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--trans-fast);
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--btn-sec-bg);
  color: var(--btn-sec-text);
  border: 1px solid var(--card-border);
  height: 52px;
  border-radius: 14px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0 24px;
  cursor: pointer;
  transition: var(--trans-fast);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary-sm {
  background: var(--btn-sec-bg);
  color: var(--btn-sec-text);
  border: 1px solid var(--card-border);
  height: 38px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--trans-fast);
}

.btn-secondary-sm:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-arrow {
  transition: transform 0.3s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-block {
  width: 100%;
}

/* ----------------------------------------------------
   8. Results Display Aesthetics
   ---------------------------------------------------- */
.results-pane {
  animation: slideUp 0.5s var(--ease-soft) forwards;
}

.result-card {
  text-align: center;
  border: 2px solid var(--primary-glow);
}

.result-eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

.result-size-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.18);
  border-radius: 16px;
  margin-bottom: 24px;
}

.result-size-badge h3 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  text-shadow: 0 0 20px rgba(253, 164, 175, 0.35);
  margin-bottom: 4px;
}

.result-size-badge span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Sisters Sizing Layout */
.sisters-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.sister-box {
  flex: 1;
  background: var(--btn-sec-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--trans-fast);
}

.sister-box.active {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.04);
}

.sister-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sister-box strong {
  font-size: 1.15rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
}

.sister-note {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.result-fit-note {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-top: 1px solid var(--card-border);
  padding-top: 16px;
  text-align: left;
}

.save-profile-shortcut {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

/* Conversions Grid */
.conversions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.conv-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conv-card span {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.conv-card strong {
  font-size: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
}

/* ----------------------------------------------------
   9. Custom Amazon Affiliate Shopping Elements
   ---------------------------------------------------- */
.amazon-links-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.amazon-shop-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  color: #ffffff !important;
  text-decoration: none;
  transition: var(--trans-med);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.amazon-shop-btn:hover {
  transform: translateY(-2px);
  border-color: #f59e0b; /* Amazon Gold highlight */
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.15);
}

.amazon-shop-btn:active {
  transform: translateY(0);
}

.amazon-btn-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.amazon-btn-logo {
  width: 32px;
  height: 32px;
  background: #f59e0b;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}

.amazon-btn-text h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: #f8fafc;
  text-align: left;
}

.amazon-btn-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: left;
}

.amazon-shop-btn svg {
  color: #f59e0b;
  transition: transform 0.3s ease;
}

.amazon-shop-btn:hover svg {
  transform: translateX(4px);
}

/* ----------------------------------------------------
   10. Quiz Styling & Progressive Indicators
   ---------------------------------------------------- */
.quiz-card {
  padding-bottom: 20px;
}

.quiz-progress {
  margin-bottom: 24px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--btn-sec-bg);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  width: 0%;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--primary-glow);
}

.quiz-q-header {
  margin-bottom: 24px;
}

.quiz-q-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
}

.quiz-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.quiz-option {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 14px;
  padding: 16px 20px;
  text-align: left;
  cursor: pointer;
  transition: var(--trans-med);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quiz-option:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.02);
}

.quiz-option strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  transition: color 0.2s ease;
}

.quiz-option span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.quiz-option.is-selected {
  border-color: var(--primary-dark);
  background: rgba(244, 63, 94, 0.06);
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.1);
}

.quiz-option.is-selected strong {
  color: var(--primary);
}

.quiz-controls {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--card-border);
  padding-top: 20px;
}

.quiz-controls .spacer {
  flex: 1;
}

.quiz-results-pane {
  animation: slideUp 0.5s var(--ease-soft) forwards;
}

.shape-desc {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: left;
  border-top: 1px solid var(--card-border);
  padding-top: 16px;
  margin-top: 16px;
}

#shapeResultTitle {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.styles-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.style-rec-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.style-rec-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.style-rec-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.fit-tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fit-tips-list li {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  position: relative;
  padding-left: 20px;
}

.fit-tips-list li::before {
  content: "♡";
  position: absolute;
  left: 0;
  color: var(--primary-dark);
  font-weight: 700;
}

.quiz-amazon-section {
  animation: slideUp 0.5s var(--ease-soft) forwards;
}

/* ----------------------------------------------------
   11. Fit Diary & History Logging
   ---------------------------------------------------- */
.profiles-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  transition: var(--trans-med);
}

.profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.profile-card-header h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.profile-size-pill {
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.profile-card-details {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--card-border);
  padding-top: 10px;
  margin-bottom: 14px;
}

.profile-card-details span strong {
  color: var(--text-main);
}

.profile-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-btn-delete {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px;
  border-radius: 6px;
  transition: var(--trans-fast);
}

.profile-btn-delete:hover {
  background: rgba(239, 68, 68, 0.08);
}

.profile-shop-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.profile-amazon-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--btn-sec-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  transition: var(--trans-fast);
}

.profile-amazon-mini:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.04);
}

.profile-amazon-mini span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 240px;
}

/* ----------------------------------------------------
   12. Guides Pane (Measurement Info)
   ---------------------------------------------------- */
.guide-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.guide-step:last-child {
  margin-bottom: 0;
}

.step-badge {
  width: 28px;
  height: 28px;
  background: var(--primary-dark);
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.step-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Traffic links styling */
.links-nav-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav-link-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--text-main);
  transition: var(--trans-med);
}

.nav-link-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-main);
}

.card-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 85%;
  text-align: left;
}

.link-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-link-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-link-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.nav-link-card svg {
  color: var(--text-muted);
  transition: var(--trans-fast);
}

.nav-link-card:hover svg {
  color: var(--primary-dark);
  transform: translate(2px, -2px);
}

/* Footer in Info Pane */
.app-footer {
  text-align: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
}

.app-footer p:first-child {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.app-footer p:last-child {
  font-size: 0.7rem;
}

/* ----------------------------------------------------
   13. Core App Panels View Switching
   ---------------------------------------------------- */
.app-panel {
  display: none;
}

.app-panel.active {
  display: block;
  animation: fadeIn 0.4s var(--ease-soft) forwards;
}

/* ----------------------------------------------------
   14. PWA Installation Drawer
   ---------------------------------------------------- */
.install-banner {
  position: fixed;
  bottom: calc(var(--navbar-height) + 16px);
  left: 16px;
  right: 16px;
  max-width: calc(var(--max-width) - 32px);
  margin: 0 auto;
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--primary);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.install-banner.hidden {
  display: none !important;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-icon img {
  border-radius: 10px;
}

.banner-text h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.banner-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.banner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Utilities */
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.p-4 { padding: 16px; }
.flex-row { display: flex; gap: 12px; }
.w-50 { width: 50%; }

/* ----------------------------------------------------
   15. Keyframes & Animation Tokens
   ---------------------------------------------------- */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(0px); }
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------------------------------------------------
   15. Toast Notification
   ---------------------------------------------------- */
.app-toast {
  position: fixed;
  bottom: calc(var(--navbar-height) + 20px);
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  white-space: nowrap;
  animation: slideUp 0.3s var(--ease-soft) forwards;
  pointer-events: none;
}

.app-toast.hidden {
  display: none;
}

/* ----------------------------------------------------
   16. Save Name Modal
   ---------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s var(--ease-soft) forwards;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 360px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-card h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-card input[type="text"] {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: var(--trans-fast);
}

.modal-card input[type="text"]:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ----------------------------------------------------
   17. Offline Status Badge
   ---------------------------------------------------- */
.offline-badge {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  /* Centre within the app's max-width column, not the full viewport */
  left: 50%;
  transform: translateX(-50%);
  /* Ensure it never exceeds the app card width */
  max-width: calc(var(--max-width) - 48px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50px;
  z-index: 8500;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: slideUp 0.3s var(--ease-soft) forwards;
  pointer-events: none;
}

.offline-badge.hidden { display: none; }

/* ----------------------------------------------------
   18. iOS Add to Home Screen Guide
   ---------------------------------------------------- */
.ios-guide {
  position: fixed;
  bottom: calc(var(--navbar-height) + 12px);
  /* Use transform-based centering so it stays inside the app column */
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 24px), calc(var(--max-width) - 24px));
  max-width: 440px;
  background: rgba(30, 27, 75, 0.97);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 16px;
  padding: 14px 16px;
  z-index: 8000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);
  animation: slideUp 0.35s var(--ease-soft) forwards;
}

.ios-guide.hidden { display: none; }

.ios-guide-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #94a3b8;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-guide-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 20px;
}

.ios-guide-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
}

.ios-guide-text strong {
  display: block;
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.ios-guide-text p {
  color: #94a3b8;
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 0;
}

.ios-guide-text em {
  color: #eab308;
  font-style: normal;
  font-weight: 600;
}

.ios-share-svg {
  display: inline-block;
  vertical-align: middle;
  color: #60a5fa;
  margin: 0 1px;
}

/* ----------------------------------------------------
   19. Copy & Share Quick Action Buttons
   ---------------------------------------------------- */
.result-quick-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 10px 0 14px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font-main);
  transition: var(--trans-fast);
  -webkit-tap-highlight-color: transparent;
}

.quick-action-btn:active {
  transform: scale(0.95);
  background: rgba(255,255,255,0.12);
}

.quick-action-share {
  background: rgba(234, 179, 8, 0.1);
  border-color: rgba(234, 179, 8, 0.25);
  color: #eab308;
}

.quick-action-share:active {
  background: rgba(234, 179, 8, 0.2);
}

/* ----------------------------------------------------
   20. Sports Bra Recommender Card
   ---------------------------------------------------- */
.sports-rec-card {
  margin-bottom: 20px;
}

.sports-rec-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sports-rec-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.sports-level-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 50px;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.sports-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 14px;
}

.sports-styles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sport-style-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 50px;
}

/* ----------------------------------------------------
   21. Fit Problem Diagnostics Accordion
   ---------------------------------------------------- */
.fit-diag-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fit-diag-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  transition: var(--trans-fast);
}

.fit-diag-item summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.fit-diag-item summary::-webkit-details-marker { display: none; }

.fit-diag-item summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1;
  transition: transform 0.25s var(--ease-soft);
}

.fit-diag-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--primary);
}

.fit-diag-item[open] {
  border-color: rgba(234, 179, 8, 0.2);
}

.fit-diag-item[open] summary {
  color: var(--primary);
  border-bottom: 1px solid var(--card-border);
}

.diag-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.diag-answer {
  padding: 14px 16px;
  animation: fadeIn 0.2s var(--ease-soft) forwards;
}

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

.diag-answer strong {
  color: var(--primary);
}

.mb-3 { margin-bottom: 12px; }

/* ----------------------------------------------------
   22. Calculator Hero — Redesigned
   ---------------------------------------------------- */
.calc-hero { padding-bottom: 4px; }

.hero-badge {
  display: inline-block;
  background: rgba(234, 179, 8, 0.1);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.25);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 12px;
}

.calc-hero h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 10px;
  letter-spacing: -0.03em;
}

.hero-gradient {
  background: linear-gradient(135deg, #eab308 0%, #f97316 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.calc-hero p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 18px;
}

.hero-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #eab308;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-step-arrow { color: rgba(255,255,255,0.15); font-size: 0.8rem; }

/* ----------------------------------------------------
   23. Diary Profile Cards — Redesigned
   ---------------------------------------------------- */
.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 12px;
  transition: var(--trans-fast);
}

.pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--card-border);
  gap: 10px;
}

.pc-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(234,179,8,0.25), rgba(249,115,22,0.2));
  border: 1.5px solid rgba(234,179,8,0.3);
  color: #eab308;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pc-name-info { min-width: 0; }

.pc-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-date { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; display: block; }

.pc-size-badge {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #0f172a;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 50px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.pc-system {
  font-size: 0.52rem;
  font-weight: 700;
  opacity: 0.65;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pc-metrics {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
}

.pc-metric { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pc-metric-label { font-size: 0.62rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.pc-metric-value { font-size: 0.88rem; font-weight: 700; color: var(--text-main); }
.pc-metric-divider { width: 1px; height: 28px; background: var(--card-border); }

.pc-shop-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--card-border);
}

.pc-shop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 50px;
  text-decoration: none;
  transition: var(--trans-fast);
}

.pc-shop-btn:active { background: rgba(234,179,8,0.1); border-color: rgba(234,179,8,0.25); color: #eab308; }

.pc-footer { display: flex; justify-content: flex-end; padding: 8px 14px; }

.pc-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-main);
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--trans-fast);
}

.pc-delete-btn:hover { color: #ef4444; }
