/* ============================================================================
   Wirenetlab — Design tokens & base styles
   Tailwind utilities are loaded via CDN; this file holds tokens, custom
   components and transitions that would be awkward in pure Tailwind.
   ========================================================================= */

/* ----------------------------------------------------------------------------
   Self-hosted webfonts (OFL 1.1)
   Inter 4.0 and JetBrains Mono 2.304 are served from /assets/fonts/ so the
   browser never contacts fonts.googleapis.com / fonts.gstatic.com. This
   neutralises the Munich LG 20/01/2022 Google Fonts ruling and removes two
   third-party hosts from the delivery chain. License files live next to the
   WOFF2 binaries (Inter-LICENSE.txt, JetBrainsMono-LICENSE.txt).

   Only weights actually used by the site are shipped. font-display: swap
   paints with the system fallback first, then swaps to the webfont once
   loaded — no FOIT, no layout shift on fast connections.
   --------------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Inter-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Inter-ExtraBold.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
}

:root {
  /* Light theme (default) */
  --bg: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-subtle: #F3F4F6;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-contrast: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --danger: #DC2626;
  --success: #059669;
  --warning: #D97706;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);

  /* Topology Mapper canvas background — read from JS for PNG export bg. */
  --tm-canvas-bg: #FAFAFA;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --max-w: 1200px;
}

html.dark {
  --bg: #111827;
  --bg-card: #1F2937;
  --bg-subtle: #1A2232;
  --accent: #3B82F6;
  --accent-hover: #60A5FA;
  --accent-contrast: #0B1220;
  --text: #F9FAFB;
  --text-muted: #9CA3AF;
  --border: #374151;
  --danger: #F87171;
  --success: #34D399;
  --warning: #FBBF24;

  --shadow-sm: 0 1px 2px 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);

  --tm-canvas-bg: #111827;
}

/* -------------------------------------------------------------------------- */
/* Base                                                                       */
/* -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Smooth theme transition on color-related properties only */
*, *::before, *::after {
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.2s ease,
    fill 0.2s ease,
    stroke 0.2s ease;
}

/* Focus ring — accessible and brand consistent */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

/* -------------------------------------------------------------------------- */
/* Layout helpers                                                             */
/* -------------------------------------------------------------------------- */

.nt-container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 768px) {
  .nt-container { padding: 0 2rem; }
}

/* -------------------------------------------------------------------------- */
/* Components                                                                 */
/* -------------------------------------------------------------------------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

.card-hover {
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  font-weight: 500;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-contrast);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

/* Icon-only button (header toggles) */
.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  justify-content: center;
}

/* Copy button — appears on every result block */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.copy-btn.copied {
  color: var(--success);
  border-color: var(--success);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
}
.badge-soon {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-killer {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.badge-new {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid #10B981;
}

/* Edge-style legend panel — pinned bottom-right of the canvas wrap,
 * collapsible via the header click target. Narrow, discrete, doesn't
 * compete with the actual diagram. */
.mapper-legend {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 5;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: 0.75rem;
  min-width: 160px;
  overflow: hidden;
}
.mapper-legend-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.375rem 0.625rem;
  background: var(--bg-subtle);
  border: 0;
  border-bottom: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.mapper-legend-caret { transition: transform 0.15s ease; }
.mapper-legend[data-collapsed="true"] .mapper-legend-caret { transform: rotate(-90deg); }
.mapper-legend[data-collapsed="true"] .mapper-legend-body { display: none; }
.mapper-legend[data-collapsed="true"] .mapper-legend-toggle { border-bottom: 0; }
.mapper-legend-body {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.625rem;
  gap: 0.625rem;
}
.mapper-legend-group { display: flex; flex-direction: column; gap: 0.3rem; }
.mapper-legend-group-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mapper-legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.mapper-legend-swatch {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}
.mapper-legend-swatch--dashed {
  background: transparent !important;
  border-top: 2px dashed #3B82F6;
  height: 0;
  padding: 0;
  margin-top: 2px;
  width: 20px;
}
.mapper-legend-line {
  display: block;
  width: 24px;
  background: var(--text-muted);
  border-radius: 999px;
  flex-shrink: 0;
}

/* Label-size toolbar toggle — shows the current preset letter (S/M/L).
 * The glyph gets slightly larger per step so the button itself hints at
 * the level selected. */
#tm-label-size .label-size-letter {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
#tm-label-size[data-size="s"] .label-size-letter { font-size: 0.75rem; }
#tm-label-size[data-size="m"] .label-size-letter { font-size: 0.9rem; }
#tm-label-size[data-size="l"] .label-size-letter { font-size: 1.05rem; }

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */

.nt-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nt-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}
.nt-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nt-logo svg { width: 24px; height: 24px; color: var(--accent); }

.nt-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
@media (min-width: 900px) {
  .nt-nav { display: flex; }
}
.nt-nav a, .nt-nav button.nav-btn {
  padding: 0.5rem 0.875rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nt-nav a:hover, .nt-nav button.nav-btn:hover {
  color: var(--text);
  background: var(--bg-subtle);
}
.nt-nav a.active { color: var(--text); font-weight: 500; }

.nt-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tools dropdown */
.nt-dropdown { position: relative; }
.nt-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.nt-dropdown[data-open="true"] .nt-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nt-dropdown-panel a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}
.nt-dropdown-panel a:hover { background: var(--bg-subtle); }

/* Category labels inside the Tools dropdown (desktop). Non-focusable <div>s. */
.nt-dropdown-panel .dropdown-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.25rem;
  margin-top: 0.25rem;
}
.nt-dropdown-panel > nav > div[role="group"]:first-child .dropdown-section-label {
  margin-top: 0;
}
/* Subtle separator between category groups */
.nt-dropdown-panel > nav > div[role="group"] + div[role="group"] {
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}
/* Badge inside a dropdown link — align with the tool name */
.nt-dropdown-panel a .badge {
  margin-left: 0.375rem;
  vertical-align: middle;
}
.nt-mobile-menu a .badge {
  margin-left: 0.375rem;
  vertical-align: middle;
}

/* Mobile burger */
.nt-burger {
  display: inline-flex;
}
@media (min-width: 900px) {
  .nt-burger { display: none; }
}

.nt-mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
}
.nt-mobile-menu[data-open="true"] { display: block; }
.nt-mobile-menu a {
  display: block;
  padding: 0.625rem 1.25rem;
  color: var(--text);
  font-size: 0.9375rem;
}
.nt-mobile-menu a:hover { background: var(--bg-subtle); }
.nt-mobile-menu .mobile-section-label {
  padding: 0.5rem 1.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Hero                                                                       */
/* -------------------------------------------------------------------------- */

.hero {
  padding: 5rem 0 3rem;
  text-align: center;
}
@media (min-width: 768px) {
  .hero { padding: 7rem 0 5rem; }
}
.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}
@media (min-width: 768px) {
  .hero h1 { font-size: 3.5rem; }
}
.hero p {
  margin: 1.25rem auto 0;
  max-width: 640px;
  font-size: 1.0625rem;
  color: var(--text-muted);
}
.hero-cta {
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Subtle background ornament for the hero */
.hero-wrap {
  position: relative;
  overflow: hidden;
}
.hero-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Tools grid                                                                 */
/* -------------------------------------------------------------------------- */

.tools-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
@media (min-width: 1280px) {
  .tools-grid { grid-template-columns: repeat(4, 1fr); }
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  position: relative;
  min-height: 180px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.tool-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.tool-card .icon svg { width: 22px; height: 22px; }
.tool-card h3 {
  font-size: 1rem;
  font-weight: 600;
}
.tool-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.tool-card .badge { position: absolute; top: 1rem; right: 1rem; }

/* -------------------------------------------------------------------------- */
/* Why section                                                                */
/* -------------------------------------------------------------------------- */

.why-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .why-grid { grid-template-columns: repeat(4, 1fr); }
}
.why-item {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.why-item .icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  margin-bottom: 0.875rem;
}
.why-item h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.375rem; }
.why-item p { margin: 0; font-size: 0.875rem; color: var(--text-muted); }

/* -------------------------------------------------------------------------- */
/* Footer                                                                     */
/* -------------------------------------------------------------------------- */

.nt-footer {
  margin-top: 6rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.nt-footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .nt-footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}
.nt-footer h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.875rem;
}
.nt-footer ul { list-style: none; padding: 0; margin: 0; }
.nt-footer li { margin-bottom: 0.5rem; }
.nt-footer a {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.nt-footer a:hover { color: var(--accent); }
.nt-footer-about { font-size: 0.875rem; color: var(--text-muted); max-width: 320px; }
.nt-footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Tool page layout (used by tools/_template.html)                            */
/* -------------------------------------------------------------------------- */

.tool-layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
  padding: 2rem 0 1rem;
}
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 0.5rem; opacity: 0.5; }

.tool-section { margin-bottom: 2rem; }
.tool-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.tool-seo {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.tool-seo h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.tool-seo p { color: var(--text-muted); margin: 0 0 1rem; }

/* -------------------------------------------------------------------------- */
/* 404                                                                        */
/* -------------------------------------------------------------------------- */

.nt-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.25rem;
  text-align: center;
}
.nt-404 .code {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}
.nt-404 h1 { margin-top: 1rem; font-size: 1.75rem; }
.nt-404 p { color: var(--text-muted); margin: 0.75rem 0 2rem; max-width: 440px; }

/* -------------------------------------------------------------------------- */
/* Learn / tutorial pages                                                     */
/* -------------------------------------------------------------------------- */

.learn-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .learn-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .learn-grid { grid-template-columns: repeat(3, 1fr); }
}

.learn-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  position: relative;
  min-height: 200px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.learn-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.learn-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.learn-card .icon svg { width: 22px; height: 22px; }
.learn-card h3 { font-size: 1rem; font-weight: 600; }
.learn-card p { margin: 0; font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }

.learn-article {
  max-width: 768px;
  margin: 0 auto;
}
.learn-article h1 {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}
@media (min-width: 768px) {
  .learn-article h1 { font-size: 2.25rem; }
}
.learn-article .lead {
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-size: 1.0625rem;
  max-width: 640px;
}
.learn-article h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}
.learn-article p {
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.7;
}
.learn-article ul, .learn-article ol {
  color: var(--text-muted);
  padding-left: 1.5rem;
  margin: 0 0 1rem;
  line-height: 1.7;
}
.learn-article li { margin-bottom: 0.375rem; }

/* Cisco code blocks */
.cisco-code {
  background: #1E293B;
  color: #E2E8F0;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 0 0 1rem;
  border: 1px solid #334155;
}
html.dark .cisco-code {
  background: #0F172A;
  border-color: #1E293B;
}

/* CTA box inside tutorials */
.learn-cta {
  padding: 1.5rem;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
}
.learn-cta h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.learn-cta p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

/* Further reading links list */
.learn-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.learn-links li {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}
.learn-links li:last-child { border-bottom: none; }
.learn-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text);
}
.learn-links a:hover { color: var(--accent); }
.learn-links .link-desc {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: block;
}

/* -------------------------------------------------------------------------- */
/* Audit finding — expandable contextual help                                 */
/* -------------------------------------------------------------------------- */

.audit-finding .audit-finding-header {
  cursor: pointer;
  user-select: none;
}

.audit-finding .expand-icon {
  display: inline-block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-left: auto;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.audit-finding.expanded .expand-icon {
  transform: rotate(90deg);
}

.audit-finding .audit-finding-detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease;
  padding: 0 0.75rem;
}

.audit-finding.expanded .audit-finding-detail {
  max-height: 600px;
  opacity: 1;
  padding: 0.75rem 0.75rem 0.5rem;
}

.audit-why {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 0.625rem;
}

.audit-why strong {
  color: var(--text);
  font-weight: 600;
}

.audit-fix-wrap {
  margin-top: 0.375rem;
}

.audit-fix-wrap > strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.audit-fix {
  background: #1E293B;
  color: #E2E8F0;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 0 0 0.5rem;
  border: 1px solid #334155;
  white-space: pre;
}

html.dark .audit-fix {
  background: #0F172A;
  border-color: #1E293B;
}

.audit-fix-wrap .copy-btn {
  margin-bottom: 0.25rem;
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                             */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Topology Mapper                                                            */
/* Layout: 3 zones (palette 220px | canvas flex-1 | inspector 300px).         */
/* The shell stretches to fill the viewport minus header/footer so the canvas */
/* always feels like a "workspace", not a card on a scrolling page.           */
/* -------------------------------------------------------------------------- */

.mapper-shell {
  display: flex;
  gap: 0;
  /* 64px sticky header, ~80px footer reserve. Footer is actually taller but   */
  /* it lives below the shell, so we just need the canvas to fill above it.   */
  min-height: calc(100vh - 64px);
  background: var(--bg);
}

/* Zone 1 — palette ------------------------------------------------------- */
.mapper-palette {
  flex-shrink: 0;
  width: 220px;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.palette-header h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin: 0 0 0.25rem;
}
.palette-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}
.palette-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  min-height: 200px;
  align-content: start;
}
.palette-placeholder {
  padding: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  line-height: 1.5;
  grid-column: 1 / -1;
}
.palette-item {
  appearance: none;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 0.375rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: grab;
  user-select: none;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.palette-item:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.palette-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.palette-item:active { cursor: grabbing; }
.palette-item.is-dragging {
  opacity: 0.4;
  transform: scale(0.96);
  cursor: grabbing;
}
.palette-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.palette-item-label {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-muted);
}
.palette-item:hover .palette-item-label { color: var(--accent); }
.palette-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.palette-footer h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.palette-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.zone-chip {
  appearance: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
}
.zone-chip:hover { color: var(--accent); border-color: var(--accent); }
.zone-chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Zone 2 — canvas -------------------------------------------------------- */
.mapper-canvas-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
/* Visual hint when snap-to-grid is active. Grid is static (doesn't follow
 * pan/zoom) — it's a mode indicator, not an alignment reference. */
.mapper-canvas-wrap.snap-grid-active #tm-canvas {
  background-image:
    linear-gradient(to right, rgba(100, 116, 139, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(100, 116, 139, 0.18) 1px, transparent 1px);
  background-size: 40px 40px;
}
html.dark .mapper-canvas-wrap.snap-grid-active #tm-canvas {
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
}
.canvas-toolbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  gap: 0.75rem;
}
.canvas-toolbar-left,
.canvas-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.canvas-toolbar-right { gap: 0.625rem; flex-wrap: wrap; justify-content: flex-end; }
.toolbar-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 0.25rem;
}
.canvas-info {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0 0.25rem;
}
.canvas-info strong { color: var(--text); font-weight: 600; }
.ci-sep { opacity: 0.5; }

/* Export dropdown */
.export-menu { position: relative; }
.export-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  padding: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.export-menu-panel[hidden] { display: none; }
.export-menu-panel button {
  appearance: none;
  font-family: inherit;
  font-size: 0.875rem;
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}
.export-menu-panel button:hover { background: var(--bg-subtle); color: var(--accent); }

/* The canvas itself — a neutral working surface with a subtle dot grid.     */
.mapper-canvas {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, color-mix(in srgb, var(--text) 10%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: 0 0;
}
html.dark .mapper-canvas {
  background-image:
    radial-gradient(circle, color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px);
}
.mapper-canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Inline rename input (double-click on node/edge label).
   Positioned absolutely inside .mapper-canvas-wrap, over the canvas. */
.tm-rename-input {
  position: absolute;
  z-index: 70;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  outline: none;
  box-shadow: var(--shadow-md);
  min-width: 80px;
  text-align: center;
}

/* Empty state — centered, sober, disappears once the canvas gets populated. */
.canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  pointer-events: none;
}
.canvas-empty > * { pointer-events: auto; }
.canvas-empty svg {
  color: color-mix(in srgb, var(--text-muted) 60%, transparent);
  margin-bottom: 1rem;
}
.canvas-empty h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem;
}
.canvas-empty p {
  max-width: 380px;
  font-size: 0.875rem;
  margin: 0 0 1.25rem;
  line-height: 1.55;
}
.canvas-empty-cta { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

/* Zone 3 — inspector ----------------------------------------------------- */
.mapper-inspector {
  flex-shrink: 0;
  width: 300px;
  background: var(--bg-subtle);
  border-left: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}
.inspector-empty {
  text-align: center;
  padding: 2rem 0.5rem 1rem;
  color: var(--text-muted);
}
.inspector-empty svg {
  color: color-mix(in srgb, var(--text-muted) 60%, transparent);
  margin-bottom: 0.75rem;
}
.inspector-empty h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin: 0 0 0.375rem;
}
.inspector-empty p {
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0;
}
.inspector-panel {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.inspector-panel h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.375rem;
}
.inspector-kind-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  width: max-content;
}
.inspector-kind-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.inspector-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.inspector-field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}
.inspector-field input[type="text"] {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.625rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.inspector-field input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.inspector-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}
/* Sprint D.5 — validation warning block at the top of the inspector panel.
   One compact red-tinted box listing every cross-element issue detected on
   the selected node or edge (duplicate IPs, same-subnet mismatch, ...). */
.inspector-warnings {
  background: color-mix(in srgb, var(--danger, #DC2626) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger, #DC2626) 30%, transparent);
  border-radius: var(--radius-sm, 6px);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--danger, #DC2626);
}
.inspector-warning-row { line-height: 1.4; }
.inspector-warning-row + .inspector-warning-row { margin-top: 0.25rem; }
.inspector-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.inspector-delete {
  appearance: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  background: color-mix(in srgb, var(--danger, #DC2626) 10%, transparent);
  color: var(--danger, #DC2626);
  border: 1px solid color-mix(in srgb, var(--danger, #DC2626) 30%, transparent);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.inspector-delete:hover {
  background: var(--danger, #DC2626);
  color: #fff;
}
.inspector-zone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.inspector-zone-chip {
  appearance: none;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.inspector-zone-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.inspector-zone-chip.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* Color-override palette in node inspector */
.inspector-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.inspector-color-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.inspector-color-chip:hover { transform: scale(1.08); }
.inspector-color-chip.is-active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg);
}
.inspector-color-chip--default {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border);
}

/* Collapsible sections inside the edge inspector */
.inspector-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
}
.inspector-section-header {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}
.inspector-section-header:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.inspector-section-caret {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.inspector-section[data-open="true"] .inspector-section-caret {
  transform: rotate(0deg);
}
.inspector-section[data-open="false"] .inspector-section-caret {
  transform: rotate(-90deg);
}
.inspector-section-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem 0.625rem;
  border-top: 1px solid var(--border);
}
.inspector-section[data-open="false"] .inspector-section-body {
  display: none;
}
.inspector-field select,
.inspector-field input[type="number"],
.inspector-field textarea {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.625rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.inspector-field textarea {
  resize: vertical;
  min-height: 4.5rem;
  font-family: inherit;
}
.inspector-field select:focus,
.inspector-field input[type="number"]:focus,
.inspector-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.inspector-field input:disabled,
.inspector-field select:disabled,
.inspector-field textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.inspector-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* Sprint D — inline validation error under CIDR/IP inputs */
.inspector-field-error {
  font-size: 0.6875rem;
  color: var(--danger, #DC2626);
  margin: 0.125rem 0 0 0;
}
.inspector-field input.is-invalid,
.inspector-iface-cell input.is-invalid {
  border-color: var(--danger, #DC2626);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger, #DC2626) 15%, transparent);
}

/* Sprint D.2 — interfaces table inside the node inspector.
   Grid columns: Name (flex) | IP (flex) | Mask (auto) | VLAN (narrow) | Desc (flex) | Delete (auto)
   On narrow panels we scroll horizontally rather than wrap — a wrapped row
   would make the per-cell alignment read as a different interface. */
.inspector-iface-table {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-x: auto;
}
.inspector-iface-row {
  display: grid;
  grid-template-columns: minmax(5rem, 1fr) minmax(6rem, 1fr) minmax(5.5rem, auto) minmax(3.5rem, 4.5rem) minmax(6rem, 1fr) auto;
  gap: 0.25rem;
  align-items: center;
  min-width: 28rem;
}
.inspector-iface-row--header .inspector-iface-cell {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0 0.125rem;
}
.inspector-iface-cell {
  display: flex;
  align-items: center;
  min-width: 0;
}
.inspector-iface-cell input[type="text"],
.inspector-iface-cell input[type="number"],
.inspector-iface-cell select {
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.25rem 0.375rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  outline: none;
  width: 100%;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.inspector-iface-cell input:focus,
.inspector-iface-cell select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}
/* Mask cell contains both the dropdown and the custom text fallback stacked
   in the same column — the custom input is hidden unless 'custom' is picked. */
.inspector-iface-cell--mask {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.inspector-iface-cell--delete {
  justify-content: center;
}
.inspector-iface-delete {
  appearance: none;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.inspector-iface-delete:hover {
  color: var(--danger, #DC2626);
  border-color: var(--danger, #DC2626);
  background: color-mix(in srgb, var(--danger, #DC2626) 10%, transparent);
}
.inspector-iface-add {
  appearance: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  background: transparent;
  color: var(--accent);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  align-self: flex-start;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.inspector-iface-add:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Connect-mode hint banner (absolute over the canvas) */
.mapper-connect-hint {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 0.5rem 0.875rem;
  background: color-mix(in srgb, var(--warning, #F59E0B) 15%, var(--bg-card));
  border: 1px solid color-mix(in srgb, var(--warning, #F59E0B) 50%, var(--border));
  color: var(--text);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}
.mapper-canvas.is-connecting {
  cursor: crosshair;
}
#tm-connect[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

/* Import CDP/LLDP modal ------------------------------------------------- */
.mapper-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.mapper-modal[hidden] { display: none; }
.mapper-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
.mapper-modal-panel {
  position: relative;
  width: min(640px, 100%);
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 90vh;
  overflow: auto;
}
.mapper-modal-panel h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.mapper-modal-lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.mapper-modal-lead code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  background: var(--bg-subtle);
  padding: 0.075rem 0.3rem;
  border-radius: 4px;
}
.mapper-modal-panel textarea {
  width: 100%;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  resize: vertical;
  min-height: 160px;
}
.mapper-modal-panel textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.mapper-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Keyboard shortcuts cheat-sheet (inside .mapper-modal) */
.mapper-modal-panel-shortcuts { max-width: 560px; }
.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.9rem;
}
.shortcuts-table td {
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.shortcuts-table td:first-child { color: var(--text); }
.shortcuts-table td:last-child {
  text-align: right;
  white-space: nowrap;
  color: var(--text-muted);
}
.shortcuts-table tr:last-child td { border-bottom: none; }
.shortcuts-table kbd {
  display: inline-block;
  padding: 0.125rem 0.4rem;
  margin: 0 0.125rem;
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* SEO block under the workspace ----------------------------------------- */
.seo-content {
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.seo-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.seo-content p {
  color: var(--text-muted);
  max-width: 720px;
  margin: 0;
}

/* Mobile notice is hidden by default; only shown below 768px. */
.mapper-mobile-notice { display: none; }
.mapper-palette-toggle { display: none; }

/* Responsive — below 1024px, palette becomes an off-canvas drawer. */
@media (max-width: 1023px) {
  .mapper-palette-toggle { display: inline-flex; }
  .mapper-palette {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    z-index: 40;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }
  .mapper-palette[data-open="true"] { transform: translateX(0); }
  .mapper-inspector {
    width: 260px;
  }
}

/* Below 768px: read-only canvas, no drag-drop, inspector hidden. */
@media (max-width: 767px) {
  .mapper-mobile-notice {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--warning) 10%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
    color: var(--text);
    font-size: 0.8125rem;
  }
  .mapper-mobile-notice strong { color: var(--warning); font-weight: 600; }
  .mapper-shell {
    min-height: calc(100vh - 64px - 42px); /* minus mobile notice */
  }
  .mapper-inspector { display: none; }
  .mapper-canvas { pointer-events: none; }
  .canvas-empty { pointer-events: auto; }
  .canvas-toolbar {
    flex-wrap: wrap;
    height: auto;
    padding: 0.5rem 0.75rem;
  }
  .canvas-info { font-size: 0.75rem; }
}

/* =========================================================================
   Print fallback — defensive only.
   Wirenetlab PDF export is now handled by js/shared/pdf-export.js (jsPDF
   native, decision #27). The previous @media print cartouche pipeline was
   removed on 2026-04-18 (see CLAUDE.md). These remaining rules only kick
   in when a user hits browser Ctrl+P directly (which is NOT the intended
   path) — they strip interactive chrome so the direct print isn't wildly
   broken. They do not try to reproduce the branded PDF cartouche.
   ------------------------------------------------------------------------- */
@media print {
  header#nt-header,
  footer#nt-footer,
  nav.breadcrumb,
  .copy-btn,
  .btn,
  .no-print,
  .mapper-palette,
  .mapper-inspector,
  .mapper-mobile-notice,
  .canvas-toolbar,
  .canvas-empty,
  .mapper-badge,
  .export-menu,
  .export-menu-panel,
  dialog,
  .modal,
  #tm-shortcuts-modal {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #1A1A1A !important;
  }
}

