
/* =========================================================
   GILARIS AI — NEXUS V2.0
   STYLE.CSS — FICHIER COMPLET
   ARISONTECH
   ========================================================= */


/* =========================================================
   01 — VARIABLES GLOBALES
========================================================= */

:root {
  color-scheme: dark;
  --bg: #030817;
  --panel: #07132b;
  --panel2: #091a39;
  --surface: rgba(8, 20, 48, .92);
  --border: rgba(55, 130, 235, .25);
  --text: #edf5ff;
  --muted: #8fa9d0;
  --cyan: #00eaff;
  --blue: #377bff;
  --purple: #8c4dff;
  --pink: #f044e9;
  --gold: #ffc044;
  --shadow: 0 0 24px rgba(0, 234, 255, .08);
  --radius: 23px;

  --gilaris-font-sans:
    Inter,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}


/* =========================================================
   02 — RESET, BASE ET TYPOGRAPHIE
========================================================= */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 90% 22%, rgba(84, 25, 174, .12), transparent 35%),
    radial-gradient(ellipse at 0% 70%, rgba(0, 125, 255, .10), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: var(--gilaris-font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

html,
body,
body *,
body *::before,
body *::after {
  font-family: var(--gilaris-font-sans) !important;
}

button,
textarea,
input,
select,
option {
  font: inherit;
  font-family: var(--gilaris-font-sans) !important;
}

button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform .18s ease,
    border-color .22s ease,
    box-shadow .22s ease,
    background .22s ease;
}

button:active {
  transform: scale(.97);
}

button:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

button svg,
.aris-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden {
  display: none !important;
}

/* Ny code ihany no mitazona endrika monospace */

pre,
code,
pre *,
code *,
.code-block,
.code-block *,
.code-scroll,
.code-scroll * {
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace !important;
  font-variant-ligatures: none;
}

/* Fanatsarana ny famakiana lahatsoratra */

.message-content,
.message-content p,
.message-content li,
.message-content strong,
.message-content em,
.history-title,
.nav-item,
button,
label,
input,
textarea {
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}


/* =========================================================
   03 — APP SHELL ET TOPBAR
========================================================= */

.app-shell {
  min-height: 100vh;
  padding-bottom: 95px;
}

.topbar {
  height: 88px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
  padding: 12px clamp(14px, 3vw, 32px);
  background: rgba(3, 8, 23, .93);
  border-bottom: 1px solid rgba(38, 118, 236, .19);
  backdrop-filter: blur(18px);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  color: var(--cyan);
  border: 1px solid rgba(0, 234, 255, .55);
  border-radius: 17px;
  background: linear-gradient(
    140deg,
    rgba(0, 234, 255, .10),
    rgba(140, 77, 255, .10)
  );
  box-shadow:
    inset 0 0 12px rgba(0, 234, 255, .04),
    0 0 13px rgba(0, 234, 255, .08);
}

.icon-button svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.4;
}

.icon-button:hover {
  border-color: var(--pink);
  box-shadow: 0 0 18px rgba(240, 68, 233, .25);
}

.brand-head {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  border: 0;
  background: none;
}

.brand-mark,
.mini-logo {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 53px;
  height: 53px;
  border: 2px solid var(--cyan);
  border-radius: 17px;
  color: var(--cyan);
  font-size: 35px;
  font-weight: 900;
  text-shadow: 0 0 13px var(--cyan);
  box-shadow:
    0 0 13px #00eaff35,
    inset 0 0 15px #8c4dff28;
}

.brand-star {
  position: absolute;
  right: 4px;
  top: 0;
  color: var(--pink);
  font-size: 17px;
}

.brand-title,
.hero-title {
  font-family: Orbitron, "Segoe UI", sans-serif !important;
  font-weight: 900;
  letter-spacing: .035em;
  font-size: clamp(23px, 4.1vw, 43px);
  color: var(--cyan);
  background: linear-gradient(
    90deg,
    #00eaff,
    #4c8dff,
    #d83cff,
    #ff3cc9
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hueFlow 8s linear infinite;
  background-size: 220% 100%;
}

.brand-title span,
.hero-title span {
  -webkit-text-fill-color: #ef39df;
}

@keyframes hueFlow {
  to {
    background-position: 220% center;
  }
}


/* =========================================================
   04 — WORKSPACE ET SIDEBAR
========================================================= */

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 34%) minmax(0, 1fr);
  gap: 18px;
  padding: 18px 22px 0;
  align-items: stretch;
}

.sidebar {
  min-width: 0;
  min-height: 590px;
  display: flex;
  flex-direction: column;
  gap: 19px;
  padding: 22px;
  border: 1px solid rgba(43, 140, 255, .56);
  border-radius: 32px;
  background: linear-gradient(
    155deg,
    rgba(5, 16, 39, .98),
    rgba(5, 10, 31, .98)
  );
  box-shadow:
    5px 5px 0 rgba(128, 45, 255, .12),
    0 0 28px rgba(0, 162, 255, .07);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.mini-logo {
  width: 43px;
  height: 43px;
  border-radius: 14px;
  font-size: 27px;
}

.mini-logo span {
  position: absolute;
  right: 2px;
  top: 0;
  color: var(--pink);
  font-size: 12px;
}

.mini-brand strong {
  display: block;
  font-size: 15px;
  color: var(--cyan);
  letter-spacing: .04em;
}

.mini-brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .12em;
}

.close-sidebar {
  display: none;
}

.new-chat-button,
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 62px;
  padding: 13px 16px;
  border: 1px solid rgba(48, 112, 216, .29);
  border-radius: 21px;
  background: linear-gradient(115deg, #081a3b, #0b1537);
  text-align: left;
  font-size: 15px;
}

.new-chat-button {
  min-height: 72px;
  border: 1px solid var(--cyan);
  background: linear-gradient(
    105deg,
    #06365d,
    #24104f 72%,
    #45114d
  );
  box-shadow:
    0 0 17px rgba(0, 234, 255, .22),
    inset 0 0 18px rgba(204, 44, 255, .10);
  font-weight: 700;
}

.new-chat-button svg {
  width: 27px;
  height: 27px;
  color: var(--cyan);
  flex-shrink: 0;
}

.new-chat-button .chevron {
  margin-left: auto;
  color: var(--pink);
  width: 21px;
}

.main-nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  min-height: 61px;
  color: var(--text);
}

.nav-item svg {
  color: var(--cyan);
  flex-shrink: 0;
}

.nav-item:nth-child(2) svg {
  color: var(--pink);
}

.nav-item:nth-child(3) svg {
  color: var(--gold);
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(0, 234, 255, .60);
  background: linear-gradient(110deg, #0b2349, #181440);
  box-shadow: inset 0 0 15px #00eaff09;
}

.nav-arrow {
  margin-left: auto;
  color: #a16cff;
  font-size: 28px;
  line-height: 1;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1px;
}

.history-heading h2 {
  margin: 0;
  color: var(--cyan);
  font-size: 20px;
}

.small-icon {
  width: 37px;
  height: 37px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.history-list {
  display: grid;
  gap: 9px;
  max-height: 250px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #2458a3 transparent;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px 11px;
  border: 1px solid rgba(48, 112, 216, .27);
  border-radius: 19px;
  background: #07142f;
}

.history-open {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  text-align: left;
}

.history-gem {
  color: var(--cyan);
  font-size: 20px;
}

.history-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}

.history-delete {
  color: var(--pink);
  border: 0;
  background: none;
  font-size: 23px;
}

.empty-history {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-spacer {
  flex: 1;
  min-height: 8px;
}

.demo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 13px;
  border: 1px solid rgba(40, 135, 235, .35);
  border-radius: 22px;
  background: #07142f;
}

.demo-icon {
  color: var(--cyan);
}

.demo-icon svg {
  width: 32px;
  height: 32px;
}

.demo-copy {
  display: grid;
  gap: 5px;
}

.demo-copy strong {
  color: #a9f9ff;
  font-size: 14px;
}

.demo-copy span {
  color: var(--muted);
  font-size: 12px;
}

.demo-indicator,
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.demo-indicator {
  margin-left: auto;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid #14315b;
}

.aris-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #647dff;
}

.aris-mark svg {
  width: 39px;
  height: 36px;
  stroke-width: 2.5;
}

.sidebar-footer strong {
  display: block;
  font-size: 14px;
  color: var(--cyan);
}

.sidebar-footer small {
  display: block;
  margin-top: 4px;
  color: var(--pink);
  font-size: 10px;
}


/* =========================================================
   05 — MAIN PANEL ET NAVIGATION DES VUES
========================================================= */

.main-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 620px;
}

.main-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 8px 18px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: .16em;
}

.main-topline h1 {
  margin: 5px 0 0;
  font-size: 19px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #18446a;
  border-radius: 99px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.view {
  display: none;
  min-width: 0;
}

.view.active {
  display: flex;
  flex-direction: column;
  flex: 1;
}


/* =========================================================
   06 — CHAT, WELCOME ET HERO ORB
========================================================= */

.chat-scroll {
  flex: 1;
  min-height: 300px;
  overflow: auto;
  padding: 10px 8px 16px;
  scrollbar-width: thin;
  scrollbar-color: #214b85 transparent;
}

.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 8px 26px;
}

.hero-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 142px;
  height: 142px;
  margin: 4px 0 16px;
}

/* Anneaux lumineux conservés */

.orb-ring {
  position: absolute;
  inset: 4px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  box-shadow:
    0 0 15px #00eaff4d,
    inset 0 0 16px #00eaff15;
  pointer-events: none;
}

.ring-one {
  animation: orbitSpin 10s linear infinite;
}

.ring-two {
  inset: -4px 10px 9px -7px;
  border-color: var(--pink);
  transform: rotate(-32deg);
  animation: orbitSpin 13s linear infinite reverse;
}

@keyframes orbitSpin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   06A — VRAI ROBOT EN IMAGE
   Fichier requis : assets/gilaris-robot.webp
   Tsy robot emoji ary tsy robot CSS.
========================================================= */

.hero-robot-image {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 50%;
  filter:
    drop-shadow(0 0 9px rgba(0, 234, 255, .35))
    drop-shadow(0 0 18px rgba(140, 77, 255, .20));
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Rehefa voamarina fa tafiditra ilay sary robot,
   ny JavaScript dia afaka manampy has-robot amin'ny hero-orb. */

.hero-orb.has-robot .orb-core {
  display: none;
}

/* Fallback G raha tsy mbola misy ilay sary robot */

.orb-core {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 1px solid #3e54ff;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 25%,
    #143e78,
    #070b28 75%
  );
  color: var(--cyan);
  font-size: 61px;
  font-weight: 900;
  text-shadow: 0 0 23px #00eaff;
  box-shadow: 0 0 28px #5146ff3d;
}

.orb-core span {
  position: absolute;
  margin: -55px 0 0 54px;
  color: var(--pink);
  font-size: 23px;
}

.hero-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}

.hero-subtitle {
  margin: 8px 0 0;
  color: #a8c9f5;
  font-size: 14px;
}

.hero-description {
  max-width: 440px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}


/* =========================================================
   07 — FEATURE CARDS
========================================================= */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 25px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 126px;
  padding: 14px 12px;
  border: 1px solid rgba(48, 112, 216, .23);
  border-radius: 19px;
  background: linear-gradient(140deg, #091a38, #070e26);
  text-align: left;
}

.feature-card:hover,
.lab-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: 0 8px 22px #00eaff10;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 800;
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.feature-icon.cyan {
  color: var(--cyan);
  background: #00eaff12;
}

.feature-icon.purple {
  color: #b58bff;
  background: #8c4dff16;
}

.feature-icon.gold {
  color: var(--gold);
  background: #ffc04412;
}

.feature-icon.pink {
  color: var(--pink);
  background: #f044e912;
}

.feature-card strong {
  font-size: 13px;
  color: #a9f7ff;
}

.feature-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}


/* =========================================================
   08 — MESSAGES ET CHAT BUBBLES
========================================================= */

.messages {
  display: grid;
  gap: 19px;
  width: 100%;
  padding: 4px 0 20px;
}

.message-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

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

.message-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--cyan);
  border-radius: 12px;
  color: var(--cyan);
  background: #071c38;
  font-weight: 800;
}

.message-row.user .message-avatar {
  order: 2;
  border-color: var(--purple);
  color: #d4b8ff;
}

.message-content {
  flex: 0 1 auto;
  width: auto;
  max-width: min(88%, 740px);
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid rgba(49, 121, 214, .30);
  border-radius: 5px 18px 18px 18px;
  background: #08152f;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: normal;
}

.message-content p {
  margin: 0 0 10px;
  white-space: pre-wrap;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-meta {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}

/* Valin'ny assistant: malalaka, tsy misy bubble */

.message-row:not(.user) .message-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px 4px;
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text);
}

/* User bubble violet */

.message-row.user .message-content {
  flex: 0 1 auto;
  width: auto !important;
  max-width: min(88%, 740px) !important;
  min-width: 0 !important;
  padding: 12px 16px !important;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, .24),
    rgba(91, 55, 180, .22),
    rgba(167, 139, 250, .18)
  ) !important;
  border: 1px solid rgba(180, 150, 255, .58) !important;
  border-radius: 20px 6px 20px 20px !important;
  box-shadow:
    0 4px 18px rgba(139, 92, 246, .13),
    inset 0 1px 0 rgba(255, 255, 255, .09) !important;
  color: #f5f0ff !important;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background .25s ease,
    border-color .25s ease,
    box-shadow .25s ease;
}

@media (hover: hover) {
  .message-row.user .message-content:hover {
    border-color: rgba(205, 185, 255, .82) !important;
    box-shadow:
      0 6px 22px rgba(139, 92, 246, .20),
      inset 0 1px 0 rgba(255, 255, 255, .12) !important;
  }
}

/* Paragraphes et listes */

.message-content p,
.message-content li {
  max-width: 100%;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.message-content strong,
.message-content em,
.message-content span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Images et médias dans les messages */

.message-content img,
.message-content video,
.message-content iframe {
  max-width: 100%;
  box-sizing: border-box;
}


/* =========================================================
   09 — CODE BLOCKS ET BOUTON COPY
========================================================= */

.code-block {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 13px 0;
  overflow: hidden;
  border: 1px solid #23456f;
  border-radius: 13px;
  background: #020713;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 9px 12px;
  border-bottom: 1px solid #1b3151;
  color: var(--cyan);
  font-size: 11px;
}

.copy-code-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #20536e;
  border-radius: 8px;
  padding: 6px 8px;
  color: #a9faff;
  background: #081b2b;
  font-size: 11px;
}

.copy-code-btn svg {
  width: 15px;
  height: 15px;
}

.code-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.code-scroll pre {
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: none;
  margin: 0;
  padding: 13px;
  color: #d6e6ff;
  font: 12px/1.7 "SFMono-Regular", Consolas, monospace;
  white-space: pre;
  overflow: visible;
  box-sizing: border-box;
}

.code-scroll code {
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: none;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  font-family: "SFMono-Regular", Consolas, monospace !important;
  font-variant-ligatures: none;
}

/* =========================================================
   10 — SYNTAX HIGHLIGHTING : BASE TOKENS
========================================================= */

.token-tag {
  color: #ff75c9;
}

.token-attr {
  color: #ffc86b;
}

.token-string {
  color: #a6f5a2;
}

.token-keyword {
  color: #d79cff;
}

.token-comment {
  color: #7187a7;
}


/* =========================================================
   11 — TYPING INDICATOR
========================================================= */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 15px;
  color: var(--muted);
  font-size: 12px;
}

.typing-avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--cyan);
  border-radius: 11px;
  color: var(--cyan);
  font-weight: 800;
}

.typing-content {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulseDot 1s infinite alternate;
}

.typing-dots i:nth-child(2) {
  animation-delay: .2s;
}

.typing-dots i:nth-child(3) {
  animation-delay: .4s;
}

@keyframes pulseDot {
  to {
    opacity: .25;
    transform: translateY(-3px);
  }
}

.stop-button {
  margin-left: auto;
  padding: 7px 11px;
  border: 1px solid #70366d;
  border-radius: 10px;
  color: var(--pink);
  background: #210f2a;
  font-size: 11px;
}


/* =========================================================
   12 — COMPOSER ET ZONE DE SAISIE
========================================================= */

.composer-area {
  position: sticky;
  bottom: 0;
  padding: 8px 0 3px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--bg) 18%
  );
}

.composer-shell {
  padding: 12px;
  border: 1px solid rgba(0, 234, 255, .40);
  border-radius: 23px;
  background: rgba(6, 17, 39, .98);
  box-shadow: 0 0 22px #00eaff0b;
}

.composer-shell textarea {
  display: block;
  width: 100%;
  min-height: 43px;
  max-height: 170px;
  resize: none;
  padding: 9px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.composer-shell textarea::placeholder {
  color: #7c95bb;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-tools {
  display: flex;
  gap: 6px;
}

.tool-button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid #1c3a63;
  border-radius: 12px;
  background: #081832;
  color: var(--cyan);
  font-size: 11px;
}

.tool-button svg {
  width: 18px;
  height: 18px;
}

.tool-button:nth-child(2) {
  color: var(--pink);
}

.composer-hint {
  margin-left: auto;
  color: #7187a7;
  font-size: 9px;
  text-align: right;
}

.send-button {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 13px;
  color: #04101e;
  background: linear-gradient(135deg, var(--cyan), #8e7aff);
  box-shadow: 0 0 15px #00eaff2b;
}

.send-button svg {
  width: 21px;
  height: 21px;
}

.composer-disclaimer {
  margin: 7px 4px 0;
  color: #7186a6;
  text-align: center;
  font-size: 10px;
}

.attachment-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border: 1px solid #214d78;
  border-radius: 13px;
  background: #07152c;
  color: var(--muted);
  font-size: 12px;
}

.attachment-strip img {
  width: 43px;
  height: 43px;
  border-radius: 8px;
  object-fit: cover;
}

.attachment-strip span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}


/* =========================================================
   13 — VISION VIEW ET AI LAB
========================================================= */

.secondary-view {
  padding: 16px 10px 25px;
}

.section-heading {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 23px;
}

.section-symbol {
  display: grid;
  place-items: center;
  width: 55px;
  height: 55px;
  border-radius: 17px;
  background: #081a38;
}

.section-symbol svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-symbol.pink {
  color: var(--pink);
}

.section-symbol.gold {
  color: var(--gold);
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: 23px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 180px;
  width: 100%;
  border: 1px dashed #28659a;
  border-radius: 22px;
  background: #07142d;
  color: var(--cyan);
}

.upload-zone svg {
  width: 34px;
  height: 34px;
}

.upload-zone span {
  color: var(--muted);
  font-size: 12px;
}

.vision-preview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 15px;
}

.vision-preview img {
  max-width: 100%;
  max-height: 270px;
  border-radius: 15px;
  object-fit: contain;
}

.secondary-button,
.primary-button {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #25547d;
  background: #091a34;
  color: var(--cyan);
}

.field-label {
  display: block;
  margin: 22px 0 9px;
  color: var(--cyan);
  font-size: 13px;
}

.vision-prompt {
  width: 100%;
  padding: 13px;
  border: 1px solid #20406a;
  border-radius: 14px;
  background: #07142d;
  color: var(--text);
  resize: vertical;
}

.primary-button {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border-color: var(--cyan);
  background: linear-gradient(100deg, #063557, #26134a);
  font-weight: 700;
}

.primary-button span {
  float: right;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lab-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 17px;
  min-height: 145px;
  border: 1px solid #1b3e6a;
  border-radius: 18px;
  background: #081630;
  text-align: left;
}

.lab-card strong {
  font-size: 13px;
}

.lab-card small {
  color: var(--muted);
  font-size: 11px;
}

.lab-note {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid #1d416a;
  border-radius: 16px;
  background: #07142c;
}

.lab-note .status-dot {
  flex-shrink: 0;
  margin-top: 5px;
}

.lab-note strong {
  font-size: 13px;
}

.lab-note p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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


/* =========================================================
   14 — BOTTOM DOCK ET QUICK ACTIONS
========================================================= */

.bottom-dock {
  position: fixed;
  z-index: 15;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #10284a;
  background: rgba(3, 8, 23, .94);
  backdrop-filter: blur(18px);
}

.theme-label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid #1a3c68;
  border-radius: 16px;
  background: #081832;
  color: #d9eaff;
  font-size: 12px;
  white-space: nowrap;
}

.theme-label svg {
  width: 23px;
  height: 23px;
  color: var(--cyan);
}

.quick-actions {
  display: flex;
  gap: 8px;
}

.dock-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #1a3157;
  border-radius: 16px;
  background: #07132a;
}

.dock-button svg {
  width: 23px;
  height: 23px;
  stroke-width: 2.2;
}

.dock-button.cyan {
  color: var(--cyan);
}

.dock-button.gold {
  color: var(--gold);
}

.dock-button.blue {
  color: #9adfff;
}

.dock-button.purple {
  color: #b36aff;
}

.dock-button.pink {
  color: var(--pink);
}

.dock-button:hover {
  border-color: currentColor;
  box-shadow: 0 0 16px currentColor;
}


/* =========================================================
   15 — CONTEXT MENU ET TOAST
========================================================= */

.context-menu {
  position: fixed;
  z-index: 50;
  min-width: 210px;
  padding: 7px;
  border: 1px solid #265b88;
  border-radius: 15px;
  background: #07142d;
  box-shadow: 0 12px 40px #0009;
}

.context-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 13px;
}

.context-menu button:hover {
  background: #12294a;
  color: var(--cyan);
}

.context-time {
  padding: 8px 12px;
  border-bottom: 1px solid #193555;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 80;
  bottom: 95px;
  left: 50%;
  max-width: calc(100vw - 30px);
  padding: 12px 17px;
  border: 1px solid #2b8eae;
  border-radius: 13px;
  background: #07182c;
  color: #dffcff;
  font-size: 13px;
  box-shadow: 0 0 20px #00eaff16;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}


/* =========================================================
   16 — LIGHT THEME
========================================================= */

body.light-theme {
  color-scheme: light;
  --bg: #eef4ff;
  --panel: #fff;
  --panel2: #e8efff;
  --surface: rgba(255, 255, 255, .96);
  --border: #c7d6ef;
  --text: #17233d;
  --muted: #5c6d8a;
  background: #eef4ff;
}

.light-theme .topbar,
.light-theme .bottom-dock {
  background: rgba(242, 247, 255, .95);
  border-color: #ccd9ee;
}

.light-theme .sidebar,
.light-theme .composer-shell,
.light-theme .feature-card,
.light-theme .nav-item,
.light-theme .history-item,
.light-theme .demo-card,
.light-theme .lab-card,
.light-theme .lab-note,
.light-theme .upload-zone,
.light-theme .vision-prompt,
.light-theme .message-content {
  background: #fff;
  color: var(--text);
}

.light-theme .nav-item:hover,
.light-theme .nav-item.active {
  background: #e5f4ff;
}

.light-theme .brand-title {
  color: #007eaa;
}

.light-theme .theme-label {
  background: #fff;
  color: #17233d;
}

.light-theme .context-menu {
  background: #fff;
  border-color: #cad8ed;
}

.light-theme .context-menu button {
  color: #17233d;
}

.light-theme .message-row.user .message-content {
  background: linear-gradient(
    135deg,
    rgba(196, 181, 253, .48),
    rgba(167, 139, 250, .32)
  ) !important;
  border-color: rgba(124, 58, 237, .38) !important;
  color: #302052 !important;
}

.light-theme .message-content {
  border-color: #cfdbef;
}

.light-theme .code-block {
  background: #081225;
}

.light-theme .composer-disclaimer {
  color: #5c6d8a;
}

.light-theme .message-row:not(.user) .message-content {
  color: var(--text);
  background: transparent !important;
}


/* =========================================================
   17 — MOBILE OVERLAY
========================================================= */

.mobile-overlay {
  display: none;
}


/* =========================================================
   18 — SVG ACTION BAR
========================================================= */

.message-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 100%;
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid rgba(70, 190, 255, .10);
}

.message-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 36px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(57, 190, 255, .13);
  border-radius: 11px;
  background: rgba(7, 20, 45, .72);
  color: #a8c4e8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    color .2s ease,
    border-color .2s ease,
    background .2s ease,
    transform .2s ease,
    box-shadow .2s ease;
}

.message-action svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-action:hover,
.message-action:focus-visible {
  color: #19eaff;
  border-color: rgba(25, 234, 255, .6);
  background: rgba(11, 61, 100, .42);
  box-shadow: 0 0 13px rgba(25, 234, 255, .13);
  outline: none;
}

.message-action:active {
  transform: scale(.92);
}

.message-action.is-active {
  color: #23f0ff;
  border-color: #23cfff;
  background: rgba(10, 100, 150, .25);
}

.message-action[data-message-action="dislike"].is-active {
  color: #ff62dd;
  border-color: #ff62dd;
}

.message-action[data-message-action="share"] svg,
.message-action[data-message-action="more"] svg {
  color: #d56aff;
}

.message-action-label {
  font-size: 12px;
  line-height: 1;
}

/* =========================================================
   19 — MORE MENU
========================================================= */

.gilaris-more-menu {
  position: fixed;
  z-index: 9999;
  width: min(235px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 7px;
  border: 1px solid rgba(35, 220, 255, .42);
  border-radius: 15px;
  background: #071329;
  box-shadow:
    0 12px 38px rgba(0, 0, 0, .48),
    0 0 20px rgba(0, 220, 255, .10);
  animation: gilarisMenuIn .16s ease-out;
}

.gilaris-more-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #e3f1ff;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.gilaris-more-menu button:hover,
.gilaris-more-menu button:focus-visible {
  background: rgba(25, 220, 255, .12);
  color: #20eaff;
  outline: none;
}

.gilaris-more-menu button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

@keyframes gilarisMenuIn {
  from {
    opacity: 0;
    transform: translateY(5px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.light-theme .message-action {
  background: rgba(225, 241, 255, .85);
  color: #254363;
  border-color: rgba(30, 120, 180, .18);
}

body.light-theme .gilaris-more-menu {
  background: #f6faff;
  border-color: #78cfe8;
}

body.light-theme .gilaris-more-menu button {
  color: #183550;
}


/* =========================================================
   20 — CONTEXT MENU SVG ICONS
========================================================= */

.context-menu .context-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px currentColor);
  transition:
    transform .2s ease,
    filter .2s ease;
}

.context-menu .copy-icon {
  color: #45d9ff;
}

.context-menu .edit-icon {
  color: #c58aff;
}

.context-menu .select-icon {
  color: #4dffb8;
}

.context-menu .share-icon {
  color: #ffbd59;
}

.context-menu button:hover .context-icon {
  transform: scale(1.12);
  filter: drop-shadow(0 0 7px currentColor);
}


/* =========================================================
   21 — IMAGE VIEWER
========================================================= */

/* Images inside chat messages */

.chat-image-clickable {
  display: block;
  width: auto;
  max-width: min(100%, 520px);
  max-height: 300px;
  height: auto;
  object-fit: contain;
  margin: 0 0 12px;
  border: 1px solid rgba(0, 225, 255, .28);
  border-radius: 14px;
  background: rgba(3, 8, 23, .7);
  cursor: zoom-in;
  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.chat-image-clickable:hover,
.chat-image-clickable:focus-visible {
  border-color: rgba(0, 235, 255, .9);
  box-shadow:
    0 0 0 2px rgba(0, 225, 255, .08),
    0 0 22px rgba(0, 225, 255, .18);
  outline: none;
}

.chat-image-clickable:active {
  transform: scale(.99);
}

/* Lock background scrolling while viewer is open */

body.image-viewer-open {
  overflow: hidden;
  overscroll-behavior: none;
}

/* Full-screen backdrop */

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  overflow: hidden;
  background:
    radial-gradient(
      ellipse at 50% 35%,
      rgba(11, 42, 78, .45),
      transparent 58%
    ),
    rgba(2, 5, 17, .97);
  color: #eefaff;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity .2s ease,
    visibility .2s ease;
  isolation: isolate;
}

.image-viewer.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Top toolbar */

.image-viewer-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(0, 225, 255, .17);
  background: rgba(4, 11, 29, .94);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.image-viewer-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.image-viewer-status,
.image-viewer-hint-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00efff;
  box-shadow: 0 0 12px rgba(0, 239, 255, .85);
}

.image-viewer-title {
  max-width: min(48vw, 360px);
  overflow: hidden;
  color: #e9faff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

/* Toolbar buttons */

.image-viewer-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(0, 225, 255, .28);
  border-radius: 13px;
  background: rgba(8, 24, 49, .9);
  color: #eafaff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.image-viewer-btn svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.image-viewer-btn:hover,
.image-viewer-btn:focus-visible {
  outline: none;
  border-color: #00eaff;
  background: rgba(0, 225, 255, .12);
  box-shadow: 0 0 18px rgba(0, 225, 255, .13);
}

.image-viewer-btn:active {
  transform: scale(.94);
}

.image-viewer-download {
  color: #55f5d2;
}

.image-viewer-share {
  color: #c9a4ff;
}

.image-viewer-close {
  border-color: rgba(255, 91, 132, .38);
  color: #ff91b1;
}

.image-viewer-close:hover,
.image-viewer-close:focus-visible {
  border-color: #ff719d;
  background: rgba(255, 65, 125, .12);
  box-shadow: 0 0 18px rgba(255, 65, 125, .13);
}

/* Image presentation area */

.image-viewer-stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.image-viewer-image {
  display: block;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid rgba(0, 225, 255, .19);
  border-radius: 10px;
  background: rgba(4, 12, 27, .65);
  box-shadow:
    0 0 0 1px rgba(0, 225, 255, .035),
    0 18px 65px rgba(0, 0, 0, .42),
    0 0 32px rgba(0, 225, 255, .07);
  object-position: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Bottom indicator */

.image-viewer-hint {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 14px;
  border-top: 1px solid rgba(0, 225, 255, .12);
  background: rgba(4, 11, 29, .88);
  color: #8eaec7;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-align: center;
}

.image-viewer button:focus-visible {
  outline: 2px solid #00eaff;
  outline-offset: 3px;
}


/* =========================================================
   22 — ADVANCED SYNTAX HIGHLIGHTING
   Acode / Termux inspired color palette
========================================================= */

/* HTML / XML / SVG */

.message-content .token-tag {
  color: #45d9ff !important;
  font-weight: 600;
}

.message-content .token-attr {
  color: #ff75d8 !important;
}

.message-content .token-string {
  color: #ffe082 !important;
}

.message-content .token-comment {
  color: #8292a8 !important;
  font-style: italic;
}

/* CSS / SCSS */

.message-content .token-selector {
  color: #63e6a5 !important;
  font-weight: 600;
}

.message-content .token-property {
  color: #70c7ff !important;
}

.message-content .token-value {
  color: #ffd479 !important;
}

.message-content .token-punctuation {
  color: #c6d2e2 !important;
}

/* JavaScript / TypeScript / Python / C++ */

.message-content .token-keyword {
  color: #c792ea !important;
  font-weight: 600;
}

.message-content .token-function {
  color: #82aaff !important;
}

.message-content .token-variable {
  color: #f0f4fc !important;
}

.message-content .token-number {
  color: #f78c6c !important;
}

.message-content .token-operator {
  color: #89ddff !important;
}

.message-content .token-boolean {
  color: #ff9cac !important;
}

/* JSON */

.message-content .token-property-name {
  color: #80cbc4 !important;
}

.message-content .token-null {
  color: #f07178 !important;
}

/* Inline code */

.message-content .token-inline-code {
  color: #80deea !important;
  background: rgba(69, 217, 255, .10);
  border: 1px solid rgba(69, 217, 255, .18);
  border-radius: 5px;
  padding: 2px 5px;
  font-family:
    "JetBrains Mono",
    "Fira Code",
    Consolas,
    monospace !important;
  font-size: .92em;
  overflow-wrap: anywhere;
}

.message-content :not(pre) > code {
  color: #80deea;
  background: rgba(69, 217, 255, .10);
  border: 1px solid rgba(69, 217, 255, .18);
  border-radius: 5px;
  padding: 2px 5px;
  font-family:
    "JetBrains Mono",
    "Fira Code",
    Consolas,
    monospace !important;
  font-size: .92em;
}

/* Code block typography */

.message-content pre,
.message-content pre code,
.message-content .code-scroll pre,
.message-content .code-scroll code {
  font-family:
    "JetBrains Mono",
    "Fira Code",
    Consolas,
    monospace !important;
  font-variant-ligatures: none;
  tab-size: 4;
  line-height: 1.7;
}

.message-content pre {
  white-space: pre;
  overflow-x: auto;
  overflow-y: visible;
}

.message-content pre code {
  display: block;
  min-width: max-content;
}

/* Dark theme readability */

.message-content .token-tag,
.message-content .token-attr,
.message-content .token-string,
.message-content .token-keyword,
.message-content .token-function,
.message-content .token-selector,
.message-content .token-property,
.message-content .token-value {
  text-shadow: 0 0 8px rgba(69, 217, 255, .08);
}

/* Light theme readability */

.light-theme .message-content .token-variable {
  color: #344054 !important;
}

.light-theme .message-content .token-punctuation {
  color: #475467 !important;
}

.light-theme .message-content .token-comment {
  color: #7b8494 !important;
}

.light-theme .message-content .token-tag {
  color: #007c9e !important;
}

.light-theme .message-content .token-attr {
  color: #b42383 !important;
}

.light-theme .message-content .token-string {
  color: #986000 !important;
}

.light-theme .message-content .token-keyword {
  color: #8041a8 !important;
}

.light-theme .message-content .token-function {
  color: #245bb5 !important;
}

.light-theme .message-content .token-selector {
  color: #16804b !important;
}

.light-theme .message-content .token-property {
  color: #176b9b !important;
}

.light-theme .message-content .token-value {
  color: #956000 !important;
}


/* =========================================================
   23 — RESPONSIVE DESIGN : DESKTOP
========================================================= */

@media (min-width: 1250px) {
  .workspace {
    max-width: 1700px;
    margin: 0 auto;
    grid-template-columns: minmax(330px, 35%) minmax(0, 1fr);
    gap: 25px;
    padding-inline: 28px;
  }

  .sidebar {
    padding: 26px;
  }

  .feature-card {
    min-height: 138px;
    padding: 17px;
  }

  .chat-scroll {
    padding-inline: 20px;
  }
}


/* =========================================================
   24 — RESPONSIVE DESIGN : TABLET ET MOBILE
========================================================= */

@media (max-width: 760px) {
  .app-shell {
    padding-bottom: 78px;
  }

  .topbar {
    height: 76px;
    gap: 11px;
    padding: 10px 12px;
  }

  .icon-button {
    width: 43px;
    height: 43px;
    border-radius: 14px;
  }

  .icon-button svg {
    width: 24px;
    height: 24px;
  }

  .brand-head {
    gap: 8px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 27px;
  }

  .brand-title {
    font-size: clamp(19px, 5.4vw, 30px);
    letter-spacing: 0;
  }

  .workspace {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 12px 12px 0;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(88vw, 370px);
    min-height: 0;
    overflow-y: auto;
    border-radius: 0 27px 27px 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateX(-105%);
    transition: transform .25s ease;
  }

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

  .mobile-overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: #0009;
    backdrop-filter: blur(3px);
  }

  .close-sidebar {
    display: inline-grid;
  }

  .main-panel {
    min-height: calc(100dvh - 100px);
  }

  .main-topline {
    padding: 4px 3px 12px;
  }

  .main-topline h1 {
    font-size: 17px;
  }

  .status-pill {
    padding: 7px 9px;
    font-size: 10px;
  }

  .chat-scroll {
    min-height: 350px;
    padding: 8px 1px 12px;
  }

  .welcome {
    padding: 13px 2px 23px;
  }

  .hero-orb {
    width: 125px;
    height: 125px;
  }

  .orb-core {
    width: 91px;
    height: 91px;
    font-size: 53px;
  }

  .orb-core span {
    margin-top: -47px;
    margin-left: 48px;
  }

  .hero-description {
    margin-top: 15px;
    font-size: 13px;
  }

  .feature-grid {
    gap: 8px;
    margin-top: 20px;
  }

  .feature-card {
    min-height: 117px;
    padding: 11px 9px;
    border-radius: 16px;
  }

  .feature-card strong {
    font-size: 12px;
  }

  .feature-card small {
    font-size: 10px;
  }

  .feature-icon {
    width: 32px;
    height: 32px;
  }

  .message-content {
    max-width: 88%;
    padding: 12px;
    font-size: 14px;
  }

  .message-row:not(.user) .message-content {
    max-width: 100%;
    padding-left: 2px;
    padding-right: 2px;
  }

  .message-row.user .message-content {
    max-width: 88% !important;
  }

  .composer-shell {
    padding: 9px;
    border-radius: 19px;
  }

  .composer-shell textarea {
    min-height: 40px;
    font-size: 14px;
  }

  .composer-hint {
    display: none;
  }

  .tool-button {
    padding: 7px;
  }

  .composer-disclaimer {
    font-size: 9px;
  }

  .bottom-dock {
    gap: 10px;
    justify-content: space-between;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  .theme-label {
    padding: 9px;
    gap: 6px;
  }

  .theme-label span {
    font-size: 10px;
  }

  .theme-label svg {
    width: 20px;
    height: 20px;
  }

  .quick-actions {
    gap: 5px;
  }

  .dock-button {
    width: clamp(34px, 8.6vw, 44px);
    height: clamp(38px, 9.5vw, 44px);
    border-radius: 12px;
  }

  .dock-button svg {
    width: 20px;
    height: 20px;
  }

  .mobile-brand-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 15px 5px 9px;
    border-top: 2px solid transparent;
    border-image: linear-gradient(
      90deg,
      var(--cyan),
      var(--purple),
      var(--pink)
    ) 1;
    color: var(--cyan);
    font-size: 10px;
  }

  .mobile-brand-footer .aris-mark {
    width: 27px;
    height: 27px;
  }

  .mobile-brand-footer .aris-mark svg {
    width: 27px;
    height: 27px;
  }

  .mobile-brand-footer span:last-child {
    color: var(--pink);
  }

  .secondary-view {
    padding: 12px 1px;
  }

  .tools-grid {
    gap: 9px;
  }

  .lab-card {
    padding: 12px;
    min-height: 130px;
  }

  .context-menu {
    max-width: calc(100vw - 20px);
  }

  .message-actions {
    gap: 5px;
  }

  .message-action {
    min-width: 34px;
    min-height: 35px;
    padding: 7px;
  }

  .message-action-label {
    display: none;
  }

  .chat-image-clickable {
    max-height: 250px;
  }

  .image-viewer-stage {
    padding: 10px;
  }

  .message-content .code-scroll pre,
  .message-content .code-scroll code {
    font-size: 13px;
    line-height: 1.7;
  }
}


/* =========================================================
   25 — PETITS ÉCRANS
========================================================= */

@media (max-width: 420px) {
  .message-actions {
    gap: 5px;
  }

  .message-action {
    min-width: 34px;
    min-height: 35px;
    padding: 7px;
  }

  .message-action-label {
    display: none;
  }
}

@media (max-width: 380px) {
  .topbar {
    gap: 7px;
  }

  .icon-button {
    width: 39px;
    height: 39px;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
    font-size: 24px;
  }

  .brand-title {
    font-size: 18px;
  }

  .feature-card {
    padding: 9px 7px;
  }

  .feature-card small {
    font-size: 9px;
  }

  .theme-label span {
    display: none;
  }

  .dock-button {
    width: 34px;
    height: 38px;
  }

  .workspace {
    padding-left: 9px;
    padding-right: 9px;
  }

  .message-row.user .message-content {
    max-width: 90% !important;
  }

  .message-action {
    min-width: 32px;
    padding: 6px;
  }
}


/* =========================================================
   26 — IMAGE VIEWER RESPONSIVE
========================================================= */

@media (max-width: 600px) {
  .chat-image-clickable {
    max-width: 100%;
    max-height: 250px;
    border-radius: 12px;
  }

  .image-viewer-toolbar {
    min-height: 60px;
    gap: 8px;
    padding: 8px 10px;
  }

  .image-viewer-title {
    max-width: 36vw;
    font-size: 12px;
  }

  .image-viewer-actions {
    gap: 6px;
  }

  .image-viewer-btn {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .image-viewer-btn svg {
    width: 19px;
    height: 19px;
  }

  .image-viewer-stage {
    padding: 10px;
  }

  .image-viewer-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
  }

  .image-viewer-hint {
    min-height: 38px;
    font-size: 9px;
    letter-spacing: .11em;
  }
}

/* Short landscape screens */

@media (max-height: 500px) {
  .image-viewer-toolbar {
    min-height: 48px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .image-viewer-btn {
    width: 36px;
    height: 36px;
  }

  .image-viewer-stage {
    padding: 6px 12px;
  }

  .image-viewer-hint {
    min-height: 28px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
}


/* =========================================================
   27 — MOBILE HORIZONTAL OVERFLOW PROTECTION
========================================================= */

#app,
.app,
.app-shell,
.main-content,
.main-panel,
.chat-view,
#chatView,
#messages,
#chatScroll,
.view,
.message-row,
.message-content {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#messages {
  width: 100%;
  overflow-x: clip;
}

.message-row {
  overflow-x: visible;
}

.message-content {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Code block header */

.message-content .code-block {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.message-content .code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Scroll only inside code area */

.message-content .code-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.message-content .code-scroll pre {
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  white-space: pre;
  overflow: visible;
}

.message-content .code-scroll code {
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: none;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

/* Composer and input */

#chatForm,
#composerArea,
.composer-area,
.composer-shell,
#messageInput {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.composer-area,
.composer-shell,
#chatForm,
#messageInput {
  width: 100%;
}

#messageInput {
  overflow-x: hidden;
  overflow-wrap: anywhere;
}

/* Mobile overflow protection */

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
  }

  #messages,
  #chatScroll,
  #chatView,
  #visionView,
  #toolsView {
    min-width: 0;
    max-width: 100%;
  }

  .message-row,
  .message-content,
  .message-content .code-block,
  .message-content .code-header,
  .message-content .code-scroll {
    min-width: 0;
    max-width: 100%;
  }

  .message-content .code-scroll pre,
  .message-content .code-scroll code {
    font-size: 13px;
    line-height: 1.7;
  }
}


/* =========================================================
   28 — LIGHT THEME : CODE ET USER BUBBLE
========================================================= */

.light-theme .message-row.user .message-content {
  background: linear-gradient(
    135deg,
    rgba(196, 181, 253, .48),
    rgba(167, 139, 250, .32)
  ) !important;
  border-color: rgba(124, 58, 237, .38) !important;
  color: #302052 !important;
}

.light-theme .message-content .code-block {
  background: #081225;
}

.light-theme .message-content .code-scroll pre {
  color: #d6e6ff;
}


/* =========================================================
   29 — ACCESSIBILITY ET REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .image-viewer,
  .image-viewer-btn,
  .chat-image-clickable,
  .message-action {
    transition: none !important;
  }
}


/* =========================================================
   END — GILARIS AI NEXUS V2.0
   ARISONTECH
========================================================= */

/* ==================================================
   GILARIS AI — NEXUS V2.0
   OFFICIAL ROBOT WALLPAPER
   Background for welcome + AI conversations
   ================================================== */

/* MAIN CHAT BACKGROUND */
#chatScroll,
.chat-scroll {
  position: relative;
  isolation: isolate;

  background-color: #050a18 !important;

  background-image:
    linear-gradient(
      135deg,
      rgba(3, 8, 25, 0.76),
      rgba(5, 10, 30, 0.72),
      rgba(8, 5, 28, 0.80)
    ),
    url("assets/gilaris-robot.webp") !important;

  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

/* KEEP CHAT CONTENT ABOVE THE WALLPAPER */
#chatScroll > *,
.chat-scroll > * {
  position: relative;
  z-index: 1;
}

/* WELCOME AREA — TRANSPARENT BACKGROUND */
#chatScroll .welcome,
#chatScroll .welcome-section,
.chat-scroll .welcome,
.chat-scroll .welcome-section {
  background: transparent !important;
}

/* PRESERVE MESSAGE READABILITY */
#chatScroll .message,
.chat-scroll .message {
  position: relative;
  z-index: 2;
}

/* MOBILE RESPONSIVE WALLPAPER */
@media (max-width: 760px) {
  #chatScroll,
  .chat-scroll {
    background-position: center center;
    background-size: cover;
    background-attachment: scroll;
  }
}

/* SMALL SCREENS */
@media (max-width: 380px) {
  #chatScroll,
  .chat-scroll {
    background-position: center center;
  }
}


/* ==========================================
   GILARIS AI — IMMOBILE ROBOT WALLPAPER
   Wallpaper stays fixed while messages scroll
   ========================================== */

#chatScroll,
.chat-scroll {
  background-attachment: fixed !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
}

/* Keep conversation content scrollable */
#chatScroll,
.chat-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Android / mobile optimization */
@media (max-width: 760px) {
  #chatScroll,
  .chat-scroll {
    background-attachment: fixed !important;
    background-position: center center !important;
    background-size: cover !important;
  }
}


/* ==========================================
   GILARIS AI NEXUS V2.0
   FIX: HEADER THEME BUTTON
   ========================================== */

.topbar > #themeButton {
    margin-left: auto !important;
    margin-right: 12px !important;

    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;

    padding: 0 !important;
    flex-shrink: 0 !important;

    transform: scale(0.88);
    transform-origin: center center;
}

/* Ahena kely ilay icône soleil */
.topbar > #themeButton svg {
    width: 23px !important;
    height: 23px !important;
}


/* ==========================================
   GILARIS AI NEXUS V2.0
   ARISONTECH PERSONAL PHOTO AVATAR
   CSS OVERRIDE — SAFE ADDITION
   ========================================== */

/* IMAGE COMMUNE */
.brand-photo {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center 35% !important;
    border-radius: 50% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* 1. LOGO PRINCIPAL */
.brand-mark {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    padding: 3px !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

/* 2. LOGO SIDEBAR */
.mini-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    padding: 2px !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

/* 3. AVATAR GENERATION */
.typing-avatar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    padding: 2px !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

/* NEON CONTOUR */
.brand-mark,
.mini-logo,
.typing-avatar {
    border: 2px solid #00eaff !important;
    box-shadow:
        0 0 8px rgba(0, 234, 255, 0.55),
        0 0 16px rgba(0, 234, 255, 0.2) !important;
}

/* IMAGE INTERACTION */
.brand-photo {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
}
