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

:root {
  --primary: #3b82f6;
  --secondary: #22c55e;
  --dark-bg: rgba(20, 20, 20, 1);
  --light-bg: #ffffff;
  --text-dark: #f0f0f0;
  --text-light: #333;
  --shadow: rgba(0, 0, 0, 0.1);
  --border: #ccc;
  --addBotF: linear-gradient(135deg, #2AD0F5, #005A8B);

  /* Soft pill buttons — light theme */
  --btn-indigo-bg: #eef2ff;
  --btn-indigo-bg-hover: #e0e7ff;
  --btn-indigo-text: #4338ca;
  --btn-indigo-border: #c7d2fe;

  --btn-teal-bg: #ecfeff;
  --btn-teal-bg-hover: #cffafe;
  --btn-teal-text: #0e7490;
  --btn-teal-border: #a5f3fc;

  --btn-amber-bg: #fffbeb;
  --btn-amber-bg-hover: #fef3c7;
  --btn-amber-text: #b45309;
  --btn-amber-border: #fde68a;

  --btn-red-bg: #fef2f2;
  --btn-red-bg-hover: #fee2e2;
  --btn-red-text: #b91c1c;
  --btn-red-border: #fecaca;

  --btn-tab-track: #f1f5f9;
}

html {
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  color-scheme: light;
}

body {
  font-size: calc(1rem * 0.93);
}

html::-webkit-scrollbar {
  display: none;
}

body {
  background-color: var(--light-bg);
  color: var(--text-light);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  overflow-y: auto;
  transition: all 0.1s ease;
}

body.dark {
  background-color: var(--dark-bg);
  color: var(--text-dark);
  color-scheme: dark;

  /* Soft pill buttons — dark theme */
  --btn-indigo-bg: rgba(67, 56, 202, 0.24);
  --btn-indigo-bg-hover: rgba(79, 70, 229, 0.38);
  --btn-indigo-text: #c7d2fe;
  --btn-indigo-border: rgba(129, 140, 248, 0.5);

  --btn-teal-bg: rgba(8, 145, 178, 0.22);
  --btn-teal-bg-hover: rgba(8, 145, 178, 0.36);
  --btn-teal-text: #67e8f9;
  --btn-teal-border: rgba(34, 211, 238, 0.45);

  --btn-amber-bg: rgba(180, 83, 9, 0.22);
  --btn-amber-bg-hover: rgba(180, 83, 9, 0.36);
  --btn-amber-text: #fcd34d;
  --btn-amber-border: rgba(251, 191, 36, 0.45);

  --btn-red-bg: rgba(185, 28, 28, 0.22);
  --btn-red-bg-hover: rgba(185, 28, 28, 0.36);
  --btn-red-text: #fca5a5;
  --btn-red-border: rgba(248, 113, 113, 0.45);

  --btn-tab-track: rgba(255, 255, 255, 0.06);
}

/* Input styles */

.floating-label {
  position: relative;
  margin-bottom: 1.5rem;
}

.floating-label input,
.floating-label textarea {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  width: 100%;
  padding: 10px 0;
  outline: none;
  resize: none;
  transition: border-color 0.3s ease;
  font-family: inherit;
}

.floating-label label {
  position: absolute;
  top: 10px;
  left: 0;
  font-size: 1rem;
  color: #9ca3af;
  pointer-events: none;
  transition: all 0.3s ease;
}

.floating-label input:focus,
.floating-label textarea:focus {
  border-bottom-color: var(--primary);
}

.floating-label input:focus+label,
.floating-label input:not(:placeholder-shown)+label,
.floating-label textarea:focus+label,
.floating-label textarea:not(:placeholder-shown)+label {
  top: -8px;
  font-size: 0.7rem;
  color: var(--primary);
}

.page {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100% - 60px);
  padding: 15px;
  overflow-y: auto;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(100%);
  overscroll-behavior: contain;
}

.page.active {
  transform: translateX(0);
}

.page-exit {
  transform: translateX(-100%);
}


.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: rgba(255, 255, 255, 1);
  backdrop-filter: blur(10px);
  transform: translate3d(-100%, 0, 0);
  transition: transform 0.1s ease-out;
  z-index: 100;
  will-change: transform;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar a {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 16px;
  color: var(--text-light);
  transition: background 0.1s ease;
}

.sidebar a:hover {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 50;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Hide scrollbar cross-browser */
.scrollbar-hide {
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.floating-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--secondary);
  color: white;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 26px;
  box-shadow: 0 6px 14px var(--shadow);
  transition: all 0.3s ease;
  z-index: 50;
}

.floating-btn.hide {
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
}

/*
#mainContentPage{
  position: fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}*/

#bots-list {
  overflow-y: auto;
  flex-grow: 1;
  /*max-height: calc(100vh - 6rem);*/
  padding-bottom: 3rem;
  scrollbar-width: none;
  grid-auto-rows: min-content;
  align-content: start;
}

#bots-list::-webkit-scrollbar {
  display: none;
}


.navbar {
  position: fixed;
  top: 0.6rem;
  left: 0.7rem;
  right: 0.7rem;
  width: auto;
  z-index: 50;
  gap: 0.5rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Independent glass pills */
.navbar-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.6rem;
  padding: 0 0.35rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.navbar-group--title {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 1.25rem;
}

.navbar-group--left,
.navbar-group--right {
  flex: 0 0 auto;
}

body.dark .navbar-group {
  background: rgba(28, 28, 30, 0.55);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.navbar #head-text {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.navbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 9999px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

#menuToggle {
  padding: 0 !important;
}

#menuToggle i {
  font-size: 1.2rem;
  line-height: 1;
}

.navbar .flex.items-center.space-x-3 > button {
  flex-shrink: 0;
}

.navbar button i {
  font-size: 1.2rem;
}

.navbar button:hover {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.navbar button:active {
  transform: scale(0.92);
}

#themeIcon {
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: inline-block;
}


.text-gr {
  color: green !important;
}

.text-re {
  color: red !important;
}

.fa-2x {
  font-size: 1.75rem;
}


.shadow-lg {
  box-shadow: 0 10px 15px -3px var(--shadow), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#confirmModal {
  z-index: 1000;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.fadeIn {
  animation: fadeIn 0.3s forwards;
}

.fadeOut {
  animation: fadeOut 0.3s forwards;
}

body.dark .navbar button:hover {
  background: rgba(129, 140, 248, 0.18);
  color: #c7d2fe;
}

body.dark .sidebar {
  background: rgba(30, 30, 30, 0.95);
  color: var(--text-dark);
}

body.dark .sidebar a {
  color: var(--text-dark);
}

body.dark .sidebar a:hover {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
}


body.dark .floating-btn {
  background-color: #10b981;
}

body.dark input {
  background: transparent;
  color: var(--text-dark);
  border-color: #555;
}

body.dark .user-icon {
  color: white;
}

body.dark .accountDetails {
  background: gray;
}

.sidebar-account {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark .sidebar-account {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.sidebar-account-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.sidebar-account-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d1d5db;
  border: none;
  padding: 0;
  cursor: pointer;
}

.sidebar-account-avatar .user-icon {
  font-size: 1.75rem;
}

.sidebar-account-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}

.sidebar-account-name {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1.25;
  color: inherit;
}

.sidebar-account-name:hover {
  color: #4f46e5;
}

body.dark .sidebar-account-name:hover {
  color: #a5b4fc;
}

.sidebar-logout-btn {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  color: #E10D18;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.sidebar-logout-btn:hover {
  color: #b80a12;
  background: none;
  opacity: 1;
}

body.dark .sidebar-logout-btn {
  color: #f87171;
}

body.dark .sidebar-logout-btn:hover {
  color: #ef4444;
  background: none;
}

.text-red-600 {
  color: #E10D18 !important;
}

/* Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-fast 0.1s ease-out;
  pointer-events: none;
}

@keyframes ripple-fast {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

main {
  animation: fadeIn .1s ease;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
}


body.dark .menu {
  background: black;
}

body.dark .menu ul li a {
  color: #fff;
}

body.dark .menu ul li:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.bot-card {
  background: white;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #CCCEDE;
  cursor: pointer;
  /* hand cursor */
  height: 60px !important;
}

body.dark .bot-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #3E3F40;
}

/* Hover effect - only background change */
.bot-card:hover {
  background-color: rgba(245, 245, 245, 0.95);
  /* slightly darker in light mode */
  border-color: #B0B2C0;
  box-shadow: none !important;
  transform: none !important;
}

body.dark .bot-card:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #5A5B5D;
  box-shadow: none !important;
  transform: none !important;
}

#botV .bot-name {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.tab-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  margin-top: 30px;
  background-color: transparent;
}

.tab-buttons {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: transparent;
  padding: 6px 5px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-top: 14px;
}

.tab-buttons::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 15px;
  border: none;
  background-color: rgba(0, 0, 0, 0.08);
  color: grey;
  cursor: pointer;
  border-radius: 9px;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 13.5px;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab-btn i {
  font-size: 14px;
}

.tab-btn:hover:not(.active) {
  background-color: rgba(0, 0, 0, 0.12);
  color: #1e293b;
}

.tab-btn.active {
  background-color: rgba(0, 0, 0, 0.2);
  color: black;
}

.tab-content {
  flex-grow: 1;
  padding: 20px;
  margin-top: 112px;
  overflow-y: auto;
  border-radius: 8px;
}

.tab-content::-webkit-scrollbar {
  display: none;
}

body.dark .tab-btn {
  background: rgba(255, 255, 255, 0.1);
  color: gray;
}

body.dark .tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
}

body.dark .tab-btn.active {
  background: rgba(255, 255, 255, 0.22);
  color: white;
}

.bot-filter-tabs {
  --filter-gutter: 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 0 0 auto;
  margin-bottom: 16px;
  margin-left: calc(-1 * var(--filter-gutter));
  margin-right: calc(-1 * var(--filter-gutter));
  padding: 5px var(--filter-gutter) 9px;
  scroll-padding-inline: var(--filter-gutter);
}

.bot-filter-tabs::-webkit-scrollbar {
  display: none;
}

.bot-filter-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.bot-filter-tab.is-hidden {
  display: none;
}

.bot-filter-tab i {
  font-size: 13px;
  opacity: 0.85;
}

.bot-filter-tab:hover {
  background: #f3f4f6;
}

.bot-filter-tab.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.bot-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 11px;
  font-weight: 600;
}

.bot-filter-tab.is-active .bot-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

body.dark .bot-filter-tab {
  background: rgba(255, 255, 255, 0.06);
  border-color: #3E3F40;
  color: #e5e7eb;
}

body.dark .bot-filter-tab:hover {
  background: rgba(255, 255, 255, 0.12);
}

body.dark .bot-filter-tab.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

body.dark .bot-filter-count {
  background: rgba(255, 255, 255, 0.14);
}

body.dark .conMode {
  color: white;
  background: #000;
  backdrop-filter: blur(10px);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 1.5s infinite ease;
}

body.dark .skeleton {
  background: rgba(0, 0, 0, 0.5);
}

.error-box {
  background-color: transparent;
  border: 1px solid gray;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.floating-btndel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 60;
  background-color: red;
  color: white;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 26px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.no-errors {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 50vh;
}

#error-cards,
#dash,
#analytics,
#tool-con,
#settings-con,
#chats-con,
#env-con {
  flex-grow: 1;
  width: 100%;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow-y: auto;
}

#error-cards::-webkit-scrollbar,
#dash::-webkit-scrollbar,
#analytics::-webkit-scrollbar,
#tool-con::-webkit-scrollbar,
#settings-con::-webkit-scrollbar {
  display: none;
}

#error-cards {
  padding-bottom: 6rem;
}

.no-errors {
  font-size: 1.25rem;
  color: #34D399;
  font-weight: bold;
}

body.dark .no-errors p {
  color: #34D399
}

body.dark .err-text {
  color: gray;
}

.command-box {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #ADAFB3;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  /* hand cursor */
}

body.dark .command-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #3E3F40;
}

/* Hover effect - contrast shift */
.command-box:hover {
  background-color: rgba(240, 240, 240, 0.95);
  /* a bit darker than white */
  border-color: #9A9B9F;
}

body.dark .command-box:hover {
  background: rgba(255, 255, 255, 0.18);
  /* a bit lighter than dark */
  border-color: #5A5B5D;
}

.command-icon {
  height: 25px !important;
  width: 25px !important;
  color: #1D4ED8;
  margin-right: 10px;
}

body.dark .command-icon {
  color: dodgerblue;
}

.command-name-text {
  font-size: 1.25rem;
  color: #1F2937;
  font-weight: bold;
}

body.dark .command-name-text {
  color: white;
}

.floating-btnadd {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--addBotF);
  color: white;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 26px;
  box-shadow: 0 6px 14px var(--shadow);
  transition: all 0.3s ease;
}

.no-commands {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 30vh;
}

body.dark .no-commands p {
  color: gray;
}

.no-commands p {
  font-size: 1.25rem;
  color: gray;
  font-weight: bold;
  margin-top: 12px;
}

:root {
  --child-accent: #14b8a6;
  --child-accent-soft: rgba(20, 184, 166, 0.08);
  --child-accent-border: rgba(20, 184, 166, 0.28);
  --child-notice-title: #0f172a;
  --child-notice-text: #64748b;
}

body.dark {
  --child-accent-soft: rgba(20, 184, 166, 0.12);
  --child-accent-border: rgba(45, 212, 191, 0.35);
  --child-notice-title: #f1f5f9;
  --child-notice-text: #94a3b8;
}

.child-bot-notice-panel,
.child-bot-commands-notice,
.child-bot-env-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
}

.child-bot-notice-panel {
  border-radius: 0.75rem;
  border: 1px solid var(--child-accent-border);
  background: var(--child-accent-soft);
}

.child-bot-notice-icon {
  font-size: 3rem;
  color: var(--child-accent);
  margin-bottom: 1rem;
}

.child-bot-notice-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--child-notice-title);
}

.child-bot-notice-text {
  margin: 0.5rem 0 0;
  max-width: 28rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--child-notice-text);
}

.child-bot-parent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.55rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--btn-teal-border);
  background: var(--btn-teal-bg);
  color: var(--btn-teal-text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.child-bot-parent-btn:hover {
  background: var(--btn-teal-bg-hover);
  border-color: var(--btn-teal-text);
  box-shadow: 0 2px 8px var(--shadow);
}

.child-bot-parent-btn:focus-visible {
  outline: 2px solid var(--btn-teal-text);
  outline-offset: 2px;
}

.child-bot-parent-btn:active {
  transform: scale(0.98);
}

.dash-section--notice {
  margin-top: 0.75rem;
}

.dash-child-notice {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--child-accent-soft);
  border: 1px solid var(--child-accent-border);
  color: var(--child-notice-text);
  font-size: 0.875rem;
}

.dash-child-notice i {
  color: var(--child-accent);
}

.children-tab {
  max-width: 1000px;
  margin-left: 0;
  margin-right: auto;
}

@media (min-width: 1024px) {
  .children-tab {
    margin-left: 1.5rem;
  }
}

.children-tab-panel {
  border: 1px solid rgba(209, 213, 219, 0.9);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

body.dark .children-tab-panel {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(75, 85, 99, 0.55);
}

.children-tab-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.125rem 0.75rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
}

body.dark .children-tab-head {
  border-bottom-color: rgba(75, 85, 99, 0.45);
}

.children-tab-head-text {
  min-width: 0;
}

.children-tab-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.children-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.45rem;
  background: rgba(20, 184, 166, 0.12);
  color: #0d9488;
  font-size: 0.8rem;
}

body.dark .children-tab-title {
  color: #f9fafb;
}

body.dark .children-tab-icon {
  background: rgba(45, 212, 191, 0.16);
  color: #5eead4;
}

.children-tab-sub {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #6b7280;
}

body.dark .children-tab-sub {
  color: #9ca3af;
}

.children-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid var(--btn-teal-border);
  background: var(--btn-teal-bg);
  color: var(--btn-teal-text);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.children-refresh-btn:hover:not(:disabled) {
  background: var(--btn-teal-bg-hover);
  border-color: var(--btn-teal-text);
}

.children-refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.children-list {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

.children-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: none;
  border-top: 1px solid rgba(243, 244, 246, 0.95);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.children-list-item:first-child {
  border-top: none;
}

.children-list-item:hover {
  background: var(--btn-teal-bg);
}

.children-list-item:focus-visible {
  outline: 2px solid var(--btn-teal-text);
  outline-offset: -2px;
}

body.dark .children-list-item {
  border-top-color: rgba(255, 255, 255, 0.06);
}

body.dark .children-list-item:hover {
  background: var(--btn-teal-bg-hover);
}

.children-list-main {
  min-width: 0;
}

.children-list-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dark .children-list-name {
  color: #f3f4f6;
}

.children-list-id {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #9ca3af;
}

.children-list-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.children-list-status-dot {
  font-size: 0.42rem;
}

.children-list-status.is-on {
  color: #15803d;
  background: rgba(34, 197, 94, 0.14);
}

.children-list-status.is-on .children-list-status-dot {
  color: #22c55e;
}

.children-list-status.is-off {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}

.children-list-status.is-off .children-list-status-dot {
  color: #ef4444;
}

body.dark .children-list-status.is-on {
  color: #86efac;
  background: rgba(34, 197, 94, 0.18);
}

body.dark .children-list-status.is-on .children-list-status-dot {
  color: #4ade80;
}

body.dark .children-list-status.is-off {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
}

body.dark .children-list-status.is-off .children-list-status-dot {
  color: #f87171;
}

.children-list-chevron {
  font-size: 0.65rem;
  color: var(--btn-teal-text);
  opacity: 0.55;
}

body.dark .children-list-chevron {
  opacity: 0.75;
}

.children-tab-foot {
  padding: 0.75rem 1.125rem 1rem;
  border-top: 1px solid rgba(229, 231, 235, 0.85);
}

body.dark .children-tab-foot {
  border-top-color: rgba(75, 85, 99, 0.45);
}

.children-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.55rem;
  border: 1px solid var(--btn-teal-border);
  background: transparent;
  color: var(--btn-teal-text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.children-action-btn:hover {
  background: var(--btn-teal-bg-hover);
  border-color: var(--btn-teal-text);
}

body.dark .children-action-btn {
  color: var(--btn-teal-text);
}

body.dark .children-action-btn:hover {
  background: var(--btn-teal-bg-hover);
  border-color: var(--btn-teal-text);
}

.children-action-btn--inline {
  margin-top: 0.5rem;
}

.children-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 2rem 1.125rem;
  text-align: center;
  color: #9ca3af;
}

.children-state i {
  font-size: 1.35rem;
  color: #0d9488;
  opacity: 0.8;
}

body.dark .children-state i {
  color: #5eead4;
  opacity: 0.85;
}

.children-state-title {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #6b7280;
}

body.dark .children-state-title {
  color: #9ca3af;
}

.children-state-note {
  margin: 0;
  max-width: 22rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #9ca3af;
}

.children-state--error i {
  color: #9ca3af;
}

#command-cards {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  overflow-y: auto;
  flex-grow: 1;
  padding-bottom: 8rem;
  width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

@media (min-width: 640px) {
  #command-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #command-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#command-cards::-webkit-scrollbar {
  display: none;
}

#popupMessageBot {
  position: fixed;
  bottom: 60%;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 1000;
}

#popupMessageBot.bg-green-600 {
  background-color: #38a169;
}

#popupMessageBot.bg-red-600 {
  background-color: #e53e3e;
}

#popupMessageBot.opacity-100 {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.tab-content .hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.slide-in-right {
  animation: slideInRight 0.3s forwards;
}

.slide-out-right {
  animation: slideOutRight 0.3s forwards;
}

.slide-in-left {
  animation: slideInLeft 0.3s forwards;
}

.slide-out-left {
  animation: slideOutLeft 0.3s forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(100%);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

#loading-spinner,
#error-loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.transition-all-300 {
  transition: all 0.1s ease;
}

.command-input {
  border: 1px solid #d1d5db;
  background-color: #f9fafb;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  transition: all 0.3s ease;
}

.command-input:focus {
  border-color: #3b82f6;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}

body.dark .command-input {
  border-color: #4b5563;
  background-color: #1f2937;
  color: #f3f4f6;
}

body.dark .command-input:focus {
  border-color: #3b82f6;
  background-color: #111827;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.modal-container {
  max-height: 80vh;
  overflow-y: auto;
}

@media (max-height: 700px) {
  .modal-container {
    max-height: 65vh;
  }
}

.btn {
  position: relative;
  overflow: hidden;
}

/* For very small screens */
@media (max-height: 600px) {
  .sidebar {
    height: 100%;
    min-height: 100vh;
  }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
  width: none;
}

.btn:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn:focus:after,
.btn:hover:after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }

  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

.toggle-checkbox:checked {
  right: 0;
  border-color: #3b82f6;
  background-color: #3b82f6;
}

.toggle-checkbox:checked+.toggle-label {
  background-color: #bfdbfe;
}

#open-command-editor {
  z-index: 5001;
  position: relative;
}

#command-editor-overlay {
  z-index: 5002;
}

#command-modal {
  z-index: 5003;
  background: white;
  display: flex;
  flex-direction: column;
  max-height: 100dvh;
  overflow: hidden;
}

#command-modal .command-modal-header {
  flex-shrink: 0;
}

#command-modal .modal-container {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#command-modal .command-modal-footer {
  flex-shrink: 0;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

.sticky {
  z-index: 5004;
}

body.dark #command-modal {
  background: #1f2937;
}

body.dark .sticky {
  background: #1f2937;
}

.modal-container>div {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark .modal-container>div {
  background-color: #374151;
}



.action-btn {
  transition: all 0.2s ease;
}

.action-btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.card {
  padding: 24px;
  border: 2px solid #3b82f6;
  border-radius: 12px;
  background-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.card h3 {
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  color: #4338ca;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.card-title {
  color: #4338ca;
}

.platform-details {
  text-align: center;
}

.platform-details p {
  color: #1f2937;
  line-height: 1.6;
  margin-bottom: 16px;
  font-size: 16px;
}

.platform-details p:last-child {
  color: #4f46e5;
  font-weight: 600;
  font-size: 17px;
}


.category-btn {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.category-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.category-btn.active {
  color: var(--primary);
  font-weight: 600;
}

.category-btn.active::after {
  width: 100%;
}


.bot-image {
  height: 160px;
  object-fit: cover;
  width: 100%;
  transition: transform 0.5s ease;
}

.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 99;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.danger-text {
  color: red !important;
}

.sort-option.active {
  color: #2563eb !important;
  font-weight: 500 !important;
  background-color: rgba(37, 99, 235, 0.1);
}

.sort-icon.active {
  color: #2563eb !important;
  transform: scale(1.2) !important;
}

.filter-btn {
  position: relative;
}

.checkmark {
  font-weight: bold;
  color: #16a34a !important;
  /* green-600 */
}

/* Active state for sort / filter header buttons */
.btn-active {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

body.dark .btn-active {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
}



#loading-screen {
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}


.description {
  display: -webkit-box;
  line-clamp: unset;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all 0.3s ease-out;
}

.description.expanded {
  line-clamp: unset;
  -webkit-line-clamp: unset;
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.slide-down {
  animation: slideDown 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Editor */
.footer-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  padding: 8px 0;
  border-radius: 0;
  transition: all 0.2s ease;
}

.footer-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.dark .footer-button:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.footer-button i {
  font-size: 1.1rem;
  margin-bottom: 3px;
}

.footer-button span {
  font-size: 1rem;
}

.separator {
  width: 1px;
  height: 100%;
  background-color: #e5e7eb;
}

.dark .separator {
  background-color: #4b5563;
}

.footer-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.footer-button:disabled:hover {
  background-color: transparent;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 10px;
  width: 200px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 20;
}

.dark .dropdown-menu {
  background-color: #374151;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  color: #4b5563;
  transition: background-color 0.2s;
}

.dark .dropdown-item {
  color: #d1d5db;
}

.dropdown-item:hover {
  background-color: #f3f4f6;
}

.dark .dropdown-item:hover {
  background-color: #4b5563;
}

.dropdown-item i {
  margin-right: 10px;
  width: 18px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background-color: #e5e7eb;
  margin: 6px 0;
}

.dark .dropdown-divider {
  background-color: #4b5563;
}

.command-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.command-name:hover {
  color: #3b82f6;
}

.dark .command-name:hover {
  color: #60a5fa;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.spinner {
  border: 6px solid #ccc;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 0.8s linear infinite;
}

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

/* Command Editor Modal */
.command-editor-modal {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  max-height: 92dvh;
  background-color: white;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transition: bottom 0.4s ease;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dark .command-editor-modal {
  background-color: #1f2937;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.command-editor-modal.show {
  bottom: 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0;
  padding: 15px 16px 10px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  background-color: inherit;
  z-index: 10;
}

.dark .modal-header {
  border-bottom: 1px solid #4b5563;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  /* slightly smaller */
  cursor: pointer;
  color: #6b7280;
}

.dark .modal-close {
  color: #9ca3af;
}

.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 0.875rem;
  /* smaller font */
  color: #374151;
}

.dark .form-label {
  color: #d1d5db;
}

.form-input,
.form-input:focus,
.form-input textarea {
  width: 100%;
  padding: 8px;
  /* smaller input */
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: white;
  color: #111827;
  font-size: 0.875rem;
  /* smaller font */
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dark .form-input {
  background-color: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}


.form-input.error {
  border-color: #ef4444;
}

.error-text {
  color: #ef4444;
  font-size: 0.75rem;
  /* smaller font */
  margin-top: 3px;
  display: none;
}

.error-text.show {
  display: block;
}

.form-checkbox {
  margin-right: 6px;
  accent-color: #3b82f6;
}

.modal-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
}

.command-editor-section {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.875rem;
  margin-bottom: 0.875rem;
}

.dark .command-editor-section {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.command-editor-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.dark .command-editor-label {
  color: #e5e7eb;
}

.command-editor-sublabel {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4b5563;
}

.dark .command-editor-sublabel {
  color: #d1d5db;
}

.command-editor-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #6b7280;
}

.dark .command-editor-hint {
  color: #9ca3af;
}

.command-editor-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(229, 231, 235, 0.9);
}

.dark .command-editor-toggle-row {
  background: rgba(17, 24, 39, 0.35);
  border-color: rgba(75, 85, 99, 0.45);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.command-editor-modal .modal-actions,
.editor-preferences-modal .modal-actions {
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid #e5e7eb;
  background-color: inherit;
}

.dark .command-editor-modal .modal-actions,
.dark .editor-preferences-modal .modal-actions {
  border-top-color: #4b5563;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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




.cm-editor {
  height: 100%;
  font-size: clamp(12px, 1.1vw, 16px);
  font-family: "Fira Code", "JetBrains Mono", "Cascadia Code", "Source Code Pro", "Consolas", monospace;
  transition: background-color 0.3s ease, color 0.3s ease;
}


/* Profile*/

.floating-labelProfile {
  position: relative;
  margin-bottom: 1rem;
}

.floating-labelProfile input,
.floating-labelProfile textarea {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  width: 100%;
  padding: 6px 0;
  outline: none;
  resize: none;
  transition: border-color 0.3s ease;
  font-family: inherit;
  font-size: 0.95rem;
}

.floating-labelProfile label {
  position: absolute;
  top: 6px;
  left: 0;
  font-size: 0.95rem;
  color: #9ca3af;
  pointer-events: none;
  transition: all 0.3s ease;
}

.floating-labelProfile input:focus,
.floating-labelProfile textarea:focus {
  border-bottom-color: var(--primary);
}

.floating-labelProfile input:focus+label,
.floating-labelProfile input:not(:placeholder-shown)+label,
.floating-labelProfile textarea:focus+label,
.floating-labelProfile textarea:not(:placeholder-shown)+label {
  top: -8px;
  font-size: 0.7rem;
  color: var(--primary);
}

/* Bio markdown (parsed) */
.bio-md {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #374151;
  word-wrap: break-word;
}

.bio-md > :first-child {
  margin-top: 0;
}

.bio-md > :last-child {
  margin-bottom: 0;
}

.bio-md h1,
.bio-md h2,
.bio-md h3,
.bio-md h4,
.bio-md h5,
.bio-md h6 {
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
  margin: 1rem 0 0.45rem;
}

.bio-md h1 { font-size: 1.35rem; }
.bio-md h2 {
  font-size: 1.15rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid rgba(99, 102, 241, 0.18);
}
.bio-md h3 { font-size: 1.02rem; }
.bio-md h4 { font-size: 0.95rem; }
.bio-md h5,
.bio-md h6 { font-size: 0.88rem; }

.bio-md p {
  margin: 0 0 0.7rem;
}

.bio-md a {
  color: #4f46e5;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bio-md a:hover {
  color: #4338ca;
}

.bio-md a.bio-ext-link::after {
  content: '↗';
  display: inline-block;
  margin-left: 0.15em;
  font-size: 0.82em;
  opacity: 0.55;
  text-decoration: none;
}

.bio-md u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bio-md strong,
.bio-md b {
  font-weight: 600;
  color: #111827;
}

.bio-md em,
.bio-md i:not([class]) {
  font-style: italic;
}

.bio-md ul,
.bio-md ol {
  margin: 0 0 0.75rem;
  padding-left: 1.35rem;
}

.bio-md ul {
  list-style: disc;
}

.bio-md ol {
  list-style: decimal;
}

.bio-md li {
  margin-bottom: 0.25rem;
}

.bio-md li > ul,
.bio-md li > ol {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.bio-md del,
.bio-md s {
  text-decoration: line-through;
  color: #9ca3af;
}

.bio-md mark {
  background: linear-gradient(120deg, #fef08a 0%, #fde68a 100%);
  color: #713f12;
  padding: 0.05rem 0.2rem;
  border-radius: 3px;
}

.bio-md sub,
.bio-md sup {
  font-size: 0.75em;
  line-height: 0;
}

.bio-md :not(pre) > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86em;
  background: #eef2ff;
  color: #4338ca;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  border: 1px solid #e0e7ff;
}

.bio-md .bio-code-block {
  margin: 0.85rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1e293b;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.bio-md .bio-code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border-bottom: 1px solid #0f172a;
}

.bio-md .bio-code-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.bio-md .bio-code-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
}

.bio-md .bio-code-dots i:nth-child(1) { background: #f87171; }
.bio-md .bio-code-dots i:nth-child(2) { background: #fbbf24; }
.bio-md .bio-code-dots i:nth-child(3) { background: #4ade80; }

.bio-md .bio-code-lang {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.bio-md pre {
  margin: 0;
  padding: 0.85rem 1rem;
  background: #0f172a;
  border: none;
  border-radius: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #475569 transparent;
}

.bio-md pre code {
  display: block;
  background: none;
  padding: 0;
  border: none;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre;
}

.bio-md pre code.hljs {
  background: transparent;
}

.bio-md .hljs-comment,
.bio-md .hljs-quote { color: #64748b; font-style: italic; }
.bio-md .hljs-keyword,
.bio-md .hljs-selector-tag,
.bio-md .hljs-built_in { color: #c084fc; }
.bio-md .hljs-string,
.bio-md .hljs-regexp,
.bio-md .hljs-addition { color: #86efac; }
.bio-md .hljs-number,
.bio-md .hljs-literal { color: #fbbf24; }
.bio-md .hljs-title,
.bio-md .hljs-section,
.bio-md .hljs-name { color: #7dd3fc; }
.bio-md .hljs-attr,
.bio-md .hljs-attribute,
.bio-md .hljs-variable,
.bio-md .hljs-template-variable { color: #fdba74; }
.bio-md .hljs-type,
.bio-md .hljs-class .hljs-title { color: #f9a8d4; }
.bio-md .hljs-symbol,
.bio-md .hljs-bullet,
.bio-md .hljs-link { color: #93c5fd; }
.bio-md .hljs-meta { color: #94a3b8; }
.bio-md .hljs-deletion { color: #fca5a5; }
.bio-md .hljs-emphasis { font-style: italic; }
.bio-md .hljs-strong { font-weight: 600; }

.bio-md blockquote {
  margin: 0.85rem 0;
  padding: 0.65rem 0.9rem 0.65rem 1rem;
  border-left: 4px solid #6366f1;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
  border-radius: 0 8px 8px 0;
  color: #6b7280;
}

.bio-md blockquote blockquote {
  margin-top: 0.5rem;
  border-left-color: #818cf8;
}

.bio-md hr {
  margin: 1.1rem 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c7d2fe, #6366f1, #c7d2fe, transparent);
}

.bio-md img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 0.65rem 0;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.bio-md .bio-photo-collage {
  display: grid;
  gap: 4px;
  margin: 0.75rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
  background: #f8fafc;
}

.bio-md .bio-photo-cell {
  margin: 0;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.bio-md .bio-photo-cell img {
  width: 100%;
  height: 100%;
  min-height: 88px;
  object-fit: cover;
  display: block;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.25s ease;
}

.bio-md .bio-photo-cell:hover img {
  transform: scale(1.03);
}

.bio-md .bio-photo-collage--2 {
  grid-template-columns: 1fr 1fr;
}

.bio-md .bio-photo-collage--3 {
  grid-template-columns: 1.25fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.bio-md .bio-photo-collage--3 .bio-photo-cell:first-child {
  grid-row: span 2;
}

.bio-md .bio-photo-collage--3 .bio-photo-cell:first-child img {
  min-height: 180px;
}

.bio-md .bio-photo-collage--4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.bio-md .bio-photo-collage--5 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
}

.bio-md .bio-photo-collage--5 .bio-photo-cell:first-child {
  grid-column: span 3;
}

.bio-md .bio-photo-collage--5 .bio-photo-cell:first-child img {
  min-height: 140px;
  aspect-ratio: 16 / 7;
}

.bio-md .bio-photo-collage--many {
  grid-template-columns: repeat(3, 1fr);
}

.bio-md .bio-photo-collage--many .bio-photo-cell:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.bio-md .bio-photo-collage--many .bio-photo-cell:first-child img {
  min-height: 200px;
}

.bio-md .bio-table-wrap {
  margin: 0.85rem 0;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.bio-md table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.86rem;
}

.bio-md th,
.bio-md td {
  border: 1px solid #e5e7eb;
  padding: 0.45rem 0.6rem;
  text-align: left;
}

.bio-md th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 600;
  color: #1e293b;
}

.bio-md tr:nth-child(even) td {
  background: #f9fafb;
}

.bio-md ul.bio-task-list {
  list-style: none;
  padding-left: 0.25rem;
}

.bio-md li.bio-task-item {
  position: relative;
  display: block;
  padding-left: 1.65rem;
  margin-bottom: 0.4rem;
}

.bio-md li.bio-task-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.bio-md li.bio-task-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.18rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #fff;
  box-sizing: border-box;
}

.bio-md li.bio-task-todo::before {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.bio-md li.bio-task-done {
  color: #4b5563;
}

.bio-md li.bio-task-done::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.bio-md .bio-empty {
  opacity: 0.45;
  font-style: italic;
}

.bio-md .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0.75rem 0;
}

.bio-md .katex {
  font-size: 1em;
}

body.dark .bio-md {
  color: #d1d5db;
}

body.dark .bio-md h1,
body.dark .bio-md h2,
body.dark .bio-md h3,
body.dark .bio-md h4,
body.dark .bio-md h5,
body.dark .bio-md h6,
body.dark .bio-md strong,
body.dark .bio-md b {
  color: #f3f4f6;
}

body.dark .bio-md a {
  color: #818cf8;
}

body.dark .bio-md a:hover {
  color: #a5b4fc;
}

body.dark .bio-md h2 {
  border-bottom-color: rgba(129, 140, 248, 0.25);
}

body.dark .bio-md del,
body.dark .bio-md s {
  color: #6b7280;
}

body.dark .bio-md mark {
  background: linear-gradient(120deg, rgba(250, 204, 21, 0.35) 0%, rgba(251, 191, 36, 0.25) 100%);
  color: #fde68a;
}

body.dark .bio-md :not(pre) > code {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-color: rgba(129, 140, 248, 0.25);
}

body.dark .bio-md .bio-code-block {
  border-color: #0f172a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body.dark .bio-md blockquote {
  border-left-color: #818cf8;
  background: linear-gradient(90deg, rgba(129, 140, 248, 0.12) 0%, transparent 100%);
  color: #9ca3af;
}

body.dark .bio-md hr {
  background: linear-gradient(90deg, transparent, #4b5563, #818cf8, #4b5563, transparent);
}

body.dark .bio-md img {
  border-color: #374151;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

body.dark .bio-md .bio-photo-collage {
  border-color: #374151;
  background: #111827;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

body.dark .bio-md li.bio-task-todo::before {
  border-color: #4b5563;
  background: #1f2937;
}

body.dark .bio-md li.bio-task-done {
  color: #9ca3af;
}

body.dark .bio-md li.bio-task-done::before {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

body.dark .bio-md .bio-table-wrap {
  border-color: #374151;
}

body.dark .bio-md th,
body.dark .bio-md td {
  border-color: #374151;
}

body.dark .bio-md th {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  color: #e5e7eb;
}

body.dark .bio-md tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

body.dark .bio-md pre {
  background: #0f172a;
  border-color: transparent;
}



/* Selection mode styles */
.selection-mode .command-box {
  cursor: pointer;
}

.command-box.selection-possible {
  border-color: #e5e7eb;
  transition: all 0.2s ease;
}

.command-box.selected {
  border-color: #3b82f6;
  background-color: #f0f7ff;
}

.bulk-action-bar {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

/* Prevent text selection during long press */
.command-box {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Toast item */
.toast-editor-item {
  min-width: 220px;
  max-width: 320px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}

/* Visible state */
.toast-editor-item.show {
  opacity: 1;
  transform: translateY(0);
}

/* Variants */
.toast-editor-success {
  background: #22c55e;
  color: #fff;
}

.toast-editor-error {
  background: #ef4444;
  color: #fff;
}

.toast-editor-info {
  background: #3b82f6;
  color: #fff;
}

.toast-editor-warning {
  background: #facc15;
  color: #000;
}

.navbar button,
.navbar a,
.navbar i,
.navbar [role="button"],
#menuToggle,
#themeToggle {
  cursor: pointer !important;
}

#addBotBtnSearch {
  display: none !important;
}

/* ==========================================
   PC & Large Screen Optimizations (min-width: 1024px)
   ========================================== */
@media (min-width: 1024px) {

  /* Make the sidebar persistently visible on desktop */
  .sidebar {
    transform: translate3d(0, 0, 0) !important;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: none !important;
  }

  body.dark .sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Hide hamburger menu toggle since sidebar is always open */
  #menuToggle {
    display: none !important;
  }

  /* But if the toggle button has back-active (showing back icon), keep it visible! */
  #menuToggle.back-active {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Hide the empty left glass pill when the hamburger is hidden */
  .navbar-group--left {
    display: none !important;
  }

  /* Show it again only when the back button is active */
  .navbar-group--left:has(#menuToggle.back-active) {
    display: inline-flex !important;
  }

  /* Hide the dark overlay since the sidebar is not dynamic on desktop */
  .overlay {
    display: none !important;
  }

  /* Float the top navbar to the right of the sidebar with breathing room */
  .navbar {
    left: calc(280px + 1rem) !important;
    right: 1rem !important;
    width: auto !important;
  }

  /* Offset all primary page containers to the right of the sidebar */
  #mainContent,
  #profilePage,
  #profilePageSettings,
  #apiPage,
  #helpPage,
  #recoveryPage,
  #addBotPage,
  #devInfoPage,
  #botDashPage,
  #storePage,
  #donationPage {
    margin-left: 280px !important;
    width: calc(100% - 280px) !important;
  }

  /* Offset tab buttons and tab content for the bot dashboard */
  .tab-buttons {
    left: 280px !important;
    right: 0 !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    display: flex !important;
    justify-content: flex-start !important;
  }

  .tab-content {
    left: 280px !important;
    right: 0 !important;
  }

  /* Prevent tab contents from stretching full width on desktop screen sizes */
  #botInfoContainer,
  #analyticsContainer,
  #command-folder-bar,
  #error-cards,
  .tab-content>.search-bar-container,
  #command-cards,
  #settings-con,
  #tool-con,
  #env-con,
  #chats-con {
    max-width: 1000px !important;
    margin-left: 24px !important;
    margin-right: auto !important;
  }

  #addBotBtnSearch {
    display: flex !important;
  }
}

/* CodeMirror Search & Replace Panel Styling */
.cm-panel.cm-search {
  background-color: #f1f5f9 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  padding: 6px 10px !important;
  font-family: inherit !important;
  display: flex !important;
  flex-flow: row wrap !important;
  gap: 6px !important;
  align-items: center !important;
}

.dark .cm-panel.cm-search {
  background-color: #21252b !important;
  border-bottom: 1px solid #181a1f !important;
  color: #abb2bf !important;
}

.cm-panel.cm-search label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  cursor: pointer !important;
}

.dark .cm-panel.cm-search label {
  color: #abb2bf !important;
}

.cm-panel.cm-search input[type="text"],
.cm-panel.cm-search .cm-textfield {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  color: #0f172a !important;
  outline: none !important;
  transition: all 0.2s ease-in-out !important;
  min-width: 150px !important;
}

.dark .cm-panel.cm-search input[type="text"],
.dark .cm-panel.cm-search .cm-textfield {
  background-color: #282c34 !important;
  border-color: #3e4451 !important;
  color: #abb2bf !important;
}

.cm-panel.cm-search input[type="text"]:focus,
.cm-panel.cm-search .cm-textfield:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

.dark .cm-panel.cm-search input[type="text"]:focus,
.dark .cm-panel.cm-search .cm-textfield:focus {
  border-color: #528bff !important;
  box-shadow: 0 0 0 2px rgba(82, 139, 255, 0.25) !important;
}

.cm-panel.cm-search button,
.cm-panel.cm-search .cm-button {
  background-color: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.dark .cm-panel.cm-search button,
.dark .cm-panel.cm-search .cm-button {
  background-color: #282c34 !important;
  color: #abb2bf !important;
  border: 1px solid #3e4451 !important;
}

.cm-panel.cm-search button:hover,
.cm-panel.cm-search .cm-button:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.dark .cm-panel.cm-search button:hover,
.dark .cm-panel.cm-search .cm-button:hover {
  background-color: #353b45 !important;
  border-color: #528bff !important;
  color: #ffffff !important;
}

.cm-panel.cm-search button:focus,
.cm-panel.cm-search .cm-button:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

.dark .cm-panel.cm-search button:focus,
.dark .cm-panel.cm-search .cm-button:focus {
  border-color: #528bff !important;
  box-shadow: 0 0 0 2px rgba(82, 139, 255, 0.2) !important;
}

.cm-panel.cm-search button[name="close"] {
  background-color: transparent !important;
  color: #64748b !important;
  font-size: 15px !important;
  padding: 2px !important;
  font-weight: bold !important;
  border-radius: 50% !important;
  width: 24px !important;
  height: 24px !important;
  margin-left: auto !important;
  box-shadow: none !important;
  border: none !important;
}

.dark .cm-panel.cm-search button[name="close"] {
  color: #abb2bf !important;
  background-color: transparent !important;
  border: none !important;
}

.cm-panel.cm-search button[name="close"]:hover {
  background-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.dark .cm-panel.cm-search button[name="close"]:hover {
  background-color: #334155 !important;
  color: #f8fafc !important;
}

/* Match case, regex checkbox adjustments */
.cm-panel.cm-search input[type="checkbox"] {
  width: 13px !important;
  height: 13px !important;
  accent-color: #3b82f6 !important;
  cursor: pointer !important;
}

.dark .cm-panel.cm-search input[type="checkbox"] {
  accent-color: #528bff !important;
}

/* ==========================================
   PROFILE PAGE — Premium Redesign
   ========================================== */

/* Page container */
.profile-page {
  min-height: 100vh;
  padding-bottom: 3rem;
}

/* ---------- Hero Banner ---------- */
.profile-hero {
  position: relative;
  width: 100%;
  height: clamp(130px, 22vw, 220px);
  background: url('banner.gif') center/cover no-repeat;
  overflow: visible;
}

.profile-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
}

/* Edit button in hero */
.profile-edit-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}

.profile-edit-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

/* ---------- Avatar ---------- */
.profile-avatar-wrap {
  position: absolute;
  bottom: 0;
  left: clamp(16px, 4vw, 40px);
  transform: translateY(50%);
  z-index: 5;
}

.profile-avatar-ring {
  width: clamp(72px, 13vw, 112px);
  height: clamp(72px, 13vw, 112px);
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #38bdf8, #6366f1, #22d3ee);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid #fff;
}

body.dark .profile-avatar-img {
  border-color: #1e1e1e;
}

/* ---------- Profile Body ---------- */
.profile-body {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 clamp(12px, 4vw, 32px);
}

/* ---------- Identity Card ---------- */
.profile-identity {
  margin-top: calc(clamp(72px, 13vw, 112px) * 0.5 + 20px);
  padding: 22px 0 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

body.dark .profile-identity {
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.profile-name-row {
  width: 100%;
}

/* Display mode */
.profile-display-name {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

body.dark .profile-display-name {
  color: #f1f5f9;
}

.profile-display-username {
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 3px;
  font-weight: 500;
}

body.dark .profile-display-username {
  color: #94a3b8;
}

.profile-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.profile-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 99px;
  padding: 4px 10px;
  font-weight: 500;
}

body.dark .profile-meta-chip {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.profile-meta-chip i {
  color: #6366f1;
  font-size: 0.75rem;
}

body.dark .profile-meta-chip i {
  color: #818cf8;
}

/* ---------- Edit mode ---------- */
.profile-edit-mode {
  padding: 18px 0 4px;
}

.profile-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.profile-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

body.dark .profile-field-label {
  color: #64748b;
}

.profile-field-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
  background: #fff;
}

body.dark .profile-field-prefix-wrap {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.profile-field-prefix-wrap:focus-within {
  border-color: #6366f1;
}

.profile-field-prefix {
  padding: 0 10px;
  color: #94a3b8;
  font-size: 0.85rem;
  background: #f8fafc;
  height: 100%;
  display: flex;
  align-items: center;
  border-right: 1.5px solid #e2e8f0;
  min-height: 38px;
}

body.dark .profile-field-prefix {
  background: rgba(255, 255, 255, 0.05);
  border-right-color: rgba(255, 255, 255, 0.1);
  color: #64748b;
}

.profile-field-input {
  flex: 1;
  padding: 9px 12px;
  font-size: 0.88rem;
  border: none;
  outline: none;
  background: transparent;
  color: #0f172a;
}

body.dark .profile-field-input {
  color: #f1f5f9;
}

.profile-field-input.with-prefix {
  padding-left: 8px;
}

/* Standalone input (Full Name) */
.profile-field>.profile-field-input {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.2s;
}

body.dark .profile-field>.profile-field-input {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.profile-field>.profile-field-input:focus {
  border-color: #6366f1;
}

/* Edit actions row */
.profile-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.profile-btn-cancel {
  padding: 8px 20px;
  border-radius: 99px;
  border: 1.5px solid #e2e8f0;
  background: transparent;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-btn-cancel:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.dark .profile-btn-cancel {
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

body.dark .profile-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #f1f5f9;
}

.profile-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 99px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.profile-btn-save:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ---------- Profile Section (Bio etc.) ---------- */
.profile-section {
  margin-top: 22px;
  padding: 20px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

body.dark .profile-section {
  border-top-color: rgba(255, 255, 255, 0.07);
}

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

.profile-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 7px;
}

.profile-section-title i {
  color: #6366f1;
  font-size: 0.9rem;
}

body.dark .profile-section-title {
  color: #f1f5f9;
}

.profile-section-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  border: none;
  border-radius: 99px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-section-edit-btn:hover {
  background: rgba(99, 102, 241, 0.16);
}

body.dark .profile-section-edit-btn {
  color: #818cf8;
  background: rgba(129, 140, 248, 0.1);
}

body.dark .profile-section-edit-btn:hover {
  background: rgba(129, 140, 248, 0.18);
}

/* Bio display */
.profile-bio-display {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #334155;
  min-height: 2rem;
}

body.dark .profile-bio-display {
  color: #cbd5e1;
}

/* Bio edit area */
.profile-bio-edit {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-bio-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  min-height: 100px;
}

.profile-bio-textarea:focus {
  border-color: #6366f1;
}

body.dark .profile-bio-textarea {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

body.dark .profile-bio-textarea:focus {
  border-color: #818cf8;
}

.profile-bio-preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.profile-bio-preview {
  padding: 12px 14px;
  border: 1.5px dashed #e2e8f0;
  border-radius: 12px;
  min-height: 48px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #334155;
}

body.dark .profile-bio-preview {
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .profile-field-grid {
    grid-template-columns: 1fr;
  }

  .profile-field.full-width {
    grid-column: 1;
  }

  .profile-edit-btn span {
    display: none;
  }

  .profile-edit-btn {
    padding: 7px 10px;
  }
}

/* Empty state — bots list */
.no-bots-found {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
  width: 100%;
  gap: 6px;
}

.no-bots-found i {
  display: block;
  margin: 0 auto 8px;
}

.search-bar-container {
  width: 100%;
}

#chats-con {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

@media (min-width: 640px) {
  #chats-con {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #chats-con {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile gap/spacing optimizations */
@media (max-width: 1023px) {
  .tab-content {
    margin-top: 124px !important;
    padding: 12px 16px !important;
  }

  .command-box {
    margin-bottom: 0 !important;
  }

  #chats-con>div {
    margin-bottom: 0 !important;
  }
}

/* Quick Snippet Toolbar */
#editor-toolbar {
  scrollbar-width: none;
  /* Firefox */
}

#editor-toolbar::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.snippet-btn {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.snippet-btn i {
  font-size: 10px;
}

body.dark .snippet-btn {
  border-color: #3E3F40;
}

body.dark .snippet-btn:hover {
  background-color: #2D2E30;
}

/* Status Bar */
#editor-footers {
  flex-shrink: 0;
  border-top: 1px solid #e5e7eb;
  padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}

body.dark #editor-footers {
  border-top-color: #374151;
}

#editor-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 26px;
  min-height: 26px;
  padding: 0 12px;
  font-size: 11px;
  color: #6b7280;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

body.dark #editor-status-strip {
  background: #161b26;
  border-bottom-color: #374151;
  color: #9ca3af;
}

#editor-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  min-height: 42px;
  padding: 0 10px;
  background: #f9fafb;
  font-size: 12px;
  color: #6b7280;
  overflow: hidden;
}

body.dark #editor-actions-bar {
  background: #1e2330;
  color: #9ca3af;
}

/* CodeMirror Autocomplete Custom Sizing & Details styling */
.cm-tooltip-autocomplete {
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.cm-completionDetail {
  font-style: italic;
  opacity: 0.6;
  padding-left: 8px;
  font-size: 11px;
}

.cm-completionInfo {
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  padding: 8px 12px !important;
  font-size: 11px !important;
  max-width: 250px !important;
}

/* ═══════════════════════════════════════════
   IDE MULTI-FILE EDITOR LAYOUT
   ═══════════════════════════════════════════ */

/* Root container */
#codeEditor {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  background: #fff;
  color: #1f2937;
  font-family: system-ui, -apple-system, sans-serif;
}

body.dark #codeEditor {
  background: #111827;
  color: #f3f4f6;
}

#codeEditor.show {
  display: flex;
}

/* ── Header ── */
#ide-header {
  display: flex;
  align-items: center;
  height: 42px;
  min-height: 42px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  z-index: 10;
}

body.dark #ide-header {
  background: #1e2330;
  border-color: #374151;
}

.ide-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #6b7280;
  border-radius: 6px;
  margin: 0 2px;
  transition: background .15s, color .15s;
}

.ide-back-btn:hover {
  background: #e5e7eb;
  color: #111;
}

body.dark .ide-back-btn {
  color: #9ca3af;
}

body.dark .ide-back-btn:hover {
  background: #374151;
  color: #f3f4f6;
}

/* Tab bar */
#ide-tab-bar {
  flex: 1;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  height: 100%;
}

#ide-tab-bar::-webkit-scrollbar {
  display: none;
}

.ide-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  min-width: 90px;
  max-width: 160px;
  height: 100%;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  border-right: 1px solid #e5e7eb;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  transition: background .15s, color .15s;
  position: relative;
  flex-shrink: 0;
  user-select: none;
}

body.dark .ide-tab {
  color: #9ca3af;
  border-right-color: #374151;
}

.ide-tab:hover {
  background: #f3f4f6;
  color: #374151;
}

body.dark .ide-tab:hover {
  background: #253045;
  color: #d1d5db;
}

.ide-tab.active {
  background: #fff;
  color: #1f2937;
  border-bottom: 2px solid #3b82f6;
}

.ide-tab-errors {
  min-width: 72px;
  max-width: 100px;
  background: rgba(239, 68, 68, 0.06);
}

.ide-tab-errors .ide-tab-icon {
  color: #ef4444;
}

.ide-tab-errors:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.ide-tab-errors.active {
  background: #fff;
  color: #b91c1c;
  border-bottom-color: #ef4444;
}

body.dark .ide-tab-errors {
  background: rgba(248, 113, 113, 0.08);
}

body.dark .ide-tab-errors:hover {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

body.dark .ide-tab-errors.active {
  background: #111827;
  color: #fca5a5;
  border-bottom-color: #f87171;
}

body.dark .ide-tab.active {
  background: #111827;
  color: #f9fafb;
  border-bottom-color: #60a5fa;
}

.ide-tab-icon {
  font-size: 9px;
  color: #3b82f6;
  flex-shrink: 0;
}

.ide-tab-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ide-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}

.ide-tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: none;
  background: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 13px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s, background .15s;
}

.ide-tab:hover .ide-tab-close,
.ide-tab.active .ide-tab-close {
  opacity: 1;
}

.ide-tab-close:hover {
  background: #e5e7eb;
  color: #ef4444;
}

body.dark .ide-tab-close:hover {
  background: #374151;
  color: #f87171;
}

/* Header actions */
.ide-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  flex-shrink: 0;
  position: relative;
}

.ide-save-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: none;
  background: #3b82f6;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, opacity .15s;
}

#editor-actions-bar .ide-save-btn {
  margin-left: 4px;
}

.ide-save-btn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

body.dark .ide-save-btn:disabled {
  background: #1d4ed8;
  opacity: .5;
}

.ide-save-btn:not(:disabled):hover {
  background: #2563eb;
}

.ide-save-label {
  display: none;
}

@media (min-width: 480px) {
  .ide-save-label {
    display: inline;
  }
}

#editor-actions-bar .ide-save-label {
  display: inline;
}

.ide-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  color: #6b7280;
  border-radius: 6px;
  transition: background .15s;
}

.ide-menu-btn:hover {
  background: #e5e7eb;
}

body.dark .ide-menu-btn {
  color: #9ca3af;
}

body.dark .ide-menu-btn:hover {
  background: #374151;
}

/* Dropdown (reuse existing, just reposition inside .ide-header-actions) */
.ide-header-actions .dropdown-menu {
  top: calc(100% + 4px);
  right: 0;
}

/* ── Body Layout ── */
#ide-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* ── Sidebar ── */
#ide-sidebar {
  width: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f3f4f6;
  border-right: 1px solid #e5e7eb;
  transition: width .2s ease, min-width .2s ease;
  flex-shrink: 0;
  z-index: 5;
}

body.dark #ide-sidebar {
  background: #1a2035;
  border-right-color: #374151;
}

/* Desktop: sidebar always visible */
@media (min-width: 1024px) {
  #ide-sidebar {
    position: static;
    width: 180px;
    min-width: 180px;
    transform: none;
    box-shadow: none;
    z-index: 5;
  }
}

/* Mobile/Tablet: sidebar as fixed drawer overlay */
@media (max-width: 1023px) {
  #ide-sidebar {
    position: fixed;
    top: 42px;
    left: 0;
    bottom: 0;
    width: 240px;
    min-width: 240px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 50;
    box-shadow: none;
  }

  #ide-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
  }
}

#ide-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 49;
}

#ide-sidebar-overlay.show {
  display: block;
}

#ide-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #9ca3af;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

body.dark #ide-sidebar-header {
  border-color: #374151;
}

#ide-sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: #9ca3af;
  border-radius: 6px;
  font-size: 14px;
}

#ide-sidebar-close:hover {
  background: #e5e7eb;
  color: #374151;
}

body.dark #ide-sidebar-close:hover {
  background: #374151;
  color: #d1d5db;
}

@media (min-width: 1024px) {
  #ide-sidebar-close {
    display: none;
  }
}

#ide-sidebar-new,
#ide-sidebar-search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(59, 130, 246, 0.1);
  cursor: pointer;
  color: #3b82f6;
  border-radius: 6px;
  font-size: 13px;
  transition: background .15s, color .15s;
}

#ide-sidebar-new:hover,
#ide-sidebar-search:hover {
  background: #3b82f6;
  color: white;
}

body.dark #ide-sidebar-new,
body.dark #ide-sidebar-search {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
}

body.dark #ide-sidebar-new:hover,
body.dark #ide-sidebar-search:hover {
  background: #60a5fa;
  color: #1a2035;
}

#ide-sidebar-search.active {
  background: #3b82f6;
  color: white;
}

body.dark #ide-sidebar-search.active {
  background: #60a5fa;
  color: #1a2035;
}

#ide-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

#ide-sidebar-list::-webkit-scrollbar {
  width: 4px;
}

#ide-sidebar-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

body.dark #ide-sidebar-list::-webkit-scrollbar-thumb {
  background: #374151;
}

.ide-sidebar-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 1px;
}

.ide-sidebar-item i {
  font-size: 9px;
  color: #3b82f6;
  flex-shrink: 0;
}

.ide-sidebar-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark .ide-sidebar-item {
  color: #d1d5db;
}

.ide-sidebar-item:hover {
  background: #e5e7eb;
}

body.dark .ide-sidebar-item:hover {
  background: #253045;
}

.ide-sidebar-item.active {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

.ide-sidebar-item-errors {
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
  background: rgba(239, 68, 68, 0.06);
  color: #b91c1c;
  font-weight: 600;
}

.ide-sidebar-item-errors i {
  color: #ef4444;
}

.ide-sidebar-item-errors:hover {
  background: rgba(239, 68, 68, 0.12);
}

.ide-sidebar-item-errors.active {
  background: #fee2e2;
  color: #b91c1c;
}

body.dark .ide-sidebar-item-errors {
  border-bottom-color: #374151;
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

body.dark .ide-sidebar-item-errors.active {
  background: #3f1d1d;
  color: #fca5a5;
}

body.dark .ide-sidebar-item.active {
  background: #1e3a5f;
  color: #93c5fd;
}

.ide-sidebar-item.has-dot::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Main area ── */
#ide-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

#editor-container {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

#editor-container.hidden {
  display: none;
}

#ide-errors-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}

#ide-errors-view.hidden {
  display: none;
}

body.dark #ide-errors-view {
  background: #111827;
}

.ide-errors-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  background: #f9fafb;
}

body.dark .ide-errors-view-header {
  background: #1e2330;
  border-bottom-color: #374151;
}

.ide-errors-view-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
}

body.dark .ide-errors-view-title {
  color: #fca5a5;
}

.ide-errors-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
}

.ide-errors-refresh-btn:hover {
  background: #f3f4f6;
}

body.dark .ide-errors-refresh-btn {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

.ide-error-count-pos {
  color: #b91c1c;
  font-weight: 600;
}

body.dark .ide-error-count-pos {
  color: #fca5a5;
}

.ide-footers-errors-mode #undo-btn,
.ide-footers-errors-mode #redo-btn,
.ide-footers-errors-mode #edit-btn,
.ide-footers-errors-mode #save-btn,
.ide-footers-errors-mode #ide-refresh-btn {
  display: none;
}

/* Ensure CodeMirror fills the container */
#editor-container .cm-editor {
  height: 100%;
}

#editor-container .cm-scroller {
  overflow: auto;
  height: 100%;
}

/* ── Editor footers ── */
#status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

#status-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#ide-files-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  cursor: pointer;
  color: #6b7280;
  border-radius: 6px;
  font-size: 14px;
  transition: background .12s;
}

#ide-files-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

body.dark #ide-files-btn {
  color: #9ca3af;
}

body.dark #ide-files-btn:hover {
  background: #374151;
  color: #d1d5db;
}

@media (min-width: 1024px) {
  #ide-files-btn {
    display: none;
  }
}

.ide-status-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  cursor: pointer;
  color: #6b7280;
  border-radius: 6px;
  font-size: 14px;
  transition: background .12s, opacity .12s;
}

.ide-status-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.ide-status-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.ide-status-btn:disabled:hover {
  background: none;
}

body.dark .ide-status-btn {
  color: #9ca3af;
}

body.dark .ide-status-btn:hover {
  background: #374151;
  color: #d1d5db;
}

#edit-btn {
  width: 34px;
  height: 34px;
  font-size: 14px;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 6px;
  transition: all 0.2s ease;
}

#edit-btn:hover {
  background: #3b82f6;
  color: white !important;
}

body.dark #edit-btn {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
}

body.dark #edit-btn:hover {
  background: #60a5fa;
  color: #1e2330 !important;
}

.ide-pos {
  color: inherit;
  white-space: nowrap;
}

.ide-pos b {
  color: #374151;
  font-weight: 600;
}

body.dark .ide-pos b {
  color: #d1d5db;
}

#editor-word-count {
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Responsive ── */
@media (max-width: 479px) {
  #editor-status-strip {
    font-size: 10px;
    padding: 0 8px;
    gap: 6px;
  }

  #editor-word-count {
    display: block;
    font-size: 10px;
  }

  #editor-actions-bar .ide-save-btn {
    min-width: 72px;
    padding: 0 14px;
    height: 34px;
    font-size: 12px;
  }

  .ide-tab {
    min-width: 70px;
    padding: 0 8px;
    font-size: 11px;
  }

  .ide-tab-name {
    max-width: 60px;
  }
}

/* ── Privacy Mode ── */
#privacyToggle {
  transition: transform 0.15s ease, opacity 0.15s ease;
}

body.privacy-mode .privacy-mask {
  background-color: #d1d5db;
  /* gray-300 */
  color: transparent !important;
  border-radius: 4px;
  user-select: none !important;
  pointer-events: none !important;
}

body.dark.privacy-mode .privacy-mask {
  background-color: #4b5563;
  /* gray-600 */
}

/* ── Status Bar Responsiveness on Big Screens ── */
@media (min-width: 1024px) {
  #editor-status-strip {
    height: 28px;
    min-height: 28px;
    font-size: 12px;
    padding: 0 14px;
  }

  #editor-actions-bar {
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  #status-left {
    gap: 12px;
  }

  #status-right {
    gap: 8px;
  }

  .ide-status-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
    border-radius: 6px;
  }

  #edit-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-radius: 8px;
  }

  #editor-mode-indicator i {
    font-size: 7px !important;
  }
}

/* ── Editor Sidebar Item Actions & Dropdown ── */
.ide-sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
  overflow: visible;
  margin-bottom: 1px;
}

.ide-sidebar-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  color: #9ca3af;
  border-radius: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.ide-sidebar-item:hover .ide-sidebar-menu-btn,
.ide-sidebar-item.active .ide-sidebar-menu-btn {
  opacity: 1;
}

.ide-sidebar-menu-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #374151;
}

body.dark .ide-sidebar-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f3f4f6;
}

.ide-sidebar-dropdown {
  position: absolute;
  right: 8px;
  top: calc(100% + 2px);
  width: 110px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 60;
  padding: 4px 0;
}

body.dark .ide-sidebar-dropdown {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.ide-sidebar-dropdown-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 5px 10px;
  font-size: 11px;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.1s;
}

body.dark .ide-sidebar-dropdown-item {
  color: #d1d5db;
}

.ide-sidebar-dropdown-item:hover {
  background: #f3f4f6;
}

body.dark .ide-sidebar-dropdown-item:hover {
  background: #334155;
}

.ide-sidebar-dropdown-item.destructive {
  color: #ef4444;
}

body.dark .ide-sidebar-dropdown-item.destructive {
  color: #f87171;
}

/* ── Lint gutter — hidden by default, auto-increases when errors are present ── */
.cm-gutter-lint {
  width: 0px !important;
  min-width: 0px !important;
  overflow: hidden !important;
  transition: width 0.15s ease-in-out;
}

#editor-container.has-lint-errors .cm-gutter-lint {
  width: 14px !important;
  min-width: 14px !important;
}

#editor-container.has-lint-errors .cm-gutter-lint .cm-gutterElement {
  padding: 0 1px !important;
}

.ide-errors-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}

.ide-errors-loading {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.ide-no-errors {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 16px;
  color: #6b7280;
  text-align: center;
}

.ide-no-errors i {
  font-size: 28px;
  color: #22c55e;
}

.ide-no-errors p {
  font-size: 13px;
  margin: 0;
}

.ide-error-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  background: #f9fafb;
}

body.dark .ide-error-card {
  border-color: #374151;
  background: rgba(255, 255, 255, 0.04);
}

.ide-error-card-header {
  margin-bottom: 6px;
}

.ide-error-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ide-error-card-type {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}

body.dark .ide-error-card-type {
  color: #f3f4f6;
}

.ide-error-card-command {
  font-size: 11px;
  color: #3b82f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  flex-shrink: 0;
}

.ide-error-card-message {
  font-size: 12px;
  color: #4b5563;
  margin: 0 0 8px;
  word-break: break-word;
  line-height: 1.4;
}

body.dark .ide-error-card-message {
  color: #d1d5db;
}

.ide-error-stack {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  background: #fff;
}

.error-stack-wrap {
  position: relative;
}

.error-stack-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.error-stack-copy-btn:hover,
.error-stack-copy-btn:focus-visible {
  background: #f3f4f6;
  color: #374151;
}

.error-stack-wrap .stack-content,
.error-stack-wrap .ide-error-stack-pre {
  padding-right: 40px;
}

body.dark .error-stack-copy-btn {
  border-color: #4b5563;
  background: #374151;
  color: #9ca3af;
}

body.dark .error-stack-copy-btn:hover,
body.dark .error-stack-copy-btn:focus-visible {
  background: #4b5563;
  color: #e5e7eb;
}

body.dark .ide-error-stack {
  border-color: #374151;
  background: #111827;
}

.ide-error-stack-pre {
  margin: 0;
  padding: 8px;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: #374151;
  max-height: none;
}

.ide-error-stack-pre.collapsed {
  max-height: 72px;
  overflow: hidden;
}

body.dark .ide-error-stack-pre {
  color: #d1d5db;
}

.ide-error-expand-btn {
  width: 100%;
  border: none;
  border-top: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  padding: 4px;
  cursor: pointer;
}

body.dark .ide-error-expand-btn {
  border-top-color: #374151;
  background: #1f2937;
  color: #9ca3af;
}

.ide-error-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ide-error-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 11px;
  cursor: pointer;
}

.error-open-cmd-btn {
  max-width: min(220px, 100%);
  min-width: 0;
  overflow: hidden;
  gap: 4px;
}

.error-open-cmd-label {
  flex-shrink: 0;
}

.error-open-cmd-name {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-error-open-btn:hover {
  background: #f3f4f6;
}

body.dark .ide-error-open-btn {
  border-color: #4b5563;
  background: #374151;
  color: #e5e7eb;
}

body.dark .ide-error-open-btn:hover {
  background: #4b5563;
}

.ide-error-card-time {
  font-size: 10px;
  color: #9ca3af;
}

/* Donation page */
.donation-page {
  min-height: 100vh;
  padding: calc(56px + 1.25rem) 1.25rem 2.5rem;
  box-sizing: border-box;
}

.donation-wrap {
  max-width: 720px;
  margin: 0;
  width: 100%;
}

.donation-header {
  margin: 0 0 1.75rem;
}

.donation-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.35rem;
}

body.dark .donation-header h1 {
  color: #f9fafb;
}

.donation-lead {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.5;
}

body.dark .donation-lead {
  color: #9ca3af;
}

.donation-why {
  margin-bottom: 1.75rem;
}

.donation-why h2,
.donation-addresses h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin: 0 0 0.65rem;
}

body.dark .donation-why h2,
body.dark .donation-addresses h2 {
  color: #9ca3af;
}

.donation-why p {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #374151;
}

body.dark .donation-why p {
  color: #d1d5db;
}

.donation-why ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #4b5563;
}

body.dark .donation-why ul {
  color: #9ca3af;
}

.donation-why li + li {
  margin-top: 0.2rem;
}

.donation-addresses {
  margin-bottom: 1rem;
}

.donation-list {
  display: flex;
  flex-direction: column;
}

.donation-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #e5e7eb;
}

body.dark .donation-row {
  border-bottom-color: #3e3f40;
}

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

.donation-coin-img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-top: 0.1rem;
  border-radius: 50%;
}

.donation-row-body {
  flex: 1;
  min-width: 0;
}

.donation-row-top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.25rem;
}

.donation-row-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

body.dark .donation-row-label {
  color: #f3f4f6;
}

.donation-row-network {
  font-size: 0.72rem;
  color: #9ca3af;
}

.donation-row-address {
  display: block;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #4b5563;
  word-break: break-all;
  background: none;
  border: none;
  padding: 0;
}

.donation-row-address.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body.dark .donation-row-address {
  color: #9ca3af;
}

.donation-copy-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.donation-copy-btn:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

body.dark .donation-copy-btn:hover {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
}

.donation-note {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.45;
}

/* Help page */
.help-page {
  min-height: 100vh;
  padding: calc(56px + 1.25rem) 1.25rem 2.5rem;
  box-sizing: border-box;
}

.help-wrap {
  max-width: 720px;
  margin: 0;
  width: 100%;
}

.help-header {
  margin: 0 0 1.75rem;
}

.help-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.35rem;
}

body.dark .help-header h1 {
  color: #f9fafb;
}

.help-lead {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.5;
}

body.dark .help-lead {
  color: #9ca3af;
}

.help-section {
  margin-bottom: 1.5rem;
}

.help-section:last-of-type {
  margin-bottom: 1rem;
}

.help-section h2,
.help-resources h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin: 0 0 0.55rem;
}

body.dark .help-section h2,
body.dark .help-resources h2 {
  color: #9ca3af;
}

.help-card {
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  overflow: hidden;
}

body.dark .help-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.help-list {
  display: flex;
  flex-direction: column;
}

.help-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-bottom: 1px solid #e5e7eb;
  background: none;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.help-row:hover {
  background: #f9fafb;
  opacity: 1;
}

body.dark .help-row {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark .help-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

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

.help-row--button {
  font: inherit;
}

.help-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: 0.1rem;
  flex-shrink: 0;
  color: #6b7280;
  font-size: 1rem;
}

body.dark .help-row-icon {
  color: #9ca3af;
}

.help-row-body {
  flex: 1;
  min-width: 0;
}

.help-row-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.15rem;
}

body.dark .help-row-label {
  color: #f3f4f6;
}

.help-row-desc {
  display: block;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #6b7280;
}

body.dark .help-row-desc {
  color: #9ca3af;
}

.help-row-action {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: #9ca3af;
  font-size: 0.78rem;
}

.help-note {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #9ca3af;
}

body.dark .help-note {
  color: #6b7280;
}

/* IDE keyboard shortcuts modal */
.ide-shortcuts-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

body.dark .ide-shortcuts-modal {
  background: rgba(0, 0, 0, 0.6);
}

.ide-shortcuts-modal.show {
  opacity: 1;
  visibility: visible;
}

.ide-shortcuts-modal.hidden {
  display: none;
}

.ide-shortcuts-modal.show:not(.hidden) {
  display: flex;
}

.ide-shortcuts-panel {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}

.ide-shortcuts-modal.show .ide-shortcuts-panel {
  transform: translateY(0) scale(1);
}

body.dark .ide-shortcuts-panel {
  background: #1e2330;
  border-color: #374151;
  color: #f3f4f6;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.ide-shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

body.dark .ide-shortcuts-header {
  background: #1a2035;
  border-bottom-color: #374151;
}

.ide-shortcuts-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.ide-shortcuts-title-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  font-size: 0.85rem;
  flex-shrink: 0;
}

body.dark .ide-shortcuts-title-icon {
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
}

.ide-shortcuts-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

body.dark .ide-shortcuts-header h2 {
  color: #f9fafb;
}

.ide-shortcuts-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ide-shortcuts-close:hover {
  background: #e5e7eb;
  color: #111827;
}

body.dark .ide-shortcuts-close {
  color: #9ca3af;
}

body.dark .ide-shortcuts-close:hover {
  background: #374151;
  color: #f3f4f6;
}

.ide-shortcuts-body {
  padding: 0.75rem 1rem 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.ide-shortcuts-group + .ide-shortcuts-group {
  margin-top: 0.85rem;
}

.ide-shortcuts-group h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 0 0 0.4rem;
  padding: 0 0.15rem;
}

.ide-shortcuts-group h3 i {
  font-size: 0.62rem;
  opacity: 0.85;
}

body.dark .ide-shortcuts-group h3 {
  color: #9ca3af;
}

.ide-shortcuts-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
}

body.dark .ide-shortcuts-list {
  border-color: #374151;
  background: rgba(0, 0, 0, 0.15);
}

.ide-shortcuts-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

body.dark .ide-shortcuts-row {
  border-bottom-color: #374151;
}

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

.ide-shortcuts-label {
  font-size: 0.82rem;
  color: #374151;
}

body.dark .ide-shortcuts-label {
  color: #e5e7eb;
}

.ide-shortcuts-keys {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.ide-shortcuts-keys span {
  font-size: 0.7rem;
  color: #9ca3af;
  user-select: none;
}

.ide-shortcuts-keys kbd,
.ide-shortcuts-footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.18rem 0.42rem;
  font-size: 0.68rem;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.2;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-bottom-width: 2px;
  border-radius: 5px;
  color: #374151;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

body.dark .ide-shortcuts-keys kbd,
body.dark .ide-shortcuts-footer kbd {
  background: #2d3748;
  border-color: #4b5563;
  border-bottom-color: #1f2937;
  color: #e5e7eb;
  box-shadow: none;
}

.ide-shortcuts-footer {
  padding: 0.65rem 1rem 0.85rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}

body.dark .ide-shortcuts-footer {
  border-top-color: #374151;
  background: #1a2035;
}

.ide-shortcuts-footer p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #6b7280;
}

body.dark .ide-shortcuts-footer p {
  color: #9ca3af;
}

#ide-shortcuts-btn.active {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

body.dark #ide-shortcuts-btn.active {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

@media (max-width: 1023px) {
  #ide-shortcuts-btn,
  #ide-shortcuts-modal {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .donation-page {
    padding: calc(56px + 2rem) 24px 2.5rem;
  }

  .donation-wrap {
    margin-left: 24px;
    max-width: 680px;
  }

  .help-page {
    padding: calc(56px + 2rem) 24px 2.5rem;
  }

  .help-wrap {
    margin-left: 24px;
    max-width: 680px;
  }
}

/* Bot dashboard layout */
.dash-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 5rem;
}

.dash-header {
  padding: 0.25rem 0.25rem 0;
}

.dash-header-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dash-header-main--spread {
  justify-content: space-between;
  width: 100%;
}

.dash-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dash-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

body.dark .dash-section-title {
  color: #9ca3af;
}

.dash-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
}

body.dark .dash-title {
  color: #f3f4f6;
}

.dash-subtitle {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #6b7280;
}

body.dark .dash-subtitle {
  color: #9ca3af;
}

.dash-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dash-badge--active {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.dash-badge--inactive {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.dash-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(209, 213, 219, 0.9);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.dark .dash-panel {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(75, 85, 99, 0.55);
}

.dash-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.dash-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

body.dark .dash-panel-title {
  color: #f9fafb;
}

.dash-panel-meta {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.72rem;
  color: #9ca3af;
}

.dash-cache-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  font-weight: 600;
}

.dash-stat-grid {
  display: grid;
  gap: 0.75rem;
}

.dash-stat-grid--4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dash-stat-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dash-stat-grid--3 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .dash-stat-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .dash-stat-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dash-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(229, 231, 235, 0.9);
  background: #f9fafb;
}

body.dark .dash-stat-card {
  background: rgba(17, 24, 39, 0.55);
  border-color: rgba(75, 85, 99, 0.45);
}

.dash-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.dash-stat-value {
  margin-top: 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

body.dark .dash-stat-value {
  color: #f9fafb;
}

.dash-stat-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.dash-stat--green .dash-stat-icon { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.dash-stat--red .dash-stat-icon { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.dash-stat--blue .dash-stat-icon { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.dash-stat--purple .dash-stat-icon { background: rgba(168, 85, 247, 0.15); color: #9333ea; }
.dash-stat--teal .dash-stat-icon { background: rgba(20, 184, 166, 0.15); color: #0d9488; }

.dash-analytics-block + .dash-analytics-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(229, 231, 235, 0.8);
}

.dash-header + .dash-analytics-block {
  margin-top: 0.25rem;
}

body.dark .dash-analytics-block + .dash-analytics-block {
  border-top-color: rgba(75, 85, 99, 0.45);
}

.dash-analytics-heading {
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.dash-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 768px) {
  .dash-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dash-metric {
  padding: 0.75rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(229, 231, 235, 0.85);
  background: #f9fafb;
}

body.dark .dash-metric {
  background: rgba(17, 24, 39, 0.45);
  border-color: rgba(75, 85, 99, 0.45);
}

.dash-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dash-metric-label {
  font-size: 0.72rem;
  color: #6b7280;
}

.dash-metric-value {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

body.dark .dash-metric-value {
  color: #f9fafb;
}

.dash-metric-icon {
  opacity: 0.85;
}

.dash-metric--amber .dash-metric-icon { color: #d97706; }
.dash-metric--blue .dash-metric-icon { color: #2563eb; }
.dash-metric--green .dash-metric-icon { color: #16a34a; }
.dash-metric--purple .dash-metric-icon { color: #9333ea; }

.dash-audience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.dash-audience-card {
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(229, 231, 235, 0.85);
  background: #f9fafb;
}

body.dark .dash-audience-card {
  background: rgba(17, 24, 39, 0.45);
  border-color: rgba(75, 85, 99, 0.45);
}

.dash-audience-card--primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(59, 130, 246, 0.08));
  border-color: rgba(99, 102, 241, 0.25);
}

.dash-audience-label {
  display: block;
  font-size: 0.72rem;
  color: #6b7280;
}

.dash-audience-value {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

body.dark .dash-audience-value {
  color: #f9fafb;
}

.dash-distribution-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dash-distribution-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  color: #4b5563;
}

body.dark .dash-distribution-meta {
  color: #d1d5db;
}

.dash-distribution-track {
  height: 0.45rem;
  border-radius: 9999px;
  background: rgba(229, 231, 235, 0.9);
  overflow: hidden;
}

body.dark .dash-distribution-track {
  background: rgba(55, 65, 81, 0.85);
}

.dash-distribution-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.35s ease;
}

.dash-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .dash-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-info-item dt {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.dash-info-item dd {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
}

body.dark .dash-info-item dd {
  color: #f3f4f6;
}

.dash-link {
  color: #2563eb;
}

body.dark .dash-link {
  color: #60a5fa;
}

.dash-copy-id {
  cursor: pointer;
  transition: color 0.2s ease;
}

.dash-copy-id:hover {
  color: #16a34a;
}

.dash-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .dash-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-action-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
}

.dash-action-btn--success {
  border-color: #22c55e;
  color: #16a34a;
  background: transparent;
}

.dash-action-btn--success:hover {
  background: #22c55e;
  color: #fff;
}

.dash-action-btn--danger {
  border-color: #ef4444;
  color: #dc2626;
  background: transparent;
}

.dash-action-btn--danger:hover {
  background: #ef4444;
  color: #fff;
}

.dash-action-btn--secondary {
  border-color: #d1d5db;
  color: #374151;
  background: #fff;
}

body.dark .dash-action-btn--secondary {
  border-color: #4b5563;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.04);
}

.dash-action-btn--secondary:hover {
  background: #f3f4f6;
}

body.dark .dash-action-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dash-action-btn--pinned {
  border-color: #a855f7;
  color: #9333ea;
}

.dash-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.dash-refresh-btn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.15);
}

.dash-refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dash-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: #9ca3af;
}

.dash-empty-state i {
  font-size: 1.5rem;
}

/* Bulk actions */
.bulk-bar {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%);
  z-index: 120;
  width: min(720px, calc(100vw - 2rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(59, 130, 246, 0.25);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(10px);
}

body.dark .bulk-bar {
  background: rgba(17, 24, 39, 0.95);
  border-color: rgba(96, 165, 250, 0.25);
}

.bulk-bar--commands {
  bottom: 6.5rem;
}

.bulk-bar-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

body.dark .bulk-bar-info {
  color: #e5e7eb;
}

.bulk-link-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2563eb;
}

body.dark .bulk-link-btn {
  color: #60a5fa;
}

.bulk-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.bulk-action-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.bulk-action-btn--pin {
  border-color: #6366f1;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.08);
}

.bulk-action-btn--muted {
  border-color: #d1d5db;
  color: #4b5563;
  background: #fff;
}

body.dark .bulk-action-btn--muted {
  border-color: #4b5563;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.04);
}

.bulk-action-btn--danger {
  border-color: #ef4444;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.08);
}

.bulk-action-btn--cancel {
  border-color: #d1d5db;
  color: #6b7280;
  background: transparent;
}

.bot-list-card--bulk,
.command-box--bulk {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.bot-list-card--bulk.bot-card {
  overflow: visible;
}

.bot-list-card--selected,
.command-box--selected {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.command-box--bulk.command-box--selected {
  background-color: rgba(239, 246, 255, 0.95);
}

body.dark .command-box--bulk.command-box--selected {
  background-color: rgba(59, 130, 246, 0.12);
}

.bulk-select-slot {
  position: relative;
  flex-shrink: 0;
}

.bulk-select-slot--command {
  width: 1.25rem;
  height: 1.25rem;
}

.bulk-select-slot--bot {
  overflow: visible;
}

.bulk-select-slot--bot .bulk-select-mark--bot {
  inset: auto;
  right: 0;
  bottom: 0;
  width: 1rem;
  height: 1rem;
  border-width: 1.5px;
  overflow: visible;
  box-sizing: border-box;
  z-index: 1;
}

.bulk-select-slot--bot .bulk-select-mark--bot i {
  display: block;
  font-size: 0.5rem;
  line-height: 1;
}

.bot-list-card:not(.bot-list-card--bulk) .bulk-select-mark--bot {
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
}

.bulk-select-photo {
  display: block;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.bulk-select-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 2px solid #cbd5e1;
  background: #fff;
  color: #fff;
  opacity: 0;
  transform: scale(0.82);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease;
  pointer-events: none;
}

body.dark .bulk-select-mark {
  background: #1f2937;
  border-color: #4b5563;
}

.bot-list-card--bulk .bulk-select-photo {
  opacity: 1;
  transform: none;
}

.command-box--bulk .bulk-select-photo {
  opacity: 0;
  transform: scale(0.82);
}

.bot-list-card--bulk .bulk-select-mark--bot,
.command-box--bulk .bulk-select-mark {
  opacity: 1;
  transform: scale(1);
  color: transparent;
}

.bot-list-card--bulk:not(.bot-list-card--selected) .bulk-select-mark--bot {
  background: #fff;
  border-color: #cbd5e1;
  color: transparent;
}

body.dark .bot-list-card--bulk:not(.bot-list-card--selected) .bulk-select-mark--bot {
  background: #1f2937;
  border-color: #4b5563;
}

.bot-list-card--bulk.bot-list-card--selected .bulk-select-mark--bot,
.command-box--bulk.command-box--selected .bulk-select-mark {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.command-box--bulk .bulk-select-mark i {
  font-size: 0.55rem;
  line-height: 1;
  display: block;
}

.command-box--bulk.command-box--selected:hover {
  background-color: rgba(239, 246, 255, 0.95);
  border-color: #3b82f6 !important;
}

body.dark .command-box--bulk.command-box--selected:hover {
  background-color: rgba(59, 130, 246, 0.12);
  border-color: #3b82f6 !important;
}

.command-box--bulk .cmd-menu-container {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.bulk-toggle-desktop i {
  transition: transform 0.2s ease;
}

#toggleBotBulkBtn[aria-pressed="true"] i {
  transform: rotate(90deg);
}

.command-toolbar-menu-btn {
  min-width: 3rem;
}

.command-toolbar-dropdown {
  min-width: 9.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 0.35rem 0;
}

body.dark .command-toolbar-dropdown {
  background: #1f2937;
  border-color: #374151;
}

.command-toolbar-action {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  color: #374151;
  transition: background 0.15s;
}

body.dark .command-toolbar-action {
  color: #e5e7eb;
}

.command-toolbar-action:hover {
  background: #f3f4f6;
}

body.dark .command-toolbar-action:hover {
  background: rgba(255, 255, 255, 0.06);
}

.command-toolbar-action[aria-pressed="true"] {
  color: #2563eb;
  background: rgba(59, 130, 246, 0.08);
}

.command-toolbar-action i {
  width: 0.95rem;
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
}

.command-toolbar-action[aria-pressed="true"] i {
  color: #2563eb;
}

@media (max-width: 768px) {
  .bulk-toggle-desktop {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .bulk-bar {
    flex-direction: column;
    align-items: stretch;
    bottom: 4.75rem;
  }

  .bulk-bar-actions {
    justify-content: stretch;
  }

  .bulk-action-btn {
    flex: 1;
    text-align: center;
  }
}

/* ==========================================
   Unified UI — clean settings / profile
   ========================================== */

.ui-page {
  min-height: 100vh;
  padding: calc(56px + 2.5rem) 1rem 3rem;
}

.ui-page-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ui-page-header {
  margin-bottom: 0.25rem;
}

.ui-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}

body.dark .ui-page-title {
  color: #f9fafb;
}

.ui-page-subtitle {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
}

body.dark .ui-page-subtitle {
  color: #9ca3af;
}

.ui-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.875rem;
  overflow: hidden;
}

body.dark .ui-section {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.ui-section--flat {
  background: transparent;
  border: none;
  border-radius: 0;
}

body.dark .ui-section--flat {
  background: transparent;
  border: none;
}

.ui-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.25rem 0.75rem;
}

.ui-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

body.dark .ui-section-title {
  color: #9ca3af;
}

.ui-section-body {
  padding: 1rem 1.125rem 1.125rem;
}

.ui-section .ui-section-title:not(.ui-section-head .ui-section-title) {
  padding: 1rem 1.125rem 0.5rem;
}

.ui-list {
  display: flex;
  flex-direction: column;
}

.ui-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  border-top: 1px solid #f3f4f6;
}

.ui-row:first-child {
  border-top: none;
}

body.dark .ui-row {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.ui-row--stack {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.ui-row-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

body.dark .ui-row-label {
  color: #9ca3af;
}

.ui-row-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

body.dark .ui-row-value {
  color: #f3f4f6;
}

.ui-row-main {
  min-width: 0;
}

.ui-row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ui-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ui-copy-btn:hover {
  background: #f3f4f6;
  color: #2563eb;
}

body.dark .ui-copy-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #60a5fa;
}

.ui-field {
  margin-bottom: 0.875rem;
}

.ui-field:last-child {
  margin-bottom: 0;
}

.ui-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
}

body.dark .ui-field-label {
  color: #d1d5db;
}

.ui-field-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.45;
}

.ui-section .floating-label {
  margin-bottom: 0.875rem;
}

.ui-section .floating-label input,
.ui-section .floating-label textarea {
  border: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  padding: 1.3rem 0.875rem 0.625rem;
  background: #f9fafb;
  width: 100%;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.dark .ui-section .floating-label input,
body.dark .ui-section .floating-label textarea {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #f3f4f6;
}

.ui-section .floating-label label {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: #9ca3af;
  pointer-events: none;
  transition: top 0.2s ease, transform 0.2s ease, font-size 0.2s ease, color 0.2s ease;
  line-height: 1;
  background: transparent;
}

.ui-section .floating-label input:focus,
.ui-section .floating-label textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.ui-section .floating-label input:focus + label,
.ui-section .floating-label input:not(:placeholder-shown) + label,
.ui-section .floating-label textarea:focus + label,
.ui-section .floating-label textarea:not(:placeholder-shown) + label,
.ui-section .floating-label label.floating {
  top: 0.42rem;
  transform: none;
  font-size: 0.68rem;
  color: #2563eb;
}

body.dark .ui-section .floating-label input:focus + label,
body.dark .ui-section .floating-label input:not(:placeholder-shown) + label,
body.dark .ui-section .floating-label textarea:focus + label,
body.dark .ui-section .floating-label textarea:not(:placeholder-shown) + label,
body.dark .ui-section .floating-label label.floating {
  color: #60a5fa;
}

.ui-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0 1.125rem 1.125rem;
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.625rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

.ui-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ui-btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}

.ui-btn-block {
  width: 100%;
}

.ui-btn-primary {
  background: #2563eb;
  color: #fff;
}

.ui-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.ui-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}

body.dark .ui-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.08);
}

.ui-btn-secondary:hover:not(:disabled) {
  background: #e5e7eb;
}

body.dark .ui-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.ui-btn-ghost {
  background: transparent;
  color: #2563eb;
  border-color: #dbeafe;
}

body.dark .ui-btn-ghost {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.25);
}

.ui-btn-ghost:hover:not(:disabled) {
  background: #eff6ff;
}

body.dark .ui-btn-ghost:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.12);
}

.ui-btn-danger {
  background: #dc2626;
  color: #fff;
}

.ui-btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.ui-btn-danger-outline {
  background: transparent;
  color: #dc2626;
  border-color: #fecaca;
}

body.dark .ui-btn-danger-outline {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}

.ui-btn-danger-outline:hover:not(:disabled) {
  background: #fef2f2;
}

body.dark .ui-btn-danger-outline:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.12);
}

.ui-btn-success-outline {
  background: transparent;
  color: #059669;
  border-color: #a7f3d0;
}

.ui-btn-success-outline:hover:not(:disabled) {
  background: #ecfdf5;
}

.ui-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 0.25rem 0;
}

body.dark .ui-divider {
  background: rgba(255, 255, 255, 0.06);
}

.ui-note {
  padding: 0.75rem 1.125rem 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #6b7280;
}

.ui-danger-block {
  border-color: rgba(239, 68, 68, 0.25);
}

.ui-danger-block .ui-section-title {
  color: #dc2626;
}

body.dark .ui-danger-block .ui-section-title {
  color: #f87171;
}

.ui-danger-note {
  padding: 0 1.125rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #b91c1c;
}

body.dark .ui-danger-note {
  color: #fca5a5;
}

.ui-session-list {
  display: flex;
  flex-direction: column;
}

.ui-session-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  border-top: 1px solid #f3f4f6;
}

.ui-session-item:first-child {
  border-top: none;
}

body.dark .ui-session-item {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.ui-session-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #2563eb;
  flex-shrink: 0;
}

body.dark .ui-session-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.ui-session-meta {
  min-width: 0;
}

.ui-session-device {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

body.dark .ui-session-device {
  color: #f3f4f6;
}

.ui-session-detail {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.15rem;
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ui-badge--success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.ui-badge--muted {
  background: #f3f4f6;
  color: #6b7280;
}

body.dark .ui-badge--muted {
  background: rgba(255, 255, 255, 0.08);
  color: #9ca3af;
}

.ui-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
  padding: 0.5rem 0 1rem;
}

/* Profile page — clean layout (legacy; padding overridden below) */
.profile-page.ui-page {
  padding-top: calc(56px + 3rem);
}

.ui-profile-header {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.875rem;
  padding: 1.125rem;
}

body.dark .ui-profile-header {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.ui-profile-header-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.ui-profile-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid #e5e7eb;
  flex-shrink: 0;
}

body.dark .ui-profile-avatar {
  border-color: rgba(255, 255, 255, 0.12);
}

.ui-profile-header-text {
  flex: 1;
  min-width: 0;
  padding-top: 0.15rem;
}

.profile-page .profile-display-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.profile-page .profile-display-username {
  font-size: 0.875rem;
}

.profile-page .profile-meta-chip {
  background: #f3f4f6;
  border-radius: 9999px;
  font-size: 0.75rem;
}

body.dark .profile-page .profile-meta-chip {
  background: rgba(255, 255, 255, 0.08);
}

.profile-page .profile-edit-mode {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f3f4f6;
}

body.dark .profile-page .profile-edit-mode {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.profile-page .profile-field-input,
.profile-page .profile-bio-textarea {
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  background: #f9fafb;
}

body.dark .profile-page .profile-field-input,
body.dark .profile-page .profile-bio-textarea {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.profile-page .profile-btn-save {
  background: #2563eb;
  border: none;
  box-shadow: none;
}

.profile-page .profile-btn-cancel {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

body.dark .profile-page .profile-btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.08);
}

.profile-page .profile-bio-display,
.profile-page .profile-bio-preview {
  padding: 0 0.25rem;
}

.ui-settings-photo {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid #e5e7eb;
  margin: 0 auto 0.75rem;
  display: block;
}

body.dark .ui-settings-photo {
  border-color: rgba(255, 255, 255, 0.12);
}

.ui-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  font-size: 0.875rem;
}

.ui-textarea {
  width: 100%;
  min-height: 7rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  background: #f9fafb;
  font-size: 0.875rem;
  resize: vertical;
}

body.dark .ui-textarea {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #f3f4f6;
}

@media (min-width: 1024px) {
  .ui-page {
    padding-top: calc(56px + 2.5rem);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

#settings-con {
  padding-bottom: 5rem;
  overflow-y: auto;
  max-height: calc(100vh - 160px);
}

.ui-settings-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ui-settings-page__footer {
  margin-bottom: 1.5rem;
}

.bot-settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem;
  border: 1px solid #f3f4f6;
  border-radius: 0.75rem;
  background: #f9fafb;
}

body.dark .bot-settings-avatar-row {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.bot-settings-avatar-thumb {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid #e5e7eb;
  flex-shrink: 0;
}

body.dark .bot-settings-avatar-thumb {
  border-color: rgba(255, 255, 255, 0.1);
}

.bot-settings-avatar-copy {
  min-width: 0;
}

.ui-actions--split {
  flex-direction: row;
  flex-wrap: wrap;
}

.ui-actions--split .ui-btn {
  flex: 1 1 9rem;
}

/* Command folders */
.command-folder-bar {
  margin-bottom: 0.5rem;
  padding-top: 0.25rem;
  overflow: visible;
}

.command-folder-scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.35rem 0.15rem 0.65rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.command-folder-scroll::-webkit-scrollbar {
  display: none;
  height: 0;
}

@media (min-width: 768px) {
  .command-folder-scroll {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #eef2f7;
    padding-bottom: 0.85rem;
  }

  .command-folder-scroll::-webkit-scrollbar {
    display: block;
    height: 8px;
  }

  .command-folder-scroll::-webkit-scrollbar-track {
    background: #eef2f7;
    border-radius: 9999px;
    margin: 0 0.15rem;
  }

  .command-folder-scroll::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 9999px;
    border: 2px solid #eef2f7;
  }

  .command-folder-scroll::-webkit-scrollbar-thumb:hover {
    background: #64748b;
  }

  body.dark .command-folder-scroll {
    scrollbar-color: #6b7280 #1f2937;
  }

  body.dark .command-folder-scroll::-webkit-scrollbar-track {
    background: #1f2937;
  }

  body.dark .command-folder-scroll::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-color: #1f2937;
  }

  body.dark .command-folder-scroll::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
  }
}

.command-folder-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: rgba(255, 255, 255, 0.85);
  color: #374151;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, background 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}

.command-folder-pill--folder {
  position: relative;
  padding: 0;
  gap: 0;
  overflow: visible;
  cursor: default;
}

.command-folder-pill-select {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.35rem 0.45rem 0.75rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
  border-radius: 9999px 0 0 9999px;
}

body.dark .command-folder-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

.command-folder-pill:hover {
  border-color: #93c5fd;
}

.command-folder-pill--active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18), 0 0 12px rgba(59, 130, 246, 0.15);
  background: rgba(239, 246, 255, 0.95);
}

body.dark .command-folder-pill--active {
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), 0 0 14px rgba(59, 130, 246, 0.2);
}

.command-folder-pill--drop-target {
  transform: scale(1.03);
  border-color: var(--folder-pill-color, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.command-folder-pill--new {
  border-style: dashed;
  color: #6b7280;
  background: transparent;
}

.command-folder-count {
  color: #6b7280;
  font-weight: 500;
}

body.dark .command-folder-count {
  color: #9ca3af;
}

.command-folder-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.55rem 0.45rem 0.35rem;
  margin: 0;
  border: none;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0 9999px 9999px 0;
  background: transparent;
  color: #9ca3af;
  font-size: 0.7rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

body.dark .command-folder-pill--folder .command-folder-menu-btn {
  border-left-color: rgba(255, 255, 255, 0.1);
}

.command-folder-menu-btn:hover {
  color: #374151;
  background: rgba(0, 0, 0, 0.05);
}

body.dark .command-folder-menu-btn:hover {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.08);
}

.command-folder-dropdown {
  min-width: 9.5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 0.35rem 0;
}

body.dark .command-folder-dropdown {
  background: #1f2937;
  border-color: #374151;
}

.command-folder-action {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  color: #374151;
  transition: background 0.15s;
}

body.dark .command-folder-action {
  color: #e5e7eb;
}

.command-folder-action:hover {
  background: #f3f4f6;
}

body.dark .command-folder-action:hover {
  background: rgba(255, 255, 255, 0.06);
}

.command-folder-action--danger {
  color: #dc2626;
}

.cmd-folder-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 5.5rem;
  margin-top: 0.15rem;
  padding: 0.05rem 0.35rem 0.05rem 0.3rem;
  border-radius: 9999px;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--folder-badge-color, #64748b);
  background: color-mix(in srgb, var(--folder-badge-color, #64748b) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--folder-badge-color, #64748b) 28%, transparent);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
  align-self: flex-start;
}

.cmd-folder-badge-icon {
  font-size: 0.55rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.cmd-folder-badge-text {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.cmd-title-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  overflow: hidden;
}

.command-box--dragging {
  opacity: 0.55;
  transform: scale(0.985);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.18);
}

.move-commands-modal {
  padding: 1rem;
}

.move-commands-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 26rem;
  max-height: min(90vh, 680px);
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

body.dark .move-commands-panel {
  background: #1a2035;
  border-color: #374151;
}

.move-commands-header {
  padding: 1.15rem 1.25rem 0.95rem;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

body.dark .move-commands-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.move-commands-header-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.move-commands-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  flex-shrink: 0;
}

body.dark .move-commands-header-icon {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
}

.move-commands-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

body.dark .move-commands-title {
  color: #f9fafb;
}

.move-commands-subtitle {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #6b7280;
}

body.dark .move-commands-subtitle {
  color: #9ca3af;
}

.move-commands-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 1.25rem;
  overflow-y: auto;
  min-height: 0;
}

.move-commands-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.move-commands-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.move-commands-section-head--split {
  align-items: flex-start;
}

.move-commands-section-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.move-commands-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6b7280;
}

body.dark .move-commands-section-label {
  color: #9ca3af;
}

.move-commands-count-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #2563eb;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.18);
}

body.dark .move-commands-count-badge {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.28);
}

.move-commands-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.move-commands-pill {
  padding: 0.28rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  color: #6b7280;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

body.dark .move-commands-pill {
  background: rgba(255, 255, 255, 0.04);
  border-color: #4b5563;
  color: #d1d5db;
}

.move-commands-pill:hover {
  border-color: #93c5fd;
  color: #2563eb;
}

.move-commands-pill--active {
  border-color: #3b82f6;
  background: rgba(239, 246, 255, 0.95);
  color: #2563eb;
}

body.dark .move-commands-pill--active {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

.move-commands-target-list,
.move-commands-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.move-commands-target-list {
  max-height: 9.5rem;
  overflow-y: auto;
  padding-right: 0.1rem;
}

.move-commands-list {
  max-height: 16rem;
  overflow-y: auto;
  padding-right: 0.1rem;
}

.move-commands-target-item,
.move-commands-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #f9fafb;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

body.dark .move-commands-target-item,
body.dark .move-commands-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: #374151;
}

.move-commands-target-item:hover,
.move-commands-item:hover {
  border-color: #bfdbfe;
  background: #f8fafc;
}

body.dark .move-commands-target-item:hover,
body.dark .move-commands-item:hover {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.move-commands-target-item--active,
.move-commands-item--selected {
  border-color: #3b82f6 !important;
  background: rgba(239, 246, 255, 0.95) !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22);
}

body.dark .move-commands-target-item--active,
body.dark .move-commands-item--selected {
  background: rgba(59, 130, 246, 0.12) !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.move-commands-target-input,
.move-commands-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.move-commands-target-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

.move-commands-target-name,
.move-commands-item-name {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dark .move-commands-target-name,
body.dark .move-commands-item-name {
  color: #f3f4f6;
}

.move-commands-target-mark,
.move-commands-select-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 9999px;
  border: 1.5px solid #d1d5db;
  color: transparent;
  font-size: 0.55rem;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

body.dark .move-commands-target-mark,
body.dark .move-commands-select-mark {
  border-color: #6b7280;
}

.move-commands-target-item--active .move-commands-target-mark,
.move-commands-item--selected .move-commands-select-mark {
  border-color: #3b82f6;
  background: #3b82f6;
  color: #fff;
}

.move-commands-select-slot {
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.move-commands-item-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: #3b82f6;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.move-commands-item--selected .move-commands-item-icon {
  opacity: 0;
  transform: scale(0.7);
}

.move-commands-item .move-commands-select-mark {
  position: absolute;
  inset: 0;
  transform: scale(0.7);
  opacity: 0;
}

.move-commands-item--selected .move-commands-select-mark {
  transform: scale(1);
  opacity: 1;
}

.move-commands-error {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #dc2626;
}

.move-commands-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.85rem 1.25rem 1.15rem;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}

body.dark .move-commands-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.move-commands-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.move-commands-btn--ghost {
  border: 1px solid #d1d5db;
  color: #4b5563;
  background: transparent;
}

body.dark .move-commands-btn--ghost {
  border-color: #4b5563;
  color: #d1d5db;
}

.move-commands-btn--ghost:hover {
  background: #f3f4f6;
}

body.dark .move-commands-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.move-commands-btn--primary {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #4f46e5);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
}

.move-commands-btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #4338ca);
}

.move-commands-btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================
   Add Bot page — soft, flowing layout
   ========================================== */

.add-bot-page.ui-page {
  padding-top: calc(56px + 3rem);
}

.add-bot-inner {
  max-width: 520px;
  gap: 2rem;
}

.add-bot-hero {
  padding: 0 0 0.25rem;
}

.add-bot-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}

body.dark .add-bot-hero-title {
  color: #f9fafb;
}

.add-bot-hero-sub {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
}

body.dark .add-bot-hero-sub {
  color: #e5e7eb;
}

.add-bot-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.25rem;
  border-radius: 9999px;
  background: var(--btn-tab-track);
  border: 1px solid var(--btn-indigo-border);
}

.add-bot-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 9999px;
  background: transparent;
  color: var(--btn-indigo-text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.add-bot-tab.is-active {
  background: var(--btn-indigo-bg);
  border-color: var(--btn-indigo-border);
  color: var(--btn-indigo-text);
  box-shadow: none;
}

.add-bot-tab.is-active[data-add-bot-tab="import"] {
  background: var(--btn-teal-bg);
  border-color: var(--btn-teal-border);
  color: var(--btn-teal-text);
}

.add-bot-panels {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.add-bot-panel {
  padding-top: 0.25rem;
}

.add-bot-panel[hidden] {
  display: none !important;
}

.add-bot-panel-desc {
  font-size: 0.875rem;
  line-height: 1.55;
  color: #374151;
  font-weight: 500;
  margin-bottom: 1.1rem;
}

body.dark .add-bot-panel-desc {
  color: #e5e7eb;
}

.add-bot-panel .add-bot-guide {
  margin-top: 1.5rem;
}

.add-bot-action-btn--import {
  background: var(--btn-teal-bg);
  border: 1px solid var(--btn-teal-border);
  color: var(--btn-teal-text);
}

.add-bot-action-btn--import:hover:not(:disabled) {
  background: var(--btn-teal-bg-hover);
  color: var(--btn-teal-text);
}

.add-bot-guide .add-bot-step strong {
  color: #1f2937;
  font-weight: 700;
}

body.dark .add-bot-guide .add-bot-step strong {
  color: #f9fafb;
}

.add-bot-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.add-bot-path {
  padding: 0.25rem 0;
}

.add-bot-path-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.add-bot-path-head > div {
  min-width: 0;
}

.add-bot-path-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(42, 208, 245, 0.2), rgba(0, 90, 139, 0.15));
  color: #0284c7;
  font-size: 0.85rem;
}

body.dark .add-bot-path-badge {
  background: linear-gradient(135deg, rgba(42, 208, 245, 0.15), rgba(0, 90, 139, 0.2));
  color: #38bdf8;
}

.add-bot-path-badge--soft {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

body.dark .add-bot-path-badge--soft {
  background: rgba(129, 140, 248, 0.12);
  color: #a5b4fc;
}

.add-bot-path-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #111827;
  margin-bottom: 0.2rem;
}

body.dark .add-bot-path-title {
  color: #f3f4f6;
}

.add-bot-path-desc {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #374151;
  font-weight: 500;
}

body.dark .add-bot-path-desc {
  color: #e5e7eb;
}

.add-bot-fields {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.35rem;
}

.add-bot-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1f2937;
  margin-bottom: 0.35rem;
}

body.dark .add-bot-field-label {
  color: #f3f4f6;
}

.add-bot-optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: #4b5563;
}

body.dark .add-bot-optional {
  color: #9ca3af;
}

.add-bot-field-input {
  width: 100%;
  padding: 0.55rem 0;
  border: none;
  border-bottom: 2px solid #9ca3af;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 500;
  color: #111827;
  outline: none;
  transition: border-color 0.2s ease;
}

.add-bot-field-input::placeholder {
  color: #6b7280;
}

body.dark .add-bot-field-input {
  color: #f9fafb;
  border-bottom-color: rgba(255, 255, 255, 0.28);
}

body.dark .add-bot-field-input::placeholder {
  color: #9ca3af;
}

.add-bot-field-input:focus {
  border-bottom-color: #2AD0F5;
}

body.dark .add-bot-field-input:focus {
  border-bottom-color: #38bdf8;
}

.add-bot-action-btn,
.profile-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--btn-indigo-border);
  border-radius: 9999px;
  background: var(--btn-indigo-bg);
  color: var(--btn-indigo-text);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.add-bot-action-btn:hover:not(:disabled),
.profile-action-btn:hover:not(:disabled) {
  background: var(--btn-indigo-bg-hover);
  color: var(--btn-indigo-text);
  border-color: var(--btn-indigo-border);
}

.add-bot-action-btn:disabled,
.profile-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.add-bot-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.add-bot-divider::before,
.add-bot-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
}

body.dark .add-bot-divider::before,
body.dark .add-bot-divider::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 20%, rgba(255, 255, 255, 0.1) 80%, transparent);
}

.add-bot-guide {
  padding-top: 0.5rem;
  border-top: 1px solid #f3f4f6;
}

body.dark .add-bot-guide {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.add-bot-guide-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #374151;
  margin-bottom: 1rem;
}

body.dark .add-bot-guide-title {
  color: #e5e7eb;
}

.add-bot-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
}

.add-bot-step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.65rem 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #374151;
}

body.dark .add-bot-step {
  color: #d1d5db;
}

.add-bot-step:not(:last-child) {
  border-bottom: 1px dashed rgba(229, 231, 235, 0.8);
}

body.dark .add-bot-step:not(:last-child) {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.add-bot-step-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: #e5e7eb;
  font-size: 0.7rem;
  font-weight: 700;
  color: #374151;
  margin-top: 0.05rem;
}

body.dark .add-bot-step-num {
  background: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

.add-bot-step a {
  color: #0284c7;
  font-weight: 600;
  text-decoration: none;
}

.add-bot-step a:hover {
  text-decoration: underline;
}

body.dark .add-bot-step a {
  color: #38bdf8;
}

.add-bot-step code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(42, 208, 245, 0.12);
  font-size: 0.8rem;
  color: #0369a1;
}

body.dark .add-bot-step code {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

/* ==========================================
   Profile page — soft layout + readable text
   ========================================== */

.profile-page.ui-page {
  padding-top: calc(56px + 3rem);
}

.profile-page-inner {
  max-width: 560px;
  gap: 2rem;
}

.profile-header {
  padding: 0;
}

.profile-header-main {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.profile-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid #d1d5db;
  flex-shrink: 0;
}

body.dark .profile-avatar {
  border-color: rgba(255, 255, 255, 0.15);
}

.profile-header-text {
  flex: 1;
  min-width: 0;
  padding-top: 0.15rem;
}

.profile-page .profile-display-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}

body.dark .profile-page .profile-display-name {
  color: #f9fafb;
}

.profile-page .profile-display-username {
  font-size: 0.875rem;
  color: #374151;
  margin-top: 0.15rem;
  font-weight: 500;
}

body.dark .profile-page .profile-display-username {
  color: #e5e7eb;
}

.profile-page .profile-meta-chip {
  background: rgba(99, 102, 241, 0.18);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #1f2937;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
}

body.dark .profile-page .profile-meta-chip {
  background: rgba(129, 140, 248, 0.28);
  color: #f3f4f6;
}

.profile-page .profile-meta-chip i {
  color: #6366f1;
}

body.dark .profile-page .profile-meta-chip i {
  color: #a5b4fc;
}

.profile-action-btn--sm {
  width: auto;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.profile-page .profile-edit-mode {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
}

body.dark .profile-page .profile-edit-mode {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.profile-page .profile-field-label {
  color: #1f2937;
  font-weight: 700;
}

body.dark .profile-page .profile-field-label {
  color: #f3f4f6;
}

.profile-page .profile-field-prefix-wrap {
  border: none;
  border-bottom: 2px solid #9ca3af;
  border-radius: 0;
  background: transparent;
}

.profile-page .profile-field-prefix-wrap:focus-within {
  border-bottom-color: #6366f1;
}

body.dark .profile-page .profile-field-prefix-wrap {
  border-bottom-color: rgba(255, 255, 255, 0.28);
}

body.dark .profile-page .profile-field-prefix-wrap:focus-within {
  border-bottom-color: #818cf8;
}

.profile-page .profile-field-prefix {
  background: transparent;
  border-right: none;
  color: #374151;
  padding-left: 0;
}

body.dark .profile-page .profile-field-prefix {
  color: #d1d5db;
}

.profile-page .profile-field-prefix-wrap .profile-field-input {
  border-bottom: none;
}

.profile-page .profile-field > .profile-field-input,
.profile-page .profile-field-input {
  border: none;
  border-bottom: 2px solid #9ca3af;
  border-radius: 0;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
  color: #111827;
  font-weight: 500;
}

.profile-page .profile-field > .profile-field-input:focus,
.profile-page .profile-field-prefix-wrap .profile-field-input:focus {
  border-bottom-color: #6366f1;
}

body.dark .profile-page .profile-field > .profile-field-input,
body.dark .profile-page .profile-field-input {
  color: #f9fafb;
  border-bottom-color: rgba(255, 255, 255, 0.28);
}

.profile-page .profile-field-input::placeholder {
  color: #6b7280;
}

body.dark .profile-page .profile-field-input::placeholder {
  color: #9ca3af;
}

.profile-page .profile-edit-actions {
  justify-content: flex-end;
  margin-top: 1rem;
}

.profile-about {
  padding-top: 0.5rem;
  border-top: 1px solid #e5e7eb;
}

/* Profile plan card */
.profile-plan-card {
  margin-top: 1.25rem;
  padding: 1.2rem 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

body.dark .profile-plan-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.profile-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.profile-plan-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
}

body.dark .profile-plan-title {
  color: #f9fafb;
}

.profile-plan-sub {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #4b5563;
}

body.dark .profile-plan-sub {
  color: #d1d5db;
}

.profile-plan-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-plan-badge--free,
.profile-plan-chip--free {
  background: rgba(107, 114, 128, 0.14);
  color: #374151;
}

.profile-plan-badge--freemium,
.profile-plan-chip--freemium {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}

.profile-plan-badge--premium,
.profile-plan-chip--premium {
  background: rgba(99, 102, 241, 0.16);
  color: #4338ca;
}

.profile-plan-badge--elite,
.profile-plan-chip--elite {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

body.dark .profile-plan-badge--free,
body.dark .profile-plan-chip--free {
  background: rgba(156, 163, 175, 0.18);
  color: #e5e7eb;
}

body.dark .profile-plan-badge--freemium,
body.dark .profile-plan-chip--freemium {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

body.dark .profile-plan-badge--premium,
body.dark .profile-plan-chip--premium {
  background: rgba(129, 140, 248, 0.22);
  color: #c7d2fe;
}

body.dark .profile-plan-badge--elite,
body.dark .profile-plan-chip--elite {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}

.profile-plan-limits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.profile-plan-limit {
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid #eef2f7;
  background: #f9fafb;
}

body.dark .profile-plan-limit {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.profile-plan-limit-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.profile-plan-limit-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
}

body.dark .profile-plan-limit-value {
  color: #f9fafb;
}

.profile-plan-note {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #6b7280;
}

body.dark .profile-plan-note {
  color: #9ca3af;
}

.profile-plan-chip i {
  color: inherit;
}

/* Deleted bots panel */
.deleted-bots-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 1rem;
  background: rgba(245, 158, 11, 0.06);
}

body.dark .deleted-bots-panel {
  border-color: rgba(251, 191, 36, 0.24);
  background: rgba(245, 158, 11, 0.08);
}

.deleted-bots-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.deleted-bots-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #92400e;
}

body.dark .deleted-bots-title {
  color: #fcd34d;
}

.deleted-bots-sub {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: #78716c;
}

body.dark .deleted-bots-sub {
  color: #d6d3d1;
}

.deleted-bots-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.06);
  color: #57534e;
  cursor: pointer;
}

body.dark .deleted-bots-dismiss {
  background: rgba(255, 255, 255, 0.08);
  color: #e7e5e4;
}

.deleted-bots-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.deleted-bot-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.72);
}

body.dark .deleted-bot-item {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.deleted-bot-photo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  object-fit: cover;
}

.deleted-bot-name {
  display: block;
  font-size: 0.88rem;
  color: #111827;
}

body.dark .deleted-bot-name {
  color: #f9fafb;
}

.deleted-bot-meta {
  display: block;
  font-size: 0.72rem;
  color: #6b7280;
}

body.dark .deleted-bot-meta {
  color: #9ca3af;
}

.deleted-bot-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.deleted-bot-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.deleted-bot-btn--recover {
  background: var(--btn-teal-bg);
  border-color: var(--btn-teal-border);
  color: var(--btn-teal-text);
}

.deleted-bot-btn--purge {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
  color: #dc2626;
}

body.dark .profile-about {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.profile-about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.profile-about-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1f2937;
}

body.dark .profile-about-title {
  color: #f3f4f6;
}

.profile-page .profile-bio-display {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #1f2937;
  font-weight: 500;
  padding: 0;
}

body.dark .profile-page .profile-bio-display {
  color: #f3f4f6;
}

.profile-page .profile-bio-textarea {
  border: none;
  border-bottom: 1.5px solid #d1d5db;
  border-radius: 0;
  background: transparent;
  padding: 0.55rem 0;
  color: #111827;
  min-height: 88px;
}

.profile-page .profile-bio-textarea:focus {
  border-bottom-color: #6366f1;
  box-shadow: none;
}

body.dark .profile-page .profile-bio-textarea {
  color: #f3f4f6;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.dark .profile-page .profile-bio-textarea:focus {
  border-bottom-color: #818cf8;
}

.profile-page .profile-bio-textarea::placeholder {
  color: #9ca3af;
}

body.dark .profile-page .profile-bio-textarea::placeholder {
  color: #6b7280;
}

.profile-page .profile-bio-preview-label {
  color: #374151;
}

body.dark .profile-page .profile-bio-preview-label {
  color: #e5e7eb;
}

.profile-page .profile-bio-preview {
  border: none;
  border-radius: 0;
  padding: 0.35rem 0 0;
  color: #374151;
  background: transparent;
}

body.dark .profile-page .profile-bio-preview {
  color: #d1d5db;
}

/* ==========================================
   Account Settings page
   ========================================== */

.settings-page.ui-page {
  padding-top: calc(56px + 3rem);
}

.settings-page-inner {
  max-width: 560px;
  gap: 1rem;
}

.settings-hero {
  padding: 0 0.25rem 0.75rem;
}

.settings-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}

body.dark .settings-hero-title {
  color: #f9fafb;
}

.settings-hero-sub {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
}

body.dark .settings-hero-sub {
  color: #e5e7eb;
}

.settings-block {
  padding: 1.35rem 1.4rem 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.settings-block:first-of-type {
  margin-top: 0.25rem;
}

body.dark .settings-block {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.settings-block-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #f1f3f5;
}

body.dark .settings-block-heading {
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.settings-block-head .settings-block-heading {
  margin-bottom: 0;
}

.settings-block-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  font-size: 0.95rem;
}

.settings-block--account .settings-block-icon {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.settings-block--email .settings-block-icon {
  background: rgba(99, 102, 241, 0.14);
  color: #6366f1;
}

.settings-block--password .settings-block-icon {
  background: rgba(245, 158, 11, 0.16);
  color: #d97706;
}

.settings-block--sessions .settings-block-icon {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

body.dark .settings-block--account .settings-block-icon {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
}

body.dark .settings-block--email .settings-block-icon {
  background: rgba(129, 140, 248, 0.16);
  color: #a5b4fc;
}

body.dark .settings-block--password .settings-block-icon {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
}

body.dark .settings-block--sessions .settings-block-icon {
  background: rgba(167, 139, 250, 0.14);
  color: #c4b5fd;
}

.settings-block--usage .settings-block-icon {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

body.dark .settings-block--usage .settings-block-icon {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}

.settings-block--usage .settings-block-title {
  color: #065f46;
}

body.dark .settings-block--usage .settings-block-title {
  color: #a7f3d0;
}

.settings-usage-intro {
  margin-bottom: 1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #374151;
}

body.dark .settings-usage-intro {
  color: #e5e7eb;
}

.settings-usage-intro code {
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-size: 0.78rem;
}

.settings-usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.settings-usage-card {
  padding: 0.85rem;
  border-radius: 0.8rem;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

body.dark .settings-usage-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.settings-usage-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.45rem;
}

.settings-usage-bar-wrap {
  height: 0.45rem;
  border-radius: 9999px;
  background: rgba(107, 114, 128, 0.16);
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.settings-usage-bar {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.25s ease;
}

.settings-usage-text {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #111827;
}

body.dark .settings-usage-text {
  color: #f9fafb;
}

.settings-usage-reset {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: #6b7280;
}

body.dark .settings-usage-reset {
  color: #9ca3af;
}

.settings-usage-metric + .settings-usage-metric {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(107, 114, 128, 0.14);
}

body.dark .settings-usage-metric + .settings-usage-metric {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.settings-usage-metric-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #4b5563;
}

body.dark .settings-usage-metric-label {
  color: #d1d5db;
}

.settings-usage-bar--pub {
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

.api-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.api-refresh-btn {
  flex-shrink: 0;
  width: auto;
}

.settings-inline-link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: #4f46e5;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.dark .settings-inline-link {
  color: #a5b4fc;
}

a.settings-inline-link {
  display: inline;
}

.settings-block--docs .settings-block-icon {
  background: rgba(59, 130, 246, 0.14);
  color: #2563eb;
}

body.dark .settings-block--docs .settings-block-icon {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.settings-doc-link {
  display: inline-flex;
  width: auto;
  text-decoration: none;
}

.billing-plan-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.settings-billing-sub {
  margin: 0 0 1rem;
}

.settings-block--billing .settings-block-icon {
  background: rgba(16, 185, 129, 0.16);
  color: #059669;
}

body.dark .settings-block--billing .settings-block-icon {
  background: rgba(52, 211, 153, 0.14);
  color: #34d399;
}

.billing-plan-date {
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid #eef2f7;
  background: #f9fafb;
}

body.dark .billing-plan-date {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.billing-plan-date-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.billing-plan-date-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
}

body.dark .billing-plan-date-value {
  color: #f9fafb;
}

.settings-block--billing-tiers .settings-block-icon {
  background: rgba(245, 158, 11, 0.16);
  color: #d97706;
}

body.dark .settings-block--billing-tiers .settings-block-icon {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
}

.billing-tier-table {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.billing-tier-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.84rem;
  color: #374151;
}

body.dark .billing-tier-row {
  color: #e5e7eb;
}

.billing-tier-row--head {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  padding-top: 0;
  padding-bottom: 0.15rem;
}

.billing-tier-row:not(.billing-tier-row--head) {
  border: 1px solid #eef2f7;
  background: #f9fafb;
}

body.dark .billing-tier-row:not(.billing-tier-row--head) {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.billing-tier-row.is-current {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
}

body.dark .billing-tier-row.is-current {
  border-color: rgba(129, 140, 248, 0.35);
  background: rgba(99, 102, 241, 0.14);
}

.billing-tier-name em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4f46e5;
}

.billing-upgrade-note {
  margin-top: 1rem;
}

.recovery-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.recovery-refresh-btn {
  flex-shrink: 0;
  width: auto;
}

.recovery-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  text-align: center;
  border: 1px dashed #d1d5db;
  border-radius: 1rem;
  color: #6b7280;
}

body.dark .recovery-state {
  border-color: rgba(255, 255, 255, 0.12);
  color: #9ca3af;
}

.recovery-state i {
  font-size: 2rem;
}

.recovery-state p {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
}

body.dark .recovery-state p {
  color: #e5e7eb;
}

.recovery-state span {
  font-size: 0.84rem;
  max-width: 28rem;
  line-height: 1.5;
}

.recovery-state--error i {
  color: #dc2626;
}

.recovery-state--empty i {
  color: #10b981;
}

.recovery-bots-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.recovery-bot-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.9rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

body.dark .recovery-bot-item {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.profile-plan-chip {
  cursor: pointer;
}

.settings-block-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  margin-bottom: 0;
}

.settings-block--account .settings-block-title {
  color: #0c4a6e;
}

.settings-block--email .settings-block-title {
  color: #3730a3;
}

.settings-block--password .settings-block-title {
  color: #92400e;
}

.settings-block--sessions .settings-block-title {
  color: #5b21b6;
}

body.dark .settings-block--account .settings-block-title {
  color: #7dd3fc;
}

body.dark .settings-block--email .settings-block-title {
  color: #c7d2fe;
}

body.dark .settings-block--password .settings-block-title {
  color: #fcd34d;
}

body.dark .settings-block--sessions .settings-block-title {
  color: #ddd6fe;
}

.settings-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #f1f3f5;
}

body.dark .settings-block-head {
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.settings-block-head .settings-block-heading {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-block-head .settings-block-title {
  margin-bottom: 0;
}

.settings-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(124, 58, 237, 0.22);
  color: #5b21b6;
}

body.dark .settings-count-badge {
  background: rgba(167, 139, 250, 0.28);
  color: #ede9fe;
}

.settings-list {
  display: flex;
  flex-direction: column;
}

.settings-list--nested {
  margin-top: 0;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f3f5;
}

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

body.dark .settings-row {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.settings-row-main {
  min-width: 0;
}

.settings-row-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

body.dark .settings-row-label {
  color: #f3f4f6;
}

.settings-row-value {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dark .settings-row-value {
  color: #f9fafb;
}

.settings-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--btn-indigo-border);
  border-radius: 9999px;
  background: var(--btn-indigo-bg);
  color: var(--btn-indigo-text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.settings-copy-btn:hover {
  background: var(--btn-indigo-bg-hover);
  color: var(--btn-indigo-text);
}

.settings-block--account > .settings-list > .settings-row .settings-copy-btn {
  background: var(--btn-teal-bg);
  border-color: var(--btn-teal-border);
  color: var(--btn-teal-text);
}

.settings-block--account > .settings-list > .settings-row .settings-copy-btn:hover {
  background: var(--btn-teal-bg-hover);
  color: var(--btn-teal-text);
}

.settings-hint,
.settings-empty-note {
  font-size: 0.84rem;
  line-height: 1.55;
  color: #374151;
  padding: 0.35rem 0 0.85rem;
}

body.dark .settings-hint,
body.dark .settings-empty-note {
  color: #e5e7eb;
}

.settings-block-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.settings-field {
  margin-bottom: 1.1rem;
}

.settings-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1f2937;
  margin-bottom: 0.35rem;
}

body.dark .settings-field-label {
  color: #f3f4f6;
}

.settings-field-input {
  width: 100%;
  padding: 0.55rem 0;
  border: none;
  border-bottom: 2px solid #9ca3af;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 500;
  color: #111827;
  outline: none;
  transition: border-color 0.2s ease;
}

.settings-field-input::placeholder {
  color: #6b7280;
}

body.dark .settings-field-input {
  color: #f9fafb;
  border-bottom-color: rgba(255, 255, 255, 0.28);
}

body.dark .settings-field-input::placeholder {
  color: #9ca3af;
}

.settings-field-input:focus {
  border-bottom-color: #6366f1;
}

.settings-block--account .settings-field-input:focus {
  border-bottom-color: #0284c7;
}

.settings-block--email .settings-field-input:focus {
  border-bottom-color: #6366f1;
}

.settings-block--password .settings-field-input:focus {
  border-bottom-color: #d97706;
}

body.dark .settings-field-input:focus {
  border-bottom-color: #818cf8;
}

body.dark .settings-block--account .settings-field-input:focus {
  border-bottom-color: #38bdf8;
}

body.dark .settings-block--password .settings-field-input:focus {
  border-bottom-color: #fbbf24;
}

.settings-subsection {
  margin-top: 1.25rem;
}

.settings-divider {
  height: 1px;
  margin-bottom: 1.25rem;
  background: #ececec;
}

body.dark .settings-divider {
  background: rgba(255, 255, 255, 0.1);
}

.settings-page .add-bot-action-btn {
  margin-top: 0.25rem;
}

.settings-block--account .add-bot-action-btn {
  background: var(--btn-teal-bg);
  border-color: var(--btn-teal-border);
  color: var(--btn-teal-text);
}

.settings-block--account .add-bot-action-btn:hover:not(:disabled) {
  background: var(--btn-teal-bg-hover);
  color: var(--btn-teal-text);
}

.settings-block--email .add-bot-action-btn {
  background: var(--btn-indigo-bg);
  border-color: var(--btn-indigo-border);
  color: var(--btn-indigo-text);
}

.settings-block--email .add-bot-action-btn:hover:not(:disabled) {
  background: var(--btn-indigo-bg-hover);
  color: var(--btn-indigo-text);
}

.settings-block--password .add-bot-action-btn {
  background: var(--btn-amber-bg);
  border-color: var(--btn-amber-border);
  color: var(--btn-amber-text);
}

.settings-block--password .add-bot-action-btn:hover:not(:disabled) {
  background: var(--btn-amber-bg-hover);
  color: var(--btn-amber-text);
}

.settings-page .ui-session-icon {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

body.dark .settings-page .ui-session-icon {
  background: rgba(167, 139, 250, 0.14);
  color: #c4b5fd;
}

.settings-action-btn--danger,
.add-bot-action-btn.settings-action-btn--danger {
  background: var(--btn-red-bg);
  border: 1px solid var(--btn-red-border);
  color: var(--btn-red-text);
  font-weight: 700;
}

.settings-action-btn--danger:hover:not(:disabled),
.add-bot-action-btn.settings-action-btn--danger:hover:not(:disabled) {
  background: var(--btn-red-bg-hover);
  color: var(--btn-red-text);
}

.settings-session-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.85rem;
}

.settings-page .ui-session-item {
  padding: 0.85rem 0;
  border-top: none;
  border-bottom: 1px solid #f1f3f5;
}

.settings-page .ui-session-item:last-child {
  border-bottom: none;
}

body.dark .settings-page .ui-session-item {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.settings-page .ui-session-device {
  color: #111827;
  font-weight: 700;
}

body.dark .settings-page .ui-session-device {
  color: #f9fafb;
}

.settings-page .ui-session-detail {
  color: #374151;
  font-weight: 500;
}

body.dark .settings-page .ui-session-detail {
  color: #e5e7eb;
}

.settings-session-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.settings-session-badge--current {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

body.dark .settings-session-badge--current {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.settings-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--btn-indigo-border);
  border-radius: 9999px;
  background: var(--btn-indigo-bg);
  color: var(--btn-indigo-text);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.settings-action-btn:hover:not(:disabled) {
  background: var(--btn-indigo-bg-hover);
  color: var(--btn-indigo-text);
}

.settings-action-btn--sm {
  width: auto;
  flex-shrink: 0;
}

.settings-action-btn--danger-outline {
  background: var(--btn-red-bg);
  border: 1px solid var(--btn-red-border);
  color: var(--btn-red-text);
  font-weight: 700;
}

.settings-action-btn--danger-outline:hover:not(:disabled) {
  background: var(--btn-red-bg-hover);
  color: var(--btn-red-text);
}

.settings-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: #4b5563;
  padding: 0.5rem 0 1rem;
}

body.dark .settings-footer-note {
  color: #d1d5db;
}

/* Add Bot + Profile — mobile / small screens */
@media (max-width: 640px) {
  .add-bot-page.ui-page,
  .profile-page.ui-page,
  .settings-page.ui-page {
    padding: calc(56px + 2.25rem) 0.875rem calc(2rem + env(safe-area-inset-bottom, 0px));
  }

  .recovery-page.ui-page {
    padding: calc(56px + 2.25rem) 0.875rem calc(2rem + env(safe-area-inset-bottom, 0px));
  }

  .add-bot-inner,
  .profile-page-inner {
    gap: 1.5rem;
  }

  .settings-page-inner {
    gap: 0.85rem;
  }

  .add-bot-hero-title {
    font-size: 1.35rem;
  }

  .add-bot-tabs {
    gap: 0.35rem;
    padding: 0.2rem;
  }

  .add-bot-tab {
    padding: 0.6rem 0.45rem;
    font-size: 0.76rem;
  }

  .add-bot-path-head {
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .add-bot-path-title {
    font-size: 0.95rem;
  }

  .add-bot-path-desc {
    font-size: 0.8rem;
  }

  .add-bot-divider {
    margin: 1.35rem 0;
  }

  .add-bot-field-input,
  .profile-page .profile-field-input,
  .profile-page .profile-bio-textarea,
  .settings-field-input {
    font-size: 16px;
  }

  .profile-page .profile-field-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .profile-page .profile-field.full-width {
    grid-column: 1;
  }

  .profile-page .profile-display-name {
    font-size: 1.2rem;
    overflow-wrap: anywhere;
  }

  .profile-page .profile-display-username {
    overflow-wrap: anywhere;
  }

  .profile-page .profile-meta-row {
    gap: 0.5rem;
  }

  .profile-about-head {
    align-items: center;
    gap: 0.5rem;
  }

  .profile-plan-limits,
  .settings-usage-grid,
  .billing-plan-dates {
    grid-template-columns: 1fr;
  }

  .deleted-bot-item {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "photo main"
      "actions actions";
  }

  .deleted-bot-photo {
    grid-area: photo;
  }

  .deleted-bot-main {
    grid-area: main;
  }

  .deleted-bot-actions {
    grid-area: actions;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .add-bot-page.ui-page,
  .profile-page.ui-page,
  .settings-page.ui-page {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .add-bot-path-head {
    align-items: center;
  }

  .add-bot-step {
    font-size: 0.82rem;
    gap: 0.65rem;
  }

  .add-bot-step span:last-child {
    min-width: 0;
  }

  .profile-header-main {
    gap: 0.75rem;
  }

  .profile-avatar {
    width: 3.5rem;
    height: 3.5rem;
  }

  .profile-page .profile-display-name {
    font-size: 1.1rem;
  }

  .profile-page .profile-meta-chip {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
  }

  .profile-header-main .profile-action-btn span,
  .profile-about-head .profile-action-btn span {
    display: none;
  }

  .profile-header-main .profile-action-btn,
  .profile-about-head .profile-action-btn {
    padding: 0.45rem 0.55rem;
  }

  .profile-page .profile-edit-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .profile-page .profile-edit-actions .profile-action-btn {
    width: 100%;
  }

  .profile-page .profile-bio-display,
  .profile-page .profile-bio-preview {
    font-size: 0.875rem;
  }

  .settings-hero-title {
    font-size: 1.35rem;
  }

  .settings-page .ui-session-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .settings-page .ui-session-item > .flex-shrink-0 {
    align-self: flex-start;
  }

  .settings-row-value {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
}