/* ================================================================
   NIS 2 · Przewodnik · style.css
   Design v3 - inspirowany gov.pl
   Czcionki: Montserrat (nagłówki) + Open Sans (treść) + Space Mono
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Space+Mono:wght@400;700&display=swap');

/* ── Variables ───────────────────────── */
:root {
  /* Paleta gov.pl-inspired */
  --blue-900: #002147;
  --blue-800: #003580;
  --blue-700: #0052A5;   /* gov.pl primary */
  --blue-600: #1265BC;
  --blue-500: #3B7FCC;
  --blue-200: #AACBEF;
  --blue-100: #D9EAF8;
  --blue-50:  #EBF3FC;

  --bg:       #F5F6F8;   /* gov.pl light gray */
  --bg-card:  #FFFFFF;
  --bg-aside: #F0F3F7;
  --border:   #D8DEE8;
  --border-strong: #B8C4D4;
  --text:     #1A2233;
  --text-muted: #5A6880;

  --teal:     #007A7A;
  --teal-bg:  #E0F5F5;
  --amber:    #A05A00;
  --amber-bg: #FEF3E0;
  --red:      #CC0000;
  --red-bg:   #FFF0F0;
  --green:    #1A6B30;
  --green-bg: #E3F5E9;

  --sidebar-w: 270px;
  --header-h: 72px;
  --radius: 6px;          /* gov.pl - mało zaokrąglony */
  --radius-sm: 4px;
  --shadow-sm: 0 1px 3px rgba(0,33,71,.07);
  --shadow: 0 2px 8px rgba(0,33,71,.09);
  --shadow-md: 0 6px 20px rgba(0,33,71,.12);
}

/* ── Reset ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}
h1, h2, h3, h4, h5 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
}
a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--blue-600); }
code, .mono { font-family: 'Space Mono', monospace; font-size: .82em; }
sup { font-size: .68em; vertical-align: super; color: var(--blue-600); font-weight: 600; }

/* ── Header / Baner ──────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  width: 100%;
  height: var(--header-h);
  background: var(--blue-900);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: .875rem;
  border-bottom: 3px solid var(--blue-700);
}

.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
}
.header-logo:hover { text-decoration: none; }
.header-logo svg { flex-shrink: 0; }

.header-brand {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  flex-shrink: 0;
}
.header-brand-tag {
  font-family: 'Space Mono', monospace;
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue-200);
  line-height: 1;
}
.header-brand-title {
  font-family: 'Montserrat', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
  line-height: 1.1;
  white-space: nowrap;
}

/* Brand expands to push tools right on desktop */
.header-brand { flex: 1; min-width: 0; overflow: hidden; }

.header-tools {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}

/* Hamburger - mobile only (hidden on desktop) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  padding: .5rem;
  border-radius: var(--radius-sm);
  transition: background .15s;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── Layout ──────────────────────────── */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar - sticky in flow ────────── */
/* Sidebar jest w flow dokumentu (nie fixed) → footer naturalnie full-width */
.sidebar {
  position: sticky;
  top: var(--header-h);
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  flex-shrink: 0;
  align-self: flex-start;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 8px rgba(0,33,71,.06);
  z-index: 50;
}
/* ── Sidebar search ──────────────────── */
.sidebar-search {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-search-inner {
  position: relative;
  display: flex;
  align-items: center;
}
.sidebar-search-icon {
  position: absolute;
  left: .75rem;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
#search-input {
  width: 100%;
  padding: .6rem .75rem .6rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Open Sans', sans-serif;
  font-size: .875rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#search-input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(0,82,165,.12);
}
#search-input::placeholder { color: var(--text-muted); }

/* Search results - flows in sidebar (not absolute) */
#search-results {
  margin-top: .5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  max-height: 55vh;
  overflow-y: auto;
}

/* ── Sidebar nav ─────────────────────── */
.sidebar-label {
  padding: .875rem 1.25rem .4rem;
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  font-weight: 700;
  color: #8A9AB5;
  letter-spacing: .12em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.sidebar-nav { list-style: none; }
.sidebar-nav li { position: relative; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem 1.25rem;
  color: #3A4A60;
  font-size: .875rem;
  font-weight: 400;
  transition: background .1s, color .1s;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
  background: var(--blue-50);
  color: var(--blue-700);
  text-decoration: none;
  border-left-color: var(--blue-200);
}
.sidebar-nav a.active {
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 700;
  border-left-color: var(--blue-700);
}
.sidebar-nav .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: .55;
  transition: opacity .1s;
}
.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.active .nav-icon { opacity: 1; }
.sidebar-divider { height: 1px; background: var(--border); margin: .875rem 1.25rem; }

.sidebar-category-indicator {
  margin: .75rem 1.25rem;
  padding: .55rem .875rem;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  color: #3A4A60;
}
.cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #8A9AB5;
}
.cat-dot.kluczowy     { background: var(--blue-700); }
.cat-dot.wazny        { background: var(--teal); }
.cat-dot.nieokreslony { background: var(--amber); }

/* ── Main ────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem;
  max-width: 980px;
}

/* ── Screen: Welcome ─────────────────── */
#screen-welcome {
  width: 100%;
}
.welcome-cards-wrap {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 2rem;
}
.welcome-intro {
  padding: 2rem 0 1.75rem;
}
.welcome-intro h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--blue-900);
  margin-bottom: .5rem;
  letter-spacing: -.02em;
}
.welcome-intro p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}
.category-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  margin-bottom: 2rem;
}
.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--border);
}
.cat-card.kluczowy     { border-top-color: var(--blue-700); }
.cat-card.wazny        { border-top-color: var(--teal); }
.cat-card.nieokreslony { border-top-color: var(--amber); }
.cat-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.cat-card.selected.kluczowy     { box-shadow: 0 0 0 2px var(--blue-700), var(--shadow-md); }
.cat-card.selected.wazny        { box-shadow: 0 0 0 2px var(--teal), var(--shadow-md); }
.cat-card.selected.nieokreslony { box-shadow: 0 0 0 2px var(--amber), var(--shadow-md); }

.cat-card-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.cat-card.kluczowy .cat-card-icon     { background: var(--blue-50); color: var(--blue-700); }
.cat-card.wazny .cat-card-icon        { background: var(--teal-bg); color: var(--teal); }
.cat-card.nieokreslony .cat-card-icon { background: var(--amber-bg); color: var(--amber); }
.cat-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: .4rem;
}
.cat-card.kluczowy h3     { color: var(--blue-700); }
.cat-card.wazny h3        { color: var(--teal); }
.cat-card.nieokreslony h3 { color: var(--amber); }

.cat-card p { font-size: .84rem; color: var(--text-muted); line-height: 1.55; }
.cat-card .cat-fine {
  display: inline-block;
  margin-top: .875rem;
  padding: .2rem .65rem;
  border-radius: var(--radius-sm);
  font-family: 'Space Mono', monospace;
  font-size: .68rem;
  font-weight: 700;
}
.cat-card.kluczowy .cat-fine     { background: var(--blue-100); color: var(--blue-700); }
.cat-card.wazny    .cat-fine     { background: var(--teal-bg); color: var(--teal); }
.cat-card.nieokreslony .cat-fine { background: var(--amber-bg); color: var(--amber); }

.cat-check {
  position: absolute;
  top: .875rem;
  right: .875rem;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
}
.cat-card.selected.kluczowy .cat-check     { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.cat-card.selected.wazny    .cat-check     { background: var(--teal); border-color: var(--teal); color: #fff; }
.cat-card.selected.nieokreslony .cat-check { background: var(--amber); border-color: var(--amber); color: #fff; }

/* Przycisk styl gov.pl - prostokątny, solidny */
.btn-start {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 2.25rem;
  background: var(--blue-700);
  color: #fff;
  border: 2px solid var(--blue-700);
  border-radius: var(--radius);
  font-family: 'Montserrat', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .03em;
  text-transform: uppercase;
  transition: background .15s, border-color .15s;
}
.btn-start:hover { background: var(--blue-600); border-color: var(--blue-600); }
.btn-start:disabled { background: #A0B4CC; border-color: #A0B4CC; cursor: not-allowed; }

/* ── Screen: Guide ───────────────────── */
#screen-guide { display: none; }
#screen-guide.active { display: block; }

/* ── Module ──────────────────────────── */
.module { display: none; }
.module.active { display: block; }

.module-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-bottom: 1.1rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
}
.module-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-700);
  flex-shrink: 0;
}
.module-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--blue-900);
  letter-spacing: -.02em;
}
.module-badge {
  margin-left: auto;
  padding: .25rem .7rem;
  border-radius: var(--radius-sm);
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.module-badge.kluczowy     { background: var(--blue-100); color: var(--blue-700); }
.module-badge.wazny        { background: var(--teal-bg); color: var(--teal); }
.module-badge.nieokreslony { background: var(--amber-bg); color: var(--amber); }
.module-badge.hidden       { display: none; }

/* ── Section ─────────────────────────── */
.section { margin-bottom: 2.5rem; }
.section-title {
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  color: var(--blue-900);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Alert ───────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin-bottom: 1rem;
  font-size: .9375rem;
  line-height: 1.75;
}
.alert-info    { background: var(--blue-50); border-color: var(--blue-700); color: #002F6C; }
.alert-warning { background: var(--amber-bg); border-color: var(--amber); color: #5A3000; }
.alert-danger  { background: var(--red-bg); border-color: var(--red); color: #660000; }
.alert-success { background: var(--green-bg); border-color: var(--green); color: #0A3A18; }
.alert strong { font-weight: 700; }

/* ── FAQ accordion ───────────────────── */
.faq-list { display: flex; flex-direction: column; gap: .4rem; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  font-size: .9375rem;
  font-weight: 700;
  color: var(--blue-900);
  transition: background .12s;
}
.faq-question:hover { background: var(--blue-50); }
.faq-question.open  { background: var(--blue-50); color: var(--blue-700); }
.faq-arrow { font-size: .9rem; transition: transform .2s; flex-shrink: 0; }
.faq-question.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  padding: 0 1.1rem;
  font-size: .875rem;
  color: #3A4A60;
  line-height: 1.7;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
}
.faq-answer.open { padding: .75rem 1.1rem 1.1rem; max-height: 600px; }
.faq-answer a { color: var(--blue-700); }

/* ── Table ───────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
thead { background: var(--blue-900); }
th {
  padding: .75rem 1rem;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
}
td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
  line-height: 1.6;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--blue-50); }
.td-highlight { background: var(--blue-50); }
.td-highlight.kluczowy { background: rgba(0,82,165,.05); }
.td-highlight.wazny    { background: rgba(0,122,122,.05); }

/* ── Law hierarchy ───────────────────── */
.law-hierarchy { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.law-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue-700);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
  position: relative;
}
.law-item:hover { box-shadow: var(--shadow); }
.law-item::before {
  content: '';
  position: absolute;
  left: 1.75rem;
  top: 100%;
  width: 2px;
  height: .5rem;
  background: var(--border);
}
.law-item:last-child::before { display: none; }
.law-item:nth-child(2) { border-left-color: var(--blue-500); }
.law-item:nth-child(3) { border-left-color: var(--teal); }
.law-item:nth-child(4) { border-left-color: #8A9AB5; }
.law-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--blue-700);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: 'Montserrat', sans-serif;
}
.law-item:nth-child(2) .law-rank { background: var(--blue-500); }
.law-item:nth-child(3) .law-rank { background: var(--teal); }
.law-item:nth-child(4) .law-rank { background: #8A9AB5; }
.law-info strong { display: block; font-size: .9rem; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.law-info small { color: var(--text-muted); font-size: .78rem; }

/* ── Timeline ────────────────────────── */
.timeline { position: relative; padding-left: 3rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: .5rem;
  bottom: .5rem;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 1.75rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -2.25rem;
  top: .3rem;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  background: var(--blue-700);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--blue-700);
}
.timeline-marker {
  font-family: 'Space Mono', monospace;
  font-size: .67rem;
  font-weight: 700;
  color: var(--blue-700);
  background: var(--blue-100);
  padding: .1rem .45rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.timeline-item h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: .93rem;
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: .2rem;
}
.timeline-item p { font-size: .85rem; color: var(--text-muted); }

/* ── Tech Cards ──────────────────────── */
.tech-section { margin-bottom: 2.25rem; }
.tech-section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--blue-900);
  margin-bottom: .875rem;
  padding: .5rem 1rem;
  background: var(--bg-aside);
  border-left: 3px solid var(--blue-700);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.tech-cards { display: flex; flex-direction: column; gap: .75rem; }
.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.tech-card:hover { box-shadow: var(--shadow); }
.tech-card-main { flex: 1; min-width: 0; }
.tech-card-name {
  font-weight: 700;
  font-size: .9rem;
  color: var(--blue-900);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
  font-family: 'Montserrat', sans-serif;
}
.tech-tag {
  font-family: 'Space Mono', monospace;
  font-size: .63rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.tech-tag.rec    { background: var(--blue-100); color: var(--blue-700); }
.tech-tag.alt    { background: #E8ECF2; color: #3A4A60; }
.tech-tag.budget { background: var(--amber-bg); color: var(--amber); }
.tech-tag.priv   { background: var(--red-bg); color: var(--red); }
.tech-card p { font-size: .84rem; color: var(--text-muted); line-height: 1.6; margin-bottom: .4rem; }
.tech-card-meta {
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  color: #8A9AB5;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.tech-card-meta a { color: var(--blue-600); }

/* Link do poradnika */
.poradnik-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .5rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--blue-700);
  font-family: 'Montserrat', sans-serif;
  border-bottom: 1px dashed var(--blue-200);
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.poradnik-link:hover { color: var(--blue-600); border-color: var(--blue-400); text-decoration: none; }

/* ── Role tree ───────────────────────── */
.role-tree { margin-bottom: 1rem; }
.role-node { display: flex; flex-direction: column; gap: .5rem; }
.role-box {
  padding: .875rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.role-box.top {
  background: var(--blue-900);
  color: #fff;
  border-color: var(--blue-800);
  text-align: center;
}
.role-box.ciso { border-color: var(--blue-500); border-left: 4px solid var(--blue-700); background: var(--blue-50); }
.role-box strong { display: block; font-size: .9rem; font-family: 'Montserrat', sans-serif; font-weight: 700; }
.role-box small { font-size: .78rem; color: var(--text-muted); }
.role-box.top small { color: var(--blue-200); }
.role-box.ciso small { color: #3A4A60; }
.role-children {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-left: 2rem;
  position: relative;
  padding-top: .875rem;
}
.role-children::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: var(--border);
}

/* ── Priority badge ──────────────────── */
.priority {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  padding: .1rem .45rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-transform: uppercase;
}
.priority.critical { background: var(--red-bg); color: var(--red); }
.priority.high     { background: var(--amber-bg); color: var(--amber); }
.priority.normal   { background: var(--green-bg); color: var(--green); }

/* ── Incident timeline ───────────────── */
.incident-timeline { position: relative; padding-left: 3rem; }
.incident-timeline::before {
  content: '';
  position: absolute;
  left: 1.1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--red) 0%, var(--amber) 50%, var(--green) 100%);
}
.incident-step {
  position: relative;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.incident-step-dot {
  position: absolute;
  left: -2.15rem;
  top: .9rem;
  width: 1.25rem; height: 1.25rem;
  border-radius: 50%;
  background: var(--blue-700);
  border: 2px solid var(--bg);
}
.incident-step:nth-child(1) .incident-step-dot { background: var(--red); }
.incident-step:nth-child(2) .incident-step-dot { background: var(--amber); }
.incident-step:nth-child(3) .incident-step-dot { background: var(--amber); }
.incident-step:nth-child(4) .incident-step-dot { background: var(--blue-700); }
.incident-step:nth-child(5) .incident-step-dot { background: var(--green); }
.incident-step-time {
  font-family: 'Space Mono', monospace;
  font-size: .68rem;
  font-weight: 700;
  color: var(--blue-700);
  background: var(--blue-100);
  padding: .1rem .45rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: .35rem;
  text-transform: uppercase;
}
.incident-step h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: .93rem;
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: .3rem;
}
.incident-step ul { list-style: none; font-size: .84rem; color: var(--text-muted); }
.incident-step ul li::before { content: '> '; color: var(--blue-500); font-family: 'Space Mono', monospace; }

/* ── Scenario cards ──────────────────── */
.scenario-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  border-top: 3px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.scenario-card.ransomware { border-top-color: var(--red); }
.scenario-card.wyciek     { border-top-color: var(--amber); }
.scenario-card.phishing   { border-top-color: var(--blue-500); }
.scenario-card h4 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: .88rem;
  margin-bottom: .6rem;
  display: flex; align-items: center; gap: .4rem;
}
.scenario-card ol { font-size: .8rem; color: var(--text-muted); padding-left: 1.2rem; line-height: 1.7; }

/* ── Checklist ───────────────────────── */
.progress-bar-wrap {
  background: var(--blue-900);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  color: #fff;
}
.progress-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .6rem;
  font-size: .85rem;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
}
.progress-bar-track {
  height: 8px;
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: #4CAF50;
  border-radius: 10px;
  transition: width .4s ease;
}
.progress-pct {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: #7FD080;
}
.checklist-group { margin-bottom: 2rem; }
.checklist-group-title {
  font-family: 'Montserrat', sans-serif;
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--blue-900);
  margin-bottom: .875rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.checklist-group-count {
  font-family: 'Space Mono', monospace;
  font-size: .68rem;
  background: var(--blue-100);
  color: var(--blue-700);
  padding: .1rem .45rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.checklist-items { display: flex; flex-direction: column; gap: .35rem; }
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .7rem .95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .1s, border-color .1s;
  user-select: none;
  box-shadow: var(--shadow-sm);
}
.checklist-item:hover { background: var(--blue-50); border-color: var(--blue-200); }
.checklist-item.done {
  background: var(--green-bg);
  border-color: #A8D8B8;
  box-shadow: none;
}
.checklist-item.done .checklist-text { color: #1A5028; text-decoration: line-through; text-decoration-color: #5AAA70; }
.checklist-cb {
  width: 18px; height: 18px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-strong);
  background: #fff;
  flex-shrink: 0;
  margin-top: .1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
  font-size: .75rem;
}
.checklist-item.done .checklist-cb { background: var(--green); border-color: var(--green); color: #fff; }
.checklist-text { font-size: .875rem; color: var(--text); line-height: 1.5; }
.reset-checklist-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .35rem .95rem;
  font-size: .8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .12s;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}
.reset-checklist-btn:hover { background: var(--red-bg); color: var(--red); border-color: #FFAAAA; }

/* ── Footnotes ───────────────────────── */
.fn-list {
  list-style: decimal;
  padding-left: 1.5rem;
  font-size: .77rem;
  color: #8A9AB5;
  line-height: 1.8;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 2rem;
}
.fn-list li { margin-bottom: .2rem; }
.fn-list a { color: var(--blue-600); }

/* ── Only-kluczowy ───────────────────── */
.only-kluczowy {
  border-left: 3px solid var(--blue-700);
  padding-left: 1rem;
  margin-bottom: 1rem;
}
.only-kluczowy-label {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  font-weight: 700;
  color: var(--blue-700);
  background: var(--blue-100);
  padding: .1rem .45rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: .5rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ══════════════════════════════════════
   MODUŁ PORADNIKI
   ══════════════════════════════════════ */
.article-grid { display: flex; flex-direction: column; gap: 1rem; }

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.article-card:hover { box-shadow: var(--shadow); }

.article-card-summary { padding: 1.25rem 1.5rem 1.35rem; }
.article-card-header { display: flex; align-items: center; gap: .65rem; margin-bottom: .875rem; flex-wrap: wrap; }

.article-tag {
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .2rem .65rem;
  border-radius: var(--radius-sm);
}
.article-tag.danger  { background: var(--red-bg); color: var(--red); }
.article-tag.info    { background: var(--blue-100); color: var(--blue-700); }
.article-tag.success { background: var(--green-bg); color: var(--green); }
.article-tag.warning { background: var(--amber-bg); color: var(--amber); }
.article-tag.teal    { background: var(--teal-bg); color: var(--teal); }

.article-read-time {
  font-family: 'Space Mono', monospace;
  font-size: .68rem;
  color: #8A9AB5;
}
.article-level {
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-aside);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.article-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-900);
  margin-bottom: .55rem;
  line-height: 1.3;
}
.article-excerpt { font-size: .875rem; color: var(--text-muted); line-height: 1.68; margin-bottom: 1.1rem; }

.article-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--blue-700);
  border: none;
  border-radius: var(--radius);
  padding: .45rem 1rem;
  font-size: .78rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: background .12s;
}
.article-expand-btn:hover { background: var(--blue-600); }
.article-expand-btn.open  { background: var(--blue-900); }

.article-content {
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.5rem;
  background: var(--bg-aside);
}
.article-content h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: .93rem;
  font-weight: 700;
  color: var(--blue-900);
  margin: 1.5rem 0 .5rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.article-content h4:first-child { margin-top: 0; }
.article-content p { font-size: .875rem; color: #3A4A60; line-height: 1.72; margin-bottom: .875rem; }
.article-content ul,
.article-content ol { font-size: .875rem; color: #3A4A60; line-height: 1.72; padding-left: 1.5rem; margin-bottom: .875rem; }
.article-content li { margin-bottom: .35rem; }
.article-callout {
  background: var(--blue-50);
  border-left: 4px solid var(--blue-700);
  padding: .875rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .855rem;
  color: #002F6C;
  margin: 1.1rem 0;
  line-height: 1.68;
}
.article-callout strong { font-weight: 700; }
.article-callout.warn    { background: var(--amber-bg); border-color: var(--amber); color: #5A3000; }
.article-callout.danger  { background: var(--red-bg); border-color: var(--red); color: #660000; }
.article-callout.success { background: var(--green-bg); border-color: var(--green); color: #0A3218; }

.article-steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; margin-bottom: .875rem; }
.article-steps li {
  display: flex;
  gap: .875rem;
  align-items: flex-start;
  font-size: .875rem;
  color: #3A4A60;
  line-height: 1.6;
}
.article-steps li::before {
  content: attr(data-n);
  font-family: 'Space Mono', monospace;
  font-size: .7rem;
  font-weight: 700;
  background: var(--blue-700);
  color: #fff;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: .1rem;
}

/* ── Footer styl gov.pl ──────────────── */
.site-footer {
  background: var(--blue-900);
  color: var(--blue-200);
  padding: 1.75rem 2.5rem;
  border-top: 3px solid var(--blue-700);
  /* full width - sidebar is in flow, not fixed */
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  margin-bottom: .875rem;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: 'Montserrat', sans-serif;
}
.footer-disclaimer {
  font-size: .75rem;
  color: #8A9AB5;
  border-top: 1px solid rgba(255,255,255,.07);
  padding-top: .875rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  line-height: 1.7;
}
.footer-disclaimer a { color: var(--blue-200); }
.footer-links { display: flex; gap: .875rem; }
.footer-links a { color: var(--blue-200); font-size: .78rem; }

/* ── Sidebar overlay ─────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,33,71,.5);
  z-index: 240;
}

/* ════════════════════════════════════
   RESPONSIVE — 768px
   ════════════════════════════════════ */
@media (max-width: 768px) {
  /* ── Header mobile ── */
  .header-brand-tag { display: none; }
  .header-brand-title { font-size: .88rem; }
  .header-brand { flex: 0 0 auto; }
  .header-tools { display: none !important; }
  .hamburger-btn { display: flex; margin-left: auto; }

  /* ── Layout ── */
  .app-layout { display: block; }     /* sidebar wychodzi z flow na mobile */

  /* ── Sidebar: fixed off-canvas na mobile ── */
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    height: calc(100vh - var(--header-h));
    z-index: 260;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 30px rgba(0,33,71,.25);
  }
  .sidebar-overlay.open { display: block; }

  /* ── Content ── */
  .main-content {
    padding: 1.5rem 1.1rem;
    max-width: 100%;
  }

  /* ── Welcome screen ── */
  .welcome-cards-wrap { padding: 0 0 1.5rem; }
  .welcome-intro { padding: 1.5rem 0 1.25rem; }
  .welcome-intro h2 { font-size: 1.3rem; }
  .category-cards { grid-template-columns: 1fr; }
  .scenario-cards { grid-template-columns: 1fr; }
  .role-children  { grid-template-columns: 1fr; margin-left: 0; }

  /* ── Tables: stacked card layout ── */
  .table-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
    box-shadow: none;
    margin: 0 0 1rem;
  }
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .75rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  tbody td {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: .9375rem;
    line-height: 1.55;
  }
  tbody td:first-child {
    background: var(--blue-900);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .55rem 1rem;
  }
  tbody td:last-child { border-bottom: none; }
  tbody tr:hover { background: var(--bg-card); }
  .td-highlight { background: var(--bg-card) !important; }

  /* ── Module layout ── */
  .module-title { font-size: 1.3rem; }
  .section-title { font-size: .9rem; }
  .article-card-summary { padding: 1rem 1.1rem; }
  .article-content { padding: 1.25rem 1.1rem; }
}

/* ================================================================
   ROZSZERZENIA v4 - Entity switcher / Diagramy / Dark mode / Search
   ================================================================ */

/* ── Header tools ────────────────────── */
.header-tool-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.8);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.header-tool-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.header-tool-btn.active { background: rgba(255,255,255,.25); color: #fff; }
.btn-home { border-right: 1px solid rgba(255,255,255,.15); margin-right: .15rem; padding-right: .5rem; }

/* ── Entity Switcher ─────────────────── */
.entity-switcher { position: relative; }
.entity-sw-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .9rem .35rem .65rem;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: .03em;
  transition: background .15s;
  white-space: nowrap;
}
.entity-sw-btn:hover { background: rgba(255,255,255,.2); }
.entity-sw-btn.kluczowy     { background: var(--blue-700); border-color: var(--blue-500); }
.entity-sw-btn.wazny        { background: var(--teal); border-color: #009A9A; }
.entity-sw-btn.nieokreslony { background: var(--amber); border-color: #CC8800; }

.entity-sw-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  flex-shrink: 0;
}
.entity-sw-dot.kluczowy     { background: #7FC8F0; }
.entity-sw-dot.wazny        { background: #7FDADA; }
.entity-sw-dot.nieokreslony { background: #FFCC77; }

.entity-sw-arrow { opacity: .75; transition: transform .2s; flex-shrink: 0; }
.entity-sw-btn[aria-expanded="true"] .entity-sw-arrow { transform: rotate(180deg); }

.entity-sw-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 400;
  overflow: hidden;
}
.entity-sw-header {
  padding: .55rem 1rem;
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  background: var(--bg-aside);
  border-bottom: 1px solid var(--border);
}
.entity-sw-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .7rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background .1s;
  border-bottom: 1px solid var(--border);
}
.entity-sw-option:last-child { border-bottom: none; }
.entity-sw-option:hover { background: var(--blue-50); }
.entity-sw-option.active { background: var(--blue-50); }
.entity-sw-option-text { display: flex; flex-direction: column; gap: .1rem; }
.entity-sw-option-text strong { font-size: .84rem; color: var(--text); font-family: 'Montserrat', sans-serif; font-weight: 700; }
.entity-sw-option-text small  { font-size: .72rem; color: var(--text-muted); }

/* search-bar overlay - removed, search moved to sidebar */

/* search-results now lives in sidebar (see .sidebar-search #search-results) */
.search-results { /* base reset - actual styles in #search-results above */ }
.search-result-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.search-result-item:hover { background: var(--blue-50); }
.search-result-item:last-child { border-bottom: none; }
.sr-module  { font-size: .65rem; font-family: 'Space Mono', monospace; color: var(--blue-700); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.sr-title   { font-size: .875rem; font-weight: 700; color: var(--text); }
.sr-snippet { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }
.sr-snippet mark { background: #FFF3A0; color: var(--text); border-radius: 2px; padding: 0 2px; }
.search-no-results { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: .875rem; }

/* ── Dark mode ───────────────────────── */
body.dark {
  --bg: #0F1621;
  --bg-card: #1A2433;
  --bg-aside: #1E2A3A;
  --border: #2A3A50;
  --border-strong: #3A4F68;
  --text: #D8E4F0;
  --text-muted: #7A8FA8;
  --blue-50: #1A2A3A;
  --blue-100: #1E3050;
}
body.dark .diagram { background: var(--bg-card); }
body.dark .attack-step { background: var(--bg-card) !important; border-color: var(--border) !important; }
body.dark .backup-col { background: var(--bg-card) !important; }
body.dark .bk-box { background: var(--bg-aside) !important; }
body.dark .net-vlan { background: var(--bg-card); }
body.dark #search-input { background: var(--bg-aside); border-color: var(--border); color: var(--text); }
body.dark #search-input:focus { border-color: var(--blue-500); }
body.dark #search-results { background: var(--bg-card); border-color: var(--border); }
@media (max-width: 768px) {
  body.dark tbody td:first-child { background: #060E1A; }
}

/* ── Diagramy - podstawy ─────────────── */
.diagram {
  background: var(--bg-aside);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue-700);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.1rem 0;
  overflow-x: auto;
}
.diagram-title {
  font-family: 'Space Mono', monospace;
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: .875rem;
}
.diagram-note {
  font-size: .75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: .875rem;
  padding-top: .625rem;
  border-top: 1px dashed var(--border);
}

/* ── Attack chain flowchart ──────────── */
.attack-chain {
  display: flex;
  align-items: stretch;
  gap: .35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: .25rem;
}
.attack-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: .75rem .625rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  min-width: 100px;
  flex: 1;
}
.attack-step-icon  { font-size: 1.4rem; margin-bottom: .3rem; }
.attack-step-label { font-size: .73rem; font-weight: 700; font-family: 'Montserrat', sans-serif; color: var(--text); }
.attack-step-sub   { font-size: .62rem; color: var(--text-muted); margin-top: .15rem; line-height: 1.35; }
.attack-arrow      { display: flex; align-items: center; font-size: 1.1rem; color: var(--border-strong); flex-shrink: 0; }

/* ── Bar chart ───────────────────────── */
.bar-chart { display: flex; flex-direction: column; gap: .65rem; }
.bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 200px;
  align-items: center;
  gap: .75rem;
}
.bar-label { font-size: .78rem; font-weight: 700; color: var(--text); font-family: 'Montserrat', sans-serif; }
.bar-track { height: 22px; background: var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding-left: .5rem;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Space Mono', monospace;
  min-width: 36px;
}
.bar-fill.low    { background: var(--red); }
.bar-fill.medium { background: var(--amber); }
.bar-fill.high   { background: var(--green); }
.bar-note { font-size: .72rem; color: var(--text-muted); }
.bar-note.danger-note { color: var(--red); }
.bar-note.warn-note   { color: var(--amber); }
.bar-note.ok-note     { color: var(--green); }

/* ── Backup 3-2-1-1 visual ───────────── */
.backup-visual {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .875rem;
  margin-bottom: 1rem;
}
.backup-col {
  text-align: center;
  padding: 1rem .75rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg-card);
}
.backup-col.blue   { border-color: var(--blue-200); background: var(--blue-50); }
.backup-col.teal   { border-color: #9FDBDB; background: var(--teal-bg); }
.backup-col.amber  { border-color: #FFCC88; background: var(--amber-bg); }
.backup-col.green  { border-color: #9FDBB5; background: var(--green-bg); }
.backup-num { font-size: 2.75rem; font-weight: 800; font-family: 'Montserrat', sans-serif; line-height: 1; margin-bottom: .25rem; }
.backup-col.blue  .backup-num { color: var(--blue-700); }
.backup-col.teal  .backup-num { color: var(--teal); }
.backup-col.amber .backup-num { color: var(--amber); }
.backup-col.green .backup-num { color: var(--green); }
.backup-label { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .5rem; }
.backup-boxes { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: center; margin-bottom: .45rem; }
.bk-box {
  padding: .2rem .45rem;
  border-radius: var(--radius-sm);
  font-size: .68rem;
  font-weight: 700;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--border);
  color: var(--text);
}
.backup-desc { font-size: .69rem; color: var(--text-muted); line-height: 1.45; }

/* RPO/RTO strip */
.rto-strip { margin-top: .875rem; padding-top: .875rem; border-top: 1px solid var(--border); }
.rto-bar { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px; border-radius: var(--radius-sm); overflow: hidden; margin-bottom: .35rem; }
.rto-segment { padding: .5rem .75rem; text-align: center; display: flex; flex-direction: column; gap: .2rem; }
.rto-segment strong { font-size: .78rem; font-family: 'Montserrat', sans-serif; font-weight: 700; }
.rto-segment small  { font-size: .65rem; line-height: 1.4; }
.rto-segment.rpo { background: var(--red-bg); color: var(--red); }
.rto-segment.rto { background: var(--amber-bg); color: var(--amber); }
.rto-segment.ok  { background: var(--green-bg); color: var(--green); }
.rto-labels { display: grid; grid-template-columns: repeat(4, 1fr); font-size: .63rem; color: var(--text-muted); font-family: 'Space Mono', monospace; text-align: center; padding-top: .25rem; }

/* ── Network topology ────────────────── */
.net-topo { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 560px; }
.net-row { display: flex; justify-content: center; width: 100%; }
.net-node {
  padding: .5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  text-align: center;
  border: 2px solid;
  line-height: 1.4;
}
.net-node small { font-size: .63rem; font-weight: 400; display: block; opacity: .8; margin-top: .1rem; font-family: 'Space Mono', monospace; }
.net-node.internet { background: var(--bg-aside); border-color: var(--border-strong); color: var(--text); }
.net-node.firewall { background: var(--red-bg); border-color: var(--red); color: var(--red); min-width: 260px; }
.net-node.switch   { background: var(--blue-50); border-color: var(--blue-700); color: var(--blue-700); min-width: 260px; }
.net-line-v { width: 2px; height: 20px; background: var(--border); }
.net-vlan-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; width: 100%; margin-top: .5rem; }
.net-vlan { padding: .75rem .5rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); font-size: .7rem; text-align: center; border-top: 3px solid; }
.net-vlan.v10 { border-top-color: var(--red); }
.net-vlan.v20 { border-top-color: var(--blue-700); }
.net-vlan.v30 { border-top-color: var(--amber); }
.net-vlan.v40 { border-top-color: var(--teal); }
.net-vlan.v99 { border-top-color: #8A9AB5; }
.net-vlan-id   { font-family: 'Space Mono', monospace; font-size: .62rem; font-weight: 700; color: var(--text-muted); }
.net-vlan-name { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: .75rem; color: var(--text); margin: .2rem 0; }
.net-vlan-items { display: flex; flex-wrap: wrap; gap: .2rem; justify-content: center; margin: .3rem 0; }
.net-vlan-items span { background: var(--bg-aside); border: 1px solid var(--border); border-radius: 3px; padding: .1rem .3rem; font-size: .6rem; color: var(--text-muted); }
.net-vlan-rule { font-size: .62rem; color: var(--text-muted); line-height: 1.4; font-style: italic; margin-top: .2rem; }

/* ── Print ───────────────────────────── */
@media print {
  .site-header, .sidebar, .sidebar-overlay,
  .btn-start, .article-expand-btn, .reset-checklist-btn { display: none !important; }
  .app-layout { display: block; margin-left: 0; }
  .main-content { padding: 0; max-width: 100%; }
  .module { display: block !important; margin-bottom: 2rem; page-break-before: always; }
  .article-content { display: block !important; }
  body { font-size: 12px; }
  a { color: inherit !important; text-decoration: none; }
  .diagram { break-inside: avoid; }
  @page { margin: 2cm; }
}

/* ── Responsive diagrams ─────────────── */
@media (max-width: 900px) {
  .bar-row { grid-template-columns: 100px 1fr; }
  .bar-note { display: none; }
  .backup-visual { grid-template-columns: repeat(2, 1fr); }
  .rto-labels { grid-template-columns: repeat(2, 1fr); }
  .net-vlan-row { grid-template-columns: repeat(3, 1fr); }
  .attack-chain { overflow-x: auto; flex-wrap: nowrap; }
}
@media (max-width: 600px) {
  .net-vlan-row { grid-template-columns: repeat(2, 1fr); }
  .backup-visual { grid-template-columns: repeat(2, 1fr); }
}
