/* ════════════════════════════════════════════════════════════════════
   CarOnto — Sistema operativo de fincas
   Estética: editorial-tactile · neo-haptic · warm minimalism
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* ── PALETTE: terracotta · ivory · ink ── */
  --paper: #101823;
  --paper-warm: #172333;
  --paper-deep: #213044;
  --ink: #f7fbff;
  --ink-soft: #dbe8f5;
  --ink-mute: #9fb2c5;
  --ink-faint: #6f8194;
  --line: rgba(158, 187, 218, 0.22);
  --line-soft: rgba(158, 187, 218, 0.13);

  --terra: #ff6b4a;
  --terra-soft: #ff9b78;
  --terra-deep: #ff4f2b;
  --olive: #33c28d;
  --olive-soft: #63e0b4;
  --indigo: #4d7cff;
  --indigo-soft: #73b7ff;
  --gold: #ffbf3f;
  --gold-soft: #ffd873;
  --rose: #ff5f91;

  --status-warn: #d97706;
  --status-info: #5478a8;
  --status-good: #6b8e3d;
  --status-bad: #b03222;

  /* ── SHADOWS / DEPTH ── */
  --sh-1: 0 1px 2px rgba(0,0,0,0.24), 0 1px 1px rgba(115,183,255,0.05);
  --sh-2: 0 2px 10px rgba(0,0,0,0.25), 0 1px 5px rgba(115,183,255,0.08);
  --sh-3: 0 14px 34px rgba(0,0,0,0.32), 0 4px 16px rgba(77,124,255,0.10);
  --sh-4: 0 34px 90px rgba(0,0,0,0.42), 0 10px 34px rgba(255,107,74,0.12);
  --sh-inner: inset 0 1px 0 rgba(255,255,255,0.10), inset 0 -1px 0 rgba(0,0,0,0.26);

  /* ── TYPE ── */
  --f-display: 'Fraunces', 'Instrument Serif', Georgia, serif;
  --f-body: 'Geist', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  --f-edit: 'Instrument Serif', Georgia, serif;

  /* ── RADII ── */
  --r-1: 6px;
  --r-2: 12px;
  --r-3: 18px;
  --r-4: 28px;

  /* ── TIMING ── */
  --easeOut: cubic-bezier(0.22, 1, 0.36, 1);
  --easeInOut: cubic-bezier(0.65, 0, 0.35, 1);
}

/* dark theme */
body.dark {
  --paper: #1a1714;
  --paper-warm: #221c17;
  --paper-deep: #2a221b;
  --ink: #f4ede2;
  --ink-soft: #d6c8b1;
  --ink-mute: #94867a;
  --ink-faint: #6b5f53;
  --line: #3a3025;
  --line-soft: #2a221b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*::selection { background: var(--terra); color: var(--paper); }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(ellipse at 18% 10%, rgba(77,124,255,0.20), transparent 44%),
    radial-gradient(ellipse at 84% 86%, rgba(255,107,74,0.16), transparent 46%),
    radial-gradient(ellipse at 50% 50%, rgba(255,191,63,0.09), transparent 58%),
    linear-gradient(135deg, #0c121d 0%, #101823 52%, #162338 100%);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

/* paper grain overlay */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.3  0 0 0 0 0.2  0 0 0 0.5 0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.4'/></svg>");
  opacity: 0.18;
  mix-blend-mode: multiply;
  z-index: 0;
}

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input { font: inherit; color: inherit; }

/* ════════════════════════ TOPBAR ════════════════════════ */
.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr auto;
  align-items: center;
  height: 64px;
  padding: 0 22px;
  background: linear-gradient(to bottom, rgba(16,24,35,0.94), rgba(16,24,35,0.78));
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--paper-warm), var(--paper-deep));
  color: var(--terra-deep);
  box-shadow: var(--sh-2), var(--sh-inner);
}
.brand-name {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 22px;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.brand-sub {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 2px;
}

.nav-pills {
  display: flex;
  gap: 4px;
  justify-self: start;
  margin-left: 12px;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-mute);
  font-size: 13px;
  font-weight: 500;
  transition: all 200ms var(--easeOut);
  position: relative;
}
.pill:hover { color: var(--ink); background: rgba(115,183,255,0.10); }
.pill.active {
  color: var(--ink);
  background: var(--paper-deep);
  box-shadow: var(--sh-1);
}
.pill .badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--terra);
  color: var(--paper);
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--f-mono);
}

.topbar-right {
  display: flex; align-items: center; gap: 10px;
}
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 999px;
  color: var(--ink-mute);
  transition: all 180ms;
}
.icon-btn:hover { background: rgba(115,183,255,0.10); color: var(--ink); }

.presence {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  background: var(--paper-deep);
  box-shadow: var(--sh-1);
  position: relative;
}
.presence-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid var(--paper);
}
.presence-meta {
  display: flex; flex-direction: column;
  line-height: 1.2;
}
.presence-meta span { font-weight: 600; font-size: 12.5px; }
.presence-meta em {
  font-style: normal;
  font-size: 10px;
  color: var(--ink-mute);
  font-family: var(--f-mono);
}
.presence-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--olive-soft);
  box-shadow: 0 0 0 3px rgba(143,161,87,0.2);
  margin-left: 4px;
}

/* ════════════════════════ STAGE LAYOUT ════════════════════════ */
.stage {
  position: relative;
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 0;
  height: calc(100vh - 64px - 70px);
  overflow: hidden;
}

.rail {
  height: 100%;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.rail-left { border-right: 1px solid var(--line); background: linear-gradient(to right, rgba(33,48,68,0.58), transparent); }
.rail-right { border-left: 1px solid var(--line); background: linear-gradient(to left, rgba(33,48,68,0.58), transparent); }

/* ════════════════════════ CARDS ════════════════════════ */
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 16px;
  box-shadow: var(--sh-1);
}
.card-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--terra);
  box-shadow: 0 0 0 3px rgba(196,72,39,0.18);
  animation: pulseDot 2.4s var(--easeOut) infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(196,72,39,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(196,72,39,0.05); }
}
.eyebrow-text { flex: 1; }
.eyebrow-action {
  font-family: var(--f-body);
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--terra-deep);
  font-weight: 500;
}
.eyebrow-action:hover { text-decoration: underline; }

/* ── Status Chip ── */
.status-chip {
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: none;
  letter-spacing: 0;
}
.status-tramitar { background: rgba(217,119,6,0.12); color: var(--status-warn); }

/* ── Expediente ── */
.exp-id {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.exp-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
}
.exp-meta {
  display: flex; gap: 8px; align-items: center;
  font-size: 11.5px;
  color: var(--ink-mute);
  font-family: var(--f-mono);
}
.exp-meta .sla { color: var(--terra-deep); font-weight: 600; }

.comunidad-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}
.cb-portrait {
  width: 56px; height: 56px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--sh-2);
  border: 1px solid var(--line);
}
.cb-eyebrow {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.cb-name {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.cb-addr { font-size: 11.5px; color: var(--ink-mute); }
.cb-cif {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 2px;
}

/* ── Vecino ── */
.vecino-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
}
.vecino-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid var(--paper);
  box-shadow: var(--sh-2);
}
.vecino-name {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.vecino-role { font-size: 11.5px; color: var(--ink-mute); margin-top: 2px; }
.vecino-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag {
  display: inline-block;
  font-size: 9.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
}
.tag-good { background: rgba(107,142,61,0.15); color: var(--olive); }
.tag-soft { background: rgba(45,58,92,0.1); color: var(--indigo); }

.contact-channels {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.ch-btn {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-2);
  text-align: left;
  transition: all 160ms var(--easeOut);
  border: 1px solid transparent;
}
.ch-btn:hover {
  background: var(--paper-deep);
  border-color: var(--line);
  transform: translateX(2px);
}
.ch-btn svg { color: var(--ink-mute); }
.ch-call:hover svg { color: var(--olive); }
.ch-wa:hover svg { color: #25d366; }
.ch-mail:hover svg { color: var(--indigo); }
.ch-btn span {
  font-size: 12.5px;
  font-weight: 500;
  display: block;
  line-height: 1.1;
}
.ch-btn em {
  font-style: normal;
  display: block;
  font-size: 10.5px;
  color: var(--ink-mute);
  font-family: var(--f-mono);
  margin-top: 2px;
  grid-column: 2;
}

/* ── Docs grid ── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.doc-tile {
  display: flex; flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 10px;
  border-radius: var(--r-2);
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  transition: all 160ms var(--easeOut);
  text-align: left;
}
.doc-tile:hover {
  background: var(--paper-deep);
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
}
.doc-icon {
  font-size: 16px;
  color: var(--terra-deep);
  font-family: var(--f-mono);
  line-height: 1;
}
.doc-name { font-size: 11.5px; font-weight: 600; }
.doc-tile em {
  font-style: normal;
  font-size: 9.5px;
  color: var(--ink-mute);
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
}

/* ── Timeline ── */
.timeline {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 10px;
}
.timeline li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: start;
  position: relative;
}
.timeline li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 6px; top: 16px;
  width: 1px; height: calc(100% + 2px);
  background: var(--line);
}
.t-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-mute);
  margin-top: 4px;
  position: relative;
  z-index: 1;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line);
}
.t-dot-warn { background: var(--terra); box-shadow: 0 0 0 1px var(--terra-soft); }
.t-title { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.t-meta { font-size: 10.5px; color: var(--ink-mute); margin-top: 1px; }
.timeline time {
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ════════════════════════ WHEEL STAGE (CENTER) ════════════════════════ */
.wheel-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wheel-meta-top {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(16,24,35,0.74), transparent);
  z-index: 5;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  border: 1px solid var(--line);
  background: var(--paper);
  transition: all 160ms;
}
.back-btn:not(:disabled):hover { color: var(--ink); border-color: var(--ink-soft); }
.back-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.breadcrumb {
  flex: 1;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.bc-item {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  cursor: pointer;
  transition: all 160ms;
}
.bc-item.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.bc-item:not(.active):hover { background: var(--paper-deep); }
.bc-sep { color: var(--ink-faint); }

.wheel-controls { display: flex; gap: 4px; }
.wc-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-mute);
  transition: all 160ms;
}
.wc-btn:hover { background: var(--paper-deep); color: var(--ink); transform: scale(1.05); }
.wc-btn:active { transform: scale(0.95); }

/* ── Wheel area ── */
.wheel-area {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  perspective: 1400px;
  min-height: 480px;
}
.wheel-ambient {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(circle at 30% 30%, rgba(77,124,255,0.26), transparent 48%),
    radial-gradient(circle at 70% 70%, rgba(255,107,74,0.22), transparent 48%),
    radial-gradient(circle at 50% 50%, rgba(99,224,180,0.12), transparent 58%);
  filter: blur(60px);
  pointer-events: none;
  animation: ambientDrift 22s ease-in-out infinite;
}
@keyframes ambientDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.05); }
}
.wheel-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.65' numOctaves='3'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.18'/></svg>");
  mix-blend-mode: overlay;
}
.wheel-orbits {
  position: absolute;
  width: min(100%, 700px);
  aspect-ratio: 1;
  pointer-events: none;
  animation: spin 240s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Hub (center) ── */
.wheel-hub {
  position: absolute;
  width: 240px; height: 240px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(247,251,255,0.16) 0%, rgba(33,48,68,0.96) 42%, rgba(12,18,29,0.98) 100%),
    linear-gradient(145deg, rgba(77,124,255,0.22), rgba(255,107,74,0.14));
  box-shadow:
    0 32px 70px -18px rgba(0,0,0,0.74),
    0 0 46px -18px rgba(77,124,255,0.75),
    inset 0 -4px 10px rgba(0,0,0,0.30),
    inset 0 3px 8px rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
  z-index: 5;
  cursor: default;
  user-select: none;
  transform: translateZ(60px);
}
.hub-inner {
  text-align: center;
  padding: 20px 24px;
  width: 100%;
}
.hub-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(196,72,39,0.12);
  color: var(--terra-deep);
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  font-weight: 600;
  margin-bottom: 10px;
}
.hub-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--terra);
  box-shadow: 0 0 0 2px rgba(196,72,39,0.25);
  animation: pulseDot 2s infinite;
}
.hub-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144;
  color: var(--ink);
  padding: 0 6px;
  margin-bottom: 4px;
}
.hub-sub {
  font-size: 10.5px;
  color: var(--ink-mute);
  font-family: var(--f-mono);
}
.hub-divider {
  width: 28px;
  height: 1px;
  background: var(--line);
  margin: 12px auto;
}
.hub-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}
.hub-meta div {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}
.hub-meta em {
  font-style: normal;
  display: block;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.hub-meta strong {
  display: block;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 2px;
}
.urg-high { color: var(--terra) !important; }
.hub-cta {
  margin-top: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 500;
  transition: all 160ms;
}
.hub-cta:hover { background: var(--terra-deep); transform: translateY(-1px); }

.hub-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hub-ring-1 {
  inset: -10px;
  border: 1px dashed rgba(115,183,255,0.30);
  animation: spin 60s linear infinite;
}
.hub-ring-2 {
  inset: -22px;
  border: 1px solid rgba(255,107,74,0.18);
}

/* ── Wheel + Nodes ── */
.wheel {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  transform-style: preserve-3d;
  transition: transform 600ms var(--easeOut);
  will-change: transform;
  pointer-events: none;
}

.wheel-area.level-shift .wheel-hub {
  animation: hubLevelShift 720ms var(--easeOut);
}

@keyframes hubLevelShift {
  0% { transform: translateZ(60px) scale(1); }
  38% { transform: translateZ(96px) scale(1.045); }
  100% { transform: translateZ(60px) scale(1); }
}

/* Each node positioned absolutely */
.node {
  position: absolute;
  top: 50%; left: 50%;
  width: 92px; height: 92px;
  margin: -46px 0 0 -46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  pointer-events: auto;
  transform-style: preserve-3d;
  transform: translate(var(--tx, 0), var(--ty, 0));
  cursor: pointer;
  user-select: none;
  transition:
    transform 700ms var(--easeOut),
    opacity 500ms var(--easeOut),
    filter 300ms;
  animation: nodeArrive 640ms var(--easeOut) both;
  animation-delay: var(--stagger, 0ms);
  --hue: 30;
  --counter: 0deg;
}

@keyframes nodeArrive {
  from {
    opacity: 0;
    transform: translate(0, 0) scale(0.72);
    filter: blur(10px) saturate(0.75);
  }
  to {
    opacity: 1;
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(1);
    filter: blur(0) saturate(1);
  }
}

.node-shape {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%,
      hsl(var(--hue), 70%, 75%) 0%,
      hsl(var(--hue), 60%, 56%) 38%,
      hsl(var(--hue), 65%, 38%) 75%,
      hsl(var(--hue), 70%, 25%) 100%);
  box-shadow:
    0 16px 32px -6px hsla(var(--hue), 60%, 22%, 0.45),
    0 6px 12px -2px hsla(var(--hue), 60%, 22%, 0.35),
    inset 0 -8px 18px hsla(var(--hue), 80%, 18%, 0.3),
    inset 0 6px 10px hsla(var(--hue), 80%, 90%, 0.6);
  transition: all 280ms var(--easeOut);
  display: grid;
  place-items: center;
  transform: rotate(var(--counter));
  will-change: transform, box-shadow;
}

.node-shape::before {
  /* glossy highlight */
  content: '';
  position: absolute;
  top: 8%; left: 18%;
  width: 50%; height: 35%;
  background: radial-gradient(ellipse at center, hsla(var(--hue), 100%, 95%, 0.65), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}
.node-shape::after {
  /* bottom rim shine */
  content: '';
  position: absolute;
  bottom: 5%; left: 20%;
  width: 60%; height: 8%;
  background: radial-gradient(ellipse at center, hsla(var(--hue), 80%, 70%, 0.5), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.node-icon {
  position: relative;
  z-index: 2;
  width: 32px; height: 32px;
  color: hsla(var(--hue), 95%, 96%, 0.95);
  filter: drop-shadow(0 1px 2px hsla(var(--hue), 80%, 15%, 0.6));
  stroke-width: 1.6;
  fill: none;
  stroke: currentColor;
}

.node-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(158px, 16vw, 214px);
  min-height: 52px;
  padding: 8px 10px 9px;
  border: 1px solid rgba(158, 187, 218, 0.30);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(21, 33, 48, 0.92), rgba(12, 18, 29, 0.84)),
    radial-gradient(circle at 10% 0%, hsla(var(--hue), 72%, 68%, 0.20), transparent 48%);
  box-shadow:
    0 16px 32px -18px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  text-align: left;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.18;
  letter-spacing: 0;
  color: var(--ink);
  pointer-events: none;
  transition: all 240ms var(--easeOut);
  transform: translate(-50%, 64px) rotate(var(--counter));
  transform-origin: center center;
}
.node.label-east .node-label { transform: translate(58px, -50%) rotate(var(--counter)); }
.node.label-west .node-label { transform: translate(calc(-100% - 58px), -50%) rotate(var(--counter)); }
.node.label-north .node-label { transform: translate(-50%, calc(-100% - 24px)) rotate(var(--counter)); }
.node.label-south .node-label { transform: translate(-50%, 64px) rotate(var(--counter)); }
.node.code-F02 .node-label,
.node.code-F06 .node-label,
.node.code-F07 .node-label,
.node.code-F11 .node-label {
  transform: translate(76px, -50%) rotate(var(--counter));
}
.node.code-F02.label-west .node-label,
.node.code-F06.label-west .node-label,
.node.code-F07.label-west .node-label,
.node.code-F11.label-west .node-label {
  transform: translate(calc(-100% - 76px), -50%) rotate(var(--counter));
}

.node-label::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, hsla(var(--hue), 82%, 78%, 0.28), transparent 52%);
  opacity: 0;
  transition: opacity 220ms var(--easeOut);
  pointer-events: none;
}
.node-label span {
  position: relative;
  z-index: 1;
}
.node-label .nl-code {
  display: block;
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 2px;
}
.node-label .nl-sub {
  display: block;
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 10.5px;
  line-height: 1.16;
  color: var(--ink-mute);
  margin-top: 3px;
  font-style: italic;
}

/* hover */
.node:hover { z-index: 10; }
.node:hover .node-shape {
  transform: rotate(var(--counter)) scale(1.15) translateZ(20px);
  box-shadow:
    0 22px 50px -8px hsla(var(--hue), 60%, 22%, 0.55),
    0 10px 20px -4px hsla(var(--hue), 60%, 22%, 0.45),
    inset 0 -8px 18px hsla(var(--hue), 80%, 18%, 0.3),
    inset 0 6px 10px hsla(var(--hue), 80%, 92%, 0.7);
}
.node:hover .node-label {
  color: var(--terra-deep);
  border-color: hsla(var(--hue), 64%, 45%, 0.34);
  box-shadow:
    0 18px 38px -20px hsla(var(--hue), 58%, 26%, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
.node:hover .node-label::before {
  opacity: 1;
}
.node.label-east:hover .node-label { transform: translate(64px, -50%) rotate(var(--counter)) scale(1.035); }
.node.label-west:hover .node-label { transform: translate(calc(-100% - 64px), -50%) rotate(var(--counter)) scale(1.035); }
.node.label-north:hover .node-label { transform: translate(-50%, calc(-100% - 30px)) rotate(var(--counter)) scale(1.035); }
.node.label-south:hover .node-label { transform: translate(-50%, 70px) rotate(var(--counter)) scale(1.035); }
.node.code-F02:hover .node-label,
.node.code-F06:hover .node-label,
.node.code-F07:hover .node-label,
.node.code-F11:hover .node-label {
  transform: translate(84px, -50%) rotate(var(--counter)) scale(1.035);
}
.node.code-F02.label-west:hover .node-label,
.node.code-F06.label-west:hover .node-label,
.node.code-F07.label-west:hover .node-label,
.node.code-F11.label-west:hover .node-label {
  transform: translate(calc(-100% - 84px), -50%) rotate(var(--counter)) scale(1.035);
}

/* selected */
.node.selected .node-shape {
  transform: rotate(var(--counter)) scale(1.2);
  box-shadow:
    0 26px 56px -8px hsla(var(--hue), 70%, 22%, 0.6),
    0 0 0 4px var(--paper),
    0 0 0 6px hsl(var(--hue), 70%, 50%),
    inset 0 -8px 18px hsla(var(--hue), 80%, 18%, 0.3),
    inset 0 6px 10px hsla(var(--hue), 80%, 92%, 0.7);
}

.node.urgent .node-shape {
  animation: urgentPulse 1.6s ease-in-out infinite;
}
@keyframes urgentPulse {
  0%, 100% {
    box-shadow:
      0 16px 32px -6px hsla(var(--hue), 60%, 22%, 0.45),
      0 0 0 0 hsla(var(--hue), 80%, 50%, 0.5),
      inset 0 -8px 18px hsla(var(--hue), 80%, 18%, 0.3),
      inset 0 6px 10px hsla(var(--hue), 80%, 92%, 0.7);
  }
  50% {
    box-shadow:
      0 16px 32px -6px hsla(var(--hue), 60%, 22%, 0.45),
      0 0 0 14px hsla(var(--hue), 80%, 50%, 0.0),
      inset 0 -8px 18px hsla(var(--hue), 80%, 18%, 0.3),
      inset 0 6px 10px hsla(var(--hue), 80%, 92%, 0.7);
  }
}

/* connection line from hub to nodes */
.node-link {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 1px;
  background: linear-gradient(to right, transparent, hsla(var(--hue), 62%, 48%, 0.24), transparent);
  transform: rotate(calc(var(--angle) + 180deg)) translateX(44px);
  transform-origin: left center;
  pointer-events: none;
  z-index: -1;
  opacity: 0.85;
}

/* small nodes (level 3+ leaves) */
.node-leaf {
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
}
.node-leaf .node-icon { width: 22px; height: 22px; }
.node-leaf .node-label {
  font-size: 11px;
  width: clamp(142px, 15vw, 184px);
  min-height: 46px;
  padding: 7px 9px;
}

.terminal-node .node-shape {
  width: 56px;
  height: 56px;
  margin: auto;
  background:
    radial-gradient(circle at 30% 25%,
      hsl(var(--hue), 76%, 82%) 0%,
      hsl(var(--hue), 62%, 58%) 48%,
      hsl(var(--hue), 66%, 34%) 100%);
}
.terminal-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.22);
  color: white;
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.38);
}
.terminal-node .node-label {
  min-height: 58px;
  width: clamp(166px, 17vw, 230px);
}

/* leaf cards (final level) */
.leaf-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.leaf-grid {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 540px;
  pointer-events: auto;
  padding: 0 30px;
}
.leaf-card {
  position: relative;
  padding: 12px 14px 12px 38px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  text-align: left;
  font-size: 12.5px;
  line-height: 1.25;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms var(--easeOut);
  box-shadow: var(--sh-1);
  animation: leafIn 500ms var(--easeOut) backwards;
}
.leaf-card::before {
  content: '';
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: hsl(var(--hue, 30), 60%, 56%);
  box-shadow: 0 0 0 3px hsla(var(--hue, 30), 60%, 56%, 0.18);
}
.leaf-card:hover {
  transform: translateX(2px);
  border-color: hsl(var(--hue, 30), 50%, 50%);
  box-shadow: var(--sh-2);
}
.leaf-card.selected {
  background: hsl(var(--hue, 30), 80%, 96%);
  border-color: hsl(var(--hue, 30), 60%, 50%);
}
@keyframes leafIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.leaf-header {
  position: absolute;
  top: 30px; left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 5;
}
.leaf-header-eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.leaf-header-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
  margin-top: 4px;
}

/* rotate hint */
.rotate-hint {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 12;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(12, 18, 29, 0.72);
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  backdrop-filter: blur(14px);
}
.rotate-hint svg { animation: spin 8s linear infinite; opacity: 0.5; }

/* ── Suggestion strip ── */
.suggestion-strip {
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, rgba(235,225,208,0.5), transparent);
  padding: 14px 22px 16px;
  z-index: 4;
}
.ss-eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.ss-spark {
  color: var(--terra);
  font-size: 12px;
  animation: sparkPulse 2s var(--easeOut) infinite;
}
@keyframes sparkPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.ss-cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.ss-cards::-webkit-scrollbar { display: none; }
.ss-card {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-2);
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  box-shadow: var(--sh-1);
  cursor: pointer;
  transition: all 200ms var(--easeOut);
  position: relative;
  animation: ssIn 400ms var(--easeOut) backwards;
}
.ss-card:hover {
  transform: translateY(-2px);
  border-color: var(--terra);
  box-shadow: var(--sh-2);
}
.ss-card .ss-num {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--terra);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 600;
}
.ss-card em {
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--ink-mute);
  font-style: normal;
  letter-spacing: 0.04em;
  margin-left: 4px;
}
@keyframes ssIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════ AI CARD (Right rail) ════════════════════════ */
.ai-card {
  background: linear-gradient(155deg, var(--paper), var(--paper-warm));
  border-radius: var(--r-3);
  position: relative;
  overflow: hidden;
}
.ai-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(196,72,39,0.12), transparent 60%);
  pointer-events: none;
}

.ai-header {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.ai-orb {
  position: relative;
  width: 40px; height: 40px;
}
.ai-orb-core {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, var(--terra-soft), var(--terra) 40%, var(--terra-deep) 80%);
  box-shadow:
    0 0 24px rgba(196,72,39,0.5),
    inset 0 -2px 6px rgba(138,47,24,0.6),
    inset 0 2px 4px rgba(255,200,180,0.6);
  animation: aiOrbPulse 3s ease-in-out infinite;
}
.ai-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--terra);
  border-top-color: transparent;
  border-left-color: transparent;
  animation: spin 4s linear infinite;
  opacity: 0.6;
}
@keyframes aiOrbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.ai-name {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.ai-state {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px;
  color: var(--ink-mute);
  font-family: var(--f-mono);
  margin-top: 3px;
}
.ai-state-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--olive-soft);
  animation: pulseDot 1.6s infinite;
}
.icon-btn-sm {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-mute);
}
.icon-btn-sm:hover { background: var(--ink); color: var(--paper); }

.waveform {
  position: relative;
  height: 36px;
  background: var(--paper-deep);
  border-radius: var(--r-2);
  margin-bottom: 12px;
  display: flex; align-items: center;
  padding: 0 12px;
  overflow: hidden;
}
.wf-bars {
  flex: 1;
  display: flex; align-items: center;
  gap: 2px;
  height: 100%;
}
.wf-bar {
  width: 2px;
  background: var(--terra);
  border-radius: 1px;
  animation: wfPulse 1.2s ease-in-out infinite;
}
.ai-card.is-paused .wf-bar,
.ai-card.is-paused .ai-orb-core,
.ai-card.is-paused .cursor-blink,
.ai-card.is-paused .ai-orb-ring,
.ai-card.is-paused .ai-state-dot {
  animation-play-state: paused;
}
.ai-card.is-paused .wf-bar {
  opacity: 0.32;
  background: var(--ink-faint);
}
.ai-card.is-paused .wf-time {
  color: var(--ink-faint);
}
@keyframes wfPulse {
  0%, 100% { height: 20%; opacity: 0.5; }
  50% { height: 80%; opacity: 1; }
}
.wf-time {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-mute);
  margin-left: 8px;
  letter-spacing: 0.05em;
}

.transcript {
  max-height: 180px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 8px;
  padding: 4px;
  scrollbar-width: thin;
}
.ai-card.is-paused .transcript,
.ai-card.is-paused .prompts {
  display: none;
}
.ai-card.is-paused .waveform::after {
  content: 'Pulsa play para activar CarOnto y mostrar la transcripción';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--ink-mute);
  background: linear-gradient(90deg, rgba(16,24,35,0.74), rgba(33,48,68,0.62));
  backdrop-filter: blur(2px);
}
.transcript::-webkit-scrollbar { width: 4px; }
.transcript::-webkit-scrollbar-thumb { background: var(--line); }

.trx-line {
  position: relative;
  padding: 7px 10px 7px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.35;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  font-family: var(--f-edit);
  font-style: italic;
  color: var(--ink-soft);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  align-items: baseline;
}
.trx-line.trx-marta {
  background: rgba(45,58,92,0.04);
  border-color: rgba(45,58,92,0.15);
}
.trx-line.trx-laura {
  background: rgba(196,72,39,0.04);
  border-color: rgba(196,72,39,0.15);
}
.trx-who {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  align-self: start;
  padding-top: 1px;
}
.trx-line time {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 9px;
  color: var(--ink-faint);
}
.trx-text { display: inline; }
.trx-live { background: linear-gradient(90deg, var(--paper), rgba(196,72,39,0.08)); }
.cursor-blink {
  display: inline-block;
  font-style: normal;
  color: var(--terra);
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Prompts (suggested questions) ── */
.prompts {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.prompts-title {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.prompt-bubbles {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.prompt-bub {
  position: relative;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: all 220ms var(--easeOut);
  animation: bubbleIn 500ms var(--easeOut) backwards;
}
.prompt-bub:nth-child(1) { animation-delay: 0ms; }
.prompt-bub:nth-child(2) { animation-delay: 100ms; }
.prompt-bub:nth-child(3) { animation-delay: 200ms; }
.prompt-bub:nth-child(4) { animation-delay: 300ms; }
.prompt-bub:hover {
  background: var(--terra);
  color: var(--paper);
  border-color: var(--terra);
  transform: translateY(-1px);
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Colleagues ── */
.online-count {
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--olive);
  letter-spacing: 0.08em;
}
.col-list {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 8px;
}
.col-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--r-2);
  transition: background 160ms;
}
.col-item:hover { background: var(--paper-deep); }
.col-avatar {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid var(--paper);
}
.col-presence {
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--olive-soft);
  border: 2px solid var(--paper);
}
.col-presence.away { background: var(--gold-soft); }
.col-name { font-size: 12.5px; font-weight: 600; line-height: 1.1; }
.col-dept {
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--ink-mute);
  margin-top: 1px;
  letter-spacing: 0.04em;
}
.col-action {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  background: var(--paper-deep);
  color: var(--ink-soft);
  transition: all 160ms;
}
.col-action:hover { background: var(--ink); color: var(--paper); }

/* ── Alerts ── */
.alert-list {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 8px;
}
.alert-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: var(--paper);
}
.al-mark {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}
.alert-warn { background: rgba(217,119,6,0.05); border-color: rgba(217,119,6,0.25); }
.alert-warn .al-mark { background: rgba(217,119,6,0.18); color: var(--status-warn); }
.alert-info { background: rgba(84,120,168,0.04); border-color: rgba(84,120,168,0.2); }
.alert-info .al-mark { background: rgba(84,120,168,0.15); color: var(--status-info); }
.al-title { font-size: 12px; font-weight: 600; line-height: 1.25; }
.al-meta {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* ════════════════════════ ACTION DOCK (BOTTOM) ════════════════════════ */
.action-dock {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 70px;
  padding: 0 22px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(60,40,20,0.04);
}
.dock-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: var(--r-2);
  background: var(--paper-warm);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 180ms var(--easeOut);
}
.dock-btn:hover {
  background: var(--paper-deep);
  border-color: var(--ink-soft);
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
}
.dock-icon { display: grid; place-items: center; }
.dock-pill {
  display: inline-grid;
  place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 10px;
  font-family: var(--f-mono);
}
.dock-pill.alert { background: var(--terra); }
.dock-spacer { flex: 1; }
.dock-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.dock-primary:hover {
  background: var(--terra-deep);
  border-color: var(--terra-deep);
}

/* ════════════════════════ MODALS ════════════════════════ */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms var(--easeOut);
}
.modal.open {
  display: flex;
  pointer-events: all;
  opacity: 1;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20,18,15,0.55);
  backdrop-filter: blur(8px);
}
.modal-panel {
  position: relative;
  background: var(--paper);
  border-radius: var(--r-4);
  box-shadow: var(--sh-4);
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 280ms var(--easeOut);
}
.modal.open .modal-panel { transform: translateY(0) scale(1); }
.vc-close {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  font-size: 16px;
  color: var(--ink-mute);
  transition: all 160ms;
}
.vc-close:hover { background: var(--ink); color: var(--paper); }

/* ── Call modal ── */
.modal-call {
  width: 480px; max-width: 95vw;
  padding: 24px;
}
.call-header {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.call-pulse {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--terra);
  position: relative;
  margin-left: 14px;
}
.call-pulse::before, .call-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--terra);
  animation: ringExpand 1.6s ease-out infinite;
}
.call-pulse::after { animation-delay: 0.8s; }
@keyframes ringExpand {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.5); opacity: 0; }
}
.call-status {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--terra);
  text-transform: uppercase;
}
.call-name {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 2px;
}
.call-sub { font-size: 11.5px; color: var(--ink-mute); margin-top: 2px; }
.call-timer {
  font-family: var(--f-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.05em;
}

.call-body {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.call-portrait {
  position: relative;
  width: 140px; height: 140px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid var(--paper);
  box-shadow: var(--sh-3);
}
.call-rings span {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid var(--terra);
  opacity: 0;
  animation: ringExpand 2s ease-out infinite;
}
.call-rings span:nth-child(2) { animation-delay: 0.66s; }
.call-rings span:nth-child(3) { animation-delay: 1.33s; }

.call-side { display: flex; flex-direction: column; gap: 12px; }
.rec-flag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(176,50,34,0.1);
  color: var(--status-bad);
  font-size: 10.5px;
  font-family: var(--f-mono);
  letter-spacing: 0.06em;
  align-self: flex-start;
}
.rec-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--status-bad);
  animation: pulseDot 1s infinite;
}
.live-suggest {
  background: var(--paper-warm);
  border-radius: var(--r-2);
  padding: 10px;
  border: 1px solid var(--line);
}
.ls-title {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.ls-bubbles { display: flex; flex-wrap: wrap; gap: 5px; }
.ls-bub {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: all 180ms;
}
.ls-bub:hover { background: var(--terra); color: var(--paper); border-color: var(--terra); }
.ls-bub.ls-pulse {
  background: var(--terra);
  color: var(--paper);
  border-color: var(--terra);
  animation: lsPulse 2s infinite;
}
@keyframes lsPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196,72,39,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(196,72,39,0); }
}

.call-trx-mini {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--f-edit);
  font-size: 11.5px;
  font-style: italic;
  color: var(--ink-mute);
  line-height: 1.3;
  max-height: 80px;
  overflow-y: auto;
}
.ctm-line span {
  font-family: var(--f-mono);
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
  margin-right: 4px;
  font-size: 10px;
}

.call-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.call-act {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-soft);
  transition: all 160ms;
}
.call-act:hover { transform: scale(1.05); background: var(--ink); color: var(--paper); }
.call-end {
  background: var(--status-bad);
  color: var(--paper);
}
.call-end:hover { background: var(--terra-deep); }

/* ── Video conference modal ── */
.modal-vc {
  width: 92vw;
  max-width: 1100px;
  height: 86vh;
  max-height: 720px;
  display: flex;
  flex-direction: column;
}
.vc-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-warm);
}
.vc-title { display: flex; align-items: center; gap: 10px; }
.vc-pulse {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--status-bad);
  animation: pulseDot 1.4s infinite;
}
.vc-name {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.vc-sub { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.vc-time {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--status-bad);
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(176,50,34,0.1);
}

.vc-stage {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  min-height: 0;
}
.vc-main {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #1a1714;
}
.vc-feed {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.vc-feed-bg, .vc-feed-bg svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.vc-annot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.vc-pip {
  position: absolute;
  bottom: 80px; right: 20px;
  width: 130px; height: 130px;
  border-radius: var(--r-2);
  background-size: cover;
  background-position: center;
  border: 2px solid var(--paper);
  box-shadow: var(--sh-3);
  z-index: 5;
}
.vc-pip-label {
  position: absolute;
  bottom: 6px; left: 6px;
  font-size: 10px;
  font-family: var(--f-mono);
  font-weight: 600;
  color: var(--paper);
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.vc-tools {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(20,18,15,0.7);
  backdrop-filter: blur(20px);
  z-index: 5;
}
.vc-tool {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: rgba(255,255,255,0.08);
  transition: all 160ms;
}
.vc-tool:hover { background: var(--paper); color: var(--ink); }

.vc-snaps {
  position: absolute;
  top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 5;
}
.vc-snap {
  width: 80px;
  background: var(--paper);
  border-radius: 6px;
  padding: 4px;
  box-shadow: var(--sh-2);
  text-align: center;
}
.vc-snap em {
  font-style: normal;
  display: block;
  font-size: 8.5px;
  font-family: var(--f-mono);
  color: var(--ink-mute);
  margin-top: 2px;
}
.vc-snap-add {
  display: grid; place-items: center;
  height: 50px; width: 80px;
  background: rgba(255,255,255,0.1);
  color: var(--paper);
  font-size: 22px;
  cursor: pointer;
  border: 1.5px dashed rgba(255,255,255,0.3);
  border-radius: 6px;
}

.vc-side {
  background: var(--paper);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}
.vc-eyebrow {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.vc-eyebrow-2 { margin-top: 6px; }
.vc-detections {
  list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}
.vc-detections li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  padding: 9px 10px;
  background: var(--paper-warm);
  border-radius: var(--r-2);
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
  animation: ssIn 400ms backwards;
}
.vc-detections li:nth-child(1) { animation-delay: 100ms; }
.vc-detections li:nth-child(2) { animation-delay: 300ms; }
.vc-detections li:nth-child(3) { animation-delay: 600ms; }
.vd-mark {
  color: var(--olive);
  margin-top: 1px;
  font-size: 10px;
}
.vd-warn { color: var(--terra); }
.vc-detections strong { font-weight: 600; display: block; line-height: 1.2; }
.vc-detections em {
  font-style: normal;
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--ink-mute);
  margin-top: 2px;
  display: block;
  letter-spacing: 0.02em;
}
.vc-share {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-2);
  font-size: 12px;
  font-weight: 500;
  transition: all 160ms;
}
.vc-share:hover { background: var(--terra-deep); }
.vc-actions-vert {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 8px;
}
.vc-act-btn {
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--r-2);
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
  font-weight: 500;
  transition: all 160ms;
}
.vc-act-btn:hover { background: var(--paper-deep); transform: translateX(2px); }

/* ── WhatsApp modal ── */
.modal-wa {
  width: 420px;
  max-width: 95vw;
  height: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #efe7d8;
}
.wa-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: #075e54;
  color: white;
}
.wa-h-info { display: flex; align-items: center; gap: 10px; }
.wa-h-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}
.wa-h-name { font-weight: 600; font-size: 14px; line-height: 1.1; }
.wa-h-sub { font-size: 11px; opacity: 0.85; margin-top: 1px; }
.wa-header .vc-close { background: rgba(255,255,255,0.15); color: white; }

.wa-body {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 6px;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><circle cx='20' cy='20' r='1' fill='%23d4c8b1' opacity='0.4'/></svg>");
}
.wa-day {
  align-self: center;
  font-size: 10px;
  font-family: var(--f-mono);
  background: rgba(255,255,255,0.7);
  padding: 3px 10px;
  border-radius: 999px;
  margin: 8px 0;
  color: #555;
}
.wa-msg {
  max-width: 75%;
  padding: 7px 10px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.35;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.wa-msg p { color: #303030; }
.wa-msg time {
  position: absolute;
  bottom: 3px; right: 8px;
  font-size: 9px;
  color: #888;
  font-family: var(--f-mono);
}
.wa-in {
  background: white;
  align-self: flex-start;
  border-top-left-radius: 0;
}
.wa-out {
  background: #dcf8c6;
  align-self: flex-end;
  border-top-right-radius: 0;
}
.wa-out time { color: #4a8;}
.wa-with-img p { padding-top: 6px; }
.wa-img {
  width: 200px; height: 130px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}
.wa-typing {
  align-self: flex-start;
  display: flex; gap: 3px;
  padding: 8px 12px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.wa-typing span {
  width: 6px; height: 6px;
  background: #aaa;
  border-radius: 50%;
  animation: typing 1.2s ease-in-out infinite;
}
.wa-typing span:nth-child(2) { animation-delay: 0.2s; }
.wa-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.wa-suggest {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.wa-sug-btn {
  flex: 1;
  text-align: left;
  padding: 6px 10px;
  border-radius: var(--r-2);
  background: var(--terra);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.wa-sug-btn:hover { background: var(--terra-deep); }

.wa-input {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  background: white;
  border-top: 1px solid #ccc;
}
.wa-attach {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #f0f0f0;
  font-size: 18px;
  color: #888;
}
.wa-input input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 999px;
  background: white;
  outline: none;
  font-size: 13px;
}
.wa-send {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #075e54;
  color: white;
  font-size: 16px;
  font-weight: 700;
}

/* ── Docs modal ── */
.modal-docs {
  width: 720px; max-width: 92vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.docs-h {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.docs-h-eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.docs-h-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.docs-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 22px 22px;
  display: flex; flex-direction: column;
  gap: 6px;
}
.doc-row {
  display: grid;
  grid-template-columns: 38px 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: var(--paper);
  transition: all 160ms;
  cursor: pointer;
}
.doc-row:hover {
  background: var(--paper-warm);
  border-color: var(--ink-soft);
  transform: translateX(2px);
}
.doc-row-icon {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--paper-deep);
  color: var(--terra-deep);
  font-family: var(--f-mono);
  font-size: 16px;
}
.doc-row-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
}
.doc-row-date {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.doc-row-amount {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.doc-row-status {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.status-vigente { background: rgba(107,142,61,0.15); color: var(--olive); }
.status-pendiente { background: rgba(217,119,6,0.15); color: var(--status-warn); }
.status-abonada { background: rgba(107,142,61,0.15); color: var(--olive); }
.status-archivado { background: rgba(60,40,20,0.08); color: var(--ink-mute); }
.status-firmada { background: rgba(45,58,92,0.12); color: var(--indigo); }
.status-preferente { background: rgba(196,72,39,0.12); color: var(--terra-deep); }
.status-puntual { background: rgba(60,40,20,0.08); color: var(--ink-mute); }
.status-consulta { background: rgba(45,58,92,0.12); color: var(--indigo); }
.doc-row-action { color: var(--ink-mute); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--sh-3);
  opacity: 0;
  pointer-events: none;
  transition: all 280ms var(--easeOut);
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════ RESPONSIVE ════════════════════════ */
@media (max-width: 1280px) {
  .stage { grid-template-columns: 280px 1fr 300px; }
  .wheel { width: 540px; height: 540px; }
}
@media (max-width: 1100px) {
  .nav-pills .pill:nth-child(n+4) { display: none; }
}
@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; }
  .rail-left, .rail-right { display: none; }
  .wheel { width: 460px; height: 460px; }
  .wheel-hub { width: 200px; height: 200px; }
  .hub-title { font-size: 18px; }
}

/* ════════════════════════ DYNAMIC HOOKS (app.js) ════════════════════════ */
/* breadcrumb crumbs (rendered by JS) */
.breadcrumb .crumb {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 140ms;
}
.breadcrumb .crumb:hover { background: var(--paper-warm); color: var(--ink); }
.breadcrumb .crumb-root { color: var(--terra-deep); cursor: default; }
.breadcrumb .crumb-root:hover { background: transparent; }
.breadcrumb .crumb-active { color: var(--ink); font-weight: 600; cursor: default; }
.breadcrumb .crumb-sep { color: var(--ink-mute); opacity: 0.5; }

/* IA paused state */
.ai-state.paused .ai-state-dot,
.ai-state.paused::before { background: var(--ink-mute) !important; }

/* used prompt */
.prompt-bub.used { opacity: 0.45; text-decoration: line-through; pointer-events: none; }

/* dragging cursor */
.wheel-area.dragging { cursor: grabbing !important; }
.wheel-area { cursor: grab; }

/* ss-card urgent variant */
.ss-card.ss-urgent {
  border-color: var(--terra);
  background: linear-gradient(135deg, var(--paper) 70%, hsla(14, 67%, 92%, 0.6));
  box-shadow: 0 4px 14px -4px rgba(196, 72, 39, 0.25);
}
.ss-card.ss-urgent::before {
  content: '';
  position: absolute; top: 8px; right: 10px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--terra);
  box-shadow: 0 0 0 4px hsla(14, 67%, 50%, 0.18);
  animation: pulseSoft 1.6s ease-in-out infinite;
}

/* node label always visible above shape */
.node-label .nl-name { display: block; font-weight: 600; }

/* leaf-stage z-index above wheel */
.leaf-stage { z-index: 6; }

/* ls-bub stagger animation */
.ls-bub { animation: bubIn 350ms var(--easeOut) backwards; }
@keyframes bubIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* toast kinds */
.toast[data-kind="ok"] { background: var(--olive); }
.toast[data-kind="warn"] { background: var(--status-warn); }
