/* ========================================================
   SéLaVin — Mobile-First PWA Styles
   Design: Bordeaux profondo, finiture ottone/oro, minimalismo sommelier
   ======================================================== */

:root {
  --bg-color: #0e050b;
  --bg-surface: #170a13;
  --bg-card: rgba(30, 12, 24, 0.75);
  --bg-card-hover: rgba(46, 18, 36, 0.85);
  --border-color: rgba(212, 175, 55, 0.22);
  --border-glow: rgba(212, 175, 55, 0.45);
  
  --primary-color: #7c1231;
  --primary-hover: #98173c;
  --accent-gold: #cfa835;
  --accent-gold-light: #edd898;
  
  --text-main: #f5f2eb;
  --text-muted: #b8a3ad;
  --text-dim: #735d69;
  
  --success: #27ae60;
  --warning: #d35400;
  --danger: #c0392b;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --font-serif: 'Cinzel', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  --bottom-bar-height: 66px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(124, 18, 49, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(55, 7, 21, 0.25) 0%, transparent 55%);
  background-attachment: fixed;
}

/* Numeric input spinner reset */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-container {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(var(--bottom-bar-height) + 16px);
  overflow-x: hidden;
}

/* ========================================================
   HEADER
   ======================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(14, 5, 11, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-monogram {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(124, 18, 49, 0.35);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
}

.brand-text h1 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
}

.brand-text .tagline {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
}

/* Profile Selector */
.profile-switch-container {
  display: flex;
  align-items: center;
}

.profile-pill {
  display: flex;
  align-items: center;
  background: rgba(23, 10, 19, 0.9);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  gap: 6px;
  transition: all 0.25s ease;
}

.profile-badge-role {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-gold-light);
  background: rgba(124, 18, 49, 0.4);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.profile-pill select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.profile-pill select option {
  background: #170a13;
  color: #fff;
}

/* ========================================================
   MAIN CONTENT & VIEW PANELS
   ======================================================== */
.main-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.view-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.view-panel.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

/* Hero Card */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.hero-badge {
  display: inline-block;
  background: rgba(124, 18, 49, 0.3);
  border: 1px solid var(--border-color);
  color: var(--accent-gold-light);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.hero-card h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.hero-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
}

/* Status Chips */
.status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.status-indicator {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
}

.status-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5555;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  min-width: 0;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--primary-color), #460819);
  color: #fff;
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow: 0 4px 16px rgba(124, 18, 49, 0.3);
}

.action-btn.primary:active {
  transform: translateY(-1px);
}

.action-btn.secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.action-btn.secondary:active {
  transform: translateY(-1px);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.btn-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.btn-title {
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dashboard Section */
.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.section-header h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: 0.5px;
  color: var(--accent-gold-light);
}

.section-link {
  font-size: 0.74rem;
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 600;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--accent-gold);
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.2;
}

/* Sommelier Box */
.sommelier-features-card {
  background: rgba(23, 10, 19, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
}

.sommelier-badge {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.sommelier-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ========================================================
   VISTA QUADERNO (FASE 3)
   ======================================================== */
.quaderno-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.quaderno-header h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.5px;
}

.quaderno-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-small-primary {
  background: linear-gradient(135deg, var(--primary-color), #460819);
  color: #fff;
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Search Box */
.search-box {
  display: flex;
  align-items: center;
  background: rgba(25, 10, 20, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  gap: 8px;
  color: var(--accent-gold);
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
}

.clear-search-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

/* Filter Pills */
.quaderno-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.quaderno-filters::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-pill.active {
  background: rgba(124, 18, 49, 0.6);
  border-color: var(--accent-gold);
  color: #fff;
}

/* Tags Cloud */
.tags-cloud-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.tags-cloud-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tags-cloud-list {
  display: flex;
  gap: 5px;
}

.tag-cloud-item {
  font-size: 0.68rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border-color);
  color: var(--accent-gold-light);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
}

.tag-cloud-item:hover, .tag-cloud-item.active {
  background: var(--accent-gold);
  color: #000;
}

/* Tastings List */
.tastings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.tastings-loading {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.tastings-empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.tastings-empty-state h4 {
  font-family: var(--font-serif);
  color: #fff;
  font-size: 1.1rem;
}

.tastings-empty-state p {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 300px;
}

/* Tasting Card */
.tasting-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tasting-card:hover, .tasting-card:active {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

.tasting-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tasting-card-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #000;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tasting-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tasting-card-thumb svg {
  color: var(--accent-gold);
}

.tasting-card-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.tasting-wine-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tasting-producer {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tasting-meta-line {
  font-size: 0.7rem;
  color: var(--accent-gold);
  margin-top: 2px;
}

/* Tasting Score & Evaluation Badge */
.tasting-card-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
  font-size: 0.72rem;
}

.score-badge {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-gold-light);
}

.score-badge.top {
  color: #2ecc71;
}

.author-pill {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.68rem;
}

.rebuy-tag {
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.tasting-notes-excerpt {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================================
   MODAL OVERLAY & STRUTTURA AD ALTEZZA STABILE (88vh)
   ======================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 3, 6, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: #140810;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 520px;
  height: 88vh; /* Altezza fissa solida per evitare qualsiasi scatto di layout */
  max-height: 88vh;
  padding: 16px 16px 18px 16px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
  flex-shrink: 0;
}

.modal-title-wrap h3 {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  letter-spacing: 1px;
  color: var(--accent-gold-light);
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.modal-close:hover {
  color: #fff;
}

/* ========================================================
   SEGMENTED TABS (BORDEAUX PROFONDO & FINITURE ORO)
   Eliminazione totale dei pulsanti bianchi di default
   ======================================================== */
.segmented-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-top: 6px;
  margin-bottom: 10px;
  flex-shrink: 0;
  width: 100%;
}

.segmented-tabs .tab-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.segmented-tabs .tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.segmented-tabs .tab-btn.active {
  background: rgba(124, 18, 49, 0.7);
  border-color: var(--accent-gold);
  color: #fff;
  box-shadow: 0 2px 10px rgba(124, 18, 49, 0.35);
}

.tab-label {
  font-size: 0.78rem;
  letter-spacing: 0.3px;
}

/* Viewport Interno a Scorrimento */
.tab-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 2px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.tab-pane.active {
  display: flex;
}

/* Barra Azioni Fissa */
.modal-actions-sticky {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  width: 100%;
}

.btn-action {
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.btn-action.primary {
  background: linear-gradient(135deg, var(--primary-color), #460819);
  color: #fff;
  border-color: var(--accent-gold);
  box-shadow: 0 4px 14px rgba(124, 18, 49, 0.35);
}

.btn-action.secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-action.danger-action {
  color: #e74c3c;
  border-color: rgba(231, 76, 60, 0.4);
}

/* ========================================================
   SCANNER RESULT & ANTEPRIMA ETICHETTA FISSA
   Risoluzione bug immagine gigante: thumb rigoroso 56x56
   ======================================================== */
.scanner-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  gap: 14px;
}

.wine-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 320px;
}

.scanner-result {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.scan-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(23, 10, 19, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 8px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.summary-thumb {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  max-width: 56px;
  max-height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #000;
  flex-shrink: 0;
}

.summary-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.summary-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.summary-badge-row {
  display: flex;
  gap: 6px;
  margin-bottom: 3px;
}

.status-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(39, 174, 96, 0.2);
  color: #2ecc71;
  border: 1px solid rgba(39, 174, 96, 0.4);
}

.status-pill.duplicate {
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent-gold-light);
  border-color: rgba(212, 175, 55, 0.4);
}

.type-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(124, 18, 49, 0.4);
  color: #fff;
  border: 1px solid var(--border-color);
}

.summary-wine-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-producer {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-meta-line {
  font-size: 0.7rem;
  color: var(--accent-gold);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.dot-separator {
  opacity: 0.5;
}

/* ========================================================
   METRICS GRID, STEPPERS & INPUT CARDS (SCANNER TAB 2 & 3)
   ======================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.metric-card {
  background: rgba(25, 10, 20, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.metric-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-content label {
  font-size: 0.65rem;
  color: var(--accent-gold-light);
  font-weight: 700;
  text-transform: uppercase;
}

.metric-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.metric-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
  min-width: 0;
}

.unit-tag {
  font-size: 0.72rem;
  color: var(--accent-gold);
  font-weight: 600;
}

/* Stepper Annata con S.A. */
.stepper-input-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}

.stepper-input-wrap input {
  flex: 1;
}

.sa-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--accent-gold-light);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sa-toggle-btn.active {
  background: var(--accent-gold);
  color: #000;
}

/* Pannello Cantina & Touch Stepper */
.cellar-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cellar-panel-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}

.cellar-panel-header h5 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.panel-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.touch-stepper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stepper-action-btn {
  background: rgba(124, 18, 49, 0.3);
  border: none;
  color: var(--accent-gold);
  font-size: 1.2rem;
  font-weight: 700;
  width: 44px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.touch-stepper input {
  flex: 1;
  text-align: center;
  border: none;
  background: transparent;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
}

.quick-location-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent-gold-light);
  border-color: var(--accent-gold);
}

.price-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(25, 10, 20, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-sm);
  padding: 0 10px;
}

.currency-symbol {
  color: var(--accent-gold);
  font-weight: 700;
  margin-right: 6px;
}

.price-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 9px 0;
  color: #fff;
  outline: none;
}

/* ========================================================
   NUOVA DEGUSTAZIONE: SCANSIONE DIRETTA DA MODALE
   ======================================================== */
.tasting-wine-picker {
  background: rgba(25, 10, 20, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  flex-shrink: 0;
  margin-top: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tasting-scan-cta {
  display: flex;
  width: 100%;
}

.btn-scan-tasting {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(124, 18, 49, 0.5), rgba(46, 18, 36, 0.7));
  border: 1px dashed var(--accent-gold);
  border-radius: var(--radius-sm);
  color: var(--accent-gold-light);
  padding: 9px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-scan-tasting:hover {
  background: rgba(124, 18, 49, 0.7);
  border-style: solid;
  color: #fff;
}

.wine-picker-or {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tasting-attached-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(39, 174, 96, 0.15);
  border: 1px solid rgba(39, 174, 96, 0.35);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.74rem;
  color: #2ecc71;
}

.tasting-attached-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(39, 174, 96, 0.4);
  flex-shrink: 0;
}

.tasting-attached-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cellar-uncork-row {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--accent-gold-light);
  cursor: pointer;
}

.method-tabs {
  margin-bottom: 8px;
}

/* Form Styles & Groups */
.scanned-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 12px;
}

.form-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.flex-1 { flex: 1; min-width: 0; }
.flex-2 { flex: 2; min-width: 0; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.form-group label {
  font-size: 0.68rem;
  color: var(--accent-gold-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  min-width: 0;
  background: rgba(25, 10, 20, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 9px 11px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  border-color: var(--accent-gold);
}

.label-with-val {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.live-val-badge {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  height: 6px;
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-gold);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.6);
}

/* Toggle Pill Group (Lo ricompreresti) */
.toggle-pill-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pill-choice {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 9px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.pill-choice.active {
  background: rgba(124, 18, 49, 0.6);
  border-color: var(--accent-gold);
  color: #fff;
}

/* ========================================================
   SOMMELIER AIS 2023 WIZARD GUIDATO IN 4 STEP
   Suddivisione snella senza form chilometrico
   ======================================================== */
.ais-wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin-bottom: 10px;
  gap: 4px;
  width: 100%;
}

.wizard-step-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 0;
}

.wizard-step-pill .step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wizard-step-pill .step-name {
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wizard-step-pill.active {
  background: rgba(124, 18, 49, 0.6);
  border-color: var(--accent-gold);
  color: #fff;
}

.wizard-step-pill.active .step-num {
  background: var(--accent-gold);
  color: #000;
}

.wizard-step-pill.completed {
  color: var(--accent-gold-light);
}

.wizard-step-pill.completed .step-num {
  background: rgba(212, 175, 55, 0.3);
  color: var(--accent-gold-light);
}

.step-divider {
  width: 8px;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.ais-step-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  animation: fadeIn 0.2s ease;
}

.ais-step-pane.active {
  display: flex;
}

.ais-wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  width: 100%;
}

.btn-wizard-nav {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-wizard-nav.primary {
  background: rgba(124, 18, 49, 0.7);
  border-color: var(--accent-gold);
  color: #fff;
}

.btn-wizard-nav:hover {
  border-color: var(--accent-gold);
}

.wizard-step-indicator {
  font-size: 0.7rem;
  color: var(--accent-gold-light);
  font-weight: 600;
}

/* Sommelier AIS Fieldsets */
.sommelier-fieldset {
  background: rgba(23, 9, 18, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fieldset-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  color: var(--accent-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}

/* AIS Balance Grid (Morbidezze vs Durezze) */
.ais-balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.balance-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.balance-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold-light);
  text-align: center;
  letter-spacing: 0.5px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Multiselect Chips */
.multiselect-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chip-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-item.active {
  background: rgba(124, 18, 49, 0.6);
  border-color: var(--accent-gold);
  color: #fff;
}

/* Tags Container */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.tag-badge {
  background: rgba(124, 18, 49, 0.35);
  border: 1px solid var(--border-color);
  color: var(--accent-gold-light);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-badge .remove-tag-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

/* ========================================================
   DETTAGLIO SCHEDA DEGUSTAZIONE MODAL
   ======================================================== */
.detail-wine-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(25, 10, 20, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

.detail-wine-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #000;
  flex-shrink: 0;
}

.detail-wine-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-wine-titles h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.detail-wine-titles p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.detail-section-box {
  background: rgba(23, 9, 18, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.detail-label {
  color: var(--text-muted);
}

.detail-val {
  color: #fff;
  font-weight: 600;
}

/* ========================================================
   BOTTOM NAVIGATION BAR
   ======================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 520px;
  margin: 0 auto;
  height: var(--bottom-bar-height);
  background: rgba(14, 5, 11, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nav-item.active {
  color: var(--accent-gold);
}

.nav-item.active .nav-icon svg {
  stroke: var(--accent-gold);
}

/* ========================================================
   VISTA LA MIA CANTINETTA (FASE 4)
   ======================================================== */
.btn-small-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-small-secondary:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--accent-gold);
}

/* KPI Bar Cantina */
.cellar-kpi-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.cellar-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cellar-kpi-card.urgent {
  border-color: rgba(211, 84, 0, 0.4);
  background: rgba(35, 12, 15, 0.7);
}

.cellar-kpi-val {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.cellar-kpi-card.urgent .cellar-kpi-val {
  color: #f39c12;
}

.cellar-kpi-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Locations Filter Bar */
.cellar-locations-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cellar-locations-bar::-webkit-scrollbar {
  display: none;
}

/* Elenco Bottiglie */
.cellar-bottles-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Scheda Singola Bottiglia */
.cellar-bottle-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.cellar-bottle-card:hover {
  border-color: var(--accent-gold);
  background: var(--bg-card-hover);
}

.cellar-card-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cellar-card-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #000;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cellar-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cellar-card-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.cellar-wine-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cellar-wine-producer {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cellar-meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.7rem;
  color: var(--accent-gold);
  margin-top: 2px;
}

/* Badge Finestra di Bevibilità */
.drink-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.drink-badge.ideale {
  background: rgba(39, 174, 96, 0.2);
  border: 1px solid rgba(39, 174, 96, 0.45);
  color: #2ecc71;
}

.drink-badge.subito {
  background: rgba(211, 84, 0, 0.22);
  border: 1px solid rgba(211, 84, 0, 0.5);
  color: #f39c12;
}

.drink-badge.affinare {
  background: rgba(52, 152, 219, 0.18);
  border: 1px solid rgba(52, 152, 219, 0.45);
  color: #5dade2;
}

.location-pill {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--accent-gold-light);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Barra Dettagli Finestra & Azioni */
.cellar-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
  gap: 8px;
}

.cellar-card-price-info {
  display: flex;
  flex-direction: column;
}

.cellar-price-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.cellar-total-val {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.cellar-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Pulsante Stappa */
.btn-stappa-action {
  background: linear-gradient(135deg, var(--primary-color), #460819);
  color: #fff;
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-stappa-action:active {
  transform: scale(0.96);
}

/* Stepper Mini su Card */
.stepper-mini {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stepper-mini-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--accent-gold);
  font-size: 0.95rem;
  font-weight: 700;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-mini-btn:hover {
  background: rgba(212, 175, 55, 0.2);
}

.stepper-mini-qty {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  padding: 0 8px;
  min-width: 24px;
  text-align: center;
}

/* Stappa Feedback Modal */
.uncork-icon-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.15);
  border: 2px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.sommelier-tips-card {
  background: rgba(25, 10, 20, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.tips-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.tip-line {
  font-size: 0.75rem;
  color: var(--text-main);
  margin-bottom: 3px;
}

/* Movements Timeline */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.timeline-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  height: fit-content;
  white-space: nowrap;
}

.timeline-badge.stappato {
  background: rgba(124, 18, 49, 0.5);
  border: 1px solid var(--accent-gold);
  color: #fff;
}

.timeline-badge.acquisto {
  background: rgba(39, 174, 96, 0.2);
  border: 1px solid rgba(39, 174, 96, 0.4);
  color: #2ecc71;
}

.timeline-badge.rettifica {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
}

.timeline-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.timeline-wine {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.timeline-producer {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.timeline-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* ========================================================
   FASE 5: INTELLIGENZA SOMMELIER, ABBINAMENTI & PLAYLIST
   ======================================================== */

/* Sommelier Action Card (Home & Cantina) */
.sommelier-action-card {
  background: linear-gradient(135deg, rgba(124, 18, 49, 0.45), rgba(23, 10, 19, 0.85));
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.sommelier-action-content h4 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #fff;
  margin: 6px 0 4px 0;
}

.sommelier-action-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Category Quick Selector Pills */
.pairing-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.pairing-cat-pill {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pairing-cat-pill:hover,
.pairing-cat-pill.active {
  background: rgba(124, 18, 49, 0.6);
  border-color: var(--accent-gold);
  color: #fff;
}

/* Pairing Result Cards */
.pairing-result-card {
  background: rgba(25, 10, 20, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pairing-card-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pairing-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.pairing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pairing-titles {
  flex: 1;
  min-width: 0;
}

.pairing-wine-name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pairing-producer {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.pairing-score-badge {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.25), rgba(212, 175, 55, 0.25));
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold-light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.pairing-motivation {
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.45;
  font-style: italic;
  background: rgba(0, 0, 0, 0.25);
  border-left: 2px solid var(--accent-gold);
  padding: 6px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Service Alerts Row */
.service-alerts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.service-alert-chip {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.service-alert-chip.highlight {
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--accent-gold-light);
  font-weight: 600;
}

/* Playlist Cards */
.playlists-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.playlist-card {
  background: rgba(25, 10, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlist-card:hover {
  border-color: var(--accent-gold);
  background: rgba(35, 14, 28, 0.85);
  transform: translateY(-1px);
}

.playlist-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.playlist-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.playlist-wines-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(124, 18, 49, 0.5);
  border: 1px solid var(--accent-gold);
  color: #fff;
  white-space: nowrap;
}

.playlist-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.playlist-meta {
  font-size: 0.7rem;
  color: var(--accent-gold);
}

/* Playlist Wine Ordered List */
.playlist-wine-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 8px;
}

.playlist-order-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(124, 18, 49, 0.7);
  border: 1px solid var(--accent-gold);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.playlist-wine-details {
  flex: 1;
  min-width: 0;
}

.playlist-wine-details h5 {
  font-size: 0.88rem;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-wine-details p {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.playlist-wine-note {
  font-size: 0.72rem;
  color: var(--accent-gold);
  font-style: italic;
  margin-top: 3px;
}

.playlist-wine-actions {
  display: flex;
  gap: 4px;
}

.btn-icon-subtle {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.btn-icon-subtle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ========================================================
   FASE 6: HEADER ACTIONS, AUTH & AI USAGE MONITOR
   ======================================================== */
/* Header Level / Mode Switcher (Appassionato vs Sommelier) */
.mode-switch-control {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.mode-tab-btn {
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-tab-btn:hover {
  color: #fff;
}

.mode-tab-btn.active {
  background: var(--accent-bordeaux);
  color: #fff;
  border: 1px solid var(--accent-gold);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

.btn-header-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-header-tool:hover {
  color: var(--accent-gold-light);
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.1);
}

.btn-header-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 4px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-header-user:hover {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--accent-gold);
}

.header-user-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-gold);
  letter-spacing: 0.04em;
}

.header-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

/* Auth Login User Selection Chips */
.auth-user-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.auth-user-chip {
  flex: 1;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.25s ease;
  outline: none;
}

.auth-user-chip .user-chip-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.25s ease;
}

.auth-user-chip .user-chip-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  transition: color 0.25s ease;
}

/* Stato Spento (non attivo): ben opaco e scuro */
.auth-user-chip:not(.active) {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(20, 10, 16, 0.6) !important;
  box-shadow: none !important;
}

.auth-user-chip:not(.active):hover {
  opacity: 0.75;
  border-color: rgba(212, 175, 55, 0.35) !important;
}

/* Stato Acceso / Illuminato (attivo): oro brillante e sfondo evidenziato */
.auth-user-chip.active {
  opacity: 1 !important;
  border: 2px solid var(--accent-gold) !important;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(124, 18, 49, 0.35)) !important;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.35), inset 0 0 10px rgba(212, 175, 55, 0.15) !important;
}

.auth-user-chip.active .user-chip-name {
  color: #ffffff !important;
}

.auth-user-chip.active .user-chip-role {
  color: var(--accent-gold-light) !important;
  font-weight: 600;
}

/* Account Mode Cards in modalUserAccount */
.account-mode-card {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.25s ease;
}

.account-mode-card:not(.active) {
  opacity: 0.5;
}

.account-mode-card:not(.active):hover {
  opacity: 0.8;
  border-color: rgba(212, 175, 55, 0.35);
}

.account-mode-card.active {
  opacity: 1 !important;
  border: 2px solid var(--accent-gold) !important;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(124, 18, 49, 0.3)) !important;
  color: #fff !important;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.25) !important;
}

.ai-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
}

.ai-call-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  font-size: 0.72rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ai-call-row:last-child {
  border-bottom: none;
}

