  /* ========== CSS Variables (Theme) ========== */
:root {
  --bg: #05050f;
  --bg-solid: #0a0a1a;
  --card-bg: rgba(20, 20, 40, 0.5);
  --card-hover: rgba(35, 35, 70, 0.85);
  --card-solid: rgba(20, 20, 40, 0.5);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #e8e8f0;
  --text-dim: #9090a8;
  --text-soft: #c0c0d0;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

  /* Accent colors */
  --accent-cyan: #00e5ff;
  --accent-purple: #b026ff;
  --accent-pink: #ff006e;
  --accent-green: #00ff88;
  --accent-yellow: #fbbf24;
  --accent-red: #ef4444;
  --accent-blue: #6366f1;

  /* Effects */
  --glass: blur(14px);
  --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.15);
  --glow-purple: 0 0 20px rgba(176, 38, 255, 0.15);

  --gradient-main: linear-gradient(135deg, #00e5ff, #b026ff, #ff006e, #00e5ff);
  --gradient-bg:
    radial-gradient(circle at 20% 30%, rgba(176, 38, 255, 0.18), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 229, 255, 0.18), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 0, 110, 0.12), transparent 50%);
  --grid-color: rgba(255, 255, 255, 0.025);
}

[data-theme='light'] {
  --bg: #f1f5f9;
  --bg-solid: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-hover: rgba(255, 255, 255, 0.95);
  --card-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.15);
  --text: #0f172a;
  --text-dim: #64748b;
  --text-soft: #334155;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);

  --gradient-main: linear-gradient(135deg, #6366f1, #a855f7, #ec4899, #6366f1);
  --gradient-bg:
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.12), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.12), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.08), transparent 50%);
  --grid-color: rgba(15, 23, 42, 0.04);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  transition:
    background 0.4s ease,
    color 0.4s ease;
}

body.lang-fa {
  font-family:
    'Vazirmatn',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}

/* ========== Animated Background ========== */
.bg-gradient {
  position: fixed;
  inset: 0;
  background: var(--gradient-bg);
  animation: bgPulse 12s ease-in-out infinite;
  z-index: -2;
  transition: background 0.4s ease;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

@keyframes bgPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.15) rotate(2deg);
  }
}

/* ========== Layout ========== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

/* ========== Header ========== */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-actions {
  position: absolute;
  top: 0;
  display: flex;
  gap: 0.5rem;
}

[dir='ltr'] .header-actions {
  right: 0;
}

[dir='rtl'] .header-actions {
  left: 0;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: var(--card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.2);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.icon-btn:hover svg {
  transform: scale(1.1) rotate(15deg);
}

.logo {
  font-size: 4rem;
  margin-bottom: 0.75rem;
  display: inline-block;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.4));
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

.title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: var(--gradient-main);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientText 6s ease infinite;
  margin-bottom: 0.5rem;
}

@keyframes gradientText {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.meta-bar {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.4rem;
}

.meta-item + .meta-item {
  border-left: 1px solid var(--border);
}

[dir='rtl'] .meta-item + .meta-item {
  border-left: none;
  border-right: 1px solid var(--border);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.dot.live {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 1.5s ease-in-out infinite;
}

.dot.warn {
  background: var(--accent-yellow);
  box-shadow: 0 0 8px var(--accent-yellow);
}

.dot.error {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.3);
  }
}

/* ========== Search ========== */
.search-container {
  max-width: 500px;
  margin: 0 auto 2.5rem;
  position: relative;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.15s backwards;
}

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

.search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  transition: transform 0.3s ease;
  color: var(--text-dim);
}

[dir='ltr'] .search-icon {
  left: 1.3rem;
}

[dir='rtl'] .search-icon {
  right: 1.3rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

[dir='ltr'] .search-input {
  padding-left: 3rem;
}

[dir='rtl'] .search-input {
  padding-right: 3rem;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow:
    0 0 0 3px rgba(0, 229, 255, 0.15),
    0 0 30px rgba(0, 229, 255, 0.2);
}

.search-input:focus ~ .search-icon,
.search-container:focus-within .search-icon {
  transform: translateY(-50%) scale(1.2);
  color: var(--accent-cyan);
}

/* ========== Categories ========== */
.category {
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s backwards;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid transparent;
  border-image: linear-gradient(to bottom, var(--accent-cyan), var(--accent-purple)) 1;
}

[dir='rtl'] .category-header {
  padding-left: 0;
  padding-right: 1rem;
  border-left: none;
  border-right: 3px solid transparent;
  border-image: linear-gradient(to bottom, var(--accent-cyan), var(--accent-purple)) 1;
}

.category-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.3));
}

.category-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.category-count {
  margin-left: auto;
  padding: 0.2rem 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: 'Courier New', monospace;
}

[dir='rtl'] .category-count {
  margin-left: 0;
  margin-right: auto;
}

/* ========== Services Grid ========== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ========== Service Card ========== */
.service-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: block;
  animation: cardFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transition: left 0.7s ease;
  pointer-events: none;
}

.service-card:hover::before {
  left: 100%;
}

.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    var(--accent-cyan),
    var(--accent-purple),
    var(--accent-pink)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.service-card:hover::after {
  opacity: 1;
}

.service-card:hover {
  transform: translateY(-6px) scale(1.02);
  background: var(--card-hover);
  box-shadow:
    var(--shadow),
    0 0 30px rgba(0, 229, 255, 0.15);
}

.service-card:active {
  transform: translateY(-3px) scale(1.01);
  transition-duration: 0.1s;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.service-icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.4));
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .service-icon {
  transform: scale(1.15) rotate(-8deg);
  filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.7));
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-dim);
  font-weight: 500;
}

.status-badge.checking {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-yellow);
}

.status-badge.online {
  background: rgba(0, 255, 136, 0.12);
  color: var(--accent-green);
}

.status-badge.offline {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.service-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.service-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  min-height: 2.5em;
}

.service-url {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  opacity: 0.75;
  word-break: break-all;
  margin-bottom: 0.9rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.technique-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 50px;
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-family: 'Courier New', monospace;
}

.arrow {
  color: var(--accent-cyan);
  font-size: 1.2rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

[dir='ltr'] .arrow {
  transform: translateX(0);
}

[dir='rtl'] .arrow {
  transform: translateX(0);
}

.service-card:hover .arrow {
  transform: translateX(6px);
}

[dir='rtl'] .service-card:hover .arrow {
  transform: translateX(-6px);
}

.service-card.hidden {
  display: none;
}

.category.hidden {
  display: none;
}

/* ========== Models Section ========== */
.models-section {
  margin: 2.5rem 0;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s backwards;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-title-icon {
  font-size: 1.4rem;
}

.section-title-count {
  margin-left: auto;
  padding: 0.2rem 0.7rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: 'Courier New', monospace;
}

[dir='rtl'] .section-title-count {
  margin-left: 0;
  margin-right: auto;
}

.models-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  max-height: 240px;
  overflow-y: auto;
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
}

.model-tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  margin: 0.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  transition: all 0.2s ease;
}

.model-tag:hover {
  transform: translateY(-1px);
  border-color: var(--accent-cyan);
}

.model-tag.local {
  color: var(--accent-green);
  border-color: rgba(0, 255, 136, 0.3);
}

.model-tag.cloud {
  color: var(--accent-blue);
  border-color: rgba(99, 102, 241, 0.3);
}

.models-empty {
  color: var(--text-dim);
  font-style: italic;
  padding: 0.5rem;
}

/* ========== Quick Actions ========== */
.actions-section {
  margin: 2.5rem 0;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s backwards;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  font-family: inherit;
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
}

.action-btn:hover {
  background: var(--card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 229, 255, 0.15);
}

/* ========== Footer ========== */
.footer {
  text-align: center;
  margin-top: 4rem;
  padding: 2rem 0 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.footer kbd {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--accent-cyan);
  margin: 0 0.2rem;
}

.footer-links {
  margin-top: 0.5rem;
}

.footer-links a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-purple);
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--card-solid);
  color: var(--text);
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--accent-cyan);
  z-index: 9999;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9rem;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== Help Modal ========== */
.help-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.help-modal.show {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.help-content {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow);
}

.help-content h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  background: var(--gradient-main);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientText 6s ease infinite;
}

.help-content ul {
  list-style: none;
}

.help-content li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.help-content li:last-child {
  border: none;
}

.help-content kbd {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

/* ========== No Results ========== */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
  display: none;
}

.no-results.show {
  display: block;
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .container {
    padding: 4rem 1rem 1rem;
  }

  .logo {
    font-size: 3rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .meta-bar {
    font-size: 0.78rem;
    padding: 0.5rem 0.75rem;
  }

  .header-actions {
    top: -0.5rem;
  }

  [dir='ltr'] .header-actions {
    right: 0.5rem;
  }

  [dir='rtl'] .header-actions {
    left: 0.5rem;
  }
}

@media (max-width: 480px) {
  .meta-item.hide-mobile {
    display: none;
  }

  .service-desc {
    min-height: auto;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ============= Environment Badge ============= */
.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: var(--bg-card, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  margin: 14px 0 4px;
  user-select: none;
}

.env-badge:hover {
  border-color: var(--accent-cyan, #00e5ff);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.15);
}

.env-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 10px #00e5ff;
  transition: all 0.3s;
}

.env-dot.local {
  background: #00e5ff;
  box-shadow: 0 0 10px #00e5ff;
}

.env-dot.server {
  background: #b026ff;
  box-shadow: 0 0 10px #b026ff;
}

.env-hint {
  opacity: 0.5;
  font-size: 12px;
  margin-left: 2px;
}

/* ============= Port Badge (replaces technique-badge) ============= */
.port-badge {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-input, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 6px;
  color: var(--text-muted, #8b8b9e);
  letter-spacing: 0.5px;
}

/* ============= Settings Modal ============= */
.settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: modalFadeIn 0.2s ease;
}

.settings-modal.show {
  display: flex;
}

.settings-content {
  background: var(--bg-card, #0e0e1a);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.settings-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.icon-btn-sm {
  width: 32px;
  height: 32px;
  font-size: 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  color: inherit;
  transition: all 0.2s;
}

.icon-btn-sm:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color, rgba(255, 255, 255, 0.1));
}

.settings-body {
  padding: 22px;
  overflow-y: auto;
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.setting-group {
  margin-bottom: 22px;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-group > label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-color, #e0e0e8);
  letter-spacing: 0.3px;
}

.setting-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input, rgba(0, 0, 0, 0.3));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  color: var(--text-color, #e0e0e8);
  font-size: 14px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  transition: all 0.2s;
  box-sizing: border-box;
}

.setting-input:focus {
  outline: none;
  border-color: var(--accent-cyan, #00e5ff);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.setting-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.setting-group small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted, #8b8b9e);
  font-size: 12px;
  line-height: 1.5;
}

/* Radio Cards */
.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.radio-option {
  cursor: pointer;
  display: block;
}

.radio-option input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: var(--bg-input, rgba(0, 0, 0, 0.2));
  border: 2px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  transition: all 0.2s ease;
  text-align: center;
}

.radio-card:hover {
  border-color: rgba(0, 229, 255, 0.3);
}

.radio-option input[type='radio']:checked + .radio-card {
  border-color: var(--accent-cyan, #00e5ff);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.radio-option input[type='radio']:focus-visible + .radio-card {
  border-color: var(--accent-cyan, #00e5ff);
}

.radio-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.radio-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-color, #e0e0e8);
}

.radio-desc {
  font-size: 11px;
  color: var(--text-muted, #8b8b9e);
  margin-top: 3px;
}

/* Primary Button */
.action-btn.btn-primary {
  background: var(--accent-cyan, #00e5ff);
  color: #05050f;
  font-weight: 600;
  border: none;
}

.action-btn.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3);
}

/* Modal Animations */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* RTL adjustments for settings */
body.lang-fa .env-badge {
  direction: rtl;
}

body.lang-fa .settings-footer {
  flex-direction: row-reverse;
}

body.lang-fa .radio-group {
  direction: rtl;
}

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

  .settings-content {
    max-width: 100%;
  }
}
