/* ==========================================================================
   MCom Desktop 2026 · capa de escritorio para Bille y CreaVende
   Se activa sola en el host nativo (/space/<slug>), en la ventana de
   CreaVende y con ?desktop=1. En vista web no altera nada.
   Reglas: texto legible (>= 10 px), iconos SVG, cero fuentes externas.
   ========================================================================== */

:root {
  --mcom-desk-bar: 54px;
  --mcom-desk-status: 28px;
}

html[data-desk-accent="emerald"] {
  --desk-accent: #34d399;
  --desk-accent-strong: #10b981;
  --desk-accent-soft: rgba(52, 211, 153, 0.14);
  --desk-accent-line: rgba(52, 211, 153, 0.34);
}

html[data-desk-accent="rose"] {
  --desk-accent: #fb7185;
  --desk-accent-strong: #f43f5e;
  --desk-accent-soft: rgba(251, 113, 133, 0.14);
  --desk-accent-line: rgba(251, 113, 133, 0.34);
}

html[data-desk-accent="cyan"] {
  --desk-accent: #67e8f9;
  --desk-accent-strong: #06b6d4;
  --desk-accent-soft: rgba(103, 232, 249, 0.14);
  --desk-accent-line: rgba(103, 232, 249, 0.34);
}

html.mcom-desk {
  color-scheme: dark;
  background: #05080d;
}

html.mcom-desk body {
  padding-top: var(--mcom-desk-bar) !important;
  padding-bottom: var(--mcom-desk-status) !important;
  min-height: 100vh;
}

/* En escritorio mandan la barra propia y la estación: fuera landing y pie web.
   Se excluyen la barra y la barra de estado propias, que también son header/footer. */
html.mcom-desk body > header:not(.mcom-desk-bar),
html.mcom-desk body > footer:not(.mcom-desk-status),
html.mcom-desk .mcom-desk-hero,
html.mcom-desk #desktop-section {
  display: none !important;
}

html.mcom-desk a[href="#desktop-section"],
html.mcom-desk .cv-actions__wide {
  display: none !important;
}

html.mcom-desk [id] {
  scroll-margin-top: calc(var(--mcom-desk-bar) + 14px);
}

/* --------------------------------------------------------------------------
   Barra de aplicación
   -------------------------------------------------------------------------- */

.mcom-desk-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  height: var(--mcom-desk-bar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid #1c2532;
  background:
    linear-gradient(180deg, rgba(13, 18, 27, 0.97), rgba(7, 10, 16, 0.96));
  box-shadow: 0 12px 32px -28px #000;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: #e2e8f0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.mcom-desk-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.mcom-desk-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--desk-accent), var(--desk-accent-strong));
  color: #06110c;
  font: 800 11px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 16px -10px var(--desk-accent);
}

.mcom-desk-brand__text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.mcom-desk-brand__name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #f8fafc;
  white-space: nowrap;
}

.mcom-desk-brand__sub {
  font: 600 10px/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7c8798;
  white-space: nowrap;
}

.mcom-desk-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.mcom-desk-nav::-webkit-scrollbar {
  display: none;
}

.mcom-desk-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #9aa6b8;
  font: 600 12px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.mcom-desk-nav__btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  opacity: 0.9;
}

.mcom-desk-nav__btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.mcom-desk-nav__btn[aria-current="true"] {
  color: var(--desk-accent);
  background: var(--desk-accent-soft);
  border-color: var(--desk-accent-line);
}

.mcom-desk-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
}

.mcom-desk-local {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid #243040;
  border-radius: 999px;
  background: rgba(9, 14, 21, 0.8);
  color: #93a1b5;
  font: 600 10.5px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.mcom-desk-local::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--desk-accent);
  box-shadow: 0 0 0 3px var(--desk-accent-soft);
}

.mcom-desk-exit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #263243;
  border-radius: 8px;
  background: transparent;
  color: #aab6c7;
  font: 600 11.5px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.mcom-desk-exit:hover {
  color: #fff;
  border-color: #3a4a60;
  background: rgba(255, 255, 255, 0.04);
}

.mcom-desk-exit svg {
  width: 13px;
  height: 13px;
}

.mcom-desk-bar :focus-visible,
.mcom-desk-status :focus-visible {
  outline: 2px solid var(--desk-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Estación de trabajo
   -------------------------------------------------------------------------- */

html.mcom-desk #mainContainer,
html.mcom-desk body > main {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 14px 20px 16px !important;
}

html.mcom-desk [data-mcom-stage] {
  padding-top: 0 !important;
  margin-top: 0 !important;
  border-top: 0 !important;
  scroll-margin-top: calc(var(--mcom-desk-bar) + 10px);
}

html.mcom-desk [data-mcom-stage] > div:first-child {
  margin-bottom: 12px;
}

html.mcom-desk [data-mcom-stage] h2 {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

html.mcom-desk [data-mcom-stage] > div:first-child p {
  font-size: 12px;
  color: #8b97a8;
}

html.mcom-desk #mainContainer > section:not([data-mcom-stage]),
html.mcom-desk body > main > section:not([data-mcom-stage]) {
  margin-top: 30px !important;
  padding-top: 26px !important;
}

/* La estación ocupa la ventana; el contenido interior es el que desplaza. */
html.mcom-desk .fin-shell,
html.mcom-desk .cv-app {
  height: calc(100vh - var(--mcom-desk-bar) - var(--mcom-desk-status) - 148px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border-color: #223041;
  box-shadow: 0 30px 70px -50px #000, inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html.mcom-desk .fin-body,
html.mcom-desk .cv-app__body {
  flex: 1;
  min-height: 0;
}

html.mcom-desk .fin-content,
html.mcom-desk .cv-main {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
  padding: 20px 22px 24px;
}

html.mcom-desk .fin-content::-webkit-scrollbar,
html.mcom-desk .cv-main::-webkit-scrollbar {
  width: 10px;
}

html.mcom-desk .fin-content::-webkit-scrollbar-thumb,
html.mcom-desk .cv-main::-webkit-scrollbar-thumb {
  background: #29364a;
  border: 3px solid #080d14;
  border-radius: 999px;
}

html.mcom-desk .fin-rail,
html.mcom-desk .cv-rail {
  background: rgba(4, 8, 13, 0.55);
}

/* Barra de la ventana interna: sin semáforos de macOS, con marca y estado. */
html.mcom-desk .fin-bar,
html.mcom-desk .cv-app__bar {
  min-height: 50px;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(18, 25, 36, 0.9), rgba(9, 13, 20, 0.9));
  border-bottom-color: #223041;
}

html.mcom-desk .fin-dot,
html.mcom-desk .cv-dot {
  display: none;
}

html.mcom-desk .fin-bar__left::before,
html.mcom-desk .cv-app__bar-left::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 5px;
  flex: 0 0 auto;
  background: linear-gradient(150deg, var(--desk-accent), var(--desk-accent-strong));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

html.mcom-desk .fin-bar__title,
html.mcom-desk .cv-app__title {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #d7e0ec;
}

html.mcom-desk .fin-save,
html.mcom-desk .cv-app__status {
  font-size: 10.5px;
}

/* Legibilidad: ningún texto funcional por debajo de 10 px. */
html.mcom-desk .fin-field label,
html.mcom-desk .cv-field label {
  font-size: 10px;
}

html.mcom-desk .fin-field input,
html.mcom-desk .fin-field select,
html.mcom-desk .fin-field textarea,
html.mcom-desk .cv-field input,
html.mcom-desk .cv-field select,
html.mcom-desk .cv-field textarea {
  min-height: 36px;
  font-size: 12px;
}

html.mcom-desk .fin-kpi span,
html.mcom-desk .cv-kpi span,
html.mcom-desk .fin-card__head span,
html.mcom-desk .fin-rail__label,
html.mcom-desk .cv-rail__label {
  font-size: 10px;
}

html.mcom-desk .fin-kpi b {
  font-size: 24px;
}

html.mcom-desk .cv-kpi b {
  font-size: 23px;
}

html.mcom-desk .fin-pill,
html.mcom-desk .cv-pill {
  font-size: 10px;
  padding: 3px 7px;
}

html.mcom-desk .fin-tab,
html.mcom-desk .cv-tab {
  font-size: 12px;
  min-height: 42px;
}

html.mcom-desk .fin-tab__count,
html.mcom-desk .cv-tab__count {
  font-size: 10px;
}

html.mcom-desk .fin-heading h3,
html.mcom-desk .cv-heading h3 {
  font-size: 21px;
}

html.mcom-desk .fin-heading p,
html.mcom-desk .cv-heading p {
  font-size: 12px;
}

html.mcom-desk .fin-bar-row b,
html.mcom-desk .cv-row__main small {
  font-size: 10px;
}

html.mcom-desk .fin-submit,
html.mcom-desk .cv-submit {
  min-height: 36px;
  font-size: 11px;
}

html.mcom-desk .fin-btn,
html.mcom-desk .cv-btn {
  min-height: 34px;
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   Barra de estado
   -------------------------------------------------------------------------- */

.mcom-desk-status {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  height: var(--mcom-desk-status);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  border-top: 1px solid #1b2430;
  background: #060a10;
  color: #6b7788;
  font: 500 10.5px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.02em;
}

.mcom-desk-status span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcom-desk-status__mod {
  color: var(--desk-accent);
}

/* Con sesión, el riel del ecosistema ocupa la izquierda: la barra respeta su ancho. */
html.mcom-desk body.eco-authenticated .mcom-desk-bar,
html.mcom-desk body.eco-authenticated .mcom-desk-status {
  left: var(--eco-w, 0px);
}

@media (max-width: 1080px) {
  .mcom-desk-brand__sub {
    display: none;
  }

  .mcom-desk-nav__btn {
    padding: 0 9px;
  }
}

@media (max-width: 880px) {
  .mcom-desk-nav__btn span {
    display: none;
  }

  .mcom-desk-nav__btn {
    width: 34px;
    justify-content: center;
    padding: 0;
  }

  .mcom-desk-local {
    display: none;
  }

  .mcom-desk-status span:nth-child(2) {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Marco nativo integrado (host Rust sin barra del sistema)
   -------------------------------------------------------------------------- */

html[data-desk-native="true"] {
  --mcom-desk-bar: 50px;
}

html[data-desk-native="true"] .mcom-desk-bar {
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

html[data-desk-native="true"] .mcom-desk-exit {
  display: none;
}

/* Scrollbars finos: el WebView deja de parecer una página web pesada. */
html.mcom-desk ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html.mcom-desk ::-webkit-scrollbar-track {
  background: transparent;
}

html.mcom-desk ::-webkit-scrollbar-thumb {
  background: #2b3849;
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

html.mcom-desk ::-webkit-scrollbar-thumb:hover {
  background: var(--desk-accent, #22d3ee);
  border: 2px solid transparent;
  background-clip: padding-box;
}

html.mcom-desk ::-webkit-scrollbar-corner {
  background: transparent;
}

html.mcom-desk {
  overscroll-behavior: none;
}

.mcom-desk-win {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid #202b3a;
}

.mcom-desk-win button {
  width: 44px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #a4b0c1;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.mcom-desk-win button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.mcom-desk-win button:active {
  background: rgba(255, 255, 255, 0.12);
}

.mcom-desk-win button svg {
  width: 12px;
  height: 12px;
}

.mcom-desk-win .mcom-desk-win__close:hover {
  background: #c42b1c;
  color: #fff;
}

.mcom-desk-win .ico-restore {
  display: none;
}

html[data-desk-maximized="true"] .mcom-desk-win .ico-max {
  display: none;
}

html[data-desk-maximized="true"] .mcom-desk-win .ico-restore {
  display: block;
}

/* --------------------------------------------------------------------------
   Paleta de comandos (Ctrl+K)
   -------------------------------------------------------------------------- */

.mcom-desk-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid #263243;
  border-radius: 8px;
  background: rgba(9, 14, 21, 0.82);
  color: #9aa6b8;
  font: 600 11px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.mcom-desk-search:hover {
  color: #f1f5f9;
  border-color: #3a4a60;
  background: rgba(255, 255, 255, 0.04);
}

.mcom-desk-search svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.mcom-desk-search kbd {
  padding: 2px 5px;
  border: 1px solid #2a394c;
  border-radius: 4px;
  background: #0a111b;
  color: #6f7f94;
  font: 600 9.5px/1 "JetBrains Mono", ui-monospace, monospace;
}

html.mcom-palette-open,
html.mcom-palette-open body {
  overflow: hidden;
}

.mcom-palette[hidden] {
  display: none !important;
}

.mcom-palette {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}

.mcom-palette__scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 10, 0.66);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: mcomFade 0.14s ease-out;
}

.mcom-palette__panel {
  position: relative;
  width: min(620px, 100%);
  overflow: hidden;
  border: 1px solid #2a394d;
  border-radius: 16px;
  background: #0a1019;
  box-shadow: 0 36px 90px -22px #000, inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: mcomPaletteIn 0.16s ease-out;
}

.mcom-palette__search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid #1e2a3a;
  color: #7f8ea3;
}

.mcom-palette__search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.mcom-palette__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #eef4fb;
  font: 500 14px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  outline: none;
}

.mcom-palette__search input::placeholder {
  color: #6a7a8f;
}

.mcom-palette__search kbd,
.mcom-palette__foot kbd {
  padding: 2px 5px;
  border: 1px solid #2a394c;
  border-radius: 4px;
  background: #0d1520;
  color: #7f8fa4;
  font: 600 9.5px/1 "JetBrains Mono", ui-monospace, monospace;
}

.mcom-palette__list {
  max-height: min(380px, 52vh);
  overflow: auto;
  padding: 6px;
  scrollbar-width: thin;
}

.mcom-palette__row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #dbe4ef;
  text-align: left;
  cursor: pointer;
}

.mcom-palette__row.is-active,
.mcom-palette__row:hover {
  background: var(--desk-accent-soft);
  border-color: var(--desk-accent-line);
}

.mcom-palette__ico {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #2a3a4d;
  border-radius: 8px;
  background: #0d1520;
  color: var(--desk-accent);
}

.mcom-palette__ico svg {
  width: 14px;
  height: 14px;
}

.mcom-palette__text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mcom-palette__text strong {
  font: 600 12.5px/1.25 "Plus Jakarta Sans", system-ui, sans-serif;
  color: #eef4fb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcom-palette__text small {
  font: 500 10.5px/1.25 "JetBrains Mono", ui-monospace, monospace;
  color: #7f8ea3;
}

.mcom-palette__row > kbd {
  opacity: 0;
  padding: 2px 5px;
  border: 1px solid #2f4056;
  border-radius: 4px;
  color: #8fa0b6;
  font: 600 10px/1 "JetBrains Mono", ui-monospace, monospace;
}

.mcom-palette__row.is-active > kbd {
  opacity: 1;
}

.mcom-palette__empty {
  padding: 28px 16px;
  text-align: center;
  color: #7f8ea3;
  font-size: 12px;
}

.mcom-palette__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid #1e2a3a;
  background: #080d15;
  color: #6f7f94;
  font-size: 10px;
}

.mcom-palette__foot span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Pulido de tarjetas y filas */
html.mcom-desk .fin-kpi,
html.mcom-desk .cv-kpi {
  transition: transform 0.18s ease, border-color 0.18s ease;
}

html.mcom-desk .fin-kpi:hover,
html.mcom-desk .cv-kpi:hover {
  transform: translateY(-1px);
  border-color: var(--desk-accent-line);
}

html.mcom-desk .fin-row,
html.mcom-desk .cv-row {
  transition: border-color 0.15s ease, background 0.15s ease;
}

html.mcom-desk .fin-row:hover,
html.mcom-desk .cv-row:hover {
  border-color: #334155;
  background: rgba(15, 23, 42, 0.55);
}

html.mcom-desk [data-mcom-stage] {
  animation: mcomDeskRise 0.22s ease-out both;
}

.mcom-target {
  animation: mcomTarget 1.2s ease-out;
}

@keyframes mcomFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mcomPaletteIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

@keyframes mcomDeskRise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@keyframes mcomTarget {
  0% { box-shadow: 0 0 0 2px var(--desk-accent), 0 0 26px var(--desk-accent-soft); }
  100% { box-shadow: 0 0 0 2px transparent, 0 0 0 transparent; }
}

@media (max-width: 1180px) {
  .mcom-desk-search kbd {
    display: none;
  }
}

@media (max-width: 1024px) {
  .mcom-desk-search span {
    display: none;
  }

  .mcom-desk-search {
    width: 30px;
    justify-content: center;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mcom-desk-nav__btn,
  .mcom-desk-exit,
  .mcom-desk-win button,
  .mcom-desk-search,
  html.mcom-desk .fin-kpi,
  html.mcom-desk .cv-kpi,
  html.mcom-desk .fin-row,
  html.mcom-desk .cv-row {
    transition: none;
  }

  .mcom-palette__scrim,
  .mcom-palette__panel,
  html.mcom-desk [data-mcom-stage],
  .mcom-target {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Asistente guiado de Bille: conversación, estado y compositor
   -------------------------------------------------------------------------- */

.bille-assistant {
  display: grid;
  gap: 18px;
  padding-top: 30px;
  border-top: 1px solid #1e293b;
  scroll-margin-top: 72px;
}

.bille-assistant__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.bille-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #34d399;
  font: 700 10px/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.bille-eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: currentColor;
  opacity: 0.8;
}

.bille-assistant__head h2 {
  margin: 7px 0 0;
  color: #f1f5f9;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.bille-assistant__head p {
  max-width: 64ch;
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.6;
}

.bille-assistant__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 3px;
}

.bille-live,
.bille-local {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font: 650 10px/1 "JetBrains Mono", ui-monospace, monospace;
  white-space: nowrap;
}

.bille-live {
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
  color: #6ee7b7;
}

.bille-live i,
.bille-chat__identity span i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.bille-local {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
}

.bille-chat {
  overflow: hidden;
  border: 1px solid #243244;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(13, 21, 32, 0.96), rgba(8, 13, 20, 0.98));
  box-shadow: 0 30px 70px -55px #000, inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.bille-chat__bar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #1f2b3c;
  background: rgba(15, 23, 36, 0.72);
}

.bille-chat__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.bille-chat__avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(52, 211, 153, 0.55);
  border-radius: 50%;
  object-fit: cover;
}

.bille-chat__identity div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.bille-chat__identity strong {
  color: #f1f5f9;
  font-size: 13px;
  line-height: 1.2;
}

.bille-chat__identity span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #7f8ea3;
  font-size: 10px;
  line-height: 1.2;
}

.bille-chat__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.bille-chat__count {
  color: #64748b;
  font: 600 10px/1 "JetBrains Mono", ui-monospace, monospace;
}

.bille-icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #29374a;
  border-radius: 8px;
  background: #0b121c;
  color: #8b9bb0;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.bille-icon-btn svg {
  width: 14px;
  height: 14px;
}

.bille-icon-btn:hover {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.08);
  color: #a7f3d0;
}

.bille-chat__history {
  display: grid;
  gap: 13px;
  align-content: start;
  min-height: 250px;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 18px;
  background:
    radial-gradient(520px 220px at 18% 0%, rgba(52, 211, 153, 0.045), transparent 65%),
    rgba(5, 9, 15, 0.55);
}

.bille-chat__history::-webkit-scrollbar {
  width: 8px;
}

.bille-chat__history::-webkit-scrollbar-thumb {
  background: #2a3a4c;
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

.bille-msg {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.bille-msg--user {
  justify-content: flex-end;
}

.bille-msg__avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  margin-top: 2px;
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-radius: 50%;
  object-fit: cover;
}

.bille-msg__body {
  max-width: min(78%, 620px);
  padding: 10px 13px;
  border: 1px solid #243244;
  border-radius: 4px 14px 14px 14px;
  background: #0d1520;
  color: #dbe5f1;
  box-shadow: 0 12px 28px -24px #000;
}

.bille-msg--user .bille-msg__body {
  border-color: rgba(52, 211, 153, 0.28);
  border-radius: 14px 4px 14px 14px;
  background: rgba(6, 78, 59, 0.32);
  color: #d1fae5;
}

.bille-msg__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.bille-msg__meta strong {
  color: #6ee7b7;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.bille-msg--user .bille-msg__meta strong {
  color: #a7f3d0;
}

.bille-msg__meta time {
  color: #64748b;
  font: 500 10px/1 "JetBrains Mono", ui-monospace, monospace;
  white-space: nowrap;
}

.bille-msg__text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bille-msg--typing .bille-msg__body {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 54px;
  min-height: 34px;
}

.bille-typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6ee7b7;
  animation: billeTyping 1s ease-in-out infinite;
}

.bille-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.bille-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes billeTyping {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.bille-chat__prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 11px 16px;
  border-top: 1px solid #1f2b3c;
  background: rgba(15, 23, 36, 0.5);
}

.bille-prompt {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #29374a;
  border-radius: 8px;
  background: #0b121c;
  color: #a9b7c9;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.bille-prompt:hover {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.07);
  color: #d1fae5;
}

.bille-chat__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 13px 16px 12px;
  border-top: 1px solid #1f2b3c;
  background: rgba(12, 19, 29, 0.92);
}

.bille-chat__field {
  min-width: 0;
}

.bille-chat__field label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.bille-chat__field input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #2a384b;
  border-radius: 10px;
  background: #070c13;
  color: #f1f5f9;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.bille-chat__field input::placeholder {
  color: #5f6f84;
}

.bille-chat__field input:focus {
  border-color: rgba(52, 211, 153, 0.65);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

.bille-send {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid #34d399;
  border-radius: 10px;
  background: #34d399;
  color: #04120c;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.bille-send svg {
  width: 14px;
  height: 14px;
}

.bille-send:hover {
  background: #6ee7b7;
}

.bille-send:active {
  transform: translateY(1px);
}

.bille-chat__composer small {
  grid-column: 1 / -1;
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .bille-assistant__head,
  .bille-assistant__meta {
    align-items: flex-start;
  }

  .bille-assistant__head h2 {
    font-size: 22px;
  }

  .bille-chat__history {
    max-height: 360px;
    padding: 14px;
  }

  .bille-msg__body {
    max-width: 86%;
  }
}

@media (max-width: 480px) {
  .bille-chat__bar,
  .bille-chat__prompts,
  .bille-chat__composer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .bille-send {
    width: 44px;
    padding: 0;
  }

  .bille-send span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bille-typing-dot { animation: none; }
  .bille-icon-btn,
  .bille-prompt,
  .bille-send,
  .bille-chat__field input { transition: none; }
}
