/* Opticore floating widget styles */
#opti-widget * { box-sizing: border-box; }
#opti-widget {
  position: fixed; z-index: 9999;
  font-family: var(--font-sans, system-ui, sans-serif);
}
#ow-launcher {
  position: fixed; bottom: 24px; right: 24px;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #f59e0b) 0%, var(--accent-2, #d97706) 100%);
  color: #fff; border: 0; cursor: pointer;
  box-shadow: 0 10px 30px color-mix(in oklab, var(--accent, #d97706) 45%, transparent), 0 2px 8px rgba(0,0,0,0.1);
  display: grid; place-items: center;
  transition: transform 0.2s, background 0.25s ease, box-shadow 0.25s ease;
  z-index: 10000;
}
#ow-launcher:hover { transform: translateY(-3px) scale(1.04); }
#ow-launcher svg { width: 26px; height: 26px; }
.ow-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(245,158,11,0.4);
  animation: owPulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes owPulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.8); opacity: 0; }
}
#ow-panel {
  position: fixed; bottom: 96px; right: 24px;
  width: 360px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: #fff; color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(.16,1,.3,1);
  z-index: 9998;
}
#ow-panel.open { opacity: 1; transform: none; pointer-events: auto; }
[data-theme="dark"] #ow-panel { background: #0f172a; color: #e2e8f0; border-color: rgba(255,255,255,0.1); }

#ow-panel header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(180deg, rgba(245,158,11,0.06), transparent);
}
[data-theme="dark"] #ow-panel header { border-color: rgba(255,255,255,0.08); }
.ow-tabs { display: flex; gap: 2px; }
.ow-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; font-size: 12.5px; font-weight: 500;
  background: transparent; color: #64748b;
  border: 0; border-radius: 8px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ow-tab:hover { background: rgba(0,0,0,0.04); color: #0f172a; }
[data-theme="dark"] .ow-tab:hover { background: rgba(255,255,255,0.06); color: #f1f5f9; }
.ow-tab.active { background: rgba(245,158,11,0.12); color: #b45309; }
[data-theme="dark"] .ow-tab.active { background: rgba(245,158,11,0.2); color: #fbbf24; }
#ow-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: transparent; border: 0; cursor: pointer;
  color: #64748b; display: grid; place-items: center;
}
#ow-close:hover { background: rgba(0,0,0,0.06); color: #0f172a; }
[data-theme="dark"] #ow-close { color: #94a3b8; }
[data-theme="dark"] #ow-close:hover { background: rgba(255,255,255,0.08); color: #f1f5f9; }

.ow-view { padding: 20px; overflow-y: auto; flex: 1; min-height: 320px; }
.ow-view strong { display: block; font-size: 16px; margin-bottom: 6px; letter-spacing: -0.01em; }
.ow-view > div > p { font-size: 13.5px; color: #64748b; line-height: 1.55; margin: 0 0 16px; }
[data-theme="dark"] .ow-view > div > p { color: #94a3b8; }

.ow-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 16px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  border: 0; border-radius: 10px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.ow-btn-primary { background: #0f172a; color: #fff; }
.ow-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,23,42,0.2); }
[data-theme="dark"] .ow-btn-primary { background: #f59e0b; color: #0f172a; }
.ow-btn-ghost { background: transparent; color: inherit; border: 1px solid rgba(0,0,0,0.12); width: auto; padding: 6px 10px; font-size: 14px; }
.ow-btn[disabled], .ow-btn.loading { opacity: 0.6; cursor: wait; }

/* Voicebot form */
.ow-voice form { display: flex; flex-direction: column; gap: 12px; }
.ow-voice label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #64748b; font-weight: 500; }
[data-theme="dark"] .ow-voice label { color: #94a3b8; }
.ow-voice input[type="text"], .ow-voice input:not([type="checkbox"]) {
  padding: 10px 12px; font-size: 14px; font-family: inherit;
  background: #f8fafc; color: #0f172a;
  border: 1px solid rgba(0,0,0,0.1); border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.ow-voice input:focus { outline: none; border-color: #f59e0b; background: #fff; }
.ow-phone { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.ow-cc {
  padding: 10px 8px; font-size: 14px; font-family: inherit;
  background: #f8fafc; color: #0f172a;
  border: 1px solid rgba(0,0,0,0.1); border-radius: 8px;
}
[data-theme="dark"] .ow-cc { background: rgba(255,255,255,0.04); color: #f1f5f9; border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .ow-voice input:not([type="checkbox"]) {
  background: rgba(255,255,255,0.04); color: #f1f5f9; border-color: rgba(255,255,255,0.12);
}
[data-theme="dark"] .ow-voice input:focus { background: rgba(255,255,255,0.08); }
.ow-check { flex-direction: row !important; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.4; color: #64748b; }
.ow-check input { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; accent-color: #f59e0b; }
.ow-msg { padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.ow-msg.ok { background: #ecfdf5; color: #065f46; }
.ow-msg.err { background: #fef2f2; color: #991b1b; }
[data-theme="dark"] .ow-msg.ok { background: rgba(16,185,129,0.12); color: #6ee7b7; }
[data-theme="dark"] .ow-msg.err { background: rgba(239,68,68,0.12); color: #fca5a5; }

/* Tetris */
.ow-game { text-align: center; }
.ow-game-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.ow-score { font-size: 13px; color: #64748b; }
.ow-score b { color: #0f172a; font-variant-numeric: tabular-nums; margin-left: 4px; }
[data-theme="dark"] .ow-score b { color: #f1f5f9; }
#ow-tetris {
  display: block; margin: 0 auto;
  background: #0b1220; border-radius: 8px;
  image-rendering: pixelated;
}
.ow-game-keys { font-size: 11px; color: #94a3b8; margin-top: 10px; line-height: 1.4; }
.ow-game-touch {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin-top: 12px;
}
.ow-game-touch button {
  padding: 10px; font-size: 16px; background: #f1f5f9; color: #0f172a;
  border: 0; border-radius: 8px; cursor: pointer; font-weight: 600;
}
.ow-game-touch button:active { background: #f59e0b; color: #fff; }
[data-theme="dark"] .ow-game-touch button { background: rgba(255,255,255,0.08); color: #f1f5f9; }

#ow-tetris {
  display: block; margin: 0 auto;
  background: #0b1220; border-radius: 8px;
  image-rendering: pixelated;
}

/* ROI calculator */
.ow-roi { display: flex; flex-direction: column; gap: 14px; }
.ow-slider { display: flex; flex-direction: column; gap: 6px; }
.ow-slider-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: #64748b; font-weight: 500; }
.ow-slider-top b { color: #0f172a; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
[data-theme="dark"] .ow-slider-top { color: #94a3b8; }
[data-theme="dark"] .ow-slider-top b { color: #f1f5f9; }
.ow-slider input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; background: rgba(0,0,0,0.1);
  border-radius: 2px; outline: none; cursor: pointer;
}
[data-theme="dark"] .ow-slider input[type=range] { background: rgba(255,255,255,0.12); }
.ow-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #f59e0b; cursor: pointer;
  box-shadow: 0 2px 6px rgba(217,119,6,0.35);
  transition: transform 0.12s;
}
.ow-slider input[type=range]::-webkit-slider-thumb:active { transform: scale(1.15); }
.ow-slider input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; border: 0;
  background: #f59e0b; cursor: pointer;
}
.ow-roi-results { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.ow-roi-card {
  background: #f8fafc; border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.ow-roi-card span { font-size: 11px; color: #64748b; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.ow-roi-card strong { font-size: 18px; color: #0f172a; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
[data-theme="dark"] .ow-roi-card { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .ow-roi-card span { color: #94a3b8; }
[data-theme="dark"] .ow-roi-card strong { color: #f1f5f9; }
.ow-roi-hero {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border: 0;
}
.ow-roi-hero span { color: rgba(255,255,255,0.85); }
.ow-roi-hero strong { color: #fff; font-size: 26px; }
[data-theme="dark"] .ow-roi-hero { background: linear-gradient(135deg, #fbbf24, #d97706); }
[data-theme="dark"] .ow-roi-hero span { color: rgba(255,255,255,0.88); }
[data-theme="dark"] .ow-roi-hero strong { color: #fff; }
.ow-roi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ow-roi-fine { font-size: 11px !important; color: #94a3b8 !important; text-align: center; margin: 0 !important; }

#opti-widget [data-de], #opti-widget [data-en] { display: none; }
html[data-lang="de"] #opti-widget [data-de],
html:not([data-lang="en"]) #opti-widget [data-de] { display: inline; }
html[data-lang="en"] #opti-widget [data-en] { display: inline; }

@media (max-width: 480px) {
  #ow-panel { right: 12px; left: 12px; width: auto; bottom: 88px; }
  #ow-launcher { right: 16px; bottom: 16px; }
  .ow-view { padding: 14px; min-height: unset; }
  .ow-roi { gap: 10px; }
  .ow-slider { gap: 2px; }
  .ow-slider-top b { font-size: 13px; }
  .ow-roi-card { padding: 8px 10px; }
  .ow-roi-card strong { font-size: 16px; }
  .ow-roi-hero strong { font-size: 22px; }
  .ow-btn { padding: 8px 14px; }
  #ow-tetris { height: 280px; width: auto; }
  .ow-game-touch button { padding: 8px; font-size: 14px; }
}

/* Backdrop: schließt Panel bei Klick außen */
#ow-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
  cursor: default;
}
#ow-backdrop.open { display: block; }

/* Launcher nicht anklickbar wenn mobile Nav offen ist */
body.nav-open #ow-launcher { pointer-events: none; }

/* Hide Zoho launcher + popups until user explicitly opens chat */
body:not(.zoho-activated) #zsiq_floatmain,
body:not(.zoho-activated) .zsiq_floatmain,
body:not(.zoho-activated) .siqembed-proactivechat-popup,
body:not(.zoho-activated) .siq-notificationV2,
body:not(.zoho-activated) [id^="siqbubble"] { display: none !important; visibility: hidden !important; }
