:root {
  --vision-glass: rgba(28, 34, 46, 0.56);
  --vision-glass-heavy: rgba(20, 25, 36, 0.72);
  --vision-glass-light: rgba(255, 255, 255, 0.09);
  --vision-glass-hover: rgba(255, 255, 255, 0.16);
  --vision-glass-active: rgba(14, 140, 246, 0.34);
  --vision-border: rgba(255, 255, 255, 0.22);
  --vision-border-subtle: rgba(255, 255, 255, 0.12);
  --vision-specular: inset 0 1px 0 0 rgba(255, 255, 255, 0.38), inset 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  --vision-shadow: 0 36px 90px -12px rgba(0, 0, 0, 0.65), 0 12px 32px rgba(0, 0, 0, 0.35);
  --vision-blue: #0a84ff;
  --vision-cyan: #38bdf8;
  --vision-green: #30d158;
  --vision-amber: #ffd60a;
  --vision-red: #ff453a;
  --text-primary: rgba(255, 255, 255, 0.96);
  --text-secondary: rgba(255, 255, 255, 0.72);
  --text-tertiary: rgba(255, 255, 255, 0.48);
}

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

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Plus Jakarta Sans', 'Inter', sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  background: #070b12;
}

/* Custom sleek visionOS scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.38);
}

.svg-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* =========================================================
   SPATIAL ENVIRONMENT BACKDROP (AT&T STORE INTERIOR)
   ========================================================= */
.store-bg-layer {
  position: fixed;
  inset: -32px;
  background-image: url('assets/store-bg.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.2) brightness(0.62);
  transform: scale(1.06);
  z-index: 0;
  pointer-events: none;
}

.store-bg-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(10, 132, 255, 0.18) 0%, transparent 55%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.32) 0%, rgba(4, 8, 16, 0.58) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Signature visionOS Bottom Window Control Bar */
.vision-window-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.vision-close-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.vision-grabber {
  width: 136px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* =========================================================
   PRE-CHAT LANDING: SPATIAL GLASS WINDOW
   ========================================================= */
.prechat-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
}

.prechat-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 310px 1fr;
  background: var(--vision-glass);
  backdrop-filter: blur(42px) saturate(190%);
  -webkit-backdrop-filter: blur(42px) saturate(190%);
  border-radius: 36px;
  border: 1px solid var(--vision-border);
  box-shadow: var(--vision-shadow), var(--vision-specular);
  overflow: visible;
  animation: spatialFloatIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spatialFloatIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.prechat-aside {
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid var(--vision-border-subtle);
  padding: 36px 28px;
  border-radius: 35px 0 0 35px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.prechat-aside::before {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, transparent 70%);
  top: -80px;
  left: -60px;
  pointer-events: none;
}

.aside-top {
  position: relative;
  z-index: 1;
}

.aside-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
}

.aside-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: var(--vision-specular);
  display: flex;
  align-items: center;
  justify-content: center;
}

.aside-logo-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.prechat-aside h1 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 12px;
}

.prechat-aside p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.aside-highlights {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 11px 14px;
  border-radius: 16px;
}

.status-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--vision-specular);
  padding: 7px 14px;
  border-radius: 999px;
  margin-top: 22px;
  width: fit-content;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vision-green);
  box-shadow: 0 0 10px var(--vision-green);
}

/* Right Form Panel */
.prechat-main {
  padding: 34px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-heading {
  margin-bottom: 20px;
}

.form-heading h2 {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.form-heading span {
  font-size: 13px;
  color: var(--text-secondary);
}

.prechat-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-left: 4px;
}

.form-label .required {
  color: var(--vision-cyan);
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  pointer-events: none;
}

.input-control {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  font-family: inherit;
  font-size: 13.8px;
  color: #ffffff;
  transition: all 0.18s ease;
  outline: none;
}

.input-control::placeholder {
  color: var(--text-tertiary);
}

.input-control:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.input-control.is-invalid,
.combobox-trigger.is-invalid {
  border-color: var(--vision-red);
  box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.22);
}

.field-error {
  font-size: 11.5px;
  color: #ff6961;
  padding-left: 8px;
  display: none;
}

.field-error.visible {
  display: block;
}

/* Searchable Combobox (visionOS Capsule) */
.combobox {
  position: relative;
}

.combobox-trigger {
  width: 100%;
  min-height: 44px;
  padding: 8px 40px 8px 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  font-family: inherit;
  font-size: 13.8px;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.18s ease;
}

.combobox-trigger.placeholder {
  color: var(--text-tertiary);
}

.combobox.open .combobox-trigger,
.combobox-trigger:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.28);
}

.combobox-chevron {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  transition: transform 0.2s;
}

.combobox.open .combobox-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.combobox-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(18, 24, 35, 0.98);
  backdrop-filter: blur(36px) saturate(190%);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72), var(--vision-specular);
  z-index: 40;
  display: none;
  overflow: hidden;
}

.combobox.open .combobox-dropdown {
  display: block;
}

.combobox-search-wrap {
  padding: 10px;
  border-bottom: 1px solid var(--vision-border-subtle);
}

.combobox-search {
  width: 100%;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.combobox-search::placeholder {
  color: var(--text-tertiary);
}

.combobox-search:focus {
  border-color: var(--vision-cyan);
}

.combobox-list {
  max-height: 210px;
  overflow-y: auto;
  list-style: none;
  padding: 4px;
}

.combobox-option {
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.12s;
}

.combobox-option:hover {
  background: rgba(255, 255, 255, 0.12);
}

.combobox-option.selected {
  background: rgba(10, 132, 255, 0.32);
  font-weight: 600;
  color: #ffffff;
}

.store-code {
  font-size: 10.5px;
  font-weight: 700;
  color: #bae6fd;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.combobox-empty {
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Tipo de Atención Spatial Tiles */
.attention-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.attention-option {
  position: relative;
}

.attention-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.attention-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.18s ease;
}

.attention-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

.attention-option input:checked + .attention-card {
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(10, 132, 255, 0.28);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.attention-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.attention-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
}

.attention-desc {
  display: block;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

.btn-primary {
  margin-top: 4px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(28, 152, 255, 0.92) 0%, rgba(10, 116, 240, 0.92) 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 12px 28px rgba(10, 132, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary:hover {
  transform: scale(1.012);
  filter: brightness(1.08);
  box-shadow: 0 16px 34px rgba(10, 132, 255, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.popup-fallback {
  display: none;
  padding: 11px 14px;
  border-radius: 16px;
  background: rgba(255, 214, 10, 0.14);
  border: 1px solid rgba(255, 214, 10, 0.35);
  font-size: 12.5px;
  color: #fef08a;
}

.popup-fallback.visible {
  display: block;
}

.popup-fallback a {
  color: #ffffff;
  font-weight: 700;
}

.bo-portal-link-wrap {
  margin-top: 2px;
  text-align: right;
}

.bo-portal-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.bo-portal-link:hover {
  color: #ffffff;
}

/* =========================================================
   CHAT WINDOW: SPATIAL VISIONOS CONVERSATION PANEL
   ========================================================= */
.chat-body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.chat-spatial-window {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--vision-glass);
  backdrop-filter: blur(42px) saturate(190%);
  -webkit-backdrop-filter: blur(42px) saturate(190%);
  border: 1px solid var(--vision-border);
  border-radius: 32px;
  box-shadow: var(--vision-shadow), var(--vision-specular);
  overflow: hidden;
}

.chat-topbar {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--vision-border-subtle);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.agent-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.agent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--vision-specular);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.agent-avatar .online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--vision-green);
  box-shadow: 0 0 8px var(--vision-green);
  border: 2px solid rgba(20, 26, 38, 0.9);
}

.agent-name {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.agent-role {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--vision-green);
  box-shadow: 0 0 6px var(--vision-green);
  display: inline-block;
}

.agent-role .live-text {
  color: #86efac;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.folio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--vision-specular);
  color: #ffffff;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.folio-pill:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.02);
}

.session-strip {
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--vision-border-subtle);
  color: var(--text-secondary);
  padding: 8px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 11.8px;
  flex-shrink: 0;
}

.session-item strong {
  color: #ffffff;
  font-weight: 600;
}

.type-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(10, 132, 255, 0.28);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.day-divider {
  align-self: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 14px;
  border-radius: 999px;
}

/* Official Welcome Card (Spatial Glass Card) */
.welcome-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--vision-specular), 0 12px 30px rgba(0, 0, 0, 0.22);
  border-radius: 22px;
  overflow: hidden;
}

.welcome-banner {
  background: rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  padding: 10px 18px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.welcome-body {
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
}

.welcome-body p + p {
  margin-top: 9px;
}

.welcome-signoff {
  color: #7dd3fc;
  font-weight: 600;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.msg-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-row.agent {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-sender {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
  padding: 0 6px;
}

.msg-bubble {
  padding: 11px 16px;
  border-radius: 20px;
  font-size: 13.8px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-row.user .msg-bubble {
  background: linear-gradient(180deg, rgba(28, 152, 255, 0.88) 0%, rgba(10, 116, 240, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 20px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  border-bottom-right-radius: 6px;
}

.msg-row.agent .msg-bubble {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--vision-specular), 0 8px 20px rgba(0, 0, 0, 0.18);
  color: #ffffff;
  border-bottom-left-radius: 6px;
}

.msg-time {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 4px;
  padding: 0 6px;
}

/* Quick Chips + Spatial Capsule Composer */
.quick-replies {
  padding: 6px 18px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-chip:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.composer-dock {
  padding: 0 14px 14px;
  flex-shrink: 0;
}

.chat-composer {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 8px 6px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s;
}

.chat-composer:focus-within {
  background: rgba(0, 0, 0, 0.38);
  border-color: rgba(255, 255, 255, 0.42);
}

.composer-input {
  flex: 1;
  min-height: 24px;
  max-height: 100px;
  padding: 5px 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.8px;
  color: #ffffff;
  resize: none;
  outline: none;
  line-height: 1.4;
}

.composer-input::placeholder {
  color: var(--text-tertiary);
}

.btn-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, rgba(28, 152, 255, 0.92) 0%, rgba(10, 116, 240, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, filter 0.15s;
}

.btn-send:hover:not(:disabled) {
  transform: scale(1.05);
  filter: brightness(1.1);
}

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

/* =========================================================
   AUDIT PILLS & INTERACTIVE BUBBLE BUTTONS
   ========================================================= */
.audit-pill {
  align-self: center;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: var(--text-secondary);
  font-size: 11.8px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  text-align: center;
}

.audit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--vision-cyan);
  box-shadow: 0 0 6px var(--vision-cyan);
  flex-shrink: 0;
}

.audit-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.bubble-action-btn {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(180deg, rgba(28, 152, 255, 0.88) 0%, rgba(10, 116, 240, 0.88) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}

.bubble-action-btn:hover:not(:disabled) {
  transform: scale(1.02);
  filter: brightness(1.08);
}

.bubble-action-btn.remote {
  background: rgba(255, 255, 255, 0.16);
}

.bubble-action-btn.done {
  background: rgba(48, 209, 88, 0.18);
  color: #86efac;
  border: 1px solid rgba(48, 209, 88, 0.4);
  box-shadow: none;
  cursor: default;
}

.remote-link-box {
  margin-top: 8px;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #7dd3fc;
  word-break: break-all;
}

/* =========================================================
   CONSOLA EJECUTIVO BO TIENDAS (SPATIAL VISIONOS WORKSPACE)
   ========================================================= */
.bo-body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 12px;
  position: relative;
  overflow: hidden;
}

.bo-spatial-window {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--vision-glass);
  backdrop-filter: blur(44px) saturate(190%);
  -webkit-backdrop-filter: blur(44px) saturate(190%);
  border: 1px solid var(--vision-border);
  border-radius: 34px;
  box-shadow: var(--vision-shadow), var(--vision-specular);
  overflow: hidden;
}

.bo-topbar {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--vision-border-subtle);
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.bo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bo-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: var(--vision-specular);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
}

.bo-brand h1 {
  font-size: 15.5px;
  font-weight: 600;
  color: #ffffff;
}

.bo-brand p {
  font-size: 12px;
  color: var(--text-secondary);
}

.bo-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bo-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--vision-specular);
  padding: 6px 13px;
  border-radius: 999px;
}

.bo-new-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: var(--vision-specular);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 999px;
  transition: background 0.15s, transform 0.15s;
}

.bo-new-chat-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.02);
}

.bo-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr 290px;
  min-height: 0;
}

.bo-sidebar {
  background: rgba(0, 0, 0, 0.14);
  border-right: 1px solid var(--vision-border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bo-sidebar-head {
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bo-sidebar-head h2 {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.bo-count-badge {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}

.bo-filter-bar {
  display: flex;
  gap: 5px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--vision-border-subtle);
}

.bo-filter-btn {
  flex: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.bo-filter-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: var(--vision-specular);
  color: #ffffff;
}

.bo-sessions-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bo-session-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 12px 13px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary);
  transition: all 0.15s;
}

.bo-session-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.bo-session-item.active {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(10, 132, 255, 0.26);
  box-shadow: var(--vision-specular);
}

.bo-session-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.bo-session-folio {
  font-size: 11.5px;
  font-weight: 700;
  color: #7dd3fc;
}

.bo-session-time {
  font-size: 10.5px;
  color: var(--text-tertiary);
}

.bo-session-user {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
}

.bo-session-user small {
  font-weight: 500;
  color: var(--text-secondary);
}

.bo-session-store {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.bo-session-status,
.bo-status-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
}

.bo-session-status {
  margin-top: 6px;
}

.bo-session-status.open,
.bo-status-badge.open {
  background: rgba(48, 209, 88, 0.18);
  color: #86efac;
  border: 1px solid rgba(48, 209, 88, 0.38);
}

.bo-session-status.hold,
.bo-status-badge.hold {
  background: rgba(255, 214, 10, 0.16);
  color: #fde047;
  border: 1px solid rgba(255, 214, 10, 0.36);
}

.bo-session-status.closed,
.bo-status-badge.closed {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.bo-chat-area {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bo-placeholder {
  margin: auto;
  text-align: center;
  max-width: 340px;
  padding: 24px;
  color: var(--text-secondary);
}

.bo-placeholder-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--vision-specular);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.bo-placeholder h3 {
  color: #ffffff;
  margin-bottom: 6px;
}

.bo-active-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.bo-active-view[hidden] {
  display: none;
}

.bo-ticket-header {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--vision-border-subtle);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bo-ticket-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #ffffff;
}

.bo-folio-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 2px 10px;
  border-radius: 999px;
}

.bo-ticket-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Unified visionOS Glass Capsule Toolbar */
.bo-support-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.bo-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.bo-tool-btn svg {
  color: #7dd3fc;
}

.bo-tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.36);
  transform: translateY(-1px);
}

.bo-tool-btn.close {
  background: rgba(10, 132, 255, 0.32);
  border-color: rgba(56, 189, 248, 0.5);
  margin-left: auto;
}

.bo-tool-btn.close svg {
  color: #86efac;
}

.bo-tool-btn.close:hover:not(:disabled) {
  background: rgba(10, 132, 255, 0.48);
}

.bo-tool-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.bo-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bo-composer-wrap {
  padding: 0 16px 14px;
}

.bo-audit-panel {
  background: rgba(0, 0, 0, 0.14);
  border-left: 1px solid var(--vision-border-subtle);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bo-audit-section h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.bo-audit-section h3 svg {
  color: #7dd3fc;
}

.bo-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bo-file-card,
.bo-log-item {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 12px;
}

.bo-file-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  word-break: break-all;
}

.bo-file-meta,
.bo-log-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

.bo-log-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.bo-download-btn {
  margin-top: 8px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.bo-download-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.bo-empty-list,
.bo-empty-sub {
  font-size: 12.5px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 16px 8px;
}

.bo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.bo-modal-backdrop[hidden] {
  display: none;
}

.bo-modal {
  background: rgba(28, 35, 48, 0.88);
  backdrop-filter: blur(40px) saturate(190%);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: var(--vision-shadow), var(--vision-specular);
  padding: 24px 26px;
  width: 100%;
  max-width: 430px;
}

.bo-modal h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.bo-modal-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 6px 0 16px;
}

.bo-select {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}

.bo-select option {
  background: #18202c;
  color: #ffffff;
}

.bo-select:focus {
  border-color: var(--vision-cyan);
}

.bo-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.bo-btn-cancel {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.bo-btn-confirm {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, rgba(28, 152, 255, 0.92) 0%, rgba(10, 116, 240, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
}

@media (max-width: 1040px) {
  .bo-layout {
    grid-template-columns: 240px 1fr;
  }
  .bo-audit-panel {
    display: none;
  }
}

@media (max-width: 780px) {
  .prechat-shell {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .prechat-aside {
    border-radius: 35px 35px 0 0;
    border-right: none;
    border-bottom: 1px solid var(--vision-border-subtle);
    padding: 24px;
  }
  .aside-highlights {
    display: none;
  }
  .prechat-main {
    padding: 24px 22px;
  }
  .form-row-2,
  .attention-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   ELEMENTOS ADICIONALES: TYPING, NOTAS BO, RATING Y BADGES
   ========================================================= */
.typing-status-bar {
  padding: 4px 20px;
  font-size: 11.5px;
  color: #86efac;
  display: flex;
  align-items: center;
  gap: 7px;
}

.typing-status-bar[hidden] {
  display: none;
}

.bo-unread-badge {
  background: var(--vision-blue);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(10, 132, 255, 0.6);
}

.bo-session-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bo-notes-area {
  margin-top: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  resize: vertical;
  outline: none;
}

.bo-notes-area::placeholder {
  color: var(--text-tertiary);
}

.bo-notes-area:focus {
  border-color: var(--vision-cyan);
}

.star-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.star-btn:hover,
.star-btn.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.5);
  transform: scale(1.06);
}

.danger-pill:hover {
  background: rgba(255, 69, 58, 0.28);
  border-color: rgba(255, 69, 58, 0.5);
}

/* =========================================================
   PANTALLA DE LOG ON • EJECUTIVO BO TIENDAS (visionOS)
   ========================================================= */
.bo-login-gate {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bo-login-gate[hidden],
.bo-spatial-window[hidden] {
  display: none;
}

.bo-login-card {
  width: 100%;
  max-width: 470px;
  background: var(--vision-glass);
  backdrop-filter: blur(44px) saturate(190%);
  -webkit-backdrop-filter: blur(44px) saturate(190%);
  border: 1px solid var(--vision-border);
  box-shadow: var(--vision-shadow), var(--vision-specular);
  border-radius: 34px;
  padding: 32px 34px;
  animation: spatialFloatIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.bo-login-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}
