/* ========================================================
   Twitch Bot Dashboard - Forest Shadow & Sand Gold Edition
   Palette: Deep Shadow (#14301F), Pattern (#2C5E49 / #24543F / #1B3F2B),
            Leaf Facet (#3F7360), Dune (#D8BC82), Sand Gold (#B8975A), Cream (#F3EEE2)
   ======================================================== */

:root {
  /* Surfaces & Dark Botanical Shadow Canvas */
  --bg-canvas: #14301F;
  --bg-overlay: rgba(20, 48, 31, 0.88);
  --bg-surface: #0F2618;
  --bg-card: rgba(22, 52, 34, 0.90);
  --bg-card-hover: #1B3F2B;
  --bg-card-raised: #24543F;
  --bg-input: #0D2015;

  /* Precision Hairline Borders */
  --border-subtle: rgba(243, 238, 226, 0.11);
  --border-hover: rgba(216, 188, 130, 0.34);
  --border-focus: #D8BC82;

  /* Typography / Warm Cream Inks */
  --text-primary: #F3EEE2;
  --text-secondary: rgba(243, 238, 226, 0.74);
  --text-muted: rgba(243, 238, 226, 0.52);

  /* Brand Signature Accents: Dune & Sand Gold + Leaf Facet */
  --accent: #D8BC82;
  --accent-hover: #E3CA96;
  --accent-active: #B8975A;
  --accent-gold: #B8975A;
  --accent-ink: #14301F;
  --accent-soft: rgba(216, 188, 130, 0.12);
  --accent-glow: rgba(184, 151, 90, 0.28);

  --leaf: #3F7360;
  --leaf-soft: rgba(63, 115, 96, 0.24);
  --leaf-pattern-1: #2C5E49;
  --leaf-pattern-2: #24543F;
  --leaf-pattern-3: #1B3F2B;

  /* Functional Status Accents Harmonized with Identity */
  --emerald: #6EC4A3;
  --emerald-soft: rgba(63, 115, 96, 0.25);
  --emerald-glow: rgba(63, 115, 96, 0.48);

  --amber: #D8BC82;
  --amber-soft: rgba(184, 151, 90, 0.16);

  --rose: #E5737A;
  --rose-soft: rgba(229, 115, 122, 0.14);

  --cyan: #D8BC82;

  /* Geometry & Rhythm */
  --header-h: 68px;
  --nav-h: 52px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Subtle Botanical Pattern (Hairlines #2C5E49 / #24543F / #1B3F2B over #14301F) */
  --bg-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='84' viewBox='0 0 84 84'%3E%3Cpath d='M0 42L42 0L84 42L42 84Z' fill='none' stroke='%232C5E49' stroke-width='0.8' stroke-opacity='0.26'/%3E%3Cpath d='M21 42L42 21L63 42L42 63Z' fill='none' stroke='%2324543F' stroke-width='0.75' stroke-opacity='0.34'/%3E%3Cpath d='M0 0L84 84M84 0L0 84' fill='none' stroke='%231B3F2B' stroke-width='0.7' stroke-opacity='0.48'/%3E%3C/svg%3E");

  /* Tactile Physics & Deep Shadows */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 6px 20px rgba(7, 19, 12, 0.45), 0 1px 2px rgba(7, 19, 12, 0.35);
  --shadow-hover: 0 10px 28px rgba(7, 19, 12, 0.62), 0 0 0 1px var(--border-hover);
}

/* Reset & Global Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: 'Readex Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image:
    radial-gradient(ellipse 85% 55% at 50% -15%, rgba(63, 115, 96, 0.14) 0%, transparent 65%),
    radial-gradient(ellipse 70% 50% at 10% 110%, rgba(184, 151, 90, 0.05) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, transparent 45%, rgba(9, 23, 15, 0.48) 100%),
    var(--bg-pattern);
  background-attachment: fixed, fixed, fixed, fixed;
  background-size: auto, auto, auto, 84px 84px;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  border: none;
  background: none;
}

.mono {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

/* ========================================================
   STUDIO SIDEBAR & DOCK LAYOUT
   ======================================================== */
.app-layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  position: relative;
  width: 100%;
  overflow: hidden;
}

.app-sidebar {
  width: 250px;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  flex-shrink: 0;
  background: rgba(15, 38, 24, 0.96);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
  transition: transform 0.28s var(--ease-spring);
}

.sidebar-header {
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge,
.studio-brand-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon-box,
.studio-logo-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card-hover);
  border: 1px solid rgba(216, 188, 130, 0.36);
  color: var(--leaf);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(7, 19, 12, 0.45), inset 0 1px 0 rgba(243, 238, 226, 0.06);
  transition: transform 0.18s var(--ease-spring), border-color 0.18s ease;
}

.brand-icon-box:hover,
.studio-logo-box:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.brand-info,
.studio-brand-texts {
  display: flex;
  flex-direction: column;
}

.brand-name,
.studio-brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-tag,
.studio-brand-tagline {
  font-size: 0.7rem;
  color: var(--accent-gold);
  letter-spacing: 0.03em;
}

/* Sidebar Channel Switcher Card */
.sidebar-channel-card {
  margin: 12px 14px 6px;
  padding: 10px 12px;
  background: rgba(27, 63, 43, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s var(--ease-spring);
  user-select: none;
  position: relative;
}

.sidebar-channel-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.sidebar-channel-card:active {
  transform: scale(0.98);
}

.channel-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.channel-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 1px solid var(--border-hover);
}

.channel-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--bg-card-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.channel-pulse-dot {
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald-glow);
  border: 1.5px solid var(--bg-surface);
}

.channel-pulse-dot.live {
  background: var(--rose);
  box-shadow: 0 0 8px rgba(229, 115, 122, 0.8);
  animation: pulse-beacon 1.6s infinite;
}

.channel-text-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.channel-display-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.channel-display-name {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.channel-role-badge.badge-owner {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(216, 188, 130, 0.34);
}

.channel-role-badge.badge-mod {
  background: var(--leaf-soft);
  color: var(--emerald);
  border: 1px solid rgba(63, 115, 96, 0.48);
}

.channel-sub-status {
  font-size: 0.72rem;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 4px;
}

.channel-switcher-arrow {
  color: var(--text-muted);
  transition: transform 0.18s ease;
}

.sidebar-channel-card:hover .channel-switcher-arrow {
  color: var(--text-primary);
  transform: translateY(1px);
}

/* Sidebar Nav */
.sidebar-nav {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  padding: 12px 10px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.16s var(--ease-spring);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(63, 115, 96, 0.18);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  right: -12px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-profile-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.user-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.user-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.user-name-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
  cursor: pointer;
}

.logout-icon-btn:hover {
  color: var(--rose);
  background: var(--rose-soft);
}

/* Viewport & Topbar Header */
.app-viewport {
  flex: 1;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.app-topbar {
  min-height: 64px;
  flex-shrink: 0;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-overlay);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 90;
  box-shadow: 0 4px 18px rgba(7, 19, 12, 0.35);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  background: rgba(27, 63, 43, 0.7);
  cursor: pointer;
  border: 1px solid var(--border-subtle);
}

.topbar-breadcrumbs {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar-page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-page-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-channel-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 14px;
  background: rgba(27, 63, 43, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease-spring);
}

.topbar-channel-btn > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-channel-btn .btn-badge,
.topbar-channel-btn svg {
  flex-shrink: 0;
}

.topbar-channel-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.topbar-channel-btn .btn-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

.topbar-channel-btn .btn-badge.owner {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(216, 188, 130, 0.36);
}

.topbar-channel-btn .btn-badge.mod {
  background: var(--leaf-soft);
  color: var(--emerald);
  border: 1px solid rgba(63, 115, 96, 0.45);
}

.main-stage {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 28px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.main-stage::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.main-stage::-webkit-scrollbar-track {
  background: transparent;
}

.main-stage::-webkit-scrollbar-thumb {
  background: rgba(216, 188, 130, 0.2);
  border-radius: var(--radius-pill);
}

.main-stage::-webkit-scrollbar-thumb:hover {
  background: rgba(216, 188, 130, 0.38);
}

/* Sidebar Drawer Backdrop for Mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 30, 19, 0.78);
  backdrop-filter: blur(6px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Metric Highlight Card (Home Top Viewer) */
.stat-metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.stat-footer-tag {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Studio Nav Bar (Legacy / Helpers) */
.studio-channel-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.studio-channel-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

.studio-channel-badge.owner {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(216, 188, 130, 0.34);
}

.studio-channel-badge.mod {
  background: var(--leaf-soft);
  color: var(--emerald);
  border: 1px solid rgba(63, 115, 96, 0.45);
}

/* Center / Right Deck Actions */
.studio-deck-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Global Bot Hardware Switch in Header */
.global-bot-toggle-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(27, 63, 43, 0.55);
  border: 1px solid var(--border-subtle);
}

.bot-switch-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.bot-switch-label.active {
  color: var(--emerald);
}

/* User & Profile Controls */
.studio-user-widget {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-raised);
}

/* Studio Horizontal Navigation Bar */
.studio-nav-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  position: sticky;
  top: var(--header-h);
  z-index: 95;
  scrollbar-width: none;
}

.studio-nav-bar::-webkit-scrollbar {
  display: none;
}

.studio-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.16s var(--ease-spring);
  white-space: nowrap;
}

.studio-nav-link:hover {
  color: var(--text-primary);
  background: rgba(63, 115, 96, 0.14);
}

.studio-nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
  background: var(--accent-soft);
}

.studio-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Studio Viewport */
.studio-stage {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 28px 80px;
  flex: 1;
}

/* ========================================================
   LANDING PAGE (FULL-PAGE STUDIO EXPERIENCE)
   ======================================================== */
.landing-page-wrap {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.landing-nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 32px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.landing-hero {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 46px 32px 60px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero-text-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.hero-pill-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--leaf-soft);
  border: 1px solid rgba(216, 188, 130, 0.28);
  color: var(--accent);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  width: fit-content;
  max-width: 100%;
}

.hero-heading {
  font-size: clamp(1.85rem, 3.6vw, 3.35rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}

.hero-heading-highlight {
  color: var(--accent);
}

.hero-lead-text {
  font-size: 1.12rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 620px;
}

.hero-cta-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.hero-main-btn {
  padding: 13px 30px;
  font-size: 1.02rem;
}

.hero-features-facts {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.fact-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 500;
}

.fact-item span.icon {
  color: var(--accent);
}

/* Live Interactive Simulated Stream Console (The Product Visual!) */
.terminal-chat-mock {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  box-shadow: 0 22px 60px -15px rgba(7, 19, 12, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 440px;
  min-width: 0;
  max-width: 100%;
}

.terminal-titlebar {
  background: rgba(20, 48, 31, 0.72);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.terminal-mac-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mac-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
}
.mac-dot.red { background: var(--rose); }
.mac-dot.yellow { background: var(--accent); }
.mac-dot.green { background: var(--leaf); }

.terminal-stream-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.terminal-feed-viewport {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-input);
}

.mock-msg-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(27, 63, 43, 0.38);
  font-size: 0.85rem;
  animation: fadeInMsg 0.3s var(--ease-spring);
  min-width: 0;
}

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

.mock-msg-line.bot-reply {
  background: var(--leaf-soft);
  border-right: 3px solid var(--accent-gold);
}

.mock-chatter-tag {
  font-weight: 700;
  color: var(--emerald);
  font-size: 0.82rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.mock-chatter-tag.bot {
  color: var(--accent);
}

.mock-msg-body {
  color: var(--text-primary);
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.terminal-interactive-bar {
  padding: 10px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.terminal-typewriter-text {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-weight: 600;
}

.terminal-blinking-cursor {
  animation: blinkCursor 0.8s infinite;
  color: var(--accent);
  font-weight: 700;
}

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

/* Landing Asymmetrical Bento Grid */
.landing-bento-section {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px 80px;
}

.bento-heading-row {
  margin-bottom: 24px;
}

.bento-section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.bento-section-sub {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.landing-bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.bento-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: all 0.2s var(--ease-spring);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-card:hover {
  border-color: var(--border-hover);
  background: rgba(27, 63, 43, 0.92);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.bento-card.span-7 { grid-column: span 7; }
.bento-card.span-5 { grid-column: span 5; }
.bento-card.span-6 { grid-column: span 6; }
.bento-card.span-4 { grid-column: span 4; }
.bento-card.span-12 { grid-column: span 12; }

.bento-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bento-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--leaf-soft);
  border: 1px solid rgba(63, 115, 96, 0.4);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.bento-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.bento-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================================
   COCKPIT BENTO GRID & WIDGETS (HOME / OVERVIEW)
   ======================================================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

.pro-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: all 0.18s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.pro-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.card-title-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--leaf-soft);
  border: 1px solid rgba(63, 115, 96, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.1rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Live Broadcast Hero Cockpit */
.live-broadcast-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-right: 4px solid var(--accent-gold);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.live-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.live-info-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stream-preview-box {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--bg-card-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border: 1px solid rgba(216, 188, 130, 0.22);
}

.stream-details-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stream-title-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stream-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stream-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(27, 63, 43, 0.6);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  border: 1px solid var(--border-subtle);
}

.live-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ================= Buttons ================= */
.btn-pro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s var(--ease-spring);
  background: rgba(27, 63, 43, 0.65);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  white-space: nowrap;
}

.btn-pro:hover {
  background: rgba(44, 94, 73, 0.65);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-pro:active {
  transform: scale(0.98);
}

.btn-pro.primary {
  background: linear-gradient(135deg, #D8BC82 0%, #B8975A 100%);
  color: var(--accent-ink);
  font-weight: 700;
  border-color: var(--accent);
  box-shadow: 0 3px 12px var(--accent-glow);
}

.btn-pro.primary:hover {
  background: linear-gradient(135deg, #E3CA96 0%, #C6A464 100%);
  border-color: var(--accent-hover);
  box-shadow: 0 5px 16px var(--accent-glow);
}

.btn-pro.danger {
  background: var(--rose-soft);
  color: #F2A1A6;
  border-color: rgba(229, 115, 122, 0.34);
}

.btn-pro.danger:hover {
  background: #C94A53;
  color: var(--text-primary);
  border-color: #C94A53;
}

.btn-pro.success {
  background: var(--leaf-soft);
  color: var(--emerald);
  border-color: rgba(63, 115, 96, 0.45);
}

.btn-pro.success:hover {
  background: var(--leaf);
  color: var(--text-primary);
}

.btn-pro.sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-pro.icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ================= Status Pills ================= */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 100%;
  border: 1px solid var(--border-subtle);
  background: rgba(27, 63, 43, 0.52);
}

.status-pill.online {
  color: var(--emerald);
  border-color: rgba(63, 115, 96, 0.48);
  background: var(--emerald-soft);
}

.status-pill.live-broadcast {
  color: var(--rose);
  border-color: rgba(229, 115, 122, 0.38);
  background: var(--rose-soft);
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.status-pill.live-broadcast .status-indicator-dot {
  animation: pulse-beacon 1.4s infinite;
}

@keyframes pulse-beacon {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(229, 115, 122, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(229, 115, 122, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(229, 115, 122, 0); }
}

/* ================= Tables ================= */
.table-responsive-box {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cmd-response-cell {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pro-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: right;
}

.pro-table th {
  padding: 11px 14px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.pro-table td {
  padding: 13px 14px;
  font-size: 0.88rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(243, 238, 226, 0.055);
  vertical-align: middle;
}

.pro-table tr:hover td {
  background: rgba(63, 115, 96, 0.14);
}

.pro-table tr:last-child td {
  border-bottom: none;
}

.empty-state-cell {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Command Pill Badge */
.command-name-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(216, 188, 130, 0.32);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.86rem;
  direction: ltr;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.15s var(--ease-spring);
}

.command-name-badge:hover {
  background: rgba(216, 188, 130, 0.2);
  border-color: var(--accent);
}

.role-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(27, 63, 43, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* ================= Switch Toggle ================= */
.apple-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.apple-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.apple-switch-slider {
  position: absolute;
  inset: 0;
  background-color: rgba(243, 238, 226, 0.16);
  border-radius: var(--radius-pill);
  transition: all 0.22s var(--ease-spring);
}

.apple-switch-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  right: 3px;
  bottom: 3px;
  background-color: var(--text-primary);
  border-radius: var(--radius-pill);
  transition: transform 0.22s var(--ease-spring);
  box-shadow: 0 1px 3px rgba(7, 19, 12, 0.45);
}

.apple-switch input:checked + .apple-switch-slider {
  background-color: var(--leaf);
  box-shadow: inset 0 0 0 1px rgba(216, 188, 130, 0.25);
}

.apple-switch input:checked + .apple-switch-slider::before {
  transform: translateX(-20px);
  background-color: var(--accent);
}

/* ================= Inputs & Forms ================= */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.15s ease;
  width: 100%;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-soft);
  background: var(--bg-surface);
}

.form-textarea {
  resize: vertical;
  min-height: 85px;
  line-height: 1.6;
}

.form-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* Search Bar */
.search-input-wrap {
  position: relative;
  width: 260px;
}

.search-input-wrap input {
  padding-right: 34px;
}

.search-icon-pos {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Variable Chips */
.pill-chip-shelf {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.clay-chip {
  background: rgba(27, 63, 43, 0.65);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  direction: ltr;
  transition: all 0.15s ease;
}

.clay-chip:hover {
  background: var(--accent-soft);
  border-color: rgba(216, 188, 130, 0.42);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ================= Tabs Bar ================= */
.tabs-bar-shelf {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
  background: rgba(15, 38, 24, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 3px;
}

.tab-pill-btn {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s var(--ease-spring);
}

.tab-pill-btn:hover {
  color: var(--text-primary);
}

.tab-pill-btn.active {
  background: linear-gradient(135deg, #D8BC82 0%, #B8975A 100%);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ================= Leaderboard Podium ================= */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  padding: 20px 0 10px;
  margin-bottom: 20px;
}

.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1 1 0;
  max-width: 150px;
  min-width: 0;
}

.podium-avatar-wrap {
  position: relative;
  margin-bottom: 8px;
}

.podium-avatar {
  position: relative;
  overflow: hidden;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  border: 2px solid rgba(243, 238, 226, 0.16);
}

.podium-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.podium-rank-badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.podium-step.rank-1 .podium-avatar {
  width: 66px;
  height: 66px;
  border-color: #D8BC82;
  box-shadow: 0 0 22px rgba(216, 188, 130, 0.25);
}

.lb-user-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lb-row-avatar {
  position: relative;
  overflow: hidden;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-raised);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.lb-row-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.podium-step.rank-1 .podium-rank-badge { background: #D8BC82; color: #14301F; }
.podium-step.rank-2 .podium-avatar { border-color: #F3EEE2; }
.podium-step.rank-2 .podium-rank-badge { background: #CFCBBF; color: #14301F; }
.podium-step.rank-3 .podium-avatar { border-color: #B8975A; }
.podium-step.rank-3 .podium-rank-badge { background: #B8975A; color: #14301F; }

.podium-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-score {
  font-size: 0.78rem;
  color: var(--emerald);
  font-weight: 600;
}

/* ================= Live Chat Console Widget ================= */
.chat-console-box {
  display: flex;
  flex-direction: column;
  height: 480px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-console-box.chat-compact {
  height: clamp(290px, 44dvh, 370px);
}

.chat-console-box.chat-full {
  height: clamp(320px, 60dvh, 560px);
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.mod-add-row {
  display: flex;
  gap: 10px;
  max-width: 400px;
  flex-wrap: wrap;
}

.chat-stream-viewport {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(27, 63, 43, 0.35);
  transition: background 0.15s ease;
}

.chat-message-row:hover {
  background: rgba(44, 94, 73, 0.45);
}

.chat-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--accent);
}

.chat-message-body {
  flex: 1;
  min-width: 0;
}

.chat-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.chat-sender-name {
  font-weight: 700;
  font-size: 0.82rem;
}

.chat-timestamp {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.chat-content-text {
  font-size: 0.86rem;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.chat-input-bar {
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
}

/* ================= Channel Switcher Modal ================= */
.channel-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 30, 19, 0.84);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease-spring), visibility 0.22s;
}

.channel-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.channel-modal-container {
  width: 100%;
  max-width: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 54px -10px rgba(7, 19, 12, 0.88);
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.22s var(--ease-spring);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.channel-modal-overlay.open .channel-modal-container {
  transform: scale(1) translateY(0);
}

.channel-modal-header {
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(20, 48, 31, 0.72);
}

.channel-modal-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-modal-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--leaf-soft);
  border: 1px solid rgba(216, 188, 130, 0.34);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.channel-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.channel-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.channel-modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: rgba(27, 63, 43, 0.75);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.channel-modal-close:hover {
  background: var(--bg-card-raised);
  color: var(--text-primary);
}

.channel-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.channel-group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  padding: 0 4px;
}

.channel-list-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.channel-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s var(--ease-spring);
  text-align: right;
  position: relative;
}

.channel-picker-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.channel-picker-item.active {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.channel-picker-item.active::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 0;
  width: 3px;
  border-radius: 4px 0 0 4px;
  background: var(--accent);
}

.picker-left-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.picker-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 1px solid rgba(216, 188, 130, 0.25);
  flex-shrink: 0;
}

.picker-avatar-fallback {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-raised);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  flex-shrink: 0;
}

.picker-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.picker-channel-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.picker-channel-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.picker-right-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.current-active-tag {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(216, 188, 130, 0.34);
  display: flex;
  align-items: center;
  gap: 4px;
}

.channel-empty-box {
  padding: 16px;
  background: rgba(20, 48, 31, 0.55);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.channel-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(20, 48, 31, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ================= Toast Notification ================= */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 24px);
  text-align: center;
  background: var(--bg-overlay);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(7, 19, 12, 0.65);
  z-index: 9999;
  display: none;
  animation: slide-up-toast 0.22s var(--ease-spring);
}

#toast.good {
  border-color: rgba(63, 115, 96, 0.55);
  color: var(--emerald);
}

#toast.bad {
  border-color: rgba(229, 115, 122, 0.45);
  color: var(--rose);
}

@keyframes slide-up-toast {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ================= Responsive Layout ================= */
@media (max-width: 1080px) {
  .landing-hero {
    grid-template-columns: 1fr;
    padding-top: 30px;
  }
  .bento-card.span-7, .bento-card.span-5, .bento-card.span-6, .bento-card.span-4 {
    grid-column: span 12;
  }
  .col-8, .col-7, .col-6, .col-5, .col-4, .col-3 {
    grid-column: span 12;
  }
}

@media (max-width: 820px) {
  .app-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    box-shadow: -10px 0 30px rgba(7, 19, 12, 0.85);
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu-btn {
    display: flex;
    width: 42px;
    height: 42px;
  }
  .app-topbar {
    padding: 10px 14px;
    min-height: 60px;
    height: auto;
    flex-wrap: wrap;
  }
  #top-stream-status,
  #top-bot-status {
    display: none;
  }
  .topbar-channel-btn {
    max-width: min(58vw, 220px);
    padding: 6px 10px;
    gap: 6px;
  }
  .main-stage {
    padding: 16px 12px 60px;
  }
  .studio-top-deck {
    padding: 0 16px;
  }
  .studio-stage {
    padding: 16px 12px 60px;
  }
  .global-bot-toggle-strip {
    display: none;
  }
  .landing-nav {
    padding: 12px 16px;
  }
  .landing-hero {
    padding: 24px 16px 40px;
  }
  .landing-bento-section {
    padding: 0 16px 60px;
  }
}

/* Compatibility & Helpers */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s var(--ease-spring);
  background: rgba(27, 63, 43, 0.65);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
}

.btn:hover {
  background: rgba(44, 94, 73, 0.65);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(135deg, #D8BC82 0%, #B8975A 100%);
  color: var(--accent-ink);
  font-weight: 700;
  border-color: var(--accent);
}

/* ================= Ignored Bots & Exclusions Card ================= */
.ignored-bots-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 16px;
}

.ignored-bots-form .form-input {
  flex: 1;
  min-width: 0;
  direction: ltr;
  text-align: left;
}

.ignored-bots-form .form-input:placeholder-shown {
  direction: rtl;
  text-align: right;
}

.ignored-section {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.ignored-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.bot-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bot-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: var(--radius-md);
  background: rgba(27, 63, 43, 0.55);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.16s var(--ease-spring);
}

.bot-chip:hover {
  background: rgba(44, 94, 73, 0.65);
  border-color: var(--border-hover);
}

.bot-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.bot-chip.system .bot-chip-dot {
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald-glow);
}

.bot-chip.custom .bot-chip-dot {
  background: var(--accent);
}

.bot-chip-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  direction: ltr;
}

.bot-chip-tag {
  font-size: 0.68rem;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.bot-chip-rm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s var(--ease-spring);
}

.bot-chip-rm:hover {
  background: var(--rose-soft);
  color: var(--rose);
}

.bot-chip-rm:active {
  transform: scale(0.92);
}

.ignored-note-box {
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: rgba(15, 38, 24, 0.7);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
}

@media (max-width: 480px) {
  .ignored-bots-form {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bot-chip, .bot-chip-rm, .btn-pro, .pro-card {
    transition: none;
  }
}

/* ================= Built-in Ready Commands (Compact) ================= */
.pro-table.compact th {
  padding: 8px 12px;
  font-size: 0.72rem;
}

.pro-table.compact td {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.pro-table.compact tr.editing td {
  background: rgba(216, 188, 130, 0.08);
}

.pro-table.compact tr.disabled td {
  opacity: 0.55;
}

.builtin-edit-panel {
  margin: 0 14px 12px;
  padding: 14px 16px;
  background: rgba(13, 32, 21, 0.94);
  border: 1px solid rgba(216, 188, 130, 0.36);
  border-radius: var(--radius-md);
}

.landing-page-wrap,
.landing-hero,
.landing-bento-section,
.bento-card,
.pro-card {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 640px) {
  .form-grid-2, .form-grid-4 {
    grid-template-columns: 1fr;
  }
  .pro-card {
    padding: 16px 14px;
  }
  .topbar-actions-right {
    gap: 8px;
  }
  .tabs-bar-shelf {
    border-radius: var(--radius-md);
  }
  .search-input-wrap {
    width: 100%;
  }
  .hide-sm {
    display: none;
  }
  .podium-container {
    gap: 8px;
    padding: 12px 0 6px;
  }
  .podium-avatar {
    width: 46px;
    height: 46px;
    font-size: 1.05rem;
  }
  .podium-step.rank-1 .podium-avatar {
    width: 56px;
    height: 56px;
  }
  .podium-name {
    font-size: 0.82rem;
  }
  .btn-pro, .btn, .tab-pill-btn {
    min-height: 40px;
  }
  .btn-pro.sm {
    min-height: 36px;
  }
  .pro-table th,
  .pro-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }
  .cmd-response-cell {
    max-width: 195px;
    white-space: normal;
    line-height: 1.45;
  }
  .channel-modal-overlay {
    padding: 12px;
  }
  .channel-modal-header {
    padding: 14px 16px;
  }
  .channel-modal-body {
    padding: 14px 16px;
  }
  .channel-modal-footer {
    padding: 12px 16px;
  }
  .landing-nav {
    padding: 12px 14px;
    gap: 10px;
  }
  .landing-nav .status-pill {
    display: none;
  }
  .landing-hero {
    padding: 20px 14px 34px;
    gap: 24px;
  }
  .hero-main-btn {
    width: 100%;
    padding: 12px 18px;
    font-size: 0.94rem;
  }
  .terminal-chat-mock {
    height: 380px;
  }
  .terminal-titlebar {
    padding: 10px 12px;
  }
  .landing-bento-section {
    padding: 0 14px 48px;
  }
}

@media (max-width: 480px) {
  .topbar-page-sub,
  #quick-test-msg-btn {
    display: none;
  }
  .topbar-channel-btn {
    max-width: calc(100vw - 140px);
    font-size: 0.8rem;
    padding: 5px 9px;
  }
  .topbar-channel-btn .btn-badge {
    font-size: 0.64rem;
    padding: 2px 6px;
  }
  .mod-add-row > * {
    flex: 1 1 100%;
    width: 100%;
  }
  .channel-modal-footer > * {
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
  }
  .ignored-bots-form {
    flex-direction: column;
  }
}

/* ================= Partner Showcase Card (Valla Live) ================= */
.valla-ad-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216, 188, 130, 0.28);
  background: linear-gradient(145deg, rgba(20, 48, 31, 0.94) 0%, rgba(13, 33, 21, 0.98) 100%);
  box-shadow: var(--shadow-card);
}

.valla-ad-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(216, 188, 130, 0.72) 50%, transparent 100%);
  pointer-events: none;
}

.valla-ad-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.38fr);
  gap: 22px;
  align-items: center;
}

.valla-ad-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.valla-ad-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.valla-partner-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(216, 188, 130, 0.34);
  letter-spacing: 0.02em;
}

.valla-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.valla-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(11, 29, 18, 0.9);
  border: 1px solid rgba(216, 188, 130, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-weight: 800;
  color: var(--accent);
}

.valla-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.valla-ad-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.valla-ad-sub {
  font-size: 0.78rem;
  color: var(--emerald);
  font-weight: 600;
}

.valla-ad-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.valla-ad-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.valla-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: rgba(15, 38, 24, 0.72);
  border: 1px solid rgba(216, 188, 130, 0.26);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}

.valla-ad-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.valla-preview-shell {
  min-width: 0;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 20, 13, 0.92);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(4, 12, 7, 0.55);
}

.valla-browser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(20, 48, 31, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.valla-browser-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.valla-browser-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(243, 238, 226, 0.22);
}

.valla-browser-dots span:nth-child(1) { background: rgba(229, 115, 122, 0.65); }
.valla-browser-dots span:nth-child(2) { background: rgba(216, 188, 130, 0.72); }
.valla-browser-dots span:nth-child(3) { background: rgba(114, 184, 151, 0.75); }

.valla-url-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(10, 26, 17, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  direction: ltr;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.valla-url-pill:hover {
  border-color: var(--border-hover);
  color: var(--accent);
}

.valla-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.valla-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(27, 63, 43, 0.55);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s var(--ease-spring), color 0.16s ease, border-color 0.16s ease;
}

.valla-icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.valla-icon-btn:active {
  transform: scale(0.95);
}

.valla-iframe-stage {
  position: relative;
  direction: ltr;
  width: 100%;
  height: 440px;
  background: #0a1410;
  overflow: hidden;
}

.valla-iframe-stage iframe {
  position: relative;
  z-index: 2;
  width: 133.34%;
  height: 133.34%;
  transform: scale(0.75);
  transform-origin: top left;
  border: 0;
  display: block;
  background: #0a1410;
  opacity: 0;
  transition: opacity 0.28s var(--ease-spring);
}

.valla-iframe-stage.loaded iframe {
  opacity: 1;
}

.valla-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  direction: rtl;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.86rem;
  background: radial-gradient(circle at 50% 35%, rgba(44, 94, 73, 0.25), #09150e 75%);
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.valla-iframe-stage.loaded .valla-fallback {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.valla-fallback img {
  max-width: 180px;
  max-height: 76px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

@media (max-width: 960px) {
  .valla-ad-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .valla-iframe-stage {
    height: 340px;
  }
  .valla-iframe-stage iframe {
    width: 153.85%;
    height: 153.85%;
    transform: scale(0.65);
  }
  .valla-ad-title {
    font-size: 1.1rem;
  }
  .valla-ad-actions .btn-pro {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .valla-icon-btn,
  .valla-iframe-stage iframe {
    transition: none;
  }
}
