/* VinoLocal Web — Dark Premium Theme */
/* Matches native app: colors.ts */

:root {
  --bg: #0A0A0C;
  --surface: #141418;
  --surface-elevated: #1E1E24;
  --surface-glass: rgba(255,255,255,0.04);
  --border-subtle: rgba(255,255,255,0.06);
  --border-medium: rgba(255,255,255,0.10);
  --text: #F5F5F7;
  --text-secondary: #8E8E93;
  --text-tertiary: #48484A;
  --accent: #D4A054;
  --accent-gold: #C9A84C;
  --success: #34C759;
  --warning: #FF9500;
  --destructive: #FF3B30;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Page sections fade in on load */
section, header, footer { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Smooth focus states */
input:focus, textarea:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(212,160,84,0.15); transition: border-color 0.2s, box-shadow 0.2s; }

/* Smooth section transitions */
.collapsible-content { animation: expandIn 0.2s ease-out; }
@keyframes expandIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* --- Hero --- */

.hero {
  padding: 80px 20px 60px;
  text-align: center;
  background: linear-gradient(180deg, #1A0A1E 0%, var(--bg) 100%);
}

.hero-content { max-width: 640px; margin: 0 auto; }

.zefod-badge {
  display: inline-flex;
  width: 56px; height: 56px;
  border-radius: 28px;
  background: rgba(212,160,84,0.15);
  align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: var(--accent);
  margin-bottom: 20px;
}

.hero h1 { font-size: 48px; font-weight: 700; margin-bottom: 8px; }
.subtitle { font-size: 18px; color: var(--accent); margin-bottom: 12px; }
.tagline { font-size: 16px; color: var(--text-secondary); max-width: 500px; margin: 0 auto 28px; }

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- Buttons --- */

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.97); opacity: 0.7; }
.btn { transition: opacity 0.15s, transform 0.1s; }
.btn-primary { background: var(--accent); color: #1A0A1E; }
.btn-secondary { background: var(--surface-elevated); color: var(--text); border: 1px solid var(--border-medium); }
.btn-small { padding: 8px 16px; font-size: 13px; background: var(--surface-elevated); color: var(--text-secondary); border: 1px solid var(--border-subtle); border-radius: 8px; }

/* --- Value Section --- */

.value-section { padding: 60px 20px; }
.value-section h2 { text-align: center; font-size: 28px; margin-bottom: 32px; }

.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.value-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
}
.value-icon { font-size: 28px; display: block; margin-bottom: 12px; }
.value-card h3 { font-size: 16px; color: var(--accent); margin-bottom: 8px; }
.value-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* --- Wines Section --- */

.wines-section { padding: 60px 20px; background: var(--surface); }
.wines-section h2 { text-align: center; font-size: 28px; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--text-secondary); margin-bottom: 32px; font-size: 14px; }

.wine-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

.wine-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.2s;
}
.wine-card:hover { border-color: var(--border-medium); }

.wine-header h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.wine-region { font-size: 13px; color: var(--text-secondary); }

.wine-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.wine-tag {
  font-size: 11px; color: var(--text);
  background: rgba(212,160,84,0.1);
  border-radius: 6px; padding: 3px 8px;
}

.wine-notable {
  font-size: 13px; color: var(--accent); font-style: italic;
  margin: 10px 0; line-height: 1.5;
}

/* Expanded provenance */
.wine-expanded { margin-top: 16px; border-top: 1px solid var(--border-subtle); padding-top: 16px; }

.prov-block { margin-bottom: 14px; }
.prov-label {
  font-size: 11px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px;
  display: block; margin-bottom: 4px;
}
.prov-block p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.zefod-block {
  background: rgba(212,160,84,0.06);
  border-radius: 10px; padding: 12px;
}
.zefod-block p { color: var(--text); }

/* Compare section */
.compare-section { padding: 60px 20px; }
.compare-section h2 { text-align: center; font-size: 28px; margin-bottom: 8px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 700px; margin: 0 auto; }
.compare-card { border-radius: 14px; padding: 24px; border: 1px solid var(--border-subtle); }
.compare-card.ours { background: rgba(212,160,84,0.06); border-color: var(--accent); }
.compare-card.theirs { background: var(--surface-glass); }
.compare-card h3 { font-size: 18px; margin-bottom: 12px; }
.compare-card.ours h3 { color: var(--accent); }
.compare-card.theirs h3 { color: var(--text-tertiary); }
.compare-card ul { list-style: none; }
.compare-card li { font-size: 14px; color: var(--text-secondary); padding: 4px 0; padding-left: 16px; position: relative; }
.compare-card.ours li::before { content: '\2713'; position: absolute; left: 0; color: var(--success); }
.compare-card.theirs li::before { content: '\2717'; position: absolute; left: 0; color: var(--text-tertiary); }
@media (max-width: 640px) { .compare-grid { grid-template-columns: 1fr; } }

/* How section — 1 line compact */
.how-section { padding: 24px 20px; border-bottom: 1px solid var(--border-subtle); }
.how-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: nowrap; }
.how-item { display: flex; align-items: center; gap: 6px; }
.how-num {
  width: 22px; height: 22px; border-radius: 11px;
  background: rgba(212,160,84,0.12); color: var(--accent);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.how-text { font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
.how-text strong { color: var(--text); }
.how-divider { color: var(--text-tertiary); font-size: 14px; }

/* Features section */
.features-section { padding: 48px 20px; }
.features-section h2 { text-align: center; font-size: 24px; margin-bottom: 24px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature-card {
  background: var(--surface-glass); border: 1px solid var(--border-subtle);
  border-radius: 14px; padding: 20px;
}
.feature-icon { font-size: 24px; display: block; margin-bottom: 10px; }
.feature-card h3 { font-size: 15px; margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* Differ section — neutral, not "better" */
.differ-section { padding: 48px 20px; background: var(--surface); }
.differ-section h2 { text-align: center; font-size: 24px; margin-bottom: 8px; }
.differ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 700px; margin: 0 auto; }
.differ-card { border-radius: 14px; padding: 20px; border: 1px solid var(--border-subtle); background: var(--surface-glass); }
.differ-card.highlight { border-color: rgba(212,160,84,0.2); background: rgba(212,160,84,0.04); }
.differ-card h4 { font-size: 15px; margin-bottom: 8px; color: var(--text-secondary); }
.differ-card.highlight h4 { color: var(--accent); }
.differ-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
@media (max-width: 640px) { .differ-grid { grid-template-columns: 1fr; } }

/* Ask section — subtle */
.ask-section { padding: 40px 20px; }

/* My Wines page */
.mywines-page { min-height: 100vh; padding-bottom: 72px; }
.mywines-container { max-width: 600px; margin: 0 auto; }
.mywines-header { padding: 16px 16px 8px; }
.mywines-header h1 { font-size: 28px; font-weight: 700; }
.mywines-empty { text-align: center; padding: 60px 32px; }
.mywines-empty .empty-icon { font-size: 56px; margin-bottom: 16px; }
.mywines-empty h3 { font-size: 20px; margin-bottom: 8px; }
.mywines-empty p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.mywines-count { font-size: 13px; color: var(--text-tertiary); padding: 8px 16px; }
.mywines-list { padding: 0; }
.wine-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; min-height: 52px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; transition: background 0.15s;
}
.wine-row:hover { background: var(--surface-glass); }
.wine-row:active { background: rgba(255,255,255,0.06); }
.wine-row-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); flex-shrink: 0; }
.wine-row-info { flex: 1; min-width: 0; }
.wine-row-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wine-row-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.wine-row-arrow { color: var(--text-tertiary); font-size: 18px; }
.mywines-actions { padding: 20px 16px; text-align: center; }

/* B2B section (subtle) */
.b2b-section { padding: 40px 20px; background: var(--surface); }
.b2b-section h2 { text-align: center; font-size: 24px; margin-bottom: 8px; }
.b2b-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.b2b-item { padding: 16px; }
.b2b-item strong { font-size: 15px; color: var(--text); display: block; margin-bottom: 4px; }
.b2b-item p { font-size: 13px; color: var(--text-secondary); }

/* Zefod CTA */
.zefod-cta-section { padding: 48px 20px; }

/* Three-col grid */
.three-col { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .three-col { grid-template-columns: 1fr; } }

/* Scale explainer */
.scale-explainer-toggle {
  display: block; width: 100%; text-align: left;
  background: none; border: none; color: var(--accent);
  font-size: 12px; cursor: pointer; padding: 8px 0 0;
  text-decoration: underline;
}
.scale-explainer {
  margin-top: 8px; padding: 12px;
  background: rgba(255,255,255,0.03); border-radius: 10px;
}
.scale-explainer p { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.6; }
.scale-explainer p:last-child { margin-bottom: 0; }
.scale-explainer code { font-family: monospace; background: rgba(255,255,255,0.06); padding: 1px 4px; border-radius: 3px; }

/* Zefod formatted output */
.msg-bubble-zefod p { margin: 0 0 8px; line-height: 1.6; }
.msg-bubble-zefod p:last-child { margin-bottom: 0; }

/* Zefod hero section with avatar */
.hero-zefod-section { display: flex; gap: 10px; margin-bottom: 4px; }
.zefod-avatar-small {
  width: 24px; height: 24px; border-radius: 12px; flex-shrink: 0;
  background: rgba(212,160,84,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--accent);
  margin-top: 2px;
}
.hero-zefod-content { font-size: 15px; color: var(--text); line-height: 1.6; }
.hero-zefod-content p { margin: 0 0 8px; }
.hero-zefod-content p:first-child { color: var(--accent); font-style: italic; }
.hero-zefod-content p:last-child { margin-bottom: 0; }

/* Recent wines in Zefod chat */
.recent-wines { padding: 8px 16px; border-bottom: 1px solid var(--border-subtle); }
.recent-label { font-size: 11px; color: var(--text-tertiary); margin-bottom: 6px; }
.recent-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.recent-chip {
  font-size: 12px; color: var(--accent); background: rgba(212,160,84,0.08);
  border: 1px solid rgba(212,160,84,0.15); border-radius: 10px;
  padding: 4px 10px; cursor: pointer; border-style: solid;
}
.recent-chip:hover { opacity: 0.7; }

/* Toast notifications */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--surface-elevated); color: var(--text);
  padding: 12px 24px; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--border-medium);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 1000;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
  pointer-events: none;
}
.toast.error { border-color: var(--destructive); color: var(--destructive); }
.toast.success { border-color: var(--success); color: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-elevated) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 70%; margin-bottom: 12px; }
.skeleton-block { height: 80px; margin-bottom: 12px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.loading { text-align: center; color: var(--text-tertiary); padding: 40px; }

/* --- Pricing --- */

.pricing-section { padding: 60px 20px; }
.pricing-section h2 { text-align: center; font-size: 28px; margin-bottom: 32px; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }

.price-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 14px; padding: 28px;
  text-align: center;
}
.price-card.featured { border-color: var(--accent); }
.price-card h3 { font-size: 18px; margin-bottom: 12px; }
.price { font-size: 36px; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.price span { font-size: 16px; color: var(--text-secondary); font-weight: 400; }
.price-card ul { list-style: none; text-align: left; }
.price-card li { font-size: 14px; color: var(--text-secondary); padding: 6px 0; border-bottom: 1px solid var(--border-subtle); }
.price-card li:last-child { border-bottom: none; }

/* --- Hospitality --- */

.hospitality-section { padding: 60px 20px; background: var(--surface); }
.hospitality-section h2 { text-align: center; font-size: 28px; margin-bottom: 8px; }

.hospitality-demo {
  display: flex; gap: 32px; align-items: center;
  max-width: 700px; margin: 32px auto 0;
  flex-wrap: wrap; justify-content: center;
}

.qr-placeholder {
  width: 160px; height: 160px;
  background: var(--surface-elevated);
  border: 2px dashed var(--border-medium);
  border-radius: 14px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.qr-placeholder span { font-size: 36px; font-weight: 700; color: var(--accent); }
.qr-placeholder p { font-size: 12px; color: var(--text-tertiary); margin-top: 8px; }

.hospitality-info ul { list-style: none; margin-bottom: 20px; }
.hospitality-info li { font-size: 15px; color: var(--text-secondary); padding: 4px 0; }

/* --- Footer --- */

footer {
  padding: 40px 20px; text-align: center;
  border-top: 1px solid var(--border-subtle);
}
footer p { font-size: 14px; color: var(--text-secondary); }
.footer-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* ===== ZEFOD CHAT PAGE ===== */

.zefod-page {
  height: 100vh; height: 100dvh;
  overflow: hidden;
}

.chat-container {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  max-width: 600px; margin: 0 auto;
  background: var(--bg);
  /* Reserve space for the fixed .bottom-nav so the input bar isn't
     painted over. 72px covers icon (44) + label (10) + padding (8+8)
     on top of the phone's safe-area-inset-bottom. */
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
  flex-shrink: 0;
}

.back-link {
  font-size: 22px;
  color: var(--text);
  text-decoration: none;
  padding: 12px 16px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.chat-header-info { display: flex; align-items: center; gap: 10px; }
.zefod-avatar {
  width: 36px; height: 36px; border-radius: 18px;
  background: rgba(212,160,84,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--accent);
}
.chat-header-info h1 { font-size: 17px; font-weight: 700; }
.chat-header-info span { font-size: 12px; color: var(--text-secondary); }

/* Messages */
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}

.msg-row { display: flex; align-items: flex-end; gap: 8px; }
.msg-zefod { justify-content: flex-start; }
.msg-user { justify-content: flex-end; }

.msg-avatar {
  width: 28px; height: 28px; border-radius: 14px;
  background: rgba(212,160,84,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}

.msg-bubble {
  max-width: 78%; border-radius: 16px;
  padding: 10px 14px;
  font-size: 14px; line-height: 1.5;
  word-wrap: break-word;
}
.msg-bubble-user { background: rgba(212,160,84,0.15); border-bottom-right-radius: 4px; }
.msg-bubble-zefod { background: rgba(255,255,255,0.06); border-bottom-left-radius: 4px; }

.msg-loading { font-size: 13px; color: var(--text-secondary); font-style: italic; }

/* Typing indicator dots */
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 3px;
  background: var(--text-tertiary);
  animation: typingBounce 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick questions */
.quick-section { padding: 0 16px 16px; flex-shrink: 0; }
.quick-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-chip {
  background: rgba(212,160,84,0.08);
  border: 1px solid rgba(212,160,84,0.15);
  border-radius: 16px; padding: 8px 14px;
  font-size: 13px; color: var(--text);
  cursor: pointer; transition: opacity 0.15s;
}
.quick-chip:hover { opacity: 0.7; }

/* Wine context */
.wine-context { padding: 0 16px 8px; flex-shrink: 0; }
.wine-context input {
  width: 100%; background: var(--surface-elevated);
  border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 8px 12px; font-size: 13px; color: var(--text);
  outline: none;
}
.wine-context input::placeholder { color: var(--text-tertiary); }
.wine-context input:focus { border-color: var(--accent); }

.wine-search-results { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.wine-result-item {
  display: flex; flex-direction: column;
  background: var(--surface-elevated); border: none;
  padding: 8px 12px; border-radius: 8px;
  cursor: pointer; text-align: left; color: var(--text);
}
.wine-result-item strong { font-size: 13px; }
.wine-result-item span { font-size: 11px; color: var(--text-secondary); }
.wine-result-item:hover { background: var(--surface); }

/* Input bar */
.chat-input-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg);
}

.chat-input-bar input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 20px; padding: 10px 16px;
  font-size: 14px; color: var(--text);
  outline: none;
}
.chat-input-bar input::placeholder { color: var(--text-tertiary); }
.chat-input-bar input:focus { border-color: var(--accent); }

#send-btn {
  width: 36px; height: 36px; border-radius: 18px;
  background: none; border: none;
  color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#send-btn:hover { opacity: 0.7; }

/* --- Mobile --- */
@media (max-width: 640px) {
  .hero h1 { font-size: 36px; }
  .hero { padding: 48px 16px 40px; }
  .value-grid { grid-template-columns: 1fr 1fr; }
  .wine-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .value-grid { grid-template-columns: 1fr; }
}

/* ===== SCAN PAGE ===== */

.scan-page { min-height: 100vh; padding-bottom: 72px; }

.scan-container { max-width: 600px; margin: 0 auto; }

.scan-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.scan-header h1 { font-size: 17px; font-weight: 700; }

/* Camera */
.camera-section { text-align: center; }
.camera-wrap {
  position: relative;
  width: 100%; max-width: 500px; margin: 16px auto;
  aspect-ratio: 3/4;
  background: #000; border-radius: 16px; overflow: hidden;
}
.camera-wrap video { width: 100%; height: 100%; object-fit: cover; }
.camera-guides { position: absolute; inset: 32px; }
.guide {
  position: absolute; width: 28px; height: 28px;
  border-color: var(--accent); border-style: solid; border-width: 0;
}
.guide.tl { top:0; left:0; border-top-width:3px; border-left-width:3px; border-top-left-radius:8px; }
.guide.tr { top:0; right:0; border-top-width:3px; border-right-width:3px; border-top-right-radius:8px; }
.guide.bl { bottom:0; left:0; border-bottom-width:3px; border-left-width:3px; border-bottom-left-radius:8px; }
.guide.br { bottom:0; right:0; border-bottom-width:3px; border-right-width:3px; border-bottom-right-radius:8px; }
.camera-status {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-size: 13px; color: var(--text-secondary);
  background: rgba(0,0,0,0.6); padding: 6px 14px; border-radius: 12px;
}
.camera-controls { padding: 16px; text-align: center; }
.capture-btn {
  width: 64px !important; height: 64px !important; border-radius: 32px !important;
  padding: 0 !important; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
}
.capture-ring {
  width: 52px; height: 52px; border-radius: 26px;
  border: 3px solid #fff;
}

/* Camera switch link */
.camera-switch { display: block; margin: 12px auto; font-size: 13px; }
.camera-actions { text-align: center; padding: 8px 16px; }

/* Upload */
.upload-section { padding: 24px 16px; }
.upload-area {
  border: 2px dashed var(--border-medium);
  border-radius: 20px; padding: 48px 24px;
  text-align: center; transition: border-color 0.2s, background 0.2s;
}
.upload-area.drag-over { border-color: var(--accent); background: rgba(212,160,84,0.05); }
.upload-icon { font-size: 48px; margin-bottom: 16px; }
.upload-area h3 { font-size: 20px; margin-bottom: 8px; }
.upload-area p { font-size: 14px; color: var(--text-secondary); }
.upload-buttons { margin-top: 20px; }
.upload-btn { cursor: pointer; }
.upload-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 12px; }
.switch-mode-link {
  display: block; margin: 12px auto;
  font-size: 13px; color: var(--accent);
  background: none; border: none; cursor: pointer;
  text-decoration: underline;
}

/* Preview */
.preview-wrap { padding: 16px; text-align: center; }
.preview-wrap img {
  max-width: 100%; max-height: 400px;
  border-radius: 12px; border: 1px solid var(--border-subtle);
}
.preview-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }

/* Loading */
.loading-card { text-align: center; padding: 60px 24px; }
.loading-spinner {
  width: 40px; height: 40px; border-radius: 20px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 16px; color: var(--text-secondary); }
.loading-sub { font-size: 13px; color: var(--text-tertiary); margin-top: 6px; }

/* Wine glass branded animation */
.wine-glass-anim {
  position: relative; width: 100px; height: 150px;
  margin: 0 auto 24px;
}
.glass-fill {
  position: absolute; bottom: 28px; left: 18px;
  width: 64px; height: 0;
  background: linear-gradient(180deg, rgba(212,160,84,0.25), rgba(212,160,84,0.06));
  border-radius: 0 0 32px 32px;
  animation: glassFill 2.5s ease-in-out infinite;
}
@keyframes glassFill {
  0% { height: 0; opacity: 0.3; }
  50% { height: 65px; opacity: 0.6; }
  100% { height: 0; opacity: 0.3; }
}

/* Result: Hero Card */
.hero-card {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.hero-wine-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.hero-region { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.hero-zefod-quote {
  font-size: 17px; font-style: italic; color: var(--accent);
  line-height: 1.5; margin-bottom: 4px;
}
.hero-zefod-attrib { font-size: 12px; color: var(--text-tertiary); margin-bottom: 16px; }
.hero-price { font-size: 14px; color: var(--text-secondary); margin-top: 12px; }

/* Dual-gauge comparison card */
.comparison-card {
  background: rgba(255,255,255,0.03);
  border-radius: 14px; border: 1px solid rgba(255,255,255,0.06);
  padding: 14px; margin-bottom: 14px;
}
.rating-row { display: flex; align-items: center; gap: 12px; }
.rating-score { width: 72px; display: flex; align-items: baseline; }
.score-big { font-size: 28px; font-weight: 700; color: var(--accent-gold); }
.score-scale { font-size: 12px; color: var(--text-secondary); margin-left: 2px; }
.vivino-score { color: var(--text-tertiary); font-size: 24px; font-weight: 600; }
.vivino-scale { color: var(--text-tertiary); }
.rating-detail { flex: 1; }
.rating-label { font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.research-label { color: var(--accent-gold); display: flex; align-items: center; gap: 8px; }
.vivino-label { color: var(--text-tertiary); }
.five-point-badge {
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  background: rgba(255,255,255,0.06);
  padding: 2px 6px; border-radius: 4px;
}
.gauge-track {
  height: 6px; background: rgba(255,255,255,0.06);
  border-radius: 3px; overflow: hidden; position: relative;
}
.gauge-fill { height: 6px; border-radius: 3px; position: absolute; top: 0; left: 0; }
.gauge-research { background: var(--accent-gold); }
.gauge-vivino { background: var(--text-tertiary); opacity: 0.5; }
.gauge-noise {
  position: absolute; inset: 0; border-radius: 3px;
  border: 1px dashed rgba(255,255,255,0.08);
}
.signal-row { display: flex; align-items: center; gap: 4px; margin-top: 5px; }
.signal-dot { width: 5px; height: 5px; border-radius: 2.5px; background: var(--accent-gold); }
.signal-text { font-size: 10px; color: var(--text-secondary); }
.vivino-text { color: var(--text-tertiary); }
.comp-divider { height: 1px; background: rgba(255,255,255,0.05); margin: 10px 0; }

/* Collapsible sections */
.detail-sections { padding: 0 16px 16px; }
.collapsible {
  background: rgba(255,255,255,0.04);
  border-radius: 14px; border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 10px; overflow: hidden;
}
.collapsible-header {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 14px 16px;
  background: none; border: none; color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer;
  text-align: left;
}
.chevron { color: var(--text-secondary); }
.collapsible-content { padding: 0 16px 16px; }
.prov-block { margin-bottom: 14px; }
.prov-label {
  font-size: 12px; font-weight: 600; color: var(--accent);
  display: block; margin-bottom: 4px;
}
.prov-block p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.zefod-tip { background: rgba(212,160,84,0.06); border-radius: 10px; padding: 12px; }
.zefod-tip p { color: var(--text); }
.prov-notable {
  background: rgba(201,168,76,0.1); border-radius: 10px; padding: 10px;
  font-size: 13px; color: var(--text); line-height: 1.5;
}
.critics-grid { display: flex; flex-direction: column; gap: 8px; }
.critic-card {
  background: rgba(255,255,255,0.03); border-radius: 10px; padding: 12px;
  border: 1px solid rgba(255,255,255,0.04);
}
.critic-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.critic-score { font-size: 20px; font-weight: 700; }
.critic-quote { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; font-style: italic; }

.result-actions { display: flex; gap: 12px; justify-content: center; padding: 20px 16px; }

/* ── Zefod structured chips (food pairing + serving tip) ── */
.zefod-headline {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  margin: 0 0 6px;
}
.zefod-taste {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}
.zefod-chips {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0 4px;
}
@media (min-width: 520px) {
  .zefod-chips { grid-template-columns: 1fr 1fr; }
}
.zefod-chip {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.zefod-chip-icon { font-size: 20px; line-height: 1.2; flex-shrink: 0; }
.zefod-chip-body { flex: 1; min-width: 0; }
.zefod-chip-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 2px;
}
.zefod-chip-text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

/* ── Taste profile bars (Style & Body — always shown) ── */
.taste-profile-card {
  margin: 16px 0 4px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.taste-profile-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.taste-profile-bars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.trait-bar {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 10px;
}
.trait-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.trait-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.trait-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-gold) 100%);
  border-radius: 3px;
  transition: width 400ms ease-out;
}

/* ── Research card (single primary rating, Vivino as footnote) ── */
.research-card {
  margin: 16px 0 4px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}
.vivino-footnote {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}
.vivino-footnote strong { color: var(--text); font-weight: 600; }
.vivino-footnote-hint {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ── Palate match commentary (shows on result card after 5+ verdicts) ── */
.palate-match {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 4px;
  padding: 12px 14px;
  background: rgba(212, 160, 84, 0.08);
  border: 1px solid rgba(212, 160, 84, 0.25);
  border-radius: 10px;
}
.palate-match-icon { font-size: 18px; line-height: 1.2; }
.palate-match-text { font-size: 14px; line-height: 1.5; color: var(--text); }

/* ── Verdict row (Yes / Maybe / No) on scan result hero card ── */
.verdict-row {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.verdict-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
}
.verdict-buttons {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  justify-content: center;
}
.verdict-btn {
  flex: 1;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 100ms ease-out, background 150ms, border-color 150ms;
  -webkit-tap-highlight-color: transparent;
}
.verdict-btn:hover:not(:disabled) {
  background: var(--surface-elevated);
  border-color: var(--border-medium);
}
.verdict-btn:active:not(:disabled) { transform: scale(0.97); }
.verdict-btn:disabled { opacity: 0.5; cursor: default; }
.verdict-btn.selected {
  background: rgba(212, 160, 84, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}
.verdict-btn span { font-size: 13px; }
.verdict-saved {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 4px;
  animation: fadeIn 250ms ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Palate summary card (my-wines.html) ── */
.palate-summary {
  margin: 0 0 20px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(212, 160, 84, 0.06), rgba(212, 160, 84, 0.02));
  border: 1px solid rgba(212, 160, 84, 0.2);
  border-radius: 14px;
}
.palate-summary-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.palate-summary-headline { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.palate-summary-detail { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.palate-summary-detail + .palate-summary-detail { margin-top: 3px; }

/* ── Language toggle pill (NL | EN, top-right of every page) ── */
.lang-toggle-container {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: 12px;
  z-index: 60;
}
.lang-toggle {
  display: inline-flex;
  background: rgba(20, 20, 24, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.lang-btn {
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  -webkit-tap-highlight-color: transparent;
}
.lang-btn.active {
  background: var(--accent);
  color: #0A0A0C;
}
.lang-btn:not(.active):hover { color: var(--text); }

/* ── Capture success flash (visual-only — full viewfinder pulse) ── */
.capture-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 20;
}
.capture-flash.visible {
  animation: captureFlashIn 900ms ease-out forwards;
}
.capture-flash-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(212, 160, 84, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 rgba(212, 160, 84, 0), 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.3);
  position: relative;
}
.capture-flash.visible .capture-flash-ring {
  animation: captureRingIn 700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.capture-flash-check {
  width: 56px;
  height: 56px;
  position: relative;
}
.capture-flash-check::before,
.capture-flash-check::after {
  content: '';
  position: absolute;
  background: #0A0A0C;
  border-radius: 4px;
  transform-origin: left center;
}
.capture-flash-check::before {
  left: 6px;
  top: 32px;
  width: 0;
  height: 6px;
  transform: rotate(45deg);
}
.capture-flash-check::after {
  left: 22px;
  top: 36px;
  width: 0;
  height: 6px;
  transform: rotate(-50deg);
}
.capture-flash.visible .capture-flash-check::before {
  animation: checkStroke1 250ms ease-out 200ms forwards;
}
.capture-flash.visible .capture-flash-check::after {
  animation: checkStroke2 350ms ease-out 380ms forwards;
}
.capture-flash-label {
  position: absolute;
  bottom: -44px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
}
.capture-flash.visible .capture-flash-label {
  animation: labelFadeIn 300ms ease-out 350ms forwards;
}
@keyframes captureFlashIn {
  0%   { opacity: 0; background: rgba(212, 160, 84, 0); }
  20%  { opacity: 1; background: rgba(212, 160, 84, 0.18); }
  80%  { opacity: 1; background: rgba(212, 160, 84, 0.18); }
  100% { opacity: 0; background: rgba(212, 160, 84, 0); }
}
@keyframes captureRingIn {
  0%   { transform: scale(0.3); box-shadow: 0 0 0 0 rgba(212, 160, 84, 0); }
  40%  { transform: scale(1.08); box-shadow: 0 0 0 20px rgba(212, 160, 84, 0.2); }
  100% { transform: scale(1.0);  box-shadow: 0 0 0 40px rgba(212, 160, 84, 0); }
}
@keyframes checkStroke1 { to { width: 24px; } }
@keyframes checkStroke2 { to { width: 36px; } }
@keyframes labelFadeIn  { to { opacity: 1; } }

/* ── Scan mode toggle (Label / Wine list / Wine book) ── */
.mode-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  margin: 12px auto 0;
  gap: 2px;
}
.mode-btn {
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 150ms, color 150ms;
}
.mode-btn.active {
  background: var(--accent);
  color: #0A0A0C;
}
.mode-btn:not(.active):hover { color: var(--text); }

/* ── Wine list results (single photo → list of wines) ── */
.wine-list-results {
  padding: 16px;
  max-width: 480px;
  margin: 0 auto 96px;
}
.wine-list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.wine-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 120ms, border-color 150ms;
  -webkit-tap-highlight-color: transparent;
}
.wine-list-item:hover { border-color: var(--border-medium); }
.wine-list-item:active { transform: scale(0.985); }
.wine-list-item-num {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(212, 160, 84, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wine-list-item-body { flex: 1; min-width: 0; }
.wine-list-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.wine-list-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.wine-list-item-price {
  color: var(--accent);
  font-weight: 600;
  margin-left: 6px;
}
.wine-list-item-arrow {
  align-self: center;
  color: var(--text-tertiary);
  font-size: 20px;
  flex-shrink: 0;
}
.wine-list-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-secondary);
}

/* ── Wine book queue (multi-photo background processing) ── */
.book-queue {
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
}
.book-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.book-queue-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.book-queue-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.book-queue-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.book-queue-thumb {
  aspect-ratio: 3 / 4;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.book-queue-thumb.processing::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid var(--accent);
  border-radius: 8px;
  animation: bookQueuePulse 1.5s ease-in-out infinite;
}
.book-queue-thumb.done {
  border-color: var(--success);
}
.book-queue-thumb.done::after {
  content: '\2713';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  font-size: 20px;
  font-weight: 700;
  background: rgba(52, 199, 89, 0.3);
  border-radius: 6px;
}
.book-queue-thumb.failed {
  border-color: var(--warning);
}
.book-queue-thumb.failed::after {
  content: '!';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  font-size: 20px;
  font-weight: 700;
  background: rgba(255, 149, 0, 0.2);
  border-radius: 6px;
}
@keyframes bookQueuePulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.7; }
}
.book-queue-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.book-queue-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-gold));
  border-radius: 3px;
  transition: width 300ms ease-out;
}
.book-queue-status {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 12px;
}
.book-queue-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.book-queue-done-toast {
  position: fixed;
  left: 50%;
  top: 20%;
  transform: translateX(-50%) scale(0.9);
  background: var(--surface-elevated);
  border: 2px solid var(--success);
  border-radius: 16px;
  padding: 20px 28px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.book-queue-done-toast.visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.book-queue-done-toast h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--success);
  margin: 0 0 6px;
}
.book-queue-done-toast p {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 14px;
}

/* ── Voice controls (zefod.html mic + speaker) ── */
.voice-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.voice-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 150ms, color 150ms, border-color 150ms, transform 120ms;
}
.voice-btn:hover { color: var(--text); border-color: var(--border-medium); }
.voice-btn:active { transform: scale(0.94); }
.voice-btn.active {
  background: var(--accent);
  color: #0A0A0C;
  border-color: var(--accent);
}
.voice-btn.listening {
  background: var(--destructive);
  color: #FFFFFF;
  border-color: var(--destructive);
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.6); }
  50%      { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
}
.voice-btn svg { width: 20px; height: 20px; }

/* ── Minimal fullscreen home hero (index.html) ── */
.home-page {
  margin: 0;
  background: radial-gradient(ellipse at center top, #1a1516 0%, var(--bg) 65%);
  min-height: 100vh;
  min-height: 100dvh;
}
.home-hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: env(safe-area-inset-top, 24px) 24px calc(96px + env(safe-area-inset-bottom, 0px));
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.home-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}
.home-brand .zefod-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #0A0A0C;
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.home-brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.home-hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  width: 100%;
  padding: 32px 0;
}
.home-headline {
  font-size: clamp(34px, 8.5vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}
.home-sub {
  font-size: 17px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0;
  max-width: 320px;
}
.home-signals {
  list-style: none;
  padding: 0;
  margin: 8px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}
.home-signals li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.signal-bullet { color: var(--accent); font-size: 18px; line-height: 1; }
.btn-home-cta {
  margin-top: 16px;
  min-height: 56px;
  padding: 0 32px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(212, 160, 84, 0.25);
  -webkit-tap-highlight-color: transparent;
}
.btn-home-icon { font-size: 20px; line-height: 1; }
.btn-home-cta-secondary {
  margin-top: 8px;
  min-height: 48px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 150ms, border-color 150ms;
}
.btn-home-cta-secondary:hover {
  background: var(--surface-elevated);
  border-color: var(--border-medium);
}
.home-secondary-link {
  margin-top: 2px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--border-medium);
  text-underline-offset: 4px;
}
.home-secondary-link:hover { color: var(--text); }
.home-footer-link {
  padding-top: 12px;
  text-align: center;
}
.home-footer-link a {
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 150ms;
}
.home-footer-link a:hover { color: var(--text-secondary); }

/* ── About page header (about.html) ── */
.about-page .about-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: env(safe-area-inset-top, 12px) 12px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.about-page .about-header h1 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  text-align: center;
}
.about-page .feature-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(212, 160, 84, 0.1);
  border: 1px solid rgba(212, 160, 84, 0.25);
  border-radius: 10px;
  vertical-align: middle;
}
.back-link-text {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
}
.back-link-text:hover { color: var(--text); }

/* ── Capture button (scan.html camera UI) ── */
.camera-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  position: relative;
}
.camera-actions .btn.camera-switch {
  min-width: 92px;
  min-height: 44px;
  z-index: 2;
}
.camera-actions-spacer { width: 92px; flex-shrink: 0; }
.btn-capture {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease-out;
}
.btn-capture:active { transform: scale(0.94); }
.btn-capture:disabled { opacity: 0.5; cursor: default; }
.capture-ring {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid #F5F5F7;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  box-shadow: 0 0 0 0 rgba(212, 160, 84, 0);
  transition: box-shadow 200ms;
}
.capture-dot {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 120ms;
}
.btn-capture:active .capture-dot { transform: scale(0.85); }
.capture-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  white-space: nowrap;
}
.btn-capture.pulsing .capture-ring {
  animation: capturePulse 900ms ease-out;
}
@keyframes capturePulse {
  0%   { box-shadow: 0 0 0 0 rgba(212, 160, 84, 0.6); }
  100% { box-shadow: 0 0 0 24px rgba(212, 160, 84, 0); }
}

/* ── Step-by-step loading progress (replaces vibes text) ── */
.loading-card { padding: 24px 20px 28px; }
.loading-wine-name {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  margin: 6px 0 18px;
  min-height: 22px;
}
.loading-steps {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  opacity: 0.55;
  transition: opacity 200ms, border-color 200ms, color 200ms;
}
.loading-step.active {
  opacity: 1;
  color: var(--text);
  border-color: rgba(212, 160, 84, 0.4);
}
.loading-step.done {
  opacity: 1;
  color: var(--text);
}
.loading-step.failed {
  color: var(--warning);
  border-color: rgba(255, 149, 0, 0.3);
}
.loading-step-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  flex-shrink: 0;
  position: relative;
}
.loading-step.active .loading-step-icon {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: stepSpin 900ms linear infinite;
}
.loading-step.done .loading-step-icon {
  border-color: var(--success);
  background: var(--success);
}
.loading-step.done .loading-step-icon::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #0A0A0C;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.loading-step.failed .loading-step-icon {
  border-color: var(--warning);
  background: rgba(255, 149, 0, 0.15);
}
.loading-step.failed .loading-step-icon::after {
  content: '!';
  position: absolute;
  inset: 0;
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 16px;
}
.loading-step-label { flex: 1; }
.loading-step-time {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
}
.loading-slow-hint {
  margin: 16px auto 0;
  max-width: 340px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--warning);
  background: rgba(255, 149, 0, 0.06);
  border: 1px solid rgba(255, 149, 0, 0.25);
  border-radius: 8px;
  text-align: center;
}
@keyframes stepSpin {
  to { transform: rotate(360deg); }
}

/* ── Verdict badge on wine-row list items ── */
.wine-row-verdict {
  font-size: 16px;
  margin-right: 8px;
  flex-shrink: 0;
}
.wine-row-verdict.yes { filter: none; }
.wine-row-verdict.maybe { opacity: 0.8; }
.wine-row-verdict.no { opacity: 0.7; }

/* ── Confidence badge on scan result wine name ── */
.confidence-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 6px;
  vertical-align: middle;
  line-height: 1.4;
}
.confidence-badge.confidence-low {
  color: var(--warning);
  background: rgba(255, 149, 0, 0.12);
  border: 1px solid rgba(255, 149, 0, 0.3);
}
.confidence-badge.confidence-medium {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

/* ── Error card with retry (scan.html) ── */
#error-section {
  padding: 24px 16px 96px;
  max-width: 460px;
  margin: 0 auto;
}
.error-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}
.error-icon { font-size: 44px; line-height: 1; margin-bottom: 12px; }
.error-card h3 { font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.error-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 20px; }
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── iOS "Add to Home Screen" hint (index.html) ── */
.ios-install-hint {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  max-width: 460px;
  margin: 0 auto;
  padding: 16px 44px 16px 18px;
  background: var(--surface-elevated);
  border: 1px solid rgba(212, 160, 84, 0.3);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 200;
  animation: fadeIn 300ms ease-out;
}
.ios-install-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.ios-install-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}
.ios-install-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ios-install-close:hover { color: var(--text); }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: var(--bg);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 0 env(safe-area-inset-bottom, 12px);
  z-index: 100;
}
.nav-item {
  flex: 1; text-align: center; text-decoration: none;
  color: var(--text-tertiary); font-size: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav-item.active { color: var(--accent); }
.nav-icon { font-size: 20px; }
.scan-icon {
  background: var(--surface-elevated); border: 1px solid var(--border-subtle);
  border-radius: 14px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  margin-top: -8px;
}
.nav-label { font-size: 10px; }
