@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Cormorant Garamond", serif;
}

body {
  background-color: #f9f6f3;
  color: #333;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

/* ================================================
   LOADING SCREEN
   ================================================ */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: #f9f6f3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  touch-action: none;
  pointer-events: all;
  transition: opacity 1.1s ease, visibility 1.1s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(249, 224, 208, 0.5);
  border-top-color: #e8c4a8;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: #b08878;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.loading-text.fade-out { opacity: 0; }

/* Back Button */
.back-button {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  width: auto !important;
  height: auto !important;
  font-size: 2.5rem !important;
  color: #fff !important;
  cursor: pointer !important;
  margin: -0.6rem 0 0 0.6rem !important;
  padding: 0 !important;
  line-height: 1 !important;
  display: inline-block !important;
  transition: opacity 0.2s ease !important;
}

.back-button:hover { opacity: 0.7 !important; background: none !important; }
.back-button:active { opacity: 0.5 !important; }

/* ----- FILTER MENU ----- */
.filter-menu {
  position: absolute;
  top: 58px;
  right: 16px;
  width: 230px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  padding: 10px 0;
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 9999;
}

.filter-menu.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.filter-btn {
  width: 100%;
  padding: 12px 18px;
  background: none;
  border: none;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.filter-btn:hover { background: #f3f3f3; }

.menu-dots {
  position: relative;
  z-index: 2100;
  cursor: pointer;
}

/* Bottom sheet overlay */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.50);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9998;
}

/* Bottom sheet */
.bottom-sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: -100%;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 12px 20px;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.18);
  transition: bottom 0.35s ease;
  z-index: 10000;
}

.bottom-sheet-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 8px 0 14px 0;
  text-align: center;
}

.bottom-sheet-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bottom-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  padding: 8px 4px;
}

.bottom-sheet-apply,
.bottom-sheet-reset {
  width: 100%;
  padding: 10px 0;
  margin-top: 12px;
  border-radius: 12px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
}

.bottom-sheet-apply {
  background: linear-gradient(to bottom, #fff3ea, #f9e0d0);
  font-weight: 500;
}

.bottom-sheet-reset { background: #efefef; color: #444; }

.bottom-sheet-options input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  border: 2px solid #e5b49c;
  border-radius: 4px;
  background: #fff7f3;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.bottom-sheet-options input[type="checkbox"]:checked {
  background: linear-gradient(to bottom, #fff3ea, #f9e0d0);
  border-color: #d89f85;
}

.bottom-sheet-options input[type="checkbox"]:checked::after {
  content: "✓";
  color: #9e6f5c;
  font-size: 14px;
  font-weight: 600;
  position: absolute;
  left: 2px;
  top: -2px;
}

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, #fff3ea, #f9e0d0);
  padding: 12px 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar h1 {
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.menu-icon, .menu-dots {
  font-size: 1.5rem;
  cursor: pointer;
  color: #333;
}

#topbarSearch {
  width: 70%;
  padding: 6px 10px;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  background: #fff3ea;
  outline: none;
}

.menu-icon.back-mode { font-size: 26px; cursor: pointer; }

.flash-fade { animation: flashFade 0.35s ease; }

@keyframes flashFade {
  0%   { background-color: white; }
  100% { background-color: inherit; }
}

.catalogue-flash-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  animation: overlayFlash 0.9s ease-out;
  z-index: 999;
}

@keyframes overlayFlash {
  0%   { opacity: 0.85; }
  35%  { opacity: 0.55; }
  70%  { opacity: 0.25; }
  100% { opacity: 0; }
}

/* ================================================
   AI IDENTIFIER PANEL
   ================================================ */

.identifier-panel {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: #111;
  display: none;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
}

/* ---- Camera area: top 70% ---- */
.identifier-camera-area {
  position: relative;
  flex: 0 0 70%;
  overflow: hidden;
  background: #000;
}

#cameraStream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#inferenceCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

/* Close button floats top right over camera */
.close-identifier {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.45);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  cursor: pointer;
  z-index: 10;
  letter-spacing: 0.05em;
}

.close-identifier:hover { background: rgba(0,0,0,0.68); }

/* Glow ring */
.camera-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0px 0px rgba(240, 200, 140, 0);
  transition: box-shadow 0.6s ease;
  z-index: 5;
}

.camera-glow.tentative {
  animation: glowPulse 1.8s ease-in-out infinite;
}

.camera-glow.tentative-strong {
  animation: glowPulseStrong 1.2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%   { box-shadow: inset 0 0 18px 4px rgba(240, 200, 130, 0.25); }
  50%  { box-shadow: inset 0 0 32px 8px rgba(240, 200, 130, 0.45); }
  100% { box-shadow: inset 0 0 18px 4px rgba(240, 200, 130, 0.25); }
}

@keyframes glowPulseStrong {
  0%   { box-shadow: inset 0 0 28px 8px rgba(220, 170, 80, 0.45); }
  50%  { box-shadow: inset 0 0 48px 14px rgba(220, 170, 80, 0.7); }
  100% { box-shadow: inset 0 0 28px 8px rgba(220, 170, 80, 0.45); }
}

/* Hint text */
.scan-hint-bar.tentative {
  animation: hintBreath 2s ease-in-out infinite;
  color: #c4935a;
}

.scan-hint-bar.no-result {
  color: #a08070;
  font-size: 1rem;
}

@keyframes hintBreath {
  0%   { opacity: 0.7; }
  50%  { opacity: 1; }
  100% { opacity: 0.7; }
}

/* ---- Bottom bar: 30% ---- */
.identifier-bottom-bar {
  flex: 0 0 30%;
  background: #fdf5f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
}

.scan-hint-bar {
  font-size: 1.15rem;
  font-style: italic;
  color: #3a2a2a;
  letter-spacing: 0.03em;
  text-align: center;
  transition: opacity 0.3s ease;
}

.image-upload-btn {
  background: none;
  border: none;
  color: #a08070;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.88rem;
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.image-upload-btn:hover { color: #3a2a2a; }

/* ================================================
   RESULT CARD
   ================================================ */

.result-card {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(170deg, #fff8f2 0%, #fdeee2 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: top 0.55s cubic-bezier(0.32, 1.1, 0.55, 1);
  z-index: 25;
  overflow: hidden;
}

.result-card.visible { top: 0; }

.result-card-crescent {
  position: relative;
  flex: 0 0 42%;
  background: #2f1f1f;
  overflow: hidden;
  border-radius: 0 0 55% 55% / 0 0 38% 38%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}

.result-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem 2rem;
  gap: 0.3rem;
}

.result-card-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-top: -2rem;
  margin-bottom: 0.4rem;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.18));
  flex-shrink: 0;
}

.result-card-name {
  font-size: 2.1rem;
  font-weight: 500;
  color: #2f1f1f;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.1;
}

.result-card-confidence {
  font-size: 0.8rem;
  color: #b08878;
  font-style: italic;
  letter-spacing: 0.07em;
  margin-bottom: 0.6rem;
}

.result-card-profile-btn {
  background: #2f1f1f;
  color: #fdf5f0;
  border: none;
  border-radius: 28px;
  padding: 11px 34px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  margin-top: 0.4rem;
}

.result-card-profile-btn:hover { background: #7a3828; }
.result-card-profile-btn:active { transform: scale(0.97); }

.result-card-scan-again {
  background: none;
  border: none;
  color: #b08878;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.88rem;
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
  margin-top: 0.3rem;
}

.result-card-scan-again:hover { color: #2f1f1f; }

.result-card-close {
  background: none;
  border: none;
  color: #cbb8b0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  font-style: italic;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 0;
  margin-top: 0.15rem;
  transition: color 0.2s;
}

.result-card-close:hover { color: #7a3828; }

/* ================================================
   CATALOGUE
   ================================================ */

.catalogue { padding: 20px 16px; }

.flower-card {
  display: flex;
  align-items: center;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.1s ease;
  height: 80px;
  cursor: pointer;
}

.flower-card:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12); }
.flower-card:active { filter: brightness(0.9); transform: scale(0.98); }

.flower-card.amaryllis { background: radial-gradient(ellipse 10% 100% at 80% 50%, #ffe4d4 0%, #ffe4d4 60%, transparent 61%), linear-gradient(to right, #ffccb2 80%, #ffe4d4 65%); }
.flower-card.anemone { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e89a76 0%, #e89a76 60%, transparent 61%), linear-gradient(to right, #d8704d 80%, #e89a76 65%); }
.flower-card.aster { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e8d8ef 0%, #e8d8ef 60%, transparent 61%), linear-gradient(to right, #b583ca 80%, #e8d8ef 65%); }
.flower-card.azalea { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fde6cc 0%, #fde6cc 60%, transparent 61%), linear-gradient(to right, #fad4b0 80%, #fde6cc 65%); }
.flower-card.babysbreath { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e8f3f8 0%, #e8f3f8 60%, transparent 61%), linear-gradient(to right, #c9e4f2 80%, #e8f3f8 65%); }
.flower-card.begonia { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f6c7a6 0%, #f6c7a6 60%, transparent 61%), linear-gradient(to right, #f2a97b 80%, #f6c7a6 65%); }
.flower-card.buttercup { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f8e6a0 0%, #f8e6a0 60%, transparent 61%), linear-gradient(to right, #f2d45c 80%, #f8e6a0 65%); }
.flower-card.camellia { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f8d6dc 0%, #f8d6dc 60%, transparent 61%), linear-gradient(to right, #f2a9b8 80%, #f8d6dc 65%); }
.flower-card.carnation { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f2c3c0 0%, #f2c3c0 60%, transparent 61%), linear-gradient(to right, #e88b8b 80%, #f2c3c0 65%); }
.flower-card.chrysanthemum { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f7e1a3 0%, #f7e1a3 60%, transparent 61%), linear-gradient(to right, #ebc14d 80%, #f7e1a3 65%); }
.flower-card.clematis { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e5d8f5 0%, #e5d8f5 60%, transparent 61%), linear-gradient(to right, #c3a5e6 80%, #e5d8f5 65%); }
.flower-card.clover { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e4f2e9 0%, #e4f2e9 60%, transparent 61%), linear-gradient(to right, #bfe3c5 80%, #e4f2e9 65%); }
.flower-card.columbine { background: radial-gradient(ellipse 10% 100% at 80% 50%, #ece6f6 0%, #ece6f6 60%, transparent 61%), linear-gradient(to right, #cfc0e8 80%, #ece6f6 65%); }
.flower-card.cornflower { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e7ebf8 0%, #e7ebf8 60%, transparent 61%), linear-gradient(to right, #a8c7f2 80%, #e7ebf8 65%); }
.flower-card.crocus { background: radial-gradient(ellipse 10% 100% at 80% 50%, #eee8f8 0%, #eee8f8 60%, transparent 61%), linear-gradient(to right, #d2c3ee 80%, #eee8f8 65%); }
.flower-card.daffodil { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f7f6f3 0%, #f7f6f3 60%, transparent 61%), linear-gradient(to right, #e3e1dd 80%, #f7f6f3 65%); }
.flower-card.dahlia { background: radial-gradient(ellipse 10% 100% at 80% 50%, #eab7b3 0%, #eab7b3 60%, transparent 61%), linear-gradient(to right, #d97e78 80%, #eab7b3 65%); }
.flower-card.daisy { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fbfaf8 0%, #fbfaf8 60%, transparent 61%), linear-gradient(to right, #f1f0ec 80%, #fbfaf8 65%); }
.flower-card.dandelion { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fefdfc 0%, #fefdfc 60%, transparent 61%), linear-gradient(to right, #f7f6f4 80%, #fefdfc 65%); }
.flower-card.dogwood { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f7f3ee 0%, #f7f3ee 60%, transparent 61%), linear-gradient(to right, #ede7e0 80%, #f7f3ee 65%); }
.flower-card.forget { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e3f0fa 0%, #e3f0fa 60%, transparent 61%), linear-gradient(to right, #a3d1f0 80%, #e3f0fa 65%); }
.flower-card.foxglove { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f8e1e4 0%, #f8e1e4 60%, transparent 61%), linear-gradient(to right, #f1bfc5 80%, #f8e1e4 65%); }
.flower-card.gladiolus { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f9e3e6 0%, #f9e3e6 60%, transparent 61%), linear-gradient(to right, #f2bcc4 80%, #f9e3e6 65%); }
.flower-card.hawthorn { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f6f5f4 0%, #f6f5f4 60%, transparent 61%), linear-gradient(to right, #e4e2df 80%, #f6f5f4 65%); }
.flower-card.heather { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f1e6f0 0%, #f1e6f0 60%, transparent 61%), linear-gradient(to right, #d9bfd7 80%, #f1e6f0 65%); }
.flower-card.hellebore { background: radial-gradient(ellipse 10% 100% at 80% 50%, #eedfe6 0%, #eedfe6 60%, transparent 61%), linear-gradient(to right, #cda9b7 80%, #eedfe6 65%); }
.flower-card.holly { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f2b8b0 0%, #f2b8b0 60%, transparent 61%), linear-gradient(to right, #d8635a 80%, #f2b8b0 65%); }
.flower-card.honeysuckle { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fbf6e6 0%, #fbf6e6 60%, transparent 61%), linear-gradient(to right, #f4e3a1 80%, #fbf6e6 65%); }
.flower-card.hyacinth { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e9e0f5 0%, #e9e0f5 60%, transparent 61%), linear-gradient(to right, #c0a5e6 80%, #e9e0f5 65%); }
.flower-card.hydrangea { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e2eefa 0%, #e2eefa 60%, transparent 61%), linear-gradient(to right, #9dc4ee 80%, #e2eefa 65%); }
.flower-card.hyssop { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e3e4f3 0%, #e3e4f3 60%, transparent 61%), linear-gradient(to right, #b0b5dc 80%, #e3e4f3 65%); }
.flower-card.iris { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e7e0f4 0%, #e7e0f4 60%, transparent 61%), linear-gradient(to right, #b6a1e3 80%, #e7e0f4 65%); }
.flower-card.jasmine { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fbfaf4 0%, #fbfaf4 60%, transparent 61%), linear-gradient(to right, #f3eed9 80%, #fbfaf4 65%); }
.flower-card.slipper { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f9e9ed 0%, #f9e9ed 60%, transparent 61%), linear-gradient(to right, #e6b6c7 80%, #f9e9ed 65%); }
.flower-card.larkspur { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e3e6f7 0%, #e3e6f7 60%, transparent 61%), linear-gradient(to right, #a9b5e8 80%, #e3e6f7 65%); }
.flower-card.lavender { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f0ecf6 0%, #f0ecf6 60%, transparent 61%), linear-gradient(to right, #cbb8e4 80%, #f0ecf6 65%); }
.flower-card.lilac { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f6ecf7 0%, #f6ecf7 60%, transparent 61%), linear-gradient(to right, #d9bde5 80%, #f6ecf7 65%); }
.flower-card.lily { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fbfaf8 0%, #fbfaf8 60%, transparent 61%), linear-gradient(to right, #f2efe8 80%, #fbfaf8 65%); }
.flower-card.valley { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f9faf6 0%, #f9faf6 60%, transparent 61%), linear-gradient(to right, #edf0e4 80%, #f9faf6 65%); }
.flower-card.magnolia { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fbf9f7 0%, #fbf9f7 60%, transparent 61%), linear-gradient(to right, #f2e3f1 80%, #fbf9f7 65%); }
.flower-card.marigold { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f9e8b8 0%, #f9e8b8 60%, transparent 61%), linear-gradient(to right, #edc75a 80%, #f9e8b8 65%); }
.flower-card.monkshood { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e4e6f4 0%, #e4e6f4 60%, transparent 61%), linear-gradient(to right, #a6aed9 80%, #e4e6f4 65%); }
.flower-card.oleander { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f9e7ec 0%, #f9e7ec 60%, transparent 61%), linear-gradient(to right, #e8b4c1 80%, #f9e7ec 65%); }
.flower-card.orchid { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f5eaf4 0%, #f5eaf4 60%, transparent 61%), linear-gradient(to right, #d6b5da 80%, #f5eaf4 65%); }
.flower-card.pansy { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e9e3f4 0%, #e9e3f4 60%, transparent 61%), linear-gradient(to right, #b5a0d8 80%, #e9e3f4 65%); }
.flower-card.passionflower { background: radial-gradient(ellipse 10% 100% at 80% 50%, #e5e8f6 0%, #e5e8f6 60%, transparent 61%), linear-gradient(to right, #adb8e4 80%, #e5e8f6 65%); }
.flower-card.peony { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f9e6ec 0%, #f9e6ec 60%, transparent 61%), linear-gradient(to right, #e7b6c8 80%, #f9e6ec 65%); }
.flower-card.petunia { background: radial-gradient(ellipse 10% 100% at 80% 50%, #ede6f6 0%, #ede6f6 60%, transparent 61%), linear-gradient(to right, #c0a7e4 80%, #ede6f6 65%); }
.flower-card.poppy { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f7c8c0 0%, #f7c8c0 60%, transparent 61%), linear-gradient(to right, #e56a55 80%, #f7c8c0 65%); }
.flower-card.rose { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f9e8ee 0%, #f9e8ee 60%, transparent 61%), linear-gradient(to right, #e7a9bc 80%, #f9e8ee 65%); }
.flower-card.snapdragon { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fde8e6 0%, #fde8e6 60%, transparent 61%), linear-gradient(to right, #f3b6b0 80%, #fde8e6 65%); }
.flower-card.snowdrop { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fbfbf8 0%, #fbfbf8 60%, transparent 61%), linear-gradient(to right, #f0f3ea 80%, #fbfbf8 65%); }
.flower-card.sunflower { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fef4c6 0%, #fef4c6 60%, transparent 61%), linear-gradient(to right, #f7d869 80%, #fef4c6 65%); }
.flower-card.sweetpea { background: radial-gradient(ellipse 10% 100% at 80% 50%, #f9eef4 0%, #f9eef4 60%, transparent 61%), linear-gradient(to right, #e7c3d7 80%, #f9eef4 65%); }
.flower-card.sweetwilliam { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fde8ec 0%, #fde8ec 60%, transparent 61%), linear-gradient(to right, #f1b4c5 80%, #fde8ec 65%); }
.flower-card.tulip { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fbeaf0 0%, #fbeaf0 60%, transparent 61%), linear-gradient(to right, #e9b7c7 80%, #fbeaf0 65%); }
.flower-card.violet { background: radial-gradient(ellipse 10% 100% at 80% 50%, #edeaf5 0%, #edeaf5 60%, transparent 61%), linear-gradient(to right, #c5b8e4 80%, #edeaf5 65%); }
.flower-card.yarrow { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fbf6d9 0%, #fbf6d9 60%, transparent 61%), linear-gradient(to right, #f4e3a3 80%, #fbf6d9 65%); }
.flower-card.zinnia { background: radial-gradient(ellipse 10% 100% at 80% 50%, #fde8e5 0%, #fde8e5 60%, transparent 61%), linear-gradient(to right, #f3b2aa 80%, #fde8e5 65%); }

.flower-image-container {
  width: 30%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.flower-image { width: 50px; height: 50px; object-fit: contain; }

.flower-info { flex: 1; padding: 12px 16px; color: #2f3a3a; }

.flower-name { font-size: 1.05rem; margin: 0; font-weight: 500; letter-spacing: 0.2px; }

.flower-scientific { font-size: 0.8rem; font-style: italic; margin: 2px 8px; color: #444; opacity: 0.85; }

@media (max-width: 420px) {
  .flower-card { height: 75px; }
  .flower-image { width: 45px; height: 45px; }
  .flower-info { padding: 10px 14px; }
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: -260px;
  width: 260px; height: 100%;
  background: linear-gradient(to bottom right, #fff8ee 0%, #f7ecd9 100%);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
  transition: left 0.28s cubic-bezier(.2,.9,.3,1);
  z-index: 300;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-right: 1px solid #e9dbc5;
}

.sidebar.active {
  left: 0;
  touch-action: none;
  overscroll-behavior: none;
}

.sidebar h2 {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 14px;
  color: #4b3f35;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  padding-bottom: 8px;
}

.menu-list { list-style: none; padding: 0; margin: 0 0 16px 0; }

.menu-list li {
  padding: 10px 0;
  font-size: 1rem;
  color: #3a3a3a;
  cursor: pointer;
  transition: color 0.18s, transform 0.12s ease-in;
}

.menu-list li:hover { color: #7a5b3e; transform: translateX(4px); }

hr { border: none; height: 1px; background-color: #e5d8c8; margin: 12px 0; }

.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.32);
  opacity: 0; visibility: hidden;
  transition: opacity 0.28s ease;
  z-index: 200;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
  touch-action: none;
  overscroll-behavior: none;
}

/* Flower Detail Page */
.flower-page {
  position: fixed;
  top: 0; left: 100%;
  width: 100%; height: 100%;
  background-color: #fdf5f1;
  transition: left 0.5s ease-in-out;
  z-index: 400;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.flower-page.active { left: 0; }

body.transitioning main { opacity: 0.3; transition: opacity 0.3s ease; }/* ================================================
   OPTIONS PAGE
   ================================================ */
 
.options-page {
  position: fixed;
  top: 0; left: 100%;
  width: 100%; height: 100%;
  background: #f9f6f3;
  z-index: 10003;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: left 0.45s cubic-bezier(0.32, 0.9, 0.55, 1);
  display: flex;
  flex-direction: column;
}
 
.options-page.active { left: 0; }
 
.options-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem 0.8rem;
  background: linear-gradient(to bottom, #fff3ea, #f9e0d0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}
 
.options-header h2 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #2f1f1f;
}
 
.options-body {
  padding: 1.4rem 1.2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}
 
/* Section */
.options-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
 
.options-section-title {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b08878;
  padding: 0 0.2rem;
  margin-bottom: 0.2rem;
}
 
.options-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
 
/* Row */
.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid #f3ede8;
}
 
.options-row:last-child { border-bottom: none; }
 
.options-row-label {
  font-size: 1rem;
  color: #2f1f1f;
  letter-spacing: 0.02em;
}
 
.options-row-sub {
  font-size: 0.78rem;
  color: #b08878;
  font-style: italic;
  margin-top: 2px;
}
 
/* Toggle switch */
.options-toggle {
  position: relative;
  width: 48px;
  height: 27px;
  flex-shrink: 0;
}
 
.options-toggle input { opacity: 0; width: 0; height: 0; }
 
.options-toggle-track {
  position: absolute;
  inset: 0;
  background: #ddd;
  border-radius: 27px;
  transition: background 0.25s ease;
  cursor: pointer;
}
 
.options-toggle input:checked + .options-toggle-track { background: #c47a90; }
 
.options-toggle-track::after {
  content: '';
  position: absolute;
  width: 21px; height: 21px;
  background: white;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
 
.options-toggle input:checked + .options-toggle-track::after {
  transform: translateX(21px);
}
 
/* Segmented control (confidence threshold) */
.options-segments {
  display: flex;
  background: #f0ebe6;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
 
.options-segment {
  flex: 1;
  padding: 6px 0;
  border: none;
  background: none;
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.88rem;
  color: #a08070;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: center;
}
 
.options-segment.active {
  background: #fff;
  color: #2f1f1f;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
 
/* About section */
.options-about {
  background: #fff;
  border-radius: 16px;
  padding: 1.4rem 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
 
.options-about-title {
  font-size: 1.3rem;
  font-weight: 500;
  color: #2f1f1f;
  letter-spacing: 0.03em;
}
 
.options-about-version {
  font-size: 0.78rem;
  color: #b08878;
  font-style: italic;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}
 
.options-about-tagline {
  font-size: 0.92rem;
  color: #6b5550;
  font-style: italic;
  line-height: 1.5;
  border-left: 2px solid #f9e0d0;
  padding-left: 0.8rem;
  margin-bottom: 0.6rem;
}
 
.options-credit-row {
  font-size: 0.82rem;
  color: #7a6560;
  line-height: 1.5;
  padding: 0.3rem 0;
  border-bottom: 1px solid #f3ede8;
}
 
.options-credit-row:last-child { border-bottom: none; }
 
.options-credit-row strong {
  color: #2f1f1f;
  font-weight: 500;
}
 
/* Support button */
.options-support-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(to bottom, #fff3ea, #f9e0d0);
  border: none;
  border-radius: 16px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: #2f1f1f;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: opacity 0.2s ease, transform 0.1s ease;
}
 
.options-support-btn:hover { opacity: 0.85; }
.options-support-btn:active { transform: scale(0.98); }
 
/* ================================================
   DARK MODE
   ================================================ */
 
body.dark-mode {
  background-color: #1a1410;
  color: #e8ddd5;
}
 
body.dark-mode .topbar {
  background: linear-gradient(to bottom, #2a1e18, #231810);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
 
body.dark-mode .topbar h1,
body.dark-mode .menu-icon,
body.dark-mode .menu-dots { color: #e8ddd5; }
 
body.dark-mode #topbarSearch {
  background: #2f2018;
  color: #e8ddd5;
}
 
body.dark-mode .flower-card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  filter: brightness(0.82) saturate(0.9);
}
 
body.dark-mode .sidebar {
  background: linear-gradient(to bottom right, #231810 0%, #1e1510 100%);
  border-right-color: #3a2a20;
}
 
body.dark-mode .sidebar h2 { color: #c8b8a8; }
body.dark-mode .menu-list li { color: #d8c8b8; }
body.dark-mode .menu-list li:hover { color: #f9e0d0; }
body.dark-mode hr { background-color: #3a2a20; }
 
body.dark-mode .filter-menu {
  background: #2a1e18;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
 
body.dark-mode .filter-btn { color: #d8c8b8; }
body.dark-mode .filter-btn:hover { background: #3a2a20; }
 
body.dark-mode .bottom-sheet {
  background: #231810;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.4);
}
 
body.dark-mode .bottom-sheet-header h3 { color: #e8ddd5; }
body.dark-mode .bottom-option { color: #d8c8b8; }
 
body.dark-mode .bottom-sheet-apply {
  background: linear-gradient(to bottom, #3a2a20, #2f1f18);
  color: #f9e0d0;
}
 
body.dark-mode .bottom-sheet-reset { background: #2a1e18; color: #c8b8a8; }
 
body.dark-mode .bottom-sheet-options input[type="checkbox"] {
  background: #2f1f18;
  border-color: #6a4a38;
}
 
body.dark-mode .loading-screen { background: #1a1410; }
body.dark-mode .loading-text { color: #a08878; }
body.dark-mode .loading-spinner {
  border-color: rgba(200, 150, 120, 0.3);
  border-top-color: #a08070;
}
 
body.dark-mode .options-page { background: #1a1410; }
 
body.dark-mode .options-header {
  background: linear-gradient(to bottom, #2a1e18, #231810);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
 
body.dark-mode .options-header h2 { color: #e8ddd5; }
body.dark-mode .options-section-title { color: #8a6858; }
 
body.dark-mode .options-card,
body.dark-mode .options-about {
  background: #231810;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
 
body.dark-mode .options-row { border-bottom-color: #2f2018; }
body.dark-mode .options-row-label { color: #e8ddd5; }
body.dark-mode .options-row-sub { color: #8a6858; }
 
body.dark-mode .options-segments { background: #2a1e18; }
body.dark-mode .options-segment { color: #8a7060; }
body.dark-mode .options-segment.active {
  background: #3a2a20;
  color: #e8ddd5;
}
 
body.dark-mode .options-about-title { color: #e8ddd5; }
body.dark-mode .options-about-version { color: #8a6858; }
body.dark-mode .options-about-tagline {
  color: #b09888;
  border-left-color: #3a2a20;
}
 
body.dark-mode .options-credit-row { color: #9a8878; border-bottom-color: #2f2018; }
body.dark-mode .options-credit-row strong { color: #e8ddd5; }
 
body.dark-mode .options-support-btn {
  background: linear-gradient(to bottom, #3a2a20, #2f1f18);
  color: #f9e0d0;
}
 
body.dark-mode .identifier-bottom-bar { background: #231810; }
body.dark-mode .scan-hint-bar { color: #d8c8b8; }
 
body.dark-mode .result-card {
  background: linear-gradient(170deg, #231810 0%, #1e1510 100%);
}
 
body.dark-mode .result-card-name { color: #e8ddd5; }
body.dark-mode .result-card-confidence { color: #8a6858; }
body.dark-mode .result-card-scan-again { color: #8a6858; }
body.dark-mode .result-card-close { color: #6a5048; }
 
/* ================================================
   SUPPORT MESSAGE
   ================================================ */
 
.support-message {
  background: #fff;
  border-radius: 16px;
  padding: 1.4rem 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
 
.support-message p {
  font-size: 1.05rem;
  color: #4a3830;
  line-height: 1.6;
  font-style: italic;
  letter-spacing: 0.02em;
}
 
/* ================================================
   DARK MODE — FLOWER PAGE CARDS
   ================================================ */
 
body.dark-mode .flower-page {
  background-color: #1a1410;
}
 
 
body.dark-mode .flower-content .card {
  background: #231810 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
  color: #e8ddd5 !important;
}
 
body.dark-mode .flower-content .card h2 {
  color: #e8ddd5 !important;
}
 
body.dark-mode .flower-content .card p {
  color: #c8b8a8 !important;
}
 
body.dark-mode .flower-content .meaning.card {
  background: #2a1e18 !important;
  color: #e8ddd5 !important;
}
 
body.dark-mode .flower-content .gallery.card {
  background: #231810 !important;
}
 

 
body.dark-mode .support-message {
  background: #231810;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
 
body.dark-mode .support-message p {
  color: #c8b8a8;
}