/* ==============================================================================
   Check IP - Mobile-First Modern Dark Theme & Glassmorphism CSS (v1.0.5)
   ============================================================================== */

:root {
  --bg-primary: #0a0d12;
  --bg-card: rgba(18, 22, 29, 0.85);
  --bg-card-hover: rgba(24, 30, 40, 0.95);
  --bg-input: #12171f;
  --bg-input-focus: #161c26;
  --bg-terminal: #07090c;
  --border-color: rgba(240, 246, 252, 0.1);
  --border-focus: #58a6ff;

  --text-primary: #f0f6fc;
  --text-secondary: #9198a1;
  --text-muted: #656c76;
  --text-terminal: #7ee787;

  --accent-primary: #238636;
  --accent-primary-hover: #2ea043;
  --accent-blue: #1f6feb;
  --accent-blue-hover: #388bfd;

  --status-success: #3fb950;
  --status-success-bg: rgba(63, 185, 80, 0.12);
  --status-success-border: rgba(63, 185, 80, 0.35);

  --status-warning: #d29922;
  --status-warning-bg: rgba(210, 153, 34, 0.12);
  --status-warning-border: rgba(210, 153, 34, 0.35);

  --status-danger: #f85149;
  --status-danger-bg: rgba(248, 81, 73, 0.12);
  --status-danger-border: rgba(248, 81, 73, 0.35);

  --status-info: #58a6ff;
  --status-info-bg: rgba(88, 166, 255, 0.12);
  --status-info-border: rgba(88, 166, 255, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(31, 111, 235, 0.18) 0%, transparent 65%),
    radial-gradient(circle at 100% 100%, rgba(35, 134, 54, 0.1) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  justify-content: center;
  padding: 16px 12px;
}

.app-container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: auto 0;
}

/* Top Promo Banner (Telegram Stable Access) */
.top-banner {
  position: relative;
  background: linear-gradient(135deg, rgba(34, 158, 217, 0.16) 0%, rgba(15, 20, 28, 0.95) 100%);
  border: 1px solid rgba(34, 158, 217, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 15px rgba(34, 158, 217, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.top-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #229ed9, #58a6ff, #3fb950);
  opacity: 0.85;
}

.top-banner:hover {
  border-color: rgba(56, 178, 240, 0.6);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 20px rgba(34, 158, 217, 0.25);
}

.top-banner-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 440px) {
  .top-banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
}

.top-banner-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.top-banner-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-banner-icon {
  font-size: 0.95rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
}

.top-banner-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.top-banner-text {
  font-size: 0.82rem;
  color: #c9d8ea;
  line-height: 1.35;
  margin: 0;
}

.btn-top-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #229ed9 0%, #1e88e5 100%);
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(34, 158, 217, 0.35);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.btn-top-banner:hover {
  background: linear-gradient(135deg, #2db2f2 0%, #2196f3 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.55);
}

.btn-top-banner:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(34, 158, 217, 0.35);
}

.btn-top-banner-arrow {
  font-size: 0.9rem;
  transition: transform 0.15s ease;
}

.btn-top-banner:hover .btn-top-banner-arrow {
  transform: translateX(2px);
}

/* Header */
.app-header {
  text-align: center;
  padding: 8px 0 4px;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(31, 111, 235, 0.12);
  border: 1px solid rgba(56, 139, 253, 0.3);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #58a6ff;
  margin-bottom: 10px;
}

.main-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 40%, #8b949e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
  padding: 0 8px;
}

/* Service Switcher Navigation (Header Pill Switcher) */
.service-switcher-nav {
  margin: 14px auto 6px;
  display: flex;
  justify-content: center;
}

.switcher-track {
  display: inline-flex;
  align-items: center;
  background: rgba(14, 18, 26, 0.85);
  border: 1px solid rgba(240, 246, 252, 0.12);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.switcher-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.switcher-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.switcher-tab.active {
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.9) 0%, rgba(35, 134, 54, 0.85) 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(31, 111, 235, 0.4);
}

.switcher-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.switcher-sub {
  font-size: 0.72rem;
  opacity: 0.8;
  font-weight: 500;
}

.switcher-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Card */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

/* Mode Selector Chips (Unified with Port Chips) */
.mode-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-chip {
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mode-chip:hover {
  background: var(--bg-input-focus);
  color: var(--text-primary);
}

.mode-chip.active {
  background: rgba(31, 111, 235, 0.2);
  border-color: #388bfd;
  color: #58a6ff;
  font-weight: 600;
}

.form-hint,
.mode-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
  padding: 0 2px;
}

/* Fallback alias for cached HTML */
.mode-tab {
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 8px;
  transition: all 0.15s ease;
}

.mode-tab.active {
  background: rgba(31, 111, 235, 0.2);
  border-color: #388bfd;
  color: #58a6ff;
  font-weight: 600;
}

/* Flag icon */
.flag-icon {
  width: 19px;
  height: 13px;
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  vertical-align: middle;
  display: inline-block;
}

.flag-emoji {
  font-size: 1rem;
  line-height: 1;
  display: inline-block;
}

/* Node Type Badges (Datacenter vs Residential vs Mobile) */
.node-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.675rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.node-type-pill.type-dc {
  background: rgba(88, 166, 255, 0.12);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: #79c0ff;
}

.node-type-pill.type-res {
  background: rgba(210, 153, 34, 0.14);
  border: 1px solid rgba(210, 153, 34, 0.35);
  color: #e3b341;
}

.node-type-pill.type-mobile {
  background: rgba(163, 113, 247, 0.14);
  border: 1px solid rgba(163, 113, 247, 0.35);
  color: #d2a8ff;
}

.badge-anomaly {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid rgba(248, 81, 73, 0.4);
  color: #ff7b72;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Extended Cache Banner */
.cache-badge-banner.extended-cache {
  background: rgba(210, 153, 34, 0.12);
  border: 1px solid rgba(210, 153, 34, 0.35);
}

.cache-lock-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e3b341;
  background: rgba(210, 153, 34, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Form */
.check-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.form-input {
  width: 100%;
  height: 50px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.975rem;
  padding: 0 16px;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

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

/* Port Chips */
.port-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.chip {
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  background: var(--bg-input-focus);
  color: var(--text-primary);
}

.chip.active {
  background: rgba(31, 111, 235, 0.2);
  border-color: #388bfd;
  color: #58a6ff;
  font-weight: 600;
}

.custom-port-wrapper {
  margin-top: 6px;
}

/* Button */
.btn {
  height: 52px;
  border-radius: var(--radius-md);
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(180deg, #2ea043 0%, #238636 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(35, 134, 54, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #3fb950 0%, #2ea043 100%);
  box-shadow: 0 6px 18px rgba(46, 160, 67, 0.45);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  height: 48px;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline-sm {
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.35);
  color: #58a6ff;
  height: 34px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-outline-sm:hover {
  background: rgba(88, 166, 255, 0.18);
  border-color: #58a6ff;
}

/* Scanner Animation (Radar) */
.scanner-card {
  text-align: center;
  padding: 28px 20px;
}

.radar-spinner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(88, 166, 255, 0.3);
  position: relative;
  margin: 0 auto 16px;
  animation: pulse-ring 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

.radar-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #58a6ff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px #58a6ff;
}

.radar-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg at 50% 50%, rgba(88, 166, 255, 0) 0deg, rgba(88, 166, 255, 0.45) 360deg);
  animation: radar-sweep 1.2s linear infinite;
}

@keyframes radar-sweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.scanner-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.scanner-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Alert */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.alert-danger {
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  color: #ff7b72;
}

/* Result Card */
.result-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease-out;
}

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

.verdict-banner {
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.verdict-banner.success {
  background: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
}

.verdict-banner.warning {
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
}

.verdict-banner.danger {
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
}

.verdict-banner.info {
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
}

.verdict-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.verdict-icon {
  font-size: 1.3rem;
}

.verdict-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.verdict-banner.success .verdict-title { color: #56d364; }
.verdict-banner.warning .verdict-title { color: #e3b341; }
.verdict-banner.danger .verdict-title { color: #ff7b72; }
.verdict-banner.info .verdict-title { color: #79c0ff; }

.verdict-desc {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.45;
}

/* Cache Badge Banner */
.cache-badge-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(210, 153, 34, 0.12);
  border: 1px solid rgba(210, 153, 34, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #e3b341;
  font-weight: 500;
  animation: fadeIn 0.25s ease-out;
  flex-wrap: wrap;
}

.cache-badge-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cache-badge-banner .cache-icon {
  font-size: 0.95rem;
}

.btn-cache-refresh {
  background: rgba(227, 179, 65, 0.18);
  border: 1px solid rgba(227, 179, 65, 0.45);
  color: #f0883e;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-cache-refresh:hover {
  background: rgba(227, 179, 65, 0.3);
  color: #ffffff;
  border-color: rgba(227, 179, 65, 0.7);
}

.btn-cache-refresh:active {
  transform: scale(0.97);
}

/* Probes Section & Multi-Node Summary */
.probes-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.probes-title {
  font-size: 0.825rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.probe-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.probe-item.summary-item {
  background: rgba(18, 23, 31, 0.95);
  border: 1px solid rgba(240, 246, 252, 0.12);
  padding: 13px 15px;
}

/* Enhanced 2-Line Summary Cards (Россия / Зарубеж) */
.summary-card {
  background: rgba(18, 23, 31, 0.95);
  border: 1px solid rgba(240, 246, 252, 0.12);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease;
}

.summary-card:hover {
  border-color: rgba(240, 246, 252, 0.22);
}

.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 28px;
}

.summary-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.summary-region-flag {
  font-size: 1.1rem;
  line-height: 1;
}

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

.summary-card-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-ping {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.summary-metrics {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(240, 246, 252, 0.08);
}

.summary-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.825rem;
  line-height: 1.4;
}

.metric-name {
  color: #8b949e;
  font-size: 0.825rem;
  font-weight: 500;
}

.metric-val {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #8b949e;
  font-size: 0.825rem;
  font-weight: 500;
}

.metric-val strong {
  color: #58a6ff;
  font-weight: 700;
  font-size: 0.875rem;
}

.probe-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.probe-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.probe-ping {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pill.online {
  background: var(--status-success-bg);
  color: #56d364;
  border: 1px solid var(--status-success-border);
}

.status-pill.warning {
  background: var(--status-warning-bg);
  color: #e3b341;
  border: 1px solid var(--status-warning-border);
}

.status-pill.offline {
  background: var(--status-danger-bg);
  color: #ff7b72;
  border: 1px solid var(--status-danger-border);
}

.status-pill.infra {
  background: rgba(139, 148, 158, 0.15);
  color: #8b949e;
  border: 1px solid rgba(139, 148, 158, 0.35);
}

.status-pill-sm {
  padding: 2px 8px;
  font-size: 0.75rem;
}

/* Monospaced code status pills (+/+, +/-, -/-, ?/?) */
.status-pill.status-pill-code {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;
  font-weight: 700;
  font-size: 0.825rem;
  letter-spacing: 0.5px;
  min-width: 38px;
  justify-content: center;
  text-align: center;
  padding: 2px 6px;
  flex-shrink: 0;
}

/* Explanation bar (плашка расшифровки Сервер / Порт) */
.status-legend-bar {
  background: rgba(56, 139, 253, 0.06);
  border: 1px solid rgba(56, 139, 253, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.legend-bar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.785rem;
}

.legend-bar-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.legend-bar-title {
  color: #c9d1d9;
}

.legend-bar-title strong {
  color: #58a6ff;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;
}

.legend-bar-items {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* Single Details Accordion Toggle Button */
.btn-details-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: var(--radius-sm);
  color: #58a6ff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-details-toggle:hover {
  background: rgba(88, 166, 255, 0.16);
  border-color: rgba(88, 166, 255, 0.45);
  color: #79c0ff;
}

.btn-details-toggle .details-toggle-icon {
  font-size: 0.85rem;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-details-toggle.is-active .details-toggle-icon {
  transform: rotate(180deg);
}

/* Details Accordion Body */
.details-accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  opacity: 0;
}

.details-accordion-body.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.details-accordion-content {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.details-group-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(240, 246, 252, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.details-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-badge {
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8b949e;
}

.nodes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.node-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid rgba(240, 246, 252, 0.05);
  border-radius: var(--radius-sm);
  gap: 10px;
}

.node-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.node-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.node-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.node-code {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;
  font-weight: 700;
  font-size: 0.775rem;
  color: #79c0ff;
  background: rgba(56, 139, 253, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.node-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.node-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Recommendations */
.recommendations-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.rec-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.rec-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rec-item {
  font-size: 0.875rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 18px;
  line-height: 1.4;
}

.rec-item::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: #58a6ff;
  font-weight: bold;
}

/* Technical CLI Terminal Section */
.terminal-section {
  display: flex;
  flex-direction: column;
  background: #06090e;
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0d1117;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(240, 246, 252, 0.08);
}

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

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title-text {
  font-size: 0.775rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-left: 6px;
}

.terminal-box {
  background: var(--bg-terminal);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.775rem;
  line-height: 1.55;
  color: #c9d1d9;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.terminal-box .cmd {
  color: #79c0ff;
  font-weight: 600;
}

.terminal-box .ok {
  color: #7ee787;
}

.terminal-box .fail {
  color: #ff7b72;
}

/* Actions Section */
.actions-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #21262d;
  border: 1px solid rgba(240, 246, 252, 0.2);
  padding: 10px 20px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  animation: toastFade 0.25s ease-out;
}

@keyframes toastFade {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==============================================================================
   Hosters Recommendation Section & Accordion
   ============================================================================== */

.hosters-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hosters-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hosters-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(46, 160, 67, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #56d364;
  margin-bottom: 2px;
}

.hosters-badge .badge-icon {
  font-size: 0.9rem;
}

.hosters-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.hosters-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 440px;
}

.btn-section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  padding: 7px 16px;
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 999px;
  color: #58a6ff;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-section-toggle:hover {
  background: rgba(88, 166, 255, 0.16);
  border-color: rgba(88, 166, 255, 0.45);
  color: #79c0ff;
}

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

.btn-section-toggle .section-toggle-icon {
  font-size: 0.75rem;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hosters-card.is-expanded .btn-section-toggle .section-toggle-icon {
  transform: rotate(180deg);
}

/* Whole Section Body Accordion */
.hosters-section-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 0;
}

.hosters-card.is-expanded .hosters-section-body {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 14px;
}

.hosters-section-content {
  overflow: hidden;
}

.hosters-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hoster-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hoster-item:hover {
  border-color: rgba(88, 166, 255, 0.25);
}

.hoster-item.is-open {
  border-color: rgba(88, 166, 255, 0.45);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.hoster-summary {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hoster-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

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

.hoster-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.hoster-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #238636;
  color: #ffffff;
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn-cta:hover {
  background: #2ea043;
}

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

.btn-cta .cta-arrow {
  font-size: 0.9rem;
  font-weight: bold;
}

.hoster-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 0.825rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.hoster-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(240, 246, 252, 0.2);
}

.hoster-toggle-btn .toggle-icon {
  font-size: 0.75rem;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hoster-item.is-open .hoster-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

/* Accordion Smooth Height Animation */
.hoster-accordion {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  opacity: 0;
}

.hoster-item.is-open .hoster-accordion {
  grid-template-rows: 1fr;
  opacity: 1;
  border-top: 1px solid rgba(240, 246, 252, 0.08);
}

.accordion-content {
  overflow: hidden;
}

.accordion-grid {
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .accordion-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

.pros-column,
.cons-column {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.column-title {
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pros-title {
  color: #56d364;
}

.cons-title {
  color: #ff7b72;
}

.features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feature-item {
  font-size: 0.8rem;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.feature-item .marker {
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  line-height: 1.35;
}

.pro-item .marker {
  color: #56d364;
}

.con-item .marker {
  color: #ff7b72;
}

.feature-item .text {
  color: var(--text-secondary);
}

/* Footer & Utilities */
.hidden {
  display: none !important;
}

.app-footer {
  text-align: center;
  padding: 6px 0;
}

.footer-note {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  .main-title {
    font-size: 1.45rem;
  }
  .card {
    padding: 16px;
  }
  .hoster-actions {
    grid-template-columns: 1fr;
  }
}

