/* =========================================================
   Filmore Shell — Stylesheet
   Clean, professional legal-tool aesthetic.
   No external fonts, no CDN dependencies.
   ========================================================= */

/* --------------------------------------------------------- */
/* Screen management                                          */
/* --------------------------------------------------------- */
.screen { display: flex; }
.hidden { display: none !important; }

.browser-autofill-proxy {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chat-screen {
  flex-direction: column;
  height: 100vh;
}

/* --------------------------------------------------------- */
/* Login screen                                               */
/* --------------------------------------------------------- */
.login-screen {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--color-bg);
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 36px 40px;
}

.login-logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 28px;
}

.login-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}

.login-description {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.field-group {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--color-text-muted);
  margin-bottom: 7px;
}

.field-optional {
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

.psk-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.psk-input,
.endpoint-input {
  width: 100%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.psk-input {
  padding-right: 42px;   /* room for the eye button */
}

.endpoint-input {
  font-family: var(--font-sans);
  font-size: 14px;
}

.psk-input:focus,
.endpoint-input:focus {
  border-color: var(--color-accent);
}

.toggle-visibility {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.toggle-visibility:hover { color: var(--color-text); }

.toggle-visibility svg {
  width: 16px;
  height: 16px;
}

.field-error {
  font-size: 12px;
  color: var(--color-error);
  margin-top: 10px;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.15s;
}

.field-error.visible { opacity: 1; }

.unlock-btn {
  width: 100%;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 11px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  margin-top: 4px;
}

.unlock-btn:hover:not(:disabled) { background: var(--color-accent-hover); }
.unlock-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.login-footer {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.trusted-profiles {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

.trusted-profiles.trusted-profiles-standalone {
  margin-top: 2px;
  padding-top: 0;
  border-top: 0;
}

.trusted-profiles-title {
  margin-bottom: 10px;
}

.trusted-profiles-subtext {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.trusted-profiles-error {
  margin-top: 0;
  margin-bottom: 10px;
}

.trusted-profiles-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trusted-profile-btn {
  background: var(--color-surface-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.trusted-profile-btn:hover {
  border-color: var(--color-accent);
  background: #27304b;
}

/* --------------------------------------------------------- */
/* Lock button (in header)                                    */
/* --------------------------------------------------------- */
.lock-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: border-color 0.15s, color 0.15s;
}

.lock-btn:hover {
  border-color: var(--color-error);
  color: var(--color-error);
}

.lock-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

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

:root {
  --color-bg:           #0f1117;
  --color-surface:      #1a1d27;
  --color-surface-alt:  #22263a;
  --color-border:       #2e3348;
  --color-text:         #e8eaf0;
  --color-text-muted:   #8b90a8;
  --color-accent:       #4f7ef8;
  --color-accent-hover: #6b94ff;
  --color-user-bg:      #1e2d4a;
  --color-assistant-bg: #1a1d27;
  --color-error:        #e05c5c;
  --color-success:      #4caf7d;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
  --radius:    8px;
  --header-h:  56px;
  --footer-h:  176px;
}

body.drag-active {
  cursor: copy;
}

html, body {
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

/* --------------------------------------------------------- */
/* Header                                                     */
/* --------------------------------------------------------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: -0.3px;
}

.tagline {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --------------------------------------------------------- */
/* Model selector                                             */
/* --------------------------------------------------------- */
.model-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.model-select {
  background: var(--color-surface-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.model-select:hover,
.model-select:focus {
  border-color: var(--color-accent);
}

.model-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------------------------------------------- */
/* Encryption status dot                                      */
/* --------------------------------------------------------- */
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: background 0.3s;
}

.status-secure  { background: var(--color-success); }
.status-error   { background: var(--color-error); }

/* --------------------------------------------------------- */
/* Chat container                                             */
/* --------------------------------------------------------- */
.chat-container {
  position: fixed;
  top: var(--header-h);
  bottom: var(--footer-h);
  left: 0; right: 0;
  overflow-y: auto;
  padding: 24px 0;
  scroll-behavior: smooth;
}

/* --------------------------------------------------------- */
/* Messages                                                   */
/* --------------------------------------------------------- */
.message {
  max-width: 760px;
  margin: 0 auto 16px;
  padding: 0 24px;
}

.message-content {
  background: var(--color-assistant-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.message-content strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.message-status {
  display: none;
  margin: -2px 0 10px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.message-warning {
  margin: -2px 0 12px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(202, 166, 75, 0.14);
  border: 1px solid rgba(202, 166, 75, 0.28);
  color: #f1d38a;
  font-size: 12px;
  line-height: 1.45;
}

.message-warning.hidden,
.message-status.hidden {
  display: none;
}

.message[data-message-status="system_interrupted_mid_text"] .message-content,
.message[data-message-status="user_interrupted"] .message-content {
  border-color: rgba(202, 166, 75, 0.34);
}

.message-body p {
  margin-bottom: 10px;
}

.message-body p:last-child {
  margin-bottom: 0;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.user-message .message-content {
  background: var(--color-user-bg);
  border-color: #2a3f6a;
}

.user-message .message-content strong {
  color: #8fb4ff;
}

.intro-message .message-content {
  border-color: var(--color-accent);
}

.security-note {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------- */
/* System messages                                            */
/* --------------------------------------------------------- */
.system-message {
  max-width: 760px;
  margin: 0 auto 12px;
  padding: 10px 24px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
}

.system-error {
  color: var(--color-error);
}

/* --------------------------------------------------------- */
/* Typing indicator                                           */
/* --------------------------------------------------------- */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-text-muted);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%           { transform: scale(1.0); opacity: 1.0; }
}

/* --------------------------------------------------------- */
/* Input area                                                 */
/* --------------------------------------------------------- */
.input-area {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 14px 24px 10px;
  transition: border-color 0.15s, background 0.15s;
}

.input-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
}

.input-area.drop-active {
  background: #1d2230;
  border-top-color: var(--color-accent);
}

.attachment-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.attachment-input {
  display: none;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 10px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  font-size: 12px;
  line-height: 1;
}

.attachment-chip.success {
  border-color: #3d4d79;
}

.attachment-chip.transcript-chip {
  max-width: 100%;
}

.user-message .attachment-chip.transcript-chip {
  background: rgba(19, 25, 44, 0.34);
  border-color: rgba(143, 180, 255, 0.28);
}

.attachment-chip.error {
  border-color: rgba(224, 92, 92, 0.5);
  color: #ffb0b0;
}

.attachment-chip-icon {
  color: #8fb4ff;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.attachment-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.attachment-chip-remove:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
}

.transcript-chip .attachment-chip-name {
  max-width: 320px;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-area.drop-active .input-wrapper,
.input-wrapper:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px rgba(79, 126, 248, 0.15);
}

.attach-btn,
.send-btn {
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s, color 0.15s, transform 0.15s;
}

.attach-btn {
  width: 30px;
  height: 30px;
  margin: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(221, 227, 255, 0.78);
  border: 1px solid rgba(119, 140, 219, 0.18);
}

.doc-vault-trigger-btn {
  background: rgba(255, 255, 255, 0.06);
}

.send-btn {
  width: 42px;
  height: 42px;
  align-self: center;
  border-radius: 12px;
}

.attach-btn svg,
.send-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.attach-btn svg {
  width: 15px;
  height: 15px;
}

.send-btn svg {
  width: 17px;
  height: 17px;
}

.attach-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
  transform: translateY(-1px);
}

.user-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  min-height: 24px;
  max-height: 200px;
  overflow-y: auto;
}

.user-input::placeholder {
  color: var(--color-text-muted);
}

.user-input:disabled {
  opacity: 0.6;
}

.send-btn {
  background: var(--color-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.send-btn[data-mode="stop"] {
  background: #b74d61;
}

.send-btn:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.send-btn[data-mode="stop"]:hover:not(:disabled) {
  background: #a34255;
}

.attach-btn:disabled,
.send-btn:disabled,
.send-btn.loading {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------------------------------------------- */
/* Round 2 FAB                                                */
/* --------------------------------------------------------- */
.fab-row {
  display: flex;
  gap: 8px;
  padding: 6px 16px 4px;
  background: transparent;
}
.round2-fab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 20px;
  background: var(--color-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(79, 126, 248, 0.35);
}
.round2-fab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.round2-fab:hover:not(:disabled) {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}
.round2-fab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.round2-fab.loading {
  opacity: 0.6;
  cursor: not-allowed;
}
.fab-placeholder {
  background: var(--color-surface-2, #1e2235);
  color: var(--color-text-muted);
  box-shadow: none;
  border: 1px solid var(--color-border);
  cursor: default;
}
.fab-placeholder:hover {
  background: var(--color-surface-2, #1e2235);
  transform: none;
}

.disclaimer {
  max-width: 760px;
  margin: 6px auto 0;
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
}

/* --------------------------------------------------------- */
/* Scrollbar styling                                          */
/* --------------------------------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* --------------------------------------------------------- */
/* E2EE Test Button                                           */
/* --------------------------------------------------------- */
.e2ee-test-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
  background: transparent;
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}
.e2ee-test-btn:hover {
  background: var(--color-accent);
  color: #fff;
}
.e2ee-test-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------------------------------------------- */
/* E2EE Self-Test Modal Overlay                               */
/* --------------------------------------------------------- */
.test-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.test-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 720px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.test-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.test-title.pass { color: #27ae60; }
.test-title.fail { color: #c0392b; }

.test-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 20px;
}
.test-table tr {
  border-bottom: 1px solid var(--color-border);
}
.test-table tr:last-child {
  border-bottom: none;
}
.test-icon {
  width: 28px;
  font-weight: 700;
  padding: 10px 0;
  vertical-align: top;
}
.test-row-pass .test-icon { color: #27ae60; }
.test-row-fail .test-icon { color: #c0392b; }

.test-name {
  width: 200px;
  font-weight: 600;
  padding: 10px 12px 10px 0;
  vertical-align: top;
  color: var(--color-text);
}
.test-detail {
  color: var(--color-text-muted);
  padding: 10px 0;
  vertical-align: top;
  line-height: 1.5;
}

.test-close-btn {
  display: block;
  margin-left: auto;
  padding: 8px 24px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.test-close-btn:hover {
  opacity: 0.88;
}

/* --------------------------------------------------------- */
/* Last Transmission Inspector modal                          */
/* --------------------------------------------------------- */
.tx-empty {
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
  padding: 24px 0;
}

.tx-section {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
}

.tx-section:last-of-type {
  border-bottom: none;
}

.tx-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px 0;
}

.tx-description {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.tx-value {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.72rem;
  background: #0d1117;
  color: #c9d1d9;
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
  margin: 0;
  border: 1px solid #30363d;
}

.tx-cipher { color: #79c0ff; }   /* blue  — encrypted data  */
.tx-plain  { color: #56d364; }   /* green — decrypted text  */
.tx-routing { color: #e3b341; }  /* amber — routing config  */

.auth-card {
  max-width: 560px;
}

.field-success {
  font-size: 12px;
  color: var(--color-success);
  margin-top: 5px;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.15s;
}

.field-success.visible { opacity: 1; }

.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px 0;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.auth-divider span {
  padding: 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  color: var(--color-text-muted);
}

.secondary-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, color 0.15s;
}

.secondary-auth-btn:hover:not(:disabled) {
  background: #27304b;
  border-color: var(--color-accent);
}

.secondary-auth-btn:disabled,
.secondary-auth-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.72;
  color: var(--color-text-muted);
}

.compact-btn {
  width: auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
}

.session-user-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
  }

  .session-user-pill {
    order: -1;
    width: 100%;
  }
}

/* -------------------------------------------------------------------------
   Brain bootstrap status + admin invite management UI
   ------------------------------------------------------------------------- */

.bootstrap-status-card {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(92, 122, 255, 0.24);
  background: rgba(15, 22, 48, 0.78);
  border-radius: 14px;
}

.bootstrap-status-text {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #eef3ff;
}

.bootstrap-detail-text {
  margin: 0;
  color: #b6c2ef;
  line-height: 1.6;
}

.admin-panel {
  margin: 18px 24px 0;
  padding: 22px;
  border-radius: 18px;
  background: rgba(10, 14, 28, 0.92);
  border: 1px solid rgba(107, 141, 255, 0.2);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

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

.admin-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-panel-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #eef3ff;
}

.admin-panel-copy {
  margin: 0;
  color: #9da9d6;
  max-width: 880px;
  line-height: 1.6;
}

.admin-section {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(107, 141, 255, 0.16);
  background: rgba(255, 255, 255, 0.025);
}

.admin-section-title {
  margin: 0 0 8px;
  font-size: 0.98rem;
  color: #eef3ff;
}

.admin-helper-text {
  margin: 10px 0 0;
  color: #9da9d6;
  font-size: 0.88rem;
  line-height: 1.5;
}

.admin-form {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(107, 141, 255, 0.16);
  background: rgba(255, 255, 255, 0.025);
}

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

.admin-field-group {
  margin-bottom: 0;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.admin-action-btn {
  width: auto;
  min-width: 180px;
  margin-top: 0;
  flex: 0 0 auto;
}

.admin-status {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 0.93rem;
  color: #9da9d6;
}

.admin-status.success {
  color: #95e0b2;
}

.admin-status.error {
  color: #ff9f9f;
}

.admin-list-section {
  margin-bottom: 12px;
}

.admin-list-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-table-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(107, 141, 255, 0.16);
  border-radius: 14px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.admin-table th {
  color: #eef3ff;
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
}

.admin-table td {
  color: #c7d1f2;
}

.admin-empty {
  text-align: center;
  color: #9da9d6;
}

.admin-table-actions {
  min-width: 138px;
}

.invite-action-btn {
  min-width: 120px;
  margin-top: 0;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel-header,
  .admin-form-actions,
  .admin-list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-action-btn {
    width: 100%;
  }
}

/* --------------------------------------------------------- */
/* Playbook unlock panel                                      */
/* --------------------------------------------------------- */
.playbook-section {
  margin-bottom: 0;
}

.playbook-grid {
  margin-top: 18px;
}

.playbook-status-card {
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  border-radius: 10px;
  padding: 16px 18px;
}

.playbook-status-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.playbook-status-text.success {
  color: var(--color-success);
}

.playbook-status-text.error {
  color: var(--color-error);
}

.playbook-detail-text {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

#playbook-key-file {
  padding: 10px 12px;
}

#playbook-key-file::file-selector-button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  margin-right: 12px;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .header {
    height: auto;
    min-height: var(--header-h);
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
    gap: 12px;
  }

  .header-right {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .chat-container {
    top: 96px;
  }
}

@media (max-width: 720px) {
  .header-right {
    align-items: stretch;
  }

  .model-selector-wrapper {
    width: 100%;
    justify-content: space-between;
  }

  .model-select,
  .secondary-auth-btn.compact-btn,
  .e2ee-test-btn {
    width: 100%;
  }
}

.playbook-editor-input {
  width: 100%;
  min-height: 360px;
  background: #0d1117;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

.playbook-editor-input:focus {
  border-color: var(--color-accent);
}

.playbook-editor-input::placeholder {
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------- */
/* Conversation history sandbox prototype                                     */
/* -------------------------------------------------------------------------- */
.chat-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  min-height: calc(100vh - 124px);
  padding: 0 28px 0;
}

.chat-main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.conversation-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(86, 121, 255, 0.22);
  border-radius: 18px;
  background: rgba(21, 25, 44, 0.88);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.24);
  z-index: 8;
}

.conversation-sidebar-header,
.history-summary-header,
.history-summary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.conversation-sidebar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.conversation-sidebar-kicker,
.history-summary-meta {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(142, 161, 255, 0.86);
}

.conversation-sidebar-title,
.history-summary-title {
  margin: 4px 0 0;
  font-size: 1rem;
  color: #f4f6ff;
}

.conversation-sidebar-copy {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(220, 227, 255, 0.72);
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: visible;
  padding: 4px 4px 6px 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.conversation-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.conversation-list-empty {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(122, 144, 255, 0.28);
  color: rgba(221, 228, 255, 0.72);
  font-size: 0.9rem;
}

.conversation-list-row {
  position: relative;
  z-index: 0;
}

.conversation-list-row:hover,
.conversation-list-row:focus-within {
  z-index: 2;
}

.conversation-list-item {
  width: 100%;
  text-align: left;
  padding: 15px 48px 13px 15px;
  border-radius: 16px;
  border: 1px solid rgba(95, 119, 222, 0.16);
  background: linear-gradient(180deg, rgba(34, 42, 76, 0.92), rgba(27, 34, 63, 0.96));
  color: #edf1ff;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.conversation-list-item:hover,
.conversation-list-item:focus-visible {
  border-color: rgba(122, 144, 255, 0.44);
  background: rgba(44, 54, 96, 0.96);
  transform: translateY(-1px);
}

.conversation-list-item.active {
  border-color: rgba(122, 144, 255, 0.78);
  background: linear-gradient(180deg, rgba(50, 62, 113, 0.96), rgba(35, 44, 84, 0.98));
  box-shadow: 0 0 0 1px rgba(122, 144, 255, 0.2), 0 18px 32px rgba(6, 10, 22, 0.28);
}

.conversation-menu-btn {
  position: absolute;
  top: 11px;
  right: 10px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(118, 136, 219, 0.18);
  border-radius: 8px;
  background: rgba(20, 26, 48, 0.84);
  color: rgba(228, 234, 255, 0.82);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  z-index: 3;
}

.conversation-menu-btn:hover,
.conversation-menu-btn:focus-visible,
.conversation-list-row:focus-within .conversation-menu-btn {
  border-color: rgba(122, 144, 255, 0.42);
  background: rgba(36, 45, 82, 0.96);
  color: #f4f6ff;
}

.conversation-menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 48;
  min-width: 112px;
  width: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(120, 138, 218, 0.24);
  background: rgba(14, 18, 34, 0.98);
  box-shadow: 0 20px 36px rgba(5, 8, 20, 0.38);
  pointer-events: auto;
}

.conversation-menu-overlay.rename-mode {
  min-width: 208px;
}

.conversation-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conversation-rename-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(106, 126, 212, 0.28);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(26, 33, 60, 0.92);
  color: #eef3ff;
  font: inherit;
}

.conversation-rename-input:focus {
  outline: none;
  border-color: rgba(122, 144, 255, 0.56);
  box-shadow: 0 0 0 3px rgba(80, 112, 255, 0.14);
}

.conversation-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conversation-menu-item {
  width: 100%;
  border: none;
  border-radius: 9px;
  padding: 8px 10px;
  background: transparent;
  color: #e8edff;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.conversation-menu-item:hover,
.conversation-menu-item:focus-visible {
  background: rgba(56, 67, 116, 0.58);
}

.conversation-menu-item.danger {
  color: #ffb7c2;
}

.conversation-menu-item.danger:hover,
.conversation-menu-item.danger:focus-visible {
  background: rgba(167, 63, 87, 0.2);
  color: #ffd3db;
}

.conversation-list-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.94rem;
  line-height: 1.35;
  font-weight: 600;
  color: #f4f6ff;
  margin-bottom: 8px;
}

.conversation-list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  color: rgba(204, 214, 255, 0.68);
}

.history-summary-panel {
  margin: 0 0 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(122, 144, 255, 0.22);
  background: rgba(21, 25, 44, 0.9);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.2);
}

.history-summary-input {
  width: 100%;
  min-height: 128px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(122, 144, 255, 0.18);
  background: rgba(31, 36, 63, 0.9);
  color: #f4f6ff;
  resize: vertical;
}

.prototype-message-meta {
  margin-top: 10px;
  font-size: 0.78rem;
  color: rgba(204, 214, 255, 0.68);
}

@media (max-width: 1080px) {
  .chat-workspace {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }

  .conversation-sidebar {
    position: static;
    max-height: none;
  }
}

.chat-workspace {
  margin-top: var(--header-h);
  padding-bottom: 20px;
}

.chat-workspace .chat-container {
  position: relative;
  top: auto;
  bottom: auto;
  left: auto;
  right: auto;
  flex: 1;
  min-height: 0;
  padding: 24px 0 calc(104px + env(safe-area-inset-bottom, 0px));
}

.chat-workspace .input-area {
  position: sticky;
  left: auto;
  right: auto;
  bottom: 0;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  margin-top: 14px;
}

.chat-workspace .input-shell,
.chat-workspace .message,
.chat-workspace .system-message {
  max-width: none;
}

.chat-workspace .message,
.chat-workspace .system-message {
  padding-left: 0;
  padding-right: 0;
}

.doc-retention-prompt {
  margin: 0;
  padding: 13px 15px;
  border: 1px solid rgba(122, 144, 255, 0.24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(24, 32, 54, 0.96), rgba(18, 24, 41, 0.98));
  box-shadow: 0 14px 28px rgba(4, 8, 18, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.doc-retention-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.doc-retention-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(143, 180, 255, 0.72);
}

.doc-retention-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(239, 244, 255, 0.92);
}

.doc-retention-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-self: center;
  flex: 0 0 auto;
}

.doc-retention-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  margin-top: 0;
  line-height: 1;
}

.doc-retention-actions > .unlock-btn.compact-btn,
.doc-retention-actions > .secondary-auth-btn.compact-btn {
  border-radius: 8px;
}

.doc-vault-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 14px);
  z-index: 14;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(9, 13, 26, 0.97);
  border: 1px solid rgba(107, 141, 255, 0.24);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.doc-vault-panel.hidden {
  display: none;
}

.doc-vault-panel-header,
.doc-vault-list-header,
.doc-vault-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.doc-vault-panel-header {
  margin-bottom: 12px;
}

.doc-vault-panel-title {
  margin: 0;
  color: #eef3ff;
  font-size: 1rem;
}

.doc-vault-panel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-vault-status {
  min-height: 0;
  margin: 0;
  font-size: 0.88rem;
}

.doc-vault-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.doc-vault-empty {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed rgba(122, 144, 255, 0.24);
  color: rgba(221, 228, 255, 0.72);
  font-size: 0.9rem;
}

.doc-vault-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(122, 144, 255, 0.16);
  background: rgba(26, 33, 60, 0.72);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.doc-vault-item:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 144, 255, 0.3);
}

.doc-vault-item.selected {
  border-color: rgba(122, 144, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(122, 144, 255, 0.14);
  background: rgba(40, 49, 88, 0.84);
}

.doc-vault-item.uploading {
  border-color: rgba(122, 144, 255, 0.42);
}

.doc-vault-item.failed {
  border-color: rgba(201, 102, 102, 0.42);
  background: rgba(58, 24, 32, 0.68);
}

.doc-vault-item input[type="checkbox"] {
  margin-top: 4px;
}

.doc-vault-item-body {
  min-width: 0;
  flex: 1 1 auto;
}

.doc-vault-item-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
  color: #f4f6ff;
}

.doc-vault-item-meta {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(204, 214, 255, 0.72);
}

.doc-vault-item-progress {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(122, 144, 255, 0.18);
  border-top-color: rgba(122, 144, 255, 0.86);
  flex-shrink: 0;
  animation: vault-spin 1s linear infinite;
}

.doc-vault-item-progress.failed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: rgba(201, 102, 102, 0.38);
  background: rgba(201, 102, 102, 0.14);
  color: rgba(255, 222, 222, 0.92);
  font-weight: 700;
  animation: none;
}

.doc-vault-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.doc-vault-multi-upload-btn {
  background: rgba(49, 83, 145, 0.74);
  border-color: rgba(111, 145, 214, 0.34);
  color: #d9e6ff;
}

.doc-vault-multi-upload-btn:hover,
.doc-vault-multi-upload-btn:focus-visible {
  background: rgba(58, 98, 170, 0.86);
  border-color: rgba(133, 164, 224, 0.44);
}

@keyframes vault-spin {
  to {
    transform: rotate(360deg);
  }
}

.composer-status-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid rgba(79, 126, 248, 0.2);
  border-radius: 999px;
  background: rgba(79, 126, 248, 0.1);
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.composer-status-bubble.hidden {
  display: none;
}

.composer-status-text {
  display: inline-block;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .doc-retention-prompt {
    flex-direction: column;
    align-items: stretch;
  }

  .composer-status-bubble {
    width: 100%;
  }

  .composer-status-text {
    white-space: normal;
  }

  .doc-vault-panel,
  .doc-vault-panel-header,
  .doc-vault-list-header,
  .doc-vault-actions {
    width: 100%;
  }

  .doc-vault-panel-header,
  .doc-vault-list-header,
  .doc-vault-actions,
  .doc-retention-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .doc-retention-actions > button {
    flex: 1 1 0;
  }
}

/* --------------------------------------------------------- */
/* Council (Legal Team) thought bubble UI                    */
/* --------------------------------------------------------- */

.council-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Council Thinking Header ─────────────────────────────────────────────── */
.council-header-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  min-height: 28px;
}

.council-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.council-thinking-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: council-dot-bounce 1.2s ease-in-out infinite;
}

.council-thinking-dot.dot-blue  { background: #4a9eff; animation-delay: 0s; }
.council-thinking-dot.dot-green { background: #3dba78; animation-delay: 0.2s; }
.council-thinking-dot.dot-amber { background: #e6a817; animation-delay: 0.4s; }

@keyframes council-dot-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%            { transform: scale(1.1); opacity: 1; }
}

.council-thinking-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.01em;
}

/* Merged completion pill: "💡 Thought for Xs  ↗" */
.council-thoughts-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.council-thoughts-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.92);
}
.council-thoughts-pill-icon {
  font-size: 0.9rem;
  line-height: 1;
}
.council-thoughts-pill-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}
.council-thoughts-pill-arrow {
  font-size: 0.72rem;
  opacity: 0.55;
  margin-left: 2px;
}

.council-seats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.council-seat {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-surface);
}

.council-seat[data-seat-status="thinking"],
.council-seat[data-seat-status="re-evaluating"],
.council-seat[data-seat-status="final_synthesis"] {
  border-color: var(--color-accent, #4a7cdc);
}

.council-seat[data-seat-status="done"] {
  border-color: var(--color-border);
  opacity: 0.85;
}

/* Rolling live cards — slide in from below */
.council-seats--live .council-seat {
  animation: council-card-in 0.25s ease both;
}

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

/* Oldest card fades when 3 are visible */
.council-seat--fading {
  opacity: 0.45 !important;
  transition: opacity 0.4s ease;
}

/* ── Rolling thought bubbles (live stream) ─────────────────────────────────── */
.council-bubbles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

/* Each bubble slides in from below */
.council-bubble {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--bubble-accent, #4a9eff);
  border-radius: 0 8px 8px 0;
  animation: bubble-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
  max-width: 560px;
  overflow: hidden;
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Oldest bubble slides up and fades out */
.council-bubble--exiting {
  animation: bubble-out 0.32s ease forwards !important;
  pointer-events: none;
}

@keyframes bubble-out {
  from { opacity: 1; transform: translateY(0);    max-height: 80px; margin-bottom: 6px; }
  to   { opacity: 0; transform: translateY(-14px); max-height: 0;   margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}

.council-bubble-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bubble-accent, #4a9eff);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.council-bubble-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
  word-break: break-word;
}
.council-seat[data-seat-status="error"] {
  border-color: #c0392b;
}

.council-seat-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  background: var(--color-surface);
  user-select: none;
  gap: 8px;
}

.council-seat-summary::-webkit-details-marker {
  display: none;
}

.council-seat-summary::before {
  content: "▶";
  font-size: 10px;
  color: var(--color-muted, #888);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.council-seat[open] > .council-seat-summary::before {
  transform: rotate(90deg);
}

.council-seat-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-text);
  flex: 1;
}

.council-seat-status {
  font-size: 0.75rem;
  color: var(--color-muted, #888);
  font-style: italic;
  flex-shrink: 0;
}

.council-seat[data-seat-status="thinking"] .council-seat-status,
.council-seat[data-seat-status="re-evaluating"] .council-seat-status,
.council-seat[data-seat-status="final_synthesis"] .council-seat-status {
  color: var(--color-accent, #4a7cdc);
}

.council-seat[data-seat-status="done"] .council-seat-status {
  color: #27ae60;
}

.council-seat[data-seat-status="error"] .council-seat-status {
  color: #c0392b;
}

.council-seat-body {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--color-text);
}

.council-seat-body p {
  margin: 0 0 8px;
}

.council-seat-body p:last-child {
  margin-bottom: 0;
}

.council-disagreement-banner {
  padding: 8px 12px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #856404;
}

.council-final-answer {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-surface);
}

.council-final-label {
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  letter-spacing: 0.02em;
}

.council-final-body {
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
}

.council-final-body p {
  margin: 0 0 10px;
}

.council-final-body p:last-child {
  margin-bottom: 0;
}

/* ── Council Opposition Label ────────────────────────────────────────────── */
.council-opposition-label {
  color: #e05a3a;
}

/* ── Council Vulnerability Section ───────────────────────────────────────── */
.council-vulnerability-section {
  border: 1px solid rgba(224, 90, 58, 0.35);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-surface);
  margin-top: 8px;
}

.council-vulnerability-label {
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #e05a3a;
  background: rgba(224, 90, 58, 0.08);
  border-bottom: 1px solid rgba(224, 90, 58, 0.25);
}

.council-vulnerability-body {
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
}

.council-vulnerability-body p {
  margin: 0 0 10px;
}

.council-vulnerability-body p:last-child {
  margin-bottom: 0;
}

.council-vulnerability-list {
  margin: 0;
  padding-left: 1.8rem;
  list-style-type: upper-alpha;
}

.council-vulnerability-list li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.council-vulnerability-list li:last-child {
  margin-bottom: 0;
}

/* ── Council Confidence Badge ─────────────────────────────────────────────── */
.council-confidence-badge {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 0.78rem;
}

.council-confidence-meter {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.council-confidence-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.council-confidence-fill[data-level="high"] { background: #4caf82; }
.council-confidence-fill[data-level="mid"]  { background: #e6a817; }
.council-confidence-fill[data-level="low"]  { background: #e05252; }

.council-confidence-label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.council-disagreements {
  margin: 0.5rem 0 0 0;
  padding-left: 1.1rem;
  color: rgba(255, 200, 100, 0.85);
  font-size: 0.77rem;
  line-height: 1.5;
}

.council-disagreements li {
  margin-bottom: 0.2rem;
}

/* ── Council Streaming Cursor ─────────────────────────────────────────────── */
.council-stream-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: rgba(100, 160, 255, 0.8);
  border-radius: 1px;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: council-cursor-blink 0.9s step-end infinite;
}

@keyframes council-cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Council Seat Status — Completed ─────────────────────────────────────── */
.council-seat-status--done {
  color: #3dba78 !important;
  font-weight: 600;
}

/* ── Council Thoughts Button ─────────────────────────────────────────────── */
.council-thoughts-btn {
  display: inline-flex;
  align-self: center;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.council-thoughts-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
}

.council-thoughts-btn-icon {
  font-size: 0.7rem;
  color: #7eb8ff;
}

/* ── Council Thoughts Sidebar ────────────────────────────────────────────── */
#council-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1100;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.council-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 92vw;
  height: 100dvh;
  background: #151c2c;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.council-sidebar--open {
  transform: translateX(0);
}

.council-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.02);
}

.council-sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

.council-sidebar-title-icon {
  color: #7eb8ff;
  font-size: 0.85rem;
}

.council-sidebar-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.council-sidebar-close:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

.council-sidebar-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.council-sidebar-timeline::-webkit-scrollbar { width: 4px; }
.council-sidebar-timeline::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.council-sidebar-entry {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.council-sidebar-entry-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.council-sidebar-entry-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.council-sidebar-entry-icon--claude {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #fff;
}

.council-sidebar-entry-icon--grok {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff;
}

.council-sidebar-entry-icon--gemini {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
}

.council-sidebar-entry-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.01em;
}

.council-sidebar-entry-body {
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.75);
}

.council-sidebar-entry-body p {
  margin: 0 0 0.6rem;
}

.council-sidebar-entry-body p:last-child {
  margin-bottom: 0;
}

/* Divider line between sidebar entries */
.council-sidebar-entry + .council-sidebar-entry {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Council Final Answer — Disagreements ───────────────────────────────── */
.council-final-disagreements {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 180, 50, 0.07);
  border: 1px solid rgba(255, 180, 50, 0.25);
  border-radius: 8px;
}
.council-final-disagreements-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 180, 50, 0.85);
  margin-bottom: 0.5rem;
}
.council-final-disagreement-item {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.72);
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.5;
}
.council-final-disagreement-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.council-final-disagreement-item::before {
  content: "⚑ ";
  color: rgba(255, 180, 50, 0.8);
}
