/* ─── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #050c12;
  --bg-2:        #081420;
  --bg-3:        #0c1e30;
  --bg-4:        #102540;
  --accent:      #00aaff;
  --accent-dim:  #0077cc;
  --accent-glow: rgba(0, 170, 255, 0.12);
  --text:        #c8dae8;
  --text-dim:    #6a8aaa;
  --text-bright: #e8f4ff;
  --border:      rgba(0, 170, 255, 0.18);
  --border-hi:   rgba(0, 170, 255, 0.45);

  /* Superficies claras — los pocos lugares que a propósito rompen el tema
     oscuro de Odin porque son "de lectura/escritura" (WhatsApp, mail): un
     único juego de tokens para que las dos identidades no diverjan. */
  --light-bg:        #e6eef5;
  --light-bg-alt:    #ffffff;
  --light-bg-accent: #cfe8fb;
  --light-text:      #16324a;
  --light-dim:       #5c7995;
  --light-accent:    #0088cc;
  --light-border:    rgba(0, 60, 100, 0.15);

  --font-mono:   'Share Tech Mono', monospace;
  --font-ui:     'Rajdhani', sans-serif;
  --sidebar-w:   256px;
  --radius:      4px;
}

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

/* ─── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ─── Login ─────────────────────────────────────────────────── */
.login-container {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  padding: 60px 48px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 0 60px rgba(0,170,255,0.08);
}
.odin-logo { position: relative; width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; }
.logo-ring {
  position: absolute; inset: 0; border: 2px solid var(--accent); border-radius: 50%;
  animation: spin 8s linear infinite; box-shadow: 0 0 20px rgba(0,170,255,0.4);
}
.logo-ring::before {
  content: ''; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%; transform: translateX(-50%);
  box-shadow: 0 0 10px var(--accent);
}
.logo-text { font-family: var(--font-mono); font-size: 28px; color: var(--accent); letter-spacing: 6px; text-shadow: 0 0 20px var(--accent); z-index: 1; }
.login-subtitle { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; }
.auth-error { color: #ff4466; font-size: 13px; }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  background: var(--accent); color: #000; border: none; border-radius: var(--radius);
  font-family: var(--font-ui); font-size: 14px; font-weight: 600; letter-spacing: 1px;
  cursor: pointer; transition: background 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { background: #33bbff; box-shadow: 0 0 20px rgba(0,170,255,0.35); }

.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  padding: 5px 12px; border-radius: var(--radius); font-family: var(--font-ui);
  font-size: 13px; cursor: pointer; transition: border-color 0.2s, color 0.2s; white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-icon {
  background: none; border: none; color: var(--text-dim); font-size: 18px;
  cursor: pointer; padding: 0 8px; line-height: 1; transition: color 0.2s;
}
.btn-icon:hover { color: var(--accent); }

/* ─── Layout ────────────────────────────────────────────────── */
#app-screen { display: flex; align-items: stretch; width: 100%; height: 100%; }
/* Desktop only — frames the whole app (sidebar + main-content) evenly on all
   4 sides. Overrides .screen's inset:0. Mobile keeps the fixed sidebar overlay
   below untouched. */
@media (min-width: 768px) {
  #app-screen { inset: 20px; width: auto; height: auto; }
}

/* ─── Sidebar ───────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-2);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 18px 16px; border-bottom: 1px solid var(--border);
}
.odin-wordmark { font-family: var(--font-mono); font-size: 22px; color: var(--accent); letter-spacing: 6px; text-shadow: 0 0 12px rgba(0,170,255,0.5); }
.status-dot { width: 8px; height: 8px; background: #00ff88; border-radius: 50%; box-shadow: 0 0 8px #00ff88; animation: pulse-dot 2s ease-in-out infinite; }

.sidebar-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.nav-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  background: none; border: none; border-left: 2px solid transparent;
  color: var(--text-dim); font-family: var(--font-ui); font-size: 14px; font-weight: 500;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  transition: color 0.15s, background 0.15s; text-align: left;
}
.nav-btn:hover { color: var(--text); background: var(--accent-glow); }
.nav-btn.active { color: var(--accent); background: var(--accent-glow); border-left-color: var(--accent); }
.nav-icon { font-size: 16px; line-height: 1; }

.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
#user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
#user-photo { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); object-fit: cover; }
.user-meta { display: none; } /* name/email now live in #user-photo's title tooltip instead */
#btn-logout { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; padding: 4px; transition: color 0.2s; flex-shrink: 0; }
#btn-logout:hover { color: #ff4466; }
#btn-restart { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; padding: 4px; transition: color 0.2s; flex-shrink: 0; }
#btn-restart:hover { color: #00aaff; }

/* ─── Panels ────────────────────────────────────────────────── */
#main-content { flex: 1; overflow: hidden; position: relative; --clima-h: 0px; }
.panel { position: absolute; top: var(--clima-h, 0px); right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; overflow: hidden; }
.panel.hidden { display: none; }
.panel.active { display: flex; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; gap: 12px;
}
.panel-header h2 { font-family: var(--font-mono); font-size: 15px; font-weight: 400; color: var(--text-bright); letter-spacing: 2px; white-space: nowrap; }
.accent { color: var(--accent); }

/* ─── Gmail toolbar ─────────────────────────────────────────── */
.gmail-toolbar { display: flex; align-items: center; gap: 8px; }

.search-bar {
  display: flex; align-items: center; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input {
  background: none; border: none; color: var(--text-bright); font-family: var(--font-ui);
  font-size: 13px; padding: 6px 12px; width: 220px; outline: none;
}
.search-bar input::placeholder { color: var(--text-dim); }

/* ─── Tab bar ───────────────────────────────────────────────── */
.tab-bar {
  display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0;
  padding: 0 24px; gap: 0;
}
.tab-btn {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); font-family: var(--font-ui); font-size: 13px; font-weight: 500;
  letter-spacing: 0.5px; padding: 8px 16px; cursor: pointer; transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Item list ─────────────────────────────────────────────── */
.item-list { flex: 1; overflow-y: auto; padding: 12px 24px; display: flex; flex-direction: column; gap: 6px; }

.loading-state { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); letter-spacing: 2px; text-align: center; padding: 40px 0; }
.empty-state { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); letter-spacing: 1px; text-align: center; padding: 40px 0; }

/* ─── Gmail items ───────────────────────────────────────────── */
.gmail-item {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.gmail-item:hover { border-color: var(--accent); background: var(--bg-4); }
.gmail-item.unread { border-left: 3px solid var(--accent); background: var(--bg-2); }
.gmail-item:not(.unread) { background: #1e3555; }
.gmail-item:not(.unread):hover { background: #264268; }
.gmail-item:not(.unread) .gmail-sender { font-weight: 400; color: var(--text); }

.gmail-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: bold; color: #000;
}
.gmail-item-body { flex: 1; min-width: 0; }
.gmail-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gmail-sender { font-size: 13px; font-weight: 600; color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gmail-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.gmail-subject { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.gmail-item.unread .gmail-subject { color: var(--text-bright); font-weight: 600; }
.gmail-snippet { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.gmail-star { color: #ffcc02; font-size: 14px; flex-shrink: 0; align-self: center; }

/* ─── Calendar grid ─────────────────────────────────────────── */
.cal-outer { flex: 1; overflow-y: auto; }

.cal-grid-wrap { padding: 14px 20px 20px; }

.cal-weekday-row {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px;
}
.cal-wday-hdr {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
  letter-spacing: 1.5px; text-align: center; padding: 4px 0; text-transform: uppercase;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.cal-day-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 8px; min-height: 82px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.15s;
}
.cal-day-card:hover:not(.cal-day-filler) { border-color: rgba(0,170,255,0.35); }
.cal-day-card.cal-today { border-color: var(--accent); background: rgba(0,170,255,0.05); }
.cal-day-card.cal-empty { opacity: 0.45; }
.cal-day-card.cal-day-filler { background: transparent; border-color: transparent; min-height: 82px; }

.cal-card-hdr { display: flex; align-items: baseline; gap: 4px; }
.cal-card-num {
  font-family: var(--font-mono); font-size: 15px; color: var(--text-bright); line-height: 1;
}
.cal-day-card.cal-today .cal-card-num { color: var(--accent); text-shadow: 0 0 8px rgba(0,170,255,0.5); }
.cal-card-mon {
  font-family: var(--font-mono); font-size: 9px; color: var(--text-dim);
  letter-spacing: 1px; text-transform: uppercase;
}

.cal-card-events { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow: hidden; }
.cal-card-evt { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cal-evt-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.cal-evt-txt {
  font-size: 10px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; line-height: 1.4; flex: 1;
}
.cal-card-more { font-family: var(--font-mono); font-size: 9px; color: var(--accent); margin-top: 1px; }

/* ─── Calendar day popover ──────────────────────────────────── */
.cal-day-card { cursor: pointer; }
.cal-day-card.cal-day-filler { cursor: default; }
.cal-day-card.cal-card-active {
  border-color: var(--accent);
  background: rgba(0,170,255,0.08);
  box-shadow: 0 0 0 1px var(--accent);
}

.cal-popover {
  position: fixed;
  z-index: 80;
  width: 288px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 24px rgba(0,170,255,0.12);
  animation: fadeUp 0.15s ease;
  overflow: hidden;
}

.cal-pop-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.cal-pop-date {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  letter-spacing: 1.5px; text-transform: uppercase;
}
.cal-pop-close {
  background: none; border: none; color: var(--text-dim); font-size: 14px;
  cursor: pointer; padding: 2px 6px; transition: color 0.15s; line-height: 1;
}
.cal-pop-close:hover { color: var(--text-bright); }

.cal-pop-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
}
.cal-pop-empty {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
  text-align: center; padding: 20px 14px;
}
.cal-pop-event {
  display: flex; gap: 0; padding: 8px 14px; border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.cal-pop-event:last-child { border-bottom: none; }
.cal-pop-event:hover { background: var(--bg-3); }

.cal-pop-evt-bar {
  width: 3px; border-radius: 2px; flex-shrink: 0; margin-right: 10px;
  align-self: stretch; min-height: 16px;
}
.cal-pop-evt-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cal-pop-evt-title { font-size: 13px; font-weight: 600; color: var(--text-bright); word-break: break-word; }
.cal-pop-evt-time  { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.cal-pop-evt-meta  { font-size: 11px; color: var(--text-dim); }
.cal-pop-evt-desc  {
  font-size: 11px; color: var(--text-dim); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cal-pop-meet-btn {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  margin-top: 4px; padding: 4px 10px; border-radius: 4px;
  background: rgba(0,170,255,0.12); border: 1px solid rgba(0,170,255,0.4);
  color: var(--accent); font-family: var(--font-ui); font-size: 11px; font-weight: 600;
  text-decoration: none; transition: background 0.12s;
}
.cal-pop-meet-btn:hover { background: rgba(0,170,255,0.22); }
.cal-evt-meet-ico { font-size: 0.75em; flex-shrink: 0; opacity: 0.85; }

.cal-pop-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.cal-pop-foot .btn-primary {
  width: 100%; justify-content: center; font-size: 13px; padding: 8px;
}

/* ─── Drive sections ────────────────────────────────────────── */
.drive-section { margin-bottom: 4px; }
.drive-section-hdr {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim); padding: 10px 0 6px; border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

/* ─── Drive ─────────────────────────────────────────────────── */
.drive-breadcrumb {
  display: flex; align-items: center; gap: 6px; padding: 8px 24px;
  border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px;
}
.breadcrumb-item { color: var(--text-dim); cursor: pointer; transition: color 0.15s; }
.breadcrumb-item:hover, .breadcrumb-item.active { color: var(--accent); }
.breadcrumb-sep { color: var(--border-hi); }

.drive-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color 0.15s, background 0.15s; text-decoration: none; color: inherit;
}
.drive-item:hover { border-color: var(--accent); background: var(--bg-3); }
.drive-folder { border-left: 3px solid rgba(0,170,255,0.4); }
.drive-icon { font-size: 20px; flex-shrink: 0; }
.drive-name { flex: 1; font-size: 13px; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-modified { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.drive-chevron { color: var(--text-dim); font-size: 20px; flex-shrink: 0; }

/* ─── Memory indicator ──────────────────────────────────────── */
.memory-indicator {
  position: absolute;
  top: 68px;
  right: 20px;
  background: rgba(0, 170, 255, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 5px 12px;
  border-radius: var(--radius);
  z-index: 20;
  pointer-events: none;
  animation: memFadeIn 0.25s ease;
}
.memory-indicator.mem-fade-out {
  animation: memFadeOut 0.4s ease forwards;
}
@keyframes memFadeIn  { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
@keyframes memFadeOut { from{opacity:1;transform:translateY(0)}    to{opacity:0;transform:translateY(-6px)} }

/* ─── Conversation tabs ─────────────────────────────────────── */
.conv-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 16px 0;
  overflow-x: auto;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.conv-tabs::-webkit-scrollbar { display: none; }

.header-session-tk {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.8px;
  color: rgba(0, 170, 255, 0.5); white-space: nowrap; flex-shrink: 0;
  transition: color 0.3s;
  cursor: default;
}
.header-session-tk.heavy {
  color: #ffaa00;
}
.chat-token-usage {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.4px;
  color: var(--text-dim); padding: 4px 0 0 0; opacity: 0.55;
}

.conv-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px 0 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  background: rgba(255,255,255,0.02);
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  white-space: nowrap;
  max-width: 130px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.conv-tab:hover { background: rgba(0,170,255,0.06); color: var(--text); }
.conv-tab.active {
  border-color: rgba(0,170,255,0.4);
  background: rgba(0,170,255,0.1);
  color: var(--text);
}
.conv-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  pointer-events: none;
}
.conv-tab-close {
  flex-shrink: 0;
  width: 14px; height: 14px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.25);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.12s;
}
.conv-tab-close:hover { color: #ff4466; }
.conv-tab-new {
  flex-shrink: 0;
  width: 26px; height: 26px;
  margin-left: 2px;
  border: 1px dashed rgba(0,170,255,0.25);
  border-radius: 4px;
  background: none;
  color: rgba(0,170,255,0.45);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}
.conv-tab-new:hover { border-color: var(--accent); color: var(--accent); }

.conv-tab-rename-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--accent);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 0 2px;
  outline: none;
  min-width: 40px;
  max-width: 120px;
}

/* ─── Chat ──────────────────────────────────────────────────── */
.chat-messages { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }

.message { display: flex; flex-direction: column; gap: 5px; max-width: 72%; animation: fadeUp 0.2s ease; }
.message.user { align-self: flex-end; }
.message.odin { align-self: flex-start; }

.message-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); }
.message.odin .message-meta { color: var(--accent); }

.message-body { padding: 11px 15px; border-radius: var(--radius); font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.message.user .message-body { background: var(--bg-4); border: 1px solid var(--border); color: var(--text-bright); }
.message.odin .message-body { background: var(--bg-3); border: 1px solid rgba(0,170,255,0.22); color: var(--text); }

.chat-input-area {
  display: flex; gap: 10px; padding: 14px 24px 18px;
  border-top: 1px solid var(--border); flex-shrink: 0; align-items: flex-end;
}
#chat-input {
  flex: 1; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-bright); font-family: var(--font-ui); font-size: 14px;
  padding: 9px 13px; resize: none; max-height: 130px; overflow-y: auto;
  transition: border-color 0.2s; line-height: 1.5;
}
#chat-input:focus { outline: none; border-color: var(--accent); }
#chat-input::placeholder { color: var(--text-dim); }

.btn-send {
  width: 40px; height: 40px; background: var(--accent); border: none; border-radius: var(--radius);
  color: #000; font-size: 15px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: background 0.2s, box-shadow 0.2s;
}
.btn-send:hover { background: #33bbff; box-shadow: 0 0 12px rgba(0,170,255,0.4); }
.btn-send:disabled { background: var(--bg-4); cursor: not-allowed; }

/* ─── Modal ─────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: rgba(5,12,18,0.85);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: var(--bg-2); border: 1px solid var(--border-hi); border-radius: var(--radius);
  width: 580px; max-width: 92vw; display: flex; flex-direction: column;
  /* Valor de respaldo nada más — el que manda es JS (fitEmailModalToViewport
     en gmail.js, con window.innerHeight) apenas se abre el modal de mail.
     Este 80vh es solo para el instante antes de que corra ese JS, o para
     otros modales que no lo usan. */
  max-height: min(80vh, calc(100vh - 64px)); /* CSS puro de respaldo, no depende solo de JS */
  box-shadow: 0 0 40px rgba(0,170,255,0.12); overflow: hidden;
}
.modal-wide { width: 680px; }

.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px;
  flex-shrink: 0;
}
.modal-header h3 { font-family: var(--font-mono); font-size: 13px; color: var(--accent); letter-spacing: 1.5px; word-break: break-word; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 16px; cursor: pointer; padding: 2px 6px; flex-shrink: 0; transition: color 0.2s; }
.modal-close:hover { color: var(--text-bright); }

/* Email header in modal */
.email-header-meta { padding: 12px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.email-sender-row { display: flex; align-items: center; gap: 12px; }
.sender-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: bold; color: #000;
}
.email-from-name { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.email-from-addr { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.email-date-stamp { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-left: auto; white-space: nowrap; }

.email-body {
  flex: 1; overflow-y: auto; overflow-x: hidden; min-width: 0; min-height: 0;
  padding: 18px 20px; font-size: 13px; line-height: 1.75;
  background: var(--light-bg); color: var(--light-text); color-scheme: light; word-break: break-word;
}

/* Vista simplificada del cuerpo del mail — se le saca el HTML/estilos
   originales del remitente (ver sanitizeEmailHtml en gmail.js) y se
   muestra con la tipografía propia de Odin, no la del mail.
   overflow-wrap:anywhere + table-layout:fixed evitan que una tabla o una
   URL/palabra sin cortes empuje el modal más ancho que la pantalla. */
.email-body-content { font-family: var(--font-ui); font-size: 14px; line-height: 1.65; color: var(--light-text); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.email-body-content p, .email-body-content div { margin: 0 0 10px; }
.email-body-content h1, .email-body-content h2, .email-body-content h3, .email-body-content h4 { font-family: var(--font-ui); font-size: 16px; font-weight: 600; margin: 14px 0 8px; }
.email-body-content ul, .email-body-content ol { margin: 0 0 10px 20px; padding: 0; }
.email-body-content img { max-width: 100%; height: auto; }
.email-body-content table { width: 100% !important; max-width: 100%; border-collapse: collapse; table-layout: fixed; }
.email-body-content td, .email-body-content th { max-width: 100%; overflow-wrap: anywhere; padding: 2px; }
.email-body-content a { color: var(--accent-dim); text-decoration: underline; }
.email-body-content blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid #ddd; color: #555; }
.modal-actions { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }

/* ─── Popup de mail: estilo simple/claro, no el tema oscuro del resto de
   Odin — así lo pidió Juan específicamente para este modal. Usa los mismos
   tokens --light-* que el panel de WhatsApp, para que las dos superficies
   claras de la app se sientan una sola identidad y no dos estilos sueltos.
   El rojo de "peligro" (eliminar/papelera) queda literal a propósito: es
   semántico, no de marca, y no debe seguir al acento de color. */
#email-modal .modal-content { background: var(--light-bg); border: 1px solid var(--light-border); box-shadow: 0 4px 24px rgba(0,0,0,0.18); }
#email-modal .modal-header { border-bottom: 1px solid var(--light-border); }
#email-modal .modal-header h3 { font-family: var(--font-ui); font-size: 15px; font-weight: 500; letter-spacing: normal; color: var(--light-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
#email-modal .modal-close { color: var(--light-dim); }
#email-modal .modal-close:hover { color: var(--light-text); }
/* Fila de acciones (mover, papelera, eliminar, responder) — su propia
   franja, arriba del cuerpo del mail y abajo del remitente. flex-shrink:0
   como el resto de la cabecera: siempre visible, nunca se va con el
   scroll del cuerpo del mail. */
.modal-header-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap;
  padding: 8px 20px; border-bottom: 1px solid var(--border);
}
#email-modal .modal-header-actions { border-bottom-color: var(--light-border); background: var(--light-bg-alt); }
#email-modal .modal-header-actions .btn-icon { color: var(--light-dim); }
#email-modal .modal-header-actions .btn-icon:hover { color: var(--light-text); }
#email-modal .modal-header-actions .btn-danger { color: #d93025 !important; }
#email-modal .modal-header-actions .btn-danger:hover { color: #b3261e !important; }
#email-modal .email-header-meta { border-bottom: 1px solid var(--light-border); }
#email-modal .email-from-name { color: var(--light-text); }
#email-modal .email-from-addr { font-family: var(--font-ui); color: var(--light-dim); }
#email-modal .email-date-stamp { font-family: var(--font-ui); color: var(--light-dim); }
#email-modal .modal-actions { border-top: 1px solid var(--light-border); background: var(--light-bg); }
#email-modal .modal-actions .btn-ghost { background: var(--light-bg-alt); border-color: var(--light-border); color: var(--light-dim); }
#email-modal .modal-actions .btn-ghost:hover { background: var(--light-bg); border-color: var(--light-border); color: var(--light-text); }
#email-modal .modal-actions .btn-danger { color: #d93025 !important; border-color: var(--light-border) !important; }
#email-modal .modal-actions .btn-danger:hover { background: rgba(217,48,37,0.08) !important; border-color: #d93025 !important; }

/* ─── Compose form ──────────────────────────────────────────── */
.compose-form { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; flex: 1; overflow-y: auto; }
.compose-form input, .compose-form textarea, .compose-form select {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-bright); font-family: var(--font-ui); font-size: 14px; padding: 9px 12px; width: 100%;
}
.compose-form input:focus, .compose-form textarea:focus, .compose-form select:focus { outline: none; border-color: var(--accent); }
.compose-form input::placeholder, .compose-form textarea::placeholder { color: var(--text-dim); }
.compose-form textarea { resize: vertical; line-height: 1.5; }
.form-row { display: flex; gap: 12px; }
.form-row label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); letter-spacing: 1px; }
.form-row input { margin-top: 4px; }
.compose-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.compose-to-row { display: flex; gap: 8px; align-items: center; }
.compose-to-row input { flex: 1; }
.btn-cc-toggle { flex-shrink: 0; font-size: 11px; padding: 6px 10px; white-space: nowrap; }

/* ─── Mail action overlay (list row) ────────────────────────── */
.mail-actions {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 3px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s;
}
.gmail-item:hover .mail-actions { opacity: 1; pointer-events: auto; }

.mail-act-btn {
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 4px;
  width: 26px; height: 26px; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.mail-act-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--bg-4); }
.mail-act-btn.danger:hover { color: #ff4444; border-color: #ff4444; }

/* ─── Move-to dropdown ──────────────────────────────────────── */
.mail-move-dropdown {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 0;
  min-width: 160px; max-height: 280px; overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.mail-move-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 14px; background: none; border: none;
  color: var(--text); font-size: 13px; cursor: pointer;
  font-family: var(--font-ui);
}
.mail-move-item:hover { background: var(--bg-3); color: var(--accent); }

/* ─── Danger button ─────────────────────────────────────────── */
.btn-danger { color: #ff4444 !important; border-color: #ff4444 !important; }
.btn-danger:hover { background: rgba(255,68,68,0.08) !important; }

/* ─── Nav separator ─────────────────────────────────────────── */
.nav-separator { height: 1px; background: var(--border); margin: 8px 14px; }

/* ─── Gmail contact view ────────────────────────────────────── */
.gmail-badge {
  background: var(--accent); color: #000; border-radius: 10px;
  font-family: var(--font-mono); font-size: 10px; font-weight: bold;
  padding: 1px 6px; flex-shrink: 0; align-self: center;
}
.gmail-avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.contact-thread-header {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.contact-thread-title { display: flex; align-items: center; gap: 10px; }

/* ─── Drive tree ─────────────────────────────────────────────── */
.drive-tree-list { padding: 8px 0 !important; gap: 0 !important; }

.dti {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  cursor: pointer; transition: background 0.12s; min-width: 0;
  border-bottom: 1px solid transparent;
}
.dti:hover { background: var(--bg-3); }
.dti-folder:hover { color: var(--text-bright); }

.dti-toggle {
  font-size: 11px; color: var(--text-dim); width: 14px; flex-shrink: 0;
  text-align: center; line-height: 1; cursor: pointer; user-select: none;
  transition: color 0.15s;
}
.dti-folder:hover .dti-toggle { color: var(--accent); }
.dti-spacer { width: 14px; flex-shrink: 0; }
.dti-icon   { font-size: 16px; flex-shrink: 0; }
.dti-name   { flex: 1; font-size: 13px; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dti-date   { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.dti-children { overflow: hidden; }
.dti-children.hidden { display: none; }
.dti-status { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); padding: 6px 48px; }

/* ─── Drive pillar folder cards ──────────────────────────────── */
.drive-pillar-folders {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dpf-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.dpf-card:hover { border-color: var(--drive-pc, #00aaff); background: var(--bg-3); }
.dpf-not-found  { opacity: 0.38; cursor: default; pointer-events: none; }
.dpf-icon       { font-size: 18px; flex-shrink: 0; }
.dpf-name       { flex: 1; font-size: 13px; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dpf-open       { font-size: 13px; color: var(--drive-pc, #00aaff); flex-shrink: 0; }
.dpf-missing    { font-size: 11px; color: var(--text-dim); flex-shrink: 0; font-family: var(--font-mono); }
.dpf-footer     { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); text-align: center; }

/* ─── Notes ──────────────────────────────────────────────────── */
.note-add-bar {
  display: flex; gap: 10px; padding: 12px 24px; border-top: 1px solid var(--border);
  flex-shrink: 0; align-items: flex-end;
}
.note-inputs { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.note-inputs input, .note-inputs textarea {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-bright); font-family: var(--font-ui); font-size: 13px; padding: 7px 12px; width: 100%;
}
.note-inputs input:focus, .note-inputs textarea:focus { outline: none; border-color: var(--accent); }
.note-inputs input::placeholder, .note-inputs textarea::placeholder { color: var(--text-dim); }
.note-inputs textarea { resize: none; line-height: 1.4; }

.note-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.15s; cursor: pointer;
}
.note-card:hover, .note-card.expanded { border-color: rgba(0,170,255,0.4); }
.note-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
}
.note-title { font-size: 14px; font-weight: 600; color: var(--text-bright); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.note-date { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }
.note-delete { background: none; border: none; color: var(--text-dim); font-size: 12px; cursor: pointer; padding: 2px 4px; opacity: 0; transition: opacity 0.15s, color 0.15s; }
.note-card:hover .note-delete { opacity: 1; }
.note-delete:hover { color: #ff4466; }
.note-body { font-size: 13px; color: var(--text); padding: 0 14px 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.note-body.collapsed { display: none; }

/* ─── Scope / re-auth warning ────────────────────────────────── */
.scope-warning {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; padding: 40px 24px;
}
.scope-warning-icon  { font-size: 36px; }
.scope-warning-title { font-family: var(--font-mono); font-size: 14px; color: var(--accent); letter-spacing: 1px; }
.scope-warning-body  { font-size: 13px; color: var(--text-dim); max-width: 340px; line-height: 1.6; }

/* ─── Weather ────────────────────────────────────────────────── */
.weather-main {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px 20px 24px; border-bottom: 1px solid var(--border);
}
.weather-city { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); letter-spacing: 3px; text-transform: uppercase; }
.weather-hero { display: flex; align-items: center; gap: 16px; }
.weather-icon-big { font-size: 64px; line-height: 1; }
.weather-temp-big { font-family: var(--font-mono); font-size: 72px; color: var(--text-bright); line-height: 1; }
.weather-desc  { font-size: 16px; color: var(--text); font-weight: 500; }
.weather-feels { font-size: 13px; color: var(--text-dim); }
.weather-details { display: flex; gap: 20px; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.weather-forecast {
  display: flex; gap: 8px; padding: 20px; overflow-x: auto; justify-content: center; flex-wrap: wrap;
}
.forecast-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 80px;
}
.fc-day  { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.fc-icon { font-size: 28px; }
.fc-desc { font-size: 10px; color: var(--text-dim); text-align: center; max-width: 80px; }
.fc-temps { display: flex; gap: 6px; }
.fc-max  { font-family: var(--font-mono); font-size: 14px; color: var(--text-bright); }
.fc-min  { font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); }
.fc-rain { font-family: var(--font-mono); font-size: 10px; color: #00aaff; }

/* ─── News ───────────────────────────────────────────────────── */
.news-item {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: inherit; transition: border-color 0.15s;
}
.news-item:hover { border-color: var(--accent); }
.news-title { font-size: 14px; font-weight: 600; color: var(--text-bright); line-height: 1.4; }
.news-desc  { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.news-meta  { display: flex; justify-content: space-between; align-items: center; }
.news-source { font-family: var(--font-mono); font-size: 10px; color: var(--accent); letter-spacing: 1px; text-transform: uppercase; }
.news-time   { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }

/* ─── Pillar navigation ─────────────────────────────────────── */
.pillar {
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition: background 0.2s;
}
.pillar.drag-over {
  background: rgba(255,255,255,0.04);
  outline: 2px dashed var(--pc);
  outline-offset: -3px;
}
.pillar:last-child { border-bottom: none; }

/* Pillar header row: toggle + upload button */
.pillar-hdr-row {
  display: flex; align-items: stretch;
}

.pillar-toggle {
  display: flex; align-items: center; gap: 8px;
  flex: 1; padding: 11px 8px 11px 16px;
  background: none; border: none; border-left: 3px solid transparent;
  color: var(--text-dim); font-family: var(--font-ui); font-size: 12px;
  font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  text-align: left; cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.pillar-toggle:hover { background: rgba(255,255,255,0.03); }

.pillar.pillar-open .pillar-toggle { color: var(--pc); }
.pillar.pillar-active .pillar-toggle { border-left-color: var(--pc); }
.pillar.pillar-open.pillar-active .pillar-toggle { background: rgba(255,255,255,0.03); }

.ph-upload-btn {
  background: none; border: none; border-left: 1px solid var(--border);
  color: var(--text-dim); font-size: 13px; padding: 0 10px;
  cursor: pointer; flex-shrink: 0; opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  line-height: 1;
}
.pillar:hover .ph-upload-btn,
.pillar.pillar-open .ph-upload-btn { opacity: 1; }
.ph-upload-btn:hover { color: var(--pc); background: rgba(255,255,255,0.04); }

.ph-icon {
  font-size: 13px; flex-shrink: 0;
  color: var(--pc); opacity: 0.6;
  transition: opacity 0.18s;
}
.pillar.pillar-open .ph-icon,
.pillar.pillar-active .ph-icon { opacity: 1; }

/* Pillar-body max-height needs to accommodate briefing + docs */

.ph-name { flex: 1; }

.ph-badge {
  min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--pc); color: #000;
  font-family: var(--font-mono); font-size: 9px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px; flex-shrink: 0;
  animation: badgePop 0.2s ease;
}
@keyframes badgePop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ph-chev {
  font-size: 16px; color: var(--text-dim); flex-shrink: 0;
  display: inline-block; transition: transform 0.22s ease, color 0.18s;
  line-height: 1;
}
.pillar.pillar-open .pillar-toggle .ph-chev { transform: rotate(90deg); color: var(--pc); }

/* Pillar body collapse */
.pillar-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease-out;
}
.pillar.pillar-open .pillar-body { max-height: 3000px; }

/* Subgroup buttons */
.sg-btn {
  display: block; width: 100%;
  padding: 7px 14px 7px 34px;
  background: none; border: none; border-left: 2px solid transparent;
  color: var(--text-dim); font-family: var(--font-ui); font-size: 13px; font-weight: 400;
  cursor: pointer; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.sg-btn:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.sg-btn.active {
  color: var(--pc);
  border-left-color: var(--pc);
  background: rgba(255,255,255,0.04);
  font-weight: 500;
}

/* ─── Pillar briefing ────────────────────────────────────────── */
.pillar-briefing {
  margin: 4px 10px 2px;
  display: none;
}
.bf-section {
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.bf-section:last-child { border-bottom: none; }
.bf-section-label {
  font-family: var(--font-mono); font-size: 9px; color: var(--text-dim);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 4px;
}
.bf-insight {
  font-size: 11px; color: var(--text); padding: 2px 0;
  border-left: 2px solid var(--pc); padding-left: 6px; margin-bottom: 3px;
}
.bf-area {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 6px; margin-bottom: 2px;
  background: rgba(255,255,255,0.03); border-radius: 3px;
}
.bf-area-name {
  font-size: 11px; color: var(--text); flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.bf-area-count {
  font-family: var(--font-mono); font-size: 9px; color: var(--pc);
  flex-shrink: 0; margin-left: 6px;
}
.bf-doc {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-dim); padding: 2px 0;
  text-decoration: none; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; transition: color 0.15s;
}
.bf-doc:hover { color: var(--pc); }
.bf-subproject {
  font-size: 11px; color: var(--pc); padding: 2px 0;
}

/* ─── Pillar doc list (under Documents subgroup) ─────────────── */
.pillar-docs {
  margin: 2px 0; border-top: 1px solid rgba(255,255,255,0.04);
}
.pillar-docs:empty { display: none; }
.pd-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 14px 5px 34px; text-decoration: none;
  transition: background 0.12s;
}
.pd-item:hover { background: rgba(255,255,255,0.03); }
.pd-icon { font-size: 12px; flex-shrink: 0; }
.pd-name {
  flex: 1; font-size: 11px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color 0.15s;
}
.pd-item:hover .pd-name { color: var(--text); }
.pd-date { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); flex-shrink: 0; }
.pd-empty { font-size: 11px; color: var(--text-dim); padding: 4px 34px; }

/* ─── Upload progress bar ────────────────────────────────────── */
.upload-progress-bar {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  z-index: 300; animation: fadeUp 0.2s ease;
}
.upb-inner {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border-hi);
  border-radius: var(--radius); padding: 10px 18px;
  box-shadow: 0 0 24px rgba(0,170,255,0.1);
  font-family: var(--font-ui); font-size: 13px; color: var(--text);
  white-space: nowrap;
}
.upb-icon { font-size: 16px; }
.upb-spinner {
  width: 14px; height: 14px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}

/* ─── Upload result message ──────────────────────────────────── */
.upload-result-body {
  padding: 10px 14px !important;
}
.ur-file-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.ur-icon { font-size: 18px; flex-shrink: 0; }
.ur-name {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--text-bright);
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ur-name:hover { color: var(--accent); }
.ur-pillar-tag {
  font-family: var(--font-mono); font-size: 9px; font-weight: bold;
  color: #000; background: var(--pc); border-radius: 3px;
  padding: 2px 6px; flex-shrink: 0; letter-spacing: 0.5px; text-transform: uppercase;
}
.ur-summary { font-size: 12px; color: var(--text); line-height: 1.6; white-space: pre-wrap; }

/* ─── Subproject proposal card ───────────────────────────────── */
.sp-card {
  border: 1px solid var(--pc); border-radius: var(--radius);
  padding: 14px 16px; background: rgba(255,255,255,0.02);
  animation: fadeUp 0.2s ease;
}
.sp-card-title {
  font-family: var(--font-mono); font-size: 10px; color: var(--pc);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px;
}
.sp-card-name {
  font-size: 15px; font-weight: 600; color: var(--text-bright); margin-bottom: 4px;
}
.sp-card-desc {
  font-size: 12px; color: var(--text-dim); line-height: 1.5; margin-bottom: 6px;
}
.sp-card-pillar {
  font-family: var(--font-mono); font-size: 10px; color: var(--pc);
  margin-bottom: 12px;
}
.sp-card-actions { display: flex; gap: 8px; }
.sp-card-actions .btn-primary { font-size: 12px; padding: 6px 14px; }
.sp-card-actions .btn-ghost   { font-size: 12px; padding: 5px 12px; }

/* ─── Subgroup hierarchy ──────────────────────────────────────── */
.sg-group { display: flex; flex-direction: column; }

.sg-group-hdr { display: flex; align-items: center; }
.sg-group-hdr > .sg-btn { flex: 1; min-width: 0; }

/* drag handle */
.sg-drag-handle {
  flex-shrink: 0;
  padding: 0 4px 0 2px;
  color: var(--text-dim);
  opacity: 0;
  cursor: grab;
  font-size: 13px;
  line-height: 1;
  transition: opacity 0.15s;
  user-select: none;
}
.sg-group-hdr:hover .sg-drag-handle { opacity: 0.4; }
.sg-drag-handle:hover { opacity: 0.8 !important; }
.sg-group[draggable] { transition: opacity 0.15s; }
.sg-group.sg-dragging { opacity: 0.35; }
.sg-group.sg-drag-over-before { box-shadow: inset 0 2px 0 var(--accent); }
.sg-group.sg-drag-over-after  { box-shadow: inset 0 -2px 0 var(--accent); }
.sg-group.sg-touch-sort { background: rgba(255,255,255,0.04); border-radius: 4px; }
/* touch sort ↑/↓ controls */
.sg-sort-controls { display: flex; gap: 2px; margin-right: 2px; }
.sg-sort-controls button {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 12px; padding: 1px 4px; line-height: 1;
}
.sg-sort-controls button:hover { color: var(--accent); }

.sg-rename-btn {
  flex-shrink: 0;
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  padding: 2px 4px; font-size: 13px; line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.sg-group-hdr:hover .sg-rename-btn { opacity: 0.55; }
.sg-rename-btn:hover { opacity: 1 !important; color: var(--pc); }

.sg-edit-input {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--pc);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 8px;
  outline: none;
  margin: 2px 4px;
}

.sg-toggle {
  flex-shrink: 0;
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  padding: 4px 8px 4px 2px; font-size: 14px; line-height: 1;
  transition: color 0.15s;
}
.sg-toggle:hover { color: var(--pc, var(--text)); }

.sg-children {
  display: flex;
  flex-direction: column;
  margin-left: 16px;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.07);
}
.sg-children.sg-collapsed { display: none; }

.sg-sub {
  padding: 5px 14px 5px 10px;
  font-size: 12px;
  font-style: italic;
}
.sg-sub::before { content: "* "; opacity: 0.5; }

.sg-add-sub-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 11px;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  opacity: 0.55;
  transition: opacity 0.15s, color 0.15s;
}
.sg-add-sub-btn:hover { opacity: 1; color: var(--pc); }

.sg-add-form {
  padding: 6px 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sg-add-input {
  background: var(--bg);
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.sg-add-input:focus { border-color: var(--pc, var(--accent)); }
.sg-add-actions { display: flex; gap: 4px; }
.sg-add-confirm {
  font-size: 11px;
  padding: 3px 10px;
  background: var(--pc, var(--accent));
  color: #000;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.sg-add-cancel {
  font-size: 11px;
  padding: 3px 8px;
  background: none;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

/* ─── Tech panel ─────────────────────────────────────────────── */

/* Tab bar inside panel header */
.tech-tab-bar {
  display: flex; gap: 0; flex-wrap: nowrap; overflow-x: auto;
}
.tech-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); font-family: var(--font-ui); font-size: 12px;
  font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 6px 12px; cursor: pointer; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s; margin-bottom: -1px;
}
.tech-tab:hover { color: var(--text); }
.tech-tab.active { color: #9b59b6; border-bottom-color: #9b59b6; }

/* Panel header override to allow tab bar */
#panel-tech .panel-header {
  flex-direction: column; align-items: flex-start; gap: 8px;
  padding-bottom: 0; border-bottom: 1px solid var(--border);
}
#panel-tech .panel-header > div:first-child {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}

/* Views */
.tech-view { flex: 1; overflow-y: auto; padding: 12px 24px; display: flex; flex-direction: column; gap: 8px; }
.tech-view.hidden { display: none !important; }

/* Cards */
.tech-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; transition: border-color 0.15s;
}
.tech-card:hover { border-color: rgba(155,89,182,0.4); }
.tech-card p { font-size: 13px; color: var(--text); line-height: 1.6; margin: 0 0 10px; }
.tech-card p:last-child { margin-bottom: 0; }
.tech-card ul { margin: 0 0 10px; padding-left: 18px; }
.tech-card li { font-size: 13px; color: var(--text); line-height: 1.6; margin-bottom: 4px; }

.tc-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap;
}
.tc-title {
  font-size: 13px; font-weight: 600; color: var(--text-bright); flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tc-title.tc-repo-name { color: #9b59b6; text-decoration: none; }
.tc-title.tc-repo-name:hover { text-decoration: underline; }
.tc-desc {
  font-size: 12px; color: var(--text-dim); line-height: 1.55; margin-bottom: 6px;
}
.tc-date { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }
.tc-lang, .tc-priority, .tc-use-count {
  font-family: var(--font-mono); font-size: 9px; color: #9b59b6;
  background: rgba(155,89,182,0.12); border-radius: 3px; padding: 2px 6px;
  letter-spacing: 0.5px; flex-shrink: 0;
}
.tc-use-count { color: var(--text-dim); background: var(--bg-4); }
.tc-status {
  font-family: var(--font-mono); font-size: 9px; border-radius: 3px;
  padding: 2px 6px; flex-shrink: 0;
}
.tc-status-active   { color: #00cc88; background: rgba(0,204,136,0.12); }
.tc-status-paused   { color: var(--text-dim); background: var(--bg-4); }
.tc-status-archived { color: #ff6b6b; background: rgba(255,107,107,0.12); }

.tc-stack {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.tc-tag {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 6px;
}
.tc-links, .tc-resources {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.tc-link {
  font-family: var(--font-mono); font-size: 11px; color: #9b59b6;
  text-decoration: none; transition: opacity 0.15s;
}
.tc-link:hover { opacity: 0.8; text-decoration: underline; }
.tc-res-text { font-size: 11px; color: var(--text-dim); }

/* Code blocks */
.tc-code {
  margin: 8px 0 0; border-radius: var(--radius); font-size: 12px;
  max-height: 220px; overflow-y: auto;
}
.tc-prompt-body {
  font-size: 12px; color: var(--text); line-height: 1.6; white-space: pre-wrap;
  word-break: break-word; max-height: 120px; overflow-y: auto;
  background: var(--bg-3); border-radius: var(--radius); padding: 8px 10px;
  margin: 4px 0;
}

/* Buttons */
.tc-del {
  background: none; border: none; color: var(--text-dim); font-size: 11px;
  cursor: pointer; padding: 2px 5px; opacity: 0; flex-shrink: 0;
  transition: opacity 0.15s, color 0.15s;
}
.tech-card:hover .tc-del { opacity: 0.6; }
.tc-del:hover { opacity: 1 !important; color: #ff4466; }
.tc-copy {
  background: none; border: none; color: var(--text-dim); font-size: 13px;
  cursor: pointer; padding: 2px 5px; flex-shrink: 0;
  transition: color 0.15s;
}
.tc-copy:hover { color: #9b59b6; }

/* Add form */
.tc-add-form {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px;
}
.tc-add-fields { display: flex; flex-direction: column; gap: 6px; }
.tc-add-form input, .tc-add-form textarea, .tc-select {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-bright); font-family: var(--font-ui); font-size: 13px;
  padding: 7px 10px; width: 100%;
}
.tc-add-form input:focus, .tc-add-form textarea:focus { outline: none; border-color: #9b59b6; }
.tc-add-form input::placeholder, .tc-add-form textarea::placeholder { color: var(--text-dim); }
.tc-add-form textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.tc-select { color: var(--text-dim); color-scheme: dark; }
.tc-add-btn {
  background: rgba(155,89,182,0.15) !important;
  color: #9b59b6 !important; border: 1px solid rgba(155,89,182,0.4) !important;
  align-self: flex-start; font-size: 12px !important; padding: 6px 14px !important;
}
.tc-add-btn:hover { background: rgba(155,89,182,0.25) !important; box-shadow: none !important; }

/* Section labels */
.tech-subsection-label {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
  letter-spacing: 2px; text-transform: uppercase; padding: 4px 0 2px;
}

/* GitHub */
.tech-gh-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap;
}
.tc-repo-meta { display: flex; gap: 12px; margin-top: 4px; }
.tc-commits-area { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.tc-commit {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 11px; padding: 3px 0; border-top: 1px solid var(--border);
}
.tc-commit-sha a { font-family: var(--font-mono); color: #9b59b6; font-size: 10px; text-decoration: none; }
.tc-commit-msg { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Vercel */
.tc-deploy-state {
  font-family: var(--font-mono); font-size: 9px; border-radius: 3px;
  padding: 2px 7px; flex-shrink: 0;
}
.vc-ready    { color: #00cc88; background: rgba(0,204,136,0.12); }
.vc-building { color: #ffaa00; background: rgba(255,170,0,0.12); animation: pulse-dot 1.5s ease infinite; }
.vc-error    { color: #ff4466; background: rgba(255,68,102,0.12); }
.vc-queued   { color: var(--text-dim); background: var(--bg-4); }
.vc-canceled { color: var(--text-dim); background: var(--bg-4); }
.vc-deploy-btn { color: #9b59b6 !important; border-color: rgba(155,89,182,0.4) !important; }

/* Setup required card */
.tech-setup-card {
  background: var(--bg-2); border: 1px solid rgba(155,89,182,0.3);
  border-radius: var(--radius); padding: 20px 24px; max-width: 480px;
}
.tsc-title { font-family: var(--font-mono); color: #9b59b6; font-size: 13px; margin-bottom: 8px; }
.tsc-body  { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.tsc-body code { font-family: var(--font-mono); color: var(--text); background: var(--bg-4); padding: 1px 5px; border-radius: 3px; }

/* ─── Global tools (top nav: Chat / Agenda / Tareas) ────────── */
.global-tools {
  display: flex; gap: 4px; padding: 6px 8px 2px;
}
.global-tool-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 3px; background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-dim); cursor: pointer;
  font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.global-tool-btn:hover {
  background: var(--accent-glow); border-color: var(--border-hi); color: var(--text);
}
.global-tool-btn.active {
  background: var(--accent-glow); border-color: var(--accent); color: var(--accent);
}
.gtb-icon { font-size: 12px; line-height: 1; }
.gtb-label { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ─── Sidebar divider ────────────────────────────────────────── */
.sidebar-divider {
  height: 1px; background: var(--border); margin: 6px 12px;
}

/* ─── Pillar filter tabs (Agenda + Tareas panels) ────────────── */
.pillar-filter-tabs {
  display: flex; gap: 4px; padding: 8px 16px 0; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.pft-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 20px;
  background: transparent; color: var(--text-dim);
  font-family: var(--font-ui); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pft-btn:hover { background: var(--bg-3); color: var(--text); border-color: var(--border-hi); }
.pft-btn.active {
  background: color-mix(in srgb, var(--pc, var(--accent)) 12%, transparent);
  color: var(--pc, var(--accent));
  border-color: color-mix(in srgb, var(--pc, var(--accent)) 50%, transparent);
}
.pft-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ─── Calendar popover — pillar row ──────────────────────────── */
.cal-pop-pillar-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.cal-pop-pillar-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 10px;
  font-family: var(--font-mono); font-weight: 600;
}
.cal-pop-pillar-general { background: var(--bg-4); color: var(--text-dim); }
.cal-pop-pillar-sel {
  font-size: 10px; background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1px 4px; cursor: pointer; font-family: var(--font-ui);
}

/* ─── GitHub section labels ─────────────────────────────────── */
.gh-section-label { margin: 10px 0 4px; padding: 0 4px; }
.tc-repo-pinned   { border-color: rgba(155,89,182,0.35) !important; }
.gh-issues-label  { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; font-family: var(--font-mono); }

/* ─── MercadoPago panel ──────────────────────────────────────── */
.mp-status-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; font-size: 13px;
}
.mp-connected { color: #00cc88; font-family: var(--font-mono); font-size: 12px; }
.mp-balance-card {
  padding: 12px 16px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px;
}
.mp-balance-amount { font-family: var(--font-mono); font-size: 22px; color: var(--text-bright); margin-top: 4px; }
.mp-feature-list { padding: 0 4px; }
.mp-feature { padding: 7px 0; border-bottom: 1px solid var(--bg-3); color: var(--text-dim); font-size: 13px; }
.mp-feature:last-child { border-bottom: none; }
.mp-payment-row { padding: 10px 14px !important; }
.mp-payment-amount { font-family: var(--font-mono); font-size: 13px; color: var(--text-bright); margin-left: auto; }
.mp-status-approved  { color: #00cc88 !important; border-color: rgba(0,204,136,0.4) !important; background: rgba(0,204,136,0.1) !important; }
.mp-status-pending   { color: #ffaa00 !important; border-color: rgba(255,170,0,0.4)  !important; background: rgba(255,170,0,0.1)  !important; }
.mp-status-rejected  { color: #ff4466 !important; border-color: rgba(255,68,102,0.4) !important; background: rgba(255,68,102,0.1) !important; }
.mp-status-cancelled { color: var(--text-dim) !important; }
.vc-project-card     { border-left: 2px solid rgba(155,89,182,0.5); }

/* ─── Voice controls (header) ───────────────────────────────── */
.voice-controls {
  display: flex; gap: 4px; margin-left: auto; align-items: center;
}
.btn-voice {
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border-radius: var(--radius);
}
.btn-voice.voice-btn-on {
  color: var(--accent);
  border-color: rgba(0,170,255,0.45);
  background: rgba(0,170,255,0.08);
}
.btn-voice.tts-speaking {
  color: #00cc88 !important;
  border-color: rgba(0,204,136,0.5) !important;
  animation: tts-pulse 0.9s ease-in-out infinite !important;
}
@keyframes tts-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
/* Mic muted — red tint, static */
#btn-mic-mute.mic-muted {
  color: #ff4444;
  border-color: rgba(255,68,68,0.45);
  background: rgba(255,68,68,0.08);
}
/* Wake word fired — fast bright-green pulse while user is speaking */
.btn-voice.wake-triggered {
  color: #00cc88;
  border-color: rgba(0,204,136,0.6);
  background: rgba(0,204,136,0.15);
  animation: wake-triggered-pulse 0.75s ease-in-out infinite;
}
@keyframes wake-triggered-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(0,204,136,0.55); }
  50%       { box-shadow: 0 0 0 6px rgba(0,204,136,0);    }
}
/* Always-listening mode — subtle slow green breathe */
#btn-wake-toggle.voice-btn-on {
  color: #00cc88;
  border-color: rgba(0,204,136,0.4);
  background: rgba(0,204,136,0.08);
  animation: wake-breathe 2.4s ease-in-out infinite;
}
@keyframes wake-breathe {
  0%, 100% { opacity: 1;    box-shadow: 0 0 0   0 rgba(0,204,136,0.3); }
  50%       { opacity: 0.65; box-shadow: 0 0 8px 2px rgba(0,204,136,0.12); }
}

/* ─── Microphone button ──────────────────────────────────────── */
.btn-mic {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-mic:hover {
  background: var(--accent-glow);
  border-color: var(--border-hi);
}
/* ─── Attach picker popup ────────────────────────────────────── */
.attach-wrap { position: relative; flex-shrink: 0; display: flex; align-items: center; }
.attach-picker {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--border-hi); border-radius: 8px;
  display: flex; flex-direction: column; gap: 2px; padding: 4px;
  min-width: 148px; z-index: 50; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.attach-picker.hidden { display: none !important; }
.ap-btn {
  background: none; border: none; color: var(--text); font-family: var(--font-ui);
  font-size: 14px; padding: 9px 14px; text-align: left; border-radius: 5px;
  cursor: pointer; white-space: nowrap; width: 100%; transition: background 0.12s, color 0.12s;
}
.ap-btn:hover { background: var(--accent-glow); color: var(--accent); }

/* ─── Chat upload button ─────────────────────────────────────── */
.btn-chat-upload {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-chat-upload:hover {
  background: var(--accent-glow);
  border-color: var(--border-hi);
  color: var(--text);
}

/* Chat panel drag-and-drop overlay */
.chat-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 12, 18, 0.88);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  backdrop-filter: blur(3px);
  pointer-events: none;
}
.cdo-inner {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 2px;
  text-shadow: 0 0 16px rgba(0,170,255,0.5);
}

/* ─── Voice recording mode ───────────────────────────────────── */
/* Recording state is shown via .mic-active on the mic button only.
   No UI elements are hidden — the form layout stays intact. */

.voice-recording-indicator { display: none; align-items: center; gap: 6px; }
.voice-recording-indicator.active { display: flex; }

.vri-pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ff4466; flex-shrink: 0;
  animation: mic-pulse 1.1s ease-in-out infinite;
}
.vri-label {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-dim); letter-spacing: 2px;
}

/* Confirm (✓) button — green, replaces stop */
.btn-mic-stop {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,204,136,0.15);
  border: 1px solid #00cc88;
  border-radius: 50%;
  color: #00cc88;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-mic-stop:hover { background: rgba(0,204,136,0.30); }

/* Active / listening state */
.btn-mic.mic-active {
  border-color: #ff4466;
  background: rgba(255, 68, 102, 0.12);
  animation: mic-pulse 1.1s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(255,68,102,0.5); }
  50%       { box-shadow: 0 0 0 7px rgba(255,68,102,0); }
}

/* Ready state — text from dictation is sitting in the input. Color tint
   only (stays the 🎤 icon) — sending is still the normal ▶/Enter flow. */
.btn-mic.mic-ready-send {
  border-color: #00cc88;
  background: rgba(0,204,136,0.15);
  color: #00cc88;
}
.btn-mic.mic-ready-send:hover { background: rgba(0,204,136,0.30); }

/* ─── PWA install button ─────────────────────────────────────── */
.btn-install-pwa {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: rgba(0,170,255,0.06);
  border: 1px solid rgba(0,170,255,0.3);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn-install-pwa:hover {
  background: rgba(0,170,255,0.12);
  border-color: rgba(0,170,255,0.55);
}

/* ─── Global Chat Button ────────────────────────────────────── */
.global-chat-btn {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 12px 4px;
  padding: 8px 12px;
  background: rgba(0,170,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; text-align: left;
  cursor: pointer; width: calc(100% - 24px);
  transition: all 0.15s;
}
.global-chat-btn:hover { color: var(--accent); border-color: rgba(0,170,255,0.4); background: rgba(0,170,255,0.08); }
.global-chat-btn.active {
  color: var(--accent); border-color: var(--accent);
  background: rgba(0,170,255,0.1);
  box-shadow: 0 0 10px rgba(0,170,255,0.12);
}
.gcb-icon { font-size: 14px; color: var(--accent); }
.gcb-label { flex: 1; }
.gcb-badge {
  font-size: 10px; letter-spacing: 1px; padding: 1px 6px;
  border: 1px solid rgba(0,170,255,0.25); border-radius: 3px;
  color: var(--text-dim); opacity: 0.7;
}
.global-chat-btn.active .gcb-badge { opacity: 1; color: var(--accent); border-color: rgba(0,170,255,0.5); }

/* ─── Context pill ──────────────────────────────────────────── */
/* ─── Chat Scope Bar ─────────────────────────────────────────── */
.chat-scope-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 16px; border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
  background: rgba(255,255,255,0.02);
  transition: background 0.2s;
}
.chat-scope-bar.hidden { display: none; }
.csb-icon { opacity: 0.45; }
#csb-sources { flex: 1; letter-spacing: 0.3px; }
.csb-global-btn {
  padding: 2px 8px; border-radius: 3px; cursor: pointer;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.3px; white-space: nowrap;
}
.csb-global-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.csb-global-btn.csb-active { color: #ff8844; border-color: rgba(255,136,68,0.5); }
.chat-scope-bar-h30      { border-color: rgba(0,170,255,0.2); color: rgba(0,170,255,0.7); }
.chat-scope-bar-proyecto { border-color: rgba(0,204,136,0.2); color: rgba(0,204,136,0.7); }
.chat-scope-bar-alquimia { border-color: rgba(184,80,63,0.2); color: rgba(184,80,63,0.7); }
.chat-scope-bar-familia  { border-color: rgba(255,107,107,0.2); color: rgba(255,107,107,0.7); }
.chat-scope-bar-tech     { border-color: rgba(155,89,182,0.2); color: rgba(155,89,182,0.7); }

.context-pill {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 3px; vertical-align: middle;
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  transition: all 0.2s;
}
.context-pill-h30       { color: #00aaff; background: rgba(0,170,255,0.08);   border-color: rgba(0,170,255,0.3); }
.context-pill-proyecto  { color: #00cc88; background: rgba(0,204,136,0.08);   border-color: rgba(0,204,136,0.3); }
.context-pill-alquimia  { color: #B8503F; background: rgba(184,80,63,0.08);   border-color: rgba(184,80,63,0.3); }
.context-pill-familia,
.context-pill-hijos,
.context-pill-romina,
.context-pill-hobbies,
.context-pill-amigos    { color: #ff6b6b; background: rgba(255,107,107,0.08); border-color: rgba(255,107,107,0.3); }
.context-pill-tech,
.context-pill-odin-tech { color: #9b59b6; background: rgba(155,89,182,0.08); border-color: rgba(155,89,182,0.3); }

/* ─── Amigos ────────────────────────────────────────────────── */
.friend-add-form {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin: 0 0 16px;
}
.faf-row { display: flex; gap: 8px; }
.faf-row input { flex: 1; }
.faf-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.friend-add-form input,
.friend-add-form textarea {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-ui); font-size: 13px;
  padding: 7px 10px; width: 100%; outline: none; resize: vertical;
}
.friend-add-form input:focus,
.friend-add-form textarea:focus { border-color: #ff6b6b; }

.friends-list { display: flex; flex-direction: column; gap: 10px; }

.friend-card {
  background: var(--bg-2); border: 1px solid rgba(255,107,107,0.2);
  border-radius: var(--radius); padding: 14px 16px;
  transition: border-color 0.2s;
}
.friend-card:hover { border-color: rgba(255,107,107,0.5); }

.fc-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 6px;
}
.fc-name-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fc-name { font-family: var(--font-mono); font-size: 14px; color: #ff6b6b; font-weight: 600; }
.fc-nick { font-size: 12px; color: var(--text-dim); }

.fc-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.fc-btn { padding: 3px 8px; font-size: 12px; }

.friend-contact {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 3px; white-space: nowrap;
}
.friend-contact-green  { background: rgba(0,255,136,0.1);  color: #00ff88; }
.friend-contact-yellow { background: rgba(255,170,0,0.12); color: #ffaa00; }
.friend-contact-red    { background: rgba(255,68,102,0.12); color: #ff4466; }
.friend-contact-never  { background: rgba(106,138,170,0.12); color: var(--text-dim); }

.fc-how   { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.fc-notes { font-size: 13px; color: var(--text); margin-bottom: 6px; line-height: 1.5; }

.fc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fc-tag {
  font-family: var(--font-mono); font-size: 11px; padding: 2px 7px;
  border-radius: 3px; background: var(--bg-4); color: var(--text-dim);
}
.fc-tag-ctx { background: rgba(255,107,107,0.08); color: rgba(255,107,107,0.7); }

/* ─── Zoom control — proportional page zoom, sidebar footer ──── */
.sidebar-zoom { display: flex; gap: 1px; flex-shrink: 0; }
.sidebar-zoom button {
  background: none; border: none; color: var(--text-dim);
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 5px 5px; border-radius: var(--radius); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar-zoom button:hover { background: var(--accent-glow); color: var(--accent); }

/* ─── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--border-hi); color: var(--text-bright);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px;
  padding: 9px 18px; border-radius: var(--radius); z-index: 200;
  box-shadow: 0 0 20px rgba(0,170,255,0.15); animation: fadeUp 0.2s ease; white-space: nowrap;
}
.toast.error { border-color: #ff4466; color: #ff4466; }

/* ─── Typing indicator ──────────────────────────────────────── */
.typing-dots span {
  display: inline-block; width: 6px; height: 6px; background: var(--accent);
  border-radius: 50%; margin-right: 4px; animation: bounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ─── Animations ────────────────────────────────────────────── */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }

/* ─── Sidebar overlay (mobile backdrop) ──────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
#sidebar-overlay.visible { display: block; }

/* Mobile bar — hidden on desktop */
#mobile-bar { display: none; }
#btn-hamburger { display: none; }

/* ─── Mobile responsive (<768px) ─────────────────────────────── */
@media (max-width: 767px) {
  body { font-size: 16px; }

  /* ── Sidebar: fixed overlay, slides in from left ── */
  #sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 300;
    width: min(var(--sidebar-w), 82vw);
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  #sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.75);
  }

  /* ── Mobile top bar ── */
  #mobile-bar {
    display: flex;
    align-items: center;
    height: 48px;
    flex-shrink: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 0 14px;
    gap: 12px;
  }
  #btn-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 2px;
    transition: color 0.15s;
    flex-shrink: 0;
  }
  #btn-hamburger:hover { color: var(--accent); }
  .mobile-bar-title {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--accent);
    letter-spacing: 5px;
  }

  /* ── Main content: flex column so mobile-bar pushes panels down ── */
  #main-content {
    display: flex;
    flex-direction: column;
  }

  /* ── Panels: switch from absolute to flex child ── */
  .panel {
    position: relative !important;
    inset: auto !important;
    flex: 1;
    min-height: 0;
  }

  /* ── Panel header: compact + wrappable ── */
  .panel-header {
    padding: 8px 12px;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 44px;
  }
  .panel-header h2 { font-size: 15px; letter-spacing: 1px; }
  .panel-header .btn-ghost { font-size: 13px; padding: 4px 8px; }
  /* .header-session-tk — visible on mobile too, wraps inside flex-wrap panel-header */
  .accent { font-size: 13px; }

  /* ── Conversation tabs ── */
  .conv-tabs { padding: 4px 10px 0; gap: 2px; }
  .conv-tab  { height: 28px; padding: 0 8px 0 10px; font-size: 13px; max-width: 110px; }
  .conv-tab-label { max-width: 72px; }
  .conv-tab-new { width: 24px; height: 24px; font-size: 16px; }

  /* ── Chat ── */
  .chat-messages { padding: 10px 12px; }
  .message { padding: 10px 12px; margin-bottom: 8px; }
  .message-body { font-size: 16px; line-height: 1.55; }
  .chat-input-area { padding: 8px 10px; gap: 6px; }
  #chat-input { font-size: 16px; }
  .voice-controls { gap: 2px; margin-left: 0; }
  .btn-voice { width: 32px; height: 32px; font-size: 15px; }

  /* ── Mic button — hidden on mobile (native keyboard dictation) */
  .btn-mic, .btn-mic.mic-active, .btn-mic-stop { display: none; }
  @keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(255,68,102,0.6); }
    50%       { box-shadow: 0 0 0 10px rgba(255,68,102,0); }
  }

  /* ── Gmail ── */
  .gmail-toolbar { flex-wrap: wrap; gap: 5px; width: 100%; }
  .search-bar { flex: 1; min-width: 120px; }
  .tab-bar { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; gap: 0; }
  .tab-btn { flex-shrink: 0; font-size: 14px; padding: 8px 10px; }

  /* ── Calendar (grid fallback kept for wide mobile) ── */
  .cal-grid-wrap { padding: 8px 10px 16px; overflow-x: hidden; }
  .cal-grid      { gap: 3px; }
  .cal-weekday-row { gap: 3px; }
  .cal-day-card  { min-height: 64px; padding: 5px 6px; }
  .cal-wday-hdr  { font-size: 13px; letter-spacing: 0.5px; }
  .cal-card-num  { font-size: 16px; }
  .cal-evt-txt   { font-size: 13px; }

  /* ── Calendar agenda list (mobile) ── */
  .cal-agenda-list { padding: 8px 10px 24px; display: flex; flex-direction: column; }
  .cal-agenda-day  { margin-left: 10px; padding-left: 14px; border-left: 2px solid var(--border); margin-bottom: 20px; }
  .cal-agenda-today { border-left-color: var(--accent); }
  .cal-agenda-day-hdr { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; cursor: pointer; }
  .cal-agenda-day-name {
    font-family: var(--font-mono); font-size: 15px; font-weight: 600;
    color: var(--text-bright); text-transform: uppercase; letter-spacing: 0.5px;
  }
  .cal-agenda-today .cal-agenda-day-name { color: var(--accent); }
  .cal-agenda-day-date { font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); letter-spacing: 1px; }
  .cal-agenda-evts { display: flex; flex-direction: column; gap: 7px; }
  .cal-agenda-evt  {
    display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
    padding: 10px 12px; background: var(--bg-2);
    border: 1px solid var(--border); border-radius: var(--radius);
    transition: border-color 0.15s;
  }
  .cal-agenda-evt:active { border-color: rgba(0,170,255,0.5); }
  .cal-agenda-dot  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
  .cal-agenda-evt-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
  .cal-agenda-evt-title { font-size: 16px; color: var(--text-bright); line-height: 1.35; }
  .cal-agenda-evt-time  { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); }
  .cal-agenda-free { font-size: 15px; color: var(--text-dim); font-style: italic; padding: 3px 0; }

  /* ── Pillar filter tabs ── */
  .pillar-filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 6px 12px;
    gap: 5px;
  }
  .pft-btn { flex-shrink: 0; font-size: 13px; padding: 4px 10px; }

  /* ── Tech ── */
  #panel-tech .panel-header { flex-wrap: wrap; }
  .tech-tab-bar { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; gap: 0; }
  .tech-tab { flex-shrink: 0; font-size: 13px; padding: 7px 10px; }
  .tech-view { padding: 8px 10px !important; }

  /* ── Item lists (scrollable touch) ── */
  .item-list { -webkit-overflow-scrolling: touch; }
  .cal-outer { overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* ── Drive breadcrumb ── */
  .drive-breadcrumb { overflow-x: auto; white-space: nowrap; padding: 6px 12px; }

  /* ── Friends ── */
  .friend-card { padding: 10px 12px; }

  /* ── Global tools ── */
  .global-tools { padding: 8px 8px 4px; gap: 3px; }
  .gtb-label { font-size: 11px; }

  /* ── Sidebar user info ── */
  #user-name  { font-size: 15px; }
  #user-email { font-size: 13px; }

  /* ── WhatsApp chat list ── */
  .wci-name    { font-size: 15px; }
  .wci-preview { font-size: 14px; }
  .wci-time    { font-size: 12px; }
  .wci-badge   { font-size: 12px; }
  .wci-me      { font-size: 13px; }
  .wa-state    { font-size: 14px; }

  /* ── WhatsApp messages ── */
  .wa-msg-body   { font-size: 15px; }
  .wa-msg-time   { font-size: 12px; }
  .wa-msg-author { font-size: 12px; }

  /* ── Email modal ── */
  /* El alto lo fija el CSS (max-height: min(80vh, calc(100vh - 64px)),
     ver regla de .modal-content) — nada de forzar width/height:100vw/100dvh
     acá, eso ya se probó y terminaba mal. En celular, si el asunto + los
     íconos de acción no entran en una sola línea, los íconos bajan a una
     segunda línea DENTRO de la cabecera fija — nunca se van al pie del
     mail, así siempre quedan al alcance de la mano arriba del todo. */
  /* La fila de acciones ya tiene flex-wrap propio (ver regla base) —
     en celular simplemente envuelve si hiciera falta, sin tocar nada más. */
}

/* ── Code block with copy button ──────────────────────────── */
.code-block-wrap {
  position: relative;
  margin: 8px 0;
}
.code-block-wrap pre {
  margin: 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.55;
}
.code-block-wrap code {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text);
  white-space: pre;
}
.btn-copy-code {
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 2px 9px;
  font-size: 11px;
  background: var(--bg-4);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  z-index: 1;
}
.btn-copy-code:hover { color: var(--accent); border-color: var(--accent); }
.btn-copy-code:active { transform: scale(0.95); }

/* ─── Botón de documento generado (Google Docs/Slides/Drive) ─── */
.odin-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  padding: 9px 18px;
  background: var(--bg-4);
  color: var(--accent) !important;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.odin-doc-btn:hover {
  background: var(--accent);
  color: var(--bg) !important;
  box-shadow: 0 0 14px var(--accent-glow);
}
.odin-doc-btn-icon { font-size: 15px; line-height: 1; }

/* ─── Pre-send attachment question card ─────────────────────── */
.aq-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-3); border: 1px solid rgba(0,170,255,0.2);
  border-radius: var(--radius); padding: 14px 16px;
}
.aq-file-row { font-size: 13px; color: var(--text-bright); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aq-size { font-size: 11px; color: var(--text-dim); }
.aq-step { display: flex; flex-direction: column; gap: 8px; }
.aq-step.hidden { display: none; }
.aq-label { font-size: 12px; color: var(--text-dim); }
.aq-btns { display: flex; flex-wrap: wrap; gap: 7px; }
.aq-btn {
  padding: 6px 14px; border-radius: 6px;
  border: 1px solid var(--border-hi); background: var(--bg-4);
  color: var(--text); font-size: 12px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.aq-btn:hover:not(:disabled) { background: var(--accent-glow); border-color: var(--accent); }
.aq-btn:disabled { opacity: 0.38; cursor: default; }
.aq-btn.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.aq-summary { font-size: 12px; color: #00cc88; }

/* ─── Chat input: allow attachment row to wrap above textarea ── */
.chat-input-area { flex-wrap: wrap; }

/* ─── Pending attachment chip row ────────────────────────────── */
.chat-attachment-row {
  width: 100%; order: -1;
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 0 0 4px 0;
}
.chat-attachment-row.hidden { display: none; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-4); border: 1px solid var(--border-hi);
  border-radius: 20px; padding: 4px 10px 4px 8px;
  font-size: 12px; color: var(--text); max-width: 100%;
}
.attach-chip-icon { font-size: 14px; flex-shrink: 0; }
.attach-chip-name {
  max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.attach-chip-size { color: var(--text-dim); font-size: 11px; flex-shrink: 0; }
.attach-chip-remove {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 0 0 0 4px; font-size: 13px;
  line-height: 1; flex-shrink: 0; transition: color 0.15s;
}
.attach-chip-remove:hover { color: var(--text); }

/* Chip shown inside a sent user message */
.attach-chip-inline {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 7px; padding: 3px 9px;
  background: rgba(255,255,255,0.06); border-radius: 5px;
  font-size: 11px; color: var(--text-dim);
}

/* ─── Attachment action card (post-response) ─────────────────── */
.attach-actions-msg .message-body { padding: 0; background: none; border: none; }
.attach-actions-card {
  background: var(--bg-3);
  border: 1px solid rgba(0,170,255,0.25);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.aac-title { font-size: 13px; color: var(--text); }
.aac-title strong { color: var(--text-bright); }
.aac-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.aac-btn {
  padding: 6px 14px; border-radius: 6px;
  border: 1px solid var(--border-hi); background: var(--bg-4);
  color: var(--text); font-size: 12px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.aac-btn:hover:not(:disabled) { background: var(--accent-glow); border-color: var(--accent); }
.aac-btn:disabled { opacity: 0.45; cursor: default; }
.aac-btn.done { border-color: #00cc88; color: #00cc88; }
.aac-btn-dismiss { color: var(--text-dim); }
.aac-loading { font-size: 12px; color: var(--text-dim); font-style: italic; }
.aac-error { font-size: 12px; color: #ff4466; }

/* ─── Inline folder picker ───────────────────────────────────── */
.aac-folder-picker { display: flex; flex-direction: column; gap: 8px; }
.aac-folder-picker.hidden { display: none; }
.fp-label { font-size: 12px; color: var(--text-dim); }
.fp-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.fp-btn {
  padding: 5px 13px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-4);
  color: var(--text); font-size: 12px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fp-btn:hover { background: var(--accent-glow); border-color: var(--accent); }

/* ─── Icon button (reusable) ────────────────────────────────── */
.icon-btn {
  background: none; border: none; color: var(--text-dim); font-size: 16px;
  cursor: pointer; padding: 4px 8px; border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--accent); background: var(--accent-glow); }

/* ─── Drive: back button + breadcrumb nav ───────────────────── */
.drive-back-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 8px 0 0;
  flex-shrink: 0; transition: color 0.15s;
}
.drive-back-btn:hover { color: var(--accent); }
.breadcrumb-nav {
  background: none; border: none; font-family: inherit;
  font-size: 13px; color: var(--text-dim); cursor: pointer;
  padding: 0; transition: color 0.15s;
}
.breadcrumb-nav:hover { color: var(--accent); }

/* ─── Drive: pillar folder cards (now buttons, not links) ────── */
.dpf-clickable { cursor: pointer; text-align: left; width: 100%; }

/* ─── Drive: inline folder rows ─────────────────────────────── */
.df-section-hdr {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-dim);
  padding: 12px 16px 4px; border-bottom: 1px solid var(--border);
}
.df-list { padding: 4px 0; }
.df-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; cursor: pointer;
  transition: background 0.12s; user-select: none;
}
.df-row:hover { background: var(--bg-3); }
.df-folder { border-left: 2px solid transparent; }
.df-folder:hover { border-left-color: var(--accent); }
.df-file   { border-left: 2px solid transparent; }
.df-file:hover { border-left-color: rgba(0,170,255,0.25); }
.df-icon { font-size: 16px; flex-shrink: 0; }
.df-name { flex: 1; font-size: 13px; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.df-chev { color: var(--text-dim); font-size: 16px; flex-shrink: 0; }
.df-ext {
  font-size: 13px; color: var(--text-dim); flex-shrink: 0;
  text-decoration: none; padding: 2px 6px; border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}
.df-ext:hover { color: var(--accent); background: var(--accent-glow); }

/* Shortcut indicator (⤷ superscript on icon) */
.df-sc-mark {
  font-size: 8px; line-height: 1; vertical-align: super;
  color: var(--accent); font-family: var(--font-mono); font-style: normal;
}
.df-shortcut .df-name { font-style: italic; }

/* Load-more pagination button */
.drive-load-more {
  width: 100%; margin-top: 6px; padding: 7px 12px;
  background: none; border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-dim); font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 1px; cursor: pointer; text-align: center;
  transition: border-color 0.15s, color 0.15s;
}
.drive-load-more:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Drive file viewer modal (bottom drawer) ───────────────── */
.drive-viewer {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: flex-end;
}
.drive-viewer.hidden { display: none !important; }
.dv-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.7);
}
.dv-panel {
  position: relative; z-index: 1; background: var(--bg-2);
  border-top: 2px solid var(--border-hi); border-radius: 14px 14px 0 0;
  width: 100%; height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  animation: dvSlideUp 0.22s ease;
}
@keyframes dvSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.dv-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-3); flex-shrink: 0;
}
.dv-icon { font-size: 18px; flex-shrink: 0; }
.dv-filename {
  flex: 1; font-size: 14px; color: var(--text-bright);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dv-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dv-drive-link {
  font-size: 12px; color: var(--accent); text-decoration: none;
  padding: 4px 10px; border: 1px solid var(--border-hi); border-radius: 4px;
  white-space: nowrap; transition: background 0.15s;
}
.dv-drive-link:hover { background: var(--accent-glow); }
.dv-body {
  flex: 1; overflow: auto; display: flex; flex-direction: column; min-height: 0;
}
.dv-loading {
  display: flex; align-items: center; justify-content: center;
  flex: 1; color: var(--text-dim); font-size: 13px;
}
.dv-error  { padding: 24px; color: #e74c3c; text-align: center; font-size: 13px; }
.dv-empty  { padding: 24px; color: var(--text-dim); text-align: center; font-size: 13px; }
.dv-img-wrap {
  display: flex; align-items: center; justify-content: center;
  flex: 1; padding: 20px; background: var(--bg);
}
.dv-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.dv-iframe { width: 100%; flex: 1; border: none; min-height: 0; background: #fff; }
.dv-text {
  padding: 20px; color: var(--text); font-family: var(--font-mono); font-size: 12px;
  line-height: 1.7; white-space: pre-wrap; overflow-x: auto;
}
.dv-table-wrap { flex: 1; overflow: auto; padding: 8px; }
.dv-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.dv-table th {
  background: var(--bg-3); color: var(--accent); border: 1px solid var(--border);
  padding: 6px 12px; text-align: left; white-space: nowrap; position: sticky; top: 0;
}
.dv-table td { border: 1px solid var(--border); padding: 5px 12px; color: var(--text); }
.dv-table tr:nth-child(even) td { background: var(--bg-3); }

/* ─── Subgroup info panel ────────────────────────────────────── */
#panel-subgroup { display: flex; flex-direction: column; overflow: hidden; }

/* Header */
.sgp-header {
  padding: 16px 20px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sgp-title-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.sgp-icon { font-size: 20px; flex-shrink: 0; }
.sgp-name { font-family: var(--font-mono); font-size: 16px; font-weight: 400; color: var(--text-bright); flex: 1; }
.sgp-hdr-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sgp-hdr-btn {
  padding: 4px 11px; border: 1px solid var(--border-hi); border-radius: 4px;
  background: none; color: var(--text-dim); font-family: var(--font-ui); font-size: 12px;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.sgp-hdr-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
.sgp-meta { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--text-dim); }
.sgp-pillar-tag {
  padding: 2px 8px; border-radius: 3px; font-size: 10px; letter-spacing: .07em; font-family: var(--font-mono);
  background: var(--accent-glow); color: var(--accent); border: 1px solid var(--border-hi);
}
.sgp-updated { font-family: var(--font-mono); }

/* Body */
.sgp-body { flex: 1; overflow-y: auto; padding: 0 0 24px; }

/* Sections */
.sgp-section {
  border-bottom: 1px solid var(--border); padding: 0;
}
.sgp-section-last { border-bottom: none; }

/* ─── Subgroup ficha (Cliente / CUIT / Dirección / Tipo de fee) ── */
.sgp-ficha-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; padding: 14px 20px; }
.sgp-ficha-field { display: flex; flex-direction: column; gap: 4px; }
.sgp-ficha-label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; color: var(--text-dim); text-transform: uppercase; }
.sgp-ficha-inp {
  background: var(--input-bg, rgba(255,255,255,0.06)); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; padding: 6px 9px; color: var(--text-main); font-family: var(--font-ui); font-size: 13px;
}
.sgp-ficha-inp:focus { outline: none; border-color: var(--accent); }

/* ─── Subgroup contactos (generic contact list) ─────────────────── */
.sgp-contactos-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 20px; }
.sgp-contacto-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto auto; gap: 8px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sgp-contacto-row:last-child { border-bottom: none; }
.sgp-contacto-inp {
  background: var(--input-bg, rgba(255,255,255,0.06)); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; padding: 6px 8px; color: var(--text-main); font-family: var(--font-ui);
  font-size: 12px; width: 100%; box-sizing: border-box;
}
.sgp-contacto-inp:focus { outline: none; border-color: var(--accent); }
/* Native <select> popup ignores parent styling unless told explicitly to stay dark */
select.sgp-contacto-inp { color-scheme: dark; }
select.sgp-contacto-inp option { background: var(--bg-3); color: var(--text); }
.sgp-ct-save-btn {
  font-size: 11px; padding: 3px 8px; border-radius: 3px; border: 1px solid rgba(0,170,255,0.35);
  background: transparent; color: rgba(0,170,255,0.85); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.sgp-ct-save-btn:hover  { background: rgba(0,170,255,0.12); color: #00aaff; }
.sgp-ct-save-btn:disabled { opacity: 0.5; cursor: default; }
.sgp-ct-remove-btn {
  font-size: 11px; padding: 3px 8px; border-radius: 3px; border: 1px solid rgba(255,68,68,0.3);
  background: transparent; color: rgba(255,68,68,0.7); cursor: pointer; transition: background 0.15s, color 0.15s;
}
.sgp-ct-remove-btn:hover { background: rgba(255,68,68,0.12); color: #ff5566; }

@media (max-width: 767px) {
  .sgp-ficha-grid { grid-template-columns: 1fr; }
  .sgp-contacto-row { grid-template-columns: 1fr 1fr; }
}

.sgp-section-hdr {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px 6px; background: var(--bg-3);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dim); border-bottom: 1px solid var(--border);
}
.sgp-section-hdr span:first-child { flex: 1; }
.sgp-sec-btn {
  padding: 2px 8px; border: 1px solid var(--border); border-radius: 3px;
  background: none; color: var(--text-dim); font-size: 11px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s; white-space: nowrap; font-family: var(--font-mono);
}
.sgp-sec-btn:hover { color: var(--accent); border-color: var(--accent); }
.sgp-folder-name { font-size: 10px; color: var(--accent); letter-spacing: .04em; }
.sgp-empty { padding: 14px 20px; color: var(--text-dim); font-size: 12px; }

/* Description textarea */
.sgp-description {
  width: 100%; box-sizing: border-box;
  background: transparent; border: none; color: var(--text); font-family: var(--font-ui); font-size: 13px;
  line-height: 1.6; resize: none; padding: 12px 20px; min-height: 80px;
  outline: none; transition: background 0.15s;
}
.sgp-description:focus { background: var(--bg-3); }

/* Info grid */
.sgp-grid-table { width: 100%; border-collapse: collapse; }
.sgp-grid-table tr { border-bottom: 1px solid var(--border); }
.sgp-grid-table tr:last-child { border-bottom: none; }
.sgp-grid-table td { padding: 4px 6px; }
.sgp-grid-table td:first-child { width: 38%; padding-left: 20px; }
.sgp-grid-table td:last-child  { width: 36px; text-align: center; padding-right: 12px; }
.sgp-key-inp, .sgp-val-inp {
  width: 100%; background: transparent; border: none; padding: 5px 4px;
  color: var(--text); font-family: var(--font-ui); font-size: 13px; border-radius: 3px;
  outline: none; transition: background 0.15s;
}
.sgp-key-inp { color: var(--text-dim); font-weight: 600; }
.sgp-key-inp:focus, .sgp-val-inp:focus { background: var(--bg-3); }
.sgp-grid-empty { padding: 10px 20px; color: var(--text-dim); font-size: 12px; }
.sgp-del-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 12px; padding: 3px 6px; border-radius: 3px; transition: color 0.15s, background 0.15s;
}
.sgp-del-btn:hover { color: #e74c3c; background: rgba(231,76,60,0.1); }

/* Documents */
.sgp-docs-list { padding: 4px 0; }
.sgp-doc-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 20px;
  cursor: pointer; transition: background 0.12s;
}
.sgp-doc-row:hover { background: var(--bg-3); }
.sgp-doc-icon { font-size: 15px; flex-shrink: 0; }
.sgp-doc-name { flex: 1; font-size: 13px; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgp-doc-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.sgp-doc-ext  { color: var(--text-dim); font-size: 13px; flex-shrink: 0; text-decoration: none; padding: 2px 5px; border-radius: 3px; transition: color 0.15s; }
.sgp-doc-ext:hover { color: var(--accent); }
.sgp-link-form {
  display: flex; align-items: center; gap: 6px; padding: 8px 20px;
  background: var(--bg-3); border-top: 1px solid var(--border);
}
.sgp-link-input {
  flex: 1; background: var(--bg-4); border: 1px solid var(--border); border-radius: 4px;
  padding: 5px 9px; color: var(--text); font-family: var(--font-ui); font-size: 13px; outline: none;
}
.sgp-link-input:focus { border-color: var(--accent); }

/* Notes */
.sgp-notes-list { padding: 4px 0; max-height: 260px; overflow-y: auto; }
.sgp-note-row { padding: 10px 20px; border-bottom: 1px solid var(--border); }
.sgp-note-row:last-child { border-bottom: none; }
.sgp-note-text { font-size: 13px; color: var(--text); line-height: 1.5; word-break: break-word; }
.sgp-note-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.sgp-note-date { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }

/* Tasks */
.sgp-tasks-list { padding: 4px 0; max-height: 240px; overflow-y: auto; }
.sgp-task-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 20px;
  border-bottom: 1px solid var(--border);
}
.sgp-task-row:last-child { border-bottom: none; }
.sgp-task-done .sgp-task-text { text-decoration: line-through; color: var(--text-dim); }
.sgp-task-check { display: flex; align-items: center; flex-shrink: 0; cursor: pointer; }
.sgp-task-check input { display: none; }
.sgp-task-box {
  width: 16px; height: 16px; border: 2px solid var(--border-hi); border-radius: 3px;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s, border-color 0.15s;
}
.sgp-task-check input:checked + .sgp-task-box {
  background: var(--accent); border-color: var(--accent);
}
.sgp-task-check input:checked + .sgp-task-box::after { content: '✓'; font-size: 10px; color: #000; }
.sgp-task-text { flex: 1; font-size: 13px; color: var(--text); word-break: break-word; }

/* Shared add form */
.sgp-add-row-form {
  display: flex; gap: 6px; padding: 8px 20px;
  background: var(--bg-3); border-top: 1px solid var(--border);
}
.sgp-add-input {
  flex: 1; background: var(--bg-4); border: 1px solid var(--border); border-radius: 4px;
  padding: 5px 9px; color: var(--text); font-family: var(--font-ui); font-size: 13px; outline: none;
}
.sgp-add-input:focus { border-color: var(--accent); }

/* ─── Mail account selector (Gmail / IMAP accounts) ───────────── */
.gmail-account-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-3); flex-shrink: 0;
}
.gmail-account-btn {
  background: var(--bg-4); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text-dim); font-family: var(--font-ui);
  font-size: 12px; font-weight: 600; padding: 4px 14px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.gmail-account-btn:hover { border-color: var(--accent); color: var(--text); }
.gmail-account-btn.active {
  background: var(--accent-glow); border-color: var(--accent); color: var(--accent);
}

/* ─── WhatsApp session selector ─────────────────────────────── */
.wa-session-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-3); flex-shrink: 0;
}
.wa-session-btn {
  background: var(--bg-4); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text-dim); font-family: var(--font-ui);
  font-size: 12px; font-weight: 600; padding: 4px 14px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.wa-session-btn:hover { border-color: var(--accent); color: var(--text); }
.wa-session-btn.active {
  background: var(--accent-glow); border-color: var(--accent); color: var(--accent);
}

/* ─── Gmail pillar bar + sublabel chips ─────────────────────── */
.gmail-pillar-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-3); flex-shrink: 0;
}
.gmail-pillar-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent); white-space: nowrap;
}
.gmail-label-chips {
  display: flex; gap: 6px; overflow-x: auto; flex: 1;
  -webkit-overflow-scrolling: touch;
}
.gmail-label-chips::-webkit-scrollbar { height: 3px; }
.gmail-label-chip {
  flex-shrink: 0; background: var(--bg-4); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text-dim); font-family: var(--font-ui);
  font-size: 12px; padding: 3px 12px; cursor: pointer; white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.gmail-label-chip:hover { border-color: var(--accent); color: var(--text); }
.gmail-label-chip.active {
  background: var(--accent-glow); border-color: var(--accent); color: var(--accent);
}

/* ─── Contacts panel ─────────────────────────────────────────── */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px; padding: 14px 16px; align-content: start;
}
.contact-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.contact-card:hover { border-color: var(--accent); background: var(--bg-4); }
.contact-card--incomplete { border-color: rgba(220, 60, 60, 0.55); }
.contact-card--incomplete:hover { border-color: #e05454; }
.contact-card-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: #000; flex-shrink: 0;
}
.contact-card-body { flex: 1; min-width: 0; }
.contact-card-name { font-size: 14px; color: var(--text-bright); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-card-company { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-card-email { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-card-pillars { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.contact-card-match   { font-size: 10px; color: var(--accent); opacity: 0.7; font-family: var(--font-mono); letter-spacing: .04em; }

/* Pillar badges */
.pillar-badge {
  display: inline-block; font-size: 10px; font-family: var(--font-mono);
  letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 10px; border: 1px solid;
}
.pillar-badge-h30      { color: #00aaff; border-color: rgba(0,170,255,0.35); background: rgba(0,170,255,0.08); }
.pillar-badge-proyecto { color: #00cc88; border-color: rgba(0,204,136,0.35); background: rgba(0,204,136,0.08); }
.pillar-badge-alquimia { color: #B8503F; border-color: rgba(184,80,63,0.35);  background: rgba(184,80,63,0.08); }
.pillar-badge-familia  { color: #ff6b6b; border-color: rgba(255,107,107,0.35); background: rgba(255,107,107,0.08); }
.pillar-badge-tech     { color: #9b59b6; border-color: rgba(155,89,182,0.35); background: rgba(155,89,182,0.08); }

/* Contact modal */
.contact-modal-body { position: relative; padding: 16px 20px; overflow-y: auto; max-height: calc(90vh - 60px); }
.contact-detail { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.contact-detail-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: #000;
}
.contact-detail-fields { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.cdf-row { display: flex; gap: 10px; align-items: flex-start; }
.cdf-row label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; min-width: 96px; flex-shrink: 0; padding-top: 7px; }
.cdf-row span, .cdf-row a { font-size: 14px; color: var(--text); word-break: break-word; }
.cdf-row a { color: var(--accent); text-decoration: none; }
.cdf-row a:hover { text-decoration: underline; }
.cdf-row-notes { align-items: flex-start; }

/* Editable inputs inside contact modal */
.cd-input {
  flex: 1; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); padding: 5px 8px;
  font-family: var(--font-ui); font-size: 13px;
  outline: none; transition: border-color 0.15s;
  width: 100%;
}
.cd-input:focus { border-color: var(--accent); }
.cd-textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.cd-actions { width: 100%; display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.cd-save-btn { flex: 1; justify-content: center; letter-spacing: 2px; }
.cd-delete-btn { flex-shrink: 0; color: #ff4444; border-color: rgba(255,68,68,0.3); }
.cd-delete-btn:hover { color: #ff4444; border-color: #ff4444; background: rgba(255,68,68,0.08); }

/* Unsaved-changes confirm overlay */
.cd-confirm-overlay {
  position: absolute; inset: 0;
  background: rgba(5, 12, 18, 0.88);
  display: flex; align-items: center; justify-content: center;
  z-index: 10; border-radius: 0 0 var(--radius) var(--radius);
}
.cd-confirm-overlay.hidden { display: none; }
.cd-confirm-box {
  background: var(--bg-2); border: 1px solid var(--border-hi);
  border-radius: 8px; padding: 28px 32px; display: flex; flex-direction: column;
  gap: 18px; align-items: center; box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}
.cd-confirm-msg { font-size: 15px; color: var(--text-bright); font-family: var(--font-mono); letter-spacing: .04em; }
.cd-confirm-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cd-confirm-save-btn { justify-content: center; padding: 8px 20px; }
.clm-content { display: flex; flex-direction: column; gap: 3px; }
.clm-subject { font-size: 13px; color: var(--text-bright); font-weight: 500; }
.clm-meta { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }
.clm-snippet { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.clm-empty { font-size: 12px; color: var(--text-dim); }

/* Pillar assignment buttons */
.contact-pillar-assign, .pillar-assign-row {
  width: 100%; display: flex; flex-direction: column; gap: 8px;
}
.cpa-label, .field-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.cpa-btns, .nc-pillar-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.cpa-btn {
  padding: 4px 14px; border-radius: 12px; font-size: 12px; font-family: var(--font-ui);
  border: 1px solid var(--border); background: var(--bg-4); color: var(--text);
  cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cpa-btn:hover { border-color: var(--pc, var(--accent)); color: var(--pc, var(--accent)); }
.cpa-btn.active { border-color: var(--pc, var(--accent)); background: var(--pc, var(--accent)); color: #050c12; font-weight: 600; }

/* Categorization modal */
.cat-progress { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); margin-left: auto; padding-right: 12px; }
.categorize-body { padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 30px; min-width: 260px;
}
.cat-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: #000;
}
.cat-name { font-size: 16px; color: var(--text-bright); font-weight: 500; }
.cat-sub { font-size: 12px; color: var(--text-dim); }
.cat-pillar-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cat-pillar-btn {
  padding: 6px 18px; border-radius: 14px; font-size: 13px;
  border: 1px solid var(--border); background: var(--bg-4); color: var(--text);
  cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cat-pillar-btn:hover { border-color: var(--accent); color: var(--accent); }
.cat-pillar-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.cat-actions { display: flex; gap: 10px; }
.cat-done { font-size: 15px; color: #00cc88; padding: 24px; text-align: center; }

/* ─── Pillar Memory panel ────────────────────────────────────── */
.pillar-memory-content {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 20px;
}
.pm-section { display: flex; flex-direction: column; gap: 8px; }
.pm-section-title {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 10px;
}
.pm-last-updated { font-size: 11px; color: var(--text-dim); }
.pm-textarea {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-ui); font-size: 13px; line-height: 1.55;
  padding: 10px 12px; resize: vertical; outline: none;
  transition: border-color 0.15s;
}
.pm-textarea:focus { border-color: var(--accent); }
.pm-keypoints {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.pm-section-hdr {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.pm-kp-controls { display: flex; align-items: center; gap: 6px; }
.pm-kp-item {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-left: 4px solid #4b5563;
  border-radius: var(--radius); padding: 7px 10px;
  transition: opacity 0.15s, box-shadow 0.1s;
}
.pm-kp-item--alta  { border-left-color: #ef4444; }
.pm-kp-item--media { border-left-color: #f59e0b; }
.pm-kp-item--baja  { border-left-color: #22c55e; }
.pm-kp-item--none  { border-left-color: #4b5563; }
.pm-kp-handle {
  cursor: grab; color: var(--text-dim); font-size: 14px; line-height: 1.4;
  flex-shrink: 0; user-select: none; touch-action: none;
}
.pm-kp-handle:active { cursor: grabbing; }
.pm-kp-item.pm-kp-dragging { opacity: 0.4; box-shadow: 0 6px 16px rgba(0,0,0,0.35); }
.pm-kp-item.pm-kp-dragover-before { box-shadow: inset 0 2px 0 var(--pc, var(--accent)); }
.pm-kp-item.pm-kp-dragover-after  { box-shadow: inset 0 -2px 0 var(--pc, var(--accent)); }
.pm-kp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pm-kp-text {
  color: var(--text); font-size: 13px; outline: none; word-break: break-word;
  display: block; width: 100%; margin: 0; padding: 0; border: none;
  background: transparent; resize: none; overflow: hidden;
  font-family: inherit; line-height: 1.4;
}
.pm-kp-text:focus { color: var(--text-bright); }
.pm-kp-date { font-size: 10px; color: var(--text-dim); }
.pm-kp-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; padding-top: 1px; }
.pm-kp-prio {
  padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 600;
  cursor: pointer; border: none; text-transform: uppercase; letter-spacing: 0.4px;
  transition: opacity 0.15s;
}
.pm-kp-prio:hover { opacity: 0.7; }
.pm-prio-alta  { background: rgba(255,68,68,0.15);  color: #ff4444; }
.pm-prio-media { background: rgba(255,170,0,0.15);  color: #ffaa00; }
.pm-prio-baja  { background: rgba(0,170,255,0.15);  color: #00aaff; }
.pm-prio-none  { background: rgba(75,85,99,0.15);   color: #9ca3af; }
.pm-kp-del {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 12px; padding: 0 2px; flex-shrink: 0;
  transition: color 0.15s;
}
.pm-kp-del:hover { color: #ff4466; }
.pm-add-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-dim); font-size: 11px; padding: 2px 9px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.pm-add-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Colegio panel ──────────────────────────────────────────── */
.colegio-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  padding: 0 16px; flex-shrink: 0;
}
.colegio-tab {
  padding: 9px 20px; background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-family: var(--font-ui); font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.colegio-tab:hover { color: var(--text); }
.colegio-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.colegio-content {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ─── Clima Widget ──────────────────────────────────────────── */
.clima-widget {
  position: relative; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  background: rgba(5, 12, 18, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 170, 255, 0.18);
  font-family: 'Share Tech Mono', 'Rajdhani', monospace;
  min-height: 52px;
  flex-shrink: 0;
}
.clima-widget.hidden { display: none !important; }
.cw-left {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.cw-icon { font-size: 1.5rem; line-height: 1; }
.cw-temps { display: flex; flex-direction: column; align-items: flex-end; }
.cw-temp  { font-size: 1.3rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.cw-feels { font-size: 0.68rem; color: var(--text-muted); }
.cw-range { display: flex; flex-direction: column; }
.cw-city  { font-size: 0.72rem; color: var(--accent); letter-spacing: 0.04em; }
.cw-minmax{ font-size: 0.68rem; color: var(--text-muted); }
.cw-desc  { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }
.cw-hours { display: flex; gap: 8px; margin-left: auto; }
.cw-chip  {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: rgba(0,170,255,0.07); border: 1px solid rgba(0,170,255,0.15);
  border-radius: 6px; padding: 4px 8px; min-width: 44px;
}
.cw-chip-hour { font-size: 0.62rem; color: var(--text-muted); }
.cw-chip-icon { font-size: 0.9rem; line-height: 1.2; }
.cw-chip-temp { font-size: 0.68rem; color: var(--text); }
.cw-meta {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0; margin-left: 8px;
}
.cw-ts { font-size: 0.58rem; color: var(--text-muted); white-space: nowrap; }
.cw-refresh {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 0.9rem; padding: 2px 4px; border-radius: 4px; transition: color 0.2s;
}
.cw-refresh:hover { color: var(--accent); }

@media (max-width: 767px) {
  .cw-hours { display: none; }
  .cw-desc  { display: none; }
  .cw-meta  { display: none; }
  .clima-widget { padding: 6px 12px; min-height: 44px; }
}
.colegio-section { display: flex; flex-direction: column; gap: 8px; }

/* ─── Inline edit ✓/✕ ───────────────────────────────────────── */
.ife-btns {
  display: flex; flex-direction: row; gap: 4px; flex-shrink: 0; align-self: flex-end;
}
.ife-ok, .ife-cancel {
  width: 22px; height: 22px; padding: 0; border-radius: 3px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.ife-ok {
  border: 1px solid rgba(0, 204, 136, 0.4);
  color: #00cc88; background: rgba(0, 204, 136, 0.08);
}
.ife-ok:hover:not(:disabled) { background: rgba(0, 204, 136, 0.22); }
.ife-ok:disabled { opacity: 0.45; cursor: wait; }
.ife-ok.ife-saved {
  background: #00cc88 !important; color: #001a0f !important;
  animation: ife-pulse 0.25s ease-out;
}
.ife-cancel {
  border: 1px solid rgba(100, 120, 140, 0.28);
  color: var(--text-dim); background: transparent;
}
.ife-cancel:hover {
  border-color: rgba(255, 68, 68, 0.45); color: #ff5566; background: rgba(255, 68, 68, 0.07);
}
.ife-active { outline: 1px solid rgba(0, 170, 255, 0.5) !important; outline-offset: 1px; }
.ife-error  { outline: 1px solid rgba(255, 68, 68, 0.7) !important; outline-offset: 1px; }
@keyframes ife-pulse {
  0%   { transform: scale(1.2); }
  100% { transform: scale(1);   }
}

/* ─── WA Reply Notification Banner ──────────────────────────────── */
.wa-reply-notif {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(0, 204, 136, 0.12);
  border-bottom: 1px solid rgba(0, 204, 136, 0.28);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.4;
  animation: wa-notif-slide 0.25s ease-out;
  position: sticky;
  top: 0;
  z-index: 200;
}
.wa-reply-notif.hidden { display: none; }
.wa-reply-notif-icon { color: rgba(0, 204, 136, 0.7); flex-shrink: 0; font-size: 12px; }
.wa-reply-notif-dismiss {
  margin-left: auto;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(0, 204, 136, 0.3);
  color: rgba(0, 204, 136, 0.7);
  width: 20px;
  height: 20px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background 0.15s, color 0.15s;
}
.wa-reply-notif-dismiss:hover { background: rgba(0, 204, 136, 0.18); color: #00cc88; }
@keyframes wa-notif-slide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Save conversation button ──────────────────────────────── */
.btn-save-conv {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--save-btn-color, var(--text-muted));
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.btn-save-conv:hover:not(:disabled) {
  border-color: var(--save-btn-color, var(--accent));
  background: rgba(0, 170, 255, 0.06);
}
.btn-save-conv:disabled { opacity: 0.45; cursor: default; }
.bsc-icon { font-size: 13px; line-height: 1; }
.bsc-label { font-family: var(--font-ui); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }

/* ─── Restore conversation card ─────────────────────────────── */
.restore-conv-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; margin: 8px 16px 0;
  background: rgba(0, 170, 255, 0.06);
  border: 1px solid rgba(0, 170, 255, 0.2);
  border-radius: 8px; flex-shrink: 0;
}
.rcc-icon { color: var(--accent); font-size: 14px; flex-shrink: 0; }
.rcc-text { flex: 1; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.rcc-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-muted); cursor: pointer; padding: 3px 10px;
  font-size: 11px; font-family: var(--font-ui); transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0; white-space: nowrap;
}
.rcc-restore { border-color: rgba(0,170,255,0.3); color: var(--accent); }
.rcc-restore:hover { border-color: var(--accent); background: var(--accent-glow); }
.rcc-dismiss:hover { border-color: var(--border-hi); color: var(--text); }

/* ─── WhatsApp panel ────────────────────────────────────────── */
/* ── WhatsApp panel ──────────────────────────────────────────── */
.wa-status-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; background: var(--bg-2); border-bottom: 1px solid var(--border);
  font-size: 13px; flex-shrink: 0;
}
.wa-state { font-family: var(--font-mono); font-size: 12px; padding: 2px 8px; border-radius: 3px; }
.wa-state-ok      { background: rgba(0,200,100,0.12); color: #00cc64; border: 1px solid rgba(0,200,100,0.3); }
.wa-state-qr      { background: rgba(255,170,0,0.1);  color: #ffaa00; border: 1px solid rgba(255,170,0,0.3); }
.wa-state-loading { background: rgba(0,170,255,0.08); color: var(--accent); border: 1px solid var(--border); }
.wa-state-error   { background: rgba(255,80,80,0.1);  color: #ff5050; border: 1px solid rgba(255,80,80,0.3); }
.wa-connect-btn {
  background: var(--accent); color: #000; border: none; border-radius: var(--radius);
  padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-ui); letter-spacing: 0.5px;
}
.wa-icon-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-dim); padding: 3px 8px; cursor: pointer; font-size: 14px; margin-left: auto;
}
.wa-icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.wa-connect-btn--retry {
  background: rgba(255,170,0,0.15); color: #ffaa00;
  border: 1px solid rgba(255,170,0,0.4);
}
.wa-connect-btn--retry:hover { background: rgba(255,170,0,0.25); }
.wa-connect-btn--clear {
  background: rgba(255,80,80,0.1); color: #ff5050;
  border: 1px solid rgba(255,80,80,0.35); font-size: 11px;
}
.wa-connect-btn--clear:hover { background: rgba(255,80,80,0.2); }

/* Chat list — single column */
.wa-chat-list { overflow-y: auto; flex: 1; }
.wa-chat-item { border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.wa-chat-item--active { border-left-color: var(--accent); background: var(--bg-2); }
.wa-chat-unread .wci-summary { background: rgba(0,170,255,0.04); }
.wci-summary {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; cursor: pointer; transition: background 0.12s;
}
.wci-summary:hover { background: var(--bg-2); }
.wci-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #000;
}
.wci-body    { flex: 1; min-width: 0; }
.wci-top     { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.wci-name    { font-weight: 600; color: var(--text-bright); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wci-time    { font-size: 10px; color: var(--text-dim); flex-shrink: 0; font-family: var(--font-mono); }
.wci-preview { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.wci-me      { color: var(--accent); font-size: 11px; flex-shrink: 0; }
.wci-badge   { background: #25d366; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 10px; margin-left: auto; flex-shrink: 0; }
.wci-chevron { font-size: 16px; color: var(--text-dim); flex-shrink: 0; transition: transform 0.18s; line-height: 1; }
.wa-chat-item--unknown .wci-name { color: var(--text-dim); font-style: italic; }
.wci-avatar--unknown { opacity: 0.5; }
.wci-unknown-tag { background: rgba(255,170,0,0.2); color: #ffaa00; font-size: 10px; padding: 0 4px; border-radius: 3px; font-style: normal; margin-right: 3px; }
.wci-add-contact { margin-top: 3px; }
.wci-add-btn {
  background: none; border: 1px solid rgba(0,170,255,0.3); border-radius: 3px;
  color: var(--accent); font-size: 11px; padding: 2px 8px; cursor: pointer;
  font-family: var(--font-ui); transition: background 0.12s;
}
.wci-add-btn:hover { background: rgba(0,170,255,0.1); }
.wa-chat-item--active .wci-chevron { transform: rotate(90deg); color: var(--accent); }
.wci-avatar--group { font-size: 16px; }
.wci-group-tag { background: rgba(0,170,255,0.18); color: var(--accent); font-size: 10px; padding: 0 4px; border-radius: 3px; font-style: normal; margin-right: 3px; }

/* Inline thread (accordion) — identidad propia y clara ("Frío ODIN"), a
   propósito distinta del resto de la app oscura: es la zona de lectura y
   escritura, y necesita leerse como tal a simple vista. Comparte tokens
   --light-* con el popup de mail para que ambas superficies claras luzcan
   parte del mismo sistema (ver :root). */
.wa-thread { display: none; flex-direction: column; border-top: 1px solid var(--border-hi); }
.wa-thread.open { display: flex; }
.wa-messages {
  max-height: 380px; overflow-y: auto;
  padding: 12px 16px; display: flex; flex-direction: column; gap: 4px;
  background: var(--light-bg);
}
.wa-msg { max-width: 78%; display: flex; flex-direction: column; gap: 2px; }
.wa-msg-in  { align-self: flex-start; }
.wa-msg-out { align-self: flex-end; }
.wa-msg-body {
  padding: 7px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45;
  word-break: break-word; white-space: pre-wrap;
}
.wa-msg-in  .wa-msg-body { background: var(--light-bg-alt);     color: var(--light-text); border-radius: 2px 10px 10px 10px; }
.wa-msg-out .wa-msg-body { background: var(--light-bg-accent); color: var(--light-text); border-radius: 10px 2px 10px 10px; }
.wa-msg-author { font-size: 11px; font-weight: 600; padding: 0 4px; }
.wa-msg-time { font-size: 10px; color: var(--light-dim); padding: 0 4px; font-family: var(--font-mono); }
.wa-audio { max-width: 220px; height: 32px; accent-color: var(--light-accent); display: block; }
.wa-msg-in  .wa-msg-time { align-self: flex-start; }
.wa-msg-out .wa-msg-time { align-self: flex-end; }
.wa-reply-form {
  display: flex; gap: 8px; padding: 10px 14px;
  border-top: 1px solid var(--light-border); flex-shrink: 0; background: var(--light-bg);
}
.wa-reply-input {
  flex: 1; background: var(--light-bg-alt); border: 1px solid var(--light-border); border-radius: 20px;
  color: var(--light-text); padding: 8px 14px; font-size: 13px; font-family: var(--font-ui);
  outline: none; transition: border-color 0.15s;
}
.wa-reply-input::placeholder { color: var(--light-dim); }
.wa-reply-input:focus { border-color: var(--light-accent); }
.wa-reply-send {
  background: var(--light-accent); border: none; border-radius: 50%; width: 36px; height: 36px;
  color: #fff; font-size: 14px; cursor: pointer; flex-shrink: 0;
}
.wa-reply-send:hover { opacity: 0.85; }

/* QR modal */
.wa-qr-modal-content { max-width: 380px; width: 95vw; }
.wa-qr-container { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wa-qr-img { width: 240px; height: 240px; border: 2px solid var(--border); border-radius: var(--radius); }
.wa-qr-instructions { font-size: 13px; color: var(--text); text-align: center; }
.wa-qr-hint { font-size: 11px; color: var(--text-dim); text-align: center; font-family: var(--font-mono); }
.wa-qr-loading { font-family: var(--font-mono); color: var(--text-dim); font-size: 13px; }
.wa-qr-ok    { font-family: var(--font-mono); color: #25d366; font-size: 18px; }
.wa-qr-error { color: #ff5050; font-size: 13px; text-align: center; }

/* Generic states */
.wa-loading { padding: 24px; text-align: center; color: var(--text-dim); font-family: var(--font-mono); font-size: 13px; }
.wa-empty   { padding: 24px; text-align: center; color: var(--text-dim); font-size: 13px; }
.wa-error   { padding: 16px; color: #ff5050; font-size: 13px; }
.wa-connect-prompt {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  padding: 48px 24px; text-align: center;
  color: var(--text-dim); font-family: var(--font-mono); font-size: 13px;
}
.wa-connect-prompt p { margin: 0; }
.wa-qr-inline {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 24px 16px;
}
.wa-qr-img-inline {
  width: 280px; height: 280px;
  border: 2px solid var(--border); border-radius: var(--radius);
  display: block;
}
.wa-qr-expire { font-size: 10px; color: var(--text-dim); font-family: var(--font-mono); }
