    :root {
      --color-primary:       #3E3F58;
      --color-primary-dark:  #2C2D3F;
      --color-primary-light: #EBEBEF;
      --color-dark:          #1A1A1A;
      --color-gray-dark:     #6B6B7B;
      --color-gray-mid:      #9A9AAA;
      --color-gray-light:    #F7F7F8;
      --color-border:        #E8E8ED;
      --color-success:       #2E7D32;
      --color-error:         #C62828;
      --color-bg:            #FFFFFF;
      --content-max:         48rem;
      --font:                'DM Sans', -apple-system, 'Segoe UI', sans-serif;
      --font-mono:           'SF Mono', 'Fira Code', 'Consolas', monospace;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: var(--font);
      background: var(--color-bg);
      color: var(--color-dark);
      height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* === HEADER === */
    header {
      padding: 0.75rem 1.5rem;
      display: flex;
      align-items: center;
      gap: 0.75rem;
      background: var(--color-primary);
      color: #fff;
      flex-shrink: 0;
    }

    header h1 {
      font-size: 1.05rem;
      font-weight: 600;
      color: #fff;
      letter-spacing: -0.01em;
    }

    .header-right {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .header-link {
      font-size: 0.82rem;
      color: rgba(255,255,255,0.85);
      text-decoration: none;
      padding: 0.3rem 0.6rem;
      border-radius: 6px;
      cursor: pointer;
      border: none;
      background: none;
      font-family: var(--font);
      transition: all 0.12s;
    }

    .header-link:hover {
      background: rgba(255,255,255,0.15);
      color: #fff;
    }

    #status-dot {
      width: 8px; height: 8px;
      border-radius: 50%;
      background: var(--color-success);
    }

    /* === CHAT === */
    #chat-container {
      flex: 1;
      overflow-y: auto;
      padding: 1.5rem 1rem 2rem;
    }

    .chat-inner {
      max-width: var(--content-max);
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }

    /* === MESSAGES === */
    .msg { animation: fadeIn 0.25s ease-out; }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .msg-user {
      display: flex;
      justify-content: flex-end;
    }

    .msg-user-content {
      background: var(--color-primary);
      color: #fff;
      padding: 0.65rem 1rem;
      border-radius: 18px 18px 4px 18px;
      max-width: 75%;
      font-size: 0.92rem;
      line-height: 1.55;
    }

    .msg-bot {
      padding: 0 0.25rem;
    }

    .msg-bot-content {
      font-size: 0.92rem;
      line-height: 1.7;
      color: var(--color-dark);
    }

    /* Markdown styles */
    .msg-bot-content p { margin: 0 0 0.7rem; }
    .msg-bot-content p:last-child { margin-bottom: 0; }
    .msg-bot-content ul, .msg-bot-content ol { margin: 0.3rem 0 0.7rem 1.4rem; }
    .msg-bot-content li { margin-bottom: 0.25rem; }
    .msg-bot-content strong { font-weight: 600; color: var(--color-dark); }

    .msg-bot-content h1, .msg-bot-content h2, .msg-bot-content h3,
    .msg-bot-content h4, .msg-bot-content h5, .msg-bot-content h6 {
      font-weight: 600;
      color: var(--color-dark);
      margin: 1.2rem 0 0.4rem;
    }

    .msg-bot-content h1 { font-size: 1.15rem; }
    .msg-bot-content h2 { font-size: 1.05rem; }
    .msg-bot-content h3 { font-size: 0.95rem; }

    .msg-bot-content blockquote {
      border-left: 3px solid var(--color-primary);
      padding: 0.4rem 0 0.4rem 1rem;
      margin: 0.5rem 0;
      color: var(--color-gray-dark);
    }

    .msg-bot-content table {
      border-collapse: collapse;
      width: 100%;
      margin: 0.5rem 0;
      font-size: 0.85rem;
    }

    .msg-bot-content th, .msg-bot-content td {
      border: 1px solid var(--color-border);
      padding: 0.4rem 0.65rem;
      text-align: left;
    }

    .msg-bot-content th {
      background: var(--color-gray-light);
      font-weight: 600;
    }

    /* Code blocks */
    .msg-bot-content code {
      font-family: var(--font-mono);
      font-size: 0.82rem;
      background: var(--color-gray-light);
      padding: 0.15rem 0.35rem;
      border-radius: 4px;
    }

    .msg-bot-content pre {
      position: relative;
      background: var(--color-primary-dark);
      color: #e0e0e8;
      padding: 1rem 1.1rem;
      border-radius: 10px;
      overflow-x: auto;
      margin: 0.6rem 0;
    }

    .msg-bot-content pre code {
      background: none;
      padding: 0;
      color: inherit;
      font-size: 0.82rem;
      line-height: 1.6;
    }

    .copy-btn {
      position: absolute;
      top: 0.5rem;
      right: 0.5rem;
      background: rgba(255,255,255,0.1);
      border: none;
      color: rgba(255,255,255,0.6);
      padding: 0.25rem 0.5rem;
      border-radius: 5px;
      font-size: 0.72rem;
      font-family: var(--font);
      cursor: pointer;
      transition: all 0.15s;
    }

    .copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

    /* === FEEDBACK === */
    .feedback-bar {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      margin-top: 0.6rem;
      padding-top: 0.4rem;
    }

    .feedback-btn {
      background: none;
      border: 1px solid var(--color-border);
      border-radius: 6px;
      padding: 0.25rem 0.45rem;
      cursor: pointer;
      font-size: 0.85rem;
      line-height: 1;
      transition: all 0.15s;
      color: var(--color-gray-mid);
    }

    .feedback-btn:hover { background: var(--color-gray-light); }

    .feedback-btn.selected-up {
      background: #E8F5E9;
      border-color: var(--color-success);
      color: var(--color-success);
    }

    .feedback-btn.selected-down {
      background: #FFEBEE;
      border-color: var(--color-error);
      color: var(--color-error);
    }

    .feedback-btn:disabled { cursor: default; opacity: 0.7; }

    .feedback-comment {
      display: none;
      margin-top: 0.4rem;
      gap: 0.35rem;
      align-items: flex-start;
    }

    .feedback-comment.visible { display: flex; }

    .feedback-comment textarea {
      flex: 1;
      font-family: var(--font);
      font-size: 0.82rem;
      padding: 0.4rem 0.6rem;
      border: 1px solid var(--color-border);
      border-radius: 8px;
      resize: none;
      outline: none;
      line-height: 1.4;
    }

    .feedback-comment textarea:focus { border-color: var(--color-primary); }

    .feedback-comment button {
      font-family: var(--font);
      font-size: 0.78rem;
      padding: 0.4rem 0.7rem;
      background: var(--color-primary);
      color: #fff;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      white-space: nowrap;
    }

    .feedback-comment button:hover { background: var(--color-primary-dark); }

    .feedback-thanks {
      font-size: 0.8rem;
      color: var(--color-gray-mid);
      padding-top: 0.4rem;
    }

    /* === THINKING === */
    .thinking-indicator {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      padding: 0.25rem 0;
    }

    .thinking-dots {
      display: flex;
      gap: 3px;
    }

    .thinking-dots span {
      width: 5px;
      height: 5px;
      background: var(--color-primary);
      border-radius: 50%;
      animation: pulse 1.4s ease-in-out infinite;
    }

    .thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
    .thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

    @keyframes pulse {
      0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
      40% { opacity: 1; transform: scale(1.15); }
    }

    .thinking-text {
      font-size: 0.82rem;
      color: var(--color-gray-mid);
      transition: opacity 0.3s ease;
    }

    /* === SOURCES === */
    .sources {
      font-size: 0.78rem;
      color: var(--color-gray-dark);
      margin-top: 0.75rem;
      padding-top: 0.6rem;
      border-top: 1px solid var(--color-border);
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem;
      align-items: center;
    }

    .sources-label {
      margin-right: 0.15rem;
      color: var(--color-gray-mid);
    }

    .source-chip {
      position: relative;
      display: inline-block;
      background: var(--color-gray-light);
      color: var(--color-primary);
      padding: 0.2rem 0.55rem;
      border-radius: 6px;
      cursor: pointer;
      text-decoration: none;
      font-weight: 500;
      font-size: 0.76rem;
      transition: all 0.12s;
      border: 1px solid var(--color-border);
    }

    .source-chip:hover {
      background: var(--color-primary);
      color: #fff;
      border-color: var(--color-primary);
    }

    .source-tooltip {
      display: none;
      position: absolute;
      bottom: calc(100% + 8px);
      left: 50%;
      transform: translateX(-50%);
      width: 320px;
      max-height: 200px;
      overflow-y: auto;
      background: var(--color-dark);
      color: #e0e0e8;
      font-size: 0.78rem;
      font-weight: 400;
      line-height: 1.55;
      padding: 0.65rem 0.85rem;
      border-radius: 8px;
      box-shadow: 0 8px 30px rgba(0,0,0,0.2);
      z-index: 20;
      pointer-events: none;
    }

    .source-tooltip::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      border: 6px solid transparent;
      border-top-color: var(--color-dark);
    }

    .source-chip:hover .source-tooltip { display: block; }

    /* === INPUT === */
    #input-area {
      flex-shrink: 0;
      padding: 0.75rem 1rem 1rem;
      background: var(--color-bg);
    }

    .input-wrap {
      max-width: var(--content-max);
      margin: 0 auto;
      position: relative;
      display: flex;
      align-items: flex-end;
      background: var(--color-gray-light);
      border: 1px solid var(--color-border);
      border-radius: 24px;
      padding: 0.4rem 0.5rem 0.4rem 1.15rem;
      transition: border-color 0.15s, box-shadow 0.15s;
    }

    .input-wrap:focus-within {
      border-color: var(--color-primary);
      box-shadow: 0 0 0 3px rgba(62, 63, 88, 0.08);
      background: #fff;
    }

    #user-input {
      flex: 1;
      border: none;
      background: transparent;
      font-family: var(--font);
      font-size: 0.92rem;
      line-height: 1.5;
      resize: none;
      outline: none;
      padding: 0.35rem 0;
      max-height: 150px;
      color: var(--color-dark);
    }

    #user-input::placeholder { color: var(--color-gray-mid); }

    .input-actions {
      display: flex;
      align-items: center;
      gap: 0.3rem;
      flex-shrink: 0;
    }

    .btn-icon {
      width: 36px;
      height: 36px;
      border: none;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.12s;
      background: transparent;
      color: var(--color-gray-dark);
    }

    .btn-send {
      background: var(--color-primary);
      color: #fff;
    }

    .btn-send:hover { background: var(--color-primary-dark); }
    .btn-send:disabled { background: var(--color-border); color: var(--color-gray-mid); cursor: not-allowed; }

    .btn-clear { font-size: 1.1rem; }
    .btn-clear:hover { background: var(--color-gray-light); }

    /* === WELCOME === */
    .welcome {
      text-align: center;
      padding: 3rem 1rem 2rem;
    }

    .welcome-title {
      font-size: 1.35rem;
      font-weight: 600;
      color: var(--color-dark);
      margin-bottom: 0.4rem;
      letter-spacing: -0.02em;
    }

    .welcome-sub {
      font-size: 0.9rem;
      color: var(--color-gray-dark);
      line-height: 1.6;
      margin-bottom: 1.25rem;
    }

    .starters {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 0.5rem;
    }

    .starter-btn {
      background: var(--color-gray-light);
      border: 1px solid var(--color-border);
      border-radius: 20px;
      padding: 0.45rem 0.9rem;
      font-family: var(--font);
      font-size: 0.84rem;
      color: var(--color-dark);
      cursor: pointer;
      transition: all 0.15s;
    }

    .starter-btn:hover {
      background: var(--color-primary);
      color: #fff;
      border-color: var(--color-primary);
    }

    /* === FOOTER === */
    footer {
      text-align: center;
      padding: 0.5rem;
      font-size: 0.75rem;
      color: rgba(255,255,255,0.7);
      background: var(--color-primary);
      flex-shrink: 0;
    }

    footer a {
      color: rgba(255,255,255,0.9);
      cursor: pointer;
      text-decoration: underline;
    }

    /* === SHARED PANEL STRUCTURE (About + Datenschutz) === */
    .panel-header {
      background: var(--color-primary);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 1rem 1.5rem;
      flex-shrink: 0;
      border-radius: 14px 14px 0 0;
    }

    .panel-header h2 {
      font-size: 1rem;
      font-weight: 600;
      color: #fff;
      margin: 0;
    }

    .panel-close {
      background: none;
      border: none;
      color: rgba(255,255,255,0.75);
      font-size: 1.05rem;
      cursor: pointer;
      padding: 0.2rem 0.5rem;
      line-height: 1;
      border-radius: 5px;
      transition: color 0.15s, background 0.15s;
      font-family: var(--font);
    }
    .panel-close:hover { color: #fff; background: rgba(255,255,255,0.15); }

    .panel-body {
      overflow-y: auto;
      padding: 1.75rem 2rem;
      flex: 1;
      font-size: 0.9rem;
      line-height: 1.6;
    }

    /* === MODALS === */
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.45);
      z-index: 100;
      justify-content: center;
      align-items: center;
      backdrop-filter: blur(2px);
      padding: 1rem;
    }

    .modal-overlay.active { display: flex; }

    @keyframes modalIn {
      from { opacity: 0; transform: scale(0.96) translateY(8px); }
      to   { opacity: 1; transform: scale(1)    translateY(0); }
    }
    .modal-overlay.active .modal { animation: modalIn 0.2s ease-out; }

    .modal {
      background: #fff;
      border-radius: 14px;
      padding: 2rem;
      max-width: 480px;
      width: 90%;
      position: relative;
      box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    }

    .modal h2 {
      font-size: 1.05rem;
      font-weight: 600;
      margin-bottom: 1rem;
      color: var(--color-dark);
    }

    .modal p { font-size: 0.875rem; line-height: 1.7; color: var(--color-gray-dark); }

    .modal p a { color: var(--color-primary); text-decoration: underline; }

    .modal-close {
      position: absolute;
      top: 0.75rem;
      right: 1rem;
      background: none;
      border: none;
      font-size: 1.2rem;
      cursor: pointer;
      color: var(--color-gray-dark);
    }

    /* === ABOUT OVERLAY === */
    .about-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.45);
      z-index: 100;
      justify-content: center;
      align-items: flex-start;
      backdrop-filter: blur(2px);
      padding: 2rem 1rem;
      overflow-y: auto;
    }

    .about-overlay.active { display: flex; }

    .about-panel {
      background: #fff;
      border-radius: 14px;
      width: 100%;
      max-width: 680px;
      max-height: 80vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      box-shadow: 0 20px 60px rgba(0,0,0,0.2);
      margin: auto;
    }

    .about-intro {
      color: #718096;
      font-size: 0.875rem;
      line-height: 1.65;
      margin-bottom: 1.25rem;
    }

    .about-caps {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      margin-bottom: 0.25rem;
    }

    .accent-card {
      background: #f7fafc;
      border-left: 3px solid #4299e1;
      border-radius: 0 8px 8px 0;
      padding: 0.7rem 1rem;
      font-size: 0.875rem;
      line-height: 1.55;
      color: #2d3748;
    }

    .about-panel .panel-body h3 {
      font-size: 0.72rem;
      font-weight: 700;
      color: #718096;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin: 1.5rem 0 0.6rem;
    }

    .about-panel .panel-body p {
      font-size: 0.875rem;
      line-height: 1.6;
      color: #4a5568;
      margin-bottom: 0.5rem;
    }

    .doc-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
      margin-top: 0.5rem;
    }

    .doc-list li {
      background: #f7fafc;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      padding: 0.55rem 0.9rem;
      font-size: 0.85rem;
      color: #2d3748;
      transition: background 0.12s, border-color 0.12s;
    }

    .doc-list li:hover {
      background: #edf2f7;
      border-color: #cbd5e0;
    }

    /* === ACCORDION (Verfügbare Unterlagen) === */
    .doc-accordion { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }

    .doc-group {
      border: 1px solid var(--color-border);
      border-radius: 8px;
      overflow: hidden;
    }

    .doc-group summary {
      padding: 0.65rem 0.9rem;
      font-size: 0.875rem;
      font-weight: 600;
      color: var(--color-dark);
      background: var(--color-gray-light);
      cursor: pointer;
      list-style: none;
      display: flex;
      justify-content: space-between;
      align-items: center;
      user-select: none;
    }
    .doc-group summary::-webkit-details-marker { display: none; }
    .doc-group summary::after { content: '▸'; font-size: 0.72rem; color: var(--color-gray-mid); }
    .doc-group[open] summary::after { content: '▾'; }

    .doc-count { font-weight: 400; color: var(--color-gray-dark); font-size: 0.82rem; }

    .doc-group .doc-list { padding: 0.5rem 0.9rem 0.75rem; margin-top: 0; }
    .doc-group .doc-list li { background: var(--color-bg); }

    /* === CONTACT CARD (Ansprechpartner) === */
    .contact-card {
      background: #f0f4ff;
      border: 1px solid #c8d4f5;
      border-radius: 10px;
      padding: 0.9rem 1.1rem;
      margin-top: 0.5rem;
      display: flex;
      flex-direction: column;
      gap: 0;
    }
    .contact-item {
      font-size: 0.85rem;
      line-height: 1.6;
      color: #2d3748;
      padding: 0.45rem 0;
      border-bottom: 1px solid #dbe4f5;
      padding-left: 1rem;
      position: relative;
    }
    .contact-item:last-child { border-bottom: none; }
    .contact-item::before {
      content: '•';
      position: absolute;
      left: 0;
      color: #4299e1;
      font-size: 1rem;
      line-height: 1.6;
    }
    .contact-card a { color: #4299e1; text-decoration: underline; }

    /* === HINTS TOGGLE (Hinweise zur Nutzung) === */
    .hints-toggle {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      background: none;
      border: 1px solid #c8d4f5;
      border-radius: 6px;
      color: #4299e1;
      font-size: 0.82rem;
      font-weight: 500;
      cursor: pointer;
      padding: 0.3rem 0.75rem;
      margin-top: 0.6rem;
      font-family: var(--font);
      transition: background 0.12s, border-color 0.12s;
    }
    .hints-toggle:hover { background: #ebf4ff; border-color: #4299e1; }

    /* === DATENSCHUTZ MODAL === */
    .ds-modal {
      padding: 0;
      max-width: 600px;
      max-height: 80vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .ds-section {
      padding-bottom: 1.25rem;
      margin-bottom: 1.25rem;
      border-bottom: 1px solid #e2e8f0;
    }
    .ds-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

    .ds-section h3 {
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--color-primary);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin: 0 0 0.6rem;
    }

    .ds-section p {
      font-size: 0.875rem;
      line-height: 1.65;
      color: var(--color-gray-dark);
      margin-bottom: 0.6rem;
    }
    .ds-section p:last-child { margin-bottom: 0; }
    .ds-section p a { color: var(--color-primary); text-decoration: underline; }

    .ds-address-card {
      background: var(--color-gray-light);
      border: 1px solid var(--color-border);
      border-left: 3px solid var(--color-primary);
      border-radius: 0 8px 8px 0;
      padding: 0.75rem 1rem;
      font-size: 0.875rem;
      line-height: 1.7;
      color: var(--color-gray-dark);
    }
    .ds-address-card a { color: var(--color-primary); text-decoration: underline; }

    .ds-list {
      list-style: none;
      padding: 0;
      margin: 0.6rem 0 0;
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
    }
    .ds-list li {
      padding-left: 1.1rem;
      position: relative;
      font-size: 0.875rem;
      line-height: 1.6;
      color: var(--color-gray-dark);
    }
    .ds-list li::before { content: '–'; position: absolute; left: 0; color: var(--color-primary); }

    .ds-rights-list {
      list-style: none;
      padding: 0;
      margin: 0.6rem 0 0.75rem;
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
    }
    .ds-rights-list li {
      padding-left: 1.1rem;
      position: relative;
      font-size: 0.875rem;
      line-height: 1.55;
      color: var(--color-gray-dark);
    }
    .ds-rights-list li::before { content: '•'; position: absolute; left: 0; color: var(--color-primary); font-size: 0.9rem; }

    /* === IMPRESSUM BLOCKS === */
    .impr-block {
      padding: 0.85rem 0;
      border-bottom: 1px solid var(--color-border);
    }
    .impr-block--last { border-bottom: none; }
    .impr-label {
      font-size: 0.7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--color-primary);
      margin-bottom: 0.35rem;
    }
    .impr-firm {
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--color-primary-dark);
      margin-bottom: 0.2rem;
    }
    .impr-addr, .impr-row {
      font-size: 0.875rem;
      color: var(--color-gray-dark);
      line-height: 1.7;
    }
    .impr-row a { color: var(--color-primary); text-decoration: underline; }
    .impr-note { color: var(--color-gray-mid); font-size: 0.82rem; }
    .impr-mgmt {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }
    .impr-mgmt li {
      font-size: 0.875rem;
      color: var(--color-gray-dark);
      padding-left: 0.9rem;
      position: relative;
      line-height: 1.55;
    }
    .impr-mgmt li::before { content: '·'; position: absolute; left: 0; color: var(--color-primary); font-weight: 700; }

    /* === DATENSCHUTZ ACCORDION === */
    .ds-highlights {
      display: flex;
      gap: 0.45rem;
      flex-wrap: wrap;
      padding: 0.6rem 1.5rem;
      background: var(--color-primary-light);
      border-bottom: 1px solid var(--color-border);
      flex-shrink: 0;
    }
    .ds-highlight-chip {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      background: #fff;
      border: 1px solid var(--color-border);
      border-radius: 20px;
      padding: 0.2rem 0.65rem;
      font-size: 0.71rem;
      font-weight: 600;
      color: var(--color-primary);
      white-space: nowrap;
    }
    .ds-accordion { display: block; }
    .ds-accordion details {
      border-bottom: 1px solid var(--color-border);
      transition: border-left 0.15s;
    }
    .ds-accordion details:last-child { border-bottom: none; }
    .ds-accordion details[open] { border-left: 3px solid var(--color-primary); }
    .ds-accordion summary {
      list-style: none;
      cursor: pointer;
      padding: 0.85rem 1rem;
      display: flex;
      align-items: center;
      gap: 0.65rem;
      font-size: 0.875rem;
      font-weight: 500;
      color: var(--color-dark);
      user-select: none;
      background: #fff;
      transition: background 0.15s;
    }
    .ds-accordion summary:hover { background: var(--color-primary-light); }
    .ds-accordion summary::-webkit-details-marker { display: none; }
    .ds-accordion summary::marker { display: none; }
    .ds-num {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 1.5rem;
      height: 1.5rem;
      background: var(--color-primary-light);
      color: var(--color-primary);
      border-radius: 50%;
      font-size: 0.7rem;
      font-weight: 700;
      flex-shrink: 0;
    }
    .ds-accordion details[open] > summary { background: var(--color-primary-light); }
    .ds-accordion details[open] > summary .ds-num { background: var(--color-primary); color: #fff; }
    .ds-section-icon { color: var(--color-primary); flex-shrink: 0; width: 16px; height: 16px; }
    .ds-section-title { flex: 1; font-size: 0.9rem; font-weight: 500; color: inherit; }
    .ds-chevron-icon {
      color: var(--color-gray-mid);
      transition: transform 0.25s ease;
      flex-shrink: 0;
      width: 16px;
      height: 16px;
    }
    .ds-accordion details[open] > summary .ds-chevron-icon { transform: rotate(180deg); }
    .ds-accordion details[open] > summary .ds-section-title { color: var(--color-primary); }
    .ds-accordion-body { padding: 0.25rem 1rem 1.1rem 3.5rem; }
    .ds-accordion-body p {
      font-size: 0.875rem;
      line-height: 1.65;
      color: var(--color-gray-dark);
      margin-bottom: 0.6rem;
    }
    .ds-accordion-body p:last-child { margin-bottom: 0; }
    .ds-accordion-body p a { color: var(--color-primary); text-decoration: underline; }

    /* === RESPONSIVE === */
    @media (max-width: 640px) {
      header { padding: 0.6rem 1rem; }
      .input-wrap { border-radius: 18px; }
      .msg-user-content { max-width: 88%; }
      .welcome { padding: 2rem 0.5rem 1.5rem; }
      .welcome-title { font-size: 1.15rem; }
      .about-overlay { padding: 0; align-items: flex-end; }
      .about-panel { max-height: 90vh; border-radius: 14px 14px 0 0; margin: 0; }
      .panel-body { padding: 1.25rem 1.25rem; }
      .modal-overlay { padding: 0.5rem; }
      .ds-modal { max-height: 90vh; }
    }

    /* === FOOTNOTE SOURCES === */
    .footnote-link, .footnote-ref {
      position: relative;
      display: inline;
    }

    .footnote-link sup, .footnote-ref sup {
      font-size: 0.7em;
      font-weight: 600;
      color: var(--color-primary);
      background: rgba(62, 63, 88, 0.08);
      padding: 0.05em 0.35em;
      border-radius: 4px;
      margin-left: 1px;
      transition: all 0.12s;
      text-decoration: none;
      cursor: pointer;
      position: relative;
      z-index: 2;
    }

    .footnote-link:hover sup, .footnote-ref:hover sup {
      background: var(--color-primary);
      color: #fff;
    }

    .footnote-link { text-decoration: none; }

    .footnote-tooltip {
      display: none;
      position: absolute;
      bottom: calc(100% + 6px);
      left: 50%;
      transform: translateX(-50%);
      width: max-content;
      max-width: 320px;
      background: var(--color-dark);
      color: #e0e0e8;
      font-size: 0.78rem;
      font-weight: 400;
      line-height: 1.5;
      padding: 0.5rem 0.7rem;
      border-radius: 7px;
      box-shadow: 0 6px 20px rgba(0,0,0,0.2);
      z-index: 20;
      white-space: normal;
      pointer-events: none;
    }

    .footnote-tooltip::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      border: 5px solid transparent;
      border-top-color: var(--color-dark);
    }

    .footnote-link:hover .footnote-tooltip,
    .footnote-ref:hover .footnote-tooltip {
      display: block;
    }

    /* Self-Verification-Badge */
    .verification-badge {
      margin-top: 0.75rem;
      padding: 0.6rem 0.8rem;
      border-radius: 6px;
      font-size: 0.85rem;
      line-height: 1.35;
    }
    .verification-badge.no_info {
      background: #e7f1fb;
      border: 1px solid #9dc4ee;
      color: #1d3e66;
    }
    .verification-badge.partial {
      background: #fff4d9;
      border: 1px solid #e8b84b;
      color: #6a4a00;
    }
    .verification-badge.unsupported {
      background: #fdeaea;
      border: 1px solid #d9534f;
      color: #8a1a1a;
    }
    .verification-headline {
      font-weight: 600;
      margin-bottom: 0.25rem;
    }
    .verification-list {
      margin: 0.3rem 0 0 1.1rem;
      padding: 0;
    }
    .verification-list li {
      margin: 0.1rem 0;
    }

    /* Fallback-Quellenliste (wenn das LLM keine Inline-Quellen gesetzt hat) */
    .sources-fallback {
      margin-top: 1rem;
      padding-top: 0.75rem;
      border-top: 1px solid var(--color-gray-light, #e5e5e5);
      font-size: 0.88rem;
    }
    .sources-fallback-label {
      font-weight: 600;
      margin-bottom: 0.35rem;
      color: var(--color-text-muted, #666);
    }
    .sources-fallback-list {
      margin: 0;
      padding-left: 1.25rem;
    }
    .sources-fallback-list li {
      margin: 0.15rem 0;
    }
    .sources-fallback-list .footnote-link {
      color: var(--color-primary, #003366);
      text-decoration: none;
    }
    .sources-fallback-list .footnote-link:hover {
      text-decoration: underline;
    }

    /* === AUTH GATE === */
    #auth-gate {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 2rem;
      background: var(--color-gray-light);
    }

    .auth-card {
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 12px 40px rgba(0,0,0,0.1);
      padding: 2.25rem;
      width: 100%;
      max-width: 360px;
      animation: fadeIn 0.3s ease-out;
    }

    .auth-card h2 {
      font-size: 1.15rem;
      font-weight: 600;
      color: var(--color-primary);
      margin-bottom: 0.25rem;
    }

    .auth-card .auth-sub {
      font-size: 0.84rem;
      color: var(--color-gray-dark);
      margin-bottom: 1.25rem;
    }

    .auth-field { margin-bottom: 0.8rem; }

    .auth-field label {
      display: block;
      font-size: 0.8rem;
      font-weight: 500;
      color: var(--color-gray-dark);
      margin-bottom: 0.25rem;
    }

    .auth-input {
      width: 100%;
      padding: 0.55rem 0.8rem;
      border: 1px solid var(--color-border);
      border-radius: 7px;
      font-family: var(--font);
      font-size: 0.9rem;
      outline: none;
    }

    .auth-input:focus {
      border-color: var(--color-primary);
      box-shadow: 0 0 0 3px rgba(62,63,88,0.08);
    }

    .auth-btn {
      width: 100%;
      padding: 0.6rem;
      border: none;
      border-radius: 7px;
      font-family: var(--font);
      font-size: 0.9rem;
      font-weight: 500;
      cursor: pointer;
      margin-top: 0.5rem;
    }

    .auth-btn-primary {
      background: var(--color-primary);
      color: #fff;
    }

    .auth-btn-primary:hover { background: var(--color-primary-dark); }

    .auth-btn-link {
      background: none;
      color: var(--color-primary);
      font-size: 0.82rem;
      margin-top: 0.75rem;
    }

    .auth-error {
      background: #FFEBEE;
      color: var(--color-error);
      font-size: 0.82rem;
      padding: 0.5rem 0.7rem;
      border-radius: 6px;
      margin-bottom: 0.75rem;
      display: none;
    }

    .auth-error.visible { display: block; }

    .auth-success {
      background: #E8F5E9;
      color: var(--color-success);
      font-size: 0.82rem;
      padding: 0.5rem 0.7rem;
      border-radius: 6px;
      margin-bottom: 0.75rem;
      display: none;
    }

    .auth-success.visible { display: block; }

    /* === APP CONTAINER === */
    #app-container {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    /* === SIDEBAR === */
    .app-layout {
      display: flex;
      flex: 1;
      overflow: hidden;
    }

    #sidebar {
      width: 260px;
      background: var(--color-gray-light);
      border-right: 1px solid var(--color-border);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      overflow: hidden;
    }

    .sidebar-header {
      padding: 0.75rem;
      border-bottom: 1px solid var(--color-border);
    }

    .sidebar-new-btn {
      width: 100%;
      padding: 0.5rem;
      border: 1px solid var(--color-border);
      border-radius: 8px;
      background: #fff;
      font-family: var(--font);
      font-size: 0.84rem;
      cursor: pointer;
      color: var(--color-dark);
      transition: background 0.12s;
    }

    .sidebar-new-btn:hover { background: var(--color-primary-light); }

    .sidebar-list {
      flex: 1;
      overflow-y: auto;
      padding: 0.4rem;
    }

    .sidebar-item {
      padding: 0.55rem 0.7rem;
      border-radius: 7px;
      font-size: 0.84rem;
      color: var(--color-dark);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.4rem;
      margin-bottom: 2px;
      transition: background 0.1s;
    }

    .sidebar-item:hover { background: var(--color-border); }
    .sidebar-item.active { background: var(--color-primary-light); font-weight: 500; }

    .sidebar-item-title {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .sidebar-item-delete {
      background: none;
      border: none;
      font-size: 0.9rem;
      color: var(--color-gray-mid);
      cursor: pointer;
      padding: 0 0.2rem;
      opacity: 0;
      transition: opacity 0.1s;
    }

    .sidebar-item:hover .sidebar-item-delete { opacity: 1; }
    .sidebar-item-delete:hover { color: var(--color-error); }

    .sidebar-footer {
      padding: 0.6rem 0.75rem;
      border-top: 1px solid var(--color-border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 0.8rem;
      color: var(--color-gray-dark);
    }

    .sidebar-logout {
      background: none;
      border: none;
      font-family: var(--font);
      font-size: 0.8rem;
      color: var(--color-gray-dark);
      cursor: pointer;
    }

    .sidebar-logout:hover { color: var(--color-error); }

    .chat-main {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    @media (max-width: 768px) {
      #sidebar { width: 200px; }
    }

    @media (max-width: 640px) {
      #sidebar { display: none; }
    }

    /* === DRAWER (Impressum & Datenschutz) === */
    .drawer-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.4);
      z-index: 200;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .drawer-backdrop.active { opacity: 1; visibility: visible; }

    .drawer {
      position: fixed;
      top: 0;
      right: 0;
      height: 100vh;
      width: min(720px, 100vw);
      background: #fff;
      z-index: 201;
      display: flex;
      flex-direction: column;
      transform: translateX(100%);
      transition: transform 0.3s ease;
      box-shadow: -4px 0 32px rgba(0,0,0,0.15);
    }
    .drawer.active { transform: translateX(0); }

    .drawer-header {
      background: var(--color-primary);
      color: #fff;
      padding: 1.1rem 1.5rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
    }
    .drawer-title { font-size: 1.1rem; font-weight: 600; margin: 0; color: #fff; }
    .drawer-close {
      background: none;
      border: none;
      color: rgba(255,255,255,0.85);
      cursor: pointer;
      padding: 4px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      transition: background 0.15s, color 0.15s;
    }
    .drawer-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

    .drawer-body {
      flex: 1;
      overflow-y: auto;
      padding: 2rem 2rem 3rem;
    }
    .drawer-content { display: none; }
    .drawer-content.visible { display: block; }

    .accordion-controls {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 0.75rem;
    }
    .accordion-toggle-btn {
      font-size: 0.78rem;
      color: var(--color-primary);
      background: none;
      border: 1px solid var(--color-border);
      border-radius: 6px;
      padding: 0.3rem 0.75rem;
      cursor: pointer;
      font-family: var(--font);
      transition: background 0.15s;
    }
    .accordion-toggle-btn:hover { background: var(--color-primary-light); }

    .ds-intro-header { margin-bottom: 1.25rem; }
    .ds-subtitle {
      font-size: 0.875rem;
      color: var(--color-gray-dark);
      margin: 0 0 0.75rem;
    }
    .ds-intro-header .ds-highlights {
      background: none;
      border: none;
      padding: 0;
      gap: 0.4rem;
    }
    .ds-intro-header .ds-highlight-chip {
      background: var(--color-primary-light);
      border-color: var(--color-border);
      color: var(--color-primary);
    }

    @media (max-width: 640px) {
      .drawer-body { padding: 1.25rem 1rem 3rem; }
      .ds-accordion-body { padding: 0.25rem 0.5rem 1rem 3rem; }
    }
