:root {
  --bg: #f6f8fb;
  --ink: #18212f;
  --muted: #5e6b7e;
  --panel: #ffffff;
  --line: #d9e0ea;
  --panel-soft: #fbfcff;
  --panel-tint: #eef7ff;
  --chip-bg: #eef4ff;
  --chip-border: #b9ccff;
  --chip-ink: #0f3f9e;
  --control-bg: rgba(255, 255, 255, 0.9);
  --control-ink: #5e6b7e;
  --code-bg: #101827;
  --code-ink: #f5f7fb;
  --blue: #2667ff;
  --teal: #008f8c;
  --amber: #c57a00;
  --red: #c93636;
  --violet: #6f4bd8;
  --green: #2f8d58;
  --shadow: 0 18px 44px rgba(24, 33, 47, 0.09);
}

body.theme-dark {
  --bg: #070b12;
  --ink: #eef3ff;
  --muted: #a9b6cc;
  --panel: #101827;
  --line: #2b374c;
  --panel-soft: #141e2e;
  --panel-tint: #10263d;
  --chip-bg: #10243d;
  --chip-border: #2c5688;
  --chip-ink: #d8e7ff;
  --control-bg: rgba(16, 24, 39, 0.88);
  --control-ink: #dce7f8;
  --code-bg: #050914;
  --code-ink: #f7fbff;
  --blue: #77a2ff;
  --teal: #35c4bd;
  --amber: #f1b64c;
  --red: #ff6b6b;
  --violet: #a78bfa;
  --green: #55d087;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

body.theme-contrast {
  --bg: #fffdf7;
  --ink: #080a0f;
  --muted: #313b4b;
  --panel: #ffffff;
  --line: #101827;
  --panel-soft: #fff7d1;
  --panel-tint: #e5f5ff;
  --chip-bg: #fff2bd;
  --chip-border: #101827;
  --chip-ink: #080a0f;
  --control-bg: rgba(255, 255, 255, 0.96);
  --control-ink: #080a0f;
  --code-bg: #000000;
  --code-ink: #ffffff;
  --blue: #004cff;
  --teal: #006f68;
  --amber: #9b5400;
  --red: #b00020;
  --violet: #4f31b8;
  --green: #006b2f;
  --shadow: 0 16px 0 rgba(16, 24, 39, 0.08);
}

body.theme-paper {
  --bg: #f3efe6;
  --ink: #201b15;
  --muted: #6e6255;
  --panel: #fffaf0;
  --line: #d8cbb7;
  --panel-soft: #f8f0df;
  --panel-tint: #eef3e8;
  --chip-bg: #efe3c8;
  --chip-border: #d2bc8e;
  --chip-ink: #563d0e;
  --control-bg: rgba(255, 250, 240, 0.92);
  --control-ink: #5c5144;
  --code-bg: #211a14;
  --code-ink: #fff4df;
  --blue: #315faa;
  --teal: #24786e;
  --amber: #9a6408;
  --red: #a53b2e;
  --violet: #70579c;
  --green: #397143;
  --shadow: 0 18px 38px rgba(76, 58, 33, 0.12);
}

body.theme-ocean {
  --bg: #eaf7fb;
  --ink: #10232f;
  --muted: #536b78;
  --panel: #ffffff;
  --line: #b9d9e4;
  --panel-soft: #f0fbff;
  --panel-tint: #e2f5ff;
  --chip-bg: #ddf5ff;
  --chip-border: #8fcde2;
  --chip-ink: #07506a;
  --control-bg: rgba(240, 251, 255, 0.94);
  --control-ink: #315b69;
  --code-bg: #062033;
  --code-ink: #ebfbff;
  --blue: #116ed2;
  --teal: #008c96;
  --amber: #b66a00;
  --red: #c73c4a;
  --violet: #6750b6;
  --green: #18805c;
  --shadow: 0 18px 44px rgba(9, 74, 96, 0.12);
}

body.theme-forest {
  --bg: #eef5ec;
  --ink: #142119;
  --muted: #536757;
  --panel: #fbfff8;
  --line: #c8dac6;
  --panel-soft: #f3faef;
  --panel-tint: #e8f5e5;
  --chip-bg: #e6f4df;
  --chip-border: #adcaa5;
  --chip-ink: #225322;
  --control-bg: rgba(251, 255, 248, 0.94);
  --control-ink: #425846;
  --code-bg: #0c2114;
  --code-ink: #effff2;
  --blue: #356fd0;
  --teal: #287f63;
  --amber: #a96d00;
  --red: #bf3c36;
  --violet: #6852a6;
  --green: #19733d;
  --shadow: 0 18px 44px rgba(31, 86, 42, 0.12);
}

body.theme-ruby {
  --bg: #fff3f5;
  --ink: #29161b;
  --muted: #705962;
  --panel: #ffffff;
  --line: #efc7d0;
  --panel-soft: #fff8fa;
  --panel-tint: #fff0f4;
  --chip-bg: #ffe9ef;
  --chip-border: #f0aebd;
  --chip-ink: #8a1c37;
  --control-bg: rgba(255, 248, 250, 0.94);
  --control-ink: #704651;
  --code-bg: #2a0b15;
  --code-ink: #fff4f7;
  --blue: #325fd4;
  --teal: #0a827a;
  --amber: #ac6500;
  --red: #d3234a;
  --violet: #834fc0;
  --green: #218052;
  --shadow: 0 18px 44px rgba(130, 31, 55, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* user-select: none; */
  /* -webkit-user-select: none; */
  /* -webkit-touch-callout: none; */
}

body * {
  min-width: 0;
  /* user-select: none; */
  /* -webkit-user-select: none; */
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 220ms ease;
}

.app-shell:has(.sidebar--rail:hover),
.app-shell:has(.sidebar--rail.is-pinned),
.app-shell:has(.sidebar--rail:focus-within) {
  grid-template-columns: 260px minmax(0, 1fr);
}

.app-shell--dock {
  display: block;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 20px;
  background: rgba(13, 20, 34, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5f7fb;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.topbar-brand .brand-mark {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.brand-mark--crosshair {
  background: transparent;
  color: var(--red, #ff6b6b);
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
}

.brand-mark--crosshair svg {
  display: block;
}

.brand-mark--banned {
  background: transparent;
  color: #a9c8ff;
  border: none;
  border-radius: 0;
  padding: 0;
  display: grid;
  place-items: center;
}

.brand-mark--banned svg {
  display: block;
}

.topbar-brand-text h1 {
  margin: 0;
  font-size: 14px;
  line-height: 1.1;
  color: #ffffff;
}

.topbar-brand-text p {
  margin: 1px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.topbar-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.topbar-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #dce5f4;
  text-decoration: none;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.topbar-nav a:hover,
.topbar-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  outline: none;
}

.topbar-nav a.is-active {
  color: #ffffff;
  background: rgba(201, 54, 54, 0.18);
  border-color: rgba(255, 107, 107, 0.55);
}

.topbar-nav .nav-badge {
  font-size: 10px;
  padding: 1px 5px;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.topbar-controls .theme-cycle,
.topbar-controls .lang-cycle {
  position: static;
  padding: 0;
  font-size: 12px;
}

.topbar-controls .home-corner {
  position: static;
  font-size: 12px;
}

.topbar-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  cursor: pointer;
}

.topbar-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #f5f7fb;
  margin: 0 auto;
}

.app-shell--dock main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px 80px;
}

.app-shell--dock main > section[id] {
  scroll-margin-top: 80px;
}

.app-shell--dock main > section[id]:last-of-type {
  min-height: calc(100vh - 80px);
}

.app-shell--dock .corner-controls {
  display: none;
}

.floating-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(16, 24, 39, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  color: #f5f7fb;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dock-progress {
  position: relative;
  width: 44px;
  height: 44px;
}

.dock-progress-arc {
  color: var(--red, #ff6b6b);
  transition: stroke-dashoffset 180ms ease;
}

.dock-progress-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #f5f7fb;
}

.dock-mini {
  list-style: none;
  margin: 0;
  padding: 0 4px;
  display: flex;
  gap: 6px;
}

.dock-mini a {
  display: block;
  width: 16px;
  height: 16px;
  position: relative;
}

.dock-mini a span {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: background 160ms ease, transform 160ms ease, inset 160ms ease;
}

.dock-mini a:hover span {
  background: rgba(255, 255, 255, 0.7);
  inset: 2px;
}

.dock-mini a.is-active span {
  background: var(--red, #ff6b6b);
  inset: 1px;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.25);
}

.dock-top {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f7fb;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  display: grid;
  place-items: center;
  transition: background 160ms ease;
}

.dock-top:hover {
  background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 1420px) {
  .floating-dock {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
  }

  .topbar-brand {
    flex: 1 1 auto;
  }

  .topbar-brand-text p,
  .topbar-controls .home-corner {
    display: none;
  }

  .topbar-controls {
    margin-left: auto;
    gap: 6px;
  }

  .topbar-nav {
    order: 5;
    flex-basis: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .topbar-nav.is-collapsed {
    display: none;
  }

  .topbar-burger {
    display: flex;
  }

  .floating-dock {
    padding: 8px 10px;
    gap: 6px;
  }

  .dock-mini {
    display: none;
  }
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
  }

  .topbar-brand {
    flex: 1 1 auto;
  }

  .topbar-brand-text p,
  .topbar-controls .home-corner {
    display: none;
  }

  .topbar-controls {
    margin-left: auto;
    gap: 6px;
  }

  .topbar-nav {
    order: 5;
    flex: 1 1 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .topbar-nav::-webkit-scrollbar {
    display: none;
  }

  .banner-subtitle {
    width: auto !important;
    max-width: 100%;
    white-space: normal;
    text-align: left;
    text-align-last: left;
    line-height: 1.12;
  }
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, #0d1422 0%, #101827 60%, #0a1020 100%);
  color: #f5f7fb;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.sidebar--rail {
  padding: 18px 8px 14px;
  width: 64px;
  transition: width 220ms ease, padding 220ms ease;
  overflow: hidden;
}

.sidebar--rail:hover,
.sidebar--rail.is-pinned,
.sidebar--rail:focus-within {
  width: 260px;
  padding: 22px 16px 18px;
  overflow-y: auto;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
}

.sidebar--rail .brand-block {
  gap: 10px;
  margin-bottom: 22px;
  align-items: center;
}

.sidebar--rail .brand-block > div:last-child {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 180ms ease, max-width 220ms ease;
  pointer-events: none;
}

.sidebar--rail:hover .brand-block > div:last-child,
.sidebar--rail.is-pinned .brand-block > div:last-child,
.sidebar--rail:focus-within .brand-block > div:last-child {
  opacity: 1;
  max-width: 200px;
  white-space: normal;
  pointer-events: auto;
  transition-delay: 80ms;
}

.sidebar--rail .brand-mark {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.sidebar--rail .nav-timeline-label {
  opacity: 0;
  height: 0;
  margin: 0;
  padding: 0;
  transition: opacity 160ms ease;
}

.sidebar--rail:hover .nav-timeline-label,
.sidebar--rail.is-pinned .nav-timeline-label,
.sidebar--rail:focus-within .nav-timeline-label {
  opacity: 1;
  height: auto;
  margin: 0 0 12px;
  padding-left: 4px;
}

.sidebar--rail .nav-timeline ol::before {
  display: none;
}

.sidebar--rail:hover .nav-timeline ol::before,
.sidebar--rail.is-pinned .nav-timeline ol::before,
.sidebar--rail:focus-within .nav-timeline ol::before {
  display: block;
}

.sidebar--rail .nav-timeline a {
  grid-template-columns: 32px 1fr;
  padding: 8px 4px;
  justify-content: start;
}

.sidebar--rail .nav-text {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 160ms ease, max-width 220ms ease;
  pointer-events: none;
}

.sidebar--rail:hover .nav-text,
.sidebar--rail.is-pinned .nav-text,
.sidebar--rail:focus-within .nav-text {
  opacity: 1;
  max-width: 200px;
  white-space: normal;
  pointer-events: auto;
  transition-delay: 100ms;
}

.sidebar--rail .nav-icon {
  margin-left: 4px;
}

.sidebar--rail .sidebar-footer {
  align-items: center;
}

.sidebar--rail .sidebar-repo span {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 160ms ease, max-width 220ms ease;
}

.sidebar--rail:hover .sidebar-repo span,
.sidebar--rail.is-pinned .sidebar-repo span,
.sidebar--rail:focus-within .sidebar-repo span {
  opacity: 1;
  max-width: 200px;
}

.sidebar--rail .sidebar-repo {
  padding: 8px;
  justify-content: center;
}

.sidebar--rail:hover .sidebar-repo,
.sidebar--rail.is-pinned .sidebar-repo,
.sidebar--rail:focus-within .sidebar-repo {
  justify-content: flex-start;
  padding: 8px 10px;
}

.sidebar--rail .sidebar-tag {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
  transition: opacity 160ms ease;
}

.sidebar--rail:hover .sidebar-tag,
.sidebar--rail.is-pinned .sidebar-tag,
.sidebar--rail:focus-within .sidebar-tag {
  opacity: 1;
  height: auto;
}

.sidebar--rail .sidebar-pin {
  position: absolute;
  top: 18px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #dce5f4;
  border-radius: 6px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 11px;
  z-index: 5;
}

.sidebar--rail:hover .sidebar-pin,
.sidebar--rail.is-pinned .sidebar-pin,
.sidebar--rail:focus-within .sidebar-pin {
  display: flex;
}

.sidebar--rail.is-pinned .sidebar-pin {
  background: var(--red, #c93636);
  border-color: var(--red, #c93636);
  color: #ffffff;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #101827;
  background: #f4c542;
  font-weight: 900;
}

.brand-block h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.brand-block p {
  margin: 5px 0 0;
  color: #bcc6d6;
  font-size: 13px;
}

.nav-timeline {
  flex: 1;
  margin-top: 4px;
}

.nav-timeline-label {
  margin: 0 0 12px;
  padding-left: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.nav-timeline ol {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.nav-timeline ol::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-radius: 2px;
}

.nav-timeline li {
  position: relative;
}

.nav-timeline a {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 6px;
  color: #dce5f4;
  text-decoration: none;
  border-radius: 8px;
  transition: background 160ms ease, color 160ms ease;
  position: relative;
}

.nav-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1b2840;
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: #a9c8ff;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nav-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: #f0f4ff;
}

.nav-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-badge--crit {
  color: #ffd9d9;
  background: rgba(201, 54, 54, 0.28);
  border: 1px solid rgba(255, 107, 107, 0.55);
}

.nav-timeline a:hover,
.nav-timeline a:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.nav-timeline a:hover .nav-icon,
.nav-timeline a:focus-visible .nav-icon {
  background: #243758;
  border-color: rgba(169, 200, 255, 0.55);
  color: #ffffff;
  transform: scale(1.05);
}

.nav-timeline a.is-active {
  background: rgba(38, 103, 255, 0.12);
}

.nav-timeline a.is-active .nav-icon {
  background: var(--red, #c93636);
  border-color: rgba(255, 255, 255, 0.85);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(201, 54, 54, 0.18);
}

.nav-timeline a.is-active .nav-title {
  color: #ffffff;
}

.sidebar-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-repo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #dce5f4;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: background 160ms ease;
}

.sidebar-repo:hover,
.sidebar-repo:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.sidebar-tag {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

main {
  position: relative;
  width: min(1280px, calc(100vw - 64px));
  padding: 26px;
}

.corner-controls {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 8px auto;
}

.home-corner,
.theme-cycle {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(16, 24, 39, 0.1);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--control-ink);
  box-shadow: 0 8px 22px rgba(24, 33, 47, 0.09);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.home-corner:hover,
.home-corner:focus-visible,
.theme-cycle:hover,
.theme-cycle:focus-visible {
  color: var(--ink);
  outline: none;
}

.theme-cycle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  justify-content: center;
  cursor: pointer;
}

.theme-cycle-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.theme-cycle-icon svg {
  display: block;
}

.lang-cycle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(16, 24, 39, 0.12);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(24, 33, 47, 0.11);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.lang-cycle:hover,
.lang-cycle:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.intro-copy,
.summary-panel,
.explain-strip,
.section-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro-copy {
  padding: 34px;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.94), rgba(255,255,255,0.78)),
    repeating-linear-gradient(0deg, rgba(38,103,255,0.08) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(0,143,140,0.08) 0 1px, transparent 1px 34px);
}

body.theme-dark .intro-copy {
  background:
    linear-gradient(90deg, rgba(16,24,39,0.98), rgba(16,24,39,0.86)),
    repeating-linear-gradient(0deg, rgba(119,162,255,0.1) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(53,196,189,0.08) 0 1px, transparent 1px 34px);
}

body.theme-contrast .intro-copy {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.98), rgba(255,253,247,0.9)),
    repeating-linear-gradient(0deg, rgba(0,76,255,0.16) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(0,111,104,0.12) 0 1px, transparent 1px 34px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

p {
  color: var(--muted);
}

.intro-copy p:not(.eyebrow) {
  max-width: 680px;
}

.obliterated-banner {
  width: min(100%, 720px);
  margin: 6px 0 22px;
  padding: 18px 20px;
  color: #fff;
  background:
    linear-gradient(135deg, #101827 0%, #17243a 52%, #6f1010 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(16, 24, 39, 0.22);
  position: relative;
  overflow: hidden;
  contain: paint;
}

.obliterated-banner::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 124px;
  height: 124px;
  border: 22px solid rgba(255, 223, 128, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.banner-kicker,
.banner-title,
.banner-subtitle {
  display: block;
  position: relative;
  z-index: 1;
}

.banner-stack {
  display: inline-block;
  position: relative;
  z-index: 1;
}

.banner-kicker {
  color: #ffdf80;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
}

.banner-title {
  margin-top: 3px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.92;
  font-weight: 900;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  letter-spacing: -0.01em;
  -webkit-text-stroke: 2px currentColor;
  font-stretch: 125%;
}

.banner-subtitle {
  margin-top: 8px;
  color: #f4d6d6;
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 900;
  text-transform: uppercase;
  text-align: justify;
  text-align-last: justify;
  display: block;
  white-space: nowrap;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 12px;
  color: var(--chip-ink);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.source-badge:hover,
.source-badge:focus-visible {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--chip-bg) 70%, var(--blue) 12%);
  border-color: color-mix(in srgb, var(--chip-border) 60%, var(--blue) 40%);
  box-shadow: 0 6px 18px rgba(38, 103, 255, 0.18);
  outline: none;
}

.source-badge-icon {
  flex: 0 0 auto;
  display: block;
}

.source-badge-arrow {
  flex: 0 0 auto;
  opacity: 0.55;
  transition: transform 160ms ease, opacity 160ms ease;
}

.source-badge:hover .source-badge-arrow,
.source-badge:focus-visible .source-badge-arrow {
  transform: translate(2px, -2px);
  opacity: 1;
}

.source-badge--repo {
  color: #f5f7fb;
  background: #1f2937;
  border-color: #374151;
}

.source-badge--repo:hover,
.source-badge--repo:focus-visible {
  background: #111827;
  border-color: #4b5563;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.summary-panel {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  grid-template-rows: minmax(96px, 1fr) repeat(3, auto) minmax(86px, 0.9fr);
  align-content: stretch;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 12%, color-mix(in srgb, var(--blue), transparent 84%) 0 86px, transparent 87px),
    radial-gradient(circle at 18% 88%, color-mix(in srgb, var(--amber), transparent 84%) 0 92px, transparent 93px),
    linear-gradient(145deg, var(--panel), var(--panel-soft));
}

.summary-panel::before,
.summary-panel::after {
  content: "";
  display: block;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  opacity: 0.96;
}

.summary-panel::before {
  background:
    radial-gradient(circle at 21% 58%, var(--blue) 0 7px, transparent 8px),
    radial-gradient(circle at 50% 38%, var(--red) 0 7px, transparent 8px),
    radial-gradient(circle at 78% 64%, var(--amber) 0 7px, transparent 8px),
    linear-gradient(23deg, transparent 0 23%, color-mix(in srgb, var(--blue), transparent 72%) 23.4% 24.4%, transparent 24.8% 100%),
    linear-gradient(151deg, transparent 0 44%, color-mix(in srgb, var(--red), transparent 72%) 44.4% 45.4%, transparent 45.8% 100%),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--ink), transparent 92%) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--ink), transparent 93%) 0 1px, transparent 1px 28px),
    color-mix(in srgb, var(--panel-tint), var(--panel) 42%);
}

.summary-panel::after {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--blue), transparent 44%) 0 22%, transparent 22% 100%),
    linear-gradient(90deg, transparent 0 27%, color-mix(in srgb, var(--red), transparent 38%) 27% 62%, transparent 62% 100%),
    linear-gradient(90deg, transparent 0 66%, color-mix(in srgb, var(--amber), transparent 34%) 66% 100%),
    radial-gradient(circle at 21% 50%, color-mix(in srgb, var(--blue), transparent 70%) 0 28px, transparent 29px),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--red), transparent 70%) 0 28px, transparent 29px),
    radial-gradient(circle at 79% 50%, color-mix(in srgb, var(--amber), transparent 70%) 0 28px, transparent 29px),
    linear-gradient(180deg, color-mix(in srgb, var(--panel), transparent 8%), color-mix(in srgb, var(--panel-soft), transparent 4%));
}

.summary-row {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 104px;
  padding: 16px 16px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72), rgba(255,255,255,0)),
    var(--panel-soft);
  overflow: hidden;
  isolation: isolate;
}

.summary-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--blue);
}

.summary-row::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -34px;
  width: 120px;
  height: 120px;
  border: 18px solid color-mix(in srgb, var(--blue), transparent 78%);
  border-radius: 50%;
  z-index: -1;
}

.summary-critical::before {
  background: var(--red);
}

.summary-critical::after {
  border-color: color-mix(in srgb, var(--red), transparent 78%);
}

.summary-zero::before {
  background: var(--amber);
}

.summary-zero::after {
  border-color: color-mix(in srgb, var(--amber), transparent 78%);
}

.summary-copy {
  display: grid;
  gap: 5px;
  overflow-wrap: anywhere;
}

.summary-copy strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}

.summary-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.summary-number {
  color: var(--blue);
  font-size: 46px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.summary-critical .summary-number {
  color: var(--red);
}

.summary-zero .summary-number {
  color: var(--amber);
}

body.theme-dark .summary-row {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0)),
    var(--panel-soft);
}

body.theme-dark .summary-panel {
  background:
    radial-gradient(circle at 78% 12%, color-mix(in srgb, var(--blue), transparent 88%) 0 86px, transparent 87px),
    radial-gradient(circle at 18% 88%, color-mix(in srgb, var(--amber), transparent 88%) 0 92px, transparent 93px),
    linear-gradient(145deg, var(--panel), var(--panel-soft));
}

.explain-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-top: 18px;
  padding: 24px;
  min-height: 1400px;
}

.explain-strip h2 {
  font-size: 24px;
}

.explain-strip p {
  text-align: justify;
  text-align-last: left;
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  overflow-wrap: break-word;
}

.block-justified {
  display: block;
  text-align: justify;
  text-align-last: left;
}

.hard-claim {
  display: block;
  margin-top: 14px;
  padding: 16px 18px;
  color: #6f1010;
  background: #fff0f0;
  border: 2px solid var(--red);
  border-left-width: 8px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(201, 54, 54, 0.16);
  font-weight: 950;
  text-align: center;
  text-align-last: center;
  text-wrap: balance;
}

.hard-claim.final-claim {
  margin-top: 12px;
  padding: clamp(12px, 2.5vw, 22px) clamp(14px, 3vw, 26px);
  font-size: clamp(22px, 4.5vw, 38px);
  letter-spacing: 0.02em;
  border-left-width: 8px;
  box-shadow: 0 14px 34px rgba(201, 54, 54, 0.28);
  word-break: break-word;
}

.explain-note {
  display: block;
  margin-top: 22px;
  margin-bottom: 18px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--line), transparent 18%);
  font-size: 13px;
  line-height: 1.72;
  color: var(--muted);
  max-width: 100%;
}

.explain-note-index {
  display: inline-block;
  margin-right: 6px;
  font-size: 11px;
  font-weight: 800;
  vertical-align: super;
  transform: translateY(-1px);
}

body.theme-dark .hard-claim {
  color: #ffdede;
  background: #35151a;
  border-color: #ff6b6b;
}

body.theme-contrast .hard-claim {
  color: #080a0f;
  background: #fff1a8;
  border-color: #b00020;
}

.person-name {
  font-weight: 900;
  color: var(--red);
  background: color-mix(in srgb, var(--red) 12%, transparent);
  padding: 2px 4px;
  border-radius: 4px;
}

body.theme-dark .person-name {
  color: #ff9999;
  background: color-mix(in srgb, #ff6b6b 16%, transparent);
}

body.theme-contrast .person-name {
  color: #b00020;
  background: #fff1a8;
}

body.theme-paper .person-name {
  color: #a53b2e;
  background: color-mix(in srgb, var(--red) 14%, transparent);
}

body.theme-ocean .person-name {
  color: #d64654;
  background: color-mix(in srgb, #d64654 14%, transparent);
}

body.theme-forest .person-name {
  color: #c1483f;
  background: color-mix(in srgb, #c1483f 12%, transparent);
}

body.theme-ruby .person-name {
  color: #ff6b7a;
  background: color-mix(in srgb, #ff6b7a 14%, transparent);
}

.explain-footnote {
  font-size: 0.82em;
  font-style: italic;
  opacity: 0.85;
  margin-top: 8px;
}

body.theme-dark .explain-note {
  color: #b6c0d2;
}

.mini-legend {
  display: grid;
  gap: 9px;
  min-width: 150px;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: -1px;
}

.critical {
  background: var(--red);
}

.high {
  background: var(--amber);
}

.medium {
  background: var(--violet);
}

.section-block {
  margin-top: 18px;
  padding: 24px;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 18px;
}

.flow-lab {
  display: grid;
  gap: 14px;
}

.flow-diagram {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.flow-step {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-height: 168px;
  padding: 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(24, 33, 47, 0.06);
}

.flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
  opacity: 0.72;
}

.flow-step.active {
  border-color: var(--blue);
  background: var(--chip-bg);
  box-shadow: 0 0 0 3px rgba(38, 103, 255, 0.12), 0 10px 22px rgba(38, 103, 255, 0.12);
}

.flow-icon {
  display: grid;
  place-items: center;
  height: 68px;
}

.flow-icon svg {
  width: 112px;
  height: 74px;
}

.flow-copy {
  align-self: start;
  padding-right: 20px;
}

.flow-step strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.flow-step span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.flow-detail {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-ink);
}

.flow-detail p {
  color: #cbd6e6;
}

.flow-detail code {
  color: #ffdf80;
  white-space: normal;
  overflow-wrap: anywhere;
}

.flow-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.flow-detail-card {
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.flow-detail-card strong {
  display: block;
  margin-bottom: 5px;
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.related-list span {
  padding: 3px 7px;
  border-radius: 5px;
  background: #ffdf80;
  color: #101827;
  font-weight: 900;
  font-size: 12px;
}

.toolbar,
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn,
.mode-btn {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.filter-btn--severity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-btn--severity .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}

.filter-btn--severity .dot.critical { background: var(--red); }
.filter-btn--severity .dot.high { background: var(--amber); }
.filter-btn--severity .dot.medium { background: var(--blue); }

.filter-btn.active,
.mode-btn.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.filter-btn--severity.active[data-filter="Kritická"] {
  background: var(--red);
  border-color: var(--red);
}

.filter-btn--severity.active[data-filter="Vysoká"] {
  background: var(--amber);
  border-color: var(--amber);
}

.filter-btn--severity.active[data-filter="Střední"] {
  background: var(--blue);
  border-color: var(--blue);
}

.filter-btn--severity.active .dot {
  background: #ffffff !important;
}

.problem-grid {
  display: grid;
  gap: 12px;
}

.problem-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.problem-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 15px;
  border: 0;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.problem-id {
  padding: 5px 8px;
  border-radius: 6px;
  color: #fff;
  background: var(--code-bg);
  font-weight: 900;
  font-size: 12px;
}

.severity {
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
}

.severity.Kritická {
  background: var(--red);
}

.severity.Vysoká {
  background: var(--amber);
}

.severity.Střední {
  background: var(--violet);
}

.problem-body {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
  gap: 12px;
  padding: 0 15px 16px;
}

.problem-card.open .problem-body {
  display: grid;
}

.plain-box,
.code-box,
.visual-box,
.meaning-box {
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.plain-box {
  background: #fffdf5;
  border-left: 5px solid #f0c46f;
}

.meaning-box {
  background: var(--panel-tint);
  border-left: 5px solid #9cc8ff;
}

.code-box {
  background: var(--code-bg);
  color: var(--code-ink);
}

.plain-box p,
.meaning-box p,
.visual-box p {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.65;
}

.code-box p,
.code-box li {
  color: #d7e2f2;
}

.code-box li {
  margin-bottom: 8px;
}

.code-box code {
  color: #ffdf80;
  overflow-wrap: anywhere;
}

.visual-box {
  background: var(--panel-soft);
  border-left: 5px solid #b8c3d5;
}

.visual-box svg {
  display: block;
  width: 100%;
  margin-top: 12px;
  overflow: visible;
}

.visual-box svg .panel-label {
  fill: var(--ink);
}

.visual-box svg .panel-muted-stroke {
  stroke: var(--muted);
}

.body-stack {
  display: grid;
  gap: 12px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: center;
}

.two-column > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.two-column > div:first-child {
  overflow: hidden;
}

.range-label {
  display: block;
  margin-top: 18px;
  font-weight: 900;
}

input[type="range"] {
  display: block;
  width: calc(100% - 8px);
  max-width: calc(100% - 8px);
  accent-color: var(--blue);
}

.range-readout {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.projection-card,
.eclipse-demo {
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.projection-visual {
  min-height: 210px;
}

.projection-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-pill {
  padding: 10px;
  border-radius: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.stat-pill strong {
  display: block;
  font-size: 20px;
}

.eclipse-stage {
  display: grid;
  gap: 12px;
}

.eclipse-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.status-ok {
  background: var(--green);
}

.status-bad {
  background: var(--red);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.glossary-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.audit-footer {
  margin: 12px 0 34px;
  padding: 22px 12px 6px;
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  text-align: center;
}

.audit-footer-line {
  margin: 0;
  color: var(--ink);
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.audit-footer-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

body.theme-dark .plain-box {
  background: #302719;
  border-left-color: #f1b64c;
}

body.theme-dark .meaning-box {
  background: #102235;
  border-left-color: #77a2ff;
}

body.theme-dark .visual-box {
  border-left-color: #61718d;
}

body.theme-contrast .plain-box {
  background: #fff7d1;
  border-left-color: #9b5400;
}

svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .app-shell:has(.sidebar--rail:hover),
  .app-shell:has(.sidebar--rail.is-pinned),
  .app-shell:has(.sidebar--rail:focus-within) {
    display: block;
  }

  .sidebar,
  .sidebar--rail,
  .sidebar--rail:hover,
  .sidebar--rail.is-pinned,
  .sidebar--rail:focus-within {
    position: static;
    height: auto;
    width: 100%;
    overflow: visible;
    padding: 16px;
    box-shadow: none;
  }

  .sidebar--rail .nav-text,
  .sidebar--rail .brand-block > div:last-child,
  .sidebar--rail .sidebar-repo span,
  .sidebar--rail .sidebar-tag,
  .sidebar--rail .nav-timeline-label {
    opacity: 1;
    max-width: none;
    height: auto;
    margin: initial;
    white-space: normal;
    pointer-events: auto;
  }

  .sidebar-pin {
    display: none !important;
  }

  .nav-timeline ol {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 4px;
  }

  .nav-timeline ol::before {
    display: none;
  }

  .nav-meta {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  main {
    width: 100%;
    padding: 16px;
  }

  .intro-grid,
  .explain-strip,
  .two-column,
  .problem-body {
    grid-template-columns: 1fr;
  }

  .glossary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .flow-diagram {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .flow-step {
    grid-template-columns: 110px 1fr;
    grid-template-rows: auto;
    min-height: 136px;
    align-items: center;
  }

  .flow-step:not(:last-child)::after {
    content: "↓";
    right: 12px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    font-size: 22px;
  }

  .flow-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  h2 {
    font-size: 27px;
  }

  .intro-copy h2 {
    font-size: clamp(22px, 8.8vw, 36px);
    line-height: 1.04;
    overflow-wrap: anywhere;
  }

  .obliterated-banner {
    padding: 14px 16px;
  }

  .banner-title {
    font-size: clamp(24px, 10.8vw, 42px);
    -webkit-text-stroke: 1px currentColor;
  }

  .banner-subtitle {
    width: auto !important;
    max-width: 100%;
    font-size: 13px;
    white-space: normal;
    text-align: left;
    text-align-last: left;
    line-height: 1.15;
  }

  .topbar {
    gap: 10px;
    padding: 9px 12px;
  }

  .topbar-brand {
    gap: 8px;
  }

  .topbar-brand .brand-mark,
  .theme-cycle,
  .lang-cycle,
  .topbar-burger {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .topbar-brand-text h1 {
    font-size: 13px;
  }

  .intro-copy,
  .section-block,
  .explain-strip {
    padding: 18px;
  }

  .source-links {
    flex-direction: column;
  }

  .source-badge {
    width: 100%;
    justify-content: space-between;
  }

  .glossary-grid,
  .projection-stats {
    grid-template-columns: 1fr;
  }

  .problem-head {
    grid-template-columns: 1fr;
  }
}
