/* ============================================================
   AXESS ANALYTICS — Design System
   Palette: style.md
   Font: Raleway (primary), Montserrat (bold/CTA), Roboto (fallback)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@200;300;400;700&family=Montserrat:wght@600;700&family=Roboto:wght@300;400&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --color-bg:           #FEFEFD;
  --color-bg-section:   #F7F5F4;
  --color-placeholder:  #D6D6D7;
  --color-secondary:    #9B9B9B;
  --color-text-muted:   #6D6C6D;
  --color-text:         #1F1F1F;
  --color-brand-red:    #EE3222;
  --color-brand:        #F16120;
  --color-brand-light:  #F58A2D;
  --color-coral:        #FC6E6D;
  --color-coral-hover:  #F97561;
  --color-orange-soft:  #EDAD72;
  --color-beige:        #F1CAA3;

  --gradient-brand: linear-gradient(135deg, #EE3222 0%, #F16120 50%, #F58A2D 100%);
  --gradient-subtle: linear-gradient(135deg, #F7F5F4 0%, #FEFEFD 100%);

  --font-primary:   'Raleway', 'Montserrat', 'Roboto', system-ui, sans-serif;
  --font-cta:       'Montserrat', 'Raleway', system-ui, sans-serif;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.12);

  --sidebar-w:  240px;
  --topbar-h:   60px;
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-primary);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
}

a { color: var(--color-brand); text-decoration: none; }
a:hover { color: var(--color-brand-red); }

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--color-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo .logo-name {
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: .5px;
}

.sidebar-logo .logo-tagline {
  font-size: .7rem;
  color: var(--color-secondary);
  font-weight: 300;
  margin-top: 2px;
}

.sidebar-logo .logo-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: .65rem;
  font-family: var(--font-cta);
  font-weight: 700;
  padding: 2px 8px;
  background: var(--gradient-brand);
  color: #fff;
  border-radius: 20px;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 16px 0; }

.nav-section-title {
  font-size: .65rem;
  font-weight: 700;
  font-family: var(--font-cta);
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  font-size: .875rem;
  font-weight: 400;
  transition: all .15s ease;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,.05);
}

.nav-item.active {
  color: #fff;
  border-left-color: var(--color-brand);
  background: rgba(241,97,32,.12);
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .7;
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .75rem;
  color: var(--color-secondary);
}

/* ── Main Layout ───────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-placeholder);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  flex: 1;
}

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

.page-content {
  flex: 1;
  min-height: 0;
  padding: 28px;
  background: var(--color-bg-section);
  overflow-y: auto;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-placeholder);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--color-bg-section);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: .875rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 22px; }

/* ── KPI Cards ─────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--color-placeholder);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-brand);
}

.kpi-label {
  font-size: .7rem;
  font-weight: 700;
  font-family: var(--font-cta);
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-cta);
  color: var(--color-text);
  line-height: 1;
}

.kpi-sub {
  font-size: .72rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  font-weight: 300;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .3px;
  cursor: pointer;
  transition: all .15s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-brand);
  color: #fff;
}
.btn-primary:hover { background: var(--color-brand-red); color: #fff; }

.btn-secondary {
  background: var(--color-bg-section);
  color: var(--color-text);
  border: 1px solid var(--color-placeholder);
}
.btn-secondary:hover { background: var(--color-placeholder); }

.btn-danger {
  background: var(--color-coral);
  color: #fff;
}
.btn-danger:hover { background: var(--color-coral-hover); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--color-brand);
  border: 1px solid var(--color-brand);
}
.btn-ghost:hover { background: var(--color-brand); color: #fff; }

.btn-sm { padding: 5px 12px; font-size: .75rem; }
.btn-lg { padding: 12px 28px; font-size: .95rem; }

/* ── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  font-family: var(--font-cta);
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=date],
select,
textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--color-placeholder);
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-size: .875rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color .15s ease;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(241,97,32,.1);
}

textarea { resize: vertical; min-height: 80px; }

.input-hint {
  font-size: .72rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ── Date range picker ─────────────────────────────────── */
.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-range input { width: 140px; }
.date-range span { color: var(--color-text-muted); font-size: .8rem; }

/* ── Tables ────────────────────────────────────────────── */
.data-table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

th {
  background: var(--color-bg-section);
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--color-text-muted);
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--color-bg-section);
  color: var(--color-text);
  vertical-align: middle;
}

tr:hover td { background: rgba(241,97,32,.03); }

/* ── Badge / Tag ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .68rem;
  font-family: var(--font-cta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.badge-brand   { background: rgba(241,97,32,.12); color: var(--color-brand); }
.badge-success { background: rgba(39,174,96,.12);  color: #27ae60; }
.badge-muted   { background: var(--color-bg-section); color: var(--color-text-muted); }
.badge-red     { background: rgba(238,50,34,.12); color: var(--color-brand-red); }

/* ── Alert / Flash ─────────────────────────────────────── */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  margin-bottom: 18px;
  border-left: 4px solid;
}
.alert-success { background: rgba(39,174,96,.08); border-color: #27ae60; color: #1a6b3d; }
.alert-error   { background: rgba(238,50,34,.08); border-color: var(--color-brand-red); color: var(--color-brand-red); }
.alert-info    { background: rgba(241,97,32,.08); border-color: var(--color-brand); color: var(--color-brand); }

/* ── Section header ────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.section-title {
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
}

.section-sub {
  font-size: .8rem;
  color: var(--color-text-muted);
  font-weight: 300;
  margin-top: 3px;
}

/* ── Chart containers ──────────────────────────────────── */
.chart-wrap {
  position: relative;
  width: 100%;
}

/* ── Grid utilities ────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* ── Chat UI ───────────────────────────────────────────── */
.chat-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

.chat-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-placeholder);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.chat-header-bar .chat-header-label {
  font-size: .72rem;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.chat-header-bar input[type=date] {
  height: 32px;
  font-size: .78rem;
  padding: 0 8px;
  width: 130px;
}

.chat-sidebar {
  background: var(--color-bg);
  border-right: 1px solid var(--color-placeholder);
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow-y: auto;
}

.chat-sidebar-title {
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.context-table-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-placeholder);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s ease;
  background: var(--color-bg);
}
.context-table-item:hover { border-color: var(--color-brand); }
.context-table-item.selected {
  background: rgba(241,97,32,.06);
  border-color: var(--color-brand);
}
.context-table-item input[type=checkbox] { accent-color: var(--color-brand); }
.context-table-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.context-table-name {
  font-size: .8rem;
  font-weight: 700;
  font-family: var(--font-cta);
  color: var(--color-text);
}
.context-table-desc {
  font-size: .7rem;
  color: var(--color-text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--color-bg-section);
  overflow: hidden;
}

.chat-disclaimer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  background: rgba(241,97,32,.06);
  border-bottom: 1px solid rgba(241,97,32,.22);
  font-size: .75rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.chat-disclaimer strong { color: var(--color-brand); font-weight: 600; white-space: nowrap; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 820px;
  animation: fadeUp .2s ease;
}

.chat-message.user { flex-direction: row-reverse; align-self: flex-end; }

.msg-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: .75rem;
  flex-shrink: 0;
}
.msg-avatar.user-av { background: var(--gradient-brand); color: #fff; }
.msg-avatar.ai-av   {
  background-image: url('../image/icon_m.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--color-placeholder);
  font-size: 0;
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  line-height: 1.6;
  max-width: 100%;
}
.chat-message.user .msg-bubble {
  background: var(--gradient-brand);
  color: #fff;
  border-radius: var(--radius-md) 4px var(--radius-md) var(--radius-md);
}
.chat-message.assistant .msg-bubble {
  background: var(--color-bg);
  border: 1px solid var(--color-placeholder);
  color: var(--color-text);
  border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
}

/* Markdown in chat */
.msg-bubble h1,.msg-bubble h2,.msg-bubble h3 {
  font-family: var(--font-cta);
  margin: 10px 0 6px;
}
.msg-bubble code {
  background: rgba(0,0,0,.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: .82em;
}
.msg-bubble pre {
  background: var(--color-bg-section);
  border: 1px solid var(--color-placeholder);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: .8rem;
}
.msg-bubble ul,.msg-bubble ol { padding-left: 20px; margin: 6px 0; }
.msg-bubble table { font-size: .8rem; margin: 8px 0; }
.msg-bubble th,.msg-bubble td { padding: 5px 10px; border: 1px solid var(--color-placeholder); }

.msg-meta {
  font-size: .68rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.chat-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}
.chat-typing span {
  width: 7px; height: 7px;
  background: var(--color-brand);
  border-radius: 50%;
  animation: bounce .8s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .30s; }

.chat-input-bar {
  padding: 16px 24px;
  background: var(--color-bg);
  border-top: 1px solid var(--color-placeholder);
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-textarea {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--color-placeholder);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: .875rem;
  resize: none;
  min-height: 46px;
  max-height: 160px;
  overflow-y: auto;
  transition: border-color .15s;
  background: var(--color-bg-section);
}
.chat-textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(241,97,32,.1);
  background: var(--color-bg);
}

.chat-send-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--gradient-brand);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .15s, opacity .15s;
}
.chat-send-btn:hover { transform: scale(1.05); }
.chat-send-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.chat-send-btn svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; }

.chat-context-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.context-pill {
  padding: 3px 10px;
  background: rgba(241,97,32,.1);
  color: var(--color-brand);
  border-radius: 20px;
  font-size: .7rem;
  font-family: var(--font-cta);
  font-weight: 700;
}

/* ── Welcome screen chat ───────────────────────────────── */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 40px;
  gap: 16px;
  color: var(--color-text-muted);
}
.chat-welcome-icon {
  width: 56px; height: 56px;
  background: rgba(241,97,32,.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Pagination ────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 16px;
}
.page-btn {
  padding: 5px 12px;
  border: 1px solid var(--color-placeholder);
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-family: var(--font-cta);
  font-weight: 700;
  cursor: pointer;
  background: var(--color-bg);
  color: var(--color-text-muted);
  transition: all .15s;
}
.page-btn:hover, .page-btn.active {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
}

/* ── Loader ────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--color-placeholder);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Progress bar (brand gradient) ────────────────────── */
.progress-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--color-bg-section);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-brand);
  transition: width .4s ease;
}

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

/* ── AP Color indicators (AP 42-49) ───────────────────── */
.ap-42 { color: var(--color-brand); }
.ap-43 { color: var(--color-brand-light); }
.ap-44 { color: var(--color-coral); }
.ap-45 { color: var(--color-orange-soft); }
.ap-46 { color: var(--color-beige); }
.ap-47 { color: var(--color-brand-red); }
.ap-48 { color: var(--color-coral-hover); }
.ap-49 { color: var(--color-secondary); }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-section); }
::-webkit-scrollbar-thumb { background: var(--color-placeholder); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-secondary); }

/* ── Modal ──────────────────────────────────────────────── */
.ax-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ax-modal-overlay.open { display: flex; }

.ax-modal {
  background: var(--color-bg);
  border: 1px solid var(--color-placeholder);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.ax-modal-title {
  font-family: var(--font-cta);
  font-weight: 700;
  font-size: .95rem;
  color: var(--color-text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-placeholder);
}

.ax-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-placeholder);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* Sidebar toggle: hidden on desktop, shown on mobile */
#sidebar-toggle { display: none; }

@media (max-width: 768px) {
  #sidebar-toggle { display: inline-flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 200;
    position: fixed;
    top: 0; left: 0; bottom: 0;
  }
  .sidebar.open { transform: translateX(0); }

  /* Overlay to close sidebar on outside tap */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 199;
  }
  .sidebar-overlay.visible { display: block; }

  .main-wrap { margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
}
