/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Static background — black + sage radial glow ──────── */
#yt-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -5%,  rgba(52, 95, 62, 0.42) 0%, transparent 70%),
    radial-gradient(ellipse 55% 40% at 15% 105%, rgba(36, 72, 46, 0.28) 0%, transparent 65%),
    #07090a;
}
#yt-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.09;
  pointer-events: none;
}

/* ── Welcome active: hide everything except the video ────── */
body.welcome-active .app-header      { display: none !important; }
body.welcome-active .app-footer      { display: none !important; }
body.welcome-active .bottom-tab-bar  { display: none !important; }
body.welcome-active main > *:not(#welcomeScreen) { display: none !important; }

/* ─── Cannabis leaf canvas ───────────────────────────────── */
#nuggetCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}

/* ─── Design tokens ─────────────────────────────────────── */
:root {
  /* RML logo palette */
  --teal:        #1B5F82;
  --teal-light:  #2A85B3;
  --teal-pale:   #1A3A4D;
  --sage:        #7A9B6C;
  --sage-light:  #A0BF92;
  --sage-pale:   #2A3D28;

  /* Dark surfaces */
  --bg:          #0D1B24;
  --surface-1:   #132232;
  --surface-2:   #192C3E;
  --surface-3:   #1F3448;

  /* Accents */
  --gold:        #E8A820;
  --gold-pale:   #2A2010;

  /* Crohn's */
  --crohns-bg:   #0F2A1E;
  --crohns-mid:  #2A6B4A;
  --crohns-fg:   #4DCE87;
  --crohns-dk:   #89E8B4;

  /* Text */
  --text-1:      #F0F4F8;
  --text-2:      #8BA8BE;
  --text-3:      #4A6880;

  /* Borders */
  --sep:         rgba(255,255,255,0.07);
  --sep-bright:  rgba(255,255,255,0.12);

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:   0 6px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 16px 48px rgba(0,0,0,0.5);

  /* Radii */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  26px;

  /* Fonts */
  --font-display: -apple-system, 'SF Pro Display', BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-text:    -apple-system, 'SF Pro Text',    BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-serif:   'Playfair Display', Georgia, serif;
}

/* ─── Base ──────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-text);
  background:  transparent;
  color:       var(--text-1);
  min-height:  100vh;
  line-height: 1.6;
  font-size:   16px;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ────────────────────────────────────────────── */
.page-wrap {
  max-width:      640px;
  margin:         0 auto;
  padding:        0 0 5rem;
  position:       relative;
  z-index:        2;
  display:        flex;
  flex-direction: column;
  min-height:     100dvh;
}

main {
  flex:            1;
  display:         flex;
  flex-direction:  column;
  justify-content: flex-start;
  padding:         0.65rem 1rem 0;
}

/* ─── Header ────────────────────────────────────────────── */
.app-header {
  background:     rgba(8, 16, 12, 0.72);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  text-align:     center;
  /* Push content below the status bar / Dynamic Island in standalone PWA mode */
  padding:        calc(env(safe-area-inset-top) + 0.6rem) 1.5rem 0.5rem;
  border-bottom:  1px solid var(--sep-bright);
  position:       relative;
  overflow:       hidden;
}

.app-header::before {
  content:    '';
  position:   absolute;
  inset:      0;
  background: radial-gradient(ellipse at 50% 0%, rgba(27,95,130,0.25) 0%, transparent 70%);
  pointer-events: none;
}

/* Logo lockup — white C + CULTIVAR stacked */
.header-lockup {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  gap:             2px;
  margin:          0 auto;
}
.header-c-mark {
  display:     block;
  width:       clamp(70px, 18vw, 100px);
  height:      auto;
  object-fit:  contain;
}

/* Compare panel header */
.compare-panel-header {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 0 18px;
}
.compare-l-logo {
  width: 44px; height: 44px; object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(27,95,130,0.5));
  flex-shrink: 0;
}
.compare-panel-title {
  font-family: var(--font-serif); font-size: 22px; font-weight: 600;
  color: var(--text-1);
}

/* Keep old .app-logo for any legacy refs */
.app-logo {
  width:         100px;
  height:        auto;
  margin-bottom: 14px;
  filter:        drop-shadow(0 4px 16px rgba(27,95,130,0.5));
  position:      relative;
}

.app-eyebrow {
  font-family:    var(--font-display);
  font-size:      9px;
  font-weight:    500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color:          var(--teal-light);
  margin:         0;
  opacity:        0.7;
}

.app-title {
  font-family:    var(--font-serif);
  font-size:      clamp(14px, 4vw, 20px);
  font-weight:    700;
  color:          #ffffff;
  line-height:    1;
  margin:         0;
  position:       static;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space:    nowrap;
}

.app-title span {
  color: var(--sage-light);
}

.app-sub {
  display: none;
}

/* ─── Welcome / Start screen ────────────────────────────── */
#welcomeScreen {
  position:        fixed;
  inset:           0;
  z-index:         150;
  background:      rgba(6, 18, 30, 0.68);
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: space-between;
  overflow:        hidden;
  padding:         0;
  /* dvh adapts to actual available height in both browser and PWA mode */
  min-height:      100dvh;
}

.welcome-name-band {
  width:       100%;
  text-align:  center;
  /* safe-area-inset-top covers the status bar; +20px gives real breathing room in standalone PWA mode */
  padding:     calc(max(env(safe-area-inset-top), 44px) + 20px) 24px 20px;
  position:    relative;
  z-index:     2;
}

.welcome-eyebrow {
  font-family:    var(--font-display);
  font-size:      11px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color:          var(--teal-light);
  margin-bottom:  6px;
}

.welcome-app-title {
  font-family:    var(--font-serif);
  font-size:      clamp(42px, 13vw, 72px);
  font-weight:    700;
  color:          var(--text-1);
  line-height:    1.1;
  margin-bottom:  0;
  text-shadow:    0 2px 14px rgba(0,0,0,0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display:        flex;
  align-items:    center;
  gap:            0.3em;
  width:          100%;
}
.welcome-app-title::before,
.welcome-app-title::after {
  content:  '';
  flex:     1;
  height:   1.5px;
  min-width: 12px;
}
.welcome-app-title::before {
  background: linear-gradient(to right, transparent, rgba(160, 191, 146, 0.45));
}
.welcome-app-title::after {
  background: linear-gradient(to left,  transparent, rgba(160, 191, 146, 0.45));
}

.welcome-app-title span { color: var(--sage-light); }

.welcome-back-greeting {
  font-family:  var(--font-serif);
  font-size:    18px;
  font-weight:  400;
  color:        rgba(210, 235, 215, 0.9);
  margin-top:   10px;
  text-shadow:  0 2px 10px rgba(0,0,0,0.6);
  font-style:   italic;
}

.welcome-center-stage {
  width:           100%;
  flex:            1;         /* grows to fill vertical space between header and tagline */
  position:        relative;
  display:         flex;
  justify-content: center;
  align-items:     center;   /* centers the L vertically as space opens up */
  padding-top:     0;
}

/* L is in normal flow — its height defines the stage */
.welcome-l-logo {
  display:     block;
  width:       min(85vw, 380px);
  height:      auto;
  position:    relative;
  z-index:     1;
  opacity:     0.95;
}

/* Button floats over the C, centered vertically in the stage */
.welcome-cta-wrap {
  position:        absolute;
  top:             50%;
  transform:       translateY(-50%);
  left:            0; right: 0;
  z-index:         2;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  text-align:      center;
  padding:         0 32px;
}

.welcome-below-fold {
  width:           100%;
  text-align:      center;
  padding:         10px 36px max(env(safe-area-inset-bottom), 36px);
  display:         flex;
  flex-direction:  column;
  gap:             10px;
  flex-shrink:     0;  /* never squish the tagline */
}

/* placeholder for old .welcome-card — no longer used */
.welcome-card {
  display: none;
}

/* Subtle radial glow behind the card */
.welcome-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(27,95,130,0.18) 0%, transparent 65%);
  pointer-events: none;
}

.welcome-intro {
  font-family: var(--font-serif);
  font-size:   16px;
  font-weight: 500;
  color:       rgba(255, 255, 255, 0.97);
  line-height: 1.55;
  text-shadow: 0 1px 10px rgba(0,0,0,0.9);
}

.welcome-detail { display: none; }

/* Pulsating glow button */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 18px rgba(27,95,130,0.55),
                0 4px 20px rgba(27,95,130,0.4),
                0 0 0 0 rgba(42,133,179,0.0);
  }
  50% {
    box-shadow: 0 0 36px rgba(42,133,179,0.75),
                0 6px 28px rgba(27,95,130,0.6),
                0 0 60px rgba(42,133,179,0.25);
  }
}

@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.025); }
}

.start-here-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px; position: relative;
  width: auto;
  padding: 16px 44px;
  font-family: var(--font-serif); font-size: 20px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  color: #fff; border: 2px solid rgba(255,255,255,0.6); border-radius: var(--r-lg);
  cursor: pointer;
  animation: pulseGlow 2.4s ease-in-out infinite,
             pulseScale 2.4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
  margin-bottom: 14px;
}
.start-here-btn:active { opacity: 0.85; animation: none; transform: scale(0.97); }

.start-here-label { position: relative; text-align: center; line-height: 1.3; }
.start-here-icon  { font-size: 22px; line-height: 1; }

.welcome-rml-logo {
  width:      72px;
  opacity:    0.7;
  margin:     0 auto 8px;
  display:    block;
  filter:     drop-shadow(0 1px 6px rgba(0,0,0,0.5));
}

.welcome-spf-label {
  font-family: var(--font-text);
  font-size:   12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:       rgba(160, 191, 146, 0.55);
  text-align:  center;
  margin:      0 auto;
}

.welcome-note {
  font-family: var(--font-text);
  font-size:   14px;
  color:       rgba(200, 225, 210, 0.9);
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}

/* ─── Standalone PWA layout override ─────────────────────
   Browser: space-between spreads nicely with the URL bar.
   Standalone: no browser chrome, full device height —
   space-between pushes title too high and footer too low.
   Fix: top-anchor the title + C as a unit; float footer
   to the bottom with margin-top: auto.
─────────────────────────────────────────────────────────── */
@media (display-mode: standalone) {
  /* Shift the whole welcome block upward:
     - 12vh top on name-band (was 20vh) moves title up
     - 8vh bottom padding on the screen adds matching air below the footer
     - Stage height stays identical (852 - 68bottom - 193nameband - 90footer = 501px)
       so all internal spacing between title, C, and footer is preserved exactly. */
  #welcomeScreen {
    padding-bottom: 6vh;
  }
  .welcome-name-band {
    padding-top: max(calc(env(safe-area-inset-top) + 16px), 14vh);
  }
}

/* ─── Main — defined in layout block above ──────────────── */

/* ─── Strain slot ───────────────────────────────────────── */
.strain-slot {
  background:    rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border:        1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--r-lg);
  padding:       16px;
  margin-bottom: 10px;
  box-shadow:    var(--shadow-sm);
}


.compare-slot { border-color: var(--sage); }

.slot-header {
  display:         flex;
  align-items:     center;
  justify-content: center;
  margin-bottom:   10px;
  gap:             8px;
}

.slot-label {
  font-size: 13px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color:          var(--teal-light);
  flex:           1;
}

.scan-btn {
  font-family:   var(--font-text);
  font-size: 16px;
  font-weight:   500;
  padding:       6px 14px;
  min-height:    34px;
  border-radius: var(--r-sm);
  background:    var(--surface-3);
  border:        1px solid var(--sep-bright);
  color:         var(--text-2);
  cursor:        pointer;
  transition:    background 0.15s, color 0.15s;
  white-space:   nowrap;
}
.scan-btn:hover { background: var(--teal-pale); color: var(--teal-light); }

.remove-compare-btn {
  font-family:   var(--font-text);
  font-size: 16px;
  font-weight:   500;
  padding:       5px 12px;
  min-height:    34px;
  border-radius: var(--r-sm);
  background:    transparent;
  border:        1px solid var(--sep-bright);
  color:         var(--text-3);
  cursor:        pointer;
  transition:    color 0.15s, border-color 0.15s;
  white-space:   nowrap;
}
.remove-compare-btn:hover { color: #e57373; border-color: #e57373; }

.strain-input-wrap {
  position: relative;
}
.strain-input {
  width:          100%;
  font-family:    var(--font-text);
  font-size:      16px;
  font-weight:    400;
  padding:        11px 38px 11px 14px;
  border-radius:  var(--r-sm);
  border:         1px solid rgba(255,255,255,0.15);
  background:     rgba(10, 20, 28, 0.55);
  color:          var(--text-1);
  outline:        none;
  transition:     border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  box-sizing:     border-box;
}
.strain-input:focus {
  border-color: var(--teal-light);
  box-shadow:   0 0 0 3px rgba(42,133,179,0.18);
}
.strain-input::placeholder { color: var(--text-3); }
.strain-clear-btn {
  position:    absolute;
  right:       8px;
  top:         50%;
  transform:   translateY(-50%);
  background:  none;
  border:      none;
  color:       var(--text-3);
  font-size:   15px;
  line-height: 1;
  padding:     4px 6px;
  cursor:      pointer;
  border-radius: 50%;
  transition:  color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.strain-clear-btn:hover,
.strain-clear-btn:active { color: var(--text-1); background: rgba(255,255,255,0.08); }

.img-preview-wrap  { position: relative; margin-top: 8px; }
.img-preview {
  width: 100%; max-height: 120px; object-fit: cover;
  border-radius: var(--r-sm); display: none;
  border: 1px solid var(--sep);
}
.img-preview.visible { display: block; }

.clear-img {
  position: absolute; top: 6px; right: 6px;
  background: var(--surface-1); border: 1px solid var(--sep-bright);
  border-radius: 50%; width: 26px; height: 26px;
  font-size: 13px; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  color: var(--text-2);
}
.clear-img.visible { display: flex; }

.extracted-badge {
  display: none; font-size: 15px;
  color: var(--sage-light); background: var(--sage-pale);
  border-radius: var(--r-sm); padding: 4px 10px;
  margin-top: 7px; width: fit-content;
}
.extracted-badge.visible { display: inline-block; }

/* ─── Label extraction card ─────────────────────────────── */
.label-extract-card {
  margin-top:    10px;
  background:    var(--surface-1);
  border-radius: var(--r-md);
  border-left:   3px solid var(--teal-light);
  padding:       12px 14px;
  animation:     fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

.extract-reading {
  font-size: 20px; color: var(--text-3); font-style: italic;
  margin-top: 8px; display: flex; align-items: center; gap: 7px;
}
.extract-reading .spinner { margin: 0; width: 14px; height: 14px; border-width: 2px; }

.extract-header { display: flex; align-items: center; margin-bottom: 8px; }
.extract-header-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--teal-light);
}

.extract-strain-name {
  font-family: var(--font-serif); font-size: 20px; font-weight: 600;
  color: var(--text-1); margin-bottom: 5px;
}
.extract-strain-name span {
  font-family: var(--font-text); font-size: 13px; font-weight: 500;
  color: var(--sage-light); background: var(--sage-pale);
  padding: 2px 7px; border-radius: 6px;
  margin-left: 7px; vertical-align: middle;
}

.extract-canna { font-size: 20px; color: var(--text-2); margin-bottom: 7px; }
.extract-canna strong { color: var(--text-1); }

.extract-terpenes { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.extract-terp {
  font-size: 15px; padding: 3px 10px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--sep-bright);
}

.extract-autofilled { font-size: 14px; color: var(--sage-light); margin-top: 4px; }
.extract-note       { font-size: 14px; color: var(--text-3); margin-top: 4px; font-style: italic; }
.extract-error      { font-size: 16px; color: #e57373; margin-top: 8px; }

.extract-cta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 12px;
  background: var(--teal-pale);
  border: 1px solid rgba(42,133,179,0.3);
  border-radius: var(--r-sm);
  animation: ctaPulse 2s ease-in-out infinite;
}
.extract-cta-arrow {
  font-size: 18px; color: var(--teal-light); flex-shrink: 0;
  animation: ctaBounce 1s ease-in-out infinite;
}
.extract-cta-text {
  font-size: 17px; color: var(--teal-light); line-height: 1.4;
}
.extract-cta-text strong { color: #fff; }
@keyframes ctaPulse {
  0%, 100% { border-color: rgba(42,133,179,0.3); }
  50%       { border-color: rgba(42,133,179,0.7); }
}
@keyframes ctaBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(3px); }
}

/* ─── Format toggle ─────────────────────────────────────── */
.format-toggle {
  display: flex; gap: 8px; margin-top: 10px;
  justify-content: center;
}
.fmt-btn {
  flex: 1; text-align: center;
  font-family: var(--font-serif); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 11px 4px; min-height: 42px; border-radius: var(--r-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-3); cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.fmt-btn:hover  {
  background: rgba(42,133,179,0.12);
  color: var(--teal-light);
  border-color: rgba(42,133,179,0.35);
}
.fmt-btn.active {
  background: rgba(42,133,179,0.15);
  border-color: var(--teal-light);
  border-width: 1.5px;
  color: var(--teal-light);
}
.fmt-btn:active { transform: scale(0.97); }

/* ─── Manual number entry ───────────────────────────────── */
.manual-toggle-btn {
  display: block; width: 100%; text-align: center;
  font-family: var(--font-text); font-size: 17px; font-weight: 500;
  padding: 7px 12px; margin-top: 8px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px dashed var(--sep-bright);
  color: var(--text-3); cursor: pointer; text-align: left;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.manual-toggle-btn:hover { border-color: var(--teal); color: var(--teal-light); background: var(--teal-pale); }

.manual-entry-wrap {
  margin-top: 9px;
  background: var(--surface-1);
  border: 1px solid var(--sep-bright);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  animation: fadeIn 0.15s ease;
}
.manual-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.manual-field { display: flex; flex-direction: column; gap: 4px; }
.manual-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-3);
}
.manual-input {
  font-family: var(--font-text); font-size: 16px; font-weight: 500;
  padding: 7px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--sep-bright); background: var(--surface-2);
  color: var(--text-1); outline: none; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.manual-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,168,32,0.15); }
.manual-input::placeholder { color: var(--text-3); font-size: 15px; }
.manual-hint {
  font-size: 13px; color: var(--sage-light); margin-top: 7px; min-height: 14px;
}

/* ─── Compare toggle ────────────────────────────────────── */
.toggle-compare-btn {
  width: 100%; padding: 12px; min-height: 46px;
  font-family: var(--font-text); font-size: 16px; font-weight: 500;
  color: var(--teal-light);
  background: var(--surface-2);
  border: 1.5px dashed var(--teal-pale);
  border-radius: var(--r-md);
  cursor: pointer; margin-bottom: 10px;
  transition: border-color 0.15s, background 0.15s;
  text-align: center; box-shadow: var(--shadow-sm);
}
.toggle-compare-btn:hover { border-color: var(--teal-light); background: var(--teal-pale); }

/* ─── Hint ──────────────────────────────────────────────── */
.hint { font-size: 16px; color: var(--text-3); text-align: center; margin: 4px 0 14px; line-height: 1.5; }

/* ─── Analyze button ────────────────────────────────────── */
.analyze-btn {
  width: 100%; padding: 15px; min-height: 52px;
  font-family: var(--font-serif); font-size: 15px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  border: none; color: #fff;
  transition: opacity 0.15s, transform 0.1s;
  margin: 6px 0 1.5rem;
  -webkit-appearance: none;
  animation: analyzePulse 2.2s ease-in-out infinite;
}
@keyframes analyzePulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(27,95,130,0.45),
                0 0 0 0 rgba(42,133,179,0);
  }
  50% {
    box-shadow: 0 6px 28px rgba(42,133,179,0.7),
                0 0 0 6px rgba(42,133,179,0.12);
  }
}
.analyze-btn:hover  { opacity: 0.9; }
.analyze-btn:active { transform: scale(0.99); animation: none; }
.analyze-btn:disabled { opacity: 0.35; cursor: not-allowed; animation: none; }

/* ─── Loading / Error ───────────────────────────────────── */
.loading-state {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 2rem 1rem;
  color: var(--text-2); font-size: 20px; line-height: 1.7;
}
.spinner {
  display: block; width: 24px; height: 24px;
  border: 2.5px solid var(--sep-bright); border-top-color: var(--teal-light);
  border-radius: 50%; animation: spin 0.7s linear infinite; margin-bottom: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.joke-setup {
  font-family:   var(--font-serif);
  font-size:     18px;
  color:         var(--text-1);
  margin-top:    6px;
  line-height:   1.5;
}
.joke-punchline {
  font-family:   var(--font-serif);
  font-size:     19px;
  font-weight:   600;
  color:         var(--teal-light);
  margin-top:    14px;
  line-height:   1.5;
  animation:     punchlineIn 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes punchlineIn {
  from { opacity:0; transform: scale(0.85) translateY(8px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

/* ─── Strain validation states ───────────────────────────── */
.strain-unverified-banner {
  margin: 0 0 12px;
  padding: 12px 15px;
  font-size: 14px;
  color: #f5c842;
  background: rgba(245, 200, 66, 0.08);
  border: 1px solid rgba(245, 200, 66, 0.25);
  border-radius: var(--r-md);
  line-height: 1.55;
}
.strain-unverified-banner strong { color: #f5d76e; }

.error-state {
  padding: 14px 16px; font-size: 16px; color: #e57373;
  background: rgba(229,115,115,0.1); border-radius: var(--r-md);
  border: 1px solid rgba(229,115,115,0.25); line-height: 1.55;
}

/* ─── Did You Know home card ─────────────────────────────── */
.home-fact-card {
  margin: 16px 0 8px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--sep-bright);
}
.home-fact-inner { padding: 16px 18px 12px; }
.home-fact-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sage-light);
  margin-bottom: 8px;
}
.home-fact-text {
  font-family: var(--font-text);
  font-size: 15px;
  color: var(--text-1);
  line-height: 1.65;
  margin: 0 0 10px;
}
.home-fact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.home-fact-source {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
}
.home-fact-refresh {
  background: none;
  border: 1px solid var(--sep-bright);
  border-radius: 50%;
  width: 26px; height: 26px;
  font-size: 14px;
  color: var(--text-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.home-fact-refresh:hover { color: var(--sage-light); border-color: var(--sage); }

/* ─── Quick chips ───────────────────────────────────────── */
.quick-section { margin-bottom: 18px; }

.chips-label {
  font-size: 13px; font-weight: 600; color: var(--text-3);
  margin-bottom: 9px; text-transform: uppercase; letter-spacing: 1px;
}
.chips-label strong { color: var(--text-2); text-transform: none; letter-spacing: 0; font-size: 17px; }

.quick-chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }

.quick-chip {
  font-family: var(--font-text); font-size: 17px; font-weight: 500;
  padding: 7px 14px; min-height: 36px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--sep-bright);
  cursor: pointer; color: var(--text-2);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.quick-chip:hover { background: var(--teal-pale); color: var(--teal-light); border-color: var(--teal); }

.quick-chip.crohns-chip { background: var(--sage-pale); color: var(--sage-light); border-color: rgba(122,155,108,0.3); }
.quick-chip.crohns-chip:hover { background: var(--sage); color: #fff; border-color: var(--sage); }

/* ─── Journal tab ────────────────────────────────────────── */
.journal-empty {
  text-align: center; padding: 32px 20px;
}
.journal-empty-icon { font-size: 40px; margin-bottom: 10px; }
.journal-empty-title {
  font-family: var(--font-serif); font-size: 18px; font-weight: 600;
  color: var(--text-1); margin-bottom: 6px;
}
.journal-empty-sub { font-size: 17px; color: var(--text-3); line-height: 1.6; }

.journal-list { display: flex; flex-direction: column; gap: 10px; }

.journal-entry {
  background: var(--surface-2);
  border: 1px solid var(--sep-bright);
  border-left: 3px solid var(--teal);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: border-left-color 0.15s;
}
.journal-entry:has(.fav-btn.favorited) { border-left-color: var(--gold); }

.journal-entry-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 6px;
}
.journal-strain-name {
  font-family: var(--font-serif); font-size: 16px; font-weight: 600;
  color: var(--text-1); flex: 1;
}
.journal-note {
  font-size: 15px; color: var(--text-2); line-height: 1.6;
  font-style: italic; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.journal-no-note {
  font-size: 15px; color: var(--text-3); font-style: italic; margin-bottom: 10px;
}
.journal-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.journal-action-btn {
  font-family: var(--font-text); font-size: 15px; font-weight: 500;
  padding: 6px 13px; min-height: 32px; border-radius: var(--r-sm);
  background: var(--surface-3); border: 1px solid var(--sep-bright);
  color: var(--text-2); cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.journal-action-btn:hover { background: var(--teal-pale); color: var(--teal-light); }

.journal-saved-badge {
  font-size: 12px; font-weight: 500;
  padding: 2px 8px; border-radius: 6px;
  background: rgba(232,168,32,0.12); color: var(--gold);
  border: 1px solid rgba(232,168,32,0.25);
  white-space: nowrap;
}

/* ─── Results ───────────────────────────────────────────── */
.vs-badge {
  text-align: center; font-family: var(--font-serif);
  font-size: 15px; color: var(--text-3); margin-bottom: 14px;
}

.results-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 14px; margin-bottom: 14px;
}

/* ─── Strain card ───────────────────────────────────────── */
.strain-card {
  background:    rgba(25, 44, 62, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border:        1px solid var(--sep-bright);
  border-top:    3px solid var(--teal-light);
  border-radius: var(--r-xl);
  padding:       20px;
  margin-bottom: 14px;
  box-shadow:    var(--shadow-md);
}
.results-grid .strain-card { margin-bottom: 0; }

.strain-card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px; margin-bottom: 4px;
}

.strain-name {
  font-family: var(--font-serif); font-size: 22px; font-weight: 600;
  line-height: 1.25; color: var(--text-1);
}

.source-tag {
  font-family: var(--font-text); font-size: 12px; font-weight: 500;
  padding: 2px 8px; border-radius: 6px; margin-left: 7px;
  vertical-align: middle; display: inline-block; transform: translateY(-2px);
}
.source-real   { background: var(--sage-pale);  color: var(--sage-light); }
.source-leafly { background: var(--teal-pale);  color: var(--teal-light); }
.source-gen    { background: var(--surface-3);  color: var(--text-3); }

/* ─── Periodic tiles ─────────────────────────────────────── */
.periodic-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0 16px;
}
.ptile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--sep-bright);
  border-radius: var(--r-sm);
  padding: 8px 4px 9px;
  text-align: center;
  gap: 2px;
}
.ptile-label {
  font-size: 8px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
  line-height: 1; width: 100%;
}
.ptile-sym {
  font-family: var(--font-display);
  font-size: clamp(14px, 4vw, 20px); font-weight: 600;
  color: var(--text-1); line-height: 1.1;
  word-break: break-all; text-align: center;
}
.ptile-sub {
  font-family: var(--font-text);
  font-size: 8px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-2); line-height: 1;
}
.tile-thc   { border-top: 2px solid var(--teal-light); }
.tile-cbd   { border-top: 2px solid var(--sage); }
.tile-type  { border-top: 2px solid var(--gold); }
.tile-crohns { border-top: 2px solid var(--crohns-mid); }
.tile-crohns .ptile-sym { color: var(--crohns-fg); }

/* ─── Effect tags (positives / negatives / helps with) ────── */
.effect-tags-wrap { margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; justify-content: flex-start; }
.tag-group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-3); white-space: nowrap;
  flex-basis: 100%; margin-bottom: 2px;
}
.etag {
  font-size: 16px; font-weight: 500;
  padding: 3px 9px; border-radius: 6px;
}
.etag-pos  { background: rgba(122,155,108,0.18); color: var(--sage-light); }
.etag-neg  { background: rgba(220,100,80,0.15);  color: #E8957A; }
.etag-help { background: rgba(27,95,130,0.25);   color: var(--teal-light); }

.fav-btn {
  font-size: 22px; background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 0; line-height: 1;
  transition: color 0.15s, transform 0.15s; flex-shrink: 0; margin-top: 2px;
}
.fav-btn:hover    { color: var(--gold); transform: scale(1.18); }
.fav-btn.favorited { color: var(--gold); }

.type-badge {
  display: inline-block; font-family: var(--font-text); font-size: 13px; font-weight: 600;
  padding: 4px 12px; border-radius: var(--r-sm); margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-hybrid  { background: rgba(232,168,32,0.15);  color: var(--gold); }
.badge-indica  { background: rgba(130,80,200,0.15);  color: #B899F5; }
.badge-sativa  { background: rgba(230,120,40,0.15);  color: #F0A060; }

.section-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-3); margin: 16px 0 7px;
}

.divider { border: none; border-top: 1px solid var(--sep); margin: 16px 0; }

/* Vibe check */
.vibe-check-box {
  background: var(--surface-3); border: 1px solid var(--sep-bright);
  border-left: 3px solid var(--sage);
  border-radius: var(--r-md); padding: 12px 14px; margin: 10px 0 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.vibe-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--sage-light); }
.vibe-text  { font-family: var(--font-serif); font-size: 18px; color: var(--text-1); font-style: italic; }

/* Music & food pairings */
.pairings-row {
  display: grid; grid-template-columns: 1fr;
  gap: 10px; margin-top: 4px; margin-bottom: 14px;
}

/* ── Flip card shell ─────────────────────────────────────── */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.35s ease;
}
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-card-back {
  position: absolute;
  top: 0; left: 0; right: 0;
  transform: rotateY(180deg);
  visibility: hidden;
}
.flip-card.flipped .flip-card-back  { visibility: visible; }
.flip-card.flipped .flip-card-front { visibility: hidden; }

.flip-hint {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.45;
  letter-spacing: 0.3px;
  align-self: flex-end;
}

.pairing-block {
  border-radius: var(--r-md); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--sep-bright);
}
.pairing-block.music               { background: #0D0A1E; border-color: rgba(130,80,200,0.3); }
.pairing-block.music.music-back    { background: #0A0D1E; border-color: rgba(80,130,220,0.35); }
.pairing-block.food.food-stoner    { background: #1E0E00; border-color: rgba(220,110,30,0.35); }
.pairing-block.food.food-healthy   { background: #071A0D; border-color: rgba(60,180,90,0.35); }

.pairing-icon-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  display: flex; align-items: center; gap: 5px;
}
.pairing-block.music                .pairing-icon-label { color: #9B79E0; }
.pairing-block.music.music-back     .pairing-icon-label { color: #7AABF0; }
.pairing-block.food.food-stoner     .pairing-icon-label { color: #E07030; }
.pairing-block.food.food-healthy    .pairing-icon-label { color: #4DB870; }

.pairing-name { font-family: var(--font-serif); font-size: 17px; font-weight: 500; line-height: 1.3; }
.pairing-song { font-family: var(--font-text); font-size: 15px; font-weight: 400; opacity: 0.7; }
.pairing-block.music                .pairing-name { color: #D4C0FF; }
.pairing-block.music.music-back     .pairing-name { color: #A8CFFF; }
.pairing-block.food.food-stoner     .pairing-name { color: #F09050; }
.pairing-block.food.food-healthy    .pairing-name { color: #6DD890; }

.pairing-why { font-size: 17px; line-height: 1.5; margin-top: 2px; }
.pairing-block.music                .pairing-why { color: rgba(180,155,240,0.6); }
.pairing-block.music.music-back     .pairing-why { color: rgba(140,180,255,0.6); }
.pairing-block.food.food-stoner     .pairing-why { color: rgba(220,120,50,0.7); }
.pairing-block.food.food-healthy    .pairing-why { color: rgba(80,200,110,0.7); }

.recipe-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(232,168,32,0.2);
  display: flex; flex-direction: column; gap: 5px;
}
.food-stoner .recipe-block { border-top-color: rgba(220,120,50,0.25); }
.food-healthy .recipe-block { border-top-color: rgba(60,180,90,0.25); }
.food-healthy .recipe-label { color: #4DB870; }
.food-healthy .recipe-steps { color: rgba(80,200,110,0.75); }
.recipe-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--gold);
}
.recipe-steps {
  font-size: 16px; line-height: 1.65;
  color: rgba(232,168,32,0.75);
  font-family: var(--font-text);
}

.apple-music-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  color: #fff; font-size: 15px; font-weight: 500;
  text-decoration: none; font-family: var(--font-text);
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.apple-music-btn:hover {
  background: rgba(252,60,68,0.2);
  border-color: rgba(252,60,68,0.4);
  color: #fff;
}
.am-icon {
  width: 14px; height: 14px; flex-shrink: 0;
  color: #FC3C44; /* Apple Music red */
}

/* ─── Apple Music inline embed player ───────────────────── */
.music-pairing-face { display: contents; }

.music-embed-container {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, margin-top 0.35s ease;
  margin-top: 0;
}
.music-embed-container.open {
  max-height: 180px;
  margin-top: 10px;
}
.music-embed-container iframe {
  border-radius: 10px;
  display: block;
  width: 100%;
}

/* ─── Apple Music back-nudge toast ──────────────────────── */
#am-toast {
  position: fixed;
  bottom: 90px; /* sit above the tab bar */
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  background: rgba(30, 30, 40, 0.95);
  border: 1px solid rgba(252, 60, 68, 0.3);
  border-radius: 24px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  z-index: 9999;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  pointer-events: none;
}
#am-toast.am-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.am-toast-icon { font-size: 15px; }
.am-toast-text { font-size: 13px; color: var(--text-2); }
.am-toast-text strong { color: #FC3C44; font-weight: 600; }

/* ─── Ask Dad bottom-sheet overlay ──────────────────────── */
.askdad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.askdad-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.askdad-sheet {
  width: 100%;
  max-width: 640px;
  background: rgba(19, 34, 50, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--sep-bright);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 12px 24px calc(env(safe-area-inset-bottom, 0px) + 90px);
  text-align: center;
  transform: translateY(30px);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.askdad-overlay.visible .askdad-sheet {
  transform: translateY(0);
}
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--sep-bright);
  border-radius: 2px;
  margin: 0 auto 18px;
}

.askdad-memoji {
  width: 80px; height: 80px;
  object-fit: contain;
  border-radius: 50%;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.askdad-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600;
  color: var(--text-1); margin-bottom: 4px;
}
.askdad-sub {
  font-size: 16px; color: var(--text-3); margin-bottom: 20px;
}
.askdad-btns {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 16px; width: 100%;
}
.askdad-btn {
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 12px; padding: 18px 24px; width: 100%;
  border-radius: var(--r-md);
  text-decoration: none;
  font-family: var(--font-text); font-weight: 600;
  transition: transform 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.askdad-btn:active { transform: scale(0.96); opacity: 0.85; }
.call-btn {
  background: linear-gradient(135deg, #1A5F3A, #2A8C58);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
}
.text-btn {
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
}
.askdad-btn-icon { font-size: 28px; line-height: 1; }
.askdad-btn-label { font-size: 16px; letter-spacing: 0.3px; }
.askdad-note {
  font-size: 13px; color: var(--text-3);
  line-height: 1.6;
}

/* ─── Card section tabs ──────────────────────────────────── */
.card-tab-nav {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0 8px;
  margin: 4px -2px 0;
}
.card-tab-nav::-webkit-scrollbar { display: none; }

.ctab {
  flex: 0 0 auto;
  font-family: var(--font-text); font-size: 13px; font-weight: 600;
  padding: 6px 12px; min-height: 30px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--sep);
  color: var(--text-3);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ctab:hover  { background: var(--teal-pale); color: var(--teal-light); border-color: var(--teal); }
.ctab.active { background: var(--teal-pale); border-color: var(--teal-light); color: var(--teal-light); }

/* ─── Card slides ────────────────────────────────────────── */
.card-slide-wrap { min-height: 160px; perspective: 600px; }
.card-slide      { padding: 4px 0; transform-origin: center bottom; }

@keyframes cardExit {
  0%   { transform: scale(1)    translateY(0)   ; opacity: 1;   }
  100% { transform: scale(0.86) translateY(12px); opacity: 0;   }
}
@keyframes cardEnter {
  0%   { transform: scale(1.05) translateY(-8px); opacity: 0;   }
  100% { transform: scale(1)    translateY(0)   ; opacity: 1;   }
}
.card-exit  { animation: cardExit  0.22s cubic-bezier(0.4, 0, 0.6, 1) forwards; }
.card-enter { animation: cardEnter 0.25s cubic-bezier(0.2, 0, 0.2, 1) forwards; }

/* ─── Swipe hint ─────────────────────────────────────────── */
.swipe-hint {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 0 2px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
.swipe-hint.visible { opacity: 1; }
.swipe-hint-text {
  font-family: var(--font-text); font-size: 15px; font-weight: 500;
  color: var(--text-3); letter-spacing: 0.5px; text-transform: uppercase;
}
.swipe-hint-arrow {
  font-size: 15px; color: var(--teal-light); opacity: 0.7;
  animation: swipeNudge 1.2s ease-in-out infinite alternate;
}
.swipe-hint-arrow:first-child { animation-direction: alternate-reverse; }
@keyframes swipeNudge {
  from { transform: translateX(0); opacity: 0.5; }
  to   { transform: translateX(4px); opacity: 1; }
}

/* ─── Swipe dots ─────────────────────────────────────────── */
.swipe-dots {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  padding: 6px 0 2px;
}
.swipe-dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: var(--surface-3); border: none; cursor: pointer;
  padding: 0; transition: background 0.2s, width 0.2s;
}
.swipe-dot.active { background: var(--teal-light); width: 18px; }

/* Persona takes */
.persona-takes { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.persona-take  { display: flex; flex-direction: column; gap: 3px; }
.persona-name  {
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--teal-light);
}
.persona-text { font-size: 16px; color: var(--text-2); line-height: 1.6; }

/* Effect bars */
.effect-bar-wrap { display: flex; flex-direction: column; gap: 7px; }
.effect-row      { display: flex; align-items: center; gap: 10px; }
.effect-label    { font-size: 16px; color: var(--text-2); min-width: 80px; }
.effect-bar-bg   { flex: 1; height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.effect-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--teal), var(--teal-light)); }
.effect-val      { font-size: 16px; color: var(--text-3); min-width: 16px; text-align: right; }

/* Terpene bars */
.real-terpene-row      { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.real-terpene-name     { font-size: 16px; min-width: 110px; color: var(--text-1); }
.real-terpene-note     { font-size: 14px; color: var(--text-3); }
.real-terpene-bar-bg   { flex: 1; height: 4px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.real-terpene-bar-fill { height: 100%; border-radius: 3px; background: var(--sage); }
.real-terpene-pct      { font-size: 16px; color: var(--text-3); min-width: 38px; text-align: right; }

/* Terpene tags */
.terpene-list { display: flex; flex-wrap: wrap; gap: 6px; }
.terpene-pill {
  font-size: 15px; padding: 4px 12px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--sep-bright);
}

.body-text   { font-size: 17px; line-height: 1.65; color: var(--text-1); }
.watch-out   { font-size: 15px; color: var(--text-2); line-height: 1.6; border-left: 3px solid var(--surface-3); padding-left: 10px; }
.flavor-note { font-size: 15px; color: var(--text-2); font-style: italic; }

/* Crohn's block */
.crohns-block {
  background: var(--crohns-bg); border: 1px solid rgba(77,206,135,0.2);
  border-radius: var(--r-md); padding: 13px 15px;
}
.crohns-score-row  { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; overflow: hidden; }
.crohns-label      { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--crohns-fg); white-space: nowrap; flex-shrink: 0; }
.crohns-dots       { display: flex; gap: 3px; flex: 1; min-width: 0; overflow: hidden; }
.crohns-dot        { width: 13px; height: 13px; border-radius: 50%; background: rgba(77,206,135,0.12); flex-shrink: 1; }
.crohns-dot.filled { background: var(--crohns-fg); }
.crohns-score-num  { font-size: 15px; font-weight: 600; color: var(--crohns-dk); min-width: 34px; text-align: right; flex-shrink: 0; }
.crohns-insight    { font-size: 15px; color: rgba(137,232,180,0.85); line-height: 1.65; }

/* Dad's fit block (Aria mode only) */
.dad-block {
  background: var(--teal-pale); border: 1px solid rgba(42,133,179,0.3);
  border-radius: var(--r-md); padding: 13px 15px;
  margin-top: 10px;
}
.dad-block .crohns-label  { color: var(--teal-light); }
.dad-block .crohns-dot    { background: rgba(42,133,179,0.15); }
.dad-block .crohns-dot.filled { background: var(--teal-light); }
.dad-block .crohns-score-num  { color: var(--teal-light); }
.dad-block .crohns-insight    { color: rgba(160,200,230,0.9); }

/* Notes */
.strain-notes {
  width: 100%; font-family: var(--font-text); font-size: 15px; line-height: 1.6;
  padding: 11px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--sep-bright); background: var(--surface-1);
  color: var(--text-1); resize: vertical; min-height: 150px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s; -webkit-appearance: none;
}
.strain-notes:focus { border-color: var(--teal-light); box-shadow: 0 0 0 3px rgba(42,133,179,0.15); }
.strain-notes::placeholder { color: var(--text-3); font-style: italic; }

.note-saved-hint { font-size: 14px; color: var(--sage-light); margin-top: 4px; min-height: 16px; text-align: right; }

/* ─── Community Bowl share row (inside Notes tab) ────────── */
.bowl-share-row { margin-top: 12px; }
.bowl-share-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-text); font-size: 14px;
  color: var(--text-2); cursor: pointer;
}
.bowl-share-label input[type="checkbox"] { accent-color: var(--teal-light); width: 16px; height: 16px; cursor: pointer; }
.bowl-submit-wrap { margin-top: 10px; }
.bowl-submit-btn {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  padding: 9px 20px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  color: #fff; border: none; cursor: pointer;
  transition: opacity 0.15s;
}
.bowl-submit-btn:active { opacity: 0.82; }
.bowl-feedback { font-size: 13px; color: var(--text-3); margin-top: 8px; line-height: 1.4; }
.bowl-shared-badge { font-size: 13px; color: var(--sage-light); margin-top: 2px; }

/* ─── Community Bowl card (below strain card) ────────────── */
.community-bowl {
  background:    var(--surface-2);
  border:        1px solid rgba(42,133,179,0.2);
  border-radius: var(--r-lg);
  padding:       18px 20px 20px;
  margin-top:    10px;
}
.bowl-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.bowl-icon { font-size: 18px; line-height: 1; }
.bowl-title {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  color: var(--teal-light); letter-spacing: 0.02em;
}
.bowl-notes { display: flex; flex-direction: column; gap: 14px; }
.bowl-note {
  border-left: 2px solid rgba(42,133,179,0.35);
  padding-left: 12px;
}
.bowl-attribution {
  font-family: var(--font-text); font-size: 12px;
  color: var(--text-3); margin-bottom: 4px; font-style: italic;
}
.bowl-quote {
  font-family: var(--font-serif); font-size: 15px;
  color: var(--text-1); line-height: 1.55;
}

/* Bottom line */
.bottom-line-card {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--teal-pale) 100%);
  border: 1px solid var(--teal);
  border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(27,95,130,0.3);
}
.bottom-line-card .section-label { margin-top: 0; color: var(--teal-light); }
.bottom-line-card .body-text     { font-size: 15px; color: var(--text-1); line-height: 1.65; }

/* Favorites */
.fav-chip          { background: rgba(232,168,32,0.12) !important; color: var(--gold) !important; border-color: rgba(232,168,32,0.3) !important; display: inline-flex !important; align-items: center; gap: 4px; }
.fav-chip:hover    { background: var(--gold) !important; color: #000 !important; }
.fav-chip-remove   { font-size: 14px; color: rgba(232,168,32,0.4); margin-left: 2px; }
.fav-chip-remove:hover { color: #e57373; }

/* ─── Analyze new strain button (bottom of results) ─────── */
.analyze-new-btn {
  display: block;
  width: 100%;
  margin: 20px 0 10px;
  padding: 14px 24px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-light);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(42, 133, 179, 0.35);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.analyze-new-btn:hover  { background: var(--teal-pale); border-color: var(--teal-light); }
.analyze-new-btn:active { opacity: 0.8; }

/* ─── Footer ────────────────────────────────────────────── */
.app-footer {
  display: none;
}
.app-footer strong { color: var(--teal-light); }

/* ─── Bottom tab bar ─────────────────────────────────────── */
.bottom-tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: rgba(7, 12, 9, 0.92);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--sep-bright);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 18px 8px;
  background: none; border: none; cursor: pointer;
  color: var(--text-3);
  border-top: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn:hover  { color: var(--text-2); }
.tab-btn.active { color: var(--teal-light); border-top-color: var(--teal-light); }
.tab-label {
  font-family: var(--font-serif);
  font-size: 12px; font-weight: 600;
  text-align: center; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* ─── Tab panels ─────────────────────────────────────────── */
.tab-panel {
  background: var(--surface-1);
  border: 1px solid var(--sep-bright);
  border-radius: var(--r-md);
  margin: 12px 0 0;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-panel-inner { padding: 14px; }

/* push page content up off the tab bar */
.page-wrap { padding-bottom: 80px; }

/* ─── Desktop ───────────────────────────────────────────── */
@media (min-width: 600px) {
  main          { padding: 1.75rem 1.5rem 0; }
  .app-title    { font-size: 32px; }
  .results-grid { grid-template-columns: 1fr 1fr; }
  .app-footer   { padding: 1.5rem 1.5rem 0; }
}

@media (max-width: 400px) {
  .crohns-dots { gap: 3px; }
  .crohns-dot  { width: 13px; height: 13px; }
  .periodic-tiles { gap: 5px; }
  .ptile { padding: 8px 4px 6px; }
}

/* ─── Header greeting + profile button ──────────────────── */
.header-top-row {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 10px); right: 14px;
  display: flex; align-items: center;
  z-index: 2;
}
.header-profile-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.profile-edit-link {
  background: none; border: none;
  font-family: var(--font-text); font-size: 11px;
  color: var(--text-3); text-decoration: underline;
  cursor: pointer; padding: 0; line-height: 1;
  white-space: nowrap;
}
.profile-edit-link:hover { color: var(--teal-light); }
.profile-icon-btn {
  background: var(--surface-1); border: 1.5px solid var(--sep-bright);
  border-radius: 50%; width: 44px; height: 44px;
  font-size: 20px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.profile-icon-btn:hover { background: var(--teal-pale); border-color: var(--teal-light); }
.profile-photo-thumb {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}

/* ─── Wizard photo upload ────────────────────────────────── */
.wizard-photo-row {
  display: flex; justify-content: center;
  margin-bottom: 10px;
}
.wizard-photo-btns {
  display: flex; gap: 10px; justify-content: center;
  margin-bottom: 20px;
}
.wizard-photo-choice-btn {
  flex: 1; max-width: 140px;
  font-family: var(--font-text); font-size: 14px; font-weight: 500;
  padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--sep-bright);
  color: var(--text-2); cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.wizard-photo-choice-btn:hover { border-color: var(--teal-light); color: var(--text-1); }
.wizard-photo-circle {
  width: 60px; height: 60px; border-radius: 50%;
  border: 2.5px dashed var(--sep-bright);
  background: var(--surface-1);
  cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.wizard-photo-circle:hover { border-color: var(--teal-light); background: var(--teal-pale); }
.wizard-photo-img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.wizard-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
}
/* ─── Selfie camera overlay ─────────────────────────────── */
#selfieCameraOverlay {
  position: fixed; inset: 0; z-index: 300;
  background: #000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden;
}
#selfieVideo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror for selfie */
}
.selfie-corner {
  position: absolute; z-index: 3;
  pointer-events: none;
}
.selfie-corner--leaf {
  top: max(env(safe-area-inset-top), 20px); left: 20px;
  width: 64px; height: auto;
  opacity: 0.85;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.selfie-corner--l {
  bottom: 100px; right: 20px;
  width: 56px; height: auto;
  opacity: 0.82;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.selfie-countdown {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 180px; font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 32px rgba(0,0,0,0.6);
  animation: selfieCountPulse 0.85s ease-out forwards;
}
@keyframes selfieCountPulse {
  0%   { transform: scale(1.4); opacity: 0; }
  20%  { transform: scale(1);   opacity: 1; }
  80%  { transform: scale(1);   opacity: 1; }
  100% { transform: scale(0.8); opacity: 0; }
}
.selfie-flash {
  position: absolute; inset: 0; z-index: 5;
  background: #fff; opacity: 0; pointer-events: none;
  transition: opacity 0.06s ease-out;
}
.selfie-flash.go { opacity: 1; }
.selfie-controls {
  position: absolute; bottom: max(env(safe-area-inset-bottom), 24px);
  left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 36px;
}
.selfie-shutter-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 4px solid rgba(255,255,255,0.5);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.25), 0 4px 20px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.selfie-shutter-btn:active { transform: scale(0.93); }
.selfie-cancel-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.selfie-preview-wrap {
  position: absolute; inset: 0; z-index: 6;
  background: #000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
}
.selfie-preview-img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* no mirror — canvas capture already handles it */
}
.selfie-preview-btns {
  position: absolute; bottom: max(env(safe-area-inset-bottom), 24px);
  left: 0; right: 0;
  display: flex; gap: 16px; padding: 0 32px;
}
.selfie-retake-btn, .selfie-accept-btn {
  flex: 1; padding: 14px;
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  border-radius: var(--r-md); border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.selfie-retake-btn {
  background: rgba(255,255,255,0.15); color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}
.selfie-accept-btn {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  color: #fff;
}

.header-greeting {
  font-family: var(--font-text); font-size: 16px; font-weight: 500;
  color: var(--teal-light); margin-top: 10px; margin-bottom: 4px; display: none;
}
.condition-dots {
  display: inline-grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 8px);
  gap: 3px;
  margin: 0 4px;
  transform: scaleY(-1);
}
/* Single dot: bypass the 2-row grid so the dot sits dead-center on the line */
.condition-dots.single-dot {
  display: inline-flex;
  align-items: center;
  transform: none;
  vertical-align: middle;
}
.condition-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Dots tooltip ───────────────────────────────────────── */
.dots-wrapper {
  position: relative;
  display: inline-flex; align-items: center;
  vertical-align: middle;
  cursor: pointer;
}
.dots-tooltip {
  display: none;
  flex-direction: column; gap: 7px;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%; transform: translateX(-50%);
  background: rgba(18, 28, 38, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--sep-bright);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 190px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  z-index: 100;
  pointer-events: none;
}
.dots-tooltip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--sep-bright);
}
.dots-wrapper.open .dots-tooltip {
  display: flex;
}
.dots-tip-row {
  display: flex; align-items: center; gap: 9px;
}
.dots-tip-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.dots-tip-label {
  font-family: var(--font-text); font-size: 14px;
  color: var(--text-1); white-space: nowrap;
}

.greeting-sep {
  color: #ffffff;
  opacity: 0.6;
  font-weight: 300;
  margin: 0 2px;
}

.profile-edit-btn {
  background: none; border: none; font-size: 13px; color: var(--text-3);
  cursor: pointer; text-decoration: underline; margin-left: 8px;
  font-family: var(--font-text);
}
.profile-edit-btn:hover { color: var(--teal-light); }

/* ─── Profile / Onboarding overlay ──────────────────────── */
.profile-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: linear-gradient(160deg, #0a141c 0%, #0d2030 60%, #0a1a10 100%);
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex; align-items: flex-start; justify-content: center;
}
.profile-overlay.visible { opacity: 1; pointer-events: all; }

/* ── Wizard sheet ─────────────────────────────────────── */
.wizard-sheet {
  width: 100%; max-width: 480px;
  padding: calc(env(safe-area-inset-top) + 14px) 24px 20px;
  min-height: unset;
  box-sizing: border-box;
  display: flex; flex-direction: column;
  overflow-x: hidden;
}

/* Brand bar */
.wizard-brand-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.wizard-brand-logo {
  width: 34px; height: 34px; border-radius: 8px;
  object-fit: cover; border: 1px solid rgba(255,255,255,0.1);
}
.wizard-brand-name {
  font-family: var(--font-serif); font-size: 15px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--text-1);
}

/* Progress dots */
.wizard-progress {
  display: flex; gap: 8px; margin-bottom: 14px;
}
.wizard-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--surface-3);
  transition: background 0.3s, transform 0.3s;
}
.wizard-dot.active {
  background: var(--teal-light);
  transform: scale(1.25);
}
.wizard-dot.done {
  background: var(--sage);
}

/* Steps */
.wizard-step {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: wizardFadeUp 0.32s ease;
}
.wizard-step.active { display: flex; }

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

/* Step content — rope wave banner */
.wizard-soundwave {
  position: relative;
  width: 100%;
  height: 44px;
  overflow: hidden;
  margin-bottom: 12px;
}
.wv {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.wave-path { fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Rope-wave: animation handled via SMIL <animate> in SVG (iOS Safari compatible) */

.wizard-leaf-icon {
  width: 52px; height: 52px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(122,155,108,0.5));
}

/* Heading: three-stacker layout */
.wizard-heading {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  margin-bottom: 8px;
  gap: 0;
}
.wizard-heading-eyebrow {
  font-family: var(--font-text); font-size: 15px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); line-height: 1.2;
  display: block;
  margin-bottom: 4px;
}
.wizard-heading-brand {
  font-family: var(--font-serif); font-size: 38px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-1); line-height: 1.0;
  display: flex;
  align-items: center;
  gap: 0.3em;
  width: 100%;
}
.wizard-heading-brand::before,
.wizard-heading-brand::after {
  content:   '';
  flex:      1;
  height:    1.5px;
  min-width: 10px;
}
.wizard-heading-brand::before {
  background: linear-gradient(to right, transparent, rgba(160, 191, 146, 0.45));
}
.wizard-heading-brand::after {
  background: linear-gradient(to left,  transparent, rgba(160, 191, 146, 0.45));
}
.wizard-heading-tagline {
  font-family: var(--font-serif); font-size: 16px; font-weight: 500;
  color: var(--sage-light); line-height: 1.3;
  display: block;
  margin-top: 4px;
  font-style: italic;
}
.wizard-question {
  font-family: var(--font-serif); font-size: 26px; font-weight: 700;
  color: var(--text-1); line-height: 1.25; text-align: center;
  margin: 0 0 10px 0;
}
.wizard-sub {
  font-family: var(--font-text); font-size: 15px; color: var(--text-2);
  line-height: 1.5; margin-bottom: 0; text-align: center;
}

/* Text inputs (Step 1) */
.wizard-fields { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; margin-bottom: 12px; max-width: 100%; }
.wizard-text-input {
  flex: 1; min-width: 0; font-family: var(--font-text); font-size: 17px;
  font-weight: 400; padding: 12px 16px;
  border-radius: var(--r-md); border: 1.5px solid var(--sep-bright);
  background: var(--surface-1); color: var(--text-1); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.wizard-text-input:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(42,133,179,0.18);
}
.wizard-text-input::placeholder { color: var(--text-3); }
.wizard-age-input { flex: 0 0 130px; }
.wizard-age-hint {
  font-family: var(--font-text);
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  margin: -8px 0 12px;
  line-height: 1.4;
}

/* Big choice buttons (Step 2) */
.wizard-choice-col {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 16px;
}
.wizard-choice-btn {
  width: 100%; font-family: var(--font-text); font-size: 19px; font-weight: 600;
  padding: 14px 18px; border-radius: var(--r-md);
  border: 2px solid var(--sep-bright);
  background: var(--surface-1); color: var(--text-1);
  cursor: pointer; text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.wizard-choice-btn:active { transform: scale(0.98); }
.wizard-choice-btn.selected {
  border-color: var(--sage-light); background: var(--sage-pale); color: var(--sage-light);
}
.med-no-x {
  color: #E85050; font-weight: 700;
}
.med-yes-check {
  color: #4CAF50; font-weight: 700;
}

/* ─── Condition list (replaces tile grid) ────────────────── */
.cond-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 16px;
}
.cond-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--sep-bright);
  background: var(--surface-1);
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  -webkit-appearance: none;
  appearance: none;
}
.cond-row-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* legacy — no longer used */
.cond-row-icon {
  font-size: 17px;
  flex-shrink: 0;
  line-height: 1;
  width: 22px;
  text-align: center;
}
.cond-row-label {
  flex: 1;
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-2);
  transition: color 0.12s;
}
.cond-row-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--sep-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: transparent;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cond-row.active {
  border-color: var(--teal-light);
  background: var(--teal-pale);
}
.cond-row.active .cond-row-label {
  color: var(--teal-light);
}
.cond-row.active .cond-row-check {
  background: var(--teal-light);
  border-color: var(--teal-light);
  color: #fff;
}

/* ─── Dietary list (replaces tile grid) ─────────────────── */
.diet-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.diet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--sep-bright);
  background: var(--surface-1);
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  -webkit-appearance: none;
  appearance: none;
}
.diet-row-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* legacy — no longer used */
.diet-row-icon {
  font-size: 17px;
  flex-shrink: 0;
  line-height: 1;
  width: 22px;
  text-align: center;
}
.diet-row-label {
  flex: 1;
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-2);
  transition: color 0.12s;
}
.diet-row-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--sep-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: transparent;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.diet-row.active {
  border-color: var(--gold);
  background: rgba(232,168,32,0.1);
}
.diet-row.active .diet-row-label {
  color: var(--gold);
}
.diet-row.active .diet-row-check {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

/* Primary next/proceed button */
.wizard-next-btn {
  display: block; width: 100%;
  font-family: var(--font-serif); font-size: 15px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 14px 20px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  border: none; color: #fff; cursor: pointer;
  box-shadow: 0 4px 20px rgba(27,95,130,0.4);
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 10px;
}
.wizard-next-btn:hover  { opacity: 0.92; box-shadow: 0 6px 24px rgba(27,95,130,0.5); }
.wizard-next-btn:active { transform: scale(0.98); }

/* Back button */
.wizard-back-btn {
  display: block; width: 100%;
  font-family: var(--font-text); font-size: 13px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid var(--sep);
  color: var(--text-3); cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.wizard-back-btn:hover { color: var(--text-2); border-color: var(--sep-bright); }

.med-card-nudge {
  background:    rgba(27, 95, 130, 0.12);
  border:        1px solid rgba(42, 133, 179, 0.28);
  border-radius: var(--r-md);
  padding:       16px;
  margin-top:    16px;
  text-align:    left;
}
.nudge-text {
  font-family:   var(--font-text);
  font-size:     15px;
  color:         var(--text-2);
  line-height:   1.65;
  margin-bottom: 14px;
}

.profile-sheet {
  max-width: 480px; margin: 0 auto;
  padding: 40px 24px 60px;
  min-height: 100%;
}

.profile-header-art {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px;
}
.profile-logo-L {
  width: 64px; height: 64px; border-radius: 14px;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}
.profile-app-name {
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  color: var(--text-1); line-height: 1.3; margin-bottom: 4px;
}
.profile-app-tagline {
  font-family: var(--font-text); font-size: 14px; color: var(--sage-light);
}

.profile-intro {
  font-family: var(--font-text); font-size: 14px; color: var(--text-2);
  line-height: 1.6; margin-bottom: 28px;
  padding-bottom: 24px; border-bottom: 1px solid var(--sep);
}

.profile-field { margin-bottom: 22px; }

.profile-label {
  display: block; font-family: var(--font-text); font-size: 14px;
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 8px;
}
.profile-optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-3); }

.profile-sublabel {
  font-family: var(--font-text); font-size: 14px; color: var(--text-3);
  margin-bottom: 10px; margin-top: -4px;
}

.profile-input {
  width: 100%; font-family: var(--font-text); font-size: 16px;
  padding: 11px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--sep-bright); background: var(--surface-1);
  color: var(--text-1); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.profile-input:focus { border-color: var(--teal-light); box-shadow: 0 0 0 3px rgba(42,133,179,0.2); }
.profile-input::placeholder { color: var(--text-3); }
.profile-input-sm { max-width: 120px; }

.med-card-btn {
  font-family: var(--font-text); font-size: 14px; font-weight: 500;
  padding: 10px 16px; border-radius: var(--r-sm);
  border: 1.5px solid var(--sep-bright);
  background: var(--surface-1); color: var(--text-2);
  cursor: pointer; width: 100%; text-align: left;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.med-card-btn.active {
  border-color: var(--sage-light); background: var(--sage-pale); color: var(--sage-light);
}

/* Tile grid classes removed — replaced by .cond-list/.cond-row and .diet-list/.diet-row */

/* Other — write-in field */
.diet-other-wrap {
  grid-column: 1 / -1;
  margin-top: 2px;
}
.diet-other-input {
  width: 100%; font-family: var(--font-text); font-size: 15px;
  padding: 12px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--gold); background: rgba(232,168,32,0.06);
  color: var(--text-1); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.diet-other-input:focus { box-shadow: 0 0 0 3px rgba(232,168,32,0.15); }
.diet-other-input::placeholder { color: var(--text-3); }


.profile-save-btn {
  display: block; width: 100%; margin-top: 32px;
  font-family: var(--font-text); font-size: 16px; font-weight: 600;
  padding: 15px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  border: none; color: #fff; cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.profile-save-btn:hover  { opacity: 0.9; }
.profile-save-btn:active { transform: scale(0.98); }

.profile-cancel-btn {
  display: block; width: 100%; margin-top: 12px;
  font-family: var(--font-text); font-size: 14px;
  padding: 10px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid var(--sep-bright);
  color: var(--text-3); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.profile-cancel-btn:hover { color: var(--text-2); border-color: var(--sep-bright); }

/* ─── Add to Home Screen nudge ──────────────────────────── */
.a2hs-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.a2hs-overlay.visible { opacity: 1; pointer-events: all; }

.a2hs-sheet {
  width: 100%; max-width: 640px;
  background: rgba(19,34,50,0.98);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--sep-bright);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 12px 24px calc(env(safe-area-inset-bottom,0px) + 32px);
  text-align: center;
  transform: translateY(30px);
  transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1);
}
.a2hs-overlay.visible .a2hs-sheet { transform: translateY(0); }

.a2hs-icon-wrap { margin: 8px 0 14px; }
.a2hs-icon {
  width: 64px; height: 64px; border-radius: var(--r-md);
  border: 1px solid var(--sep-bright);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.a2hs-title {
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  color: var(--text-1); margin-bottom: 6px;
}
.a2hs-sub {
  font-size: 15px; color: var(--text-3); margin-bottom: 20px; line-height: 1.55;
}
.a2hs-install-btn {
  display: block; width: 100%;
  font-family: var(--font-text); font-size: 16px; font-weight: 600;
  padding: 15px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  border: none; color: #fff; cursor: pointer;
  box-shadow: 0 4px 20px rgba(27,95,130,0.45);
  margin-bottom: 12px;
  transition: opacity 0.15s;
}
.a2hs-install-btn:active { opacity: 0.85; }

.a2hs-steps {
  display: flex; flex-direction: column; gap: 12px;
  text-align: left; margin-bottom: 20px;
  background: var(--surface-1); border-radius: var(--r-md);
  padding: 16px; border: 1px solid var(--sep-bright);
}
.a2hs-step {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14px; color: var(--text-2); line-height: 1.5;
}
.a2hs-step-icon {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0;
  background: var(--teal-pale); border: 1px solid var(--teal);
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700; color: var(--teal-light);
}
.a2hs-step strong { color: var(--text-1); }
.a2hs-share-icon { font-style: normal; font-size: 16px; }
.a2hs-dismiss-btn {
  display: block; width: 100%;
  font-family: var(--font-text); font-size: 14px;
  padding: 11px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid var(--sep-bright);
  color: var(--text-3); cursor: pointer;
  transition: color 0.15s;
}
.a2hs-dismiss-btn:hover { color: var(--text-2); }

/* Ask Dad — email button */
.email-btn { background: linear-gradient(135deg, #1a3a4d 0%, #1B5F82 100%) !important; color: #fff !important; }
.email-btn:hover { background: linear-gradient(135deg, #1B5F82 0%, #2A85B3 100%) !important; }
