/* Nachbau der ONYX-Aim-Oberflaeche. Masse wie in der Qt-App (ui_shell/theme.py,
   menu.py, widgets.py); Farben kommen als Variablen aus dem gewaehlten Theme. */

.demo-viewport { aspect-ratio: 1100 / 720; background: #111214; }
.oa {
  position: absolute; left: 0; top: 0;
  width: 1100px; height: 720px;
  transform-origin: 0 0;
  display: flex;
  background: var(--bg);
  color: var(--text);
  font: 400 13px/1.35 "Geist", system-ui, sans-serif;
  user-select: none;
  overflow: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}
.oa *, .oa *::before, .oa *::after { box-sizing: border-box; }
.oa svg { display: block; }
.oa .mono { font-family: "Geist Mono", ui-monospace, monospace; }
:where(.oa) button { cursor: pointer; border: 0; background: none; color: inherit; font: inherit; padding: 0; }

/* ---------- Sidebar ---------- */
.oa-side {
  flex: none; width: 232px; height: 100%;
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}
.oa-word { display: flex; align-items: center; gap: 10px; padding: 0 10px; height: 36px; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.oa-word img { width: 28px; height: 28px; }
.oa-word b { color: var(--accent); }
.oa-sec { padding: 0 15px; margin: 26px 0 6px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; color: var(--text_dim); }
.oa-sec.acc { margin-top: 16px; }
.oa-nav {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 39px; padding: 0 15px; margin-bottom: 4px;
  border-radius: 10px; color: var(--text_muted); font-size: 14px; font-weight: 500; text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}
.oa-nav svg { width: 15px; height: 15px; }
.oa-nav:hover { background: var(--hover); color: var(--text); }
.oa-nav.on { background: var(--accent_soft); color: var(--text); font-weight: 600; }
.oa-nav.on svg { color: var(--accent); }
.oa-fill { flex: 1; }

.oa-engine {
  padding: 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface);
}
.oa-eh { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13px; }
.oa-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: oaPulse 2s ease-out infinite; }
@keyframes oaPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
.oa-state { margin-left: auto; color: var(--accent); font-weight: 500; font-size: 12px; }
.oa-backend { margin: 8px 0 12px; font: 400 11px "Geist Mono", monospace; color: var(--text_dim); }
.oa-stats { display: grid; grid-template-columns: 1fr 1fr; row-gap: 12px; }
.oa-stat b { display: block; font: 500 15px "Geist Mono", monospace; color: var(--text); }
.oa-stat b.acc { color: var(--accent); }
.oa-stat span { font-size: 11px; color: var(--text_dim); }
.oa-model {
  display: block; width: 100%; margin-top: 12px; height: 33px; padding: 0 11px; text-align: left;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface_alt);
  font: 400 12px "Geist Mono", monospace; color: var(--text_muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.oa-model:hover { border-color: var(--border_strong); color: var(--text); }
.oa-profile {
  display: flex; align-items: center; gap: 9px; margin-top: 8px;
  padding: 8px 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
}
.oa-ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 600; font-size: 12px; }
.oa-profile b { display: block; font-size: 13px; font-weight: 500; }
.oa-profile span { font-size: 11.5px; color: var(--text_dim); }

/* ---------- Inhalt ---------- */
.oa-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.oa-title { height: 44px; flex: none; display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding-right: 10px; }
.oa-title button { width: 34px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--text_muted); }
.oa-title button svg { width: 13px; height: 13px; }
.oa-title button:hover { background: var(--hover); color: var(--text); }
.oa-title button.x:hover { background: #c42b1c; color: #fff; }
.oa-head { padding: 0 32px 18px; flex: none; }
.oa-head h2 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.oa-head p { margin: 7px 0 0; color: var(--text_muted); font-size: 13px; }
.oa-scroll { flex: 1; overflow-y: auto; padding: 0 30px 28px 32px; scrollbar-width: thin; scrollbar-color: var(--border_strong) transparent; }
.oa-scroll::-webkit-scrollbar { width: 8px; }
.oa-scroll::-webkit-scrollbar-thumb { background: var(--border_strong); border-radius: 8px; }
.oa-page { animation: oaIn 0.32s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes oaIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.oa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.oa-grid .s2 { grid-column: span 2; }

/* Karte im Doppelrand: Schale + Kern */
.oa-card { padding: 5px; border-radius: 19px; background: var(--shell); border: 1px solid var(--shell_edge); }
.oa-core { border-radius: 14px; background: var(--surface); border: 1px solid var(--core_edge); padding: 16px 18px 6px; }
.oa-ch { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; min-height: 30px; }
.oa-ci { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--accent_soft); color: var(--accent); }
.oa-ci svg { width: 15px; height: 15px; }
.oa-ch b { font-size: 14px; font-weight: 600; }
.oa-ch small { display: block; font-size: 12px; color: var(--text_muted); margin-top: 1px; }
.oa-ch .oa-pill { margin-left: auto; }

.oa-row { display: flex; align-items: center; gap: 16px; padding: 11px 0; border-top: 1px solid var(--border); min-height: 44px; }
.oa-ch + .oa-row { border-top: 0; }
.oa-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.oa-lbl { flex: 1; min-width: 0; }
.oa-lbl b { font-weight: 400; font-size: 13px; }
.oa-lbl .v { font: 400 12px "Geist Mono", monospace; color: var(--text_muted); margin-left: 6px; }
.oa-lbl small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text_dim); line-height: 1.4; }

/* Schalter */
.oa-tg { flex: none; width: 42px; height: 24px; border-radius: 12px; position: relative; background: var(--border_strong); transition: background 0.25s ease; }
.oa-tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.oa-tg.on { background: var(--accent); }
.oa-tg.on::after { transform: translateX(18px); }

/* Regler */
.oa-sl { position: relative; height: 22px; margin: 0 8px; cursor: pointer; touch-action: none; }
.oa-sl .tr { position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 4px; background: var(--border); }
.oa-sl .fl { position: absolute; left: 0; top: 9px; height: 4px; border-radius: 4px; background: var(--accent); }
.oa-sl .kn { position: absolute; top: 3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--knob); border: 2.5px solid var(--accent); transition: box-shadow 0.2s ease; }
.oa-sl:hover .kn, .oa-sl.drag .kn { box-shadow: 0 0 0 6px var(--accent_soft); }

/* Auswahl, Taste, Text */
.oa-sel, .oa-key, .oa-in {
  flex: none; height: 34px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface_alt);
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text);
}
.oa-sel { min-width: 138px; justify-content: space-between; }
.oa-sel svg { width: 12px; height: 12px; color: var(--text_muted); transform: rotate(90deg); }
.oa-sel:hover, .oa-key:hover { border-color: var(--border_strong); }
.oa-key { font-family: "Geist Mono", monospace; min-width: 90px; justify-content: center; }
.oa-key.wait { border-color: var(--accent); color: var(--accent); }
.oa-in { width: 166px; outline: none; font-family: inherit; }
.oa-in:focus { border-color: var(--accent); }
.oa-color { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); padding: 3px; background: var(--surface_alt); cursor: pointer; }
.oa-color::-webkit-color-swatch-wrapper { padding: 0; }
.oa-color::-webkit-color-swatch { border: 0; border-radius: 6px; }

.oa-menu {
  position: absolute; z-index: 20; min-width: 160px; max-height: 260px; overflow-y: auto;
  padding: 5px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border_strong);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.55);
  animation: oaIn 0.18s ease;
}
.oa-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text_muted); }
.oa-menu button:hover { background: var(--hover); color: var(--text); }
.oa-menu button.on { color: var(--text); background: var(--accent_soft); }

/* Tabs, Knoepfe, Pillen */
.oa-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 15px; border: 1px solid var(--border); background: var(--shell); margin-bottom: 14px; }
.oa-tabs button { height: 34px; padding: 0 15px; border-radius: 11px; font-size: 13px; font-weight: 500; color: var(--text_muted); }
.oa-tabs button.on { background: var(--surface_alt); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.oa-btn { height: 34px; padding: 0 16px; border-radius: 17px; font-weight: 600; font-size: 13px; border: 1px solid var(--border_strong); color: var(--text); }
.oa-btn:hover { background: var(--hover); }
.oa-btn.pri { background: var(--accent); border-color: transparent; color: #fff; }
.oa-btn.pri:hover { background: var(--accent_hover); }
.oa-btn[disabled] { opacity: 0.5; cursor: default; }
.oa-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 11px; border-radius: 12px; font-size: 11.5px; font-weight: 500; border: 1px solid var(--border); color: var(--text_muted); background: var(--surface_alt); }
.oa-pill.acc { background: var(--accent_soft); color: var(--accent); border-color: transparent; }

/* Live */
.oa-prev { position: relative; height: 340px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface_alt); overflow: hidden; display: grid; place-items: center; color: var(--text_dim); }
.oa-prev canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.oa-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 10px; color: var(--text_dim); font-size: 12px; }

/* Listen (Modelle) */
.oa-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface_alt); color: var(--text_dim); margin-bottom: 10px; }
.oa-search svg { width: 14px; height: 14px; }
.oa-search input { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font: inherit; }
.oa-list { border-radius: 12px; border: 1px solid var(--border); background: var(--surface_alt); padding: 5px; margin-bottom: 12px; max-height: 236px; overflow-y: auto; }
.oa-li { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--text_muted); text-align: left; }
.oa-li:hover { background: var(--hover); color: var(--text); }
.oa-li.on { background: var(--accent_soft); color: var(--text); }
.oa-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 15px; border: 1px solid var(--border); background: var(--shell); }
.oa-bar .lab { color: var(--text_dim); font-size: 12px; }
.oa-bar .val { font: 400 13px "Geist Mono", monospace; }
.oa-dl { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.oa-dl:first-of-type { border-top: 0; }
.oa-dl .nm { flex: 1; min-width: 0; }
.oa-dl .nm b { font-weight: 500; font-size: 13px; }
.oa-dl .nm small { display: block; color: var(--text_dim); font: 400 11px "Geist Mono", monospace; margin-top: 2px; }

/* Themes */
.oa-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0 12px; }
.oa-theme { border-radius: 13px; padding: 10px; border: 1px solid var(--border); background: var(--surface_alt); text-align: left; }
.oa-theme.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent_soft); }
.oa-theme .sw { height: 64px; border-radius: 8px; display: flex; overflow: hidden; margin-bottom: 9px; border: 1px solid rgba(127, 127, 127, 0.18); }
.oa-theme .sw i { flex: 1; }
.oa-theme .sw i:first-child { flex: 0 0 30%; }
.oa-theme b { font-size: 13px; font-weight: 500; text-transform: capitalize; }
.oa-theme small { display: block; font-size: 11px; color: var(--text_dim); }

/* Lizenz */
.oa-big { font-size: 26px; font-weight: 700; margin: 4px 0 12px; }
.oa-kv { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--border); }
.oa-kv span:last-child { font-family: "Geist Mono", monospace; color: var(--text_muted); }

/* Hinweis-Toast im Fenster */
.oa-toast {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 12px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border_strong); color: var(--text);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.6);
  animation: oaIn 0.25s ease;
  z-index: 30;
}

@media (prefers-reduced-motion: reduce) {
  .oa-dot { animation: none; }
  .oa-page, .oa-menu, .oa-toast { animation: none; }
}
