/* clubmix.ai - Kopfleiste: Antwortsuche (Answely), Chat (reactive.chat), Credit-Stand (20.11.2026).
   Eigene Klassen statt neuer Tailwind-Utilities: der gebaute app.css-Stand kennt nur, was beim Bau in den
   Vorlagen stand, und der Hell-Adapter in cfg/header.php ueberfaehrt Utilities mit !important.
   Die hellen Flaechen und Akzente folgen den Tokens in clubmix-theme.css. */

#bp-nav {
    --cm-h-fg: #e5e7eb;
    --cm-h-muted: #9ca3af;
    --cm-h-bg: rgba(255, 255, 255, .05);
    --cm-h-bg-hover: rgba(255, 255, 255, .1);
    --cm-h-line: rgba(255, 255, 255, .1);
    --cm-h-line-hover: rgba(255, 255, 255, .2);
    --cm-h-panel: var(--cm-bg);
    --cm-h-accent: var(--cm-acid);
    --cm-h-accent-fg: var(--cm-on-acid);
    --cm-h-accent-soft: rgba(238, 255, 112, .1);
    --cm-h-accent-line: rgba(238, 255, 112, .35);
}
html.light #bp-nav {
    --cm-h-fg: var(--cm-fg);
    --cm-h-muted: var(--cm-muted);
    --cm-h-bg: var(--cm-bg);
    --cm-h-bg-hover: var(--cm-raised);
    --cm-h-line: var(--cm-line);
    --cm-h-line-hover: var(--cm-line-strong);
    --cm-h-panel: var(--cm-panel);
    --cm-h-accent: var(--cm-ink); /* acid only as a surface on light: ink with acid text */
    --cm-h-accent-fg: var(--cm-acid);
    --cm-h-accent-soft: var(--cm-acid-soft);
    --cm-h-accent-line: rgba(17, 17, 19, .35);
}

.cm-hdr-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Runde Knoepfe (Suche unter lg, Chat) - dieselbe Groesse wie Thema und Hilfe. */
.cm-hdr-btn {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: .5rem; cursor: pointer;
    color: var(--cm-h-fg); background: var(--cm-h-bg); border: 1px solid var(--cm-h-line);
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.cm-hdr-btn:hover { background: var(--cm-h-bg-hover); border-color: var(--cm-h-line-hover); color: var(--cm-h-accent); }
.cm-hdr-btn[aria-expanded="true"] { border-color: var(--cm-h-accent-line); color: var(--cm-h-accent); }
.cm-hdr-btn svg { width: 18px; height: 18px; }
.cm-hdr-btn-chat { display: none; }
@media (min-width: 480px) { .cm-hdr-btn-chat { display: flex; } }
@media (min-width: 1024px) { .cm-hdr-btn-suche { display: none; } }

/* Suchfeld in der Leiste (ab lg). */
.cm-hdr-search { position: relative; display: none; align-items: center; height: 38px; }
@media (min-width: 1024px) { .cm-hdr-search { display: flex; } }
.cm-hdr-search-icon { position: absolute; left: .65rem; width: 16px; height: 16px; color: var(--cm-h-muted); pointer-events: none; }
.cm-hdr-search input {
    width: 11rem; height: 38px; padding: 0 1.9rem 0 2rem; border-radius: .5rem;
    font-size: .875rem; color: var(--cm-h-fg); background: var(--cm-h-bg); border: 1px solid var(--cm-h-line);
    transition: border-color .15s ease, width .2s ease;
}
@media (min-width: 1280px) { .cm-hdr-search input { width: 14rem; } }
html.light .cm-hdr-search input:not(:focus) { border-color: var(--cm-control-line); }
.cm-hdr-search input::placeholder { color: var(--cm-h-muted); }
.cm-hdr-search input:hover { border-color: var(--cm-h-line-hover); }
.cm-hdr-search input:focus { outline: none; border-color: var(--cm-h-accent-line); box-shadow: 0 0 0 1px var(--cm-h-accent-line); }
.cm-hdr-search kbd {
    position: absolute; right: .5rem; padding: 0 .35rem; border-radius: .25rem; pointer-events: none;
    font: 11px/16px ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--cm-h-muted); border: 1px solid var(--cm-h-line);
}

/* Credit-Stand neben dem Konto. Unter sm nur die Zahl. */
.cm-hdr-credits {
    display: inline-flex; align-items: center; gap: .35rem; flex-shrink: 0; height: 38px; padding: 0 .6rem;
    border-radius: 999px; text-decoration: none; white-space: nowrap;
    font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--cm-h-accent); background: var(--cm-h-accent-soft); border: 1px solid var(--cm-h-accent-line);
    transition: background-color .15s ease, border-color .15s ease;
}
.cm-hdr-credits[hidden] { display: none !important; }
.cm-hdr-credits:hover { border-color: var(--cm-h-accent); }
.cm-hdr-credits svg { width: 16px; height: 16px; flex-shrink: 0; }
.cm-hdr-credits-long { display: none; }
@media (min-width: 640px) {
    .cm-hdr-credits-n { display: none; }
    .cm-hdr-credits-long { display: inline; }
}
.cm-hdr-credits.is-unlimited .cm-hdr-credits-n { font-size: 1rem; line-height: 1; }

/* Platz unter xs (375 px): Thema und Admin-Knopf wandern ins Burger-Menue (dort stehen beide schon). */
@media (max-width: 479px) {
    .cm-hdr-theme, .cm-hdr-admin { display: none !important; }
}
.cm-hdr-burger-theme { display: flex; gap: .5rem; }
@media (min-width: 480px) { .cm-hdr-burger-theme { display: none; } }
.cm-hdr-burger-theme button {
    flex: 1; padding: .45rem .5rem; border-radius: .5rem; font-size: .8125rem; font-weight: 600; cursor: pointer;
    color: var(--cm-h-fg); background: var(--cm-h-bg); border: 1px solid var(--cm-h-line);
}
.cm-hdr-burger-theme button:hover { background: var(--cm-h-bg-hover); }

/* Bereich unter der Leiste. */
.cm-hdr-panel { border-top: 1px solid var(--cm-h-line); background: var(--cm-h-panel); }
.cm-hdr-panel[hidden] { display: none !important; }
.cm-hdr-panel-inner { max-width: 48rem; margin: 0 auto; padding: 1rem 1rem 1.1rem; max-height: calc(100vh - 5rem); overflow-y: auto; }
@media (min-width: 640px) { .cm-hdr-panel-inner { padding-left: 1.5rem; padding-right: 1.5rem; } }
.cm-hdr-panel-form { display: flex; gap: .5rem; margin: 0 0 .75rem; }
@media (min-width: 1024px) {
    #bp-nav:not([data-cm-sh-fit="short"], [data-cm-sh-fit="compact"], [data-cm-sh-fit="minimal"]) .cm-hdr-panel-form {
        display: none;
    }
}
.cm-hdr-panel-form input {
    flex: 1; min-width: 0; height: 44px; padding: 0 1rem; border-radius: .75rem; font-size: 1rem;
    color: var(--cm-h-fg); background: var(--cm-h-bg); border: 1px solid var(--cm-h-line);
}
.cm-hdr-panel-form input::placeholder { color: var(--cm-h-muted); }
.cm-hdr-panel-form input:focus { outline: none; border-color: var(--cm-h-accent-line); }
.cm-hdr-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.cm-hdr-hint { margin: 0; font-size: .75rem; line-height: 1.25rem; color: var(--cm-h-muted); }
.cm-hdr-panel[data-mode="rc"] [data-cm-hdr-teil="suche"] { display: none; }
.cm-hdr-close {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: -.25rem; margin-left: auto;
    width: 2rem; height: 2rem; border-radius: .5rem; border: 0; cursor: pointer; color: var(--cm-h-muted); background: transparent;
}
.cm-hdr-close:hover { color: var(--cm-h-fg); background: var(--cm-h-bg-hover); }
.cm-hdr-close svg { width: 16px; height: 16px; }
.cm-hdr-primary, .cm-hdr-secondary {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 1rem; border-radius: .625rem;
    font-size: .875rem; font-weight: 700; cursor: pointer; flex-shrink: 0; transition: filter .15s ease, background-color .15s ease;
}
.cm-hdr-primary { color: var(--cm-h-accent-fg); background: var(--cm-h-accent); border: 1px solid var(--cm-h-accent); }
.cm-hdr-primary:hover { filter: brightness(1.06); }
.cm-hdr-primary:disabled { opacity: .6; cursor: progress; }
.cm-hdr-secondary { color: var(--cm-h-fg); background: var(--cm-h-bg); border: 1px solid var(--cm-h-line); }
.cm-hdr-secondary:hover { background: var(--cm-h-bg-hover); }
.cm-hdr-consent {
    margin-top: .75rem; padding: .9rem 1rem; border-radius: .75rem;
    background: var(--cm-h-bg); border: 1px solid var(--cm-h-line); border-left: 3px solid var(--cm-h-accent);
}
.cm-hdr-consent[hidden] { display: none; }
.cm-hdr-consent-title { margin: 0 0 .3rem; font-size: .9375rem; font-weight: 700; color: var(--cm-h-fg); }
.cm-hdr-consent-text { margin: 0 0 .8rem; font-size: .875rem; line-height: 1.5; color: var(--cm-h-muted); }
.cm-hdr-consent-error { margin: 0 0 .8rem; font-size: .8125rem; color: #f87171; }
html.light .cm-hdr-consent-error { color: #B91C1C; }
.cm-hdr-consent-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.cm-hdr-answer:empty { display: none; }
.cm-hdr-answer { margin-top: .5rem; }
