:root {
  /* Brand-Farben (von der Live-Webseite) */
  --bg:           #f6f8fb;
  --bg-soft:      #fafbfd;
  --card:         #ffffff;
  --primary:      #003580;
  --primary-dark: #002660;
  --primary-2:    #1a5aa8;
  --accent:       #c4956a;
  --accent-light: #d4a574;
  --sage:         #7d9a8c;
  --sage-light:   #a8c4b8;
  --cream:        #f8f9fc;
  --sand:         #f0f3f8;
  --text:         #1a2a3a;
  --text-light:   #4a5a6a;
  --muted:        #7a8a9a;
  --border:       #dde3ed;
  --border-light: #e8edf5;
  --warn:         #b15454;
  --warn-bg:      #fef0f0;
  --ok:           #5a8a73;
  --ok-bg:        #ecf5ef;

  --shadow-sm: 0 2px 8px rgba(0, 53, 128, 0.06);
  --shadow:    0 4px 16px rgba(0, 53, 128, 0.08);
  --shadow-md: 0 8px 28px rgba(0, 53, 128, 0.10);
  --shadow-lg: 0 16px 48px rgba(0, 53, 128, 0.14);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --t-fast: 0.15s ease;
  --t:      0.25s ease;
}

/* ============== 2026 ADMIN REFRESH ============== */
.app-shell {
  background:
    radial-gradient(circle at 12% 12%, rgba(168, 196, 184, 0.28), transparent 30rem),
    radial-gradient(circle at 86% 18%, rgba(196, 149, 106, 0.18), transparent 28rem),
    linear-gradient(180deg, #f8f9fc 0%, #eef3f8 100%);
}

.sidenav {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid rgba(221, 227, 237, 0.9);
  box-shadow: 18px 0 55px rgba(0, 53, 128, 0.06);
}

.sn-brand,
.sn-link,
.sn-status,
.sn-logout,
.topbar-btn,
.btn,
.field input,
.field textarea,
.media-toolbar input,
.media-toolbar select,
.composer textarea {
  border-radius: 8px;
}

.sn-brand {
  background: rgba(248, 249, 252, 0.72);
  border: 1px solid var(--border-light);
}

.sn-link.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
}

.sn-status {
  border: 1px solid var(--border-light);
  background: rgba(248, 249, 252, 0.82);
}

.topbar {
  height: 68px;
  background: rgba(248, 249, 252, 0.86);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.topbar-title {
  font-size: 1.25rem;
}

.content {
  padding: 1.25rem;
}

.chat-layout {
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 1rem;
  height: calc(100vh - 68px - 2.5rem);
  height: calc(100dvh - 68px - 2.5rem);
}

.chat-sidebar,
.chat-card,
.page-card {
  border-radius: 8px;
  border: 1px solid rgba(221, 227, 237, 0.92);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 60px rgba(0, 53, 128, 0.08);
}

.chat-sidebar {
  position: static;
  max-height: none;
  height: 100%;
}

.job-list li {
  border-radius: 8px;
}

.job-list li.active {
  background: #eef5fb;
  box-shadow: inset 3px 0 0 var(--primary);
  border-color: rgba(26, 90, 168, 0.2);
}

.chat-main,
.chat-card {
  min-height: 0;
  height: 100%;
}

.chat-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.chat-card-head {
  padding: 1.1rem 1.2rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.chat-card-head h2 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
}

.chat-hint {
  max-width: none;
  font-size: 0.875rem;
}

.messages {
  min-height: 0;
  overflow-y: auto;
  padding: 1.2rem;
  background:
    linear-gradient(180deg, rgba(248, 249, 252, 0.65), rgba(255, 255, 255, 0.88));
}

.msg {
  max-width: min(760px, 92%);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(0, 53, 128, 0.06);
}

.msg.user {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
}

.msg.assistant {
  background: #fff;
  border: 1px solid var(--border-light);
}

.msg.system {
  margin-left: auto;
  margin-right: auto;
  background: #eef5fb;
  border: 1px solid #d7e6f5;
  color: var(--text-light);
}

.actions {
  padding: 0.85rem 1.2rem;
  border-top: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.92);
}

.composer {
  padding: 1rem 1.2rem 1.2rem;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border-light);
}

.dropzone {
  border-radius: 8px;
  background: rgba(248, 249, 252, 0.74);
}

.composer-row {
  align-items: end;
}

.composer textarea {
  min-height: 62px;
  max-height: 180px;
  resize: vertical;
  background: #fff;
}

.btn,
.topbar-btn {
  min-height: 40px;
  font-weight: 600;
}

.btn-primary,
.topbar-btn:not(.ghost) {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  box-shadow: 0 10px 24px rgba(0, 53, 128, 0.16);
}

.btn-ghost,
.topbar-btn.ghost {
  background: rgba(255, 255, 255, 0.7);
}

.view-settings {
  max-width: 1180px;
}

.claude-panel {
  overflow: hidden;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.settings-grid .auth-card:first-child {
  grid-column: 1 / -1;
}

.auth-card {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: rgba(248, 249, 252, 0.72);
}

.muted-card {
  opacity: 0.72;
}

.setting-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.segmented {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.seg-btn {
  min-height: 34px;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-light);
  font-weight: 600;
}

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

.auth-status-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.auth-status-list > div,
.stat-card {
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: #fff;
  padding: 0.85rem;
}

.auth-status-list span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-status-list strong {
  display: block;
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.92rem;
}

.auth-command {
  display: block;
  margin: 0.85rem 0 0;
  padding: 0.8rem;
  border-radius: 8px;
  background: #172333;
  color: #f8f9fc;
  overflow-x: auto;
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .chat-sidebar {
    height: auto;
  }

  .chat-card {
    height: calc(100vh - 68px - 2.5rem);
    height: calc(100dvh - 68px - 2.5rem);
  }

  .settings-grid,
  .auth-status-list {
    grid-template-columns: 1fr;
  }
}

/* ============== FINAL FILE ATTACH + SETTINGS SCROLL FIXES ============== */
.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidenav {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.content {
  min-height: 0;
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  overflow-y: auto;
  overflow-x: hidden;
}

.view-settings {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding-bottom: 3rem;
}

.view-settings.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.composer-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 44px 44px auto;
  align-items: end;
  gap: 0.5rem;
}

.composer textarea {
  min-width: 0;
  width: 100%;
}

.icon-btn.attach-btn,
.icon-btn.mic-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 8px;
}

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

.media-grid .item.document {
  background: #f8f9fc;
}

.media-grid .item .document-thumb {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.5rem;
  color: var(--primary);
  padding: 1rem;
}

.media-grid .item .document-thumb span {
  max-width: 100%;
  color: var(--text-light);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-flow-modal {
  width: min(480px, calc(100vw - 2rem));
  max-height: min(680px, calc(100dvh - 2rem));
  overflow: auto;
  border-radius: 8px;
}

.login-flow-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-flow-card h3,
.login-flow-card p {
  margin: 0;
}

@media (max-width: 720px) {
  .content {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
  }

  .composer-row {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
  }

  .btn-send {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* ============== PROFESSIONAL RESPONSIVE POLISH ============== */
.app-shell {
  grid-template-columns: 256px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%) !important;
}

.sidenav {
  padding: 14px 12px;
  gap: 12px;
}

.sn-brand {
  margin-bottom: 0.75rem;
}

.project-panel,
.chat-list-panel,
.utility-nav {
  flex-shrink: 0;
}

.chat-list-panel {
  min-height: 120px;
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.job-list.simple {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.sn-status,
.sn-foot {
  flex-shrink: 0;
}

.topbar {
  min-width: 0;
  padding-inline: clamp(0.875rem, 2vw, 1.5rem);
}

.topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-right {
  min-width: 0;
}

.content {
  padding: clamp(0.75rem, 2vw, 1.5rem);
}

.view-chat.active {
  height: 100%;
}

.chat-layout {
  width: min(1180px, 100%);
  height: 100%;
  margin: 0 auto;
}

.chat-card {
  height: min(860px, calc(100dvh - 96px));
  min-height: min(680px, calc(100dvh - 96px));
}

.chat-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.chat-head-status,
.conn-state {
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: #fff;
  padding: 0.35rem 0.6rem;
  white-space: nowrap;
}

.empty-chat {
  max-width: 640px;
  margin-inline: auto;
}

.empty-chat h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
}

.prompt-suggestions {
  width: min(620px, 100%);
}

.prompt-chip {
  width: 100%;
  text-align: left;
}

.composer {
  position: relative;
}

.composer-row {
  grid-template-columns: minmax(0, 1fr) 44px 44px minmax(172px, auto) !important;
}

.btn-send {
  white-space: nowrap;
}

.view-settings.active,
.view-media.active,
.view-history.active {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.settings-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
}

.auth-status-list {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.backup-details {
  grid-column: 1 / -1;
}

.login-flow-modal {
  padding: 0;
  border-radius: 10px;
}

.login-flow-card {
  padding: 1.5rem;
}

.login-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.login-steps li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.login-steps span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #eef5fb;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
}

.login-flow-card input:disabled {
  background: #f4f6f9;
  color: var(--muted);
}

.dlg-actions [hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .auth-status-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "content";
  }

  .sidenav {
    width: min(86vw, 304px);
    transform: translateX(-105%);
    border-right: 1px solid var(--border-light);
  }

  .sidenav.open {
    transform: translateX(0);
  }

  .content {
    padding: 0.75rem;
  }

  .chat-card {
    height: calc(100dvh - 88px);
    min-height: calc(100dvh - 88px);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .auth-status-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    height: 58px;
    padding-inline: 0.75rem;
  }

  .topbar-title {
    font-size: 1rem;
  }

  .topbar-btn {
    min-height: 38px;
    padding-inline: 0.65rem;
  }

  .topbar-btn.ghost span,
  .topbar-btn .btn-label {
    display: none;
  }

  .content {
    height: calc(100dvh - 58px);
    padding: 0;
  }

  .chat-layout {
    width: 100%;
  }

  .chat-card {
    height: calc(100dvh - 58px);
    min-height: calc(100dvh - 58px);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .chat-card-head {
    padding: 0.85rem;
    flex-direction: column;
  }

  .messages {
    padding: 0.85rem;
  }

  .composer {
    padding: 0.75rem;
  }

  .dropzone {
    display: none;
  }

  .composer-row {
    grid-template-columns: minmax(0, 1fr) 42px 42px !important;
  }

  .icon-btn.attach-btn,
  .icon-btn.mic-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .btn-send {
    grid-column: 1 / -1;
    width: 100%;
  }

  .view-settings.active,
  .view-media.active,
  .view-history.active {
    padding: 0.75rem;
  }

  .page-card,
  .setting-card {
    border-radius: 8px;
  }

  .auth-status-list {
    grid-template-columns: 1fr;
  }

  .setting-row-head {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .seg-btn {
    flex: 1;
  }

  .login-flow-card {
    padding: 1.1rem;
  }

  .dlg-actions {
    flex-direction: column-reverse;
  }

  .dlg-actions .btn {
    width: 100%;
  }
}

/* ============== AUTH FIX PRO UI FINAL OVERRIDE ============== */
.app-shell {
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --line: #dce4ee;
  --ink: #102033;
  --ink-soft: #53657a;
  --brand: #003580;
  --brand-2: #1a5aa8;
  --sage-soft: #edf5f1;
  --gold-soft: #fbf4e9;
  background: #eef3f8 !important;
  color: var(--ink);
}

.sidenav {
  background: #f9fbfd !important;
  border-right: 1px solid var(--line);
  box-shadow: none;
}

.sn-brand {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(16, 32, 51, 0.05);
}

.project-card {
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(16, 32, 51, 0.04);
}

.job-list.simple li:hover,
.job-list.simple li.active {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 8px 20px rgba(16, 32, 51, 0.05);
}

.topbar {
  background: rgba(249, 251, 253, 0.96) !important;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.topbar-copy {
  flex: 1;
  min-width: 0;
}

.topbar-title {
  color: var(--ink);
  font-size: 1.28rem;
  letter-spacing: 0;
}

.topbar-sub {
  margin: 0.12rem 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1;
}

.topbar-btn:not(.ghost),
.btn-primary,
.new-chat-btn,
.sn-link.active {
  background: #003f8f !important;
  box-shadow: 0 10px 22px rgba(0, 53, 128, 0.16);
}

.content {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.42) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255,255,255,0.42) 0 1px, transparent 1px 100%),
    #eef3f8;
  background-size: 28px 28px;
}

.chat-card {
  background: #fff !important;
  border: 1px solid var(--line);
  box-shadow: 0 22px 60px rgba(16, 32, 51, 0.09);
}

.pro-chat-head,
.chat-card-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--brand-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.messages {
  background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
}

.empty-chat {
  width: min(720px, 100%);
  text-align: left;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.2rem;
}

.empty-chat picture {
  grid-row: span 2;
}

.empty-chat img {
  width: 70px;
  height: 70px;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.empty-chat h2 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(2rem, 4.8vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.prompt-suggestions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  width: 100%;
  margin-top: 0.4rem;
}

.prompt-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  min-height: 58px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(16, 32, 51, 0.05);
}

.prompt-chip span {
  min-width: 64px;
  padding: 0.32rem 0.48rem;
  border-radius: 999px;
  background: var(--sage-soft);
  color: #2f725b;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.prompt-chip:nth-child(2) span,
.prompt-chip:nth-child(4) span {
  background: var(--gold-soft);
  color: #8a5b1f;
}

.composer textarea {
  border: 1px solid #cbd7e6;
  box-shadow: inset 0 1px 0 rgba(16,32,51,0.03);
}

.page-card,
.setting-card {
  background: #fff !important;
  border: 1px solid var(--line);
  box-shadow: 0 16px 44px rgba(16, 32, 51, 0.07);
}

.auth-card,
.auth-status-list > div,
.stat-card {
  background: #f9fbfd;
  border-color: var(--line);
}

.login-flow-modal {
  box-shadow: 0 28px 90px rgba(16, 32, 51, 0.24);
}

.login-flow-card h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ink);
}

@media (max-width: 760px) {
  .topbar-sub {
    display: none;
  }

  .empty-chat {
    display: block;
    text-align: center;
    padding-top: 1rem;
  }

  .empty-chat picture {
    display: inline-block;
    margin-bottom: 1rem;
  }

  .prompt-suggestions {
    grid-template-columns: 1fr;
    margin-top: 1.1rem;
  }
}

/* ============== AUTH FIX PRO UI FINAL ============== */
.app-shell {
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --line: #dce4ee;
  --ink: #102033;
  --ink-soft: #53657a;
  --brand: #003580;
  --brand-2: #1a5aa8;
  --sage-soft: #edf5f1;
  --gold-soft: #fbf4e9;
  background: #eef3f8 !important;
  color: var(--ink);
}

.sidenav {
  background: #f9fbfd !important;
  border-right: 1px solid var(--line);
  box-shadow: none;
}

.sn-brand {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(16, 32, 51, 0.05);
}

.sn-name {
  font-size: 1rem;
}

.project-card,
.new-chat-btn,
.sn-link,
.sn-status,
.sn-logout,
.topbar-btn,
.btn,
.field input,
.field textarea,
.composer textarea,
.page-card,
.chat-card {
  border-radius: 8px !important;
}

.project-card {
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(16, 32, 51, 0.04);
}

.side-h {
  color: #748296;
  font-size: 0.68rem;
  letter-spacing: 0;
}

.job-list.simple li {
  border: 1px solid transparent;
  background: transparent;
}

.job-list.simple li:hover,
.job-list.simple li.active {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 8px 20px rgba(16, 32, 51, 0.05);
}

.topbar {
  background: rgba(249, 251, 253, 0.96) !important;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.topbar-copy {
  flex: 1;
  min-width: 0;
}

.topbar-title {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.28rem;
  letter-spacing: 0;
}

.topbar-sub {
  margin: 0.12rem 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1;
}

.topbar-btn.ghost {
  background: #fff;
  border-color: var(--line);
}

.topbar-btn:not(.ghost),
.btn-primary,
.new-chat-btn,
.sn-link.active {
  background: #003f8f !important;
  box-shadow: 0 10px 22px rgba(0, 53, 128, 0.16);
}

.content {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.42) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255,255,255,0.42) 0 1px, transparent 1px 100%),
    #eef3f8;
  background-size: 28px 28px;
}

.chat-layout {
  max-width: 1160px;
}

.chat-card {
  background: #fff !important;
  border: 1px solid var(--line);
  box-shadow: 0 22px 60px rgba(16, 32, 51, 0.09);
}

.pro-chat-head,
.chat-card-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--brand-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chat-card-head h2,
.page-head h2 {
  color: var(--ink);
}

.chat-hint,
.hint {
  color: var(--ink-soft);
}

.messages {
  background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
}

.empty-chat {
  width: min(720px, 100%);
  text-align: left;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.2rem;
}

.empty-chat picture {
  grid-row: span 2;
}

.empty-chat img {
  width: 70px;
  height: 70px;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.empty-chat h2 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(2rem, 4.8vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.prompt-suggestions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  width: 100%;
  margin-top: 0.4rem;
}

.prompt-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  min-height: 58px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(16, 32, 51, 0.05);
}

.prompt-chip span {
  min-width: 64px;
  padding: 0.32rem 0.48rem;
  border-radius: 999px;
  background: var(--sage-soft);
  color: #2f725b;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.prompt-chip:nth-child(2) span,
.prompt-chip:nth-child(4) span {
  background: var(--gold-soft);
  color: #8a5b1f;
}

.prompt-chip:hover {
  border-color: #b9c9dc;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(16, 32, 51, 0.08);
}

.composer {
  background: #fff;
}

.composer textarea {
  border: 1px solid #cbd7e6;
  box-shadow: inset 0 1px 0 rgba(16,32,51,0.03);
}

.composer textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(26, 90, 168, 0.14);
}

.dropzone {
  border: 1px dashed #bfccda;
  background: #f8fafc;
}

.icon-btn.attach-btn,
.icon-btn.mic-btn {
  border: 1px solid #cbd7e6;
  background: #fff;
}

.icon-btn.attach-btn:hover,
.icon-btn.mic-btn:hover,
.icon-btn.mic-btn.active {
  background: #eef5fb;
  border-color: #9db7d3;
}

.page-card,
.setting-card {
  background: #fff !important;
  border: 1px solid var(--line);
  box-shadow: 0 16px 44px rgba(16, 32, 51, 0.07);
}

.settings-grid {
  gap: 0.85rem;
}

.auth-card,
.auth-status-list > div,
.stat-card {
  background: #f9fbfd;
  border-color: var(--line);
}

.segmented {
  border-color: var(--line);
}

.seg-btn.active {
  background: var(--brand) !important;
}

.login-flow-modal {
  box-shadow: 0 28px 90px rgba(16, 32, 51, 0.24);
}

.login-flow-card h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ink);
}

.login-flow-card .cstatus {
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  background: #f8fafc;
}

.login-flow-card .cstatus.error {
  background: #fff1f1;
}

@media (max-width: 760px) {
  .topbar-sub {
    display: none;
  }

  .empty-chat {
    display: block;
    text-align: center;
    padding-top: 1rem;
  }

  .empty-chat picture {
    display: inline-block;
    margin-bottom: 1rem;
  }

  .prompt-suggestions {
    grid-template-columns: 1fr;
    margin-top: 1.1rem;
  }

  .prompt-chip {
    min-height: 54px;
  }
}

/* ============== FINAL FILE ATTACH + SETTINGS SCROLL FIXES ============== */
.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidenav {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.content {
  min-height: 0;
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  overflow-y: auto;
  overflow-x: hidden;
}

.view-settings {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding-bottom: 3rem;
}

.view-settings.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.composer-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 44px 44px auto;
  align-items: end;
  gap: 0.5rem;
}

.composer textarea {
  min-width: 0;
  width: 100%;
}

.icon-btn.attach-btn,
.icon-btn.mic-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 8px;
}

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

.media-grid .item.document {
  background: #f8f9fc;
}

.media-grid .item .document-thumb {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.5rem;
  color: var(--primary);
  padding: 1rem;
}

.media-grid .item .document-thumb span {
  max-width: 100%;
  color: var(--text-light);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-flow-modal {
  width: min(480px, calc(100vw - 2rem));
  max-height: min(680px, calc(100dvh - 2rem));
  overflow: auto;
  border-radius: 8px;
}

.login-flow-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-flow-card h3,
.login-flow-card p {
  margin: 0;
}

@media (max-width: 720px) {
  .content {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
  }

  .composer-row {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
  }

  .btn-send {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* ============== FILE ATTACH + CLAUDE LOGIN FIXES ============== */
.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidenav {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.content {
  min-height: 0;
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  overflow-y: auto;
  overflow-x: hidden;
}

.view-settings {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding-bottom: 3rem;
}

.view-settings.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.composer-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 44px 44px auto;
  align-items: end;
  gap: 0.5rem;
}

.composer textarea {
  min-width: 0;
  width: 100%;
}

.icon-btn.attach-btn,
.icon-btn.mic-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 8px;
}

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

.dropzone .dz-inner span {
  min-width: 0;
}

.media-grid .item.document {
  background: #f8f9fc;
}

.media-grid .item .document-thumb {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.5rem;
  color: var(--primary);
  padding: 1rem;
}

.media-grid .item .document-thumb span {
  max-width: 100%;
  color: var(--text-light);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-flow-modal {
  width: min(480px, calc(100vw - 2rem));
  max-height: min(680px, calc(100dvh - 2rem));
  overflow: auto;
  border-radius: 8px;
}

.login-flow-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-flow-card h3,
.login-flow-card p {
  margin: 0;
}

.login-flow-card .field {
  margin-top: 0.25rem;
}

@media (max-width: 720px) {
  .content {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
  }

  .composer-row {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
  }

  .btn-send {
    grid-column: 1 / -1;
    width: 100%;
  }

  .topbar-right {
    gap: 0.35rem;
  }
}

/* ============== SIMPLE OPERATOR UI ============== */
.app-shell {
  grid-template-columns: 312px minmax(0, 1fr);
  grid-template-rows: 72px minmax(0, 1fr);
  background:
    linear-gradient(135deg, rgba(248, 249, 252, 0.96) 0%, rgba(239, 245, 250, 0.96) 100%),
    radial-gradient(circle at 85% 15%, rgba(196, 149, 106, 0.18), transparent 28rem);
}

.sidenav {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
}

.sn-brand {
  min-height: 62px;
  margin-bottom: 1rem;
}

.sn-nav.utility-nav {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light);
}

.subtle-link,
.admin-only {
  display: none !important;
}

.project-panel,
.chat-list-panel {
  margin-bottom: 1rem;
}

.project-card,
.new-chat-btn {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.project-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.project-card strong,
.project-card small {
  display: block;
}

.project-card strong {
  font-size: 0.95rem;
}

.project-card small {
  color: var(--muted);
  margin-top: 0.1rem;
}

.project-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}

.new-chat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  margin-top: 0.65rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(0, 53, 128, 0.14);
}

.chat-list-panel {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.job-list.simple {
  overflow-y: auto;
  padding-right: 0.2rem;
}

.job-list.simple li {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.7rem 0.75rem;
}

.job-list.simple li:hover {
  background: rgba(240, 243, 248, 0.8);
}

.job-list.simple li.active {
  background: #eef5fb;
  border-color: rgba(26, 90, 168, 0.18);
}

.job-list.simple .title {
  -webkit-line-clamp: 1;
}

.job-list.simple .meta {
  margin-top: 0.25rem;
}

.job-list.simple .meta span:last-child {
  display: none;
}

.topbar {
  height: 72px;
  padding: 0 1.25rem;
  background: rgba(248, 249, 252, 0.92);
}

.topbar-title {
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 700;
}

.content {
  min-width: 0;
  overflow: hidden;
}

.chat-layout {
  display: block;
  height: calc(100vh - 72px - 2.5rem);
  height: calc(100dvh - 72px - 2.5rem);
}

.chat-card {
  max-width: 980px;
  margin: 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.chat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.chat-card-head h2 {
  font-size: 1.05rem;
}

.chat-head-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 34px;
  padding: 0 0.7rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #fff;
  color: var(--text-light);
  font-size: 0.82rem;
  white-space: nowrap;
}

.empty-chat {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}

.empty-chat img {
  opacity: 0.92;
}

.empty-chat h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  color: var(--primary);
}

.prompt-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  max-width: 760px;
}

.prompt-chip {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.65rem 0.8rem;
  color: var(--text-light);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.prompt-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.composer {
  padding: 0.85rem 1rem 1rem;
}

.dropzone {
  display: none;
}

.composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px auto;
  gap: 0.55rem;
}

.composer textarea {
  min-height: 58px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0, 53, 128, 0.07);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
}

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

.btn-send {
  align-self: end;
  min-height: 44px;
  padding-inline: 1rem;
}

.settings-grid {
  grid-template-columns: minmax(0, 1fr);
}

.auth-status-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-setup {
  margin-top: 0.8rem;
}

.admin-setup summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
}

@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidenav {
    transform: translateX(-105%);
  }

  .sidenav.open {
    transform: translateX(0);
  }

  .composer-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .btn-send {
    grid-column: 1 / -1;
  }

  .auth-status-list {
    grid-template-columns: 1fr;
  }
}

/* ============== NON TECHNICAL SURFACE ============== */
.calm-head .segmented {
  display: none;
}

.job-list.simple .meta {
  display: none;
}

.backup-details {
  grid-column: 1 / -1;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  padding: 0.8rem;
}

.backup-details summary {
  cursor: pointer;
  color: var(--text-light);
  font-weight: 700;
}

.backup-details .auth-card {
  margin-top: 0.85rem;
}

.auth-status-list strong {
  text-transform: none;
}

#accountAuthCard {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.95), rgba(238,245,251,0.92));
}

/* ============== LAYOUT FIX ============== */
.content {
  width: 100%;
  min-width: 0;
}

.view-chat,
.chat-layout,
.chat-main,
.chat-card {
  width: 100%;
  min-width: 0;
}

.chat-layout {
  display: block !important;
  grid-template-columns: none !important;
}

.chat-main {
  display: block;
}

.chat-card {
  max-width: none;
  margin: 0;
}

.messages {
  overflow-x: hidden;
}

.empty-chat {
  max-width: 920px;
  margin: 0 auto;
}

.empty-chat h2 {
  max-width: 780px;
  line-height: 1.08;
}

.prompt-chip {
  max-width: 100%;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
.link { background: none; border: none; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; }
.link:hover { color: var(--primary-dark); }
.hidden { display: none !important; }

/* ============== APP SHELL (sidebar + topbar + content) ============== */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "side top"
    "side content";
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

/* Sidebar */
.sidenav {
  grid-area: side;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 10;
}

.sn-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: background var(--t);
}
.sn-brand:hover { background: var(--cream); }
.sn-symbol { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.sn-brand-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.sn-name { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; line-height: 1.1; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-tag { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }

.sn-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.sn-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: background var(--t-fast), color var(--t-fast);
}
.sn-link svg { flex-shrink: 0; }
.sn-link:hover { background: var(--cream); color: var(--primary); }
.sn-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px -6px rgba(0, 53, 128, 0.5);
}

.sn-status {
  margin-top: auto;
  padding: 0.75rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-light);
}
.sn-status-row { display: flex; align-items: center; gap: 0.5rem; }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.dot.ok      { background: var(--sage); }
.dot.warn    { background: var(--accent); }
.dot.error   { background: var(--warn); }
.dot.busy    { background: var(--primary-2); animation: dotPulse 1.4s infinite ease-in-out; }
.dot-pulse   { animation: dotPulse 1.6s infinite ease-in-out; }
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.4); }
}

.sn-foot {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.sn-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}
.sn-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.sn-user-text { display: flex; flex-direction: column; min-width: 0; }
.sn-user-text > span:first-child { font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-userrole { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.sn-logout {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  transition: all var(--t-fast);
}
.sn-logout:hover { background: var(--cream); color: var(--primary); border-color: var(--primary); }

/* Topbar */
.topbar {
  grid-area: top;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 8;
}
.topbar-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--text);
  flex: 1;
  letter-spacing: -0.005em;
}
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.875rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all var(--t-fast);
}
.topbar-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.topbar-btn.ghost { background: transparent; color: var(--text-light); border: 1px solid var(--border); }
.topbar-btn.ghost:hover { background: var(--cream); color: var(--primary); border-color: var(--primary); transform: translateY(-1px); }

.hamburger { display: none; background: none; border: none; padding: 0.5rem; flex-direction: column; gap: 4px; }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* Content */
.content {
  grid-area: content;
  padding: 1.5rem;
  overflow-x: auto;
}
.view { display: none; }
.view.active { display: block; }

/* ============== CHAT VIEW ============== */
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.chat-sidebar {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 1rem;
  position: sticky;
  top: calc(64px + 1.5rem);
  max-height: calc(100vh - 64px - 3rem);
  max-height: calc(100dvh - 64px - 3rem);
  overflow-y: auto;
}
.side-h {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
}
.job-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.job-list li {
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  border: 1px solid transparent;
  transition: all var(--t-fast);
}
.job-list li:hover { background: var(--cream); }
.job-list li.active { background: var(--cream); border-color: var(--primary); }
.job-list .title { font-weight: 500; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job-list .meta { display: flex; gap: 0.5rem; align-items: center; font-size: 0.7rem; color: var(--muted); margin-top: 0.3rem; }
.job-list .empty-msg { color: var(--muted); font-size: 0.8125rem; padding: 0.5rem; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge.pending        { background: #ece9f7; color: #5a4ca8; }
.badge.running        { background: #fef3c7; color: #92400e; }
.badge.preview_ready  { background: #dbeafe; color: #1e40af; }
.badge.published      { background: #dcfce7; color: #166534; }
.badge.failed         { background: #fee2e2; color: #991b1b; }
.badge.discarded      { background: #e5e7eb; color: #4b5563; }
.badge.running, .badge.pending { animation: badgePulse 1.6s infinite ease-in-out; }
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.chat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px - 3rem);
  min-height: calc(100dvh - 64px - 3rem);
}
.chat-card-head {
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.chat-card-head h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--text);
}
.chat-hint { margin: 0; color: var(--muted); font-size: 0.875rem; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 240px;
}
.msg {
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  max-width: 78%;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 0.9375rem;
}
.msg .who {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.msg.user      { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.user .who { color: rgba(255, 255, 255, 0.75); }
.msg.assistant { align-self: flex-start; background: var(--cream); border: 1px solid var(--border-light); border-bottom-left-radius: 4px; }
.msg.system    { align-self: center; background: transparent; color: var(--muted); font-size: 0.8125rem; padding: 0.3rem 0.6rem; max-width: none; }
.msg.system .who { display: none; }
.msg.system::before { content: "·"; margin-right: 0.5rem; color: var(--accent); font-weight: bold; }

.actions {
  padding: 0.75rem 1.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-light);
  background: var(--cream);
}

/* Composer */
.composer {
  border-top: 1px solid var(--border-light);
  padding: 1rem 1.5rem 1.25rem;
  background: #fff;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  margin-bottom: 0.625rem;
  background: var(--cream);
  transition: all var(--t);
}
.dropzone.drag {
  border-color: var(--primary);
  background: #eaf0fa;
}
.dz-inner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.dz-inner svg { color: var(--accent); }
.pending {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.pending:not(:empty) { margin-top: 0.5rem; }
.pending li {
  padding: 0.25rem 0.5rem 0.25rem 0.65rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.pending button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}
.pending button:hover { color: var(--warn); }

.composer-row { display: flex; gap: 0.5rem; align-items: flex-end; }
.composer textarea {
  flex: 1;
  resize: vertical;
  min-height: 70px;
  max-height: 240px;
  padding: 0.7rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: var(--font-body);
  background: #fff;
  transition: border-color var(--t), box-shadow var(--t);
}
.composer textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 53, 128, 0.1);
}
.cstatus { color: var(--muted); font-size: 0.8125rem; margin: 0.5rem 0 0; min-height: 1.2em; }
.cstatus.success { color: var(--ok); }
.cstatus.error { color: var(--warn); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn:disabled { cursor: not-allowed; opacity: 0.6; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px -6px rgba(0, 53, 128, 0.5);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-secondary:hover:not(:disabled) {
  background: #a67c52;
  border-color: #a67c52;
  transform: translateY(-1px);
}
.btn-warn {
  background: #fff;
  color: var(--warn);
  border-color: #f3d4d4;
}
.btn-warn:hover:not(:disabled) {
  background: var(--warn-bg);
}
.btn-ghost {
  background: #fff;
  color: var(--text-light);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--cream);
  color: var(--primary);
  border-color: var(--primary);
}
.btn-send { position: relative; }
.btn-send .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn-send.loading .btn-label, .btn-send.loading .arrow { display: none; }
.btn-send.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============== PAGE CARDS (settings, media, history) ============== */
.page-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.page-head {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.page-head.with-status {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.page-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--text);
}
.page-head .hint { margin: 0; color: var(--muted); font-size: 0.875rem; }

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Settings cards */
.setting-card .setting-section { margin-bottom: 1rem; }
.setting-section + .setting-section { padding-top: 1rem; border-top: 1px solid var(--border-light); }
.setting-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--muted); margin: 0 0 0.25rem; letter-spacing: 0.04em; }
.setting-value { font-size: 1rem; color: var(--text); margin: 0 0 0.25rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.setting-help { font-size: 0.8125rem; color: var(--muted); margin: 0.5rem 0 0; line-height: 1.55; }
.setting-help code { background: var(--cream); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.85em; }
.setting-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.setting-actions .cstatus { margin: 0 0 0 0.5rem; }

.setting-collapse {
  margin-top: 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--cream);
  padding: 0;
  overflow: hidden;
}
.setting-collapse summary {
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--primary);
  list-style: none;
}
.setting-collapse summary::-webkit-details-marker { display: none; }
.setting-collapse summary::before {
  content: "›";
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.2s;
}
.setting-collapse[open] summary::before { transform: rotate(90deg); }
.setting-collapse[open] { background: #fff; }
.setting-collapse .setting-section { padding: 0 0.875rem 0.875rem; margin: 0; border: none; }

.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.75rem; }
.field label { font-size: 0.8125rem; font-weight: 500; color: var(--text-light); }
.field input, .field select {
  padding: 0.7rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font-body);
  background: #fff;
  color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 53, 128, 0.1);
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
}
.pw-toggle:hover { background: var(--cream); color: var(--primary); }
.pw-toggle[aria-pressed="true"] { color: var(--primary); }

.conn-state {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--cream);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-light);
}
.conn-state.ok    { background: var(--ok-bg); color: var(--ok); }
.conn-state.warn  { background: #fef3c7; color: #92400e; }
.conn-state.error { background: var(--warn-bg); color: var(--warn); }

/* ============== STATS GRID ============== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}
.stat-card {
  padding: 1rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.stat-num { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; color: var(--primary); line-height: 1; }
.stat-label { font-size: 0.8125rem; color: var(--muted); margin-top: 0.4rem; }

/* ============== MEDIA GRID ============== */
.media-toolbar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.media-toolbar input,
.media-toolbar select {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: #fff;
  font-family: var(--font-body);
}
.media-toolbar input { flex: 1; min-width: 200px; }
.media-toolbar input:focus, .media-toolbar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 53, 128, 0.1);
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.625rem;
}
.media-grid .item {
  background: var(--cream);
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border-light);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.media-grid .item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.media-grid .item img,
.media-grid .item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-grid .item .name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff; font-size: 0.7rem; padding: 0.25rem 0.4rem 0.35rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-grid .item .kind-badge {
  position: absolute; top: 0.4rem; left: 0.4rem;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 0.6rem; font-weight: 600;
  padding: 0.1rem 0.4rem; border-radius: 4px;
  text-transform: uppercase;
}

/* History list */
.history-list { display: flex; flex-direction: column; gap: 0.5rem; }
.history-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--t-fast);
}
.history-item:hover { background: #fff; box-shadow: var(--shadow-sm); }
.history-item .h-prompt { font-size: 0.9375rem; color: var(--text); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.history-item .h-time { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

/* Modals */
dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
}
dialog::backdrop { background: rgba(0, 53, 128, 0.4); backdrop-filter: blur(4px); }
dialog h3 { margin: 0 0 0.5rem; font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; }
dialog p { margin: 0 0 1rem; color: var(--text-light); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* ============== RESPONSIVE ============== */
@media (max-width: 1100px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { position: relative; top: auto; max-height: 240px; }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 64px 1fr;
    grid-template-areas: "top" "content";
  }
  .sidenav {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 50;
    box-shadow: var(--shadow-lg);
  }
  .sidenav.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .topbar { padding: 0 1rem; }
  .topbar-title { font-size: 1.25rem; }
  .content { padding: 1rem; }
  .topbar-btn .lbl { display: none; }
  .chat-card { min-height: calc(100dvh - 180px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Login (Suzanne Maria Kern Brand) ---------- */
.login-page {
  /* Brand-Farben (1:1 von der Live-Webseite) */
  --bk-primary: #003580;
  --bk-primary-dark: #002660;
  --bk-primary-light: #1a5aa8;
  --bk-accent: #c4956a;
  --bk-accent-light: #d4a574;
  --bk-sage: #7d9a8c;
  --bk-cream: #f8f9fc;
  --bk-sand: #f0f3f8;
  --bk-text: #1a2a3a;
  --bk-text-light: #4a5a6a;
  --bk-text-muted: #7a8a9a;
  --bk-border: #dde3ed;
  --bk-border-light: #e8edf5;
  --bk-white: #ffffff;

  --bk-shadow-sm: 0 2px 8px rgba(0, 53, 128, 0.06);
  --bk-shadow-md: 0 4px 20px rgba(0, 53, 128, 0.10);
  --bk-shadow-lg: 0 8px 40px rgba(0, 53, 128, 0.12);
  --bk-shadow-xl: 0 20px 60px rgba(0, 53, 128, 0.18);

  --bk-font-display: 'Cormorant Garamond', Georgia, serif;
  --bk-font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  font-family: var(--bk-font-body);
  color: var(--bk-text);
  background:
    linear-gradient(135deg, var(--bk-cream) 0%, rgba(0, 53, 128, 0.03) 50%, rgba(196, 149, 106, 0.05) 100%);
}

/* Decorative background — same blurred circles as the live hero */
.bg-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.32;
  will-change: transform;
}
.bg-circle-1 {
  width: 480px; height: 480px;
  background: var(--bk-primary-light);
  top: -180px; right: -160px;
  animation: bkFloat 22s ease-in-out infinite;
}
.bg-circle-2 {
  width: 380px; height: 380px;
  background: var(--bk-accent-light);
  bottom: -120px; left: -120px;
  opacity: 0.38;
  animation: bkFloat 26s ease-in-out infinite reverse;
}
.bg-circle-3 {
  width: 320px; height: 320px;
  background: var(--bk-sage);
  bottom: 25%; right: 15%;
  opacity: 0.18;
  animation: bkFloat 30s ease-in-out infinite;
}
@keyframes bkFloat {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(20px, -25px); }
  66% { transform: translate(-15px, 20px); }
}

/* Subtle SVG-pattern overlay (gleicher wie auf der Live-Seite) */
.bg-pattern {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23003580' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

/* ---- Card ---- */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  padding: 2.5rem 2.25rem 2rem;
  background: var(--bk-white);
  border-radius: 24px;
  box-shadow: var(--bk-shadow-xl);
  border: 1px solid var(--bk-border-light);
  animation: bkCardIn 0.55s cubic-bezier(0.2, 0.85, 0.25, 1);
}
@keyframes bkCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-card.shake { animation: bkShake 0.42s ease; }
@keyframes bkShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

/* ---- Brand header ---- */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}
.brand-symbol {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 53, 128, 0.15));
  animation: bkSymbolBreath 6s ease-in-out infinite;
}
@keyframes bkSymbolBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}
.brand-schrift {
  height: 36px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
}

/* ---- Intro ---- */
.login-intro { text-align: center; margin-bottom: 1.75rem; }
.section-tag {
  display: inline-block;
  font-family: var(--bk-font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bk-primary);
  margin-bottom: 0.75rem;
}
.login-card h1 {
  margin: 0 0 0.5rem;
  font-family: var(--bk-font-display);
  font-weight: 500;
  line-height: 1.05;
  font-size: clamp(2rem, 5vw, 2.5rem);
  letter-spacing: -0.01em;
  color: var(--bk-text);
}
.login-card h1 .title-line { display: inline; color: var(--bk-text); }
.login-card h1 .title-accent {
  display: inline;
  font-style: italic;
  color: var(--bk-primary);
  margin-left: 0.35ch;
}
.login-card .sub {
  margin: 0;
  color: var(--bk-text-light);
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: 34ch;
  margin-inline: auto;
}

/* ---- Form ---- */
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-family: var(--bk-font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--bk-text-light);
  letter-spacing: 0.01em;
}
.field input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bk-cream);
  border: 1.5px solid var(--bk-border);
  border-radius: 12px;
  font-size: 16px;
  font-family: var(--bk-font-body);
  color: var(--bk-text);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.field input:hover { border-color: #c5cee0; background: #fff; }
.field input:focus {
  outline: none;
  border-color: var(--bk-primary);
  background: var(--bk-white);
  box-shadow: 0 0 0 4px rgba(0, 53, 128, 0.12);
}
.field input::placeholder { color: #a8b3c5; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--bk-text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.pw-toggle:hover { color: var(--bk-primary); background: var(--bk-sand); }
.pw-toggle:focus-visible { outline: 2px solid var(--bk-primary); outline-offset: 2px; }
.pw-toggle[aria-pressed="true"] { color: var(--bk-primary); background: var(--bk-sand); }

.btn-primary {
  margin-top: 0.5rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.5rem;
  border: 2px solid var(--bk-primary);
  background: var(--bk-primary);
  color: var(--bk-white);
  border-radius: 9999px;
  font-family: var(--bk-font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 4px 14px -6px rgba(0, 53, 128, 0.5);
}
.btn-primary:hover {
  background: var(--bk-primary-dark);
  border-color: var(--bk-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--bk-shadow-md);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible {
  outline: 3px solid rgba(196, 149, 106, 0.55);
  outline-offset: 3px;
}
.btn-primary:disabled { cursor: progress; opacity: 0.9; }

.btn-primary .arrow { transition: transform 0.2s ease; }
.btn-primary:hover .arrow { transform: translateX(4px); }

.btn-primary .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bkSpin 0.8s linear infinite;
}
.btn-primary.loading .label,
.btn-primary.loading .arrow { display: none; }
.btn-primary.loading .spinner { display: inline-block; }
.btn-primary.success {
  background: var(--bk-sage);
  border-color: var(--bk-sage);
}
@keyframes bkSpin { to { transform: rotate(360deg); } }

.err {
  margin: 0.25rem 0 0;
  min-height: 1.25em;
  color: #b15454;
  font-size: 0.875rem;
  text-align: center;
  font-family: var(--bk-font-body);
}

/* ---- Footer ---- */
.login-foot {
  margin: 1.75rem 0 0;
  text-align: center;
  color: var(--bk-text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.login-foot .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bk-sage);
  animation: bkPulse 2.5s infinite;
}
@keyframes bkPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

@media (max-width: 480px) {
  .login-card {
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 20px;
  }
  .brand-symbol { width: 76px; height: 76px; }
  .brand-schrift { height: 30px; }
  .bg-circle { filter: blur(70px); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bg-circle, .login-card, .brand-symbol, .login-foot .dot { animation: none !important; }
  .btn-primary { transition: none; }
}

/* ============== 2026 ADMIN REFRESH OVERRIDES ============== */
.app-shell {
  background:
    radial-gradient(circle at 12% 12%, rgba(168, 196, 184, 0.28), transparent 30rem),
    radial-gradient(circle at 86% 18%, rgba(196, 149, 106, 0.18), transparent 28rem),
    linear-gradient(180deg, #f8f9fc 0%, #eef3f8 100%);
}

.sidenav {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid rgba(221, 227, 237, 0.9);
  box-shadow: 18px 0 55px rgba(0, 53, 128, 0.06);
}

.sn-brand,
.sn-link,
.sn-status,
.sn-logout,
.topbar-btn,
.btn,
.field input,
.field textarea,
.media-toolbar input,
.media-toolbar select,
.composer textarea {
  border-radius: 8px;
}

.sn-brand {
  background: rgba(248, 249, 252, 0.72);
  border: 1px solid var(--border-light);
}

.sn-link.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
}

.sn-status {
  border: 1px solid var(--border-light);
  background: rgba(248, 249, 252, 0.82);
}

.topbar {
  height: 68px;
  background: rgba(248, 249, 252, 0.86);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.topbar-title {
  font-size: 1.25rem;
}

.content {
  padding: 1.25rem;
}

.chat-layout {
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 1rem;
  height: calc(100vh - 68px - 2.5rem);
  height: calc(100dvh - 68px - 2.5rem);
}

.chat-sidebar,
.chat-card,
.page-card {
  border-radius: 8px;
  border: 1px solid rgba(221, 227, 237, 0.92);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 60px rgba(0, 53, 128, 0.08);
}

.chat-sidebar {
  position: static;
  max-height: none;
  height: 100%;
}

.job-list li {
  border-radius: 8px;
}

.job-list li.active {
  background: #eef5fb;
  box-shadow: inset 3px 0 0 var(--primary);
  border-color: rgba(26, 90, 168, 0.2);
}

.chat-main,
.chat-card {
  min-height: 0;
  height: 100%;
}

.chat-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.chat-card-head {
  padding: 1.1rem 1.2rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.chat-card-head h2 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
}

.chat-hint {
  max-width: none;
  font-size: 0.875rem;
}

.messages {
  min-height: 0;
  overflow-y: auto;
  padding: 1.2rem;
  background:
    linear-gradient(180deg, rgba(248, 249, 252, 0.65), rgba(255, 255, 255, 0.88));
}

.msg {
  max-width: min(760px, 92%);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(0, 53, 128, 0.06);
}

.msg.user {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
}

.msg.assistant {
  background: #fff;
  border: 1px solid var(--border-light);
}

.msg.system {
  margin-left: auto;
  margin-right: auto;
  background: #eef5fb;
  border: 1px solid #d7e6f5;
  color: var(--text-light);
}

.actions {
  padding: 0.85rem 1.2rem;
  border-top: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.92);
}

.composer {
  padding: 1rem 1.2rem 1.2rem;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border-light);
}

.dropzone {
  border-radius: 8px;
  background: rgba(248, 249, 252, 0.74);
}

.composer-row {
  align-items: end;
}

.composer textarea {
  min-height: 62px;
  max-height: 180px;
  resize: vertical;
  background: #fff;
}

.btn,
.topbar-btn {
  min-height: 40px;
  font-weight: 600;
}

.btn-primary,
.topbar-btn:not(.ghost) {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  box-shadow: 0 10px 24px rgba(0, 53, 128, 0.16);
}

.btn-ghost,
.topbar-btn.ghost {
  background: rgba(255, 255, 255, 0.7);
}

.view-settings {
  max-width: 1180px;
}

.claude-panel {
  overflow: hidden;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.settings-grid .auth-card:first-child {
  grid-column: 1 / -1;
}

.auth-card {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: rgba(248, 249, 252, 0.72);
}

.muted-card {
  opacity: 0.72;
}

.setting-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.segmented {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.seg-btn {
  min-height: 34px;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-light);
  font-weight: 600;
}

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

.auth-status-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.auth-status-list > div,
.stat-card {
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: #fff;
  padding: 0.85rem;
}

.auth-status-list span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-status-list strong {
  display: block;
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.92rem;
}

.auth-command {
  display: block;
  margin: 0.85rem 0 0;
  padding: 0.8rem;
  border-radius: 8px;
  background: #172333;
  color: #f8f9fc;
  overflow-x: auto;
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .chat-sidebar {
    height: auto;
  }

  .chat-card {
    height: calc(100vh - 68px - 2.5rem);
    height: calc(100dvh - 68px - 2.5rem);
  }

  .settings-grid,
  .auth-status-list {
    grid-template-columns: 1fr;
  }
}

/* ============== FINAL FILE ATTACH + SETTINGS SCROLL FIXES ============== */
.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidenav {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.content {
  min-height: 0;
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  overflow-y: auto;
  overflow-x: hidden;
}

.view-settings {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding-bottom: 3rem;
}

.view-settings.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.composer-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 44px 44px auto;
  align-items: end;
  gap: 0.5rem;
}

.composer textarea {
  min-width: 0;
  width: 100%;
}

.icon-btn.attach-btn,
.icon-btn.mic-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 8px;
}

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

.media-grid .item.document {
  background: #f8f9fc;
}

.media-grid .item .document-thumb {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.5rem;
  color: var(--primary);
  padding: 1rem;
}

.media-grid .item .document-thumb span {
  max-width: 100%;
  color: var(--text-light);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-flow-modal {
  width: min(480px, calc(100vw - 2rem));
  max-height: min(680px, calc(100dvh - 2rem));
  overflow: auto;
  border-radius: 8px;
}

.login-flow-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-flow-card h3,
.login-flow-card p {
  margin: 0;
}

@media (max-width: 720px) {
  .content {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
  }

  .composer-row {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
  }

  .btn-send {
    grid-column: 1 / -1;
    width: 100%;
  }
}
/* ============== EOF RESPONSIVE APP POLISH ============== */
.app-shell {
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --line: #dce4ee;
  --ink: #102033;
  --ink-soft: #53657a;
  --brand: #003580;
  --brand-2: #1a5aa8;
  --sage-soft: #edf5f1;
  --gold-soft: #fbf4e9;
  background: #eef3f8 !important;
  color: var(--ink);
}

.sidenav {
  background: #f9fbfd !important;
  border-right: 1px solid var(--line);
  box-shadow: none;
}

.sn-brand {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(16, 32, 51, 0.05);
}

.project-card {
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(16, 32, 51, 0.04);
}

.topbar {
  background: rgba(249, 251, 253, 0.96) !important;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.topbar-copy {
  flex: 1;
  min-width: 0;
}

.topbar-title {
  color: var(--ink);
  font-size: 1.28rem;
  letter-spacing: 0;
}

.topbar-sub {
  margin: 0.12rem 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1;
}

.topbar-btn:not(.ghost),
.btn-primary,
.new-chat-btn,
.sn-link.active {
  background: #003f8f !important;
  box-shadow: 0 10px 22px rgba(0, 53, 128, 0.16);
}

.content {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.42) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255,255,255,0.42) 0 1px, transparent 1px 100%),
    #eef3f8;
  background-size: 28px 28px;
}

.chat-card {
  background: #fff !important;
  border: 1px solid var(--line);
  box-shadow: 0 22px 60px rgba(16, 32, 51, 0.09);
}

.pro-chat-head,
.chat-card-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--brand-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.messages {
  background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
}

.empty-chat {
  width: min(720px, 100%);
  text-align: left;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.2rem;
}

.empty-chat picture {
  grid-row: span 2;
}

.empty-chat img {
  width: 70px;
  height: 70px;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.empty-chat h2 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(2rem, 4.8vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.prompt-suggestions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  width: 100%;
  margin-top: 0.4rem;
}

.prompt-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  min-height: 58px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(16, 32, 51, 0.05);
}

.prompt-chip span {
  min-width: 64px;
  padding: 0.32rem 0.48rem;
  border-radius: 999px;
  background: var(--sage-soft);
  color: #2f725b;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.prompt-chip:nth-child(2) span,
.prompt-chip:nth-child(4) span {
  background: var(--gold-soft);
  color: #8a5b1f;
}

.page-card,
.setting-card {
  background: #fff !important;
  border: 1px solid var(--line);
  box-shadow: 0 16px 44px rgba(16, 32, 51, 0.07);
}

.auth-card,
.auth-status-list > div,
.stat-card {
  background: #f9fbfd;
  border-color: var(--line);
}

.login-flow-modal {
  box-shadow: 0 28px 90px rgba(16, 32, 51, 0.24);
}

.app-shell {
  grid-template-columns: 256px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%) !important;
}

.sidenav {
  padding: 14px 12px;
  gap: 12px;
}

.chat-list-panel {
  min-height: 120px;
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.job-list.simple {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.topbar {
  min-width: 0;
  padding-inline: clamp(0.875rem, 2vw, 1.5rem);
}

.topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  padding: clamp(0.75rem, 2vw, 1.5rem);
}

.view-chat.active {
  height: 100%;
}

.chat-layout {
  width: min(1180px, 100%);
  height: 100%;
  margin: 0 auto;
}

.chat-card {
  height: min(860px, calc(100dvh - 96px));
  min-height: min(680px, calc(100dvh - 96px));
}

.chat-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.chat-head-status,
.conn-state {
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: #fff;
  padding: 0.35rem 0.6rem;
  white-space: nowrap;
}

.empty-chat {
  max-width: 640px;
  margin-inline: auto;
}

.empty-chat h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
}

.prompt-suggestions {
  width: min(620px, 100%);
}

.prompt-chip {
  width: 100%;
  text-align: left;
}

.composer-row {
  grid-template-columns: minmax(0, 1fr) 44px 44px minmax(172px, auto) !important;
}

.btn-send {
  white-space: nowrap;
}

.view-settings.active,
.view-media.active,
.view-history.active {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.settings-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
}

.auth-status-list {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.backup-details {
  grid-column: 1 / -1;
}

.login-flow-modal {
  padding: 0;
  border-radius: 10px;
}

.login-flow-card {
  padding: 1.5rem;
}

.login-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.login-steps li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.login-steps span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #eef5fb;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
}

.login-flow-card input:disabled {
  background: #f4f6f9;
  color: var(--muted);
}

.dlg-actions [hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .auth-status-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "content";
  }

  .sidenav {
    width: min(86vw, 304px);
    transform: translateX(-105%);
    border-right: 1px solid var(--border-light);
  }

  .sidenav.open {
    transform: translateX(0);
  }

  .content {
    padding: 0.75rem;
  }

  .chat-card {
    height: calc(100dvh - 88px);
    min-height: calc(100dvh - 88px);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .auth-status-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    height: 58px;
    padding-inline: 0.75rem;
  }

  .topbar-title {
    font-size: 1rem;
  }

  .topbar-btn {
    min-height: 38px;
    padding-inline: 0.65rem;
  }

  .content {
    height: calc(100dvh - 58px);
    padding: 0;
  }

  .chat-layout {
    width: 100%;
  }

  .chat-card {
    height: calc(100dvh - 58px);
    min-height: calc(100dvh - 58px);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .chat-card-head {
    padding: 0.85rem;
    flex-direction: column;
  }

  .messages {
    padding: 0.85rem;
  }

  .composer {
    padding: 0.75rem;
  }

  .dropzone {
    display: none;
  }

  .composer-row {
    grid-template-columns: minmax(0, 1fr) 42px 42px !important;
  }

  .icon-btn.attach-btn,
  .icon-btn.mic-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .btn-send {
    grid-column: 1 / -1;
    width: 100%;
  }

  .view-settings.active,
  .view-media.active,
  .view-history.active {
    padding: 0.75rem;
  }

  .auth-status-list {
    grid-template-columns: 1fr;
  }

  .setting-row-head {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .seg-btn {
    flex: 1;
  }

  .login-flow-card {
    padding: 1.1rem;
  }

  .dlg-actions {
    flex-direction: column-reverse;
  }

  .dlg-actions .btn {
    width: 100%;
  }
}
