/* Ambient UI Design System - Website Visitor Identification */

@property --glow-angle {
  syntax: '<angle>';
  initial-value: 180deg;
  inherits: false;
}

:root {
  --bg-deep: #07070d;
  --bg-surface: rgba(255,255,255,0.025);
  --bg-surface-hover: rgba(255,255,255,0.05);
  --bg-input: rgba(255,255,255,0.035);
  --text-primary: #fafaff;
  --text-secondary: rgba(230,230,245,0.92);
  --text-muted: rgba(200,200,220,0.65);
  --border: rgba(255,255,255,0.055);
  --border-hover: rgba(255,255,255,0.12);
  --green: #34d399;
  --red: #f87171;
  --blue: #7eb4ff;
  --lavender: #c4b5fd;
  --amber: #fbbf24;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --sidebar-w: 240px;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-deep);
  color: var(--text-secondary);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ===== AMBIENT BACKGROUND ===== */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ab {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  animation: drift 32s ease-in-out infinite;
}

.ab.a1 {
  width: 600px; height: 400px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed, #ec4899);
  opacity: 0.1;
  top: -10%; left: 20%;
}

.ab.a2 {
  width: 500px; height: 350px;
  background: linear-gradient(135deg, #22d3ee, #34d399);
  opacity: 0.07;
  top: 40%; right: -5%;
  animation-delay: -8s;
}

.ab.a3 {
  width: 450px; height: 300px;
  background: linear-gradient(135deg, #f97316, #ef4444, #ec4899);
  opacity: 0.05;
  bottom: -5%; left: 10%;
  animation-delay: -16s;
}

.ab.a4 {
  width: 400px; height: 280px;
  background: linear-gradient(135deg, #fbbf24, #34d399, #22d3ee);
  opacity: 0.04;
  top: 20%; left: 50%;
  animation-delay: -24s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(60px, -40px) scale(1.1); }
  50% { transform: translate(-30px, 50px) scale(0.95); }
  75% { transform: translate(40px, 20px) scale(1.05); }
}

.noise {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.028;
  background-size: 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ===== AURORA GLOW ===== */
@keyframes glowSpin {
  from { --glow-angle: 180deg; }
  to { --glow-angle: 540deg; }
}

.aurora-glow {
  position: relative;
}

.aurora-glow::before,
.aurora-glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(from var(--glow-angle),
    #f87171, #f97316, #fbbf24, #34d399, #22d3ee, #7eb4ff, #7c3aed, #f472b6, #f87171
  );
  animation: glowSpin 4s linear infinite;
  opacity: 0;
  transition: opacity 0.45s;
  pointer-events: none;
}

.aurora-glow::before {
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
}

.aurora-glow::after {
  inset: -6px;
  filter: blur(14px);
  opacity: 0;
}

.aurora-glow:hover::before { opacity: 1; }
.aurora-glow:hover::after { opacity: 0.4; }
.aurora-glow.active::before { opacity: 0.7; }
.aurora-glow.active::after { opacity: 0.3; }

/* ===== FADE UP ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.5s ease-out both;
}

/* ===== COMMON COMPONENTS ===== */
.app-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.oc-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.3s;
}

.oc-input:focus {
  border-color: rgba(126,180,255,0.4);
  box-shadow: 0 0 0 3px rgba(126,180,255,0.08);
}

.oc-input::placeholder {
  color: var(--text-muted);
}

.input-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.input-group {
  margin-bottom: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.35s;
  text-decoration: none;
}

.btn-primary {
  background: rgba(126,180,255,0.08);
  color: var(--blue);
  width: 100%;
}

.btn-primary:hover {
  background: rgba(126,180,255,0.14);
  border-color: var(--border-hover);
}

.btn-green {
  background: rgba(52,211,153,0.08);
  color: var(--green);
  width: 100%;
}

.btn-green:hover {
  background: rgba(52,211,153,0.14);
  border-color: var(--border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(248,113,113,0.06);
  color: var(--red);
  border-color: rgba(248,113,113,0.15);
}

.btn-danger:hover {
  background: rgba(248,113,113,0.12);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

/* OAuth buttons */
.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.35s;
  text-decoration: none;
  margin-bottom: 8px;
}

.oauth-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.oauth-btn svg { width: 18px; height: 18px; }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Auth card */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  animation: fadeUp 0.5s ease-out;
}

.auth-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #e4e4ee, #7eb4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 24px;
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--blue);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Flash messages */
.flash-msg {
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.82rem;
  margin-bottom: 14px;
}

.flash-msg.error {
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  color: var(--red);
}

.flash-msg.success {
  background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.2);
  color: var(--green);
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(10,10,18,0.7);
  backdrop-filter: blur(30px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #e4e4ee, #7eb4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all 0.3s;
  margin-bottom: 2px;
  text-decoration: none;
  border: 1px solid transparent;
}

.nav-item:hover {
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.nav-item.active {
  color: var(--text-primary);
  background: var(--bg-surface);
  border-color: var(--border);
}

.nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-user-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 2px;
}

.sidebar-user-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sidebar-logout:hover {
  color: var(--red);
  border-color: rgba(248,113,113,0.3);
}

/* Main content area (with sidebar) */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 24px 32px 40px;
  max-width: calc(1200px + var(--sidebar-w));
}

/* Mobile hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 60;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(20px);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7,7,13,0.6);
  z-index: 45;
}

/* ===== STATS ROW ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  transition: all 0.35s;
}

.stat-card:hover {
  border-color: var(--border-hover);
}

.stat-icon {
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: block;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-title-icon {
  margin-right: 8px;
}

/* Filters */
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.3s;
}

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

.filter-btn.active {
  background: var(--bg-surface);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.sort-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.76rem;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
}

.sort-select:focus {
  border-color: rgba(126,180,255,0.4);
}

.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.76rem;
  color: var(--text-primary);
  outline: none;
  width: 160px;
  transition: all 0.3s;
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: rgba(126,180,255,0.4); width: 200px; }

/* ===== COMPANY CARDS ===== */
.company-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.company-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  cursor: pointer;
  transition: all 0.35s;
  text-decoration: none;
  display: block;
}

.company-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.company-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.company-info { flex: 1; }

.company-name {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.company-domain {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.company-type-badge {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.company-type-badge.business { color: var(--blue); border-color: rgba(126,180,255,0.2); }
.company-type-badge.education { color: var(--lavender); border-color: rgba(196,181,253,0.2); }
.company-type-badge.government { color: var(--amber); border-color: rgba(251,191,36,0.2); }

.company-metrics {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.company-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.company-metric-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.company-metric-value {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.engagement-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.engagement-bar {
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.engagement-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease-out;
}

.engagement-fill.high { background: var(--green); }
.engagement-fill.mid { background: var(--amber); }
.engagement-fill.low { background: var(--red); }

.company-pages {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.page-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
}

.page-tag-views {
  color: var(--cyan);
  margin-left: 3px;
}

/* ===== DETAIL PANEL ===== */
.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(7,7,13,0.7);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.detail-overlay.visible { display: flex; }

.detail-panel {
  background: rgba(12,12,20,0.95);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  animation: fadeUp 0.35s ease-out;
}

.detail-panel::-webkit-scrollbar { width: 4px; }
.detail-panel::-webkit-scrollbar-track { background: transparent; }
.detail-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.detail-company-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.detail-company-domain {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.detail-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 4px 10px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all 0.3s;
}

.detail-close:hover {
  color: var(--red);
  border-color: rgba(248,113,113,0.3);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.detail-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.detail-stat-value {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.detail-section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 16px 24px 8px;
}

.activity-day { padding: 0 24px 14px; }

.activity-date {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--blue);
  margin-bottom: 6px;
}

.activity-page {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.8rem;
}

.activity-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 40px;
}

.activity-path { color: var(--text-secondary); }

.activity-title {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.empty-state-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* Skeleton shimmer */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, rgba(255,255,255,0.04) 50%, var(--bg-surface) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-stat {
  height: 32px;
  width: 60px;
  margin-bottom: 6px;
}

.skeleton-text {
  height: 14px;
  width: 80%;
  margin-bottom: 8px;
}

.skeleton-text.short { width: 40%; }

.skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 10px;
}

.skeleton-card .skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  margin-bottom: 10px;
}

.skeleton-card .skeleton-line:nth-child(1) { width: 45%; height: 16px; }
.skeleton-card .skeleton-line:nth-child(2) { width: 30%; }
.skeleton-card .skeleton-line:nth-child(3) { width: 70%; }
.skeleton-card .skeleton-line:nth-child(4) { width: 55%; }

/* ===== SNIPPET BANNER ===== */
.snippet-banner {
  background: rgba(126,180,255,0.06);
  border: 1px solid rgba(126,180,255,0.15);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.snippet-banner-icon {
  color: var(--blue);
  font-size: 1rem;
}

.snippet-banner-text { flex: 1; }

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

/* ===== CODE BLOCK ===== */
.code-block {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--cyan);
  overflow-x: auto;
  position: relative;
}

.code-block .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  font-size: 0.68rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all 0.3s;
}

.code-block .copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ===== SETTINGS SECTIONS ===== */
.settings-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}

.settings-section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.site-row:last-child { border-bottom: none; }

.site-row-domain {
  font-weight: 500;
  color: var(--text-primary);
}

.site-row-key {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.site-row-actions {
  display: flex;
  gap: 6px;
}

.danger-zone {
  border-color: rgba(248,113,113,0.15);
}

/* ===== TOAST ===== */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: rgba(12,12,20,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  animation: toastIn 0.3s ease-out;
  pointer-events: none;
}

.toast.fade-out { animation: toastOut 0.3s ease-in forwards; }

.toast.success { border-color: rgba(52,211,153,0.3); color: var(--green); }
.toast.error { border-color: rgba(248,113,113,0.3); color: var(--red); }

/* ===== ONBOARDING TRANSITIONS ===== */
.screen-enter {
  animation: screenIn 0.35s ease-out;
}

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

/* Button loading state */
.btn.loading-btn {
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading-btn::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ===== FOCUS VISIBLE ===== */
.oc-input:focus-visible,
.btn:focus-visible,
.oauth-btn:focus-visible,
.nav-item:focus-visible,
.filter-btn:focus-visible {
  outline: 2px solid rgba(126,180,255,0.4);
  outline-offset: 2px;
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
  .main-content { padding: 24px 20px 40px; }
  .stats-row { gap: 10px; }
  .stat-value { font-size: 1.4rem; }
  .company-metrics { gap: 14px; }
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .hamburger { display: block; }
  .main-content { margin-left: 0; padding: 60px 16px 40px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .detail-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 14px 16px; }
  .stat-value { font-size: 1.3rem; }
  .auth-card { padding: 28px 20px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .filters { width: 100%; }
  .search-input { flex: 1; min-width: 0; width: auto; }
  .search-input:focus { width: auto; }
  .snippet-banner { flex-direction: column; align-items: flex-start; }
  .snippet-banner-actions { width: 100%; }
  .snippet-banner-actions .btn { flex: 1; }
  .company-top { flex-direction: column; gap: 8px; }
  .company-metrics { gap: 10px; }
  .detail-panel { max-width: 100%; max-height: 90vh; }
  .detail-header { padding: 16px 16px 12px; }
  .detail-stats { padding: 12px 16px; gap: 8px; }
  .detail-section-title { padding: 12px 16px 6px; }
  .activity-day { padding: 0 16px 10px; }
  .settings-section { padding: 16px; }
  .site-row { flex-direction: column; align-items: flex-start; }
  .site-row-actions { width: 100%; }
}

/* Small mobile */
@media (max-width: 480px) {
  .main-content { padding: 56px 12px 32px; }
  .stats-row { grid-template-columns: 1fr; gap: 8px; }
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 1.2rem; }
  .company-card { padding: 14px 16px; }
  .company-name { font-size: 0.92rem; }
  .auth-card { padding: 24px 16px; max-width: 100%; }
  .auth-logo { font-size: 1.3rem; }
  .detail-panel { border-radius: 12px; }
  .detail-company-name { font-size: 1.1rem; }
  .toast { left: 12px; right: 12px; bottom: 12px; text-align: center; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
