/* =============================================================================
   EMDR AI — Therapist Console
   Estetica: NeuroFlow · dark glassmorphism · neon accents · clinical premium
   ============================================================================= */

:root {
  /* Palette deep space */
  --bg-1: #060D1A;
  --bg-2: #0B1C3D;
  --bg-3: #0F2347;

  /* Glass surfaces */
  --glass-bg: rgba(11, 28, 61, 0.6);
  --glass-bg-strong: rgba(11, 28, 61, 0.8);
  --glass-border: rgba(201, 168, 76, 0.2);
  --glass-border-strong: rgba(201, 168, 76, 0.35);

  /* Accents neon */
  --cyan: #C9A84C;
  --cyan-soft: rgba(201, 168, 76, 0.18);
  --magenta: #C9A84C;
  --magenta-soft: rgba(201, 168, 76, 0.12);
  --lime: #7DFFB1;
  --lime-soft: rgba(125, 255, 177, 0.18);
  --gold: #C9A84C;
  --gold-soft: rgba(201, 168, 76, 0.15);
  --violet: #5B8DB8;
  --violet-soft: rgba(91, 141, 184, 0.18);

  /* Status */
  --ok: #4ADE80;
  --warn: #FBBF24;
  --risk: #F87171;

  /* Text */
  --text: #F0F4FF;
  --text-soft: rgba(240, 244, 255, 0.7);
  --text-faint: rgba(240, 244, 255, 0.4);

  /* Layout */
  --sidebar-w: 260px;

  /* Fonts */
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radii */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-1);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==================== AMBIENT BACKGROUND ==================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(184, 136, 255, 0.4), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(0, 217, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(255, 77, 203, 0.15), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--violet), transparent);
  top: -100px; left: -100px;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--cyan), transparent);
  bottom: -100px; right: 10%;
  animation-delay: -5s;
}
.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, var(--magenta), transparent);
  top: 40%; right: -100px;
  animation-delay: -10s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(10, 15, 46, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: var(--s-5) 0;
  z-index: 50;
}

.sb-logo {
  padding: 0 var(--s-5) var(--s-5);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
}

.logo-mark {
  width: 60px;
  height: 30px;
  margin-bottom: var(--s-1);
}

.infinity-svg {
  width: 100%;
  height: 100%;
  animation: infinityPulse 4s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(0, 217, 255, 0.4));
}

@keyframes infinityPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 217, 255, 0.4)); }
  50% { filter: drop-shadow(0 0 16px rgba(255, 77, 203, 0.6)); }
}

.sb-logo h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.logo-ai {
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}

.logo-tagline {
  font-size: 0.65rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

/* SB SESSION INFO */
.sb-session-info {
  margin: var(--s-4) var(--s-4);
  padding: var(--s-3);
  background: linear-gradient(135deg, var(--cyan-soft), transparent);
  border: 1px solid rgba(0, 217, 255, 0.25);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.sb-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.sb-info-label {
  color: var(--text-faint);
  font-weight: 500;
}

.sb-info-value {
  color: var(--text);
  font-weight: 600;
}

.sb-code-mono {
  font-family: var(--font-mono);
  color: var(--cyan);
  letter-spacing: 0.1em;
}

/* SB NAV */
.sb-nav {
  flex: 1;
  padding: var(--s-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.sb-nav-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0 var(--s-5) var(--s-3);
}

.sb-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-soft);
  cursor: default;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.sb-item.active {
  color: var(--cyan);
  border-left-color: var(--cyan);
  background: rgba(0, 217, 255, 0.08);
  font-weight: 500;
}

.sb-item.completed {
  color: var(--ok);
}

.sb-item.completed .sb-dot {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

.sb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  transition: all 0.2s;
}

.sb-item.active .sb-dot {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

/* SB STATUS CARD */
.sb-status-card {
  margin: var(--s-4);
  padding: var(--s-3);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.sb-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: statusPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.sb-status-text { display: flex; flex-direction: column; }
.sb-status-title { font-size: 0.72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.sb-status-sub { font-size: 0.85rem; color: var(--text); font-weight: 500; }

/* ==================== MAIN ==================== */
.main-content {
  margin-left: var(--sidebar-w);
  padding: var(--s-5) var(--s-6) var(--s-7);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-3) 0 var(--s-5);
  margin-bottom: var(--s-5);
  border-bottom: 1px solid var(--glass-border);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.topbar-sub {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-top: var(--s-1);
  font-style: italic;
}

.topbar-time {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--cyan);
  letter-spacing: 0.05em;
}

/* ==================== PHASE ==================== */
.phase {
  display: none;
  flex-direction: column;
  gap: var(--s-4);
  animation: phaseEnter 0.5s ease-out;
}

.phase--active { display: flex; }

.phase--centered {
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}

@keyframes phaseEnter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== CARDS (GLASSMORPHISM) ==================== */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  position: relative;
  overflow: hidden;
}

.glass {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--s-1);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.title-accent {
  width: 3px;
  height: 18px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  border-radius: 2px;
  display: inline-block;
}

.title-accent--warm {
  background: linear-gradient(180deg, var(--gold), var(--magenta));
}

.card-sub {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: var(--s-4);
  font-style: italic;
}

.card-header {
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--glass-border);
}

/* ==================== INPUT / TEXTAREA ==================== */
.input-glass,
.textarea-glass,
.select-glass {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.input-glass::placeholder,
.textarea-glass::placeholder { color: var(--text-faint); }

.input-glass:focus,
.textarea-glass:focus,
.select-glass:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}

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

select.select-glass {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff80' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

select.select-glass option {
  background: var(--bg-2);
  color: var(--text);
}

/* ==================== DIMENSION GRID ==================== */
.dimension-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}

.dim-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  cursor: pointer;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  position: relative;
  overflow: hidden;
}

.dim-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(0, 217, 255, 0.1));
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.dim-card:hover { border-color: var(--glass-border-strong); transform: translateY(-2px); }
.dim-card:hover::after { opacity: 1; }

.dim-card.active {
  border-color: var(--cyan);
  background: linear-gradient(135deg, var(--cyan-soft), transparent);
  box-shadow: 0 0 24px var(--cyan-soft);
}

.dim-card.active::after { opacity: 1; }

.dim-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-1);
}

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

.dim-icon--past { background: var(--violet-soft); color: var(--violet); }
.dim-icon--present { background: var(--cyan-soft); color: var(--cyan); }
.dim-icon--future { background: var(--lime-soft); color: var(--lime); }

.dim-card h4 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.dim-tagline {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
  font-weight: 600;
}

.dim-detail {
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ==================== ASSESSMENT ==================== */
.assessment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4);
}

.assessment-grid .field--full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: var(--s-2); }

.field label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-style: italic;
}

.field input[type="range"] { accent-color: var(--cyan); }

.assessment-warning {
  background: rgba(251, 191, 36, 0.1);
  border-left: 3px solid var(--warn);
  padding: var(--s-3) var(--s-4);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: var(--s-4);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-md);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: var(--bg-1);
  font-weight: 700;
  box-shadow: 0 4px 16px var(--cyan-soft);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--cyan-soft), 0 0 24px var(--violet-soft);
}

.btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--glass-bg);
  color: var(--text-faint);
  box-shadow: none;
}

.btn--secondary {
  background: var(--glass-bg-strong);
  color: var(--text);
  border-color: var(--glass-border);
}

.btn--secondary:hover { border-color: var(--cyan); color: var(--cyan); }

.btn--large { padding: var(--s-4) var(--s-6); font-size: 1rem; }

.btn--save {
  width: 100%;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  color: var(--bg-1);
  font-weight: 700;
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-md);
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn--save:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--lime-soft); }

.btn-icon {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  padding: var(--s-2);
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  transition: all 0.2s;
}

.btn-icon:hover { color: var(--cyan); border-color: var(--cyan); }

.btn-bls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-4);
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-bls--start {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: var(--bg-1);
  box-shadow: 0 4px 16px var(--cyan-soft);
}

.btn-bls--start:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--cyan-soft), 0 0 24px var(--violet-soft);
}

.btn-bls--stop {
  background: linear-gradient(135deg, #FBBF24, #F87171);
  color: var(--bg-1);
}

.btn-risk {
  width: 100%;
  margin-top: var(--s-3);
  padding: var(--s-3);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid var(--risk);
  border-radius: var(--r-md);
  color: var(--risk);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  transition: all 0.2s;
}

.btn-risk:hover { background: var(--risk); color: var(--bg-1); }

/* ==================== ACTION ROW ==================== */
.action-row {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--glass-border);
}

.action-row--center { justify-content: center; }

/* ==================== GRIDS ==================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }

.grid-processing {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: var(--s-4);
}

/* ==================== KPI CARDS ==================== */
.kpi-card {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon--cyan { background: var(--cyan-soft); color: var(--cyan); box-shadow: 0 0 16px var(--cyan-soft); }
.kpi-icon--magenta { background: var(--magenta-soft); color: var(--magenta); box-shadow: 0 0 16px var(--magenta-soft); }
.kpi-icon--lime { background: var(--lime-soft); color: var(--lime); box-shadow: 0 0 16px var(--lime-soft); }

.kpi-body { flex: 1; }
.kpi-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); font-weight: 600; }
.kpi-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; margin-top: var(--s-1); }
.kpi-trend { font-size: 0.78rem; color: var(--text-soft); margin-top: var(--s-1); }
.kpi-trend.up { color: var(--lime); }
.kpi-trend.down { color: var(--ok); }
.kpi-trend.warn { color: var(--warn); }

/* ==================== SEGMENTED CONTROL ==================== */
.control-block { margin-bottom: var(--s-4); }

.control-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: var(--s-2);
}

.seg-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 4px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: var(--s-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.seg-btn:hover { color: var(--text); }

.seg-btn--active {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: var(--bg-1);
  box-shadow: 0 2px 8px var(--cyan-soft);
}

/* ==================== TOGGLE SWITCH ==================== */
.toggle-group { display: flex; flex-direction: column; gap: var(--s-2); }

.tog-switch {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  cursor: pointer;
  padding: var(--s-2);
}

.tog-switch input { display: none; }

.tog-slider {
  width: 36px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tog-slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: var(--text);
  border-radius: 50%;
  transition: all 0.2s;
}

.tog-switch input:checked + .tog-slider {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-soft);
}

.tog-switch input:checked + .tog-slider::after { transform: translateX(16px); }

.tog-label { font-size: 0.85rem; color: var(--text); font-weight: 500; }

/* ==================== BLS ACTION ==================== */
.bls-action { margin-top: var(--s-2); }

/* ==================== CHARTS ==================== */
.card--charts {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.chart-wrap { background: rgba(0, 0, 0, 0.2); border-radius: var(--r-md); padding: var(--s-3); }
.chart-label { font-size: 0.75rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-bottom: var(--s-2); }
.chart-wrap canvas { max-height: 140px; }

/* ==================== AI ASSISTANT ==================== */
.ai-column { display: flex; flex-direction: column; gap: var(--s-4); }

.card--ai {
  background: linear-gradient(135deg, rgba(184, 136, 255, 0.08), rgba(0, 217, 255, 0.04));
  border: 1px solid rgba(184, 136, 255, 0.25);
}

.ai-header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--glass-border);
}

.ai-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-1);
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--violet-soft);
}

.ai-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--text); }
.ai-sub { font-size: 0.75rem; color: var(--text-faint); margin-top: 2px; }

.ai-suggestions { display: flex; flex-direction: column; gap: var(--s-2); }

.ai-suggestion {
  padding: var(--s-3);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  line-height: 1.5;
  border-left: 2px solid;
  animation: aiSlide 0.4s ease-out;
}

@keyframes aiSlide {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.ai-suggestion p { color: var(--text-soft); }

.ai-suggestion--neutral { background: rgba(255,255,255,0.04); border-left-color: var(--violet); }
.ai-suggestion--positive { background: var(--lime-soft); border-left-color: var(--lime); }
.ai-suggestion--positive p { color: var(--lime); }
.ai-suggestion--warn { background: rgba(251, 191, 36, 0.1); border-left-color: var(--warn); }
.ai-suggestion--warn p { color: var(--warn); }
.ai-suggestion--info { background: var(--cyan-soft); border-left-color: var(--cyan); }
.ai-suggestion--info p { color: var(--cyan); }

/* ==================== POST SET FORM ==================== */
.rating-block { margin-bottom: var(--s-4); }

.rating-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: var(--s-2);
}

.rating-controls {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.rating-controls--big { padding: var(--s-3) 0; }

.range-glass {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  appearance: none;
  cursor: pointer;
}

.range-glass::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 12px var(--cyan-soft);
}

.range-glass::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 12px var(--cyan-soft);
}

.rating-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cyan);
  min-width: 40px;
  text-align: center;
}

.rating-value--big {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==================== SHARE ==================== */
.card--feature {
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(184, 136, 255, 0.08));
  border: 1px solid rgba(0, 217, 255, 0.3);
  text-align: center;
  padding: var(--s-7) var(--s-5);
}

.feature-label {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--s-3);
  font-weight: 600;
}

.session-code-big {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, var(--cyan), var(--lime));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.feature-validity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  margin-top: var(--s-4);
  font-size: 0.85rem;
  color: var(--text-soft);
  font-style: italic;
}

.dot-validity {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: statusPulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--ok);
}

.link-box {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: var(--s-3);
}

.link-box code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.big-code {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
  padding: var(--s-3);
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--cyan);
  border-radius: var(--r-md);
  color: var(--cyan);
  box-shadow: inset 0 0 24px rgba(0, 217, 255, 0.15);
}

.card--presence {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4);
}

.presence-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  animation: statusPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.card--presence.connected .presence-pulse {
  background: var(--lime);
  box-shadow: 0 0 16px var(--lime);
  animation: none;
}

.presence-content { flex: 1; }
.presence-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--text); }
.presence-sub { font-size: 0.8rem; color: var(--text-soft); margin-top: 2px; }

/* ==================== RADIO CARDS ==================== */
.radio-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-2);
}

.radio-card {
  cursor: pointer;
  position: relative;
}

.radio-card input { position: absolute; opacity: 0; }

.radio-card-label {
  display: block;
  text-align: center;
  padding: var(--s-3);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: all 0.2s;
}

.radio-card input:checked + .radio-card-label {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-soft);
}

/* ==================== COMPLETION ==================== */
.completion-card {
  max-width: 600px;
  text-align: center;
  padding: var(--s-7) var(--s-6);
}

.completion-mark {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-1);
  margin: 0 auto var(--s-5);
  box-shadow: 0 8px 32px var(--lime-soft);
}

.completion-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--s-2);
}

.completion-sub { color: var(--text-soft); margin-bottom: var(--s-5); font-style: italic; }

.completion-summary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  margin-bottom: var(--s-5);
  text-align: left;
}

.completion-summary p {
  margin-bottom: var(--s-2);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.completion-summary strong { color: var(--text); }

/* ==================== TOAST ==================== */
.toast-container {
  position: fixed;
  bottom: var(--s-5);
  right: var(--s-5);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.toast {
  background: rgba(10, 15, 46, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  animation: toastIn 0.4s ease-out;
  max-width: 320px;
}

.toast--success { border-left: 3px solid var(--lime); }
.toast--warn { border-left: 3px solid var(--warn); }
.toast--risk { border-left: 3px solid var(--risk); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1280px) {
  .grid-processing { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .dimension-grid { grid-template-columns: 1fr; }
}
