/* ==========================================================================
   AIBotDazzler OR 4.0 — Modern Glassmorphism Responsive Stylesheet
   Desktop Floating Shell & Mobile Full-Bleed App (100dvh)
   ========================================================================== */

:root {
  --main-color: #01386d;
  --main-color-soft: rgba(1, 56, 109, 0.14);
  --title-bg: rgba(1, 56, 109, 0.88);
  --chat-bg: rgba(10, 18, 34, 0.82);
  --title-text: #ffffff;
  --subtitle-text: #dbeafe;
  --info-text: #f1f5f9;
  --title-font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --subtitle-font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --surface-glass: rgba(15, 23, 42, 0.78);
  --surface-card: rgba(255, 255, 255, 0.08);
  --surface-card-hover: rgba(255, 255, 255, 0.14);
  --surface-drawer: rgba(15, 23, 42, 0.94);
  --border-glass: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.28);
  --text-muted: rgba(241, 245, 249, 0.74);
  --text-dim: rgba(241, 245, 249, 0.56);

  /* Unified Translucent Glass Controls */
  --btn-glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  --btn-glass-bg-hover: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.12));
  --btn-glass-bg-emphasis: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.11));
  --btn-glass-border: rgba(255, 255, 255, 0.24);
  --btn-glass-border-hover: rgba(255, 255, 255, 0.42);
  --btn-glass-border-emphasis: rgba(255, 255, 255, 0.38);
  --btn-glass-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;

  --shadow-shell: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12);
  --shadow-drawer: 0 20px 50px rgba(0, 0, 0, 0.6);
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--subtitle-font);
  color: var(--info-text);
  background-color: #090f1d;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom thin scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.38);
}

/* Dynamic Background Layer */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #0b1324;
  transition: background-image 0.35s ease;
}

.bg-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.07), transparent 55%),
              linear-gradient(180deg, rgba(6, 11, 23, 0.38) 0%, rgba(6, 11, 23, 0.65) 100%);
  pointer-events: none;
}

/* Main Desktop Stage */
.app-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.app-stage.is-fullscreen {
  padding: 0;
}

.app-stage.is-fullscreen .chat-shell,
body.is-embed .chat-shell {
  max-width: 100%;
  height: 100dvh;
  border-radius: 0;
}

body.is-embed .app-stage {
  padding: 0;
}

body.is-embed .chat-shell {
  border: none;
  box-shadow: none;
}

/* Floating Chat Shell */
.chat-shell {
  width: 100%;
  max-width: 980px;
  height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-shell);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: transparent;
  transition: max-width var(--transition-smooth), height var(--transition-smooth), border-radius var(--transition-smooth);
}

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--title-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  min-height: 68px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.bot-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.bot-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.brand-titles {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-family: var(--title-font);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--title-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  color: var(--title-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.brand-subtitle {
  margin: 0;
  font-family: var(--subtitle-font);
  font-size: 0.8rem;
  color: var(--subtitle-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.92;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pdf-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--btn-glass-bg);
  border: 1px solid var(--btn-glass-border);
  box-shadow: var(--btn-glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--title-text);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.pdf-status-pill:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
  transform: translateY(-1px);
}

.pdf-status-pill.is-off {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-muted);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  box-shadow: var(--btn-glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--title-text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.icon-btn:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn.is-active {
  background: var(--btn-glass-bg-emphasis);
  border-color: var(--btn-glass-border-hover);
  color: #ffffff;
}

.studio-trigger-btn {
  background: var(--btn-glass-bg-emphasis);
  border-color: var(--btn-glass-border-emphasis);
  padding: 0 12px;
}

.lang-pill-btn {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 10px;
}

/* Chat Viewport */
.chat-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--chat-bg);
  padding: 20px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  position: relative;
}

/* Welcome Empty State */
.welcome-stage {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  gap: 14px;
  max-width: 640px;
  align-self: center;
}

.welcome-logo {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  object-fit: contain;
  padding: 2px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.welcome-title {
  margin: 0;
  font-family: var(--title-font);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--info-text);
}

.welcome-desc {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.welcome-pdf-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 500;
}

.prompt-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.prompt-chip {
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  box-shadow: var(--btn-glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--info-text);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  text-align: left;
  max-width: 100%;
}

.prompt-chip:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
  transform: translateY(-1px);
}

/* Message Rows */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 100%;
  animation: msgFadeUp 0.22s ease-out;
}

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

.msg-row.is-user {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
}

.msg-bubble-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(78%, 680px);
  min-width: 0;
}

.msg-row.is-user .msg-bubble-col {
  align-items: flex-end;
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.94rem;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  position: relative;
}

.msg-row.is-bot .msg-bubble {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--info-text);
  border-bottom-left-radius: 6px;
}

.msg-row.is-user .msg-bubble {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

/* Markdown Styling inside Bot Bubbles */
.msg-bubble p {
  margin: 0 0 10px;
}
.msg-bubble p:last-child {
  margin-bottom: 0;
}
.msg-bubble ul,
.msg-bubble ol {
  margin: 6px 0 10px 18px;
  padding: 0;
}
.msg-bubble li {
  margin-bottom: 4px;
}
.msg-bubble h1,
.msg-bubble h2,
.msg-bubble h3,
.msg-bubble h4 {
  margin: 12px 0 6px;
  font-family: var(--title-font);
  line-height: 1.3;
}
.msg-bubble a {
  color: #f8fafc;
  text-decoration: underline;
}
.msg-bubble blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0 8px 8px 0;
}
.msg-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 0.86rem;
  display: block;
  overflow-x: auto;
}
.msg-bubble th,
.msg-bubble td {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  text-align: left;
}
.msg-bubble th {
  background: rgba(255, 255, 255, 0.1);
}
.msg-bubble code {
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: 0.86em;
  background: rgba(0, 0, 0, 0.34);
  padding: 2px 5px;
  border-radius: 5px;
}
.code-block-wrap {
  position: relative;
  margin: 10px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 10, 20, 0.85);
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.74rem;
  color: var(--text-muted);
}
.code-copy-btn {
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  color: #fff;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.code-copy-btn:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
}
.code-block-wrap pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
}
.code-block-wrap pre code {
  background: transparent;
  padding: 0;
}

/* Message Footer (Sources + Actions) */
.msg-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.msg-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  color: #f1f5f9;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.msg-action-btn:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
  color: #ffffff;
}

.source-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--btn-glass-bg);
  border: 1px solid var(--btn-glass-border);
  box-shadow: var(--btn-glass-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--info-text, #f8fafc);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.source-badge:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
  transform: translateY(-1px);
}

.msg-attachment-img {
  display: block;
  max-width: min(260px, 100%);
  max-height: 220px;
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: contain;
}

/* Typing indicator */
.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.72); opacity: 0.45; }
  40% { transform: scale(1); opacity: 1; }
}

/* Footer Composer */
.chat-footer {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--chat-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.chat-attachment-preview {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--btn-glass-border);
  font-size: 0.78rem;
  color: #f1f5f9;
}

.attachment-thumb {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
}

.attachment-name {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-xs {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-size: 0.85rem;
  border-radius: 7px;
}

.composer-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 10px 10px 10px 12px;
  min-height: 68px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.composer-box:focus-within {
  border-color: var(--btn-glass-border-hover);
  background: rgba(255, 255, 255, 0.13);
}

.composer-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  box-shadow: var(--btn-glass-shadow);
  color: #f8fafc;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.composer-icon-btn:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
}

.composer-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 22px;
  resize: none;
  min-height: 48px;
  max-height: 160px;
  padding: 2px 0;
  margin: 0;
  outline: none;
  align-self: center;
  overflow-y: auto;
}

.composer-input::placeholder {
  color: rgba(241, 245, 249, 0.56);
}

.send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--btn-glass-border-emphasis);
  background: var(--btn-glass-bg-emphasis);
  box-shadow: var(--btn-glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
  flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
}
.send-btn:active:not(:disabled) {
  transform: scale(0.97);
}
.send-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.footer-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.73rem;
  color: var(--text-dim);
  padding: 0 4px;
}

.footer-meta-bar a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-meta-bar a:hover {
  text-decoration: underline;
  color: #ffffff;
}

/* ==========================================================================
   Slide-Over Drawers (Builder Studio Left & User Panel Right)
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 8, 18, 0.62);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 50;
  width: min(460px, 100vw);
  background: var(--surface-drawer);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-drawer);
  transition: transform var(--transition-smooth);
}

.drawer-left {
  left: 0;
  border-right: 1px solid var(--border-glass);
  transform: translateX(-105%);
}

.drawer-right {
  right: 0;
  border-left: 1px solid var(--border-glass);
  transform: translateX(105%);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-title {
  margin: 0;
  font-family: var(--title-font);
  font-size: 1.04rem;
  font-weight: 700;
}

.drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
  flex-shrink: 0;
}

.drawer-tab-btn {
  flex: 1;
  min-width: fit-content;
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  box-shadow: var(--btn-glass-shadow);
  color: rgba(248, 250, 252, 0.90);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.drawer-tab-btn:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
  color: #ffffff;
}

.drawer-tab-btn.is-active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.16));
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: var(--btn-glass-shadow);
  color: #ffffff;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-pane.is-active {
  display: flex;
}

.drawer-footer {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-glass);
  background: rgba(2, 6, 18, 0.72);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* Form Controls & Cards inside Drawers */
.form-section-card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-heading {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(248, 250, 252, 0.88);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.form-control,
.form-select,
.form-textarea {
  width: 100%;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.86rem;
  padding: 9px 11px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--btn-glass-border-hover);
}

.form-select option {
  background: #0f172a;
  color: #f8fafc;
}

.form-textarea {
  resize: vertical;
  min-height: 82px;
  line-height: 1.45;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="color"].color-swatch {
  width: 38px;
  height: 36px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

input[type="range"].range-slider {
  width: 100%;
  accent-color: #f8fafc;
  cursor: pointer;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
}

.toggle-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #f8fafc;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  box-shadow: var(--btn-glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.btn:hover:not(:disabled) {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary,
.btn-emerald {
  background: var(--btn-glass-bg-emphasis);
  border-color: var(--btn-glass-border-emphasis);
}
.btn-primary:hover:not(:disabled),
.btn-emerald:hover:not(:disabled) {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
}

.btn-danger {
  background: var(--btn-glass-bg);
  border-color: var(--btn-glass-border);
  color: #f8fafc;
}
.btn-danger:hover:not(:disabled) {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.77rem;
  border-radius: 8px;
}

.btn-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* ==========================================================================
   OpenRouter Real-Time Models & Specs Card
   ========================================================================== */
.model-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.model-source-badge {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #f8fafc;
}

.model-source-badge.is-cache {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(248, 250, 252, 0.86);
}

.filter-pills {
  display: flex;
  gap: 6px;
}

.filter-pill {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  color: rgba(248, 250, 252, 0.88);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
  color: #ffffff;
}

.filter-pill.is-active {
  background: var(--btn-glass-bg-emphasis);
  border-color: var(--btn-glass-border-hover);
  box-shadow: var(--btn-glass-shadow);
  color: #ffffff;
}

.model-specs-card {
  background: rgba(2, 6, 23, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.model-specs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.model-specs-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #f8fafc;
}

.model-specs-id {
  font-family: Consolas, monospace;
  font-size: 0.73rem;
  color: rgba(248, 250, 252, 0.76);
  word-break: break-all;
}

.model-modality-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  white-space: nowrap;
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.spec-cell {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-label {
  font-size: 0.69rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
}

.spec-value.is-free {
  color: #ffffff;
}

.model-specs-desc {
  margin: 0;
  font-size: 0.77rem;
  line-height: 1.45;
  color: var(--text-muted);
  max-height: 82px;
  overflow-y: auto;
}

/* ==========================================================================
   PDF Knowledge Base / Source of Truth
   ========================================================================== */
.pdf-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.pdf-dropzone:hover,
.pdf-dropzone.is-dragover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.52);
}

.pdf-dropzone-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #f8fafc;
}

.pdf-dropzone-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.pdf-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pdf-progress-track {
  width: 100%;
  height: 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.pdf-progress-bar {
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.75);
  transition: width 0.2s ease;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.doc-info {
  min-width: 0;
  flex: 1;
}

.doc-name {
  font-weight: 600;
  font-size: 0.84rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-stats {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.doc-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* User Menu List */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-action-item {
  width: 100%;
  justify-content: flex-start;
  padding: 12px 14px;
  font-size: 0.88rem;
}

.prompt-card-btn {
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  box-shadow: var(--btn-glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f8fafc;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.prompt-card-btn:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
}

/* ==========================================================================
   Modals (Splash, About, Password, PDF Preview)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 88dvh;
}

.modal-card.is-wide {
  max-width: 720px;
}

.splash-hero {
  position: relative;
  padding: 28px 24px 20px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.splash-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: transparent;
  border-radius: 18px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-title {
  margin: 0;
  font-family: var(--title-font);
  font-size: 1.08rem;
  font-weight: 700;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.pdf-preview-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #e2e8f0;
  background: rgba(2, 6, 23, 0.7);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-height: 55dvh;
  overflow-y: auto;
}

.pdf-page-block {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.pdf-page-block.is-highlighted {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
}

.pdf-page-label {
  font-weight: 700;
  font-size: 0.76rem;
  color: #ffffff;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Preset & Template Pills */
.preset-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.preset-pill {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--btn-glass-border);
  background: var(--btn-glass-bg);
  box-shadow: var(--btn-glass-shadow);
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.preset-pill:hover {
  background: var(--btn-glass-bg-hover);
  border-color: var(--btn-glass-border-hover);
  transform: translateY(-1px);
}

.preset-pill.is-active {
  background: var(--btn-glass-bg-emphasis);
  border-color: var(--btn-glass-border-hover);
}

.conv-card.is-active {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  color: #f8fafc;
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 9px;
  animation: toastIn 0.2s ease-out;
}

.toast-item.is-success { border-left: 4px solid rgba(255, 255, 255, 0.72); }
.toast-item.is-error { border-left: 4px solid rgba(255, 255, 255, 0.5); }
.toast-item.is-info { border-left: 4px solid rgba(255, 255, 255, 0.65); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Surface Isolation (Drawers/Modals) & Light-Glass Adaptive Overrides
   ========================================================================== */
.drawer,
.modal-overlay {
  --title-text: #ffffff;
  --subtitle-text: #cbd5e1;
  --info-text: #f1f5f9;
  --text-muted: rgba(241, 245, 249, 0.84);
  --text-dim: rgba(241, 245, 249, 0.64);
  --btn-glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  --btn-glass-bg-hover: linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.14));
  --btn-glass-bg-emphasis: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.15));
  --btn-glass-border: rgba(255, 255, 255, 0.24);
  --btn-glass-border-hover: rgba(255, 255, 255, 0.45);
  --btn-glass-border-emphasis: rgba(255, 255, 255, 0.44);
  --btn-glass-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.drawer .icon-btn,
.modal-card .icon-btn {
  color: #f8fafc;
}

body.is-light-title .chat-header {
  border-bottom-color: rgba(15, 23, 42, 0.12);
  --btn-glass-bg: linear-gradient(135deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.04));
  --btn-glass-bg-hover: linear-gradient(135deg, rgba(15, 23, 42, 0.15), rgba(15, 23, 42, 0.08));
  --btn-glass-bg-emphasis: linear-gradient(135deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.09));
  --btn-glass-border: rgba(15, 23, 42, 0.22);
  --btn-glass-border-hover: rgba(15, 23, 42, 0.38);
  --btn-glass-border-emphasis: rgba(15, 23, 42, 0.34);
  --btn-glass-shadow: 0 3px 10px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
body.is-light-title .chat-header .version-chip {
  background: rgba(15, 23, 42, 0.09);
  border-color: rgba(15, 23, 42, 0.18);
}
body.is-light-title .chat-header .bot-avatar-wrap {
  border-color: rgba(15, 23, 42, 0.18);
}
body.is-light-title .chat-header .icon-btn.is-active {
  color: #0f172a;
}

body.is-light-chat .chat-body,
body.is-light-chat .chat-footer {
  --btn-glass-bg: linear-gradient(135deg, rgba(15, 23, 42, 0.09), rgba(15, 23, 42, 0.04));
  --btn-glass-bg-hover: linear-gradient(135deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.09));
  --btn-glass-bg-emphasis: linear-gradient(135deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.10));
  --btn-glass-border: rgba(15, 23, 42, 0.22);
  --btn-glass-border-hover: rgba(15, 23, 42, 0.38);
  --btn-glass-border-emphasis: rgba(15, 23, 42, 0.34);
  --btn-glass-shadow: 0 3px 10px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
body.is-light-chat .welcome-logo,
body.is-light-chat .msg-avatar {
  border-color: rgba(15, 23, 42, 0.16);
}
body.is-light-chat .welcome-pdf-note {
  background: rgba(15, 23, 42, 0.07);
  border-color: rgba(15, 23, 42, 0.18);
  color: #0f172a;
}
body.is-light-chat .msg-row.is-bot .msg-bubble {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(15, 23, 42, 0.14);
  color: var(--info-text);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
body.is-light-chat .msg-row.is-user .msg-bubble {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.90), rgba(30, 41, 59, 0.84));
  border-color: rgba(15, 23, 42, 0.25);
  color: #ffffff;
}
body.is-light-chat .msg-bubble a {
  color: inherit;
  font-weight: 600;
}
body.is-light-chat .msg-action-btn,
body.is-light-chat .msg-action-btn:hover,
body.is-light-chat .source-badge,
body.is-light-chat .prompt-chip {
  color: #0f172a;
}
body.is-light-chat .chat-footer {
  background: var(--chat-bg);
  border-top-color: rgba(15, 23, 42, 0.12);
}
body.is-light-chat .chat-attachment-preview {
  background: rgba(15, 23, 42, 0.07);
  border-color: rgba(15, 23, 42, 0.18);
  color: #0f172a;
}
body.is-light-chat .composer-box {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.20);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
body.is-light-chat .composer-box:focus-within {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.38);
}
body.is-light-chat .composer-input {
  color: #0f172a;
}
body.is-light-chat .composer-input::placeholder {
  color: rgba(15, 23, 42, 0.54);
}
body.is-light-chat .composer-icon-btn,
body.is-light-chat .send-btn {
  color: #0f172a;
}
body.is-light-chat .footer-meta-bar,
body.is-light-chat .footer-meta-bar a {
  color: rgba(15, 23, 42, 0.72);
}
body.is-light-chat .footer-meta-bar a:hover {
  color: #0f172a;
}

.is-hidden {
  display: none !important;
}

/* ==========================================================================
   Mobile & Tablet Responsiveness (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .app-stage {
    padding: 0;
  }

  .chat-shell {
    max-width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .chat-header {
    padding: 10px 12px;
    min-height: 60px;
  }

  .bot-avatar-wrap {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

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

  .brand-subtitle {
    font-size: 0.74rem;
  }

  .hide-on-mobile {
    display: none !important;
  }

  .chat-body {
    padding: 14px 12px 10px;
  }

  .msg-bubble-col {
    max-width: 86%;
  }

  .msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .drawer {
    width: 100vw;
  }

  .field-row-2,
  .btn-grid-2,
  .btn-grid-3 {
    grid-template-columns: 1fr;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    max-width: none;
  }
}


/* ==========================================================================
   Phase 2: Studio Multi-Bot Workspace, Auth & Admin Panel
   ========================================================================== */
.studio-workspace-bar {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.studio-user-row,
.studio-bot-row,
.studio-new-bot-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.studio-user-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(59, 130, 246, 0.22);
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-bot-select {
  flex: 1;
  min-width: 0;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 0.84rem;
}

.studio-new-bot-inline {
  margin-top: 2px;
}

.studio-new-bot-inline .form-control {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-size: 0.84rem;
}

.studio-slug-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.2s ease;
}

.studio-slug-box.is-disabled {
  opacity: 0.52;
}

.studio-login-hint {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
}

.admin-modal-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(68vh, 620px);
  overflow-y: auto;
}

.admin-tab-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.admin-tab-pane.is-active {
  display: flex;
}

.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-inline-form .form-control {
  flex: 1;
  min-width: 180px;
}

.admin-inline-form .form-select {
  width: auto;
  min-width: 150px;
}

.admin-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-list-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-list-card.is-current {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.1);
}

.admin-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-card-title {
  font-weight: 700;
  font-size: 0.94rem;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-card-meta {
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.75);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.role-badge.is-super {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.45);
}

.role-badge.is-published {
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.4);
}

.role-badge.is-inactive {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
}

.bot-unavailable-card {
  margin: 24px auto;
  max-width: 480px;
  padding: 22px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #f8fafc;
  text-align: center;
}
