:root {
  --bg: #0f172a; --surface: #1e293b; --text: #f8fafc; --muted: #94a3b8;
  --accent: #38bdf8; --accent2: #f472b6; --border: #334155; --card: #1e293b;
  --radius: 12px; --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
  --success: #22c55e; --warning: #f59e0b; --danger: #ef4444; --ai: #a855f7; --ai-glow: rgba(168,85,247,0.3);
}
[data-theme="light"] {
  --bg: #f8fafc; --surface: #ffffff; --text: #0f172a; --muted: #64748b;
  --border: #e2e8f0; --card: #ffffff; --shadow: 0 4px 6px -1px rgba(0,0,0,0.08);
  --ai-glow: rgba(168,85,247,0.15);
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after{animation:none!important;transition:none!important} }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  min-height: 100vh; display: flex; flex-direction: column;
}

.skip-link {
  position: absolute; top: -40px; left: 0; background: var(--accent); color: #000;
  padding: 0.5rem 1rem; z-index: 1000; font-weight: 600; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { top: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* AI Animations */
@keyframes ai-pulse { 0%,100%{box-shadow:0 0 0 0 var(--ai-glow)} 50%{box-shadow:0 0 20px 8px var(--ai-glow)} }
@keyframes ai-typing { 0%,80%,100%{opacity:.4;transform:scale(0.8)} 40%{opacity:1;transform:scale(1)} }
@keyframes fade-in-up { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
@keyframes glow-border { 0%,100%{border-color:var(--ai)} 50%{border-color:var(--accent)} }

header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem; }
.header-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.logo { font-size: 2rem; }
.brand h1 { font-size: 1.4rem; font-weight: 700; background: linear-gradient(90deg, var(--accent), var(--ai), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.subtitle { color: var(--muted); font-size: 0.85rem; }
.header-actions { display: flex; gap: 0.5rem; }
.icon-btn { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.75rem; color: var(--text); cursor: pointer; font-size: 1.1rem; position: relative; transition: background .15s,transform .15s; }
.icon-btn:hover { background: var(--border); transform: translateY(-2px); }
.ai-btn { background: linear-gradient(135deg, var(--ai), var(--accent2)); color: #fff; border: none; animation: ai-pulse 2s infinite; }
.ai-btn:hover { filter: brightness(1.2); }
.badge { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 999px; font-weight: 700; min-width: 18px; text-align: center; }
.badge.hidden { display: none; }

.breadcrumbs { max-width: 1200px; margin: 0.5rem auto 0; width: 100%; font-size: 0.8rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; display: flex; gap: 0.5rem; }
.breadcrumbs li:not(:last-child)::after { content: '›'; margin-left: 0.5rem; color: var(--muted); }
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* AI Search Bar */
.ai-search-bar { max-width: 1000px; margin: 1rem auto 0; padding: 0 1rem; }
.ai-input-wrap { display: flex; gap: 0.5rem; align-items: center; background: var(--bg); border: 2px solid var(--ai); border-radius: var(--radius); padding: 0.25rem; position: relative; animation: glow-border 3s infinite; }
.ai-input-wrap:focus-within { box-shadow: 0 0 20px var(--ai-glow); }
.ai-input-wrap input { flex: 1; background: transparent; border: none; color: var(--text); padding: 0.6rem 0.5rem; font-size: 0.95rem; outline: none; }
.ai-input-wrap input::placeholder { color: var(--muted); opacity: 0.7; }
.voice-inline { background: transparent; border: none; color: var(--text); cursor: pointer; font-size: 1.2rem; padding: 0.4rem; border-radius: 8px; transition: background .15s; }
.voice-inline:hover { background: var(--border); }
.voice-inline.recording { animation: ai-pulse 1s infinite; color: var(--danger); }
.ai-search-action { background: linear-gradient(135deg, var(--ai), var(--accent2)); border: none; color: #fff; padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: filter .15s; }
.ai-search-action:hover { filter: brightness(1.15); }

.ai-suggestions { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); z-index: 100; max-height: 300px; overflow-y: auto; box-shadow: var(--shadow); }
.ai-suggestions.hidden { display: none; }
.ai-suggestion-item { padding: 0.75rem 1rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; border-bottom: 1px solid var(--border); transition: background .15s; }
.ai-suggestion-item:hover { background: var(--border); }
.ai-suggestion-item .sugg-icon { font-size: 1.1rem; }
.ai-suggestion-item .sugg-text { flex: 1; font-size: 0.9rem; }
.ai-suggestion-item .sugg-meta { font-size: 0.75rem; color: var(--muted); }

.controls { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; max-width: 1200px; margin: 1rem auto 0; width: 100%; }
.controls input, .controls select {
  padding: 0.5rem 0.75rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.95rem; outline: none;
}
.controls input:focus, .controls select:focus { border-color: var(--accent); }
.btn-ai-recommend {
  background: linear-gradient(135deg, var(--ai), var(--accent)); border: none; color: #fff;
  padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer; font-weight: 600;
  font-size: 0.9rem; transition: filter .15s, transform .15s;
}
.btn-ai-recommend:hover { filter: brightness(1.15); transform: translateY(-2px); }

.ai-status { text-align: center; padding: 0.5rem; color: var(--ai); font-size: 0.85rem; animation: fade-in-up 0.3s; }
.ai-status.hidden { display: none; }

.stats { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 0.5rem; }

/* AI Insights Section */
.ai-insights { max-width: 1200px; margin: 1rem auto 0; width: 100%; padding: 0 1rem; }
.ai-insights.hidden { display: none; }
.ai-insights h2 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--ai); display: flex; align-items: center; gap: 0.5rem; }
.ai-insights h2::before { content: '⚡'; }
.ai-insight-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; animation: fade-in-up 0.4s; }
.ai-insight-card h3 { font-size: 0.95rem; color: var(--accent); margin-bottom: 0.5rem; }
.ai-insight-card p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.ai-insight-card ul { list-style: none; padding: 0; }
.ai-insight-card ul li { font-size: 0.85rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.ai-insight-card ul li:last-child { border: none; }

/* Price Chart */
.price-chart { margin-top: 0.5rem; }
.bar-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.bar-label { font-size: 0.75rem; color: var(--muted); min-width: 140px; }
.bar-wrap { flex: 1; display: flex; align-items: center; gap: 0.5rem; }
.bar { height: 12px; border-radius: 6px; transition: width 0.5s; }
.bar-budget { background: var(--success); }
.bar-mid { background: var(--accent); }
.bar-premium { background: var(--accent2); }
.bar-val { font-size: 0.7rem; color: var(--muted); min-width: 24px; }

/* Stat Pills */
.stat-pill { font-size: 0.8rem; padding: 0.3rem 0.7rem; border-radius: 999px; font-weight: 500; }

/* Compatibility Banner */
.compatibility-banner { max-width: 1200px; margin: 0.75rem auto 0; width: 100%; padding: 0 1rem; }
.compatibility-banner.hidden { display: none; }
.compat-card { display: flex; gap: 1rem; background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(56,189,248,0.1)); border: 1px solid var(--success); border-radius: var(--radius); padding: 1rem; align-items: flex-start; animation: fade-in-up 0.4s; }
.compat-card.warn { background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(239,68,68,0.1)); border-color: var(--warning); }
.compat-icon { font-size: 2rem; }
.compat-body h3 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.compat-body p { font-size: 0.85rem; color: var(--muted); }
.compat-body .compat-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.compat-body .compat-tag { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--success); color: #fff; }
.compat-body .compat-tag.missing { background: var(--danger); }

/* Related Section */
.related-section { max-width: 1200px; margin: 1.5rem auto 0; width: 100%; padding: 0 1rem; }
.related-section.hidden { display: none; }
.related-section h2 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--accent2); }

.tag-cloud, .brand-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 0.75rem; max-width: 1200px; margin-left: auto; margin-right: auto; }
.cloud-tag, .brand-tag { font-size: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 999px; background: rgba(56,189,248,0.1); color: var(--accent); border: 1px solid var(--border); cursor: pointer; transition: all .15s; }
.cloud-tag:hover, .brand-tag:hover { background: var(--accent); color: #000; }
.cloud-tag .count { opacity: 0.7; font-size: 0.65rem; margin-left: 0.25rem; }
.brand-tag.konkurrenz { background: rgba(244,114,182,0.1); color: var(--accent2); }
.brand-tag.konkurrenz:hover { background: var(--accent2); color: #fff; }

main { flex: 1; padding: 1rem; max-width: 1200px; width: 100%; margin: 0 auto; }

.loading-overlay { display: flex; justify-content: center; align-items: center; padding: 3rem; }
.loading-overlay.hidden { display: none; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.grid-small { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column;
  position: relative; animation: fade-in-up 0.3s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow), 0 0 20px rgba(56,189,248,0.12); }
.card.ai-recommended { border-color: var(--ai); box-shadow: 0 0 15px var(--ai-glow); }
.card.rival-product { border-left: 3px solid var(--accent2); }
.card .badge-new { position: absolute; top: 8px; left: 8px; background: var(--accent2); color: #fff; font-size: 0.65rem; padding: 0.2rem 0.5rem; border-radius: 999px; font-weight: 700; z-index: 2; }
.card .badge-ai { position: absolute; top: 8px; right: 44px; background: var(--ai); color: #fff; font-size: 0.65rem; padding: 0.2rem 0.5rem; border-radius: 999px; font-weight: 700; z-index: 2; }
.card .badge-rival { position: absolute; top: 8px; right: 44px; background: var(--accent2); color: #fff; font-size: 0.65rem; padding: 0.2rem 0.5rem; border-radius: 999px; font-weight: 700; z-index: 2; }
.card .badge-brand { position: absolute; top: 8px; left: 8px; background: var(--warning); color: #000; font-size: 0.65rem; padding: 0.2rem 0.5rem; border-radius: 999px; font-weight: 700; z-index: 2; }
.card .wishlist-btn { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.5); border: none; border-radius: 50%; width: 32px; height: 32px; color: #fff; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; z-index: 2; transition: background .15s; }
.card .wishlist-btn:hover { background: var(--danger); }
.card .wishlist-btn.active { background: var(--danger); }

.card .thumb-wrap { position: relative; overflow: hidden; }
.card .thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #0b1220; display: block; transition: transform .3s; }
.card:hover .thumb { transform: scale(1.05); }
.card-body { padding: 0.85rem; flex: 1; display: flex; flex-direction: column; }
.card-body .name { font-size: 0.9rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.4rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card-body .name a { color: inherit; text-decoration: none; }
.card-body .name a:hover { color: var(--accent); }
.card-body .compat-match { font-size: 0.75rem; color: var(--success); margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.3rem; }
.card-actions { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; }
.card-actions button { flex: 1; padding: 0.4rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; font-size: 0.8rem; transition: all .15s; }
.card-actions button:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.card-actions .btn-cart:hover { background: var(--success); border-color: var(--success); }
.card-actions .btn-compare:hover { background: var(--warning); border-color: var(--warning); }
.card-actions .btn-compare.active { background: var(--warning); color: #000; }

.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.tag { font-size: 0.7rem; padding: 0.15rem 0.45rem; border-radius: 999px; background: rgba(244,114,182,0.15); color: var(--accent2); cursor: pointer; border: none; }
.tag:hover { background: var(--accent2); color: #fff; }

.card-body .meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 0.5rem; }
.price { font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.stock { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 999px; background: rgba(34,197,94,0.15); color: var(--success); }
.stock.oos { background: rgba(239,68,68,0.15); color: var(--danger); }

.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.empty a { color: var(--ai); }
.hidden { display: none !important; }

.pagination { display: flex; justify-content: center; gap: 0.3rem; margin-top: 1.5rem; flex-wrap: wrap; }
.pagination button { min-width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; }
.pagination button:hover:not(:disabled) { background: var(--accent); color: #000; border-color: var(--accent); }
.pagination button.active { background: var(--accent); color: #000; font-weight: 700; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.scroll-top { position: fixed; bottom: 1.5rem; right: 1.5rem; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s, transform .3s; z-index: 100; }
.scroll-top.visible { opacity: 1; }
.scroll-top:hover { background: var(--accent); color: #000; }

/* Sidebar */
.sidebar { position: fixed; top: 0; right: 0; width: min(420px, 100vw); height: 100vh; background: var(--surface); border-left: 1px solid var(--border); z-index: 200; transform: translateX(100%); transition: transform .3s; display: flex; flex-direction: column; }
.sidebar.open { transform: translateX(0); }
.sidebar-wide { width: min(600px, 100vw); }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-bottom: 1px solid var(--border); }
.sidebar-header h2 { font-size: 1.1rem; }
.close-btn { background: none; border: none; color: var(--text); font-size: 1.2rem; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.close-btn:hover { background: var(--border); }
.sidebar-body { flex: 1; overflow-y: auto; padding: 1rem; }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); }

/* AI Chat */
.ai-chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.ai-chat-messages .msg { max-width: 85%; padding: 0.75rem 1rem; border-radius: 12px; font-size: 0.9rem; line-height: 1.5; animation: fade-in-up 0.3s; }
.ai-chat-messages .msg.user { align-self: flex-end; background: var(--accent); color: #000; border-bottom-right-radius: 4px; }
.ai-chat-messages .msg.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-chat-messages .msg.ai strong { color: var(--ai); }
.ai-chat-messages .msg.ai a { color: var(--accent); }
.ai-chat-messages .typing { display: flex; gap: 0.3rem; padding: 0.5rem; }
.ai-chat-messages .typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--ai); animation: ai-typing 1.4s infinite; }
.ai-chat-messages .typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-chat-messages .typing span:nth-child(3) { animation-delay: 0.4s; }

.ai-chat-input { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border); }
.ai-chat-input input { flex: 1; padding: 0.6rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.9rem; outline: none; }
.ai-chat-input input:focus { border-color: var(--ai); }
.ai-chat-input button { background: var(--ai); color: #fff; border: none; border-radius: 8px; width: 40px; cursor: pointer; font-size: 1rem; transition: filter .15s; }
.ai-chat-input button:hover { filter: brightness(1.15); }

.ai-chat-hints { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.5rem 0.75rem; border-top: 1px solid var(--border); }
.hint-btn { font-size: 0.75rem; padding: 0.3rem 0.6rem; border-radius: 999px; background: rgba(168,85,247,0.1); color: var(--ai); border: 1px solid var(--border); cursor: pointer; transition: all .15s; }
.hint-btn:hover { background: var(--ai); color: #fff; }

/* Cart / Compare */
.cart-item, .compare-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.cart-item img, .compare-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; background: var(--bg); }
.cart-item .info, .compare-item .info { flex: 1; min-width: 0; }
.cart-item .name, .compare-item .name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item .price { color: var(--accent); font-weight: 700; font-size: 0.9rem; }
.cart-item .remove, .compare-item .remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; align-self: flex-start; }
.cart-total { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; }
.btn-primary, .btn-secondary { width: 100%; padding: 0.6rem; border-radius: var(--radius); border: none; cursor: pointer; font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--muted); }

/* AI Compare Button */
.btn-ai-compare {
  width: 100%; padding: 0.7rem; border-radius: var(--radius); border: none; cursor: pointer;
  font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--ai), var(--accent2)); color: #fff;
  animation: ai-pulse 2s infinite; transition: filter .15s, transform .15s;
}
.btn-ai-compare:hover { filter: brightness(1.2); transform: translateY(-2px); }
.btn-ai-compare:disabled {
  background: var(--border); color: var(--muted); animation: none; cursor: not-allowed;
  transform: none; filter: none;
}

.compare-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.compare-table th, .compare-table td { padding: 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
.compare-table th { color: var(--muted); font-weight: 500; }
.compare-table td { font-weight: 600; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal.open { opacity: 1; pointer-events: all; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal-content { position: relative; background: var(--surface); border-radius: var(--radius); max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto; border: 1px solid var(--border); }
.modal-close { position: absolute; top: 0.75rem; right: 0.75rem; background: var(--border); border: none; width: 32px; height: 32px; border-radius: 50%; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; }
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-body { padding: 1.5rem; }
.modal-body img { width: 100%; border-radius: var(--radius); margin-bottom: 1rem; }
.modal-body h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.modal-body .price { font-size: 1.5rem; color: var(--accent); font-weight: 700; margin-bottom: 0.5rem; }
.modal-body .meta-row { display: flex; gap: 1rem; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.modal-body .share { display: flex; gap: 0.5rem; margin-top: 1rem; }
.modal-body .share button { padding: 0.4rem 0.8rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; font-size: 0.8rem; }
.modal-body .share button:hover { background: var(--accent); color: #000; }

/* AI Compare Modal */
.ai-compare-modal .modal-content {
  max-width: 700px; width: 90%; max-height: 90vh; overflow-y: auto;
}
.ai-compare-content { padding: 1.5rem; }
.ai-compare-content h2 {
  font-size: 1.3rem; margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--ai), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.ai-compare-content h3 { font-size: 1rem; margin: 1.2rem 0 0.5rem; color: var(--accent); }
.ai-compare-content .preview-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; font-family: 'Courier New', monospace; font-size: 0.8rem;
  line-height: 1.6; white-space: pre-wrap; word-break: break-word;
  max-height: 250px; overflow-y: auto; color: var(--text);
}
.ai-compare-content .ai-providers {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem;
  margin: 1rem 0;
}
.ai-provider-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer;
  transition: all .15s; text-decoration: none;
}
.ai-provider-btn:hover {
  border-color: var(--ai); box-shadow: 0 0 15px var(--ai-glow);
  transform: translateY(-3px);
}
.ai-provider-btn .icon { font-size: 2rem; }
.ai-provider-btn .name { font-weight: 700; font-size: 0.95rem; }
.ai-provider-btn .desc { font-size: 0.75rem; color: var(--muted); }
.ai-provider-btn .badge-free { font-size: 0.65rem; padding: 0.15rem 0.4rem; border-radius: 999px;
  background: rgba(34,197,94,0.2); color: var(--success); margin-top: 0.25rem;
}
.ai-provider-btn .badge-paid { font-size: 0.65rem; padding: 0.15rem 0.4rem; border-radius: 999px;
  background: rgba(245,158,11,0.2); color: var(--warning); margin-top: 0.25rem;
}
.ai-compare-content .copy-btn {
  background: var(--ai); color: #fff; border: none; padding: 0.5rem 1rem;
  border-radius: var(--radius); cursor: pointer; font-weight: 600;
  transition: filter .15s;
}
.ai-compare-content .copy-btn:hover { filter: brightness(1.15); }
.ai-compare-content .copy-btn.copied { background: var(--success); }
.ai-compare-content .tip {
  font-size: 0.8rem; color: var(--muted); margin-top: 0.75rem;
  padding: 0.5rem; border-left: 3px solid var(--ai); background: rgba(168,85,247,0.08);
  border-radius: 0 4px 4px 0;
}

footer { border-top: 1px solid var(--border); padding: 1.5rem 1rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-inner h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.footer-inner p { color: var(--muted); font-size: 0.8rem; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--accent); text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { text-decoration: underline; }
.copyright { text-align: center; color: var(--muted); font-size: 0.75rem; margin-top: 1rem; }

@media (max-width: 640px) {
  .header-inner { justify-content: center; }
  .brand h1 { font-size: 1.1rem; }
  .grid, .grid-small { grid-template-columns: 1fr; }
  .sidebar, .sidebar-wide { width: 100vw; }
  .ai-chat-messages .msg { max-width: 95%; }
}
@media print {
  header, footer, .sidebar, .scroll-top, .icon-btn, .card-actions, .pagination, .ai-chat-hints, .ai-status, .ai-insights, .compatibility-banner, .related-section { display: none !important; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card { break-inside: avoid; border: 1px solid #ccc; }
  body { background: #fff; color: #000; }
}
