/* ==========================================================================
   API AI v4.0 — CENTRIX EDITION STYLESHEET
   12 Accent Colors · Font Scale · Animation Modes · Settings · Profile · VietQR
   Tasks · Resources · Agents Hub · Studio · 24 Connectors · Responsive MCP Modal
   ========================================================================== */

/* 12 CentriX Accent Color Palettes */
body[data-accent="cobalt"]  { --accent:#3b82f6; --accent-hover:#2563eb; --accent-ink:#93c5fd; --accent-soft:rgba(59,130,246,0.16); --accent-rim:rgba(96,165,250,0.36); }
body[data-accent="indigo"]  { --accent:#6366f1; --accent-hover:#4f46e5; --accent-ink:#a5b4fc; --accent-soft:rgba(99,102,241,0.16); --accent-rim:rgba(129,140,248,0.36); }
body[data-accent="violet"]  { --accent:#8b5cf6; --accent-hover:#7c3aed; --accent-ink:#c4b5fd; --accent-soft:rgba(139,92,246,0.16); --accent-rim:rgba(167,139,250,0.36); }
body[data-accent="rose"]    { --accent:#f43f5e; --accent-hover:#e11d48; --accent-ink:#fda4af; --accent-soft:rgba(244,63,94,0.16);  --accent-rim:rgba(251,113,133,0.36); }
body[data-accent="coral"]   { --accent:#f97316; --accent-hover:#ea580c; --accent-ink:#fdba74; --accent-soft:rgba(249,115,22,0.16); --accent-rim:rgba(251,146,60,0.36); }
body[data-accent="amber"]   { --accent:#eab308; --accent-hover:#ca8a04; --accent-ink:#fde047; --accent-soft:rgba(234,179,8,0.16);  --accent-rim:rgba(250,204,21,0.36); }
body[data-accent="emerald"] { --accent:#10b981; --accent-hover:#059669; --accent-ink:#6ee7b7; --accent-soft:rgba(16,185,129,0.16); --accent-rim:rgba(52,211,153,0.36); }
body[data-accent="teal"]    { --accent:#14b8a6; --accent-hover:#0d9488; --accent-ink:#5eead4; --accent-soft:rgba(20,184,166,0.16); --accent-rim:rgba(45,212,191,0.36); }
body[data-accent="sky"]     { --accent:#0ea5e9; --accent-hover:#0284c7; --accent-ink:#7dd3fc; --accent-soft:rgba(14,165,233,0.16); --accent-rim:rgba(56,189,248,0.36); }
body[data-accent="pink"]    { --accent:#ec4899; --accent-hover:#db2777; --accent-ink:#f9a8d4; --accent-soft:rgba(236,72,153,0.16); --accent-rim:rgba(244,114,182,0.36); }
body[data-accent="lime"]    { --accent:#84cc16; --accent-hover:#65a30d; --accent-ink:#bef264; --accent-soft:rgba(132,204,22,0.16); --accent-rim:rgba(163,230,53,0.36); }
body[data-accent="mono"]    { --accent:#e4e4e7; --accent-hover:#d4d4d8; --accent-ink:#f4f4f5; --accent-on:#09090b; --accent-soft:rgba(228,228,231,0.14); --accent-rim:rgba(228,228,231,0.30); }

/* Font Size Scale */
body[data-font-scale="sm"] { font-size: 14.5px; }
body[data-font-scale="md"] { font-size: 16px; }
body[data-font-scale="lg"] { font-size: 17.5px; }

/* Animation Modes: off / snappy / elegant */
body[data-anim="off"] *, body[data-anim="off"] *::before, body[data-anim="off"] *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}
body[data-anim="snappy"] { --dur-micro: 80ms; --dur-short: 130ms; --dur-long: 200ms; }
body[data-anim="elegant"] { --dur-micro: 140ms; --dur-short: 240ms; --dur-long: 380ms; }

/* Web Landing Page (Shown only on Web when logged out; hidden inside APK) */
#web-landing {
  position: fixed;
  inset: 0;
  z-index: 205;
  display: none;
  flex-direction: column;
  background: radial-gradient(80% 45% at 50% 0%, var(--accent-soft), var(--bg) 68%);
  overflow-y: auto;
  padding: calc(var(--s-4) + var(--safe-t)) var(--s-4) calc(var(--s-8) + var(--safe-b));
}
#web-landing.open { display: flex; }
.wl-nav {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto var(--s-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.wl-hero {
  max-width: 820px;
  width: 100%;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) 0 var(--s-8);
}
.wl-h1 {
  font-size: clamp(28px, 6vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  max-width: 18ch;
}
.wl-sub {
  font-size: clamp(14.5px, 2vw, 17px);
  color: var(--ink-2);
  max-width: 56ch;
  line-height: 1.55;
}
.wl-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-2);
}
.wl-grid {
  width: 100%;
  max-width: 960px;
  margin: var(--s-6) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-3);
  text-align: left;
}
@media (min-width: 680px) {
  .wl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.wl-feat {
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--rim);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wl-feat strong { font-size: 14.5px; color: var(--ink); }
.wl-feat span { font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* Google Sign-In Button */
.btn-google {
  width: 100%;
  height: 44px;
  padding: 0 var(--s-4);
  border-radius: var(--r-sm);
  background: #ffffff;
  color: #111318;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--rim-hi);
}
.auth-or-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-3);
  margin: 4px 0;
}
.auth-or-row::before, .auth-or-row::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rim);
}

/* Top Quota Ring Button */
.quota-ring-btn {
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rim-hi);
  background: var(--surface-1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink);
  flex-shrink: 0;
}
.quota-ring-svg { width: 18px; height: 18px; transform: rotate(-90deg); }

/* Model Dropdown CentriX Upgrade (Tabs + 5-Step Reasoning Slider) */
.cx-mod-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: var(--r-sm);
  background: var(--surface-0);
  border: 1px solid var(--rim);
  margin-bottom: 8px;
}
.cx-mod-tab {
  flex: 1;
  height: 30px;
  border-radius: var(--r-xs);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.cx-mod-tab.active {
  background: var(--surface-2);
  color: var(--ink);
}
.cx-reason-box {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  background: var(--surface-0);
  border: 1px solid var(--rim);
  margin-top: 6px;
}
.cx-reason-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.cx-reason-slider {
  width: 100%;
  accent-color: var(--accent);
  height: 6px;
  cursor: pointer;
}
.cx-reason-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* Greeting Hero Quick Prompts (CentriX compact 3 pills) */
.cx-quick-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 520px;
  margin-top: 4px;
}
.cx-quick-pill {
  height: 34px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rim);
  background: var(--surface-1);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* CentriX Full-Page Grouped Settings (Exact 54105.jpg aesthetic) */
.cx-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.cx-back-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-1);
  border: 1px solid var(--rim-hi);
  display: grid;
  place-items: center;
  color: var(--ink);
  flex-shrink: 0;
}
.cx-page-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.cx-group-card {
  border-radius: var(--r-lg);
  background: var(--surface-1);
  border: 1px solid var(--rim);
  overflow: hidden;
  margin-bottom: var(--s-3);
}
.cx-row {
  width: 100%;
  min-height: 52px;
  padding: 12px var(--s-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  border-bottom: 1px solid var(--rim);
  text-align: left;
  color: var(--ink);
  font-size: 14.5px;
}
.cx-row:last-child { border-bottom: none; }
.cx-row-l {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.cx-row-l svg { width: 19px; height: 19px; stroke-width: 1.7; color: var(--ink-2); flex-shrink: 0; }
.cx-row-r {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 13px;
  flex-shrink: 0;
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cx-wallet-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--rim);
}
.cx-wallet-cell {
  padding: 14px var(--s-4);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cx-wallet-cell:first-child { border-right: 1px solid var(--rim); }
.cx-wallet-lbl { font-size: 12px; color: var(--ink-3); }
.cx-wallet-val { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); font-family: var(--font-mono); }
.cx-wallet-sub { font-size: 11.5px; color: var(--ink-3); }

/* Profile Interest Chips (54106-54107.jpg) */
.cx-avatar-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-2) 0 var(--s-4);
}
.cx-avatar-big {
  width: 68px;
  height: 68px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--rim-hi);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}
.cx-avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.cx-interest-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.cx-int-chip {
  min-height: 38px;
  padding: 6px 13px;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--rim-hi);
  color: var(--ink-2);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cx-int-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}

/* 12 Accent Swatch Grid */
.cx-swatch-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: var(--s-2) 0 var(--s-3);
}
.cx-swatch-btn {
  height: 36px;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  display: grid;
  place-items: center;
}
.cx-swatch-btn.active { border-color: #ffffff; transform: scale(1.06); }

/* Pricing Hero Card & VietQR Modal (54108-54110.jpg) */
.cx-tier-hero {
  border-radius: var(--r-lg);
  padding: var(--s-5);
  position: relative;
  overflow: hidden;
  color: #ffffff;
  margin-bottom: var(--s-3);
  border: 1px solid rgba(255,255,255,0.14);
}
.cx-tier-hero.t-classic { background: linear-gradient(135deg, #27272a 0%, #3f3f46 100%); }
.cx-tier-hero.t-pro     { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #1e3a8a 100%); }
.cx-tier-hero.t-pro_max { background: linear-gradient(135deg, #059669 0%, #047857 55%, #064e3b 100%); }
.cx-tier-hero.t-ultra   { background: linear-gradient(135deg, #b45309 0%, #92400e 55%, #451a03 100%); }
.cx-power-bars { display: flex; gap: 5px; margin-top: 6px; }
.cx-power-bar { width: 26px; height: 6px; border-radius: 99px; background: rgba(255,255,255,0.28); }
.cx-power-bar.on { background: #ffffff; }

.cx-qr-frame {
  width: min(260px, 72vw);
  margin: 8px auto;
  padding: 10px;
  border-radius: var(--r-lg);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cx-qr-frame img { width: 100%; height: auto; display: block; border-radius: var(--r-sm); }
.cx-bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rim);
  font-size: 13px;
}
.cx-bank-row:last-child { border-bottom: none; }

/* OAuth Connectors List (54111-54113.jpg) */
.cx-conn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px var(--s-3);
  border-bottom: 1px solid var(--rim);
}
.cx-conn-row:last-child { border-bottom: none; }
.cx-conn-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}
.cx-conn-plus {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--rim-hi);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 17px;
  flex-shrink: 0;
}
.cx-conn-plus.on { background: var(--ok-soft); border-color: var(--ok-rim); color: var(--ok-ink); }

/* Responsive Custom MCP Modal (Fixes CentriX mobile squish bug in 54115.jpg!) */
.cx-mcp-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-3);
}
@media (min-width: 720px) {
  .cx-mcp-modal-grid { grid-template-columns: 1.2fr 0.8fr; }
}
.cx-mcp-type-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
@media (min-width: 520px) {
  .cx-mcp-type-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cx-mcp-type-card {
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface-0);
  border: 1px solid var(--rim-hi);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cx-mcp-type-card.active { border-color: var(--accent); background: var(--accent-soft); }

/* Tasks, Studio & Usage Charts */
.cx-task-card {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--rim);
  margin-bottom: var(--s-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cx-prio-high { background: var(--danger-soft); color: var(--danger-ink); }
.cx-prio-med  { background: var(--warn-soft); color: var(--warn-ink); }
.cx-prio-low  { background: var(--ok-soft); color: var(--ok-ink); }

.cx-usage-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 110px;
  padding: 10px 6px 4px;
  border-radius: var(--r-sm);
  background: var(--surface-0);
  border: 1px solid var(--rim);
  overflow-x: auto;
}
.cx-usage-col {
  flex: 1;
  min-width: 22px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.cx-usage-bar {
  width: 100%;
  max-width: 26px;
  border-radius: 5px 5px 0 0;
  background: var(--accent);
  min-height: 4px;
}
.cx-usage-lbl { font-size: 9.5px; font-family: var(--font-mono); color: var(--ink-3); }

/* Admin Setup Health Lights */
.cx-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: var(--s-3);
}
.cx-health-item {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--rim);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.cx-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.cx-dot.ok { background: var(--ok); }
.cx-dot.warn { background: var(--warn); }
