/* ==========================================================================
   zbxctl GitHub Pages - Accessible & Responsive Design System (WCAG 2.x AA/AAA)
   ========================================================================== */

:root {
  --bg-dark: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-alt: #F8FAFC;
  --border-color: #E2E8F0;
  --border-glow: rgba(37, 99, 235, 0.25);
  
  --zabbix-navy: #0F172A;
  --zabbix-slate: #1E293B;
  --zabbix-blue: #2563EB;
  --zabbix-blue-hover: #1D4ED8;
  --zabbix-blue-dark: #1E40AF;
  --zabbix-blue-light: #EFF6FF;
  
  /* Red brand accent with WCAG AA compliant contrast ratio (>= 4.5:1 on white) */
  --zabbix-red: #D92D20;
  --zabbix-red-hover: #B42318;
  --zabbix-red-light: #FEF3F2;
  --zabbix-red-border: #FECDCA;

  --primary-cyan: #2563EB;
  --primary-violet: #1D4ED8;
  --accent-purple: #1E40AF;
  --accent-green: #059669;
  --accent-yellow: #D97706;
  --accent-red: #DC2626;
  
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dim: #64748B;

  --card-shadow: 0 4px 16px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
  --card-shadow-hover: 0 12px 28px rgba(37, 99, 235, 0.12), 0 4px 10px rgba(15, 23, 42, 0.04);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  position: relative;
  min-width: 320px;
}

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

pre, code {
  max-width: 100%;
}

/* ==========================================================================
   Accessibility Utilities (WCAG 2.x)
   ========================================================================== */

/* Screen reader only utility class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to main content link (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--zabbix-blue);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  z-index: 10000;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid #FFFFFF;
  outline-offset: 2px;
}

/* Focus visible styles across all interactive elements (WCAG 2.4.7) */
:focus-visible {
  outline: 2px solid var(--zabbix-blue);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[role="tab"]:focus-visible,
[role="region"][tabindex="0"]:focus-visible,
pre[tabindex="0"]:focus-visible {
  outline: 2px solid var(--zabbix-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* Subtle Glow FX */
.bg-glow {
  position: absolute;
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
  overflow: hidden;
}

.bg-glow-1 {
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #BFDBFE, #EFF6FF);
}

.bg-glow-2 {
  top: 800px;
  right: 0;
  background: radial-gradient(circle, #DBEAFE, #FFFFFF);
}

/* ==========================================================================
   Navigation Bar & Responsive Mobile Menu
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--zabbix-navy);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  min-height: 44px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.brand-badge {
  font-size: 0.75rem;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* Desktop navigation links */
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.1vw, 1.25rem);
  white-space: nowrap;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.2s ease;
  padding: 0.4rem 0.25rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--zabbix-blue);
}

.nav-actions {
  flex-shrink: 0;
}

.nav-mobile-actions {
  display: none;
}

/* Mobile hamburger toggle button */
.nav-toggle {
  display: none;
  background: #F1F5F9;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nav-toggle:hover {
  background: #E2E8F0;
}

.hamburger-box {
  width: 22px;
  height: 16px;
  position: relative;
  display: block;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  width: 22px;
  height: 2px;
  background-color: var(--zabbix-navy);
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease, background-color 0.25s ease;
}

.hamburger-inner {
  top: 7px;
}

.hamburger-inner::before {
  content: '';
  top: -7px;
}

.hamburger-inner::after {
  content: '';
  top: 7px;
}

/* Hamburger active transformation (X icon) */
.nav-toggle[aria-expanded="true"] .hamburger-inner {
  background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger-inner::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger-inner::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Common Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  min-height: 44px;
  line-height: 1.2;
}

.btn-primary {
  background: var(--zabbix-blue);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: var(--zabbix-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: #F1F5F9;
  color: var(--zabbix-navy);
  border: 1px solid #E2E8F0;
}

.btn-secondary:hover {
  background: #E2E8F0;
  border-color: #CBD5E1;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding: 5rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

.hero-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw + 0.75rem, 3.25rem);
  line-height: 1.15;
  font-weight: 800;
  color: var(--zabbix-navy);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.gradient-text {
  color: var(--zabbix-red);
}

.hero-description {
  font-size: clamp(1rem, 1.5vw + 0.5rem, 1.15rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 540px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

/* Terminal Mockup */
.hero-terminal {
  background: #1A1F2C;
  border: 1px solid #374151;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(37, 99, 235, 0.08);
}

.terminal-header {
  background: #111520;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #2D3748;
}

.terminal-dots {
  display: flex;
  gap: 0.4rem;
  margin-right: 1rem;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot-red { background: #FF5F56; }
.dot-yellow { background: #FFBD2E; }
.dot-green { background: #27C93F; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #9CA3AF;
}

.terminal-body {
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  color: #E5E7EB;
}

.terminal-line {
  margin-bottom: 0.5rem;
  color: #F9FAFB;
  word-break: break-all;
}

.prompt {
  color: #FF6B6B;
  font-weight: bold;
}

.terminal-output {
  background: #111520;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.85rem;
  color: #34D399;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-output .key { color: #60A5FA; }
.terminal-output .string { color: #34D399; }
.terminal-output .number { color: #FBBF24; }

.terminal-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #111520;
  border-radius: 6px;
}

.terminal-table {
  width: 100%;
  border-collapse: collapse;
  padding: 0.4rem 0.5rem;
  font-size: 0.72rem;
  color: #E5E7EB;
  text-align: left;
}

.terminal-table th,
.terminal-table td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
  white-space: nowrap;
}

.terminal-table th {
  color: #9CA3AF;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.terminal-table .host-name {
  color: #93C5FD;
}

.sev-high {
  color: #F87171;
  font-weight: 600;
}

.status-badge {
  color: #991B1B;
  background: #FEE2E2;
  border: 1px solid #FECACA;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-block;
  text-align: center;
  width: fit-content;
}

.terminal-table .ack-no {
  color: #9CA3AF;
  font-weight: 500;
}

.terminal-table .ack-yes {
  color: #34D399;
  font-weight: 500;
}

.prob-name {
  color: #E5E7EB;
  white-space: normal;
  line-height: 1.25;
}

/* ==========================================================================
   Sections Common
   ========================================================================== */

.section {
  padding: 5rem 1.5rem;
  position: relative;
  z-index: 1;
}

.alt-bg {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.35rem);
  font-weight: 700;
  color: var(--zabbix-navy);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.section-subtitle {
  font-size: clamp(0.95rem, 1.5vw + 0.25rem, 1.1rem);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Installation Grid
   ========================================================================== */

.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.install-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.install-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.install-card-header {
  margin-bottom: 0.75rem;
  min-height: 60px;
}

.install-os-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.os-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  flex-shrink: 0;
  color: var(--zabbix-navy);
  transition: all 0.2s ease;
}

.install-card:hover .os-icon {
  background: #FFFFFF;
  border-color: var(--zabbix-blue);
  color: var(--zabbix-blue);
}

.install-os-info h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--zabbix-navy);
  margin: 0;
  line-height: 1.2;
}

.arch-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.arch-badge {
  font-size: 0.72rem;
  background: #EFF6FF;
  color: #1E40AF; /* High contrast text on light blue (WCAG AAA) */
  border: 1px solid #BFDBFE;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
}

.install-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
  min-height: 64px;
}

.install-cmd-block {
  background: #111520;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  min-height: 54px;
}

.install-cmd-block code {
  color: #34D399;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow-x: auto;
  padding: 0.2rem 0;
}

.copy-btn {
  background: #E2E8F0;
  border: none;
  color: #0F172A;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  flex-shrink: 0;
  min-height: 44px;
  min-width: 44px;
}

.copy-btn:hover,
.copy-btn:focus {
  background: var(--zabbix-blue);
  color: #FFFFFF;
}

.direct-downloads {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 92px;
}

.dl-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--zabbix-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
  min-height: 44px;
}

.dl-link:hover,
.dl-link:focus {
  color: var(--zabbix-blue-hover);
  text-decoration: underline;
}

.github-rel-btn {
  color: var(--zabbix-red);
}

/* ==========================================================================
   Features Grid
   ========================================================================== */

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  transition: all 0.25s ease;
}

.feature-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--zabbix-navy);
  margin-bottom: 0.6rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   Interactive Command Playground
   ========================================================================== */

.playground-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
}

.search-bar {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-bar input {
  width: 100%;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  padding: 0.9rem 1.2rem 0.9rem 3rem;
  color: var(--zabbix-navy);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  min-height: 48px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar input:focus {
  border-color: var(--zabbix-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.command-categories {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.cat-btn {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #334155;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.cat-btn.active,
.cat-btn:hover {
  background: #EFF6FF;
  color: var(--zabbix-blue);
  border-color: #BFDBFE;
}

.command-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1rem;
}

.cmd-item {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}

.cmd-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cmd-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--zabbix-red);
  word-break: break-word;
}

.cmd-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #E2E8F0;
  color: #1E293B;
  flex-shrink: 0;
}

.cmd-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.cmd-example {
  background: #1E222D;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #34D399;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.cmd-example code {
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.2rem 0;
}

/* ==========================================================================
   Safety Level Section
   ========================================================================== */

.safety-interactive {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.75rem;
  align-items: start;
}

.safety-selector {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.safety-option {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 48px;
  width: 100%;
}

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

.safety-option.active {
  border-color: var(--zabbix-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), var(--card-shadow-hover);
  background: #FFFFFF;
}

.safety-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.level-readonly { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.level-mine { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.level-all { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.level-danger { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

.safety-opt-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.safety-details {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
}

.safety-details-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #F1F5F9;
}

.safety-level-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.safety-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.safety-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.safety-box {
  padding: 1.15rem 1.25rem;
  border-radius: 10px;
}

.safety-box-allowed {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
}

.safety-box-blocked {
  background: #FEF2F2;
  border: 1px solid #FECACA;
}

.safety-box-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.safety-box-allowed .safety-box-title {
  color: #065F46;
}

.safety-box-blocked .safety-box-title {
  color: #991B1B;
}

.safety-ops-list {
  padding-left: 1.2rem;
  color: #1F2937;
  font-size: 0.86rem;
  line-height: 1.6;
  margin: 0;
}

.safety-ops-list li {
  margin-bottom: 0.35rem;
}

.safety-ops-list code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.safety-error-section {
  background: #0F172A;
  border: 1px solid #1E293B;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.safety-error-header {
  background: #1E293B;
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #F87171;
  font-weight: 600;
}

.safety-error-pre {
  background: transparent;
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #FCA5A5;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.safety-error-pre code {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}

/* ==========================================================================
   Format Preview Tabs
   ========================================================================== */

.format-tab-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.format-tabs {
  display: flex;
  background: #F1F5F9;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.format-tab {
  background: none;
  border: none;
  color: #475569;
  padding: 0.9rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.format-tab .fmt-label-short {
  display: none;
}

.format-tab .fmt-label-full {
  display: inline;
}

.format-tab.active {
  color: var(--zabbix-red);
  border-bottom-color: var(--zabbix-red);
  background: #FFFFFF;
}

.format-content {
  padding: 1.5rem;
  background: #1E222D;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.format-content pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #F9FAFB;
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
   Inspiration & Comparison Sections
   ========================================================================== */

.inspiration-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.inspiration-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 2rem;
  position: relative;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.inspiration-card:hover {
  border-color: var(--zabbix-red);
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.inspiration-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #1E40AF;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.inspiration-card h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: var(--zabbix-navy);
}

.inspiration-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.mcp-comparison-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.mcp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
}

.mcp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  transition: all 0.25s ease;
}

.mcp-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.mcp-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  color: var(--zabbix-navy);
}

.mcp-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Comparison Tables & Responsive Cards */
.mcp-vs-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--card-shadow);
}

.mcp-vs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.mcp-vs-table th,
.mcp-vs-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.mcp-vs-table th {
  background: #F8FAFC;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--zabbix-navy);
  font-weight: 700;
}

.mcp-vs-table thead th {
  white-space: nowrap;
}

.mcp-vs-table tr:last-child td,
.mcp-vs-table tr:last-child th {
  border-bottom: none;
}

.comp-dimension {
  color: var(--zabbix-navy);
  font-weight: 700;
}

.highlight-accent {
  color: var(--zabbix-red);
  font-weight: 700;
}

/* Mobile Card Transformation for Comparison Tables (MCP vs CLI & zabbix-cli vs zbxctl) */
@media (max-width: 860px) {
  .mcp-vs-table-container {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    padding: 0;
  }

  .mcp-vs-table {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
  }

  .mcp-vs-table thead {
    display: none;
  }

  .mcp-vs-table tbody {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    width: 100%;
  }

  .mcp-vs-table .comparison-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    width: 100%;
    box-sizing: border-box;
  }

  .mcp-vs-table .comp-dimension {
    display: block;
    width: 100%;
    background: transparent;
    padding: 0 0 0.5rem 0;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--zabbix-navy);
    border-bottom: 1px solid #F1F5F9;
    box-sizing: border-box;
  }

  .mcp-vs-table .comp-val {
    display: block;
    width: 100%;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    border-bottom: none;
    box-sizing: border-box;
  }

  .mcp-vs-table .comp-val-alt {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #475569;
  }

  .mcp-vs-table .comp-val-zbxctl {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--zabbix-navy);
  }

  .mcp-vs-table .comp-val::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
  }

  .mcp-vs-table .comp-val-alt::before {
    color: #64748B;
  }

  .mcp-vs-table .comp-val-zbxctl::before {
    color: var(--zabbix-red);
  }
}

/* ==========================================================================
   License Section & Footer
   ========================================================================== */

.license-box {
  max-width: 750px;
  margin: 0 auto;
}

.license-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.license-box p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 1rem 0 2rem;
}

.license-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
  background: #F8FAFC;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.brand-icon {
  font-size: 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--zabbix-red);
}

.footer-copyright {
  color: var(--text-dim);
  font-size: 0.85rem;
  width: 100%;
}

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

/* Acknowledgements */
.acknowledgements-note {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.citation-link {
  color: var(--zabbix-blue);
  font-weight: 600;
}

.citation-link-secondary {
  color: var(--zabbix-blue);
}

.citation-link-inline {
  color: inherit;
  text-decoration: underline;
}

/* ==========================================================================
   Quickstart & AI Skills Setup Section
   ========================================================================== */

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--zabbix-blue);
  background: var(--zabbix-blue-light);
  border: 1px solid #BFDBFE;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.quickstart-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--border-glow);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--zabbix-blue);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-heading);
  flex-shrink: 0;
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--zabbix-navy);
}

.step-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.step-code-box {
  background: #0F172A;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.step-code-box code {
  color: #38BDF8;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  overflow-x: auto;
  white-space: nowrap;
}

/* Skills Matrix Cards */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.skill-card:hover {
  border-color: var(--zabbix-blue);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.skill-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.skill-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--zabbix-blue);
}

.skill-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.skill-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.85rem;
  flex-grow: 1;
}

.skill-cmd-mini {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  color: var(--zabbix-slate);
}

/* ==========================================================================
   Interactive AI Agent Simulation Component
   ========================================================================== */

.agent-sim-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.sim-header {
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.sim-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sim-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
}

.sim-tab .tab-label-short {
  display: none;
}

.sim-tab .tab-label-full {
  display: inline;
}

.sim-tab:hover {
  background: #F1F5F9;
  color: var(--zabbix-navy);
}

.sim-tab.active {
  background: var(--zabbix-blue);
  color: #FFFFFF;
  border-color: var(--zabbix-blue);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.sim-token-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  line-height: 1.35;
}

.sim-chat-body {
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  background: #FFFFFF;
}

/* Chat Message Styles */
.chat-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.chat-author-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.chat-avatar-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.avatar-user {
  background: #E2E8F0;
  color: #334155;
  border: 1px solid #CBD5E1;
}

.avatar-agent {
  background: #EFF6FF;
  color: var(--zabbix-blue);
  border: 1px solid #BFDBFE;
}

.chat-author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--zabbix-navy);
}

.chat-bubble-user {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  border-top-left-radius: 4px;
  padding: 0.95rem 1.25rem;
  color: #1E293B;
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 90%;
}

.chat-thought-box {
  background: #F0F9FF;
  border-left: 3px solid var(--zabbix-blue);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: #0369A1;
  line-height: 1.5;
}

.chat-cli-block {
  background: #0F172A;
  border: 1px solid #1E293B;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.chat-cli-header {
  background: #1E293B;
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94A3B8;
}

.tool-call-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tool-call-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38BDF8;
}

.mini-copy-btn {
  min-height: 32px;
  min-width: 44px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
}

.chat-cli-body {
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.5;
}

.chat-cli-cmd {
  color: #38BDF8;
  margin-bottom: 0.5rem;
  font-weight: 600;
  word-break: break-all;
}

.chat-cli-cmd .prompt {
  color: #F43F5E;
}

.chat-cli-output {
  color: #E2E8F0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  padding: 0;
  margin: 0;
}

.chat-cli-output code {
  color: #E2E8F0;
  font-family: inherit;
  font-size: inherit;
}

.chat-bubble-agent {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-left: 3px solid #10B981;
  border-radius: 12px;
  padding: 1.1rem 1.35rem;
  color: #1E293B;
  font-size: 0.92rem;
  line-height: 1.6;
}

.agent-response-text {
  white-space: pre-line;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */

/* Mobile / Tablet Breakpoint (max-width: 1024px) */
@media (max-width: 1024px) {
  /* Navbar & Mobile Menu Overlay */
  .nav-container {
    position: static;
    justify-content: flex-start;
  }

  .nav-toggle {
    display: flex;
    order: -1;
    margin-right: 0.75rem;
  }

  .nav-actions {
    display: none;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 1.25rem 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
    z-index: 99;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s;
  }

  .nav-links.nav-open {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0s;
  }

  .nav-links .nav-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--zabbix-navy);
    border-radius: 8px;
    border-bottom: 1px solid #F1F5F9;
    min-height: 48px;
  }

  .nav-links .nav-link:hover,
  .nav-links .nav-link:focus {
    background: var(--zabbix-blue-light);
    color: var(--zabbix-blue);
  }

  .nav-mobile-actions {
    display: block;
    margin-top: 1rem;
    padding-top: 0.5rem;
  }

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

  /* Grid Stackings */
  .hero-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .safety-interactive {
    grid-template-columns: 1fr;
  }
}

/* Small & Medium Screens (max-width: 768px) */
@media (max-width: 768px) {
  .section {
    padding: 3.5rem 1rem;
  }

  .hero {
    padding: 3.5rem 1rem 2.5rem;
  }

  .playground-wrapper {
    padding: 1.25rem 1rem;
  }

  /* Safety Section Mobile Layout */
  .safety-interactive {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .safety-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .safety-option {
    padding: 0.75rem 0.65rem;
    border-radius: 10px;
    min-height: 48px;
    align-items: flex-start;
  }

  .safety-option .safety-badge {
    font-size: 0.74rem;
    padding: 0.15rem 0.45rem;
    margin-bottom: 0.2rem;
  }

  .safety-option .safety-opt-desc {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .safety-details {
    padding: 1.15rem 0.85rem;
    border-radius: 14px;
  }

  .safety-columns {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .safety-box {
    padding: 0.85rem 1rem;
  }

  .safety-error-pre {
    padding: 0.75rem 0.85rem;
    font-size: 0.74rem;
  }

  /* Segmented Tab Controller for AI Agent Simulation */
  .sim-header {
    padding: 0.85rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .sim-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #E2E8F0;
    padding: 4px;
    border-radius: 10px;
    gap: 3px;
    width: 100%;
  }

  .sim-tab {
    width: 100%;
    padding: 0.5rem 0.2rem;
    font-size: 0.78rem;
    font-weight: 700;
    justify-content: center;
    border: none;
    border-radius: 7px;
    min-height: 38px;
    gap: 0.3rem;
  }

  .sim-tab .tab-label-full {
    display: none;
  }

  .sim-tab .tab-label-short {
    display: inline;
  }

  .sim-token-badge {
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: 0.76rem;
    padding: 0.4rem 0.6rem;
    box-sizing: border-box;
    border-radius: 8px;
  }

  .sim-chat-body {
    padding: 1.15rem 0.85rem;
    gap: 1.25rem;
  }

  .chat-bubble-user {
    max-width: 100%;
    padding: 0.75rem 0.9rem;
    font-size: 0.88rem;
  }

  .chat-thought-box {
    font-size: 0.82rem;
    padding: 0.65rem 0.85rem;
  }

  .chat-cli-body {
    padding: 0.65rem 0.75rem;
    font-size: 0.76rem;
  }

  .chat-cli-output {
    font-size: 0.74rem;
  }

  .chat-bubble-agent {
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
  }

  /* Multi-Format Tabs Mobile Layout */
  .format-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #E2E8F0;
    padding: 4px;
    gap: 3px;
    border-bottom: none;
  }

  .format-tab {
    width: 100%;
    padding: 0.55rem 0.15rem;
    font-size: 0.78rem;
    font-weight: 700;
    min-height: 38px;
    border-bottom: none;
    border-radius: 7px;
    justify-content: center;
    text-align: center;
  }

  .format-tab .fmt-label-full {
    display: none;
  }

  .format-tab .fmt-label-short {
    display: inline;
  }

  .format-tab.active {
    background: var(--zabbix-red);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(224, 0, 0, 0.25);
  }

  .format-content {
    padding: 1rem 0.85rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .format-content pre {
    font-size: clamp(0.64rem, 2.7vw, 0.82rem);
    line-height: 1.45;
  }

  .license-actions {
    flex-direction: column;
  }

  .license-actions .btn {
    width: 100%;
  }

  .footer-container {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Floating Action Button (Back to Top)
   ========================================================================== */

.fab-back-to-top {
  position: fixed;
  bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  right: calc(2rem + env(safe-area-inset-right, 0px));
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--zabbix-red);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(224, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.fab-back-to-top.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.fab-back-to-top:hover {
  background: var(--zabbix-red-hover);
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 6px 22px rgba(224, 0, 0, 0.5);
}

.fab-back-to-top:focus-visible {
  outline: 3px solid var(--zabbix-blue);
  outline-offset: 3px;
}

.fab-back-to-top svg {
  width: 22px;
  height: 22px;
  stroke: #FFFFFF;
}

@media (max-width: 768px) {
  .fab-back-to-top {
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    right: calc(1.25rem + env(safe-area-inset-right, 0px));
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

/* Reduced Motion Support (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
