/*
 * الهوية البصرية لخدمة عقل الإذاعة المركزي (Broadcast Brain)
 * - ثيم داكن زجاجي بلون تمييز وحيد برتقالي (#f5821f)
 * - الألوان الدلالية الإضافية موثقة ومقصورة على حالات التشغيل (متصل / تحذير / خطر)
 * - الأزرار تتبع وصفة الطبقات الأربع مع انقلاب الظلال عند الضغط
 */

:root {
  --bg-base: #0b0d11;
  --bg-elevated: rgba(20, 24, 32, 0.78);
  --bg-card: rgba(24, 29, 39, 0.84);
  --bg-input: rgba(13, 16, 23, 0.92);
  --bg-sticky-th: #161b25;

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(245, 130, 31, 0.36);

  --text-primary: #f3f5f8;
  --text-secondary: #a7b0c0;
  --text-muted: #737d90;

  /* لون التمييز الأساسي الوحيد للهوية */
  --brand-orange: #f5821f;
  --brand-orange-hover: #ff9233;
  --brand-orange-soft: rgba(245, 130, 31, 0.14);

  /* ألوان دلالية مقصودة وموثقة لحالات النظام فقط */
  --status-online: #22c55e;
  --status-online-bg: rgba(34, 197, 94, 0.14);
  --status-warn: #f59e0b;
  --status-warn-bg: rgba(245, 158, 11, 0.14);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.14);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --space-1: 0.375rem;
  --space-2: 0.625rem;
  --space-3: 0.875rem;
  --space-4: 1.25rem;
  --space-5: 1.75rem;

  --font-ar: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

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

html {
  font-size: 16px;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-ar);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle at 85% 8%, rgba(245, 130, 31, 0.11), transparent 38%),
    radial-gradient(circle at 12% 90%, rgba(245, 130, 31, 0.06), transparent 34%);
  color: var(--text-primary);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
}

/* قاعدة أمان عامة تمنع تضخم أي أيقونة SVG داخل اللوحة خارج سياقاتها */
body svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* أرقام ثابتة العرض لمنع اهتزاز التخطيط عند التحديث الحي */
.num,
.stat-value,
.counter-pill,
code.hash-pill,
td[data-numeric="true"] {
  font-variant-numeric: tabular-nums;
}

/* شريط التحميل العلوي بهوية المنتج */
.brand-top-loader {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease;
  background: rgba(245, 130, 31, 0.16);
  overflow: hidden;
}

body.is-loading .brand-top-loader {
  opacity: 1;
}

.brand-top-loader::after {
  content: "";
  display: block;
  width: 38%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--brand-orange), transparent);
  animation: loaderSlide 1.1s infinite ease-in-out;
}

@keyframes loaderSlide {
  0% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(-280%);
  }
}

/* هيكل الانتظار: اللمعة تتحرك تحت المحتوى دون تحريك العنصر نفسه */
.skeleton-surface {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.skeleton-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(245, 130, 31, 0.09) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmerUnder 1.6s infinite linear;
  pointer-events: none;
}

@keyframes shimmerUnder {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* الترويسة وشريط التنقل الموحد المتجاوب */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link:focus-visible {
  position: fixed;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  z-index: 1100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  color: var(--text-primary);
  border: 2px solid var(--brand-orange);
  text-decoration: none;
  font-weight: 700;
}

.app-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(11, 13, 17, 0.86);
  border-block-end: 1px solid var(--border-glass);
}

.app-header.is-measuring * {
  transition: none !important;
}

.header-inner {
  max-width: 1280px;
  margin-inline: auto;
  padding: var(--space-2) var(--space-4);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.header-inner > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  min-height: 44px;
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(245, 130, 31, 0.24), rgba(245, 130, 31, 0.08));
  border: 1px solid var(--border-strong);
  color: var(--brand-orange);
  box-shadow: 0 0 16px rgba(245, 130, 31, 0.18);
}

.brand-icon-box svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.menu-button {
  anchor-name: --menu-button;
}

.site-menu {
  list-style: none;
  margin: 0;
  padding: var(--space-2);
  position: fixed;
  inset: auto;
  inset-block-start: 4.5rem;
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-end: var(--space-3);
  inline-size: min(82dvw, 21rem);
  max-inline-size: calc(100dvw - 2rem);
  block-size: fit-content;
  max-block-size: calc(100dvh - 6rem);
  margin-block-start: 0.4rem;
  overflow: auto;
  border-radius: var(--radius-md);
  background: rgba(16, 20, 28, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.58);
  color: var(--text-primary);
}

@supports not selector(:popover-open) {
  [popover]:not(.\:popover-open) {
    display: none;
  }
}

.site-menu:is(:popover-open, .\:popover-open) {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.site-menu::backdrop {
  background: rgba(5, 7, 10, 0.52);
  backdrop-filter: blur(2px);
}

.app-header.is-wide .menu-button {
  display: none;
}

.app-header.is-wide .site-menu {
  position: static;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-1);
  inline-size: auto;
  max-inline-size: none;
  block-size: auto;
  max-block-size: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.app-header.is-wide .site-menu::backdrop {
  display: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  width: 100%;
  min-height: 44px;
  padding-inline: 0.78rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.app-header.is-wide .nav-link {
  width: auto;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.is-active,
.nav-link[aria-current="page"] {
  color: var(--text-primary);
  background: var(--brand-orange-soft);
  border-color: var(--border-strong);
  box-shadow: inset 0 -2px 0 var(--brand-orange);
  padding-inline: 1rem;
}

.nav-pill-planned {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
}

.nav-logout-btn {
  width: 100%;
  justify-content: center;
}

.app-header.is-wide .nav-logout-item {
  margin-inline-start: var(--space-1);
}

.app-header.is-wide .nav-logout-btn {
  width: auto;
}

.nav-link svg,
.btn svg,
.icon-inline {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 2px;
}

/* شريط أقسام وحدة الإذاعة الفرعي */
.module-subnav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.module-subnav-identity {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.subnav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

.subnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding-inline: 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.subnav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.subnav-link.is-active,
.subnav-link[aria-current="page"] {
  color: var(--text-primary);
  background: var(--brand-orange-soft);
  border-color: var(--border-strong);
  box-shadow: inset 0 -2px 0 var(--brand-orange);
}

.subnav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* بطاقات الوحدات في الرئيسية وصفحات التنبيهات والإحصائيات */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-3);
}

.module-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(13, 16, 23, 0.78);
  border: 1px solid var(--border-glass);
}

.module-card.is-live {
  border-color: var(--border-strong);
  box-shadow: 0 0 22px rgba(245, 130, 31, 0.08);
}

.module-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.placeholder-card {
  width: 100%;
}

.placeholder-copy {
  margin: 0 0 var(--space-3);
  max-width: 66ch;
  color: var(--text-primary);
  line-height: 1.8;
}

@media (forced-colors: active) {
  .nav-link.is-active,
  .nav-link[aria-current="page"],
  .subnav-link.is-active,
  .subnav-link[aria-current="page"] {
    border: 2px solid Highlight;
  }
}

/* الحاوية الرئيسية والبطاقات الزجاجية */
.page-shell {
  max-width: 1280px;
  margin-inline: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.page-title-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.page-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-subtitle {
  margin: 0.2rem 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.card-title {
  margin: 0 0 var(--space-3);
  font-size: 1.08rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card-title svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* نظام الشبكات المتجاوبة */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--space-4);
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-2);
}

.stat-box {
  background: rgba(11, 13, 17, 0.56);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  margin-block-start: 0.15rem;
}

/*
 * وصفة الأزرار ذات الطبقات الأربع وحالة الضغط الفورية
 * 1) إبراز داخلي علوي (--btn-highlight)
 * 2) إظلام داخلي سفلي (--btn-shade)
 * 3) ظل تلامس ضيق بالأسفل (--btn-contact)
 * 4) توهج ناعم بلون الزر نفسه (--btn-glow)
 */
.btn {
  --btn-bg-top: #283040;
  --btn-bg-bottom: #1d2432;
  --btn-border: rgba(255, 255, 255, 0.12);
  --btn-text: var(--text-primary);
  --btn-highlight: rgba(255, 255, 255, 0.14);
  --btn-shade: rgba(0, 0, 0, 0.38);
  --btn-contact: rgba(0, 0, 0, 0.55);
  --btn-glow: rgba(255, 255, 255, 0.03);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.55rem 1.15rem;
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--btn-text);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--btn-bg-top) 0%, var(--btn-bg-bottom) 100%);
  box-shadow:
    inset 0 1px 0 var(--btn-highlight),
    inset 0 -2px 0 var(--btn-shade),
    0 2px 4px var(--btn-contact),
    0 0 14px var(--btn-glow);
  transition:
    filter 120ms ease,
    box-shadow 90ms ease,
    transform 70ms ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px var(--btn-contact),
    inset 0 -1px 0 transparent,
    0 1px 1px var(--btn-contact),
    0 0 6px var(--btn-glow);
}

.btn:disabled,
.btn[aria-busy="true"] {
  opacity: 0.68;
  cursor: not-allowed;
}

/* الزر البرتقالي الأساسي بمتغيرات ظله الخاصة */
.btn-primary {
  --btn-bg-top: #ff9334;
  --btn-bg-bottom: #e5720f;
  --btn-border: rgba(255, 185, 122, 0.42);
  --btn-text: #110c07;
  --btn-highlight: rgba(255, 232, 208, 0.48);
  --btn-shade: rgba(122, 52, 0, 0.48);
  --btn-contact: rgba(22, 10, 0, 0.62);
  --btn-glow: rgba(245, 130, 31, 0.34);
}

/* زر الخطر بمتغيرات ظله الخاصة */
.btn-danger {
  --btn-bg-top: #dc3c3c;
  --btn-bg-bottom: #b92525;
  --btn-border: rgba(255, 145, 145, 0.35);
  --btn-text: #fff7f7;
  --btn-highlight: rgba(255, 205, 205, 0.34);
  --btn-shade: rgba(84, 10, 10, 0.5);
  --btn-contact: rgba(24, 4, 4, 0.62);
  --btn-glow: rgba(239, 68, 68, 0.26);
}

.btn-compact {
  padding-inline: 0.8rem;
  font-size: 0.85rem;
}

.btn-loader-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  display: none;
  animation: spinRing 0.75s linear infinite;
}

.btn[aria-busy="true"] .btn-loader-dot {
  display: inline-block;
}

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

/* الحقول والنماذج */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-block-end: var(--space-3);
}

.field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.field-hint {
  font-size: 0.81rem;
  color: var(--text-secondary);
  margin: 0;
}

.input-control,
select.input-control,
textarea.input-control {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea.input-control {
  min-height: 150px;
  resize: vertical;
  line-height: 1.65;
}

.input-control:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(245, 130, 31, 0.18);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding-inline: 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-glass);
}

.check-row input[type="checkbox"],
.check-row input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-orange);
}

/* التنبيهات الصادقة */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  font-weight: 600;
}

.alert-banner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.alert-error {
  background: var(--status-danger-bg);
  border-color: rgba(239, 68, 68, 0.42);
  color: #fecaca;
}

.alert-success {
  background: var(--status-online-bg);
  border-color: rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}

.alert-warn {
  background: var(--status-warn-bg);
  border-color: rgba(245, 158, 11, 0.42);
  color: #fde68a;
}

/* الشارات وحالة الاتصال */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 700;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
}

.badge-online {
  background: var(--status-online-bg);
  border-color: rgba(34, 197, 94, 0.36);
  color: #86efac;
}

.badge-offline {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
}

.badge-warn {
  background: var(--status-warn-bg);
  border-color: rgba(245, 158, 11, 0.36);
  color: #fcd34d;
}

.badge-danger {
  background: var(--status-danger-bg);
  border-color: rgba(239, 68, 68, 0.36);
  color: #fca5a5;
}

.badge-orange {
  background: var(--brand-orange-soft);
  border-color: var(--border-strong);
  color: #ffb370;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* الجداول المتجاوبة وفق معيار responsive-table مع Container Queries */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(560px, 78vh);
  container-type: inline-size;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: rgba(11, 13, 17, 0.5);
}

.table-wrapper table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-wrapper caption {
  text-align: right;
  padding: var(--space-2) var(--space-3);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.table-wrapper thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.table-wrapper thead th {
  background: var(--bg-sticky-th);
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 700;
  padding: 0.75rem 0.9rem;
  border-block-end: 1px solid var(--border-glass);
  white-space: nowrap;
}

.table-wrapper tbody th,
.table-wrapper tbody td {
  padding: 0.75rem 0.9rem;
  border-block-end: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: middle;
  font-size: 0.9rem;
}

.table-wrapper tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--bg-sticky-th);
  font-weight: 700;
}

@container (width < 620px) {
  .table-wrapper table,
  .table-wrapper thead,
  .table-wrapper tbody,
  .table-wrapper tr,
  .table-wrapper th,
  .table-wrapper td {
    display: block;
  }

  .table-wrapper thead {
    display: none;
  }

  .table-wrapper tbody tr {
    margin: var(--space-2);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    background: rgba(20, 24, 32, 0.9);
  }

  .table-wrapper tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    border-block-end: 1px solid var(--border-glass);
  }

  .table-wrapper tbody td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--text-secondary);
  }
}

/* بطاقات اختيار البوت وباني الأزرار السبعة */
.bot-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-2);
}

.bot-select-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(13, 16, 23, 0.78);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.bot-select-card:has(input:checked) {
  border-color: var(--brand-orange);
  background: rgba(245, 130, 31, 0.08);
}

.button-builder-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bb-row-card {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(11, 13, 17, 0.65);
  border: 1px solid var(--border-glass);
}

.bb-btn-item {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: var(--space-2);
  padding: var(--space-2);
  margin-block-top: var(--space-2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bb-preview-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-block-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(9, 11, 15, 0.85);
  border: 1px dashed var(--border-glass);
}

.bb-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.bb-preview-pill {
  flex: 1 1 120px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.bb-preview-pill[data-style="primary"] {
  background: rgba(245, 130, 31, 0.22);
  border-color: var(--border-strong);
}

.bb-preview-pill[data-style="success"] {
  background: var(--status-online-bg);
  border-color: rgba(34, 197, 94, 0.4);
}

.bb-preview-pill[data-style="danger"] {
  background: var(--status-danger-bg);
  border-color: rgba(239, 68, 68, 0.4);
}

.sticky-actions-bar {
  position: sticky;
  inset-block-end: var(--space-2);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(16, 20, 28, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

code.hash-pill {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.81rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-glass);
  direction: ltr;
  display: inline-block;
}

.token-once-box {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(245, 130, 31, 0.12);
  border: 1px solid var(--brand-orange);
  margin-block-end: var(--space-3);
}

.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}

.login-card {
  width: min(100%, 430px);
}
