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

:root {
  --bg: #07111f;
  --bg-secondary: #0a1626;
  --sidebar: #08131f;

  --panel: #0f1d2d;
  --panel-2: #132336;
  --panel-hover: #172b40;

  --border: #29425d;
  --border-soft: #1b3047;

  --text: #f8fafc;
  --text-soft: #dbe7f3;
  --muted: #8fa2b7;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.13);

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.11);

  --orange: #f59e0b;
  --orange-soft: rgba(245, 158, 11, 0.11);

  --shadow:
    0 20px 50px rgba(0, 0, 0, 0.22);

  --sidebar-width: 310px;
  --topbar-height: 88px;
}


/* =========================================================
   LIGHT THEME
========================================================= */

body.light-theme {
  --bg: #f3f7fb;
  --bg-secondary: #edf3f9;
  --sidebar: #ffffff;

  --panel: #ffffff;
  --panel-2: #f8fbff;
  --panel-hover: #eef4fb;

  --border: #d7e1ec;
  --border-soft: #e3eaf2;

  --text: #0f172a;
  --text-soft: #26364a;
  --muted: #64748b;

  --primary-soft: rgba(37, 99, 235, 0.08);
  --green-soft: rgba(22, 163, 74, 0.08);
  --orange-soft: rgba(217, 119, 6, 0.08);

  --shadow:
    0 18px 45px rgba(15, 23, 42, 0.08);
}


html {
  scroll-behavior: smooth;
}


body {
  min-height: 100vh;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--bg);
  color: var(--text);
}


button,
input,
select {
  font: inherit;
}


button {
  cursor: pointer;
}


a {
  text-decoration: none;
}


/* =========================================================
   APP
========================================================= */

.app-shell {
  display: flex;

  min-height: 100vh;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;

  z-index: 30;

  width: var(--sidebar-width);
  height: 100vh;

  display: flex;
  flex-direction: column;

  padding: 30px 22px;

  background: var(--sidebar);

  border-right:
    1px solid var(--border-soft);
}


.sidebar-brand {
  display: flex;
  align-items: center;

  gap: 15px;

  padding:
    0 9px 30px;

  margin-bottom: 12px;

  border-bottom:
    1px solid var(--border-soft);
}


.brand-mark {
  width: 56px;
  height: 56px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 16px;

  color: #ffffff;

  font-size: 19px;
  font-weight: 900;

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #0ea5e9
    );

  box-shadow:
    0 12px 30px
    rgba(37, 99, 235, 0.26);
}


.brand-name {
  font-size: 18px;
  font-weight: 900;

  letter-spacing: -0.4px;
}


.brand-subtitle {
  margin-top: 5px;

  color: var(--muted);

  font-size: 12px;
}


.sidebar-section-label {
  padding:
    24px 14px 11px;

  color: var(--muted);

  font-size: 11px;
  font-weight: 900;

  letter-spacing: 1.45px;

  text-transform: uppercase;
}


.sidebar-settings-label {
  margin-top: 15px;
}


.sidebar-nav {
  display: flex;
  flex-direction: column;

  gap: 7px;
}


.nav-item {
  width: 100%;

  display: flex;
  align-items: center;

  gap: 14px;

  padding: 15px;

  border: 0;
  border-radius: 13px;

  background: transparent;
  color: var(--muted);

  font-size: 14px;
  font-weight: 750;

  text-align: left;

  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}


.nav-item:hover {
  color: var(--text);

  background: var(--panel-hover);

  transform:
    translateX(3px);
}


.nav-item.active {
  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #3b82f6
    );

  box-shadow:
    0 10px 25px
    rgba(37, 99, 235, 0.22);
}


.nav-icon {
  width: 28px;

  display: inline-flex;
  justify-content: center;

  font-size: 18px;
}


.sidebar-bottom {
  margin-top: auto;

  padding-top: 24px;
}


.sidebar-product-card {
  display: flex;
  align-items: center;

  gap: 13px;

  padding: 17px;

  border:
    1px solid var(--border-soft);

  border-radius: 14px;

  background: var(--panel-2);
}


.sidebar-product-dot {
  width: 10px;
  height: 10px;

  border-radius: 50%;

  background: var(--green);

  box-shadow:
    0 0 0 6px
    rgba(34, 197, 94, 0.08);
}


.sidebar-product-card strong {
  display: block;

  font-size: 12px;
}


.sidebar-product-card p {
  margin-top: 4px;

  color: var(--muted);

  font-size: 11px;
}


/* =========================================================
   MAIN SHELL
========================================================= */

.main-shell {
  width:
    calc(
      100% -
      var(--sidebar-width)
    );

  min-height: 100vh;

  margin-left:
    var(--sidebar-width);

  background:
    linear-gradient(
      180deg,
      var(--bg-secondary),
      var(--bg)
      420px
    );
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
  position: sticky;
  top: 0;

  z-index: 20;

  height: var(--topbar-height);

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding:
    0 46px;

  background: var(--bg);

  border-bottom:
    1px solid var(--border-soft);
}


.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;

  gap: 15px;
}


.topbar-brand-mobile {
  display: none;
}


.theme-toggle {
  min-width: 94px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  padding:
    0 16px;

  border:
    1px solid var(--border-soft);

  border-radius: 12px;

  background: var(--panel);
  color: var(--text);

  font-size: 12px;
  font-weight: 800;
}


.theme-toggle:hover {
  background: var(--panel-hover);
}


.user-chip {
  display: flex;
  align-items: center;

  gap: 12px;

  min-height: 50px;

  padding:
    7px 12px 7px 7px;

  border:
    1px solid var(--border-soft);

  border-radius: 13px;

  background: var(--panel);
}


.user-avatar {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 11px;

  color: #ffffff;

  font-size: 14px;
  font-weight: 900;

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #0ea5e9
    );
}


.user-info {
  display: flex;
  flex-direction: column;
}


.user-info strong {
  font-size: 12px;
}


.user-info span {
  max-width: 230px;

  margin-top: 3px;

  overflow: hidden;

  color: var(--muted);

  font-size: 11px;

  text-overflow: ellipsis;
  white-space: nowrap;
}


.mobile-menu-btn {
  display: none;
}


/* =========================================================
   CONTENT
========================================================= */

.main-content {
  width: 100%;

  padding:
    48px
    58px
    80px;
}


/* =========================================================
   PAGE HEADER
========================================================= */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 30px;

  margin-bottom: 44px;
}


.eyebrow {
  margin-bottom: 10px;

  color: var(--primary);

  font-size: 11px;
  font-weight: 900;

  letter-spacing: 1.6px;
}


.page-header h1 {
  font-size:
    clamp(
      38px,
      3.2vw,
      52px
    );

  line-height: 1;

  letter-spacing: -1.8px;
}


.page-header p {
  margin-top: 12px;

  color: var(--muted);

  font-size: 14px;
}


.selector-wrap {
  width: 340px;
}


.selector-wrap label {
  display: block;

  margin-bottom: 9px;

  color: var(--muted);

  font-size: 12px;
  font-weight: 800;
}


select,
input {
  width: 100%;

  min-height: 50px;

  padding:
    0 15px;

  outline: none;

  border:
    1px solid var(--border);

  border-radius: 12px;

  background: var(--panel);
  color: var(--text);
}


select:focus,
input:focus {
  border-color: var(--primary);

  box-shadow:
    0 0 0 3px
    var(--primary-soft);
}


/* =========================================================
   SECTIONS
========================================================= */

.tab-section {
  display: none;
}


.tab-section.active {
  display: block;
}


.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 22px;

  margin-bottom: 24px;
}


.section-title-row h2 {
  font-size: 25px;

  letter-spacing: -0.7px;
}


.section-title-row p {
  margin-top: 7px;

  color: var(--muted);

  font-size: 13px;
}


.live-badge {
  display: inline-flex;
  align-items: center;

  gap: 8px;

  padding:
    9px 14px;

  border:
    1px solid
    rgba(34, 197, 94, 0.25);

  border-radius: 999px;

  color: var(--green);

  background: var(--green-soft);

  font-size: 11px;
  font-weight: 900;
}


.live-badge span {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: var(--green);
}


/* =========================================================
   KPI CARDS
========================================================= */

.stats-grid {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 22px;

  margin-bottom: 28px;
}


.stat-card,
.insight-card,
.data-card,
.coach-card {
  border:
    1px solid var(--border-soft);

  background: var(--panel);

  box-shadow:
    var(--shadow);
}


.stat-card {
  min-height: 205px;

  padding: 28px;

  border-radius: 19px;
}


.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;
}


.stat-label {
  color: var(--muted);

  font-size: 13px;
  font-weight: 800;
}


.stat-icon {
  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  color: var(--primary);

  background: var(--primary-soft);

  font-size: 18px;
}


.stat-value {
  margin-top: 34px;

  font-size:
    clamp(
      36px,
      2.7vw,
      48px
    );

  font-weight: 900;

  letter-spacing: -1.3px;
}


.stat-foot {
  margin-top: 11px;

  color: var(--muted);

  font-size: 11px;
}


/* =========================================================
   TOP / ATTENTION CARDS
========================================================= */

.performance-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 22px;

  margin-bottom: 28px;
}


.insight-card {
  min-height: 270px;

  padding: 32px;

  border-radius: 19px;
}


.success-card {
  border-color:
    rgba(34, 197, 94, 0.25);
}


.warning-card {
  border-color:
    rgba(245, 158, 11, 0.25);
}


.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 25px;
}


.card-kicker {
  color: var(--muted);

  font-size: 10px;
  font-weight: 900;

  letter-spacing: 1.5px;
}


.card-heading h3 {
  margin-top: 7px;

  font-size: 20px;
}


.card-symbol {
  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 13px;

  color: var(--primary);

  background: var(--primary-soft);

  font-size: 21px;
  font-weight: 900;
}


.success-card .card-symbol {
  color: var(--green);
  background: var(--green-soft);
}


.warning-card .card-symbol {
  color: var(--orange);
  background: var(--orange-soft);
}


.featured-value {
  margin-top: 48px;

  font-size:
    clamp(
      31px,
      2.6vw,
      42px
    );

  font-weight: 900;

  letter-spacing: -1.2px;
}


.muted {
  color: var(--muted);
}


.insight-card .muted {
  margin-top: 10px;

  font-size: 13px;
}


/* =========================================================
   DATA CARDS
========================================================= */

.data-card {
  padding: 32px;

  border-radius: 19px;

  margin-bottom: 28px;
}


.data-card-header {
  display: flex;
  justify-content: space-between;

  gap: 22px;

  padding-bottom: 22px;

  margin-bottom: 10px;

  border-bottom:
    1px solid var(--border-soft);
}


.data-card-header h3 {
  font-size: 20px;
}


.data-card-header p {
  margin-top: 7px;

  color: var(--muted);

  font-size: 12px;
}


/* =========================================================
   TABLE
========================================================= */

.table-wrap {
  width: 100%;

  overflow-x: auto;
}


.comparison-table {
  width: 100%;

  min-width: 950px;

  border-collapse: collapse;
}


.comparison-table th,
.comparison-table td {
  padding:
    20px 16px;

  text-align: left;

  border-bottom:
    1px solid var(--border-soft);
}


.comparison-table th {
  color: var(--muted);

  font-size: 11px;
  font-weight: 900;

  letter-spacing: 0.65px;

  text-transform: uppercase;
}


.comparison-table td {
  color: var(--text-soft);

  font-size: 14px;
}


.comparison-table td strong {
  color: var(--text);

  font-weight: 800;
}


.comparison-table tbody tr:hover {
  background: var(--panel-hover);
}


/* =========================================================
   CONTENT
========================================================= */

.content-item {
  padding:
    25px 5px;

  border-bottom:
    1px solid var(--border-soft);
}


.content-item:last-child {
  border-bottom: 0;
}


.content-item strong {
  font-size: 15px;
}


.content-item p {
  max-width: 1200px;

  margin-top: 11px;

  color: var(--text-soft);

  font-size: 14px;
  line-height: 1.75;
}


.content-meta {
  display: flex;
  flex-wrap: wrap;

  gap: 10px;

  margin-top: 15px;
}


.content-meta span {
  padding:
    9px 12px;

  border:
    1px solid var(--border-soft);

  border-radius: 9px;

  background: var(--panel-2);

  color: var(--muted);

  font-size: 11px;
}


/* =========================================================
   AUDIENCE
========================================================= */

.audience-stats {
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
}


.recommendation {
  padding: 18px 20px;

  margin-top: 15px;

  border:
    1px solid var(--border-soft);

  border-radius: 13px;

  background: var(--panel-2);

  color: var(--text-soft);

  font-size: 13px;
  line-height: 1.75;
}


.recommendation strong {
  color: var(--text);
}


/* =========================================================
   BEST TIME
========================================================= */

.confidence-badge {
  display: inline-flex;

  margin-top: 16px;

  padding:
    8px 12px;

  border-radius: 999px;

  color: var(--primary);

  background: var(--primary-soft);

  font-size: 11px;
  font-weight: 900;
}


.performance-list {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 15px;

  padding-top: 16px;
}


.performance-item {
  padding: 20px;

  border:
    1px solid var(--border-soft);

  border-radius: 13px;

  background: var(--panel-2);
}


.performance-item strong {
  font-size: 15px;
}


.performance-item .muted {
  margin-top: 8px;

  font-size: 12px;
}


/* =========================================================
   AI COACH
========================================================= */

.coach-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 22px;

  margin-bottom: 28px;
}


.coach-card {
  min-height: 310px;

  padding: 29px;

  border-radius: 19px;
}


.coach-card-icon {
  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 25px;

  border-radius: 13px;

  color: var(--green);

  background: var(--green-soft);

  font-size: 20px;
  font-weight: 900;
}


.coach-card-icon.warning {
  color: var(--orange);
  background: var(--orange-soft);
}


.coach-card-icon.action {
  color: var(--primary);
  background: var(--primary-soft);
}


.coach-card h3 {
  font-size: 19px;
}


.coach-card .recommendation {
  padding: 0;

  border: 0;

  background: transparent;
}


/* =========================================================
   GOALS
========================================================= */

.goal-layout {
  display: grid;

  grid-template-columns:
    minmax(380px, 0.8fr)
    minmax(540px, 1.2fr);

  gap: 22px;
}


.form-group {
  margin-top: 24px;
}


.form-group label {
  display: block;

  margin-bottom: 9px;

  color: var(--muted);

  font-size: 13px;
  font-weight: 800;
}


.primary-btn,
.secondary-btn {
  min-height: 48px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding:
    0 18px;

  border-radius: 11px;

  font-size: 12px;
  font-weight: 900;
}


.primary-btn {
  border:
    1px solid var(--primary);

  background: var(--primary);
  color: #ffffff;
}


.primary-btn:hover {
  background: var(--primary-hover);
}


.secondary-btn {
  border:
    1px solid var(--border);

  background: var(--panel-2);
  color: var(--text);
}


.secondary-btn:hover {
  background: var(--panel-hover);
}


.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.55;

  cursor: not-allowed;
}


#saveGoalBtn {
  width: 100%;

  margin-top: 26px;
}


.goal-status {
  margin-top: 9px;

  font-size: 36px;
  font-weight: 900;
}


.goal-progress-track {
  width: 100%;
  height: 16px;

  margin-top: 32px;

  overflow: hidden;

  border:
    1px solid var(--border-soft);

  border-radius: 999px;

  background: var(--panel-2);
}


.goal-progress-bar {
  width: 0%;
  height: 100%;

  border-radius: 999px;

  background:
    linear-gradient(
      90deg,
      #22c55e,
      #3b82f6
    );
}


#goalStats {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 14px;

  margin-top: 26px;
}


#goalStats .muted {
  padding: 15px;

  border:
    1px solid var(--border-soft);

  border-radius: 11px;

  background: var(--panel-2);

  font-size: 12px;
}


/* =========================================================
   SETTINGS
========================================================= */

.settings-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 22px;
}


.settings-grid .data-card {
  margin-bottom: 0;
}


.settings-card-head {
  display: flex;

  gap: 18px;

  padding-bottom: 20px;

  border-bottom:
    1px solid var(--border-soft);
}


.settings-icon {
  min-width: 50px;
  height: 50px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 13px;

  color: var(--primary);

  background: var(--primary-soft);

  font-size: 16px;
  font-weight: 900;
}


.settings-card-copy h3 {
  font-size: 18px;
}


.settings-card-copy p {
  margin-top: 7px;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.6;
}


.settings-status-row {
  margin-top: 22px;
}


.status-pill {
  display: inline-flex;
  align-items: center;

  padding:
    9px 12px;

  border:
    1px solid var(--border-soft);

  border-radius: 999px;

  background: var(--panel-2);

  color: var(--muted);

  font-size: 11px;
  font-weight: 900;
}


.settings-action-btn {
  margin-top: 22px;
}


.settings-actions {
  display: flex;
  flex-wrap: wrap;

  gap: 11px;

  margin-top: 22px;
}


.install-guide {
  display: none;

  margin-top: 22px;

  padding: 20px;

  border:
    1px solid var(--border-soft);

  border-radius: 13px;

  background: var(--panel-2);
}


.install-step {
  display: flex;
  align-items: center;

  gap: 12px;

  padding: 10px 0;

  color: var(--text-soft);

  font-size: 12px;
}


.install-step strong {
  min-width: 28px;
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;

  color: var(--primary);

  background: var(--primary-soft);
}


/* =========================================================
   RESPONSIVE
========================================================= */

.mobile-backdrop {
  display: none;

  position: fixed;
  inset: 0;

  z-index: 25;

  background:
    rgba(2, 8, 23, 0.62);
}


@media (max-width: 1350px) {

  .stats-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .coach-grid {
    grid-template-columns:
      1fr;
  }

}


@media (max-width: 1050px) {

  .sidebar {
    transform:
      translateX(-100%);
  }


  .sidebar.open {
    transform:
      translateX(0);
  }


  .mobile-backdrop.open {
    display: block;
  }


  .main-shell {
    width: 100%;

    margin-left: 0;
  }


  .mobile-menu-btn {
    display: block;
  }


  .topbar-brand-mobile {
    display: block;

    font-weight: 900;
  }


  .main-content {
    padding:
      36px
      28px
      60px;
  }


  .goal-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

}


@media (max-width: 760px) {

  .topbar {
    height: 70px;

    padding:
      0 15px;
  }


  .theme-toggle span:last-child {
    display: none;
  }


  .theme-toggle {
    min-width: 48px;
  }


  .user-info {
    display: none;
  }


  .main-content {
    padding:
      27px
      15px
      48px;
  }


  .page-header {
    align-items: stretch;

    flex-direction: column;

    margin-bottom: 32px;
  }


  .page-header h1 {
    font-size: 34px;
  }


  .selector-wrap {
    width: 100%;
  }


  .stats-grid,
  .audience-stats,
  .performance-grid,
  .performance-list {
    grid-template-columns: 1fr;
  }


  .section-title-row {
    align-items: flex-start;

    flex-direction: column;
  }


  .stat-card,
  .insight-card,
  .data-card,
  .coach-card {
    padding: 22px;
  }


  #goalStats {
    grid-template-columns: 1fr;
  }

}
/* =========================================================
   SB AI FLOATING CHAT ASSISTANT
========================================================= */

.ai-chat-launcher {
  position: fixed;
  right: 28px;
  bottom: 28px;

  z-index: 80;

  display: flex;
  align-items: center;
  gap: 12px;

  min-width: 190px;

  padding: 11px 17px 11px 11px;

  border: 1px solid
    rgba(96, 165, 250, 0.35);

  border-radius: 18px;

  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #4f46e5
    );

  box-shadow:
    0 18px 50px
    rgba(37, 99, 235, 0.34);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}


.ai-chat-launcher:hover {
  transform:
    translateY(-3px);

  box-shadow:
    0 22px 60px
    rgba(37, 99, 235, 0.42);
}


.ai-launcher-icon {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 13px;

  background:
    rgba(255, 255, 255, 0.15);

  font-size: 20px;
}


.ai-launcher-copy {
  display: flex;
  flex-direction: column;

  text-align: left;
}


.ai-launcher-copy strong {
  font-size: 13px;
  font-weight: 900;
}


.ai-launcher-copy small {
  margin-top: 3px;

  color:
    rgba(255, 255, 255, 0.72);

  font-size: 10px;
}


.ai-chat-panel {
  position: fixed;

  right: 28px;
  bottom: 96px;

  z-index: 90;

  width: 410px;
  height: min(
    650px,
    calc(100vh - 130px)
  );

  display: flex;
  flex-direction: column;

  overflow: hidden;

  border:
    1px solid
    var(--border);

  border-radius: 22px;

  background:
    var(--panel);

  box-shadow:
    0 28px 80px
    rgba(0, 0, 0, 0.38);

  opacity: 0;
  visibility: hidden;

  transform:
    translateY(18px)
    scale(0.97);

  transform-origin:
    bottom right;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
}


.ai-chat-panel.open {
  opacity: 1;
  visibility: visible;

  transform:
    translateY(0)
    scale(1);
}


.ai-chat-header {
  min-height: 76px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  padding:
    14px
    16px;

  border-bottom:
    1px solid
    var(--border-soft);

  background:
    linear-gradient(
      135deg,
      rgba(37, 99, 235, 0.11),
      rgba(79, 70, 229, 0.06)
    );
}


.ai-chat-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}


.ai-chat-avatar {
  width: 43px;
  height: 43px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 13px;

  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #4f46e5
    );

  box-shadow:
    0 8px 22px
    rgba(37, 99, 235, 0.25);
}


.ai-chat-brand strong {
  display: block;

  font-size: 14px;
}


.ai-chat-online {
  display: flex;
  align-items: center;
  gap: 6px;

  margin-top: 4px;

  color: var(--muted);

  font-size: 10px;
}


.ai-chat-online span {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: #22c55e;

  box-shadow:
    0 0 0 4px
    rgba(34, 197, 94, 0.09);
}


.ai-chat-header-actions {
  display: flex;
  gap: 6px;
}


.ai-header-btn {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  border:
    1px solid
    var(--border-soft);

  border-radius: 9px;

  background:
    var(--panel-2);

  color:
    var(--text);

  font-size: 17px;
}


.ai-header-btn:hover {
  background:
    var(--panel-hover);
}


.ai-chat-messages {
  flex: 1;

  overflow-y: auto;

  padding:
    18px 15px;

  scroll-behavior: smooth;
}


.ai-message {
  display: flex;

  margin-bottom: 15px;
}


.ai-message.user {
  justify-content: flex-end;
}


.ai-message.assistant {
  justify-content: flex-start;
}


.ai-message-bubble {
  max-width: 84%;

  padding:
    11px
    13px;

  border-radius:
    15px;

  font-size: 12px;
  line-height: 1.6;

  white-space: pre-wrap;

  word-break:
    break-word;
}


.ai-message.assistant
.ai-message-bubble {
  border:
    1px solid
    var(--border-soft);

  border-bottom-left-radius:
    5px;

  background:
    var(--panel-2);

  color:
    var(--text-soft);
}


.ai-message.user
.ai-message-bubble {
  border-bottom-right-radius:
    5px;

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #3b82f6
    );

  color:
    #ffffff;
}


.ai-message-meta {
  margin-top: 6px;

  opacity: 0.6;

  font-size: 8px;
}


.ai-typing {
  display: flex;
  gap: 4px;

  align-items: center;

  min-width: 50px;
}


.ai-typing span {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background:
    var(--muted);

  animation:
    sbAiTyping
    1.1s
    infinite ease-in-out;
}


.ai-typing span:nth-child(2) {
  animation-delay:
    0.15s;
}


.ai-typing span:nth-child(3) {
  animation-delay:
    0.3s;
}


@keyframes sbAiTyping {

  0%,
  60%,
  100% {
    opacity: 0.35;

    transform:
      translateY(0);
  }

  30% {
    opacity: 1;

    transform:
      translateY(-3px);
  }
}


.ai-chat-suggestions {
  display: flex;
  gap: 7px;

  padding:
    7px 13px 10px;

  overflow-x: auto;
}


.ai-suggestion {
  flex-shrink: 0;

  min-height: 31px;

  padding:
    0
    10px;

  border:
    1px solid
    var(--border-soft);

  border-radius:
    999px;

  background:
    var(--panel-2);

  color:
    var(--muted);

  font-size:
    9px;

  font-weight:
    750;
}


.ai-suggestion:hover {
  border-color:
    var(--primary);

  color:
    var(--primary);
}


.ai-chat-form {
  display: flex;
  align-items: flex-end;

  gap: 9px;

  margin:
    0
    13px;

  padding:
    9px;

  border:
    1px solid
    var(--border);

  border-radius:
    15px;

  background:
    var(--panel-2);
}


.ai-chat-form:focus-within {
  border-color:
    var(--primary);

  box-shadow:
    0 0 0 3px
    var(--primary-soft);
}


#aiChatInput {
  width: 100%;

  min-height: 38px;
  max-height: 120px;

  padding:
    9px
    8px;

  resize: none;

  overflow-y: auto;

  border: 0;

  outline: 0;

  background: transparent;

  color:
    var(--text);

  font-size:
    12px;

  line-height:
    1.5;
}


#aiChatInput::placeholder {
  color:
    var(--muted);
}


.ai-send-btn {
  width: 39px;
  height: 39px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;

  border-radius:
    11px;

  background:
    var(--primary);

  color:
    #ffffff;

  font-size:
    15px;
}


.ai-send-btn:hover {
  background:
    var(--primary-hover);
}


.ai-send-btn:disabled {
  opacity: 0.5;

  cursor:
    not-allowed;
}


.ai-chat-footer {
  padding:
    9px
    15px
    12px;

  color:
    var(--muted);

  text-align:
    center;

  font-size:
    8px;
}


/* MOBILE AI CHAT */

@media (max-width: 600px) {

  .ai-chat-launcher {
    right: 15px;
    bottom: 15px;

    min-width: 0;

    padding: 10px;

    border-radius:
      16px;
  }


  .ai-launcher-copy {
    display: none;
  }


  .ai-launcher-icon {
    width: 43px;
    height: 43px;
  }


  .ai-chat-panel {
    right: 10px;
    bottom: 78px;

    width:
      calc(100vw - 20px);

    height:
      calc(100vh - 95px);

    border-radius:
      19px;
  }

}