:root {
  --bg:              #07090f;
  --bg-elevated:     #0d1117;
  --card:            #0f1623;
  --card-hover:      #151e2e;
  --text:            #e2e8f4;
  --text-secondary:  #94a3b8;
  --muted:           #4e6080;
  --border:          rgba(99, 130, 180, 0.12);
  --border-light:    rgba(99, 130, 180, 0.06);
  --border-hover:    rgba(99, 130, 180, 0.28);
  --accent:          #5b9ef9;
  --accent-hover:    #3b82f6;
  --accent-glow:     rgba(91, 158, 249, 0.18);
  --accent-subtle:   rgba(91, 158, 249, 0.08);
  --ok:              #34d399;
  --ok-glow:         rgba(52, 211, 153, 0.15);
  --ok-subtle:       rgba(52, 211, 153, 0.08);
  --danger:          #f87171;
  --danger-hover:    #ef4444;
  --danger-subtle:   rgba(248, 113, 113, 0.08);
  --warning:         #fbbf24;
  --warning-subtle:  rgba(251, 191, 36, 0.08);
  --purple:          #a78bfa;
  --purple-subtle:   rgba(167, 139, 250, 0.08);
  --cyan:            #22d3ee;
  --pink:            #f472b6;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 999px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s ease;
  --shadow-card:  0 1px 3px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.25);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.55), 0 0 0 1px rgba(91,158,249,0.1);
}

/* ─── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(91,158,249,0.055) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 90%, rgba(167,139,250,0.045) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(34,211,238,0.025) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: ambientShift 14s ease-in-out infinite alternate;
}
@keyframes ambientShift {
  0%   { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.06); }
}
.container { position: relative; z-index: 1; }

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,130,180,0.18); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(91,158,249,0.4); }

/* ─── Typography ────────────────────────────────────────────────────────────── */
a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.3; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--cyan);
}
ul { margin: 0; padding-left: 18px; }
li { margin: 6px 0; }

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}
.grid { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); }
@media (min-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid--wide { grid-template-columns: 1.25fr 0.75fr; }
}
.row { display: flex; gap: var(--space-md); align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }
.row--tight { gap: var(--space-sm); }

/* ─── Header ────────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
  padding: 14px var(--space-xl);
  background: rgba(13, 17, 23, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,0.04);
  position: sticky;
  top: 12px;
  z-index: 100;
}
.header__info { display: flex; flex-direction: column; gap: 2px; }
.header__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #e2e8f4 0%, var(--accent) 60%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header__subtitle {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.user-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 5px 13px;
  background: var(--accent-subtle);
  border: 1px solid rgba(91,158,249,0.2);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* ─── Nav ───────────────────────────────────────────────────────────────────── */
.nav { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.nav__link:hover {
  background: var(--accent-subtle);
  border-color: rgba(91,158,249,0.18);
  color: var(--text);
  text-decoration: none;
}
.nav__link--active {
  background: var(--accent-subtle);
  border-color: rgba(91,158,249,0.35);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(91,158,249,0.1);
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91,158,249,0.35), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card:hover::before { opacity: 1; }
.card__title { margin: 0 0 var(--space-md); font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: var(--space-sm); }
.card__subtitle { font-size: 12px; color: var(--muted); margin-bottom: var(--space-md); }

/* ─── Forms ─────────────────────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(7, 9, 15, 0.7);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
}
input:hover, select:hover { border-color: var(--border-hover); }
input:focus, select:focus, textarea:focus {
  border-color: rgba(91,158,249,0.5);
  background: rgba(7, 9, 15, 0.95);
  box-shadow: 0 0 0 3px rgba(91,158,249,0.08);
}
input::placeholder { color: var(--muted); opacity: 0.7; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235b9ef9' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  background: rgba(7, 9, 15, 0.7);
}
textarea:focus { outline: none; border-color: rgba(91,158,249,0.5); box-shadow: 0 0 0 3px rgba(91,158,249,0.08); }
.form-group { display: flex; flex-direction: column; gap: var(--space-xs); }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text-secondary); text-transform: none; letter-spacing: 0; }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
}
button::after, .btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
button:hover, .btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(91,158,249,0.4); }
button:hover::after, .btn:hover::after { opacity: 1; }
button:active, .btn:active { transform: translateY(0); box-shadow: none; }
button:disabled, .btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--secondary {
  background: rgba(148,163,184,0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn--secondary:hover { background: rgba(148,163,184,0.14); border-color: var(--border-hover); color: var(--text); box-shadow: none; transform: translateY(-1px); }

.btn--danger {
  background: rgba(248,113,113,0.1);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.25);
  box-shadow: none;
}
.btn--danger:hover { background: rgba(248,113,113,0.18); border-color: rgba(248,113,113,0.45); box-shadow: 0 4px 12px rgba(248,113,113,0.2); }

.btn--small  { padding: 5px 10px; font-size: 11px; border-radius: var(--radius-sm); }
.btn--icon   { padding: 8px; border-radius: var(--radius-sm); }
.btn--outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); box-shadow: none; }
.btn--outline:hover { background: var(--card-hover); border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn--primary { background: linear-gradient(135deg, var(--accent), #3b82f6); color: #fff; }
.btn--primary:hover { box-shadow: 0 4px 16px rgba(91,158,249,0.4); }

.btn-generate {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(102,126,234,0.45); }
.btn-generate:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-approve {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #071023;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast);
}
.btn-approve:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(52,211,153,0.45); }

.btn-reject {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast);
}
.btn-reject:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(248,113,113,0.45); }

/* ─── Stats Grid ────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-md); }
.stat-card {
  background: var(--accent-subtle);
  border: 1px solid rgba(91,158,249,0.15);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: all var(--transition-fast);
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(91,158,249,0.3); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.stat-card__value { font-size: 26px; font-weight: 800; color: var(--accent); line-height: 1.2; }
.stat-card__label { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.stat-card--success { background: var(--ok-subtle); border-color: rgba(52,211,153,0.2); }
.stat-card--success .stat-card__value { color: var(--ok); }
.stat-card--warning { background: var(--warning-subtle); border-color: rgba(251,191,36,0.2); }
.stat-card--warning .stat-card__value { color: var(--warning); }
.stat-card--accent  { background: var(--accent-subtle); border-color: rgba(91,158,249,0.2); }
.stat-card--accent .stat-card__value { color: var(--accent); }
.stat-card--positive{ background: var(--ok-subtle); border-color: rgba(52,211,153,0.3); }
.stat-card--neutral { background: rgba(148,163,184,0.06); border-color: rgba(148,163,184,0.3); }
.stat-card--negative{ background: var(--danger-subtle); border-color: rgba(248,113,113,0.3); }

.stats-grid--4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); margin-bottom: var(--space-lg); }
@media (max-width: 768px) { .stats-grid--4 { grid-template-columns: repeat(2, 1fr); } }

/* ─── Stat Boxes ────────────────────────────────────────────────────────────── */
.stat-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: all var(--transition-fast);
}
.stat-box:hover { border-color: rgba(91,158,249,0.3); transform: translateY(-2px); }
.stat-box__value { font-size: 24px; font-weight: 800; color: var(--accent); line-height: 1.2; }
.stat-box__label { font-size: 11px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.stat-box-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-md); margin: var(--space-md) 0; }

/* ─── Output / Pre ──────────────────────────────────────────────────────────── */
pre, .output {
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0,0,0,0.35);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  margin: 0;
  overflow: auto;
  max-height: 300px;
  color: var(--cyan);
}
.raw-json {
  background: rgba(0,0,0,0.4);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-size: 11px;
  max-height: 400px;
  overflow: auto;
  margin-top: var(--space-md);
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--cyan);
  font-family: var(--font-mono);
  border: 1px solid var(--border);
}

/* ─── Chart ─────────────────────────────────────────────────────────────────── */
.chart-container {
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  position: relative;
  min-height: 400px;
}
.chart-container canvas { display: block; min-width: 900px; }
.chart-output { margin-top: var(--space-lg); padding: var(--space-md); background: var(--bg); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 12px; overflow-x: auto; max-height: 300px; overflow-y: auto; }
#chartContainer { position: relative; height: 420px; width: 100%; background: var(--bg-elevated); border-radius: var(--radius-md); padding: var(--space-md); overflow-x: auto; overflow-y: hidden; }
#monthChart { display: block; height: 100% !important; width: auto !important; min-width: 900px; }

/* ─── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: var(--space-md); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px var(--space-md); border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; background: rgba(7,9,15,0.5); }
td { font-size: 13px; transition: background var(--transition-fast); }
tr:hover td { background: rgba(91,158,249,0.04); }

.channels-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.channels-table th, .channels-table td { padding: var(--space-sm) var(--space-md); text-align: left; border-bottom: 1px solid var(--border); }
.channels-table th { font-weight: 700; color: var(--muted); white-space: nowrap; background: rgba(7,9,15,0.5); }
.channels-table tr:hover { background: rgba(91,158,249,0.04); }
.channels-table-wrapper { overflow-x: auto; }
.row--active { background: rgba(52,211,153,0.04); }
.row--active td:first-child { border-left: 2px solid var(--ok); }

/* ─── Progress ──────────────────────────────────────────────────────────────── */
.progress { height: 6px; border-radius: 3px; background: rgba(148,163,184,0.1); overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--purple)); transition: width var(--transition-normal); border-radius: 3px; }

.progress-bar { height: 8px; background: rgba(148,163,184,0.1); border-radius: var(--radius-full); overflow: hidden; margin-bottom: var(--space-sm); }
.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: var(--radius-full);
  transition: width 0.3s ease-out;
  position: relative;
}
.progress-bar__fill::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(91,158,249,0.8);
  opacity: 0.7;
}
.progress-bar__fill--animated { background: linear-gradient(90deg, var(--accent), var(--purple), var(--accent)); background-size: 200% 100%; animation: progressShimmer 2s linear infinite; }
.progress-bar__fill--complete  { background: linear-gradient(90deg, var(--ok), #10b981); }
@keyframes progressShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.progress-container { padding: var(--space-md); background: var(--bg-elevated); border-radius: var(--radius-md); border: 1px solid var(--border); }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-md); }
.progress-status { font-size: 14px; font-weight: 500; }
.progress-time, .progress-eta { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.progress-info { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.progress-steps { display: flex; justify-content: space-between; gap: var(--space-md); }
.progress-step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; opacity: 0.35; transition: opacity var(--transition-fast); }
.progress-step--active { opacity: 1; }
.progress-step--done   { opacity: 0.65; }
.progress-step--done .progress-step__icon::after { content: 'v'; position: absolute; bottom: -2px; right: -2px; font-size: 10px; color: var(--ok); }
.progress-step__icon { position: relative; font-size: 20px; margin-bottom: var(--space-xs); }
.progress-step__text { font-size: 11px; color: var(--muted); }
.progress-bar-container { width: 100%; height: 8px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; margin-top: 8px; }
.progress-bar-container .progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--purple)); border-radius: var(--radius-full); transition: width 0.4s ease; margin-bottom: 0; }

/* ─── Badges / Pills ────────────────────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 9px; border-radius: var(--radius-full); background: rgba(148,163,184,0.1); color: var(--muted); font-weight: 600; letter-spacing: 0.3px; }
.pill--ok      { background: var(--ok-subtle);      color: var(--ok);      border: 1px solid rgba(52,211,153,0.2); }
.pill--danger  { background: var(--danger-subtle);  color: var(--danger);  border: 1px solid rgba(248,113,113,0.2); }
.pill--accent  { background: var(--accent-subtle);  color: var(--accent);  border: 1px solid rgba(91,158,249,0.2); }
.pill--info    { background: rgba(59,130,246,0.1);  color: #60a5fa;        border: 1px solid rgba(59,130,246,0.2); }
.pill--warning { background: var(--warning-subtle); color: var(--warning); border: 1px solid rgba(251,191,36,0.2); }
.pill--muted   { background: var(--border); color: var(--muted); }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }
.badge--ok     { background: var(--ok-subtle);  color: var(--ok); }
.badge--muted  { background: var(--border);      color: var(--muted); }
.badge--active { background: var(--ok-subtle);  color: var(--ok); border: 1px solid rgba(52,211,153,0.25); }

/* ─── Colors ────────────────────────────────────────────────────────────────── */
.text-muted     { color: var(--muted) !important; }
.text-ok        { color: var(--ok) !important; }
.text-danger    { color: var(--danger) !important; }
.text-accent    { color: var(--accent) !important; }
.text-warning   { color: var(--warning) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success   { color: var(--ok) !important; }
.text-center    { text-align: center; }

/* ─── Utility ───────────────────────────────────────────────────────────────── */
.mt-0  { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.flex  { display: flex; }
.flex-wrap  { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex-0    { flex: 0 0 auto; }
.flex-1    { flex: 1; }
.flex-2    { flex: 2; }
.min-w-120 { min-width: 120px; }
.min-w-160 { min-width: 160px; }
.min-w-200 { min-width: 200px; }
.min-w-260 { min-width: 260px; }
.text-sm   { font-size: 12px; }
.text-xs   { font-size: 11px; }
.font-mono { font-family: var(--font-mono); }
.hidden    { display: none !important; }

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes fadeIn{ from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.animate-spin    { animation: spin   1s linear infinite; }
.animate-pulse   { animation: pulse  2s ease-in-out infinite; }
.animate-fade-in { animation: fadeIn 0.35s ease; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.75s linear infinite; }

/* ─── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: 13px 18px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: 360px;
}
.toast--visible { transform: translateY(0); opacity: 1; }
.toast--ok      { border-color: rgba(52,211,153,0.4); }
.toast--danger  { border-color: rgba(248,113,113,0.4); }

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); }
.modal__content { position: relative; background: var(--card); border-radius: var(--radius-xl); padding: var(--space-xl); min-width: 400px; max-width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px var(--border); animation: fadeIn 0.25s ease; }
.modal__title   { font-size: 18px; font-weight: 700; margin-bottom: var(--space-lg); }
.modal__actions { display: flex; gap: var(--space-md); justify-content: flex-end; }
.modal-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1100; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); }
.modal-card { animation: fadeIn 0.25s ease; }

/* ─── Switch ────────────────────────────────────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider { position: absolute; cursor: pointer; inset: 0; background-color: rgba(148,163,184,0.15); transition: var(--transition-fast); border-radius: var(--radius-full); border: 1px solid var(--border); }
.switch__slider::before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: var(--text-secondary); transition: var(--transition-normal); border-radius: 50%; }
.switch input:checked + .switch__slider { background-color: rgba(52,211,153,0.2); border-color: rgba(52,211,153,0.4); }
.switch input:checked + .switch__slider::before { transform: translateX(22px); background-color: var(--ok); box-shadow: 0 0 8px rgba(52,211,153,0.6); }

/* ─── Checkbox ──────────────────────────────────────────────────────────────── */
.checkbox-label { display: flex; align-items: center; gap: var(--space-sm); cursor: pointer; font-size: 13px; color: var(--text-secondary); padding: var(--space-sm) 0; transition: color var(--transition-fast); }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.checkbox-label:hover { color: var(--text); }

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.footer { display: flex; justify-content: space-between; align-items: center; padding: var(--space-lg) 0; margin-top: var(--space-xl); border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); flex-wrap: wrap; gap: var(--space-md); }
.footer__time { font-family: var(--font-mono); }
.footer__info strong { color: var(--accent); }

/* ─── Active Sheet ──────────────────────────────────────────────────────────── */
.active-sheet-indicator { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); background: var(--purple-subtle); border-radius: var(--radius-lg); margin-bottom: var(--space-lg); border: 1px solid rgba(167,139,250,0.2); }
.active-sheet-indicator__icon { font-size: 20px; }
.active-sheet-indicator__text { flex: 1; }
.active-sheet-indicator__name { font-weight: 700; color: var(--text); }
.active-sheet-indicator__url  { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; }

/* ─── Auto-Update ───────────────────────────────────────────────────────────── */
.auto-update-stats { display: flex; gap: 12px; padding: 8px 14px; background: var(--bg-elevated); border-radius: var(--radius-md); border: 1px solid var(--border); }
.auto-update-stats .stat-item { font-size: 12px; color: var(--muted); }
.auto-update-stats .stat-item span { font-weight: 700; color: var(--accent); }

.platform-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.platform-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; background: var(--bg-elevated); border: 1px solid var(--border); }
.platform-badge span { font-weight: 700; }
.platform-badge--tiktok    { border-color: rgba(255,0,80,0.3);   color: #ff4d7d; background: rgba(255,0,80,0.07); }
.platform-badge--youtube   { border-color: rgba(255,0,0,0.3);    color: #ff5555; background: rgba(255,0,0,0.07); }
.platform-badge--instagram { border-color: rgba(225,48,108,0.3); color: #f06292; background: rgba(225,48,108,0.07); }
.platform-badge--facebook  { border-color: rgba(24,119,242,0.3); color: #5b9ef9; background: rgba(24,119,242,0.07); }

.auto-update-history { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 150px; overflow-y: auto; }
.history-header { padding: 8px 12px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-elevated); }
.history-list { padding: 4px; }
.history-empty { padding: 12px; text-align: center; font-size: 12px; color: var(--muted); }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; font-size: 12px; border-radius: 5px; transition: background var(--transition-fast); }
.history-item:hover { background: rgba(255,255,255,0.04); }
.history-item--success { border-left: 2px solid var(--ok);      padding-left: 8px; }
.history-item--empty   { border-left: 2px solid var(--warning); padding-left: 8px; }
.history-item--error   { border-left: 2px solid var(--danger);  padding-left: 8px; }
.history-item__time    { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.history-item__message { flex: 1; margin: 0 12px; }

/* ─── Search ────────────────────────────────────────────────────────────────── */
.search-loading { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-lg); color: var(--muted); }
.search-results-header { padding: var(--space-sm) 0; margin-bottom: var(--space-md); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.search-results-list { display: flex; flex-direction: column; gap: var(--space-sm); max-height: 420px; overflow-y: auto; }
.search-result { padding: var(--space-md); background: var(--bg-elevated); border-radius: var(--radius-md); border: 1px solid var(--border); transition: all var(--transition-fast); animation: fadeIn 0.25s ease; }
.search-result:hover { border-color: rgba(91,158,249,0.3); background: var(--card-hover); transform: translateX(3px); }
.search-result__header { display: flex; align-items: flex-start; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.search-result__platform { font-size: 18px; }
.search-result__title { font-size: 13px; color: var(--text); text-decoration: none; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-result__title:hover { color: var(--accent); }
.search-result__meta { display: flex; gap: var(--space-md); font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.search-result__tags { margin-top: var(--space-sm); display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.search-suggestions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }

/* ─── Tags ──────────────────────────────────────────────────────────────────── */
.tag { display: inline-block; padding: 2px 7px; background: var(--accent-subtle); color: var(--accent); border-radius: var(--radius-full); font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }
.tag-btn { padding: 4px var(--space-sm); background: var(--accent-subtle); border: 1px solid transparent; color: var(--accent); border-radius: var(--radius-full); font-size: 12px; cursor: pointer; transition: all var(--transition-fast); font-weight: 600; }
.tag-btn:hover { background: rgba(91,158,249,0.15); border-color: var(--accent); }
.topic-tag { display: inline-block; padding: var(--space-xs) var(--space-sm); background: var(--purple-subtle); color: var(--purple); border-radius: var(--radius-full); font-size: 12px; font-weight: 600; border: 1px solid rgba(167,139,250,0.2); }

/* ─── Result Cards ──────────────────────────────────────────────────────────── */
.results-grid { display: flex; flex-direction: column; gap: var(--space-md); }
.result-card { display: flex; gap: var(--space-md); padding: var(--space-md); background: var(--bg-elevated); border-radius: var(--radius-md); border-left: 3px solid var(--accent); transition: all var(--transition-fast); animation: fadeIn 0.3s ease; }
.result-card:hover { transform: translateX(4px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.result-card__rank { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--border); border-radius: var(--radius-full); font-size: 12px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.result-card__content { flex: 1; min-width: 0; }
.result-card__header { display: flex; align-items: flex-start; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.result-card__platform { font-size: 18px; flex-shrink: 0; }
.result-card__title { font-size: 14px; color: var(--text); text-decoration: none; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; }
.result-card__title:hover { color: var(--accent); }
.result-card__author { display: flex; gap: var(--space-md); font-size: 12px; color: var(--muted); margin-bottom: var(--space-sm); }
.result-card__stats { display: flex; gap: var(--space-lg); margin-bottom: var(--space-sm); }
.result-card__stats .stat { font-size: 12px; color: var(--text-secondary); }
.result-card__stats .stat--views    { color: var(--accent); }
.result-card__stats .stat--likes    { color: var(--pink); }
.result-card__stats .stat--comments { color: var(--warning); }
.result-card__stats .stat--source { color: var(--muted); font-size: 11px; opacity: 0.7; }
.result-card__tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); }

/* ─── Source badges ─────────────────────────────────────────────────────────── */
.source-badge { display: inline-block; padding: 2px 8px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-full); font-size: 11px; margin-left: 4px; }
.search-note { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; font-style: italic; }

/* ─── Empty State ───────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 0; }
.empty-state__icon { font-size: 48px; margin-bottom: var(--space-md); opacity: 0.4; }
.empty-state__text { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: var(--space-sm); }
.empty-state__hint { font-size: 13px; color: var(--muted); }

/* ─── Post Items ────────────────────────────────────────────────────────────── */
.posts-list { display: flex; flex-direction: column; gap: var(--space-sm); max-height: 500px; overflow-y: auto; }
.post-item { background: var(--bg-elevated); border-radius: var(--radius-md); padding: var(--space-md); border-left: 3px solid var(--accent); transition: all var(--transition-fast); animation: fadeIn 0.3s ease; }
.post-item:hover { border-left-color: var(--purple); transform: translateX(3px); }
.post-item__header { display: flex; gap: var(--space-md); margin-bottom: var(--space-xs); font-size: 12px; }
.post-item__num      { color: var(--accent); font-weight: 700; }
.post-item__channel  { color: var(--text); font-weight: 600; }
.post-item__date     { color: var(--muted); margin-left: auto; }
.post-item__desc     { color: var(--text-secondary); font-size: 13px; line-height: 1.4; margin-bottom: var(--space-sm); max-height: 60px; overflow: hidden; text-overflow: ellipsis; }
.post-item__stats    { display: flex; gap: var(--space-lg); font-size: 12px; color: var(--muted); }
.post-item__author   { color: var(--accent); font-size: 12px; margin-bottom: var(--space-xs); }
.post-item__platform { background: var(--accent); color: white; padding: 2px 7px; border-radius: 4px; font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.post-item__link     { display: inline-block; margin-top: var(--space-sm); color: var(--accent); font-size: 12px; text-decoration: none; }
.post-item__link:hover { text-decoration: underline; }

/* ─── Top Channels ──────────────────────────────────────────────────────────── */
.top-channels { margin-top: var(--space-lg); }
.top-channels__title { font-size: 14px; font-weight: 700; margin-bottom: var(--space-sm); color: var(--text); }
.top-channels__list { display: flex; flex-direction: column; gap: var(--space-sm); }
.top-channel { display: flex; justify-content: space-between; align-items: center; padding: var(--space-sm) var(--space-md); background: var(--bg-elevated); border-radius: var(--radius-sm); font-size: 13px; border: 1px solid var(--border); transition: all var(--transition-fast); }
.top-channel:hover { border-color: var(--border-hover); background: var(--card-hover); }
.top-channel__name  { font-weight: 600; color: var(--text); }
.top-channel__stats { display: flex; gap: var(--space-md); color: var(--muted); font-size: 12px; }
.top-channel__stat  { display: flex; align-items: center; gap: 4px; }

/* ─── Analysis ──────────────────────────────────────────────────────────────── */
.analysis-header { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: var(--ok-subtle); border-radius: var(--radius-md); margin-bottom: var(--space-lg); border: 1px solid rgba(52,211,153,0.15); }
.analysis-header__icon { font-size: 24px; }
.analysis-header__text { display: flex; flex-direction: column; gap: var(--space-xs); }
.analysis-section { margin-bottom: var(--space-lg); }
.analysis-section__title { font-size: 14px; font-weight: 700; margin-bottom: var(--space-md); color: var(--text); }

/* ─── Sentiment ─────────────────────────────────────────────────────────────── */
.sentiment-bar { display: flex; height: 10px; border-radius: var(--radius-full); overflow: hidden; background: var(--border); margin-bottom: var(--space-sm); gap: 2px; }
.sentiment-bar__segment           { height: 100%; transition: width var(--transition-normal); }
.sentiment-bar__segment--positive { background: var(--ok); }
.sentiment-bar__segment--neutral  { background: var(--muted); }
.sentiment-bar__segment--negative { background: var(--danger); }
.sentiment-legend { display: flex; gap: var(--space-lg); flex-wrap: wrap; }
.sentiment-legend__item { display: flex; align-items: center; gap: var(--space-xs); font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot--positive { background: var(--ok);     box-shadow: 0 0 6px rgba(52,211,153,0.5); }
.dot--neutral  { background: var(--muted); }
.dot--negative { background: var(--danger); box-shadow: 0 0 6px rgba(248,113,113,0.5); }

/* ─── Comments ──────────────────────────────────────────────────────────────── */
.comment-card { background: var(--bg-elevated); border-radius: var(--radius-md); padding: var(--space-md); margin-bottom: var(--space-sm); border-left: 3px solid var(--accent); transition: all var(--transition-fast); animation: fadeIn 0.3s ease; }
.comment-card:hover { border-left-color: var(--purple); transform: translateX(3px); }
.comment-card__text { font-size: 13px; line-height: 1.5; color: var(--text); margin-bottom: var(--space-sm); font-style: italic; }
.comment-card__meta { display: flex; gap: var(--space-md); font-size: 11px; color: var(--muted); }

/* ─── Files ─────────────────────────────────────────────────────────────────── */
.files-links { display: flex; flex-direction: column; gap: var(--space-sm); }
.file-link { display: inline-flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); background: var(--bg-elevated); border-radius: var(--radius-sm); color: var(--accent); text-decoration: none; font-size: 13px; transition: all var(--transition-fast); border: 1px solid var(--border); }
.file-link:hover { background: var(--card-hover); border-color: var(--border-hover); }
.files-list { list-style: none; padding: 0; margin: 0; }
.files-list__item { margin-bottom: var(--space-sm); }
.files-list__item a { display: flex; align-items: center; gap: var(--space-sm); color: var(--accent); text-decoration: none; font-size: 13px; }
.files-list__item a:hover { text-decoration: underline; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-md); margin-top: var(--space-md); }
.file-card { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: all var(--transition-normal); animation: fadeIn 0.3s ease; }
.file-card:hover { background: var(--card-hover); border-color: rgba(91,158,249,0.3); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.file-card__icon { font-size: 28px; flex-shrink: 0; }
.file-card__info { flex: 1; min-width: 0; }
.file-card__name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.file-card__meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.file-card__type { font-size: 10px; font-weight: 700; color: #0b1220; background: var(--accent); padding: 2px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.file-card__date { font-size: 11px; color: var(--muted); }
.file-card__actions { display: flex; gap: var(--space-sm); flex-shrink: 0; }
.file-card__actions .btn--small { padding: 5px 11px; font-size: 11px; white-space: nowrap; }

/* ─── Error ─────────────────────────────────────────────────────────────────── */
.error-container { display: flex; align-items: flex-start; gap: var(--space-md); padding: var(--space-lg); background: var(--danger-subtle); border-radius: var(--radius-md); border: 1px solid rgba(248,113,113,0.25); animation: fadeIn 0.3s ease; }
.error-icon { font-size: 24px; }
.error-text strong { display: block; margin-bottom: var(--space-xs); color: var(--danger); }
.error-text p { margin: 0; font-size: 13px; color: var(--text-secondary); }

/* ─── Report Data ───────────────────────────────────────────────────────────── */
.report-data-container { margin-top: var(--space-lg); }
.report-section { background: var(--bg-elevated); border-radius: var(--radius-md); padding: var(--space-lg); margin-bottom: var(--space-md); border: 1px solid var(--border); }
.report-section__title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 var(--space-md) 0; }
.report-period { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: var(--space-md); }

/* ─── Users ─────────────────────────────────────────────────────────────────── */
.users-section { margin-bottom: 30px; }
.users-section h2 { color: var(--text); margin-bottom: var(--space-md); font-size: 1.2em; font-weight: 700; }
.user-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-lg) var(--space-xl); margin-bottom: var(--space-md); display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); flex-wrap: wrap; transition: all var(--transition-fast); animation: fadeIn 0.3s ease; }
.user-card:hover { border-color: rgba(91,158,249,0.25); background: var(--card-hover); box-shadow: var(--shadow-hover); }
.user-info  { flex: 1; min-width: 200px; }
.user-name  { font-weight: 700; color: var(--text); font-size: 15px; }
.user-email { color: var(--muted); font-size: 13px; margin-top: 3px; }
.user-meta  { color: var(--muted); font-size: 12px; margin-top: 5px; }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Misc ──────────────────────────────────────────────────────────────────── */
.hint, small.hint { font-size: 11px; color: var(--muted); margin-top: 4px; display: block; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ─── Keywords Page ─────────────────────────────────────────────────────────── */
.kw-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}
@media (min-width: 1000px) {
  .kw-main-grid { grid-template-columns: 1fr 400px; align-items: start; }
}

/* AI Chat Panel */
.ai-chat-panel {
  display: flex;
  flex-direction: column;
  height: 580px;
  padding: 0 !important;
  overflow: hidden;
}
.ai-chat-panel__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: rgba(91,158,249,0.06);
  flex-shrink: 0;
}
.ai-chat-panel__icon { font-size: 26px; }
.ai-chat-panel__title { font-size: 14px; font-weight: 700; color: var(--text); }
.ai-chat-panel__sub   { font-size: 11px; color: var(--muted); }
.ai-chat-panel__header .btn { margin-left: auto; }
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.ai-chat-msg { display: flex; }
.ai-chat-msg--user     { justify-content: flex-end; }
.ai-chat-msg--assistant{ justify-content: flex-start; }
.ai-chat-msg__bubble {
  max-width: 85%;
  padding: 9px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  animation: fadeIn 0.2s ease;
}
.ai-chat-msg--user .ai-chat-msg__bubble {
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-chat-msg--assistant .ai-chat-msg__bubble {
  background: rgba(148,163,184,0.1);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.ai-chat-msg--loading .ai-chat-msg__bubble { opacity: 0.65; }
.ai-chat-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
}
.ai-chat-typing span {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.ai-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.4; }
  40%            { transform: translateY(-6px); opacity: 1; }
}
.ai-chat-quickbtns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-chat-input-row {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(7,9,15,0.3);
}
.ai-chat-input {
  flex: 1;
  background: rgba(7,9,15,0.7) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-full) !important;
  padding: 9px 16px !important;
  font-size: 13px;
  color: var(--text);
}
.ai-chat-input:focus {
  border-color: rgba(91,158,249,0.5) !important;
  box-shadow: 0 0 0 3px rgba(91,158,249,0.08) !important;
}
.ai-chat-send {
  padding: 9px 16px !important;
  border-radius: var(--radius-full) !important;
  flex-shrink: 0;
}

/* ─── Telegram WebApp ───────────────────────────────────────────────────────────────── */
body.telegram-webapp { -webkit-user-select: none; user-select: none; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); -webkit-overflow-scrolling: touch; }
body.telegram-webapp input, body.telegram-webapp textarea, body.telegram-webapp [contenteditable] { -webkit-user-select: text; user-select: text; }
body.telegram-webapp .nav.tg-compact { display: flex; flex-wrap: wrap; gap: 4px; }
body.telegram-webapp .nav.tg-compact .nav__link { padding: 6px 10px; font-size: 12px; }
body.telegram-webapp .header__title { font-size: 1.2rem; }
body.telegram-webapp .container { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
body.telegram-webapp.theme-dark { --bg: #17212b; --bg-elevated: #232e3c; --card: #1e2c3a; --card-hover: #283848; --text: #f5f5f5; --text-secondary: #8a9da8; --muted: #6c7c8c; --border: rgba(255,255,255,0.1); --border-light: rgba(255,255,255,0.05); }
body.telegram-webapp .btn { border-radius: 12px; }
body.telegram-webapp .btn--primary { background: var(--tg-theme-button-color, var(--accent)); color: var(--tg-theme-button-text-color, #fff); }
body.telegram-webapp .card { border-radius: 14px; border: none; margin-bottom: 8px; }
body.telegram-webapp input, body.telegram-webapp select, body.telegram-webapp textarea { border-radius: 10px; }
body.telegram-webapp input:focus, body.telegram-webapp select:focus, body.telegram-webapp textarea:focus { box-shadow: 0 0 0 2px rgba(91,158,249,0.3); }
.tg-loading { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.tg-popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 9998; }

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 12px; }
  .header { padding: 12px 16px; top: 6px; border-radius: var(--radius-lg); }
  .header__title { font-size: 16px; }
  button, .btn { padding: 10px 14px; }
  .grid { grid-template-columns: 1fr !important; }
  .stats-grid--4 { grid-template-columns: repeat(2, 1fr); }
  th, td { padding: 8px; }
  .files-grid { grid-template-columns: 1fr; }
  .row > * { min-width: 140px; }
  .modal__content { min-width: unset; padding: var(--space-lg); }
}

/* ─── Modern Layout Helpers ─────────────────────────────────────────────────── */
.header__usernav { display: flex; align-items: center; gap: var(--space-lg); }
.modern-main { display: block; }
.modern-container { max-width: 1200px; margin: 0 auto; padding: var(--space-xl) var(--space-lg); position: relative; z-index: 1; }
.modern-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}
@media (min-width: 900px) {
  .modern-grid { grid-template-columns: 1fr 1fr; }
}
.glass-card {
  background: rgba(15, 22, 35, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.glass-header {
  background: rgba(13, 17, 23, 0.88) !important;
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
}
.glass-footer {
  border-top: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-top: var(--space-xl);
}
.glow-text {
  text-shadow: 0 0 40px rgba(91,158,249,0.35);
}

/* ─── Floating Background ────────────────────────────────────────────────────── */
#synapse-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.bg-orb--1 {
  width: 540px; height: 540px;
  background: radial-gradient(circle, rgba(91,158,249,.17) 0%, transparent 68%);
  top: -170px; left: -150px;
  animation: bgOrb1 24s ease-in-out infinite alternate;
}
.bg-orb--2 {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(167,139,250,.14) 0%, transparent 68%);
  top: 22%; right: -150px;
  animation: bgOrb2 31s ease-in-out infinite alternate;
}
.bg-orb--3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(34,211,238,.10) 0%, transparent 68%);
  bottom: -130px; left: 18%;
  animation: bgOrb3 21s ease-in-out infinite alternate;
}
.bg-orb--4 {
  width: 310px; height: 310px;
  background: radial-gradient(circle, rgba(244,114,182,.09) 0%, transparent 68%);
  top: 44%; left: 37%;
  animation: bgOrb4 37s ease-in-out infinite alternate;
}
@keyframes bgOrb1 { to { transform: translate(115px,  95px) scale(1.18); } }
@keyframes bgOrb2 { to { transform: translate(-95px, 115px) scale(1.12); } }
@keyframes bgOrb3 { to { transform: translate(-75px, -95px) scale(1.08); } }
@keyframes bgOrb4 { to { transform: translate( 55px, -75px) scale(0.88); } }

/* Particles */
.bg-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
  animation-name: bgParticleRise;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}
@keyframes bgParticleRise {
  0%   { opacity: 0;    transform: translateY(0)      scale(0.5); }
  12%  { opacity: 0.55; }
  88%  { opacity: 0.15; }
  100% { opacity: 0;    transform: translateY(-130px) scale(1.4); }
}

/* Geometric shapes */
.bg-shape {
  position: absolute;
  will-change: transform, opacity;
  animation-name: bgShapeFloat;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
.bg-shape--circle  { border-radius: 50%; border: 1px solid rgba(91,158,249,.3); background: transparent; }
.bg-shape--tri     { clip-path: polygon(50% 0%,0% 100%,100% 100%); background: rgba(167,139,250,.07); }
.bg-shape--hex     { clip-path: polygon(25% 0%,75% 0%,100% 50%,75% 100%,25% 100%,0% 50%); background: rgba(34,211,238,.06); }
.bg-shape--diamond { clip-path: polygon(50% 0%,100% 50%,50% 100%,0% 50%); background: rgba(244,114,182,.06); }
@keyframes bgShapeFloat {
  0%   { opacity: .04; transform: translateY(0)     rotate(0deg);  }
  50%  { opacity: .09; }
  100% { opacity: .04; transform: translateY(-28px) rotate(20deg); }
}

/* ─── Date Badges ─────────────────────────────────────────────────────────── */
.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
  line-height: 1.6;
  white-space: nowrap;
}
.date-badge--now {
  background: rgba(248,113,113,.15);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,.3);
}
.date-badge--today {
  background: var(--ok-subtle, rgba(52,211,153,.12));
  color: var(--ok, #34d399);
  border: 1px solid rgba(52,211,153,.3);
}
.date-badge--yesterday {
  background: var(--warning-subtle, rgba(251,191,36,.12));
  color: var(--warning, #fbbf24);
  border: 1px solid rgba(251,191,36,.3);
}
.result-date {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.filter-recent-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  transition: border-color var(--transition-fast), color var(--transition-fast);
  user-select: none;
}
.filter-recent-label:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-recent-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--ok, #34d399);
  cursor: pointer;
  margin: 0;
}
.fresh-count {
  font-size: 11px;
  color: var(--ok, #34d399);
  font-weight: 600;
  margin-left: 6px;
}

/* ─── Report Output Panel ─────────────────────────────────────────────────── */
.report-out-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(0,0,0,.25);
  transition: border-color var(--transition-fast);
}
.report-out-wrap--running { border-color: var(--accent); }
.report-out-wrap--ok      { border-color: rgba(52,211,153,.4); }
.report-out-wrap--error   { border-color: rgba(248,113,113,.4); }

.report-out-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}
.report-out-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.report-out-dot--running { background: var(--accent); animation: dotPulse 1s ease-in-out infinite; }
.report-out-dot--ok      { background: var(--ok, #34d399); }
.report-out-dot--error   { background: var(--danger, #f87171); }
@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}
.report-out-label { color: var(--text-secondary); }
.report-out-wrap--running .report-out-label { color: var(--accent); }
.report-out-wrap--ok      .report-out-label { color: var(--ok, #34d399); }
.report-out-wrap--error   .report-out-label { color: var(--danger, #f87171); }

.report-out-body {
  margin: 0;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.65;
  color: var(--cyan, #22d3ee);
  background: transparent;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.report-out-body::-webkit-scrollbar       { width: 5px; }
.report-out-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Comment analysis result block ────────────────────────────────────────── */
.result-block { padding: 4px 0; }
.result-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.result-metric {
  background: var(--card, #0d1117);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
}
.result-metric__val {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent, #5b9ef9);
  line-height: 1;
}
.result-metric__lbl {
  font-size: 0.72rem;
  color: var(--muted, #64748b);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.result-section {
  background: var(--card, #0d1117);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.result-section__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent, #5b9ef9);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}
.result-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.result-pill {
  background: rgba(91,158,249,0.12);
  border: 1px solid rgba(91,158,249,0.25);
  color: var(--accent, #5b9ef9);
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 0.82rem;
}
.result-comment {
  background: rgba(91,158,249,0.05);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-left: 3px solid var(--gold, #f59e0b);
  border-radius: 7px;
  padding: 11px 14px;
  margin-bottom: 8px;
}
.result-comment__text { line-height: 1.55; margin-bottom: 6px; font-size: 0.9rem; }
.result-comment__meta { font-size: 0.78rem; color: var(--muted, #64748b); }
.result-file-link {
  display: inline-block;
  margin: 4px 8px 4px 0;
  color: var(--accent, #5b9ef9);
  font-size: 0.88rem;
  text-decoration: none;
}
.result-file-link:hover { text-decoration: underline; }
.file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  font-size: 0.88rem;
}
.file-row:last-child { border-bottom: none; }
.file-row a { color: var(--accent, #5b9ef9); text-decoration: none; }
.file-row a:hover { text-decoration: underline; }
.file-icon { font-size: 1rem; }

/* ─── Sheet Lock Overlay ────────────────────────────────────────────────────── */
.sheet-lock-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 20, 0.88);
  backdrop-filter: blur(8px);
}
.sheet-lock-card {
  text-align: center;
  max-width: 440px;
  padding: 48px 36px;
  background: var(--bg-card, #1a1a2e);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-xl, 16px);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.sheet-lock-icon {
  font-size: 56px;
  margin-bottom: 16px;
}
.sheet-lock-card h2 {
  color: var(--text, #fff);
  font-size: 22px;
  margin: 0 0 12px;
}
.sheet-lock-card p {
  color: var(--muted, #94a3b8);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 8px;
}

/* ─── Stop Button ───────────────────────────────────────────────────────────── */
.btn--stop {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-md, 8px);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: none;
}
.btn--stop:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}
.btn--stop.visible { display: inline-flex; align-items: center; gap: 4px; }

/* ─── Comment Hours Chart ───────────────────────────────────────────────────── */
.hours-chart { display: flex; flex-direction: column; gap: 8px; }
.hour-bar { display: flex; align-items: center; gap: 10px; }
.hour-label { font-size: 13px; font-weight: 600; color: var(--accent); min-width: 50px; font-family: var(--font-mono); }
.hour-fill { height: 24px; background: linear-gradient(90deg, var(--accent), var(--purple)); border-radius: var(--radius-sm); transition: width 0.6s ease; min-width: 4px; }
.hour-count { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ─── Comment List ──────────────────────────────────────────────────────────── */
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment-item { padding: 12px; background: var(--bg-elevated); border-radius: var(--radius-md); border: 1px solid var(--border); }
.comment-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.comment-author { font-weight: 600; color: var(--accent); font-size: 13px; }
.comment-date { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.comment-likes { font-size: 12px; color: var(--pink); }
.comment-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ─── Modal (Modern) ───────────────────────────────────────────────────────── */
.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 15, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
}
.modal__content {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 22, 35, 0.92);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(99, 130, 180, 0.18);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 480px;
  width: 90%;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 60px rgba(91,158,249,0.06);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.modal__actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.93); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ─── Enhanced Stat Box ─────────────────────────────────────────────────────── */
.stat-box {
  background: rgba(7, 9, 15, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: all 0.25s;
}
.stat-box:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(91,158,249,0.08);
  transform: translateY(-2px);
}
.stat-box__value {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-box__label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ─── WOW Extras ────────────────────────────────────────────────────────────── */
/* Animated gradient border on focused cards */
.glass-card:focus-within {
  border-color: transparent;
  background-image: linear-gradient(rgba(15,22,35,0.72), rgba(15,22,35,0.72)),
                    linear-gradient(135deg, var(--accent), var(--purple));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

/* Smooth page entry */
.modern-main > * {
  animation: fadeSlideUp 0.5s ease-out both;
}
.modern-main > *:nth-child(1) { animation-delay: 0.05s; }
.modern-main > *:nth-child(2) { animation-delay: 0.1s; }
.modern-main > *:nth-child(3) { animation-delay: 0.15s; }
.modern-main > *:nth-child(4) { animation-delay: 0.2s; }
.modern-main > *:nth-child(5) { animation-delay: 0.25s; }
.modern-main > *:nth-child(6) { animation-delay: 0.3s; }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Pulse dot for active items */
.pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--ok);
  border-radius: 50%;
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(52,211,153,0); }
}

/* Hint text */
.hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

/* Active sheet indicator */
.active-sheet-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(91,158,249,0.06);
  border: 1px solid rgba(91,158,249,0.2);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}
.active-sheet-indicator__icon { font-size: 28px; }
.active-sheet-indicator__name { font-weight: 700; color: var(--text); }
.active-sheet-indicator__url { font-size: 12px; color: var(--muted); word-break: break-all; }

/* ═══ WOW UNIQUE EFFECTS ═══════════════════════════════════════════════════ */

/* ── Cursor Glow (follows mouse) ─── */
#cursor-glow {
  position: fixed;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,158,249,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: left 0.35s ease-out, top 0.35s ease-out;
  mix-blend-mode: screen;
}

/* ── Animated Gradient Border on glass-card hover ─── */
.glass-card {
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: inherit;
  background: conic-gradient(from var(--card-angle, 0deg),
    transparent 0%, var(--accent) 10%, var(--purple) 20%, var(--cyan) 30%,
    transparent 40%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s;
  z-index: -1;
  animation: rotateBorder 4s linear infinite;
}
.glass-card:hover::before {
  opacity: 0.6;
}
@property --card-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes rotateBorder {
  to { --card-angle: 360deg; }
}

/* ── Micro-interaction: card tilt on hover ─── */
.glass-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.glass-card:hover {
  transform: perspective(800px) rotateX(1deg) rotateY(-1deg) translateY(-3px);
  box-shadow: var(--shadow-hover), 0 0 40px rgba(91,158,249,0.06);
}

/* ── Animated number counters (via JS class) ─── */
.count-up {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}
.count-up.counting {
  color: var(--accent) !important;
}

/* ── Typing cursor for glow-text ─── */
.glow-text::after {
  content: '|';
  display: inline-block;
  color: var(--accent);
  animation: blinkCursor 1s step-end infinite;
  margin-left: 2px;
  font-weight: 300;
}
@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ── Floating badge ribbon ─── */
.ribbon {
  position: absolute;
  top: 12px; right: -32px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 40px;
  transform: rotate(45deg);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(91,158,249,0.3);
  z-index: 2;
}

/* ── Skeleton loading shimmer ─── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(99,130,180,0.06) 25%,
    rgba(99,130,180,0.12) 50%,
    rgba(99,130,180,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Notification badge ─── */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px; height: 20px;
  background: linear-gradient(135deg, var(--danger), var(--pink));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  padding: 0 6px;
  animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
@keyframes popIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── Success confetti burst (applied via JS class on body) ─── */
body.confetti-active::after {
  content: '🎉';
  position: fixed;
  top: 50%; left: 50%;
  font-size: 60px;
  transform: translate(-50%, -50%) scale(0);
  animation: confettiBurst 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
  pointer-events: none;
  z-index: 9999;
}
@keyframes confettiBurst {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

/* ── Neon text glow ─── */
.neon-text {
  text-shadow:
    0 0 7px rgba(91,158,249,0.4),
    0 0 14px rgba(91,158,249,0.25),
    0 0 28px rgba(91,158,249,0.15);
}

/* ── Glass tooltip ─── */
[data-tooltip] {
  position: relative;
  cursor: help;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15,22,35,0.92);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Sparkle button (for primary actions) ─── */
.btn-sparkle {
  position: relative;
  overflow: hidden;
}
.btn-sparkle::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(from 0deg,
    transparent 0%, transparent 40%,
    rgba(255,255,255,0.15) 50%,
    transparent 60%, transparent 100%);
  animation: sparkleRotate 3s linear infinite;
}
@keyframes sparkleRotate {
  to { transform: rotate(360deg); }
}

/* ── Holographic shimmer on user badge ─── */
.user-badge {
  position: relative;
  overflow: hidden;
}
.user-badge::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,0.06),
    transparent);
  animation: holoShimmer 3s ease-in-out infinite;
}
@keyframes holoShimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* ── Scrollbar glow ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--purple));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }

/* ── Interactive noise overlay (subtle) ─── */
.modern-bg::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}
