/* ═══════════════════════════════════════════
   GLOBAL INDEX PANEL — index_global_panel.css
   Reusable slide-in panel for market indices
   ═══════════════════════════════════════════ */

#indexPanelOverlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  display: none;
  justify-content: flex-end;
}

#indexPanelOverlay.ip-open {
  display: flex;
}

#indexPanel {
  width: min(1080px, 96vw);
  height: 100%;
  min-width: 360px;
  background: var(--surface-panel-stronger, #07071a);
  border-left: 1px solid var(--border, rgba(255, 255, 255, .08));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -16px 0 80px rgba(0, 0, 0, .45);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  font-family: 'Nunito Sans', 'IBM Plex Sans Thai', 'Sarabun', sans-serif;
  font-size: 1rem;
  color: var(--text-primary, #f1f5f9);
}

#indexPanelOverlay.ip-open #indexPanel {
  transform: translateX(0);
}

/* top bar */
.ip-topbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--surface-scrollbar-soft, rgba(255, 255, 255, .07));
  background: var(--surface-topbar, rgba(7, 7, 26, .98));
}

.ip-topbar-label {
  font-size: .8125rem;
  font-weight: 700;
  color: var(--text-softer, rgba(255, 255, 255, .35));
  letter-spacing: .4px;
}

.ip-topbar-pill {
  font-size: .9375rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 7px;
  background: rgba(234, 179, 8, .14);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, .28);
}

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

.ip-ai-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid rgba(124, 58, 237, .35);
  background: rgba(124, 58, 237, .12);
  color: var(--purple-light, #a78bfa);
  font-size: .6875rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}

.ip-ai-btn:hover {
  background: rgba(124, 58, 237, .24);
  border-color: #7c3aed;
  color: #c4b5fd;
}

.ip-close-btn {
  background: none;
  border: none;
  color: var(--text-faint, rgba(255, 255, 255, .3));
  cursor: pointer;
  font-size: 1.12rem;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: color .15s;
}

.ip-close-btn:hover {
  color: var(--text-primary, #f1f5f9);
}

/* body layout */
.ip-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.ip-left {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border, rgba(255, 255, 255, .07));
  overflow-y: auto;
  background: var(--surface-panel-strong, #0f0f28);
  display: flex;
  flex-direction: column;
}

.ip-left::-webkit-scrollbar {
  width: 3px;
}

.ip-left::-webkit-scrollbar-thumb {
  background: var(--surface-scrollbar-soft, rgba(255, 255, 255, .07));
  border-radius: 99px;
}

.ip-hero {
  padding: 18px 16px 14px;
  background: linear-gradient(135deg, rgba(234, 179, 8, .08) 0%, rgba(124, 58, 237, .06) 60%, transparent 100%);
}

.ip-hero-icon {
  font-size: 2rem;
  line-height: 1;
}

.ip-hero-name {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text-primary, #f1f5f9);
  line-height: 1.3;
  margin-top: 6px;
}

.ip-hero-sub {
  font-size: .8125rem;
  color: var(--text-soft, rgba(255, 255, 255, .55));
  margin-top: 4px;
  line-height: 1.5;
}

.ip-hero-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ip-pill {
  font-size: .625rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border, rgba(255, 255, 255, .07));
  background: var(--surface-card-soft, rgba(255, 255, 255, .03));
  color: var(--text-softer, rgba(255, 255, 255, .35));
}

.ip-pill.is-thai {
  border-color: rgba(124, 58, 237, .25);
  color: var(--purple-light, #a78bfa);
}

.ip-pill.is-global {
  border-color: rgba(6, 182, 212, .25);
  color: var(--cyan, #06b6d4);
}

.ip-pill.is-china {
  border-color: rgba(220, 38, 38, .25);
  color: #f87171;
}

.ip-price-block {
  padding: 12px 16px 10px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, .07));
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, .07));
}

.ip-price {
  font-size: 1.875rem;
  font-weight: 900;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #f1f5f9);
}

.ip-chg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.ip-chg-pill {
  font-size: .8125rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 7px;
}

.ip-chg-up {
  background: rgba(16, 185, 129, .12);
  color: var(--green, #10b981);
}

.ip-chg-dn {
  background: rgba(239, 68, 68, .12);
  color: var(--red, #ef4444);
}

.ip-chg-abs {
  font-size: .75rem;
  color: var(--text-softer, rgba(255, 255, 255, .35));
  font-variant-numeric: tabular-nums;
}

.ip-spark {
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, .07));
}

.ip-spark-label {
  font-size: .625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-faint, rgba(255, 255, 255, .25));
  margin-bottom: 6px;
}

.ip-spark-canvas {
  height: 48px;
}

.ip-kpis {
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, .07));
}

.ip-kpi {
  background: var(--surface-card-soft, rgba(255, 255, 255, .03));
  border: 1px solid var(--surface-scrollbar-soft, rgba(255, 255, 255, .06));
  border-radius: 8px;
  padding: 8px 10px;
}

.ip-kpi-label {
  font-size: .625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-faint, rgba(255, 255, 255, .25));
}

.ip-kpi-val {
  font-size: .9375rem;
  font-weight: 800;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.ip-note {
  padding: 12px 16px;
  font-size: .75rem;
  line-height: 1.7;
  color: var(--text-soft, rgba(255, 255, 255, .55));
}

.ip-note-inner {
  background: var(--surface-card-soft, rgba(255, 255, 255, .03));
  border: 1px solid var(--border, rgba(255, 255, 255, .07));
  border-radius: 8px;
  padding: 10px 12px;
}

/* right column */
.ip-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.ip-chart-section {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, .07));
  --ip-chart-h: 400px;
}

.ip-chart-section[data-ip-size="S"] {
  --ip-chart-h: 360px;
}

.ip-chart-section[data-ip-size="M"] {
  --ip-chart-h: 480px;
}

.ip-chart-section[data-ip-size="L"] {
  --ip-chart-h: 620px;
}

.ip-chart-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--surface-scrollbar-soft, rgba(255, 255, 255, .06));
  background: var(--surface-toolbar, rgba(7, 7, 26, .9));
}

.ip-chart-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ip-chart-label {
  font-size: .75rem;
  font-weight: 800;
  color: var(--text-softer, rgba(255, 255, 255, .35));
  letter-spacing: .3px;
}

.ip-chart-sep {
  width: 1px;
  height: 16px;
  background: var(--surface-hover-strong, rgba(255, 255, 255, .08));
  flex-shrink: 0;
}

.ip-period-bar,
.ip-range-bar {
  display: flex;
  gap: 3px;
}

.ip-per-btn,
.ip-rng-btn,
.ip-sz-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-softer, rgba(255, 255, 255, .35));
  font-size: .6875rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.ip-per-btn:hover,
.ip-rng-btn:hover,
.ip-sz-btn:hover {
  color: var(--text-primary, #f1f5f9);
  background: var(--surface-hover, rgba(255, 255, 255, .04));
}

.ip-per-active,
.ip-rng-active,
.ip-sz-active {
  background: rgba(234, 179, 8, .12) !important;
  border-color: rgba(234, 179, 8, .28) !important;
  color: #fbbf24 !important;
}

.ip-rng-login:not(.ip-rng-active) {
  border-color: rgba(124, 58, 237, .22);
  color: rgba(167, 139, 250, .75);
}

.ip-chart-size-bar {
  margin-left: auto;
  display: flex;
  gap: 3px;
}

.ip-chart-canvas-wrap {
  height: var(--ip-chart-h);
  position: relative;
  background: var(--surface-chart, #050515);
}

#ipChartCanvas {
  width: 100%;
  height: 100%;
}

.ip-tabs-header {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, .07));
  flex-shrink: 0;
  overflow-x: auto;
}

.ip-tabs-header::-webkit-scrollbar {
  height: 0;
}

.ip-tab-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-softer, rgba(255, 255, 255, .35));
  font-size: .8125rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all .15s;
}

.ip-tab-btn:hover {
  color: var(--text-primary, #f1f5f9);
}

.ip-tab-active {
  color: #fbbf24 !important;
  border-bottom-color: #eab308 !important;
}

.ip-tabs-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.ip-tabs-body::-webkit-scrollbar {
  width: 3px;
}

.ip-tabs-body::-webkit-scrollbar-thumb {
  background: var(--surface-scrollbar-soft, rgba(255, 255, 255, .07));
  border-radius: 99px;
}

.ip-tab-pane {
  display: none;
  padding: 16px;
}

.ip-pane-active {
  display: block;
}

/* news */
.ip-news-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ip-news-card {
  display: block;
  text-decoration: none;
  background: var(--surface-card-soft, rgba(255, 255, 255, .02));
  border: 1px solid var(--border, rgba(255, 255, 255, .07));
  border-radius: 10px;
  padding: 14px 16px;
  transition: background .15s, border-color .15s;
}

.ip-news-card:hover {
  background: var(--surface-hover, rgba(255, 255, 255, .04));
  border-color: rgba(234, 179, 8, .2);
}

.ip-news-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: .75rem;
  color: var(--text-faint, rgba(255, 255, 255, .25));
}

.ip-news-src {
  color: var(--cyan, #06b6d4);
  font-weight: 600;
}

.ip-news-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  line-height: 1.45;
  margin-bottom: 6px;
}

.ip-news-snippet {
  font-size: .8125rem;
  color: var(--text-soft, rgba(255, 255, 255, .55));
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* stats table */
.ip-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ip-stat-card {
  background: var(--surface-card-soft, rgba(255, 255, 255, .03));
  border: 1px solid var(--surface-scrollbar-soft, rgba(255, 255, 255, .06));
  border-radius: 10px;
  padding: 12px 14px;
}

.ip-stat-label {
  font-size: .625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-faint, rgba(255, 255, 255, .25));
}

.ip-stat-val {
  font-size: 1.125rem;
  font-weight: 800;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* constituents */
.ip-const-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--surface-scrollbar-soft, rgba(255, 255, 255, .06));
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s;
}

.ip-const-row:hover {
  background: var(--surface-hover, rgba(255, 255, 255, .04));
}

.ip-const-sym {
  font-size: .875rem;
  font-weight: 800;
  color: var(--purple-light, #a78bfa);
}

.ip-const-name {
  font-size: .75rem;
  color: var(--text-softer, rgba(255, 255, 255, .35));
  margin-top: 2px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ip-const-main {
  min-width: 0;
  flex: 1;
}

.ip-const-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ip-const-price {
  font-size: .8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, rgba(255, 255, 255, .9));
}

.ip-const-chg {
  font-size: .75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: right;
}

.ip-const-chg-up { color: #22c55e; }
.ip-const-chg-dn { color: #ef4444; }

.ip-const-chevron {
  color: var(--text-faint, rgba(255, 255, 255, .25));
  font-size: .75rem;
}

.ip-const-note {
  padding: 8px 12px 4px;
  font-size: .6875rem;
  color: var(--text-faint, rgba(255, 255, 255, .25));
}

.ip-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-faint, rgba(255, 255, 255, .25));
  font-size: .8125rem;
}

/* chart login toast (guest — max 5y) */
#ipChartLoginToast {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  min-width: 300px;
  max-width: 460px;
  background: rgba(15, 10, 30, .92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(124, 58, 237, .4);
  border-radius: 10px;
  padding: 10px 14px;
  color: #e0d8f0;
  animation: ipFadeUp .35s ease;
}

.ip-chart-login-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ip-chart-login-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.ip-chart-login-title {
  font-weight: 600;
  font-size: .8125rem;
}

.ip-chart-login-sub {
  font-size: .6875rem;
  opacity: .7;
  margin-top: 2px;
}

.ip-chart-login-btn {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 7px;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  font-size: .6875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.ip-chart-login-dismiss {
  background: none;
  border: none;
  color: #fff;
  opacity: .6;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
}

@keyframes ipFadeUp {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* AI insight popup */
#ipAiInsightPop {
  position: fixed;
  z-index: 9300;
  top: 72px;
  right: 20px;
  width: 450px;
  max-width: calc(100vw - 40px);
  height: 550px;
  max-height: calc(100vh - 100px);
  min-width: 300px;
  min-height: 250px;
  background: #0d0d1e;
  border: 1px solid rgba(124, 58, 237, .35);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .75), 0 0 0 1px rgba(124, 58, 237, .12);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Nunito Sans', 'IBM Plex Sans Thai', 'Sarabun', sans-serif;
  animation: ipAiPopIn .18s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes ipAiPopIn {
  from { opacity: 0; transform: scale(.95) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

#ipAiInsightPop.ip-ai-minimized {
  height: 52px !important;
  min-height: 52px !important;
}

#ipAiInsightPop.ip-ai-minimized .ip-ai-pop-body,
#ipAiInsightPop.ip-ai-minimized .ip-ai-pop-input-wrap {
  display: none !important;
}

.ip-ai-pop-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(124, 58, 237, .15), rgba(6, 182, 212, .08));
  border-bottom: 1px solid rgba(124, 58, 237, .2);
  flex-shrink: 0;
  user-select: none;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.ip-ai-pop-sizes {
  display: flex;
  gap: 4px;
  margin-right: 4px;
  flex-shrink: 0;
}

.ip-ai-size-btn {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 4px;
  color: rgba(255, 255, 255, .4);
  font-size: .625rem;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.ip-ai-size-btn:hover {
  background: rgba(124, 58, 237, .15);
  color: #fff;
  border-color: rgba(124, 58, 237, .3);
}

.ip-ai-size-btn.ip-ai-size-active {
  background: #7c3aed;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 8px rgba(124, 58, 237, .4);
}

.ip-ai-pop-min {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .35);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
  transition: all .15s;
}

.ip-ai-pop-min:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, .08);
}

.ip-ai-pop-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: #fff;
}

.ip-ai-pop-title {
  flex: 1;
  font-size: .85rem;
  font-weight: 700;
  color: #e2e8f0;
}

.ip-ai-pop-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .35);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}

.ip-ai-pop-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ip-ai-pop-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .8125rem;
  line-height: 1.55;
}

.ip-ai-pop-bubble.user {
  align-self: flex-end;
  background: rgba(124, 58, 237, .18);
  border: 1px solid rgba(124, 58, 237, .25);
  color: #e9d5ff;
}

.ip-ai-pop-bubble.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(124, 58, 237, .15);
  color: #e2e8f0;
  max-width: 100%;
  width: 100%;
}

.ip-ai-pop-bubble.ai table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: .8125rem;
}

.ip-ai-pop-bubble.ai th,
.ip-ai-pop-bubble.ai td {
  border: 1px solid rgba(255, 255, 255, .08);
  padding: 6px 8px;
  text-align: left;
}

.ip-ai-pop-bubble.ai th {
  background: rgba(124, 58, 237, .15);
  font-weight: 600;
}

.ip-ai-pop-bubble.ai p {
  margin: 0 0 8px;
}

.ip-ai-pop-bubble.ai p:last-child {
  margin-bottom: 0;
}

.ip-ai-pop-bubble.ai strong {
  color: #fff;
  font-weight: 600;
}

.ip-ai-pop-bubble.ai ul,
.ip-ai-pop-bubble.ai ol {
  margin: 6px 0;
  padding-left: 18px;
}

.ip-ai-pop-bubble.ai li {
  margin-bottom: 4px;
}

.ip-ai-pop-bubble.ai h1,
.ip-ai-pop-bubble.ai h2,
.ip-ai-pop-bubble.ai h3 {
  font-size: .875rem;
  font-weight: 700;
  margin: 10px 0 6px;
  color: #f1f5f9;
}

.ip-ai-pop-body .hi-green {
  color: #10b981;
  font-weight: 600;
}

.ip-ai-pop-body .hi-red {
  color: #ef4444;
  font-weight: 600;
}

.ip-ai-pop-body .hi-yellow {
  color: #f59e0b;
  font-weight: 600;
}

.ip-ai-pop-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  width: 100%;
  align-items: flex-start;
}

.ip-ai-suggestion-btn {
  background: rgba(124, 58, 237, .06);
  border: 1px solid rgba(124, 58, 237, .25);
  border-radius: 8px;
  color: #a78bfa;
  font-size: .8125rem;
  line-height: 1.45;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all .15s;
  font-family: inherit;
}

.ip-ai-suggestion-btn:hover {
  background: rgba(124, 58, 237, .18);
  color: #fff;
  border-color: rgba(124, 58, 237, .5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, .15);
}

.ip-ai-pop-meta {
  font-size: .625rem;
  color: rgba(255, 255, 255, .3);
  margin-top: -2px;
  margin-bottom: 4px;
}

.ip-ai-pop-meta.user {
  align-self: flex-end;
  text-align: right;
}

.ip-ai-pop-meta.ai {
  align-self: flex-start;
}

.ip-ai-pop-input-wrap {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.ip-ai-pop-input {
  flex: 1;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 8px 10px;
  color: #f1f5f9;
  font-size: .8125rem;
  font-family: inherit;
}

.ip-ai-pop-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  cursor: pointer;
}

.ip-ai-loading {
  font-size: .6875rem;
  color: rgba(255, 255, 255, .35);
}

@media (max-width: 768px) {
  #indexPanel {
    width: 100vw;
  }

  .ip-ai-btn span {
    display: none;
  }

  .ip-ai-btn {
    padding: 5px 9px;
  }

  #ipAiInsightPop {
    top: auto;
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto !important;
    max-width: none;
    height: min(420px, calc(100vh - 80px));
  }

  .ip-ai-pop-sizes {
    display: none;
  }

  .ip-body {
    flex-direction: column;
  }

  .ip-left {
    width: 100%;
    max-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, .07));
  }

  .ip-kpis {
    display: none;
  }
}