/* ══════════════════════════════════════════════════════════════════════
   Wiki — AsociaPro
   Hoja de estilos compartida. Sin build step: HTML plano + esta hoja +
   wiki.js. Pensada para subirse tal cual a cualquier alojamiento.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --border: #e4e1da;
  --ink: #20242c;
  --muted: #6b6f78;
  --accent: #1367d1;
  --accent-ink: #ffffff;
  --accent-soft: #e7f0fc;
  --accent-2: #08b8b2;
  --accent-2-soft: #e2f8f6;
  --accent-3: #f2a33a;
  --accent-3-soft: #faf0e2;
  --ok: #1a7f4b;
  --ok-soft: #e8f5ee;
  --warn: #b06a12;
  --warn-soft: #faf0e2;
  --danger: #b3261e;
  --danger-soft: #fbe9e8;
  --ring: #c9cedb;
  --sidebar-w: 292px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 50, 0.05);
  --shadow-md: 0 8px 24px -8px rgba(20, 30, 50, 0.16);
  --shadow-lg: 0 20px 48px -12px rgba(20, 30, 50, 0.22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15161a;
    --surface: #1c1e24;
    --surface-2: #23262e;
    --border: #33363f;
    --ink: #eceef2;
    --muted: #9aa0ac;
    --accent: #7d97e6;
    --accent-ink: #0e1526;
    --accent-soft: #232c47;
    --accent-2: #4fd8d1;
    --accent-2-soft: #103330;
    --accent-3: #e3a75a;
    --accent-3-soft: #3a2c14;
    --ok: #5fce97;
    --ok-soft: #163227;
    --warn: #e3a75a;
    --warn-soft: #3a2c14;
    --danger: #f0928c;
    --danger-soft: #3a1e1c;
    --ring: #3a3f4d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15161a;
  --surface: #1c1e24;
  --surface-2: #23262e;
  --border: #33363f;
  --ink: #eceef2;
  --muted: #9aa0ac;
  --accent: #7d97e6;
  --accent-ink: #0e1526;
  --accent-soft: #232c47;
  --accent-2: #4fd8d1;
  --accent-2-soft: #103330;
  --accent-3: #e3a75a;
  --accent-3-soft: #3a2c14;
  --ok: #5fce97;
  --ok-soft: #163227;
  --warn: #e3a75a;
  --warn-soft: #3a2c14;
  --danger: #f0928c;
  --danger-soft: #3a1e1c;
  --ring: #3a3f4d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(19, 103, 209, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(8, 184, 178, 0.035) 1px, transparent 1px), var(--bg);
  background-size: 44px 44px;
  color: var(--ink);
  font-family:
    "IBM Plex Sans",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
h1,
h2,
h3,
h4 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--ink);
}
code,
.mono,
kbd {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.87em;
  color: var(--accent);
}
pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
img {
  max-width: 100%;
}

/* Énfasis con más carácter que el negrita/cursiva por defecto del navegador */
b,
strong {
  font-weight: 700;
  color: var(--ink);
}
.doc b,
.doc strong,
.card b,
.card strong,
.note b,
.note strong,
.timeline b,
.timeline strong {
  color: var(--accent);
  font-weight: 700;
}
em,
i {
  font-style: italic;
  color: var(--muted);
}
u {
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
mark {
  background: var(--accent-2-soft);
  color: var(--ink);
  padding: 0 3px;
  border-radius: 3px;
}

/* Enlaces dentro del contenido: subrayado animado, no estático */
.doc a:not(.card a):not(.step a),
.note a,
footer.page-foot a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  transition: background-size 0.22s ease;
  padding-bottom: 1px;
}
.doc a:not(.card a):not(.step a):hover,
.note a:hover,
footer.page-foot a:hover {
  background-size: 100% 1.5px;
}

/* ---- icon system ---- */
.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: -0.14em;
}

/* ---- entrance motion ---- */
@keyframes wiki-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes wiki-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes wiki-grow {
  from {
    width: 0;
  }
}
.doc > * {
  animation: wiki-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.doc > *:nth-child(1) {
  animation-delay: 0.02s;
}
.doc > *:nth-child(2) {
  animation-delay: 0.06s;
}
.doc > *:nth-child(3) {
  animation-delay: 0.1s;
}
.doc > *:nth-child(n + 4) {
  animation-delay: 0.12s;
}
.card-grid .card {
  animation: wiki-rise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.card-grid .card:nth-child(1) {
  animation-delay: 0.05s;
}
.card-grid .card:nth-child(2) {
  animation-delay: 0.1s;
}
.card-grid .card:nth-child(3) {
  animation-delay: 0.15s;
}
.card-grid .card:nth-child(4) {
  animation-delay: 0.2s;
}
.card-grid .card:nth-child(n + 5) {
  animation-delay: 0.24s;
}

/* ---- layout shell ---- */
.layout {
  display: flex;
  min-height: 100%;
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.92),
      rgba(255, 255, 255, 0.78)
    ),
    var(--surface);
  padding: 20px 16px 40px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  backdrop-filter: blur(14px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar {
    background:
      linear-gradient(180deg, rgba(28, 30, 36, 0.94), rgba(28, 30, 36, 0.82)),
      var(--surface);
  }
  :root:not([data-theme="light"]) .card {
    background:
      linear-gradient(180deg, rgba(35, 38, 46, 0.85), rgba(35, 38, 46, 0)),
      var(--surface);
  }
}
:root[data-theme="dark"] .sidebar {
  background:
    linear-gradient(180deg, rgba(28, 30, 36, 0.94), rgba(28, 30, 36, 0.82)),
    var(--surface);
}
:root[data-theme="dark"] .card {
  background:
    linear-gradient(180deg, rgba(35, 38, 46, 0.85), rgba(35, 38, 46, 0)),
    var(--surface);
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 10px 6px 22px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}
.sidebar-brand .mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-brand .txt {
  font-size: 13px;
  line-height: 1.3;
}
.sidebar-brand .txt b {
  display: block;
  font-weight: 700;
  color: var(--ink);
  font-family: "Fraunces", serif;
  font-size: 17px;
}
.sidebar-brand .txt span {
  color: var(--muted);
  font-size: 11.5px;
}

.section-switch {
  position: relative;
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 16px;
}
.section-switch a {
  position: relative;
  z-index: 1;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 4px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.section-switch a .icon {
  font-size: 12px;
}
.section-switch a.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.search-box {
  margin-bottom: 14px;
  position: relative;
}
.search-box .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 8px 10px 8px 30px;
  border: 1px solid var(--ring);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

nav.tree {
  font-size: 13.5px;
}
nav.tree .group {
  margin-bottom: 6px;
}
nav.tree .group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 12px 8px 5px;
  font-weight: 700;
}
nav.tree .group-label .icon {
  font-size: 12px;
  color: var(--accent-2);
}
nav.tree a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 1px;
  border-left: 2px solid transparent;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    transform 0.12s ease;
}
nav.tree a .nav-icon {
  color: var(--muted);
  font-size: 14px;
  transition:
    color 0.12s ease,
    transform 0.12s ease;
}
nav.tree a:hover .nav-icon,
nav.tree a.active .nav-icon {
  color: currentColor;
  transform: scale(1.06);
}
nav.tree a:hover {
  background: var(--surface-2);
  transform: translateX(1px);
}
nav.tree a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  border-left-color: var(--accent);
}
nav.tree a[hidden] {
  display: none;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 44px clamp(20px, 5vw, 64px) 80px;
}
.doc {
  max-width: 860px;
}
.doc > *:first-child {
  margin-top: 0;
}

.crumb {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.crumb a {
  color: var(--muted);
  text-decoration: none;
}
.crumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 5px 13px 5px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.role-badge .icon {
  font-size: 15px;
}
.role-badge.socio {
  background: var(--accent-2-soft);
  color: #0a7a74;
  border-color: transparent;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .role-badge.socio {
    color: var(--accent-2);
  }
}
:root[data-theme="dark"] .role-badge.socio {
  color: var(--accent-2);
}
.role-badge.admin {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.role-badge.superadmin {
  background: linear-gradient(135deg, var(--warn-soft), var(--danger-soft));
  color: var(--danger);
  border-color: transparent;
}

.doc h1 {
  font-size: clamp(28px, 4.2vw, 36px);
  margin: 0 0 10px;
  position: relative;
  display: inline-block;
}
.doc h1::after {
  content: "";
  display: block;
  height: 4px;
  width: 64px;
  margin-top: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: wiki-grow 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
.doc .lede {
  font-size: 16.5px;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 28px;
}
.wiki-visual {
  margin: -4px 0 34px;
  max-width: 760px;
  animation: wiki-rise 0.52s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
}
.wiki-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.wiki-visual figcaption {
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--muted);
}
.doc h2 {
  font-size: 21px;
  margin: 38px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.doc h2::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
  transform: rotate(45deg);
}
.doc h2.has-icon::before {
  display: none;
}
.doc h2 .heading-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc h2 .heading-icon .icon {
  font-size: 16px;
}
.doc h2:first-of-type {
  border-top: none;
  padding-top: 0;
}
.doc h2 .icon {
  color: var(--accent);
  font-size: 0.92em;
}
.doc h3 {
  font-size: 16.5px;
  margin: 22px 0 8px;
  color: var(--accent);
}
.doc p {
  margin: 0 0 14px;
  max-width: 66ch;
}
.doc ul,
.doc ol {
  margin: 0 0 14px;
  padding-left: 4px;
  list-style: none;
}
.doc li {
  margin-bottom: 8px;
  padding-left: 26px;
  position: relative;
}
.doc ul > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
}
.doc ol {
  counter-reset: wiki-ol;
}
.doc ol > li {
  counter-increment: wiki-ol;
}
.doc ol > li::before {
  content: counter(wiki-ol);
  position: absolute;
  left: 0;
  top: -0.05em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc p.small {
  font-size: 13px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.badge .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}
.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge.neutral {
  background: var(--surface-2);
  color: var(--muted);
}

.note {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  padding: 13px 17px;
  font-size: 14px;
  margin: 16px 0;
  max-width: 64ch;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}
.note .icon {
  color: var(--accent);
  font-size: 17px;
  margin-top: 1px;
  flex-shrink: 0;
}
.note .note-body {
  min-width: 0;
}
.note.warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}
.note.warn .icon {
  color: var(--warn);
}
.note.danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}
.note.danger .icon {
  color: var(--danger);
}
.note b {
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 18px 0 26px;
}
.card {
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0)),
    var(--surface);
  border-radius: 8px;
  padding: 18px 18px 19px;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.card:hover::before {
  transform: scaleX(1);
}
.card .card-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    var(--card-color, var(--accent)),
    var(--card-color-2, var(--accent-2))
  );
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 19px;
  box-shadow: 0 10px 22px -12px var(--card-color, var(--accent));
}
.card .card-icon .icon {
  width: 21px;
  height: 21px;
  stroke-width: 2.15;
}
.card-grid .card:nth-child(3n + 1) {
  --card-color: var(--accent);
  --card-color-2: #3c86df;
}
.card-grid .card:nth-child(3n + 2) {
  --card-color: var(--accent-2);
  --card-color-2: #2fcfc8;
}
.card-grid .card:nth-child(3n) {
  --card-color: var(--accent-3);
  --card-color-2: #d7851e;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
}
.card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}
.card a.stretched::after {
  content: "";
  position: absolute;
  inset: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
  margin: 0;
}
th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 700;
  color: var(--accent);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
  background: var(--accent-soft);
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr {
  transition: background-color 0.12s ease;
}
tbody tr:hover {
  background: var(--surface-2);
}
.table-wrap {
  overflow-x: auto;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.table-wrap table {
  min-width: 100%;
}

.mock {
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(19, 103, 209, 0.05), transparent 42%),
    var(--surface);
  border-radius: 8px;
  overflow: hidden;
  max-width: 560px;
  margin: 18px 0 22px;
  box-shadow: var(--shadow-md);
}
.mock .bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: var(--ink);
  border-bottom: 1px solid var(--border);
}
.mock .bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.mock .bar span:nth-child(1) {
  background: #f0928c;
}
.mock .bar span:nth-child(2) {
  background: #e3a75a;
}
.mock .bar span:nth-child(3) {
  background: #5fce97;
}
.mock .bar .url {
  margin-left: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 3px 10px;
}
.mock .body {
  padding: 18px 20px;
}

.timeline {
  position: relative;
  margin: 22px 0 26px;
  padding-left: 42px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.timeline .step {
  position: relative;
  padding: 0 0 24px;
}
.timeline .step:last-child {
  padding-bottom: 0;
}
.timeline .step::before {
  content: attr(data-n);
  position: absolute;
  left: -42px;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
.timeline .step h4 {
  margin: 0 0 4px;
  font-size: 15px;
}
.timeline .step p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 60ch;
}

footer.page-foot {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}
footer.page-foot .wiki-version {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}

/* password gate (interno) */
#gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: wiki-fade 0.2s ease both;
}
#gate .box {
  max-width: 360px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px 28px;
  box-shadow: var(--shadow-lg);
  animation: wiki-rise 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
#gate .gate-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--warn-soft), var(--danger-soft));
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
#gate h2 {
  font-size: 19px;
  margin: 0 0 6px;
  border: none;
  padding: 0;
}
#gate p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 16px;
}
#gate input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ring);
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 10px;
  background: var(--bg);
  color: var(--ink);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
#gate input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#gate button {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #0e56ab);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
#gate button:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
#gate .err {
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 8px;
  min-height: 16px;
}
[data-gated] .content,
[data-gated] .sidebar {
  visibility: hidden;
}

@media (max-width: 860px) {
  .menu-toggle {
    display: flex;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    z-index: 39;
    width: min(84vw, 320px);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
  }
  .content {
    padding-top: 70px;
  }
}
