/* ---------------------------------------------------------------------------
 * Franklin — Czech Labour Code Q&A
 *
 * Visual identity ported from C:\Users\mgout\franklin-frontend (a separate
 * React app not deployed). Layout and component shapes inherit from Sarah's
 * web/app/ since the chat surface, auth flows, and PWA shell are otherwise
 * identical. The variables below remap Sarah's `--purple*` tokens to
 * Franklin's blue palette so existing class names keep working without
 * per-rule edits.
 * ------------------------------------------------------------------------- */

:root {
  /* Franklin blue palette (sourced from franklin-frontend SignIn.jsx) */
  --purple: #3B7DED;          /* Franklin primary blue */
  --purple-dark: #2E6AD6;     /* Franklin blue hover/active */
  --purple-light: #E8F0FE;    /* Franklin blue tint (hover bg, decor) */

  /* Neutrals — match franklin-frontend exactly where they differ from Sarah */
  --text: #1A1A2E;            /* near-black, slight blue tint */
  --text-muted: #6B7280;      /* Franklin gray */
  --border: #E2E8F0;          /* Franklin light gray-blue */
  --bg: #FFFFFF;
  --grey-bubble: #FAFBFC;     /* Franklin's input/light bg */
  --danger: #E53E3E;          /* Franklin error red */

  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Franklin text/CSS logo (replaces Sarah's icon-192.png on login screens) */
.franklin-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.franklin-logo-icon {
  width: 56px;
  height: 56px;
  background-color: var(--purple);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 30px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: -0.02em;
}
.franklin-logo-text {
  font-size: 32px;
  font-weight: 600;
  color: var(--purple);
  letter-spacing: -0.02em;
}

/* Subtle blue circle decoration on login screen (from Franklin SignIn) */
#screen-login {
  position: relative;
  isolation: isolate;
}
#screen-login::before,
#screen-login::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
#screen-login::before {
  top: -50px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: linear-gradient(135deg, #E8F0FE 0%, #D4E4FC 100%);
  opacity: 0.7;
}
#screen-login::after {
  bottom: -40px;
  left: -60px;
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #C8D8F0 0%, #A8C4E8 100%);
  opacity: 0.5;
}
#screen-login > * {
  position: relative;
  z-index: 1;
}

/* Hide the "link your Telegram account" entry-point — Franklin has no
 * Telegram bot. The view-link sub-screen + its event handler stay in
 * place (removing them would break app.js's $('link-to-link') binding),
 * but users can no longer reach them.
 */
#link-to-link {
  display: none !important;
}

body {
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100dvh;
}

.hidden { display: none !important; }

/* ===================== LOGIN ===================== */

#screen-login {
  background: var(--bg);
  align-items: center;
  justify-content: flex-start;
  padding: calc(40px + var(--safe-top)) 24px var(--safe-bottom);
  overflow-y: auto;
}

.view {
  width: 100%;
  display: flex;
  justify-content: center;
}

.login-wrap {
  width: 100%;
  max-width: 420px;
  text-align: center;
  margin-top: 6vh;
  padding-bottom: 40px;
}

.login-links {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
}

.login-links a {
  color: var(--purple);
  text-decoration: none;
}

.login-links a:hover {
  text-decoration: underline;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 2px solid var(--border);
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-btn-wrap {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.form-message {
  color: var(--purple-dark);
  font-size: 14px;
  margin: 0;
  min-height: 20px;
  line-height: 1.4;
}

/* Menu panel */
.header-menu {
  margin-left: auto;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 10px;
}

.menu-panel {
  position: absolute;
  top: calc(60px + var(--safe-top));
  right: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  z-index: 10;
  overflow: hidden;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 12px 18px;
  background: #fff;
  border: none;
  text-align: left;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.menu-item:last-child { border-bottom: none; }

.menu-item:hover {
  background: var(--purple-light);
}

.menu-item-danger {
  color: var(--danger);
}

.menu-item-danger:hover {
  background: #fff4f4;
}

.login-logo {
  margin-bottom: 24px;
  display: inline-block;
}

.login-title {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}

.login-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0 0 40px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Generic inputs inside any login form */
.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
  font-size: 16px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
}

.login-form input:focus { border-color: var(--purple); }

/* Code-style inputs: centred, monospace, uppercase tracking */
#activate-code,
#reset-token,
#link-code {
  text-align: center;
  letter-spacing: 2px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  text-transform: uppercase;
  font-size: 18px;
}

.shake {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.code-error {
  color: var(--danger);
  font-size: 14px;
  margin: 0;
  min-height: 20px;
}

.btn-primary {
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 16px 18px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===================== CHAT ===================== */

#screen-chat {
  background: var(--bg);
}

.chat-header {
  background: var(--purple);
  color: #fff;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-logo { flex-shrink: 0; }

.header-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
}

.header-status {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
}

/* Banners */

.banner {
  background: var(--purple-light);
  color: var(--purple-dark);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.banner-text {
  flex: 1;
  line-height: 1.3;
}

.banner-btn {
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.banner-close {
  background: none;
  border: none;
  color: var(--purple-dark);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

/* Messages area */

.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.load-more-sentinel {
  height: 1px;
  flex-shrink: 0;
}

#messages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
}

.msg-out {
  align-self: flex-end;
  background: var(--purple);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.msg-in {
  align-self: flex-start;
  background: var(--purple-light);
  color: var(--purple-dark);
  border-bottom-left-radius: 6px;
}

/* Streaming bubble — blinking cursor while tokens arrive */
.msg-streaming::after {
  content: '▋';
  opacity: 1;
  animation: blink-cursor 0.7s step-end infinite;
  margin-left: 1px;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Scheduler-fired reminders stand out from normal chat replies so they're
   still findable when scrolling history. Brighter background, left accent. */
.msg-reminder {
  background: #FFF4D6;
  color: #5B3E00;
  border-left: 3px solid #E8A500;
  font-weight: 500;
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  padding: 0 4px;
}

.msg-out + .msg-time { text-align: right; }
.msg-in + .msg-time { text-align: left; }

/* Debug line below AI bubbles — tokens + cost for cost monitoring */
.msg-debug {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: 2px;
  padding: 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.msg-system {
  align-self: center;
  background: var(--grey-bubble);
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 14px;
  text-align: center;
  max-width: 85%;
}

/* Typing indicator */

.typing {
  align-self: flex-start;
  background: var(--purple-light);
  padding: 14px 16px;
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--purple);
  border-radius: 50%;
  opacity: 0.6;
  animation: typing-bounce 1.3s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.typing-thinking {
  font-size: 13px;
  color: var(--purple-dark);
  margin-left: 6px;
}

/* Recording indicator + waveform */

.recording-indicator {
  background: #faf8ff;
  color: var(--purple-dark);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.waveform {
  flex: 1;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.wf-bar {
  width: 4px;
  min-height: 6px;
  background: var(--purple);
  border-radius: 2px;
  transition: height 0.06s linear;
  flex-shrink: 0;
}

.recording-time {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--purple);
  min-width: 38px;
  text-align: right;
  flex-shrink: 0;
}

/* Transcribing indicator */

.transcribing-indicator {
  background: #faf8ff;
  color: var(--purple-dark);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.transcribing-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--purple);
  animation: transcribing-pulse 1.1s infinite ease-in-out;
}

@keyframes transcribing-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.7); }
}

/* Full-screen PWA install overlay — shown once per device until dismissed */

.pwa-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px calc(28px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pwa-overlay.hidden {
  display: none;
}

.pwa-overlay-content {
  max-width: 460px;
  width: 100%;
  color: #6A22FF;
  text-align: center;
}

.pwa-overlay-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: #6A22FF;
  line-height: 1.15;
}

.pwa-overlay-sub {
  font-size: 17px;
  line-height: 1.45;
  margin: 0 0 28px;
  color: #6A22FF;
  opacity: 0.9;
}

.pwa-overlay-section {
  margin: 0 0 22px;
  text-align: left;
}

.pwa-overlay-heading {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #6A22FF;
}

.pwa-overlay-steps {
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
  padding-left: 22px;
  color: #6A22FF;
}

.pwa-overlay-steps li {
  margin-bottom: 6px;
}

.pwa-overlay-steps strong {
  font-weight: 700;
}

.pwa-overlay-btn {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 16px 20px;
  background: #6A22FF;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(106, 34, 255, 0.28);
  -webkit-tap-highlight-color: transparent;
}

.pwa-overlay-btn:hover,
.pwa-overlay-btn:focus-visible {
  background: #5a12ef;
}

.pwa-overlay-btn:active {
  transform: scale(0.98);
}

/* Input bar */

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: #fff;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  font-size: 16px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s ease;
  min-width: 0;
  /* Auto-grow textarea */
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  min-height: 44px;            /* matches icon-btn height for single-line state */
  max-height: 160px;           /* roughly 6 lines — then the textarea scrolls */
  overflow-y: auto;
  box-sizing: border-box;
  -webkit-appearance: none;    /* kill iOS default textarea styling */
}

#chat-input:focus {
  border-color: var(--purple);
}

/* Buttons stay on the bottom row of the expanding textarea */
.chat-form-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s ease, background 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
}

.send-btn {
  background: var(--purple);
}

.mic-btn {
  background: #9E9EB0;
}

.mic-btn.recording {
  background: var(--danger);
}

.mic-btn.hidden { display: none; }

/* ===================== DESKTOP (>768px) ===================== */

/* ===================== SOURCE EXTRACT MODAL ===================== */

.source-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
}
.source-modal.hidden { display: none; }
.source-modal-content {
  background: #fff;
  border-radius: 14px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}
.source-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.source-modal-header > div { flex: 1; }
.source-modal-doc { font-weight: 600; font-size: 14px; color: var(--purple-dark); margin-bottom: 3px; }
.source-modal-section { font-size: 12px; color: var(--text-muted); }
.source-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.source-modal-close:hover { color: var(--text); }
.source-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--text);
}

/* ===================== SOURCES PANEL ===================== */

/* Mobile: panel hidden; inline toggle shown under each AI bubble */
.sources-panel { display: none; }

.msg-sources-toggle {
  font-size: 12px;
  color: var(--purple);
  cursor: pointer;
  margin-top: 5px;
  text-decoration: underline;
  display: inline-block;
}

.msg-sources-inline { margin-top: 6px; }
.msg-sources-inline.hidden { display: none; }

/* Shared source-doc group (Franklin-style: doc name header + chips) */
.source-doc-group { margin-bottom: 14px; }
.source-doc-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--purple-dark);
  margin-bottom: 6px;
}
.source-chip {
  display: inline-block;
  padding: 4px 10px;
  margin: 2px 4px 2px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
}
.source-chip:hover { background: var(--purple-light); border-color: var(--purple); }
.source-extract {
  display: none;
  margin-top: 6px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text);
}
.source-extract.open { display: block; }

/* Confidence badge */
.confidence-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.confidence-high { background: #e6f9ed; color: #1a7f37; }
.confidence-medium { background: #fff7e0; color: #8a5a00; }
.confidence-low { background: #fde8e8; color: #c53030; }

/* Clarification pill buttons */
.clarify-block { margin-top: 8px; }
.clarify-prompt {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.clarify-btn {
  display: inline-block;
  padding: 6px 14px;
  margin: 3px 4px 3px 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.clarify-btn:hover { background: var(--purple-light); border-color: var(--purple); }
.clarify-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (min-width: 769px) {
  body {
    background: #f4f2fa;
  }

  #screen-login {
    background: #f4f2fa;
    padding-top: 8vh;
  }

  .login-wrap {
    background: #fff;
    padding: 48px 40px;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(106, 34, 255, 0.08);
    margin-top: 4vh;
  }

  #screen-chat {
    background: #f4f2fa;
  }

  .chat-header {
    padding: calc(14px + var(--safe-top)) 0 14px;
    justify-content: center;
  }

  /* Chat uses the full available width on desktop — no max-width
     constraint. A source/context panel may be added later, which is
     when we'd re-introduce a sensible max-width. For now, fill the
     screen. */
  .chat-header,
  .messages,
  .chat-form,
  .recording-indicator,
  .transcribing-indicator,
  .banner {
    width: 100%;
  }

  .chat-header {
    border-radius: 0 0 16px 16px;
  }

  .messages {
    padding: 24px 20px 28px;
    gap: 12px;
  }

  #messages-list {
    gap: 12px;
  }

  .msg {
    max-width: 72%;
    font-size: 15px;
    line-height: 1.55;
    padding: 12px 18px;
    border-radius: 16px;
  }

  .msg-out { border-bottom-right-radius: 6px; }
  .msg-in {
    border-bottom-left-radius: 6px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
  }

  .msg-time {
    font-size: 11px;
  }

  /* Input bar — prominent search-bar style */
  .chat-form {
    padding: 16px 0 24px;
    border-top: none;
    background: transparent;
  }

  #chat-input {
    font-size: 15px;
    padding: 14px 20px;
    border-radius: 14px;
    border-width: 1px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }

  #chat-input:focus {
    box-shadow: 0 2px 16px rgba(106, 34, 255, 0.15);
  }

  .icon-btn {
    width: 42px;
    height: 42px;
  }

  /* Make mic secondary on desktop — smaller, muted */
  .mic-btn {
    width: 36px;
    height: 36px;
    opacity: 0.6;
  }
  .mic-btn:hover { opacity: 1; }

  /* PWA overlay — hidden on desktop */
  .pwa-overlay { display: none !important; }

  /* Notification banner — less intrusive */
  .banner {
    border-radius: 12px;
    margin-top: 8px;
  }

  /* Typing indicator */
  .typing {
    background: #fff;
    border: 1px solid var(--border);
  }

  /* Sources panel — desktop right column */
  .chat-body { flex-direction: row; }
  .messages { min-width: 0; width: auto; }  /* override the blanket width:100% above */
  .sources-panel {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px 14px;
    background: #fafaff;
  }
  .sources-panel.hidden { display: none; }
  .sources-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
  }
  .sources-panel-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }

  /* Hide mobile-only inline toggle on desktop */
  .msg-sources-toggle { display: none; }
  .msg-sources-inline { display: none !important; }
}
