:root {
  --bg: #0D1117; --bg-card: #1A1A1A; --bg-input: #1A1A1A;
  --text: #ffffff; --text-dim: #9ca3af; --text-muted: #6b7280;
  --border: #222; --primary: #2563EB;
}
body.light {
  --bg: #f5f5f5; --bg-card: #ffffff; --bg-input: #ffffff;
  --text: #111827; --text-dim: #6b7280; --text-muted: #9ca3af; --border: #e5e7eb;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  padding-bottom: calc(20px + env(safe-area-inset-bottom)); transition: background 0.3s, color 0.3s;
}

.theme-toggle, .fav-toggle {
  position: fixed; top: calc(16px + env(safe-area-inset-top));
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 20px; cursor: pointer;
  z-index: 100; display: flex; align-items: center; justify-content: center;
}
.theme-toggle { right: 16px; }
.fav-toggle { right: 68px; }

header { padding: 20px 16px 12px; text-align: center; padding-top: calc(20px + env(safe-area-inset-top)); }
header .logo { max-width: 180px; width: 55%; height: auto; display: block; margin: 0 auto 8px; filter: drop-shadow(0 0 20px rgba(37,99,235,0.4)); }
header .subtitle { color: var(--text-muted); font-size: 12px; }

main { padding: 12px 16px; max-width: 720px; margin: 0 auto; }

.search-bar { display: flex; gap: 10px; margin-bottom: 12px; position: relative; }
.input-wrap { flex: 1; position: relative; }
#query { width: 100%; padding: 16px 20px; border-radius: 30px; border: 2px solid transparent; background: var(--bg-input); color: var(--text); font-size: 16px; outline: none; transition: border-color 0.2s; }
#query:focus { border-color: var(--primary); }

#mic-btn { width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--primary); color: #fff; font-size: 26px; cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
#mic-btn.listening { background: #dc2626; animation: pulse 1.2s infinite; }
#mic-btn:active { transform: scale(0.92); }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(220,38,38,.6)} 70%{box-shadow:0 0 0 20px rgba(220,38,38,0)} 100%{box-shadow:0 0 0 0 rgba(220,38,38,0)} }

/* SETTINGS SWITCHES */
.settings-row { display: flex; gap: 16px; margin-bottom: 12px; padding: 0 4px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; color: var(--text-dim); }
.switch input { display: none; }
.slider { width: 36px; height: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; position: relative; transition: 0.3s; }
.slider::before { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: var(--text-muted); border-radius: 50%; transition: 0.3s; }
.switch input:checked + .slider { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(16px); background: #fff; }

/* AUTOCOMPLETE */
.autocomplete { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-top: 6px; overflow: hidden; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.autocomplete-item { padding: 12px 20px; cursor: pointer; font-size: 15px; color: var(--text); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.selected { background: var(--bg); }
.autocomplete-item .icon { color: var(--text-muted); }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-dim); font-size: 13px; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }

.voice-feedback { text-align: center; color: var(--text-muted); font-style: italic; margin: 8px 0; min-height: 20px; font-size: 13px; }

/* PANELS */
.favorites-panel, .history-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.panel-header, .history-header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.clear-btn, .close-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px 8px; }
.history-item, .fav-item { padding: 10px 12px; cursor: pointer; font-size: 14px; color: var(--text); border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.history-item:hover, .fav-item:hover { background: var(--bg); }
.fav-actions { margin-left: auto; display: flex; gap: 6px; }
.fav-actions button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; }

.loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text-muted); padding: 24px; font-size: 14px; }
.hidden { display: none !important; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* INSTANT ANSWER */
.instant-answer { background: linear-gradient(135deg, #065f46 0%, #047857 100%); border-radius: 16px; padding: 20px; margin-bottom: 20px; border: 1px solid #10b981; color: #fff; box-shadow: 0 4px 20px rgba(16,185,129,0.2); }
.instant-answer .ia-title { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: #6ee7b7; margin-bottom: 10px; }
.instant-answer .ia-big { font-size: 32px; font-weight: 800; margin-bottom: 6px; }
.instant-answer .ia-row { display: flex; gap: 12px; font-size: 13px; color: #d1fae5; flex-wrap: wrap; }
.instant-answer .ia-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.instant-answer .ia-chip { padding: 6px 12px; border-radius: 14px; font-size: 12px; background: rgba(255,255,255,0.15); color: #fff; cursor: pointer; border: 1px solid rgba(255,255,255,0.2); }
.instant-answer .ia-chip:hover { background: rgba(255,255,255,0.25); }

/* WIKIPEDIA CARD */
.wiki-card { background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid #fff; border-radius: 12px; padding: 16px; margin-bottom: 16px; display: flex; gap: 14px; }
.wiki-card img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.wiki-card .wiki-content { flex: 1; min-width: 0; }
.wiki-card .wiki-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.wiki-card .wiki-extract { font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.wiki-card .wiki-link { font-size: 12px; color: #60a5fa; text-decoration: none; margin-top: 6px; display: inline-block; }

/* AI ANSWER */
.ai-answer { background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%); border-radius: 16px; padding: 20px; margin-bottom: 20px; border: 1px solid #3b82f6; box-shadow: 0 4px 20px rgba(37,99,235,0.2); }
.ai-answer::before { content: "âœ¨ Risposta AI"; display: block; font-size: 12px; font-weight: 700; letter-spacing: 1px; color: #93c5fd; margin-bottom: 10px; }
.ai-answer .answer-text { font-size: 16px; line-height: 1.6; color: #fff; margin-bottom: 12px; }
.ai-answer .sources { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.ai-answer .source-chip { font-size: 11px; padding: 4px 10px; border-radius: 12px; background: rgba(255,255,255,0.1); color: #93c5fd; text-decoration: none; border: 1px solid rgba(255,255,255,0.1); }
.ai-answer .answer-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.ai-answer .action-btn { font-size: 12px; padding: 6px 12px; border-radius: 14px; background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; }
.ai-answer .action-btn:hover { background: rgba(255,255,255,0.25); }

/* RESULTS */
.results { display: flex; flex-direction: column; gap: 12px; }
.result { display: block; padding: 16px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); transition: background 0.2s; border: 1px solid var(--border); position: relative; }
.result:active { background: var(--bg); }
.result h3 { font-size: 16px; margin-bottom: 6px; line-height: 1.3; color: var(--text); padding-right: 40px; }
.result .url { font-size: 12px; color: #4ade80; word-break: break-all; margin-bottom: 8px; }
.result .description { font-size: 13px; color: var(--text-dim); line-height: 1.4; }
body.light .result .url { color: #059669; }
.result-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; }
.result-actions button { background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.result-actions button:hover { color: var(--primary); }
.result-actions button.fav { color: #facc15; }

/* IMAGES */
.image-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.image-card { display: block; background: var(--bg-card); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); border: 1px solid var(--border); }
.image-card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.image-card .img-title { padding: 10px; font-size: 12px; color: var(--text-dim); }

/* VIDEO */
.video-card { display: flex; gap: 12px; padding: 12px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid var(--border); }
.video-card .video-thumb { width: 140px; height: 80px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.video-card .video-info { flex: 1; min-width: 0; }
.video-card h3 { font-size: 14px; margin-bottom: 6px; line-height: 1.3; }
.video-card .video-meta { font-size: 11px; color: var(--text-muted); }

/* NEWS */
.news-card { display: block; padding: 16px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--primary); }
.news-card .news-meta { font-size: 11px; color: #60a5fa; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.news-card h3 { font-size: 15px; margin-bottom: 6px; line-height: 1.3; }
.news-card .news-desc { font-size: 13px; color: var(--text-dim); line-height: 1.4; }

/* GITHUB */
.repo-card { display: block; padding: 16px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid var(--border); }
.repo-card .repo-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.repo-card .repo-avatar { width: 28px; height: 28px; border-radius: 50%; }
.repo-card .repo-name { font-size: 14px; font-weight: 700; color: #60a5fa; }
.repo-card .repo-desc { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.repo-card .repo-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }

/* CHAT */
.chat-box { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.chat-msg { padding: 12px 16px; border-radius: 16px; max-width: 85%; font-size: 14px; line-height: 1.5; }
.chat-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: var(--bg-card); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }

.empty-state { text-align: center; color: var(--text-muted); padding: 40px 20px; font-size: 14px; }

/* TTS BUTTON */
.tts-btn { background: none; border: none; color: #93c5fd; cursor: pointer; font-size: 16px; margin-left: 8px; }

/* CRYPTO */
.crypto-card { background: linear-gradient(135deg, #78350f 0%, #b45309 100%); border-radius: 16px; padding: 24px; border: 1px solid #f59e0b; color: #fff; }
.crypto-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.crypto-symbol { font-size: 20px; font-weight: 800; color: #fbbf24; }
.crypto-name { font-size: 14px; color: #fde68a; }
.crypto-price { font-size: 36px; font-weight: 800; margin-bottom: 6px; }
.crypto-usd { font-size: 16px; color: #fde68a; margin-bottom: 12px; }
.crypto-change { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 20px; display: inline-block; }
.crypto-change.positive { background: rgba(16,185,129,0.3); color: #6ee7b7; }
.crypto-change.negative { background: rgba(239,68,68,0.3); color: #fca5a5; }

/* RECIPES */
.recipe-card { display: flex; gap: 12px; padding: 12px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid var(--border); cursor: pointer; }
.recipe-thumb { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.recipe-info { flex: 1; min-width: 0; }
.recipe-info h3 { font-size: 15px; margin-bottom: 6px; }
.recipe-meta { font-size: 12px; color: var(--text-muted); }
.recipe-detail { background: var(--bg-card); border-radius: 16px; padding: 20px; border: 1px solid var(--border); }
.recipe-hero { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin-bottom: 16px; }
.recipe-detail h2 { font-size: 20px; margin-bottom: 6px; }
.recipe-detail h3 { font-size: 16px; margin-top: 16px; margin-bottom: 8px; }
.recipe-ingredients { list-style: none; padding-left: 0; }
.recipe-ingredients li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.recipe-instructions { font-size: 14px; line-height: 1.6; color: var(--text-dim); }
.recipe-video { display: inline-block; margin-top: 16px; padding: 10px 16px; background: #dc2626; color: #fff; border-radius: 10px; text-decoration: none; font-size: 14px; }
.recipe-back { margin-top: 16px; padding: 10px 16px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 10px; cursor: pointer; font-size: 14px; }

/* BOOKS */
.book-card { display: flex; gap: 14px; padding: 14px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid var(--border); }
.book-cover { width: 70px; height: 100px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.book-placeholder { display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 32px; }
.book-info { flex: 1; min-width: 0; }
.book-info h3 { font-size: 15px; margin-bottom: 4px; }
.book-author { font-size: 12px; color: #60a5fa; margin-bottom: 6px; }
.book-desc { font-size: 12px; color: var(--text-dim); line-height: 1.4; margin-bottom: 6px; }
.book-meta { font-size: 11px; color: var(--text-muted); }

/* QUAKES */
.quake-card { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid var(--border); border-left: 4px solid; }
.quake-green { border-left-color: #10b981; }
.quake-yellow { border-left-color: #fbbf24; }
.quake-orange { border-left-color: #f97316; }
.quake-red { border-left-color: #dc2626; }
.quake-mag { font-size: 24px; font-weight: 800; min-width: 50px; }
.quake-green .quake-mag { color: #10b981; }
.quake-yellow .quake-mag { color: #fbbf24; }
.quake-orange .quake-mag { color: #f97316; }
.quake-red .quake-mag { color: #dc2626; }
.quake-info { flex: 1; min-width: 0; }
.quake-place { font-size: 14px; margin-bottom: 4px; }
.quake-time { font-size: 12px; color: var(--text-muted); }

/* FOOTER */
footer { text-align: center; padding: 24px 16px; color: var(--text-muted); font-size: 12px; }

/* SHOPPING */
.shop-card { display: block; padding: 16px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid var(--border); border-left: 3px solid #f59e0b; }
.shop-store { font-size: 11px; color: #f59e0b; text-transform: uppercase; font-weight: 700; margin-bottom: 6px; letter-spacing: 0.5px; }
.shop-card h3 { font-size: 15px; margin-bottom: 6px; }
.shop-desc { font-size: 13px; color: var(--text-dim); line-height: 1.4; }

/* MAPS */
.map-card { background: var(--bg-card); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.map-img { width: 100%; height: 180px; object-fit: cover; display: block; background: #333; }
.map-info { padding: 14px; }
.map-info h3 { font-size: 15px; margin-bottom: 6px; }
.map-address { font-size: 12px; color: var(--text-dim); line-height: 1.4; margin-bottom: 8px; }
.map-link { display: inline-block; font-size: 13px; color: #60a5fa; text-decoration: none; }

/* TRANSLATE */
.translate-card { background: var(--bg-card); border-radius: 12px; padding: 20px; border: 1px solid var(--border); }
.translate-row { padding: 12px; background: var(--bg); border-radius: 10px; }
.translate-row.highlight { background: rgba(37,99,235,0.15); border: 1px solid var(--primary); }
.translate-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; margin-bottom: 6px; letter-spacing: 1px; }
.translate-text { font-size: 16px; line-height: 1.5; }
.translate-arrow { text-align: center; font-size: 20px; padding: 12px 0; }

/* TIMEZONE */
.tz-card { background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%); border-radius: 16px; padding: 28px; border: 1px solid #8b5cf6; text-align: center; color: #fff; }
.tz-city { font-size: 14px; color: #ddd6fe; margin-bottom: 12px; }
.tz-time { font-size: 56px; font-weight: 800; letter-spacing: 2px; margin-bottom: 6px; }
.tz-date { font-size: 14px; color: #ddd6fe; margin-bottom: 12px; text-transform: capitalize; }
.tz-offset { font-size: 12px; color: #c4b5fd; padding: 6px 14px; background: rgba(255,255,255,0.1); border-radius: 14px; display: inline-block; }

/* SKELETON LOADING */
.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 12px; height: 80px; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* LANG TOGGLE */


/* MOVIES */
.movie-card { display: flex; gap: 12px; padding: 14px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid var(--border); }
.movie-icon { font-size: 28px; flex-shrink: 0; }
.movie-info { flex: 1; min-width: 0; }
.movie-info h3 { font-size: 15px; margin-bottom: 6px; }
.movie-desc { font-size: 13px; color: var(--text-dim); line-height: 1.4; margin-bottom: 6px; }
.movie-meta { font-size: 11px; color: var(--text-muted); }

/* STREAMING */
.streaming-header { font-size: 16px; font-weight: 700; margin-bottom: 16px; padding: 12px; background: var(--bg-card); border-radius: 10px; border-left: 3px solid #2563EB; }
.streaming-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.streaming-card { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid var(--border); transition: transform 0.2s; }
.streaming-card:active { transform: scale(0.95); }
.streaming-icon { font-size: 28px; margin-bottom: 6px; }
.streaming-name { font-size: 11px; text-align: center; font-weight: 600; }
.streaming-divider { font-size: 13px; color: var(--text-muted); margin: 16px 0 12px; text-align: center; text-transform: uppercase; letter-spacing: 1px; }

/* JOBS */
.job-card { display: block; padding: 16px; background: var(--bg-card); border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid var(--border); border-left: 3px solid #10b981; }
.job-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.job-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: #fff; flex-shrink: 0; }
.job-title-block { flex: 1; min-width: 0; }
.job-title-block h3 { font-size: 15px; margin-bottom: 4px; }
.job-company { font-size: 13px; color: #10b981; font-weight: 600; }
.job-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.job-date { font-size: 11px; color: var(--text-muted); }

/* TRENDS */
.trends-header { font-size: 16px; font-weight: 700; margin-bottom: 16px; padding: 12px; background: var(--bg-card); border-radius: 10px; border-left: 3px solid #f59e0b; }
.trend-item { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border); cursor: pointer; transition: background 0.2s; }
.trend-item:hover { background: var(--bg); }
.trend-rank { font-size: 22px; font-weight: 800; color: var(--text-muted); min-width: 34px; }
.trend-content { flex: 1; min-width: 0; }
.trend-query { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.trend-meta { font-size: 11px; color: var(--text-muted); }
.trend-change { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 14px; }
.trend-change.positive { background: rgba(16,185,129,0.2); color: #10b981; }
.trend-change.negative { background: rgba(239,68,68,0.2); color: #ef4444; }

/* HOME WIDGETS */
.home-widgets {
  display: grid; grid-template-columns: auto 1fr; gap: 12px;
  margin-bottom: 16px; align-items: center;
}
.widget-clock {
  padding: 12px 20px; background: var(--bg-card);
  border-radius: 14px; border: 1px solid var(--border);
  text-align: center; min-width: 110px;
}
.clock-time { font-size: 24px; font-weight: 800; color: var(--primary); line-height: 1; }
.clock-date { font-size: 10px; color: var(--text-muted); margin-top: 4px; text-transform: capitalize; }
.widget-quote {
  padding: 12px 16px; background: var(--bg-card);
  border-radius: 14px; border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
}
.quote-text { font-size: 13px; font-style: italic; color: var(--text-dim); line-height: 1.4; }
.quote-author { font-size: 11px; color: var(--primary); margin-top: 4px; font-weight: 600; }

@media (max-width: 480px) {
  .home-widgets { grid-template-columns: 1fr; }
}

/* DASHBOARD PANEL */
.dashboard-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.dashboard-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 16px;
}
.dashboard-card {
  padding: 16px; background: var(--bg); border-radius: 12px;
  text-align: center; border: 1px solid var(--border);
}
.dc-icon { font-size: 28px; margin-bottom: 6px; }
.dc-value { font-size: 22px; font-weight: 800; color: var(--primary); }
.dc-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.dashboard-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.dashboard-btn {
  flex: 1 1 45%; padding: 10px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 12px; font-weight: 600;
}
.dashboard-btn:hover { background: var(--bg-card); border-color: var(--primary); }

/* INSTALL BANNER */
.install-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 14px 16px; z-index: 140;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.install-content {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.install-icon { font-size: 32px; flex-shrink: 0; }
.install-text { flex: 1; min-width: 0; }
.install-text strong { font-size: 14px; display: block; margin-bottom: 2px; }
.install-text p { font-size: 11px; color: var(--text-muted); }
.install-btn {
  padding: 10px 18px; border-radius: 12px; border: none;
  background: var(--primary); color: #fff; font-weight: 700;
  font-size: 13px; cursor: pointer; flex-shrink: 0;
}
.install-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; padding: 4px 8px; flex-shrink: 0;
}

/* SITE SEARCH HEADER */
.site-search-header {
  padding: 12px 16px; background: var(--bg-card);
  border-radius: 10px; margin-bottom: 12px;
  border-left: 3px solid var(--primary);
  font-size: 14px;
}

/* PAGE TRANSLATION */
.page-translation {
  background: var(--bg-card); border-radius: 12px;
  padding: 24px; border: 1px solid var(--border);
}
.pt-header {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.pt-header h2 { flex: 1 1 100%; font-size: 18px; margin-bottom: 8px; }
.pt-link { font-size: 13px; color: #60a5fa; text-decoration: none; }
.pt-content {
  font-size: 15px; line-height: 1.8; color: var(--text);
  white-space: pre-wrap; word-wrap: break-word;
}

/* DATA SAVER MODE */
body.data-saver img:not(.logo):not(.splash-logo) {
  display: none !important;
}
body.data-saver .result,
body.data-saver .news-card {
  border-width: 1px;
}
body.data-saver .image-grid img {
  display: block !important;
  filter: blur(8px);
  transition: filter 0.3s;
}
body.data-saver .image-grid img:hover {
  filter: blur(0);
}
body.data-saver .skeleton-result,
body.data-saver .image-card .img-title {
  display: none;
}

/* TOAST */
.toast {
  position: fixed; bottom: calc(100px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 12px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
  max-width: 90vw;
}
.toast-success { background: #065f46; color: #fff; border-color: #10b981; }
.toast-error { background: #7f1d1d; color: #fff; border-color: #dc2626; }
.toast-info { background: #1e3a8a; color: #fff; border-color: #2563EB; }
.toast-out { animation: toastOut 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 20px); } }

/* ZEN TOGGLE */
.zen-toggle {
  position: fixed; top: calc(16px + env(safe-area-inset-top));
  right: 328px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 20px; cursor: pointer;
  z-index: 100; display: flex; align-items: center; justify-content: center;
}
.tools-toggle {
  position: fixed; top: calc(16px + env(safe-area-inset-top));
  right: 380px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 20px; cursor: pointer;
  z-index: 100; display: flex; align-items: center; justify-content: center;
}

/* ZEN MODE */
body.zen-mode .home-widgets,
body.zen-mode .proactive-suggestions,
body.zen-mode .settings-row,
body.zen-mode .tabs,
body.zen-mode .history-box,
body.zen-mode .favorites-panel,
body.zen-mode footer,
body.zen-mode .fav-toggle,
body.zen-mode .lang-toggle,
body.zen-mode .stats-toggle,
body.zen-mode .focus-toggle,
body.zen-mode .qr-scan-btn,
body.zen-mode .tools-toggle {
  display: none !important;
}
body.zen-mode { background: var(--bg); }
body.zen-mode main { padding-top: 15vh; max-width: 800px; }
body.zen-mode .search-bar { max-width: 700px; margin: 0 auto; }
body.zen-mode #query { font-size: 18px; padding: 20px 24px; }
body.zen-mode .zen-toggle { right: 16px; }

/* PROACTIVE SUGGESTIONS */
.proactive-suggestions {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; margin-bottom: 16px;
}
.proactive-header { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; font-weight: 700; }
.proactive-list { display: flex; flex-direction: column; gap: 6px; }
.proactive-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); cursor: pointer; font-size: 14px;
  text-align: left; transition: all 0.2s;
}
.proactive-item:hover { border-color: var(--primary); transform: translateX(4px); }
.proactive-icon { font-size: 20px; }
.proactive-text { flex: 1; }

/* TOOLS PANEL */
.tools-panel, .notes-panel, .clipboard-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.tools-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 16px;
}
.tool-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); cursor: pointer;
  font-size: 13px; font-weight: 600; transition: all 0.2s;
}
.tool-btn:hover { background: var(--bg-card); border-color: var(--primary); }
.tool-btn span { font-size: 24px; }

.tool-section { padding: 12px 0; }
.tool-section h3 { font-size: 16px; margin-bottom: 10px; }
.tool-section p { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.tool-section input[type="file"],
.tool-section input[type="text"],
.tool-section textarea {
  width: 100%; padding: 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; margin-bottom: 10px;
}
.tool-section textarea { min-height: 200px; resize: vertical; font-family: inherit; }

/* PDF TOOL */
.pdf-loaded { margin-top: 12px; }
.pdf-loaded strong { display: block; margin-bottom: 10px; font-size: 14px; }
.pdf-match { padding: 10px; background: var(--bg); border-radius: 8px; margin-bottom: 8px; font-size: 13px; line-height: 1.5; }

/* OCR */
.ocr-result textarea { min-height: 150px; }
.ocr-result strong { display: block; margin-bottom: 8px; }

/* NOTES */
.notes-actions { display: flex; gap: 8px; margin-top: 10px; }
.notes-actions .action-btn { flex: 1; padding: 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 600; }

/* CLIPBOARD */
.clipboard-item {
  padding: 12px; background: var(--bg); border-radius: 10px;
  margin-bottom: 8px; display: flex; gap: 10px; align-items: center;
}
.clipboard-text { flex: 1; font-size: 13px; word-break: break-all; }
.clipboard-actions { display: flex; gap: 6px; }
.clipboard-actions button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px; }

/* PASSWORD GENERATOR */
.pwd-options { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.pwd-options label { display: flex; align-items: center; gap: 6px; }
.pwd-result { text-align: center; margin-top: 14px; }
.pwd-result code {
  display: block; padding: 14px; background: var(--bg);
  border-radius: 10px; font-family: 'Fira Code', Monaco, monospace;
  font-size: 14px; color: #4ade80; word-break: break-all; margin-bottom: 10px;
}
.pwd-strength { font-size: 13px; font-weight: 700; margin-bottom: 10px; }

/* QR OUTPUT */
.qr-output { text-align: center; margin-top: 14px; }
.qr-output img { max-width: 250px; border-radius: 12px; margin-bottom: 12px; background: #fff; padding: 10px; }

/* CURRENCY */
.currency-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.currency-form input, .currency-form select {
  padding: 10px; border-radius: 10px; background: var(--bg);
  border: 1px solid var(--border); color: var(--text); font-size: 14px;
}
.currency-form input { flex: 1; min-width: 80px; }
.currency-result { text-align: center; padding: 16px; background: var(--bg); border-radius: 10px; margin-top: 12px; }
.cur-big { font-size: 28px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.cur-rate { font-size: 12px; color: var(--text-muted); }

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; }
  .zen-toggle { right: 120px; }
  .tools-toggle { right: 172px; }
}

/* LANGUAGE PICKER */


.lang-picker-item:hover { background: var(--bg); }
.lang-picker-item.active { background: var(--primary); color: #fff; font-weight: 700; }



/* LANGUAGE SELECT (bandiere) */
.lang-select {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  width: auto;
  height: 44px;
  padding: 0 30px 0 14px;
  border-radius: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  z-index: 100;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s, background 0.2s;
}
.lang-select:hover {
  border-color: var(--primary);
  background-color: var(--bg);
}
.lang-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.lang-select option {
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  padding: 10px;
}

/* Sposta il theme-toggle per fare spazio al select */
.theme-toggle { right: 90px !important; }
.fav-toggle { right: 164px !important; }
.stats-toggle { right: 238px !important; }
.focus-toggle { right: 312px !important; }
.qr-scan-btn { right: 386px !important; }
.zen-toggle { right: 460px !important; }
.tools-toggle { right: 534px !important; }

@media (max-width: 768px) {
  .lang-select { top: calc(12px + env(safe-area-inset-top)); right: 12px; height: 40px; font-size: 13px; }
  .theme-toggle, .fav-toggle, .stats-toggle, .focus-toggle, .qr-scan-btn, .zen-toggle, .tools-toggle { display: none !important; }
}

/* TABS - ASSICURA CLICKABILITÀ */
.tabs {
  position: relative;
  z-index: 10;
  pointer-events: auto;
}
.tab {
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 11;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tab:active {
  transform: scale(0.95);
}
.tab.active {
  pointer-events: auto;
}

/* Assicura che le tab non siano coperte */
.tab > * {
  pointer-events: none;
}

/* MAP CARD */
.map-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.map-card a { display: block; text-decoration: none; }
.map-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: #1a1a1a;
}
.map-info {
  padding: 14px;
}
.map-info h3 {
  font-size: 15px;
  margin-bottom: 6px;
}
.map-address {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 8px;
}
.map-link {
  display: inline-block;
  font-size: 13px;
  color: #60a5fa;
  text-decoration: none;
}

/* SHOP CARD */
.shop-card {
  display: block;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid #f59e0b;
  margin-bottom: 12px;
}
.shop-store {
  font-size: 11px;
  color: #f59e0b;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.shop-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
}
.shop-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* MOVIE CARD */
.movie-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.movie-icon { font-size: 28px; flex-shrink: 0; }
.movie-info { flex: 1; min-width: 0; }
.movie-info h3 { font-size: 15px; margin-bottom: 6px; }
.movie-desc { font-size: 13px; color: var(--text-dim); line-height: 1.4; margin-bottom: 6px; }
.movie-meta { font-size: 11px; color: var(--text-muted); }

/* STREAMING */
.streaming-header {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 10px;
  border-left: 3px solid var(--primary);
}
.streaming-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.streaming-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  background: var(--bg-card);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
}
.streaming-icon { font-size: 28px; margin-bottom: 6px; }
.streaming-name { font-size: 11px; text-align: center; font-weight: 600; }
.streaming-divider {
  font-size: 13px;
  color: var(--text-muted);
  margin: 16px 0 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* JOB CARD */
.job-card {
  display: block;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid #10b981;
  margin-bottom: 12px;
}
.job-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.job-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}
.job-title-block { flex: 1; min-width: 0; }
.job-title-block h3 { font-size: 15px; margin-bottom: 4px; }
.job-company { font-size: 13px; color: #10b981; font-weight: 600; }
.job-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }

/* ============================================================
   LEAFLET MAP - Mappa interattiva
   ============================================================ */
.leaflet-map {
  width: 100%;
  height: 400px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  z-index: 1;
  background: #1a1a1a;
}
body.light .leaflet-map {
  background: #f0f0f0;
}

/* Fix per il tema scuro */
.leaflet-container {
  background: #1a1a1a !important;
  font-family: inherit !important;
}
.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text);
  border-radius: 8px;
}
.leaflet-popup-tip {
  background: var(--bg-card);
}
.leaflet-popup-content b {
  color: var(--primary);
}

/* Lista luoghi sotto mappa */
.map-places-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.map-places-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: 10px 0;
  margin-bottom: 4px;
}
.map-place-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.map-place-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}
.map-place-item.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}
.mp-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.mp-info {
  flex: 1;
  min-width: 0;
}
.mp-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.mp-address {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

@media (max-width: 480px) {
  .leaflet-map {
    height: 300px;
  }
}

/* ============================================================
   RECIPE DETAIL - Vista completa ricetta
   ============================================================ */
.recipe-detail {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.recipe-back {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  margin: 16px;
  transition: all 0.2s;
}
.recipe-back:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}
.recipe-back.bottom {
  display: block;
  width: calc(100% - 32px);
  margin: 16px;
  text-align: center;
}

.recipe-hero-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px 16px;
}

.recipe-hero {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.recipe-hero-info h1 {
  font-size: 22px;
  margin-bottom: 10px;
  line-height: 1.3;
}

.recipe-detail-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.recipe-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.recipe-tag {
  font-size: 11px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--primary);
}

.recipe-section {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.recipe-section h2 {
  font-size: 17px;
  margin-bottom: 14px;
  color: var(--text);
}

.recipe-ingredients-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.recipe-ingredients-list li {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px;
  border-left: 3px solid var(--primary);
}
.ing-measure {
  font-weight: 700;
  color: var(--primary);
  min-width: 70px;
  flex-shrink: 0;
}
.ing-name {
  color: var(--text);
}

.recipe-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.recipe-step {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.step-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.recipe-video-btn {
  display: block;
  margin: 16px;
  padding: 14px;
  background: #dc2626;
  color: #fff;
  text-align: center;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}
.recipe-video-btn:hover { background: #b91c1c; }

.recipe-source {
  display: block;
  margin: 0 16px 16px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--primary);
  text-align: center;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
}
.recipe-source:hover { border-color: var(--primary); }

/* Card lista ricette */
.recipe-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s;
}
.recipe-card:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}
.recipe-thumb {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}
.recipe-info { flex: 1; min-width: 0; }
.recipe-info h3 {
  font-size: 15px;
  margin-bottom: 6px;
  line-height: 1.3;
}
.recipe-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.recipe-hint {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 4px;
}

@media (min-width: 768px) {
  .recipe-ingredients-list { grid-template-columns: repeat(2, 1fr); }
  .recipe-hero-wrap { flex-direction: row; align-items: flex-start; }
  .recipe-hero { width: 300px; max-height: 300px; }
}

/* Indicatore traduzione */
.recipe-translating {
  padding: 12px;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid var(--primary);
  border-radius: 10px;
  color: var(--primary);
  font-size: 13px;
  text-align: center;
  animation: pulse-translate 1.5s infinite;
  margin-top: 12px;
}
@keyframes pulse-translate {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================================
   RECIPE BROWSER - Categorie
   ============================================================ */
.recipe-browser {
  padding: 4px 0;
}
.browser-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.category-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.category-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}
.category-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}
.category-name {
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.area-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.area-chip {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}
.area-chip:hover {
  border-color: var(--primary);
  color: var(--text);
}
.area-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ============================================================
   RECIPE GRID - Lista ricette
   ============================================================ */
.recipe-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 0;
}
.recipe-back-inline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}
.recipe-back-inline:hover {
  border-color: var(--primary);
}
.recipe-list-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.recipe-card-mini {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.recipe-card-mini:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}
.recipe-card-mini img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.recipe-mini-title {
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  text-align: center;
}

@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .recipe-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .category-grid { grid-template-columns: repeat(6, 1fr); }
  .recipe-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   WORLD MAP - Mappa navigabile del mondo
   ============================================================ */
.world-map-header {
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 12px;
  border-left: 3px solid var(--primary);
}
.wm-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.wm-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.leaflet-map.world {
  height: 500px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  z-index: 1;
}

@media (max-width: 768px) {
  .leaflet-map.world { height: 380px; }
}

.map-search-hint {
  text-align: center;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Fix Leaflet per tema scuro */
.leaflet-container {
  background: #1a1a1a !important;
  font-family: inherit !important;
}
.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text);
  border-radius: 8px;
}
.leaflet-popup-tip { background: var(--bg-card); }
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--primary) !important;
  color: #fff !important;
}
.leaflet-control-attribution {
  background: rgba(0,0,0,0.5) !important;
  color: #999 !important;
  font-size: 10px !important;
}

/* VOICE RESPONSE TOGGLE */
#voice-response-toggle:checked + .slider {
  background: #10b981 !important;
  border-color: #10b981 !important;
}
