:root {
  --color-primary: #0284c7;
  --color-primary-hover: #0369a1;
  --color-primary-active: #075985;
  --color-primary-subtle: #e0f2fe;
  --color-accent: #0f766e;
  --color-accent-hover: #115e59;
  --color-accent-subtle: #ccfbf1;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-raised: #f1f5f9;
  --color-surface-sunken: #e2e8f0;
  --color-text: #0f172a;
  --color-text-secondary: #334155;
  --color-text-muted: #64748b;
  --color-border: #cbd5e1;
  --color-border-subtle: #e2e8f0;
  --color-border-strong: #94a3b8;
  --color-success: #15803d;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;
  --color-warning: #b45309;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-danger: #b91c1c;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-info: #0369a1;
  --color-info-bg: #f0f9ff;
  --color-info-border: #bae6fd;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08);
  --max-width: 1120px;
  --reading-width: 72ch;
  --header-height: 68px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --transition-fast: 150ms ease;
}

[data-theme="dark"] {
  --color-primary: #38bdf8;
  --color-primary-hover: #7dd3fc;
  --color-primary-active: #bae6fd;
  --color-primary-subtle: rgba(56, 189, 248, 0.15);
  --color-accent: #2dd4bf;
  --color-accent-hover: #5eead4;
  --color-accent-subtle: rgba(45, 212, 191, 0.15);
  --color-bg: #090d16;
  --color-surface: #111827;
  --color-surface-raised: #1e293b;
  --color-surface-sunken: #0b1120;
  --color-text: #f8fafc;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
  --color-border-subtle: #1e293b;
  --color-border-strong: #475569;
  --color-success: #4ade80;
  --color-success-bg: rgba(74, 222, 128, 0.12);
  --color-success-border: #166534;
  --color-warning: #fbbf24;
  --color-warning-bg: rgba(251, 191, 36, 0.12);
  --color-warning-border: #854d0e;
  --color-danger: #f87171;
  --color-danger-bg: rgba(248, 113, 113, 0.12);
  --color-danger-border: #991b1b;
  --color-info: #38bdf8;
  --color-info-bg: rgba(56, 189, 248, 0.12);
  --color-info-border: #075985;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  color: var(--color-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

p, ul, ol, dl, table, blockquote {
  margin-bottom: var(--space-4);
}

p {
  max-width: var(--reading-width);
}

h1, h2, h3, h4 {
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.25;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  letter-spacing: -0.015em;
}

h1 {
  font-size: 2.25rem;
  margin-top: 0;
}

h2 {
  font-size: 1.6rem;
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-border-subtle);
}

h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

ul, ol {
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-2);
}

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-surface-raised);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
}

.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-link {
  position: absolute;
  top: -999px;
  left: var(--space-4);
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  z-index: 1000;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-4);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@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;
  }
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.main-content {
  flex: 1 0 auto;
  padding-bottom: var(--space-16);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-link:hover {
  color: var(--color-primary);
}

.brand-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}


.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: var(--space-6);
  padding-left: 0;
  margin-bottom: 0;
}

.nav-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: var(--space-2) 0;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--color-primary);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-primary);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  cursor: pointer;
  color: var(--color-text);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-list {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-4);
    gap: var(--space-3);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav-list.is-open { display: flex; }
  .nav-link {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
  }
  .nav-link:hover { background-color: var(--color-surface-raised); }
}

.hero {
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background-color: var(--color-primary-subtle);
  color: var(--color-primary);
  border: 1px solid var(--color-border-subtle);
  margin-bottom: var(--space-3);
}

.hero-title {
  font-size: clamp(2rem, 4vw + 1rem, 2.85rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-4);
}

.hero-lead {
  font-size: clamp(1.05rem, 1.2vw + 0.9rem, 1.2rem);
  color: var(--color-text-secondary);
  max-width: 760px;
  margin: 0 auto var(--space-6) auto;
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.hero-subtext {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 0;
}

.hero-active-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-surface);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  max-width: 640px;
  width: 100%;
  margin: 0 auto var(--space-8);
  box-shadow: 0 10px 30px rgba(2, 132, 199, 0.15), var(--shadow-md);
  text-align: center;
  gap: var(--space-3);
  animation: fadeIn 0.3s ease-out;
}

.hero-active-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.hero-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: heroPulse 1.8s infinite;
}

@keyframes heroPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-active-place {
  font-size: clamp(1.2rem, 2vw + 0.8rem, 1.45rem);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.3;
}

.hero-active-coords-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
  color: var(--color-primary);
  font-weight: 600;
}

.hero-active-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.hero-active-clear {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  text-decoration: underline;
  cursor: pointer;
  margin-top: var(--space-1);
  padding: 4px 8px;
}

.hero-active-clear:hover {
  color: #ef4444;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-primary:active {
  background-color: var(--color-primary-active);
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--color-surface-raised);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.btn-success-active {
  background-color: var(--color-success-bg) !important;
  color: var(--color-success) !important;
  border-color: var(--color-success-border) !important;
  font-weight: 700 !important;
  box-shadow: 0 0 0 2px var(--color-success-border);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-primary);
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
}

.btn-ghost:hover {
  background-color: var(--color-primary-subtle);
}

.btn-sm {
  font-size: 0.85rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
}

.btn-sm svg {
  width: 1rem;
  height: 1rem;
}

.btn-large {
  font-size: 1.15rem;
  padding: 1.1rem 2.25rem;
  border-radius: var(--radius-xl);
}

.tool-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(var(--space-6), 2.5vw, var(--space-8));
  margin-bottom: var(--space-10);
}

.tool-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  margin-bottom: var(--space-6);
}

.tool-header-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.tool-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.status-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  font-size: 0.95rem;
  line-height: 1.45;
}

.status-banner.status-idle {
  background-color: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

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

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

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

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

.status-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.status-message {
  flex: 1;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-primary-subtle);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-tile {
  background-color: var(--color-surface-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-tile-full {
  grid-column: 1 / -1;
}

.stat-label {
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  word-break: break-word;
  font-family: var(--font-mono);
}

.stat-value-text {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
}

.stat-note {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  margin-bottom: 0;
}

.action-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.map-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface-sunken);
  margin-bottom: var(--space-6);
}

.map-container {
  width: 100%;
  height: 400px;
  min-height: 400px;
  z-index: 10;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  padding: var(--space-6);
  text-align: center;
  color: var(--color-text-muted);
}

.map-placeholder svg {
  width: 52px;
  height: 52px;
  margin-bottom: var(--space-3);
  opacity: 0.6;
}

/* Leaflet Layer Switcher & Customizations */
.leaflet-popup-content-wrapper {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--color-border) !important;
}

.leaflet-popup-tip {
  background: var(--color-surface) !important;
}

.leaflet-container {
  font-family: inherit !important;
}

.leaflet-control-layers {
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--color-border) !important;
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
}

.leaflet-control-layers-toggle {
  width: 36px !important;
  height: 36px !important;
}

.leaflet-control-layers-expanded {
  padding: 10px 14px !important;
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
}

.leaflet-control-layers label {
  margin-bottom: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.permission-help {
  background-color: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-top: var(--space-4);
  font-size: 0.9rem;
}

.permission-help h4 {
  margin-top: 0;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.permission-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-1);
}

.permission-tab-btn {
  background: none;
  border: none;
  padding: var(--space-1) var(--space-3);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
}

.permission-tab-btn.active {
  background-color: var(--color-primary-subtle);
  color: var(--color-primary);
}

.permission-content ol {
  padding-left: var(--space-5);
  margin-bottom: 0;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .trust-strip { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
  .steps-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
  .footer-bottom { flex-direction: row; text-align: left; }
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.trust-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--color-accent);
}

.trust-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.content-section {
  margin-bottom: var(--space-12);
}

.definition-grid, .steps-grid, .fixes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

@media (min-width: 640px) {
  .stat-grid, .definition-grid, .fixes-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .stat-grid, .definition-grid { grid-template-columns: repeat(3, 1fr); }
}

.definition-card, .step-card, .fix-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.definition-card h3 {
  margin-top: 0;
  margin-bottom: var(--space-2);
  font-size: 1.1rem;
  color: var(--color-primary);
}

.definition-card p, .step-card p, .fix-body p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: var(--space-4);
}

.step-card h3 {
  margin-top: 0;
  margin-bottom: var(--space-2);
  font-size: 1.15rem;
}

.fix-card {
  display: flex;
  gap: var(--space-4);
}

.fix-icon {
  width: 26px;
  height: 26px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.fix-body h3 {
  margin-top: 0;
  margin-bottom: var(--space-1);
  font-size: 1.05rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  background-color: var(--color-surface);
  margin-top: var(--space-6);
  margin-bottom: var(--space-6);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
  margin-bottom: 0;
}

th, td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

th {
  background-color: var(--color-surface-raised);
  color: var(--color-text);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background-color: var(--color-surface-raised); }

.badge {
  display: inline-block;
  font-size: 0.775rem;
  font-weight: 700;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.badge-green {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.badge-yellow {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-blue {
  background-color: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info-border);
}

.badge-planned {
  background-color: var(--color-surface-sunken);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.callout {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-top: var(--space-6);
  margin-bottom: var(--space-6);
  display: flex;
  gap: var(--space-4);
  border: 1px solid var(--color-border-subtle);
  border-left: 4px solid var(--color-primary);
  background-color: var(--color-surface);
}

.callout-icon {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-body { flex: 1; }
.callout-body p:last-child { margin-bottom: 0; }

.text-gradient {
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.badge-category {
  background-color: rgba(2, 132, 199, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(2, 132, 199, 0.25);
}
.badge-neutral {
  background: var(--color-surface-sunken);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.tool-search-wrap {
  position: relative;
  max-width: 560px;
  margin: var(--space-6) auto;
}
.tool-search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) 2.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.tool-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}
.tool-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-8);
}
.filter-tab {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-tab:hover, .filter-tab.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.category-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: var(--space-3);
  margin-top: var(--space-10);
}
.category-title {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
}
.category-icon-wrap {
  display: inline-flex;
  align-items: center;
  color: var(--color-primary);
}

.tools-grid, .spoke-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.tool-card, .spoke-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  color: inherit;
}
.tool-card:before, .spoke-card:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.tool-card:hover, .spoke-card:hover {
  background: var(--color-surface-raised);
  border-color: var(--color-primary);
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.15);
  transform: translateY(-4px);
}
.tool-card:hover:before, .spoke-card:hover:before {
  opacity: 1;
}
.spoke-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.tool-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-lg);
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: all var(--transition-base);
}
.tool-card:hover .tool-card-icon {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  transform: scale(1.12) rotate(-4deg);
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.35);
}
.tool-card-title, .spoke-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  transition: color var(--transition-fast);
}
.tool-card:hover .tool-card-title, .spoke-card:hover .spoke-card-title {
  color: var(--color-primary);
}
.tool-card-desc, .spoke-card-desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 0;
  line-height: 1.5;
}

.pulse-dot-emerald {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-shadow: 0 0 8px #10b981;
}
.pulse-dot-emerald:after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1.5px solid #10b981;
  border-radius: 50%;
  animation: 2s cubic-bezier(0, 0, 0.2, 1) infinite pulse-ring;
}
.footer-telemetry-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
  width: fit-content;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.faq-item {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item[open] {
  border-color: var(--color-primary);
}

.faq-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-summary::-webkit-details-marker { display: none; }

.faq-summary-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-primary);
  transition: transform var(--transition-fast);
}

.faq-item[open] .faq-summary-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 var(--space-5) var(--space-5) var(--space-5);
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
}

.faq-answer p:last-child { margin-bottom: 0; }

.author-block {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background-color: var(--color-surface-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-top: var(--space-12);
  margin-bottom: var(--space-6);
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-subtle);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.author-avatar svg { width: 26px; height: 26px; }
.author-info { flex: 1; }
.author-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.author-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  padding: var(--space-4) 0;
  color: var(--color-text-muted);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb-item:not(:last-child)::after {
  content: "/";
  color: var(--color-border-strong);
}

.breadcrumb-link {
  color: var(--color-text-muted);
  text-decoration: none;
}

.breadcrumb-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.breadcrumb-current {
  color: var(--color-text);
  font-weight: 600;
}

.back-home-cta {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-raised) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  margin-top: var(--space-12);
  margin-bottom: var(--space-10);
}

.back-home-cta h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 0;
}

.site-footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-12);
  padding-bottom: var(--space-8);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}

.footer-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.footer-brand-col p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.footer-col-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.footer-links li { margin-bottom: var(--space-2); }
.footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer-brand-line {
  font-weight: 600;
  color: var(--color-text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background-color: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background-color: var(--color-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.theme-toggle .theme-icon-sun { display: none; width: 19px; height: 19px; }
.theme-toggle .theme-icon-moon { display: block; width: 19px; height: 19px; }
[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
