:root{
  --blue-light:#0057A4;
  --blue-dark:#003D7C;
  --yellow:#FABA1C;
  --white:#ffffff;

  --shadow:0 4px 12px rgba(0,0,0,.08);
  --radius:14px;
  --transition:.2s ease;

  --header-h:220px;
  --logo-h:215px;
  --nav-w:220px;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{
  height:100%;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  overflow:hidden; /* 1-Pager */
  background:linear-gradient(180deg,var(--blue-light),var(--blue-dark));
  color:var(--white);
}

/* --- HEADER --- */
header{
  position:fixed;top:0;left:0;right:0;
  height:var(--header-h);
  background:var(--white);
  box-shadow:var(--shadow);
  z-index:10;
}
.header-box{
  position:absolute;
  left:var(--nav-w);
  width:calc(100vw - var(--nav-w));
  height:100%;
  display:flex;align-items:center;justify-content:center;
}
header .logo-center{
  height:var(--logo-h);
  width:auto;object-fit:contain;
  transform:translateY(-2px); /* wie gewünscht etwas höher */
}

/* --- NAV LINKS --- */
nav{
  position:fixed;top:0;left:0;
  width:var(--nav-w);height:100vh;
  background:var(--yellow);
  box-shadow:var(--shadow);
  z-index:20;
  display:flex;flex-direction:column;align-items:center;
  padding:20px 16px;
}
nav .logo-nav{
  width:168px;height:auto;object-fit:contain;
  position:relative;top:60px;margin-bottom:18px;background:transparent;
}

/* Menüpunkte – letzte Feinanpassungen (weiter nach unten) */
.nav-top{
  width:100%;
  margin-top:calc(var(--header-h) - 210px); /* bei Bedarf weiterfeinern */
  display:flex;flex-direction:column;gap:10px;
}
nav a{
  display:block;width:100%;
  background:rgba(255,255,255,.15);
  color:var(--white);text-decoration:none;font-weight:600;
  padding:10px 14px;border-radius:var(--radius);text-align:center;
  transition:var(--transition);
}
nav a:hover{background:rgba(255,255,255,.25);transform:translateY(-2px)}

.nav-bottom{
  width:100%;margin-top:auto;display:flex;justify-content:center;padding-top:14px;
}
.user-btn{
  display:block;width:80%;
  background:rgba(255,255,255,.2);color:var(--white);
  text-decoration:none;font-weight:600;
  padding:10px 18px;border-radius:var(--radius);text-align:center;
  transition:var(--transition);
}
.user-btn:hover{background:rgba(255,255,255,.3);transform:translateY(-2px)}

/* --- MAIN --- */
main{
  position:fixed;
  top:var(--header-h);left:var(--nav-w);right:0;bottom:0;
  display:flex;flex-direction:column;align-items:center;justify-content:space-between;
  overflow:hidden;background:transparent;
}

/* --- CHAT-FENSTER (ECHTE SPRECHBLASEN) --- */
#chat{
  flex:none;
  width:95%; max-width:1100px;
  height:calc(100% - 220px); /* etwas flacher wie gewünscht */
  margin-top:24px;
  padding:24px 28px;
  background:#f7f8fa;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow-y:auto;
  display:flex;flex-direction:column;gap:22px;
  color:#000;
}

/* Nachricht-Gruppe mit Label + Blase */
.message-block{
  display:flex;flex-direction:column;gap:6px;max-width:85%;
}
.message-block.user{align-self:flex-end;align-items:flex-end;}
.message-block.ai{align-self:flex-start;align-items:flex-start;}

.message-label{
  font-size:13px;font-weight:700;color:#444;opacity:.85;
}

/* Blasen */
.message-bubble{
  padding:14px 18px;border-radius:20px;max-width:100%;
  font-size:16px;line-height:1.55;word-wrap:break-word;
  box-shadow:0 2px 6px rgba(0,0,0,.1);
  border:1px solid transparent;
}

/* User rechts (Gelb, schwarz) */
.message-block.user .message-bubble{
  background:var(--yellow);color:#000;border-bottom-right-radius:6px;
}

/* AI links (Weiß, schwarz) */
.message-block.ai .message-bubble{
  background:#fff;color:#000;border-bottom-left-radius:6px;border-color:#e6e6e6;
}

/* --- EINGABEFORMULAR (oben & unten abgerundet) --- */
form#promptForm{
  width:95%;max-width:1100px;
  display:flex;align-items:flex-end;gap:10px;
  padding:16px 24px;background:#fff;border-top:1px solid #ddd;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  margin-top:16px;
}
#prompt{
  flex:1;resize:none;border-radius:var(--radius);
  border:1px solid #ccc;padding:12px 14px;font-size:16px;
  background:#fff;color:#000;height:60px;box-shadow:var(--shadow);
}
button[type="submit"]{
  background:var(--yellow);color:#000;border:none;border-radius:var(--radius);
  padding:12px 24px;font-weight:700;cursor:pointer;transition:var(--transition);
  box-shadow:var(--shadow);height:60px;
}
button[type="submit"]:hover{background:#ffcb36;transform:translateY(-2px)}
#modelInfo{color:#1f2937;font-size:14px;opacity:.85;margin-top:4px}

/* Scrollbars */
::-webkit-scrollbar{width:8px}
::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2);border-radius:4px}

/* Responsive */
@media(max-width:900px){:root{--nav-w:180px}}
@media(max-width:700px){
  nav{flex-direction:row;justify-content:space-around;width:100%;height:auto;top:0;left:0;padding:10px}
  .header-box{left:0;width:100vw}
  main{left:0;top:var(--header-h)}
}

/* === Chatblasen-Stil === */
.chat-line {
  display: flex;
  margin: 10px;
}

.chat-line.user {
  justify-content: flex-end;
}

.chat-line.assistant {
  justify-content: flex-start;
}

.bubble {
  padding: 10px 15px;
  border-radius: 20px;
  max-width: 70%;
  word-wrap: break-word;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-size: 1rem;
}

.user-bubble {
  background-color: #FABA1C; /* Gelb CI */
  color: #000;
}

.assistant-bubble {
  background-color: #fff;
  color: #000;
}
/* === Chat Label Styling === */
.chat-labels {
  display: flex;
  justify-content: space-between;
  margin: 10px 15px -5px 15px;
  font-weight: bold;
  color: #555;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.9rem;
}
.left-label {
  text-align: left;
}
.right-label {
  text-align: right;
}

/* === FORCE MENU TOP ALIGN (override) === */
body .sidebar {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  padding: 20px !important;          /* gleicher Abstand oben & links */
}

body .sidebar > *:first-child {
  margin-top: 0 !important;          /* kein Extra-Top-Margin beim ersten Element */
}

/* Falls Buttons/Links oben durch globalen Abstand runtergedrückt wurden: */
body .sidebar button:first-of-type,
body .sidebar a:first-of-type {
  margin-top: 0 !important;
}

/* Eventuelle Spacer deaktivieren */
body .sidebar .spacer,
body .sidebar .header-gap {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* === Menüposition anpassen === */
.sidebar a {
  display: block;
  margin-top: -100px;   /* alle 100px weiter nach oben */
}

/* Ausnahme: Jurek bleibt unten */
.sidebar a[href*="Jurek"],
.sidebar a:contains("Jurek") {
  margin-top: 0 !important;
}

/* === Menü nach oben schieben (außer Jurek unten) === */
.sidebar nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* oben + unten */
  height: 100%;
}

.sidebar .nav-top {
  margin-top: -100px !important; /* schiebt die 4 Menüpunkte 100px nach oben */
}

.sidebar .nav-bottom {
  margin-top: auto !important;   /* Jurek bleibt unten */
}

/* === NAV TOP FORCE LIFT === */
.sidebar nav{
  display:flex !important;
  flex-direction:column !important;
  min-height:100vh;
}

.sidebar .nav-top{
  position: relative !important;
  top: -100px !important;        /* << hier stellst du die Verschiebung ein */
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.sidebar .nav-bottom{
  margin-top:auto !important;    /* "Jurek" bleibt unten */
}

/* === Sidebar: Links bündig links (Icon + Text) === */
nav a,
.user-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;                /* Abstand Icon–Text */
  text-align: left !important;
  padding: 10px 14px 10px 16px !important; /* leichter linker Einzug */
  width: 100% !important;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;             /* lange Titel sauber abschneiden */
}

/* optional: gleiche Icon-Breite erzwingen (macht’s schön bündig) */
nav a::first-letter,
.user-btn::first-letter {
  display: inline-block;
  width: 1.4em;                        /* Platz für Emoji/Icon */
}
