@font-face {
  font-family: Inter;
  src: url("/assets/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 500 600;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/assets/fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700 900;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/assets/fonts/Inter-Italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("/assets/fonts/roboto-mono-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  src: url("/assets/fonts/roboto-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("/assets/fonts/roboto-mono-latin-400-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}

:root {
  --schrift: Inter;
  --schrift-mono: "Roboto Mono";
  --schrift-12: 12px;
  --schrift-14: 14px;
  --schrift-16: 16px;
  --schrift-20: 20px;
  --schrift-24: 24px;
  --raster: 4px;
  --radius-knopf: calc(2 * var(--raster));
  --radius-eingabe: calc(3 * var(--raster));
  --radius-karte: calc(4 * var(--raster));
  --radius-bild: 0;
  --radius-rund: 50%;
  --lupe-groesse: 152px;
  --weiss: #FFFFFF;
  --schwarz: #000000;
  --buehne: #0B0B0B;
  --maske-hellblau: #3DA5FF;
  --bild-auswahl: var(--maske-hellblau);
  --maske-deckkraft: .45;
  --hintergrund: #FFFFFF;
  --panel: #F7F7F6;
  --feld: #EFEFED;
  --aktiv: #E2E2DF;
  --rahmen: #CFCFCB;
  --platzhalter: var(--sekundaertext);
  --wartefortschritt: #55554F;
  --sekundaertext: var(--wartefortschritt);
  --haupttext: #1F1F1D;
  --hintergrund-dunkel: #121212;
  --panel-dunkel: #1C1C1B;
  --feld-dunkel: #262624;
  --aktiv-dunkel: #3A3A37;
  --haupttext-dunkel: #EDEDEA;
  --sekundaertext-dunkel: #A8A8A3;

  --guide-gruen-hell: #1F6B3B;
  --guide-gruen-flaeche-hell: #E8F5EC;
  --guide-gruen-rahmen-hell: #BFE3C9;
  --guide-gruen-dunkel: #9FD8B2;
  --guide-gruen-flaeche-dunkel: #13291C;
  --guide-gruen-rahmen-dunkel: #24533A;
  --guide-orange-hell: #8A4A0C;
  --guide-orange-flaeche-hell: #FDF1E3;
  --guide-orange-rahmen-hell: #F4D3AA;
  --guide-orange-dunkel: #F2C48D;
  --guide-orange-flaeche-dunkel: #2E2213;
  --guide-orange-rahmen-dunkel: #5E4320;
  --guide-rot-hell: #9A2A24;
  --guide-rot-flaeche-hell: #FCEAEA;
  --guide-rot-rahmen-hell: #F2C2C0;
  --guide-rot-dunkel: #F3AAA5;
  --guide-rot-flaeche-dunkel: #331718;
  --guide-rot-rahmen-dunkel: #6A2A2A;

  --guide-gruen: var(--guide-gruen-hell);
  --guide-gruen-text: var(--guide-gruen-hell);
  --guide-gruen-flaeche: var(--guide-gruen-flaeche-hell);
  --guide-gruen-rahmen: var(--guide-gruen-rahmen-hell);
  --guide-orange: var(--guide-orange-hell);
  --guide-orange-flaeche: var(--guide-orange-flaeche-hell);
  --guide-orange-rahmen: var(--guide-orange-rahmen-hell);
  --guide-rot: var(--guide-rot-hell);
  --guide-rot-flaeche: var(--guide-rot-flaeche-hell);
  --guide-rot-rahmen: var(--guide-rot-rahmen-hell);
  --primaer: var(--guide-gruen);
  --primaer-text: var(--weiss);
  --focus: var(--sekundaertext);
  --schatten: 0 12px 36px color-mix(in srgb, var(--schwarz) 14%, transparent);
}

:root.dark {
  color-scheme: dark;
  --hintergrund: var(--hintergrund-dunkel);
  --panel: var(--panel-dunkel);
  --feld: var(--feld-dunkel);
  --aktiv: var(--aktiv-dunkel);
  --rahmen: var(--aktiv-dunkel);
  --platzhalter: var(--sekundaertext-dunkel);
  --sekundaertext: var(--sekundaertext-dunkel);
  --haupttext: var(--haupttext-dunkel);
  --guide-gruen: var(--guide-gruen-rahmen-dunkel);
  --guide-gruen-text: var(--guide-gruen-dunkel);
  --guide-gruen-flaeche: var(--guide-gruen-flaeche-dunkel);
  --guide-gruen-rahmen: var(--guide-gruen-rahmen-dunkel);
  --guide-orange: var(--guide-orange-dunkel);
  --guide-orange-flaeche: var(--guide-orange-flaeche-dunkel);
  --guide-orange-rahmen: var(--guide-orange-rahmen-dunkel);
  --guide-rot: var(--guide-rot-dunkel);
  --guide-rot-flaeche: var(--guide-rot-flaeche-dunkel);
  --guide-rot-rahmen: var(--guide-rot-rahmen-dunkel);
}

/* LibreChat erwartet RGB-Kanäle, damit die Oberfläche Deckkraft ergänzen kann. */
html.ost-ui:root {
  --hintergrund-rgb: 255 255 255;
  --panel-rgb: 247 247 246;
  --feld-rgb: 239 239 237;
  --aktiv-rgb: 226 226 223;
  --haupttext-rgb: 31 31 29;
  --sekundaertext-rgb: 85 85 79;
  --platzhalter-rgb: 85 85 79;
  --rahmen-rgb: 207 207 203;
  --guide-rot-rgb: 154 42 36;
  --guide-rot-flaeche-rgb: 252 234 234;
  --guide-orange-rgb: 138 74 12;
  --surface-primary: var(--hintergrund-rgb);
  --surface-primary-alt: var(--hintergrund-rgb);
  --surface-primary-contrast: var(--hintergrund-rgb);
  --surface-chat: var(--hintergrund-rgb);
  --surface-dialog: var(--hintergrund-rgb);
  --surface-qr: var(--hintergrund-rgb);
  --surface-secondary: var(--panel-rgb);
  --surface-secondary-alt: var(--panel-rgb);
  --surface-fixed: var(--panel-rgb);
  --surface-overlay: var(--panel-rgb);
  --surface-code: var(--panel-rgb);
  --surface-tertiary: var(--feld-rgb);
  --surface-tertiary-alt: var(--feld-rgb);
  --surface-hover: var(--feld-rgb);
  --surface-hover-alt: var(--feld-rgb);
  --surface-fixed-hover: var(--feld-rgb);
  --surface-composer-hover: var(--feld-rgb);
  --surface-submit: var(--feld-rgb);
  --surface-submit-hover: var(--feld-rgb);
  --surface-active: var(--aktiv-rgb);
  --surface-active-alt: var(--aktiv-rgb);
  --surface-inverted: var(--haupttext-rgb);
  --surface-inverted-hover: var(--haupttext-rgb);
  --text-primary: var(--haupttext-rgb);
  --text-fixed: var(--haupttext-rgb);
  --text-inverted: var(--hintergrund-rgb);
  --text-on-status: var(--hintergrund-rgb);
  --text-secondary: var(--sekundaertext-rgb);
  --text-secondary-alt: var(--sekundaertext-rgb);
  --text-muted: var(--sekundaertext-rgb);
  --accent-primary: var(--sekundaertext-rgb);
  --accent-primary-hover: var(--sekundaertext-rgb);
  --text-tertiary: var(--platzhalter-rgb);
  --border-light: var(--rahmen-rgb);
  --border-medium: var(--rahmen-rgb);
  --border-medium-alt: var(--rahmen-rgb);
  --border-heavy: var(--rahmen-rgb);
  --border-xheavy: var(--rahmen-rgb);
  --text-destructive: var(--guide-rot-rgb);
  --border-destructive: var(--guide-rot-rgb);
  --surface-destructive: var(--guide-rot-flaeche-rgb);
  --surface-destructive-hover: var(--guide-rot-flaeche-rgb);
  --text-warning: var(--guide-orange-rgb);
  --status-warning: var(--guide-orange-rgb);
  --status-warning-border: var(--guide-orange-rgb);
  --status-warning-strong: var(--guide-orange-rgb);
  --status-warning-subtle: var(--guide-orange-flaeche-rgb);
  --status-neutral: var(--sekundaertext-rgb);
  --status-neutral-subtle: var(--feld-rgb);
  --status-neutral-border: var(--rahmen-rgb);
  --gray-800: var(--aktiv-rgb);
  --guide-orange-flaeche-rgb: 253 241 227;
}
html.ost-ui:root.dark {
  --hintergrund-rgb: 18 18 18;
  --panel-rgb: 28 28 27;
  --feld-rgb: 38 38 36;
  --aktiv-rgb: 58 58 55;
  --haupttext-rgb: 237 237 234;
  --sekundaertext-rgb: 168 168 163;
  --platzhalter-rgb: 168 168 163;
  --rahmen-rgb: 58 58 55;
  --guide-rot-rgb: 243 170 165;
  --guide-rot-flaeche-rgb: 51 23 24;
  --guide-orange-rgb: 242 196 141;
  --guide-orange-flaeche-rgb: 46 34 19;
}

/* Knopfsprache für Studio und Bildeditor. Formen und Zustände gelten in beiden Themes. */
@layer ost-knopfstile {
  :where(html.ost-ui, html.emb, html:has(.ost-editor, #mask-availability)) {
    --knopf-haupt: var(--schwarz);
    --knopf-haupttext: var(--weiss);
  }
  :where(html.ost-ui, html.emb, html:has(.ost-editor, #mask-availability)).dark {
    --knopf-haupt: var(--weiss);
    --knopf-haupttext: var(--schwarz);
  }

  :where(html.ost-ui, html.emb, html:has(.ost-editor, #mask-availability))
    button:not(:where(.result-preview, #mask-frame button, #outpaint-frame button)) {
    background: var(--knopf-fuellung, transparent) !important;
    color: var(--knopf-ink, var(--haupttext)) !important;
    border: 1px solid var(--knopf-linie, var(--rahmen)) !important;
    border-radius: var(--knopf-form, var(--radius-knopf)) !important;
    box-shadow: none !important;
    opacity: 1 !important;
  }
  :where(html.ost-ui, html.emb, html:has(.ost-editor, #mask-availability))
    button:is(
      #send-button, #during-run-send-button, #generate,
      [data-testid="stop-generation-button"],
      .ost-guide-v8-dialog-send, .ost-guide-v8-switch,
      .ost-bp-go, .ost-vg-ok, .ost-rf .ok,
      .ost-entwurf-aktionen button:last-child, button[value="weiter"],
      form:has(input#password) button[type="submit"]
    ):not(:disabled, [aria-disabled="true"]) {
    --knopf-fuellung: var(--knopf-haupt);
    --knopf-ink: var(--knopf-haupttext);
    --knopf-linie: var(--knopf-haupt);
  }
  :where(html.ost-ui, html.emb)
    .ost-editor-modi button[aria-pressed="true"]:not(:disabled) {
    --knopf-fuellung: var(--aktiv);
  }

  :where(html.ost-ui, html.emb, html:has(.ost-editor, #mask-availability))
    button:is(
      [aria-label]:has(> svg:only-child),
      #send-button, #during-run-send-button, [data-testid="stop-generation-button"],
      #audio-recorder, .ost-guide-v8-dialog-send, .ost-guide-v8-mic, .ost-mic,
      #attach-file-button, #attach-file-menu-button,
      .ost-mode, .ost-railbild, .ost-sammlung-taste, .ost-bp-x,
      .ost-mask-close, .ost-lb .x, .ost-lb-griff, .ost-lb-groesse,
      .ost-lb .mi, .ost-lb .pl, #embout, #embin, .emb-griff, .emb-groesse,
      .agent-turn button[aria-label]:has(svg):not(:has(span:not(.sr-only)))
    ) {
    --knopf-form: 50%;
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    flex-shrink: 0;
    padding: 0 !important;
  }

  :where(html.ost-ui, html.emb, html:has(.ost-editor, #mask-availability))
    button:is(:disabled, [aria-disabled="true"]) {
    opacity: .4 !important;
  }
  :where(html.ost-ui, html.emb, html:has(.ost-editor, #mask-availability))
    button:not(:disabled, [aria-disabled="true"], .result-preview, #mask-frame button, #outpaint-frame button):is(
      :hover, [aria-pressed="true"], [aria-checked="true"], [aria-current="true"],
      .ost-railbild-an, .ost-vg-f .on, .ost-bp-fl .on, .ost-sammlung-taste[aria-expanded="true"]
    ) {
    box-shadow: inset 0 0 0 1px currentColor !important;
  }
  :where(html.ost-ui, html.emb, html:has(.ost-editor, #mask-availability))
    button:focus-visible {
    outline: 2px solid var(--focus) !important;
    outline-offset: 2px !important;
  }
  :where(html.ost-ui, html.emb)
    button:is(.ost-mic, #audio-recorder, .ost-guide-v8-mic)[aria-pressed="true"] {
    box-shadow: inset 0 0 0 1px var(--guide-rot) !important;
  }
}
