/* ============================================================
   Shared base — used by every view (titlebar, resets, buttons)
   ============================================================ */

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

body {
  background: #040404;
  font-family: 'Inter', sans-serif;
  color: white;
  height: 100vh;
  overflow: hidden;
  -webkit-app-region: no-drag;
}

/* Titlebar */
.titlebar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
  -webkit-app-region: drag;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 5px;
  -webkit-app-region: no-drag;
  margin-left: -10px;
}

.titlebar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

.titlebar-right {
  display: flex;
  align-items: center;
  -webkit-app-region: no-drag;
}

.docs-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
  -webkit-app-region: no-drag;
  margin-right: 8px;
}

.docs-link-btn:hover { background: rgba(131, 131, 131, 0.1); }

.app-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.3px;
}

.app-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.app-version {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.app-publisher {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}

.titlebar-logo {
  width: 22px;
}

.window-control-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
  -webkit-app-region: no-drag;
}

.window-control-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================================
   Auth view (Create / Connect)
   ============================================================ */

/* Main layout */
.main {
  position: fixed;
  top: 40px; left: 0; right: 0; bottom: 0;
  display: flex;
}

/* Left panel */
.left-panel {
  width: 50%;
  background: #0a0a0a;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.left-panel-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 30%, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.left-panel-tag {
  position: absolute;
  top: 32px;
  left: 40px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.left-panel-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 20px;
}

.left-panel-visual img {
  width: 20%;
  max-width: 100px;
  opacity: 0.9;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
}

.left-panel-title {
  font-size: 26px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 10px;
}

.left-panel-title span {
  color: rgba(255,255,255,0.4);
  font-weight: 400;
}

.left-panel-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  line-height: 1.6;
  white-space: nowrap;
}

/* Right panel */
.right-panel {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #040404;
  position: relative;
  overflow: hidden;
}

.card {
  width: 100%;
  max-width: 520px;
  padding: 0 32px;
}

/* Section heading */
.view-title {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.view-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 28px;
}

/* Mnemonic grid */
.mnemonic-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.mnemonic-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.word-input-wrapper { position: relative; }

.word-number {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
  z-index: 1;
}

.word-input {
  width: 100%;
  padding: 22px 8px 8px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'Inter', sans-serif;
  text-transform: lowercase;
}

.word-input::placeholder { color: rgba(255, 255, 255, 0.2); }

.word-input:focus {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.word-input.valid { border-color: rgba(255, 255, 255, 0.15); }

.word-input.invalid {
  border-color: rgba(255, 80, 80, 0.5);
  animation: shake 0.25s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Connect method toggle link */
.connect-method-toggle {
  display: block;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  text-decoration: underline;
  cursor: pointer;
  margin-top: 14px;
  background: none;
  border: none;
  width: 100%;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s;
}

.connect-method-toggle:hover { color: rgba(255, 255, 255, 0.6); }

/* Form fields */
.field {
  margin-bottom: 12px;
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.field-row .field-input { margin-bottom: 0; flex: 1; }

.field-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.field-input::placeholder { color: rgba(255, 255, 255, 0.25); }

.field-input:focus {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

/* Password field with visibility toggle */
.password-field { position: relative; }

.password-field .field-input { padding-right: 42px; }

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.password-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
}

/* Send code button */
.send-btn {
  padding: 0 16px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.send-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.9);
}

.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Terms row */
.terms-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.terms-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: white;
  flex-shrink: 0;
}

.terms-row label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  line-height: 1.4;
}

.terms-row a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
}

/* Primary action button */
.action-btn {
  width: 100%;
  padding: 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
  letter-spacing: 0.2px;
}

.action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.95);
}

.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Bottom legal links */
.legal-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.legal-links a {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
  transition: color 0.15s;
}

.legal-links a:hover { color: rgba(255, 255, 255, 0.5); }

/* Tab switcher */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  letter-spacing: 0.2px;
}

.tab-btn.active {
  color: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

.tab-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.6);
}

/* View panels */
.view { display: none; }
.view.active { display: block; }

/* ============================================================
   Dashboard view (sessions / messaging / verification)
   ============================================================ */

/* Main layout */
.tx-container {
  position: fixed;
  top: 52px; left: 0; right: 0; bottom: 12px;
  display: flex;
  flex-direction: column;
  padding: 12px 20px;
  overflow: hidden;
}

/* Split panel */
.tx-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  background: #040404;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
}

/* Left: sessions list */
.sessions-col {
  width: 240px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
  transition: width 0.2s ease;
}
.sessions-col.collapsed { width: 0; border-right: none; }
.sessions-col.collapsed .sessions-list,
.sessions-col.collapsed .sessions-col-header { display: none; }

.sessions-col-header {
  padding: 10px 14px 8px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25); text-transform: uppercase;
  flex-shrink: 0;
}


.sessions-list {
  flex: 1; overflow-y: auto;
  scrollbar-width: none;
}
.sessions-list::-webkit-scrollbar { display: none; }

.sessions-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  color: rgba(255,255,255,0.2); font-size: 12px;
}
.sessions-empty i { font-size: 20px; opacity: 0.4; }

.session-item {
  display: flex; align-items: center;
  padding: 9px 14px; cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.session-item:last-child { border-bottom: none; }
.session-item:hover { background: rgba(255,255,255,0.03); }
.session-item.active { background: rgba(255,255,255,0.92); }
.session-item.active .session-partner { color: #000; }

.session-info { flex: 1; min-width: 0; }
.session-time {
  font-size: 10px; color: rgba(255,255,255,0.3);
  margin-bottom: 2px;
}
.session-item.active .session-time { color: rgba(0,0,0,0.4); }
.session-unread-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.8); flex-shrink: 0;
  display: none;
}
.session-item.unread .session-unread-dot { display: block; }
.session-partner {
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sessions-search-wrap {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sessions-search-icon {
  font-size: 10px; color: rgba(255,255,255,0.2); flex-shrink: 0;
}
.sessions-search-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 11px; font-family: 'Inter', sans-serif;
  color: rgba(255,255,255,0.7);
}
.sessions-search-input::placeholder { color: rgba(255,255,255,0.18); }

/* Center: messages */
.messages-col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Floating chat input */
.chat-input-wrap {
  position: absolute;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 32px));
  pointer-events: none;
  z-index: 10;
  display: none;
}

.chat-command-wrap {
  background: #0e0e0e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  display: flex; flex-direction: column;
  padding: 0 14px;
  pointer-events: all;
  transition: border-color 0.2s, background 0.2s;
}
.chat-command-wrap:focus-within {
  border-color: rgba(255,255,255,0.22);
  background: #111;
}

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

.chat-textarea {
  flex: 1;
  background: transparent; border: none; outline: none;
  color: rgba(255,255,255,0.9);
  font-size: 13px; font-family: 'Inter', sans-serif;
  resize: none; padding: 13px 0;
  max-height: 120px; line-height: 1.5;
  scrollbar-width: none;
}
.chat-textarea::-webkit-scrollbar { display: none; }
.chat-textarea::placeholder { color: rgba(255,255,255,0.2); }

.chat-send-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.35);
  cursor: pointer; font-size: 14px;
  padding: 5px 9px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: color 0.15s, border-color 0.15s;
}
.chat-send-btn:hover:not(:disabled) { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.35); }
.chat-send-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.chat-attach-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.25);
  cursor: pointer; font-size: 14px;
  padding: 5px 7px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: color 0.15s;
}
.chat-attach-btn:hover { color: rgba(255,255,255,0.65); }
.chat-attach-btn:disabled { opacity: 0.25; cursor: not-allowed; }

/* Element composer */
.chat-compose-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.25);
  cursor: pointer; font-size: 14px;
  padding: 5px 7px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: color 0.15s;
}
.chat-compose-btn:hover { color: rgba(255,255,255,0.65); }
.chat-compose-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.chat-compose-btn.active { color: rgba(255,255,255,0.8); }

.compose-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: #111;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px;
  width: 220px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: all;
}
.compose-popup.open { display: flex; }
.compose-popup-title {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25); text-transform: uppercase;
  padding: 0 2px 4px;
}
.compose-type-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.compose-type-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px; padding: 8px 6px;
  color: rgba(255,255,255,0.6); font-size: 11px;
  font-family: 'Inter', sans-serif;
  cursor: pointer; text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.compose-type-btn i { font-size: 14px; color: rgba(255,255,255,0.3); }
.compose-type-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.9); }
.compose-type-btn:hover i { color: rgba(255,255,255,0.7); }
.compose-type-btn.selected { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.95); }
.compose-type-btn.selected i { color: rgba(255,255,255,0.8); }

.compose-form {
  display: none; flex-direction: column; gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 8px; margin-top: 2px;
}
.compose-form.open { display: flex; }
.compose-field-label {
  font-size: 10px; color: rgba(255,255,255,0.3);
  font-weight: 500; letter-spacing: 0.04em; margin-bottom: 2px;
}
.compose-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px; padding: 7px 9px;
  color: rgba(255,255,255,0.85); font-size: 12px;
  font-family: 'Inter', sans-serif; width: 100%; outline: none;
  transition: border-color 0.15s;
}
.compose-input:focus { border-color: rgba(255,255,255,0.22); }
.compose-input::placeholder { color: rgba(255,255,255,0.18); }
.compose-send-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 7px 10px;
  color: rgba(255,255,255,0.8); font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer; transition: background 0.15s;
  margin-top: 2px;
}
.compose-send-btn:hover { background: rgba(255,255,255,0.12); }
.compose-back-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.25); font-size: 11px;
  font-family: 'Inter', sans-serif;
  cursor: pointer; text-align: left; padding: 0;
  display: flex; align-items: center; gap: 4px;
  transition: color 0.15s;
}
.compose-back-btn:hover { color: rgba(255,255,255,0.6); }

.chat-file-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 0;
}
.chat-file-preview-name {
  font-size: 11px; color: rgba(255,255,255,0.6);
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-file-preview-remove {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.25); font-size: 11px; padding: 0;
  transition: color 0.15s; flex-shrink: 0;
}
.chat-file-preview-remove:hover { color: rgba(255,255,255,0.6); }

/* Right: agent sidebar */
.agent-col {
  width: 260px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-left: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
  transition: width 0.2s ease;
}


/* Collapsible sidebar sections — exclusive accordion */
.sidebar-section {
  flex-shrink: 0;
  display: flex; flex-direction: column;
}
.sidebar-section.open {
  flex: 1; min-height: 0;
}
.sidebar-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer; user-select: none;
  flex-shrink: 0;
  transition: background 0.15s;
}
.sidebar-section-header:hover { background: rgba(255,255,255,0.03); }
.sidebar-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25); text-transform: uppercase;
}
.sidebar-section-chevron {
  font-size: 9px; color: rgba(255,255,255,0.2);
  transition: transform 0.2s;
}
.sidebar-section.open .sidebar-section-chevron { transform: rotate(180deg); }
.sidebar-section-body {
  display: none; flex: 1; min-height: 0;
  flex-direction: column; overflow: hidden;
}
.sidebar-section.open .sidebar-section-body {
  display: flex;
}
#new-session-section { border-bottom: none; border-top: 1px solid rgba(255,255,255,0.06); margin-top: auto; flex-shrink: 0; }
#new-session-section.open { flex: 1; flex-direction: column-reverse; }
#new-session-section .sidebar-section-header { background: rgba(255,255,255,0.92); flex-shrink: 0; }
#new-session-section .sidebar-section-header:hover { background: rgba(255,255,255,0.96); }
#new-session-section .sidebar-section-label { color: rgba(0,0,0,0.75) !important; }
#new-session-section .sidebar-section-chevron { color: rgba(0,0,0,0.4) !important; }
#new-session-section.open .sidebar-section-chevron { transform: rotate(180deg); }

/* Session info fields */
#session-info-section .sidebar-section-body {
  overflow-y: auto; scrollbar-width: none;
}
#session-info-section .sidebar-section-body::-webkit-scrollbar { display: none; }
.session-info-fields {
  padding: 0 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.session-info-field {
  display: flex; flex-direction: column; gap: 3px;
}
.session-info-field-label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.2); text-transform: uppercase;
}
.session-info-field-value {
  font-size: 11px; color: rgba(255,255,255,0.55);
  line-height: 1.4; word-break: break-word;
}
.session-info-empty {
  font-size: 11px; color: rgba(255,255,255,0.18);
  padding: 0 14px 12px; font-style: italic;
}

/* MCP Server section */
.mcp-body {
  padding: 10px 14px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.mcp-install-notice {
  display: flex; flex-direction: column; gap: 10px;
}
.mcp-setup-step {
  display: flex; flex-direction: column; gap: 5px;
}
.mcp-install-text {
  font-size: 10px; color: rgba(255,255,255,0.3); line-height: 1.4;
  display: flex; align-items: center; gap: 5px;
}
.mcp-step-num {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  font-size: 9px; font-weight: 600; color: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
}
.mcp-install-cmd-row {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px; padding: 5px 8px;
}
.mcp-install-cmd {
  flex: 1; font-size: 11px; font-family: monospace;
  color: rgba(255,255,255,0.6);
  word-break: break-all;
  min-width: 0;
}
.mcp-copy-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.25); font-size: 11px; padding: 0;
  transition: color 0.15s; flex-shrink: 0;
}
.mcp-copy-btn:hover { color: rgba(255,255,255,0.7); }

/* Settings modal */
.settings-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}
.settings-modal.open { display: flex; }
.settings-modal-content {
  background: rgba(10,10,10,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 24px;
  width: 400px;
  max-width: calc(100% - 40px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .settings-modal-content { width: 100%; padding: 18px; gap: 16px; }
}
.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.settings-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
}
.settings-modal-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4); font-size: 14px;
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.settings-modal-close:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}
.settings-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.settings-status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  transition: background 0.3s;
}
.settings-status-dot.verified { background: #4ade80; }
.settings-status-dot.pending { background: rgba(255,180,80,0.8); }

.settings-verified-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  padding: 9px 12px;
}
.settings-verified-notice i { color: #4ade80; }

.settings-mnemonic-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}
.settings-mnemonic-blur {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 20px 14px;
  text-align: center;
}
.settings-mnemonic-text {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
  word-spacing: 4px;
  filter: blur(6px);
  user-select: none;
  transition: filter 0.2s;
}
.settings-mnemonic-blur.revealed .settings-mnemonic-text {
  filter: none;
  user-select: text;
}
.settings-mnemonic-reveal-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.settings-mnemonic-reveal-btn:hover { background: rgba(255,255,255,0.14); }

.settings-key-wrap {
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px;
  max-height: 140px;
  overflow-y: auto;
}
.settings-key-text {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255,255,255,0.7);
  word-spacing: normal;
  white-space: pre-wrap;
  word-break: break-all;
  text-align: left;
}
.settings-mnemonic-blur.revealed .settings-mnemonic-reveal-btn { display: none; }

.settings-mnemonic-actions {
  display: flex;
  gap: 8px;
}
.settings-secondary-btn {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 8px 0;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.settings-secondary-btn:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.95); }

.settings-danger-btn {
  background: rgba(255,80,80,0.08);
  border: 1px solid rgba(255,80,80,0.25);
  color: rgba(255,120,120,0.9);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 8px 0;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.settings-danger-btn:hover { background: rgba(255,80,80,0.14); color: rgba(255,140,140,1); }
.settings-danger-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sidebar-toggle-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.25); cursor: pointer;
  font-size: 11px; padding: 0; line-height: 1;
  transition: color 0.15s; flex-shrink: 0;
}
.sidebar-toggle-btn:hover { color: rgba(255,255,255,0.65); }
.messages-header {
  padding: 8px 12px;
  min-height: 37px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.messages-header-title {
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.7);
  white-space: nowrap;
}
.messages-header-session-id {
  font-size: 11px; color: rgba(255,255,255,0.25); font-weight: 400;
  white-space: nowrap;
}
.messages-body {
  flex: 1; overflow-y: auto; padding: 12px 16px 90px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: none;
}
.messages-body::-webkit-scrollbar { display: none; }

.messages-placeholder {
  height: 100%; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  color: rgba(255,255,255,0.15); font-size: 12px;
}
.messages-placeholder i { font-size: 20px; opacity: 0.4; }

.msg-bubble {
  max-width: 72%; display: flex; flex-direction: column; gap: 3px;
}
.msg-bubble.mine { align-self: flex-end; align-items: flex-end; }
.msg-bubble.theirs { align-self: flex-start; align-items: flex-start; }

.msg-text {
  padding: 8px 12px; border-radius: 12px;
  font-size: 12px; line-height: 1.5; word-break: break-word;
}
.msg-text p, .task-query p { margin: 0 0 6px; }
.msg-text p:last-child, .task-query p:last-child { margin-bottom: 0; }
.msg-text strong, .task-query strong { font-weight: 600; color: rgba(255,255,255,0.95); }
.msg-text em, .task-query em { font-style: italic; }
.msg-text code, .task-query code {
  background: rgba(255,255,255,0.08); border-radius: 4px;
  padding: 1px 5px; font-family: monospace; font-size: 11px;
}
.msg-text pre, .task-query pre {
  background: rgba(255,255,255,0.05); border-radius: 8px;
  padding: 10px 12px; overflow-x: auto; margin: 6px 0;
}
.msg-text pre code, .task-query pre code {
  background: none; padding: 0; font-size: 11px;
}
.msg-text ul, .msg-text ol, .task-query ul, .task-query ol {
  margin: 4px 0 4px 16px; padding: 0;
}
.msg-text li, .task-query li { margin: 2px 0; }
.msg-text h1, .msg-text h2, .msg-text h3,
.task-query h1, .task-query h2, .task-query h3 {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9);
  margin: 8px 0 4px;
}
.msg-text a, .task-query a { color: rgba(150,180,255,0.8); text-decoration: underline; }
.msg-text blockquote, .task-query blockquote {
  border-left: 2px solid rgba(255,255,255,0.15);
  margin: 4px 0; padding-left: 10px;
  color: rgba(255,255,255,0.45);
}
.msg-text hr, .task-query hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 8px 0; }
.msg-bubble.mine .msg-text {
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.85);
  border-bottom-right-radius: 4px;
}
.msg-bubble.theirs .msg-text {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.75);
  border-bottom-left-radius: 4px;
}

.msg-meta {
  font-size: 10px; color: rgba(255,255,255,0.2);
  padding: 0 4px; display: flex; gap: 6px; align-items: center;
}
.msg-meta-sender { color: rgba(255,255,255,0.3); font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-meta-dot { opacity: 0.3; }
.msg-meta-time { white-space: nowrap; }

.msg-system {
  align-self: center;
  font-size: 11px; color: rgba(255,255,255,0.22);
  padding: 2px 10px;
  text-align: center;
}

.msg-loading {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: rgba(255,255,255,0.2); font-size: 12px; gap: 8px;
}

/* Task card (agent messages with elements) */
.task-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
  max-width: 82%;
  align-self: flex-start;
}
.task-query {
  font-size: 13px; color: rgba(255,255,255,0.75); line-height: 1.5;
}
.task-divider { height: 1px; background: rgba(255,255,255,0.06); }
.task-meta {
  font-size: 10px; color: rgba(255,255,255,0.2);
  display: flex; gap: 6px; align-items: center;
}
.task-meta-sender { color: rgba(255,255,255,0.3); font-weight: 500; }

/* Element types */
.element-row { display: flex; gap: 8px; flex-wrap: wrap; }

.element-btn {
  padding: 7px 18px; border-radius: 8px;
  font-size: 12px; font-weight: 500; font-family: 'Inter', sans-serif;
  cursor: pointer; border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7);
  transition: background 0.15s, color 0.15s;
}
.element-btn:hover:not(:disabled) { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.95); }
.element-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.element-btn.selected { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.95); background: rgba(255,255,255,0.1); }

.element-input-row { display: flex; gap: 8px; margin-top: 4px; }
.element-input {
  -webkit-appearance: none; appearance: none;
  flex: 1; background: #1c1c1c;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
  padding: 7px 12px; font-size: 12px; font-family: 'Inter', sans-serif;
  color: rgba(255,255,255,0.85); outline: none; box-sizing: border-box;
  transition: border-color 0.15s;
}
.element-input::placeholder { color: rgba(255,255,255,0.25); }
.element-input:focus { border-color: rgba(255,255,255,0.28); }
.element-input:disabled { opacity: 0.35; cursor: not-allowed; }

.element-field-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: rgba(255,255,255,0.35); margin-bottom: 3px;
}

.element-file-wrap { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.element-file-label {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 8px; cursor: pointer;
  font-size: 12px; color: rgba(255,255,255,0.4);
  transition: border-color 0.15s, color 0.15s;
}
.element-file-label:hover { border-color: rgba(255,255,255,0.25); color: rgba(255,255,255,0.7); }
.element-file-label.has-file { border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.75); }

.element-file-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; background: rgba(255,255,255,0.02);
}
.element-file-card-info { flex: 1; min-width: 0; }
.element-file-card-name { font-size: 12px; color: rgba(255,255,255,0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.element-file-card-size { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 2px; }

.element-table {
  width: 100%; border-collapse: collapse; margin-top: 6px;
  font-size: 12px; font-family: 'Inter', sans-serif;
}
.element-table th {
  text-align: left; padding: 6px 10px;
  color: rgba(255,255,255,0.35); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08); white-space: nowrap;
}
.element-table td {
  padding: 7px 10px; color: rgba(255,255,255,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.element-table tr:last-child td { border-bottom: none; }


/* Agent sidebar form */
.agent-form {
  padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1; min-height: 0;
}
.agent-instruct-area {
  flex: 1; min-height: 60px;
  resize: none;
  line-height: 1.5; padding-top: 9px; padding-bottom: 9px;
  background: transparent !important; outline: none;
}
.agent-form-error {
  font-size: 11px; color: rgba(255,255,255,0.6); display: none; flex-shrink: 0;
  text-align: center;
}
.agent-create-btn {
  width: 100%; padding: 8px 0; margin-top: auto;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 11px; font-weight: 500; font-family: 'Inter', sans-serif;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.agent-create-btn:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.95); border-color: rgba(255,255,255,0.2); }
.agent-create-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.agent-opener-wrap { display: flex; flex-direction: column; gap: 6px; }
.agent-opener-toggle {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: rgba(255,255,255,0.35);
  cursor: pointer; user-select: none;
}
.agent-opener-toggle input[type="checkbox"] {
  accent-color: rgba(255,255,255,0.6);
  width: 12px; height: 12px; cursor: pointer; flex-shrink: 0;
}
.agent-opener-fields { display: flex; flex-direction: column; gap: 6px; }
.agent-opener-msg { resize: none; min-height: 100px; font-size: 12px; }

.modal-input {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 9px 12px;
  font-size: 12px; font-family: 'Inter', sans-serif;
  color: rgba(255,255,255,0.85); outline: none;
  transition: border-color 0.15s;
}
.modal-input::placeholder { color: rgba(255,255,255,0.2); }
.modal-input:focus { border-color: rgba(255,255,255,0.25); }

.modal-tabs {
  display: flex; gap: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px; padding: 3px;
  margin-bottom: 12px;
}
.modal-tab {
  flex: 1; text-align: center;
  padding: 5px 0; border-radius: 6px;
  font-size: 11px; font-weight: 500; font-family: 'Inter', sans-serif;
  color: rgba(255,255,255,0.35); cursor: pointer;
  transition: all 0.15s; border: none; background: none;
}
.modal-tab.active {
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.85);
}

.modal-error {
  font-size: 11px; color: rgba(255,80,80,0.8);
  margin-top: 8px; display: none;
}

.modal-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: rgba(18,18,18,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  z-index: 10;
  display: none;
  max-height: 180px; overflow-y: auto;
  scrollbar-width: none;
}
.modal-dropdown::-webkit-scrollbar { display: none; }
.modal-dropdown.open { display: block; }

.modal-dropdown-item {
  padding: 8px 12px; cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.modal-dropdown-item:last-child { border-bottom: none; }
.modal-dropdown-item:hover { background: rgba(255,255,255,0.06); }
.modal-dropdown-item.focused { background: rgba(255,255,255,0.06); }

.modal-dropdown-cell-id {
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.modal-dropdown-operator {
  font-size: 10px; color: rgba(255,255,255,0.3);
  margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modal-dropdown-meta-line {
  font-size: 10px; color: rgba(255,255,255,0.25);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modal-dropdown-badge {
  font-size: 9px; font-weight: 600; letter-spacing: 0.04em;
  padding: 1px 5px; border-radius: 4px;
  background: rgba(80,200,120,0.12);
  border: 1px solid rgba(80,200,120,0.25);
  color: rgba(80,200,120,0.8);
  flex-shrink: 0;
}
.modal-input-wrap { position: relative; }

/* Cell identity row */
.tx-id-row {
  display: flex; gap: 8px;
  margin-top: 12px; align-items: center;
  height: 44px; flex-shrink: 0; position: relative;
}

.cell-info-box {
  height: 44px; padding: 0 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 0;
}

.cell-name { color: rgba(255,255,255,0.95); font-size: 13px; font-weight: 600; white-space: nowrap; }
.cell-id { color: rgba(255,255,255,0.35); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-divider { width: 1px; height: 16px; background: rgba(255,255,255,0.1); flex-shrink: 0; }

.tx-action-btn {
  width: 44px; height: 44px; border-radius: 10px;
  background: none; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
  text-decoration: none; color: rgba(255,255,255,0.5);
  font-size: 15px; flex-shrink: 0;
}
.tx-action-btn:hover { color: rgba(255,255,255,0.8); }
.tx-action-btn i.verified { color: #4ade80; }
.tx-action-btn:hover i.verified { color: #6ee89a; }
