/* Gardien — Obsidian Thread UI (ChatGPT × Claude × Grok, mais unique) */
:root {
  --bg: #0c0c0e;
  --bg-thread: #101012;
  --surface: #18181c;
  --surface-2: #222228;
  --surface-3: #2c2c34;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --gold: #d4a853;
  --gold-soft: #e8c878;
  --gold-dim: #a67c2e;
  --gold-glow: rgba(212, 168, 83, 0.18);
  --accent: #d4a853;
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --user-bg: #27272a;
  --bot-bg: transparent;
  --danger: #f87171;
  --danger-bg: rgba(127, 29, 29, 0.35);
  --ok: #4ade80;
  --thread-w: 768px;
  --sidebar-w: 260px;
  --topbar-h: 52px;
  --dock-pad: 16px;
  --radius: 20px;
  --radius-pill: 28px;
  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.gardien-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(212, 168, 83, 0.07), transparent 50%),
    radial-gradient(ellipse 60% 50% at 100% 50%, rgba(99, 102, 241, 0.04), transparent 45%),
    var(--bg);
}

/* ─── Shell ─── */
.ai-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* ─── Topbar (minimal like ChatGPT) ─── */
.g-header, .ai-topbar {
  flex-shrink: 0;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding: var(--safe-t) 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 12, 14, 0.85);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.ai-topbar-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: 1.15rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}
.ai-topbar-btn:hover { background: var(--surface-2); }
.ai-topbar-btn.on { color: var(--gold-soft); background: rgba(212, 168, 83, 0.1); }

.ai-topbar-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.ai-topbar-center h1, .g-brand h1, #nom {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.ai-topbar-center p, .g-brand p, #sousTitre {
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-hdr-actions, .ai-topbar-tools {
  display: flex;
  gap: 2px;
  align-items: center;
}

.g-conn, #connDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}
.g-conn.ok, #connDot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(74, 222, 128, 0.5); }
.g-conn.warn, #connDot.warn { background: #f5c542; box-shadow: 0 0 8px rgba(245, 197, 66, 0.45); }
.g-conn.err, #connDot.err { background: var(--danger); }

/* ─── Thread (centered column) ─── */
.g-chat, .ai-thread {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.ai-thread-inner {
  max-width: var(--thread-w);
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ─── Message turns (Claude/GPT style rows) ─── */
.ai-turn {
  display: flex;
  gap: 14px;
  padding: 20px 0;
  animation: ai-in 0.4s var(--ease) both;
  width: 100%;
}
@keyframes ai-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-turn--user {
  flex-direction: row-reverse;
  padding: 8px 0;
}
.ai-turn--user .ai-turn-body {
  max-width: 85%;
  background: var(--user-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-bottom-right-radius: 6px;
  padding: 12px 16px;
}
.ai-turn--user .ai-turn-avatar { display: none; }

.ai-turn--bot .ai-turn-body,
.ai-turn--bot .g-bubble.bot,
.g-bubble.bot {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  max-width: 100%;
}

.ai-turn-avatar {
  width: 38px;
  height: 44px;
  border-radius: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0;
  background: transparent;
  border: none;
  overflow: visible;
  box-shadow: none;
}
.ai-turn-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}
.ai-turn-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-turn-text, .g-bubble {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-turn--user .ai-turn-text, .g-bubble.user {
  font-size: 0.9375rem;
  line-height: 1.55;
}

.g-bubble {
  max-width: 100%;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  animation: ai-in 0.4s var(--ease) both;
}
.g-bubble.user {
  align-self: flex-end;
  max-width: 85%;
  margin-left: auto;
  background: var(--user-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-bottom-right-radius: 6px;
  padding: 12px 16px;
}
.g-bubble.bot {
  align-self: stretch;
  padding: 4px 0 4px 46px;
  position: relative;
}
.g-bubble.bot::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 42px;
  background: url("/icons/gardien-detoure-sm.png") center/contain no-repeat;
  border: none;
}
.g-bubble.danger { color: #fecaca; }
.g-bubble.danger::before { content: "⚠️"; }

.g-meta, .ai-meta {
  font-size: 0.65rem;
  color: var(--text-3);
  margin-top: 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ─── Thinking (Claude dots) ─── */
.g-thinking, .ai-thinking {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 0 16px 46px;
  color: var(--text-3);
  font-size: 0.85rem;
  position: relative;
}
.g-thinking::before, .ai-thinking::before {
  content: "";
  position: absolute;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-2);
}
.ai-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}
.ai-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-3);
  animation: ai-dot 1.2s ease infinite;
}
.ai-dots span:nth-child(2) { animation-delay: 0.15s; }
.ai-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* ─── Empty state (GPT suggestions) ─── */
.g-welcome, .ai-hero {
  padding: 48px 16px 32px;
  max-width: var(--thread-w);
  margin: 0 auto;
  text-align: center;
}
.ai-hero-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  background: linear-gradient(145deg, rgba(212, 168, 83, 0.2), rgba(212, 168, 83, 0.05));
  border: 2px solid rgba(212, 168, 83, 0.35);
  box-shadow: 0 8px 32px var(--gold-glow);
  overflow: hidden;
}
.ai-hero-logo.has-tete,
.ai-hero-logo.has-presence {
  padding: 0;
  font-size: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  width: auto;
  height: auto;
  overflow: visible;
}
.ai-hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.has-tete-detoure {
  background: transparent !important;
  border: none !important;
  box-shadow: 0 4px 24px rgba(212, 168, 83, 0.22);
}
.has-tete-detoure img {
  object-fit: contain;
  background: transparent;
}

/* ─── Présence 3D + 4D (temps) ─── */
.gardien-presence-4d {
  position: relative;
  width: 148px;
  height: 168px;
  margin: 0 auto;
  perspective: 1100px;
  transform-style: preserve-3d;
}
.g4d-orbit {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 130px;
  height: 130px;
  margin: -65px 0 0 -65px;
  border-radius: 50%;
  border: 1px solid rgba(212, 168, 83, 0.22);
  pointer-events: none;
  transform-style: preserve-3d;
}
.g4d-orbit--a {
  animation: g4d-orbit-a 14s linear infinite;
  border-color: rgba(212, 168, 83, 0.35);
}
.g4d-orbit--b {
  width: 148px;
  height: 148px;
  margin: -74px 0 0 -74px;
  animation: g4d-orbit-b 20s linear infinite reverse;
  opacity: 0.5;
}
.g4d-chrono {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(212, 168, 83, 0.45) 40deg,
    transparent 80deg,
    rgba(99, 102, 241, 0.25) 140deg,
    transparent 200deg,
    rgba(212, 168, 83, 0.35) 280deg,
    transparent 360deg
  );
  animation: g4d-chrono 8s linear infinite;
  filter: blur(6px);
  opacity: 0.7;
  pointer-events: none;
}
.g4d-aura {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 100px;
  height: 40px;
  margin-left: -50px;
  background: radial-gradient(ellipse, rgba(212, 168, 83, 0.35), transparent 70%);
  filter: blur(10px);
  animation: g4d-breathe 3.5s ease-in-out infinite;
  pointer-events: none;
}
.g3d-card {
  position: relative;
  z-index: 2;
  width: 120px;
  height: 140px;
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform 0.12s ease-out;
  animation: g4d-float 5s ease-in-out infinite;
}
.g3d-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55))
          drop-shadow(0 0 20px rgba(212, 168, 83, 0.15));
  pointer-events: none;
  user-select: none;
}
.ai-hero-logo.speaking .g3d-card img,
.ai-hero-logo.speaking .gardien-presence-4d .g3d-card img {
  filter: drop-shadow(0 12px 32px rgba(212, 168, 83, 0.45))
          drop-shadow(0 0 32px rgba(212, 168, 83, 0.35));
  animation: g4d-speak 0.8s ease-in-out infinite;
}
@keyframes g4d-orbit-a {
  from { transform: rotateX(68deg) rotateZ(0deg); }
  to { transform: rotateX(68deg) rotateZ(360deg); }
}
@keyframes g4d-orbit-b {
  from { transform: rotateX(72deg) rotateY(12deg) rotateZ(0deg); }
  to { transform: rotateX(72deg) rotateY(12deg) rotateZ(360deg); }
}
@keyframes g4d-chrono {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes g4d-float {
  0%, 100% { transform: translateY(0) translateZ(0); }
  50% { transform: translateY(-6px) translateZ(8px); }
}
@keyframes g4d-breathe {
  0%, 100% { opacity: 0.45; transform: scaleX(1); }
  50% { opacity: 0.85; transform: scaleX(1.15); }
}
@keyframes g4d-speak {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* Coupe 3D/4D quand tu parles ou qu'il parle */
[data-g3d].g3d-ecoute .g4d-orbit,
[data-g3d].g3d-ecoute .g4d-chrono,
[data-g3d].g3d-parle .g4d-orbit,
[data-g3d].g3d-parle .g4d-chrono {
  animation-play-state: paused;
  opacity: 0.15;
}
body.gardien-ecoute-active .gardien-presence-4d {
  opacity: 0.35;
  filter: grayscale(0.4);
  transition: opacity 0.25s;
}

/* ─── Portrait parlant (PNG détouré) ─── */
.gardien-parle-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 72%, rgba(212, 168, 83, 0.12), transparent 65%);
}
.gardien-parle-overlay.visible {
  display: grid;
  place-items: end center;
  padding-bottom: calc(100px + var(--safe-b, 0px));
  pointer-events: auto;
}
.gardien-parle-card {
  position: relative;
  width: min(220px, 52vw);
  height: min(260px, 62vw);
  animation: g4d-float 4s ease-in-out infinite;
}
.gardien-parle-img,
.gardien-parle-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.55))
          drop-shadow(0 0 28px rgba(212, 168, 83, 0.25));
}
.gardien-parle-overlay.speaking .gardien-parle-img,
.gardien-parle-overlay.speaking .gardien-parle-video {
  animation: g4d-speak 0.55s ease-in-out infinite;
}
.gardien-parle-waves {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  align-items: flex-end;
  height: 28px;
}
.gardien-parle-waves span {
  display: block;
  width: 4px;
  border-radius: 4px;
  background: var(--gold-soft);
  animation: g4d-wave 0.9s ease-in-out infinite;
}
.gardien-parle-waves span:nth-child(1) { height: 10px; animation-delay: 0s; }
.gardien-parle-waves span:nth-child(2) { height: 18px; animation-delay: 0.12s; }
.gardien-parle-waves span:nth-child(3) { height: 24px; animation-delay: 0.24s; }
.gardien-parle-waves span:nth-child(4) { height: 14px; animation-delay: 0.36s; }
@keyframes g4d-wave {
  0%, 100% { transform: scaleY(0.45); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}
.gardien-parle-label {
  text-align: center;
  font-size: 0.72rem;
  color: var(--gold-soft);
  margin-top: 8px;
  letter-spacing: 0.04em;
}
html.gardien-mac .gardien-parle-overlay.visible {
  padding-bottom: 120px;
}

/* ─── Portrait fixe (mode vocal mobile) ─── */
.gardien-dock-portrait {
  display: none;
  position: fixed;
  left: 50%;
  bottom: calc(108px + var(--safe-b, 0px));
  transform: translateX(-50%);
  z-index: 140;
  width: min(110px, 28vw);
  pointer-events: none;
  text-align: center;
}
.gardien-dock-portrait.visible {
  display: block;
}
.gardien-dock-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 20px rgba(212, 168, 83, 0.2));
  animation: g4d-float 4.5s ease-in-out infinite;
}
.gardien-dock-portrait.speaking .gardien-dock-img {
  animation: g4d-speak 0.55s ease-in-out infinite, g4d-float 4.5s ease-in-out infinite;
}
.gardien-dock-portrait.ecoute .gardien-dock-img {
  animation: ai-pulse 1.4s ease infinite, g4d-float 4.5s ease-in-out infinite;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 32px rgba(96, 165, 250, 0.35));
}
.gardien-dock-waves {
  display: none;
  justify-content: center;
  gap: 4px;
  align-items: flex-end;
  height: 22px;
  margin-top: 4px;
}
.gardien-dock-portrait.speaking .gardien-dock-waves {
  display: flex;
}
.gardien-dock-waves span {
  display: block;
  width: 3px;
  border-radius: 3px;
  background: var(--gold-soft);
  animation: g4d-wave 0.9s ease-in-out infinite;
}
.gardien-dock-waves span:nth-child(1) { height: 8px; animation-delay: 0s; }
.gardien-dock-waves span:nth-child(2) { height: 14px; animation-delay: 0.12s; }
.gardien-dock-waves span:nth-child(3) { height: 10px; animation-delay: 0.24s; }
.gardien-dock-label {
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 4px;
  letter-spacing: 0.03em;
}
body.gardien-mode-vocal .ai-thread {
  padding-bottom: calc(130px + var(--safe-b, 0px));
}
body.gardien-mode-vocal.gardien-parle-active .gardien-parle-overlay {
  display: none !important;
}
.ai-topbar-tete {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid rgba(212, 168, 83, 0.4);
  box-shadow: 0 2px 12px var(--gold-glow);
}
.ai-topbar-tete img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ai-hero h2, .g-welcome-card h2 {
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: var(--text);
}
.ai-hero p, .g-welcome-card p {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto;
}
.g-welcome-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.g-welcome-icon { display: none; }

.ai-suggestions {
  display: grid;
  gap: 8px;
  margin-top: 28px;
  text-align: left;
}
.ai-suggestion {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.ai-suggestion:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}
.ai-suggestion strong { color: var(--gold-soft); font-weight: 500; }

.g-chips, .ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
}
.g-chip, .ai-chip {
  font-size: 0.7rem;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-3);
  background: var(--surface);
}

/* ─── Input dock (ChatGPT pill) ─── */
.g-composer-wrap, .ai-dock {
  flex-shrink: 0;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, transparent, var(--bg) 24%);
}
.ai-dock-inner {
  max-width: var(--thread-w);
  margin: 0 auto;
}
.ai-dock-tools {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  justify-content: center;
}
.g-icon-btn, .ai-tool-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.95rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.g-icon-btn.on, .ai-tool-btn.on {
  color: var(--gold-soft);
  border-color: rgba(212, 168, 83, 0.35);
  background: rgba(212, 168, 83, 0.08);
}
.g-icon-btn.listening, .ai-tool-btn.listening {
  color: var(--danger) !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
  animation: ai-pulse 1s ease infinite;
}
@keyframes ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.g-composer, .ai-input-pill {
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 6px 6px 6px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 8px 24px rgba(0,0,0,0.25);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.g-composer:focus-within, .ai-input-pill:focus-within {
  border-color: rgba(212, 168, 83, 0.4);
  box-shadow: 0 0 0 1px var(--gold-glow), 0 8px 32px rgba(0,0,0,0.3);
}
.g-composer textarea, .ai-input-pill textarea, #input {
  flex: 1;
  resize: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
  min-height: 24px;
  max-height: 160px;
  padding: 10px 0;
}
.g-composer textarea:focus, .ai-input-pill textarea:focus { outline: none; }
.g-composer textarea::placeholder, #input::placeholder { color: var(--text-3); }

.g-send, .ai-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: #0c0c0e;
  background: var(--text);
  display: grid;
  place-items: center;
  transition: transform 0.15s, background 0.15s;
}
.g-send:hover, .ai-send:hover { background: var(--gold-soft); }
.g-send:active, .ai-send:active { transform: scale(0.92); }

.ai-dock-foot {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-3);
  margin-top: 10px;
}

/* ─── Pièces jointes ─── */
.ai-attachments {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-attachments.visible { display: flex; }

.ai-attach-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.75rem;
  color: var(--text-2);
  max-width: 200px;
}
.ai-attach-chip img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.ai-attach-chip .ai-attach-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ai-attach-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.ai-attach-chip button {
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px;
  line-height: 1;
}
.ai-attach-chip button:hover { color: var(--danger); }

.ai-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ai-attach-btn:hover { border-color: var(--border-strong); color: var(--text); }

.ai-turn--user .ai-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.ai-turn--user .ai-attach-preview img {
  max-width: 120px;
  max-height: 90px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.ai-turn--user .ai-attach-tag {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-3);
}

/* ─── Avatar (header legacy) ─── */
.g-avatar-wrap { position: relative; flex-shrink: 0; }
.g-avatar, .g-avatar-ph {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  object-fit: cover;
}
.g-avatar-ph {
  display: grid;
  place-items: center;
  font-size: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.g-avatar-ph.has-tete img,
.g-avatar-ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.g-avatar { border: 1px solid rgba(212, 168, 83, 0.4); }
.g-avatar-wrap.speaking .g-avatar,
.g-avatar-wrap.speaking .g-avatar-ph {
  box-shadow: 0 0 16px var(--gold-glow);
}

/* ─── Urgence ─── */
/* Alertes sécurité injectées dans la conversation */
.g-alerte-media {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.g-alerte-photo,
.g-alerte-video,
.g-alerte-clip {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  background: #000;
  border: 1px solid rgba(255, 91, 110, 0.35);
}
.g-alerte-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.g-alerte-btn {
  display: inline-block;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: #24304f;
  color: #e8ecf8 !important;
}
.g-alerte-btn.live {
  background: #b3121f;
}
.ai-turn-body.g-alerte-urgence {
  border: 1px solid rgba(255, 91, 110, 0.45);
  background: linear-gradient(180deg, #2a060c88, transparent);
}
.ai-turn-body.g-alerte-danger {
  border: 1px solid rgba(255, 209, 102, 0.4);
}

.g-urgence, #urgence {
  display: none;
  margin: 8px 16px 0;
  max-width: var(--thread-w);
  margin-left: auto;
  margin-right: auto;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 0.84rem;
  line-height: 1.5;
}
.g-urgence.visible, #urgence.visible { display: block; }

/* ─── Drawer / Sheet ─── */
.g-overlay, .ai-drawer-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.g-overlay.open, .ai-drawer-bg.open { display: flex; pointer-events: none; }
.g-overlay.open { align-items: flex-end; justify-content: center; }

.g-sheet, .ai-drawer {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--border);
}
.g-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 8px 20px calc(24px + var(--safe-b));
  animation: ai-sheet 0.35s var(--ease);
}
@keyframes ai-sheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.g-sheet-handle, .ai-drawer-handle {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-3);
  margin: 12px auto 20px;
}
.g-sheet h2, .ai-drawer h2 {
  font-size: 1rem;
  font-weight: 650;
  margin-bottom: 20px;
  color: var(--text);
}
.g-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.g-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
.g-field input:focus {
  outline: none;
  border-color: rgba(212, 168, 83, 0.4);
}
.g-field { margin-bottom: 16px; }
.g-field small { display: block; margin-top: 6px; font-size: 0.72rem; color: var(--text-3); line-height: 1.4; }
.g-sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

.g-btn, .ai-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}
.g-btn.primary, .ai-btn.primary, button.primary, .g-toolbar .primary {
  border: none;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}
.g-btn.primary:hover, button.primary:hover { background: var(--gold-soft); }
.g-hint, .ai-hint {
  margin-top: 20px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.55;
}
.g-hint strong { color: var(--gold-soft); }
.g-hint code { font-size: 0.72rem; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }

.g-setup, .ai-setup {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  gap: 20px;
}
.g-setup.visible, .ai-setup.visible { display: flex; }

/* ─── Desktop layout + sidebar ─── */
.g-layout {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  max-width: 100%;
  min-height: 0;
}
.ai-sidebar {
  display: none;
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-thread);
  border-right: 1px solid var(--border);
  padding: 12px;
  flex-direction: column;
  gap: 4px;
}
.ai-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 20px;
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.ai-sidebar-brand span { color: var(--gold-soft); }
.ai-sidebar-brand .ai-sidebar-tete,
.ai-sidebar-brand img {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: cover;
  border: 1.5px solid rgba(212, 168, 83, 0.35);
  flex-shrink: 0;
}

.ai-side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s;
}
.ai-side-item:hover { background: var(--surface-2); color: var(--text); }
.ai-side-item.on { background: rgba(212, 168, 83, 0.1); color: var(--gold-soft); }

.g-main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.g-main-grid { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.g-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
  border: none;
  padding: 0;
}
.g-panel.settings, .settings {
  display: none;
  margin: 16px;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  max-width: var(--thread-w);
}
.settings.open { display: block; }
.g-panel h2, .settings h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 16px;
}

.g-desktop-composer {
  max-width: var(--thread-w);
  margin: 0 auto 16px;
  width: calc(100% - 32px);
}

.g-portrait {
  display: none;
  margin: 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 280px;
}
.g-portrait.visible { display: block; }
.g-portrait-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.g-portrait img, .g-portrait video { width: 100%; display: block; }
.g-portrait.speaking { box-shadow: 0 0 24px var(--gold-glow); }

.g-toolbar button, .g-toolbar select {
  font-family: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.78rem;
  cursor: pointer;
}
.g-toolbar .toggle-on { color: var(--gold-soft) !important; border-color: rgba(212,168,83,0.35) !important; background: rgba(212,168,83,0.08) !important; }
.g-badge { font-size: 0.65rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); }
.g-badge.on { border-color: rgba(74,222,128,0.35); color: #86efac; }
.g-badge.off { color: var(--text-3); }
.g-mic-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 1rem;
}

@media (min-width: 900px) {
  .ai-sidebar { display: flex; }
  .g-desktop .g-header { padding-left: 16px; }
  .g-main-grid {
    flex-direction: row;
    align-items: flex-start;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 0 16px;
    gap: 20px;
  }
  .g-main-grid > .g-panel { flex: 1; }
  .g-portrait.visible { display: block; position: sticky; top: 80px; }
}

/* ─── App Mac native — layout plein écran ─── */
html.gardien-mac,
html.gardien-mac body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
html.gardien-mac body.g-desktop {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
html.gardien-mac .gardien-bg {
  position: fixed;
  inset: 0;
}
html.gardien-mac .ai-shell-desktop {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
html.gardien-mac .ai-sidebar {
  display: flex !important;
  height: 100%;
  overflow-y: auto;
  flex-shrink: 0;
}
html.gardien-mac .ai-sidebar a[href="/mobile"] {
  display: none;
}
html.gardien-mac .g-main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
html.gardien-mac .ai-topbar {
  flex-shrink: 0;
  height: var(--topbar-h);
  padding-top: 0;
  --safe-t: 0px;
}
html.gardien-mac .g-desktop-topbar .g-toolbar {
  flex-wrap: nowrap;
  flex-shrink: 0;
}
html.gardien-mac .g-desktop-topbar .g-toolbar select {
  max-width: 110px;
}
html.gardien-mac #chatPanel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
html.gardien-mac .g-main-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
}
html.gardien-mac .g-main-grid > .g-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
html.gardien-mac .g-portrait-wrap {
  display: none !important;
}
html.gardien-mac .ai-thread,
html.gardien-mac .g-chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
html.gardien-mac .ai-thread-inner {
  max-width: var(--thread-w);
  margin: 0 auto;
  width: 100%;
}
html.gardien-mac .ai-dock {
  flex-shrink: 0;
  padding-bottom: 14px;
}
html.gardien-mac .ai-dock-inner {
  max-width: var(--thread-w);
}
html.gardien-mac .settings {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 24px 32px;
  max-width: none;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--border);
  overflow-y: auto;
}
html.gardien-mac .settings.open {
  display: flex;
}
html.gardien-mac .g-evolution-panel.open {
  display: flex;
}
html.gardien-mac .g-urgence {
  flex-shrink: 0;
  margin: 8px 24px 0;
}

/* Mobile app container */
.g-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ─── Panneau Évolution ─── */
.g-evolution-panel,
.g-evol-sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.g-evolution-panel.open,
.settings.g-evolution-panel.open { display: block; }

.g-evol-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.g-evol-level {
  display: flex;
  align-items: center;
  gap: 12px;
}
.g-evol-level-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px var(--gold-glow));
}
.g-evol-level h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gold-soft);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 2px;
}
.g-evol-level-sub {
  font-size: 0.78rem;
  color: var(--text-3);
}
.g-evol-header-badges,
.g-evol-gpu-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.g-evol-header-badges { justify-content: flex-end; }
.g-evol-gpu-badges { margin: -8px 0 16px; }

.g-evol-badge {
  font-size: 0.65rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-3);
}
.g-evol-badge.on {
  border-color: rgba(212, 168, 83, 0.35);
  color: var(--gold-soft);
  background: rgba(212, 168, 83, 0.08);
}
.g-evol-badge.off { color: var(--text-3); }

.g-evol-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 560px) {
  .g-evol-grid { grid-template-columns: 1fr; }
}

.g-evol-card {
  padding: 14px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.g-evol-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.g-evol-icon { font-size: 1.1rem; }
.g-evol-card h3 {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: 600;
}
.g-evol-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.35;
}
.g-evol-sub {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-bottom: 10px;
  line-height: 1.4;
}
.g-evol-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.g-evol-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-soft));
  transition: width 0.4s var(--ease);
}
.g-evol-bar-label {
  font-size: 0.65rem;
  color: var(--text-3);
  margin-top: 6px;
}
.g-evol-desc {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.g-evol-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.g-evol-error {
  color: var(--danger);
  font-size: 0.85rem;
  padding: 16px 0;
}
.g-evolution-panel.loading { opacity: 0.65; pointer-events: none; }

.g-evol-sheet {
  max-height: min(88vh, 720px);
  overflow-y: auto;
}
.g-evol-sheet .g-evol-header { margin-top: 4px; }

/* ─── Historique conversations ─── */
.g-historique-panel { overflow-y: auto; }
.g-historique-panel.open { display: block; }

.g-hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.g-hist-header h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin: 0;
}
.g-hist-stats {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-bottom: 14px;
}
.g-hist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.g-hist-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}
.g-hist-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.g-hist-item.active {
  border-color: rgba(212, 168, 83, 0.4);
  background: rgba(212, 168, 83, 0.08);
}
.g-hist-item-date {
  display: block;
  font-size: 0.68rem;
  color: var(--gold-soft);
  margin-bottom: 4px;
}
.g-hist-item-preview {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-hist-item-meta {
  display: block;
  font-size: 0.65rem;
  color: var(--text-3);
  margin-top: 4px;
}
.g-hist-empty {
  font-size: 0.85rem;
  color: var(--text-3);
  padding: 20px 0;
}
.g-hist-sheet { max-height: min(80vh, 600px); overflow-y: auto; }

/* ─── Vision live Sony / GoPro ─── */
.g-vision-header h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.g-vision-header p { margin: 0; color: var(--text-3); font-size: 0.85rem; max-width: 52rem; }
.g-vision-layout {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
@media (min-width: 900px) {
  .g-vision-layout { grid-template-columns: 1.4fr 1fr; align-items: start; }
}
.g-vision-preview {
  position: relative;
  background: #0a0c10;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  min-height: 220px;
  aspect-ratio: 16 / 10;
}
.g-vision-preview video {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 10px;
  background: #0a0a0c;
  display: block;
}
.g-vision-preview video.hidden { display: none; }
.g-vision-veille {
  margin-top: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-2);
}
.g-vision-veille.present {
  border-color: rgba(72, 187, 120, 0.35);
  color: #9ae6b4;
}
.g-vision-veille.depart {
  border-color: rgba(212, 168, 83, 0.45);
  color: #f6e05e;
  background: rgba(212, 168, 83, 0.08);
}
.g-vision-veille.arrivee,
.g-vision-veille.expression {
  border-color: rgba(99, 179, 237, 0.35);
  color: #90cdf4;
}
.g-vision-hint {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--text-3);
  line-height: 1.4;
}
.g-vision-voix-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.g-vision-mic.on,
.g-vision-speaker.on {
  border-color: rgba(212, 168, 83, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 168, 83, 0.25);
}
.g-vision-mic.on {
  animation: g-vision-pulse 1.2s ease-in-out infinite;
}
@keyframes g-vision-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}
.g-vision-voix-status {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--text-3);
  min-height: 1.2em;
}
.g-vision-voix-status.ecoute { color: #90cdf4; }
.g-vision-voix-status.parle { color: #f6e05e; }
.g-vision-voix-status.erreur { color: #fc8181; }
.g-vision-voix-status.pret { color: #9ae6b4; }
.g-vision-transcript {
  margin-top: 0.5rem;
  max-height: 120px;
  overflow-y: auto;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.74rem;
  line-height: 1.45;
}
.g-vision-t-user { margin: 0 0 0.35rem; color: var(--text-2); }
.g-vision-t-bot { margin: 0 0 0.35rem; color: rgba(212, 168, 83, 0.9); }
.g-vision-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.g-vision-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
}
.g-vision-ph.hidden { display: none; }
.g-vision-expr {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #e8d5a8;
  font-size: 0.75rem;
  pointer-events: none;
}
.g-vision-block {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 0.75rem;
  background: var(--surface);
}
.g-vision-block h3 {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.g-vision-presets { display: grid; gap: 0.5rem; }
.g-vision-preset {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.g-vision-preset strong { display: block; font-size: 0.85rem; margin-bottom: 4px; }
.g-vision-preset span { display: block; font-size: 0.72rem; color: var(--text-3); line-height: 1.35; }
.g-vision-preset:hover { border-color: rgba(212, 168, 83, 0.35); }
.g-vision-list { display: grid; gap: 0.5rem; }
.g-vision-cam {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg);
}
.g-vision-cam.off { opacity: 0.55; }
.g-vision-cam-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}
.g-vision-cam-type {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-3);
}
.g-vision-cam-src {
  font-size: 0.7rem;
  color: var(--text-3);
  margin: 6px 0;
  word-break: break-all;
}
.g-vision-cam-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.g-vision-cam-actions button {
  font-family: inherit;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.g-vision-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.g-vision-status {
  font-size: 0.75rem;
  color: var(--text-3);
  margin: 0.5rem 0 0;
  min-height: 1.2em;
}
.g-vision-empty { font-size: 0.8rem; color: var(--text-3); margin: 0; }
.g-vision-panel.open { display: block; }