:root {
  color-scheme: light;
  --app-bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --sidebar-bg: #ffffff;
  --sidebar-panel: #ffffff;
  --sidebar-text: #101217;
  --sidebar-muted: #6d7280;
  --sidebar-line: #eef0f4;
  --sidebar-hover: #f2f7ff;
  --ink: #111318;
  --muted: #6b6f7b;
  --line: #edf0f4;
  --line-strong: #d8dde6;
  --accent: #087df4;
  --accent-strong: #006fe8;
  --accent-soft: #edf5ff;
  --active-bg: #087df4;
  --active-text: #ffffff;
  --warm: #0f72df;
  --gold: #087df4;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --sidebar-width: 336px;
  --sidebar-collapsed-width: 72px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #0f1117;
  --surface: #171923;
  --surface-soft: #202433;
  --sidebar-bg: #11141d;
  --sidebar-panel: #171923;
  --sidebar-text: #f5f7fb;
  --sidebar-muted: #b7bfce;
  --sidebar-line: #272d3c;
  --sidebar-hover: #202738;
  --ink: #f6f7fb;
  --muted: #b8becc;
  --line: #2a3040;
  --line-strong: #40495f;
  --accent: #1688ff;
  --accent-strong: #5cb0ff;
  --accent-soft: #14263d;
  --active-bg: #1688ff;
  --active-text: #ffffff;
  --warm: #5cb0ff;
  --gold: #1688ff;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

body.admin-page {
  --app-bg: #008080;
  --surface: #c0c0c0;
  --surface-soft: #d4d0c8;
  --sidebar-bg: #c0c0c0;
  --sidebar-panel: #d4d0c8;
  --sidebar-text: #000000;
  --sidebar-muted: #000080;
  --sidebar-line: #808080;
  --sidebar-hover: #000080;
  --ink: #000000;
  --muted: #404040;
  --line: #808080;
  --line-strong: #404040;
  --accent: #000080;
  --accent-strong: #000080;
  --accent-soft: #d4d0c8;
  --active-bg: #000080;
  --active-text: #ffffff;
  --warm: #000080;
  --gold: #000080;
  --shadow: none;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--app-bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 160ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 28px 18px;
  overflow: auto;
  border-right: 1px solid var(--sidebar-line);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}

.sidebar-overlay {
  display: none;
}

body.sidebar-collapsed .sidebar {
  align-items: center;
  gap: 14px;
  padding: 22px 10px;
  overflow: hidden;
}

body.sidebar-collapsed .brand {
  grid-template-columns: 48px;
  justify-content: center;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .knowledge-base-switcher,
body.sidebar-collapsed .search-field,
body.sidebar-collapsed .category-nav {
  display: none;
}

.brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 52px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--sidebar-line);
  border-radius: 6px;
  background: var(--sidebar-panel);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-copy p,
.brand-copy h1 {
  margin: 0;
}

.brand-copy p {
  color: var(--sidebar-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-copy h1 {
  margin-top: 3px;
  color: var(--sidebar-text);
  font-size: 1rem;
  line-height: 1.2;
}

.knowledge-base-switcher {
  display: block;
}

.knowledge-base-field {
  display: grid;
  gap: 7px;
}

.knowledge-base-field span {
  color: var(--sidebar-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.knowledge-base-field select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  outline: none;
  background: var(--sidebar-panel);
  color: var(--sidebar-text);
  font-weight: 700;
  appearance: auto;
}

.knowledge-base-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.search-field {
  position: relative;
  display: block;
}

.search-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  outline: none;
  background: var(--sidebar-panel);
  color: var(--sidebar-text);
}

.search-field input::placeholder {
  color: var(--sidebar-muted);
}

.search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--sidebar-muted);
  border-radius: 50%;
  transform: translateY(-50%);
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--sidebar-muted);
  content: "";
  transform: rotate(45deg);
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
}

.category-group {
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  background: var(--sidebar-panel);
}

.category-toggle {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  text-align: left;
}

.category-toggle:hover,
.category-toggle:focus-visible {
  background: var(--sidebar-hover);
  outline: none;
}

.chevron {
  width: 8px;
  height: 8px;
  margin-left: 3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: var(--sidebar-muted);
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.category-group.is-open .chevron {
  transform: rotate(45deg);
}

.category-name {
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  min-width: 28px;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}

.article-list {
  display: none;
  margin: 0;
  padding: 2px 8px 10px 36px;
  list-style: none;
}

.category-group.is-open .article-list {
  display: block;
}

.article-list li + li {
  margin-top: 4px;
}

.article-link {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-muted);
  line-height: 1.25;
  text-align: left;
}

.article-link:hover,
.article-link:focus-visible {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
  outline: none;
}

.article-link.is-active {
  background: var(--active-bg);
  color: var(--active-text);
  font-weight: 760;
}

.nav-empty {
  padding: 14px 12px;
  border: 1px dashed var(--sidebar-line);
  border-radius: 8px;
  color: var(--sidebar-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.content-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 68px;
  padding: 12px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--app-bg);
}

.topbar-status {
  overflow: hidden;
  padding: 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.language-switch {
  display: inline-flex;
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.language-option {
  min-width: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 820;
}

.language-option:hover,
.language-option:focus-visible {
  background: var(--surface-soft);
  color: var(--ink);
  outline: none;
}

.language-option.is-active {
  background: var(--accent);
  color: #ffffff;
}

.admin-toggle,
.admin-button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 780;
}

.admin-toggle:hover,
.admin-toggle:focus-visible,
.admin-button:hover,
.admin-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  outline: none;
}

.admin-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.admin-button.primary:hover,
.admin-button.primary:focus-visible {
  background: var(--accent-strong);
}

.admin-button.secondary {
  color: var(--accent);
}

.admin-button.danger {
  border-color: #db3b3b;
  color: #db3b3b;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  outline: none;
}

.menu-button {
  display: grid;
}

.menu-icon,
.theme-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.menu-icon {
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.menu-icon::before {
  position: absolute;
  top: 7px;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  content: "";
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 12px 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 720;
}

.theme-switch:hover,
.theme-switch:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  outline: none;
}

.theme-switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
}

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 160ms ease;
}

:root[data-theme="dark"] .theme-switch-thumb {
  transform: translateX(16px);
}

.theme-switch-label {
  min-width: 34px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: left;
}

.article-view {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 32px 32px 72px;
  outline: none;
}

.article-hero {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.article-hero-image,
.article-hero-fallback {
  width: 156px;
  height: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.article-hero-image {
  display: block;
  object-fit: cover;
}

.article-hero-fallback {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 850;
}

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 720;
}

.article-kicker span {
  display: inline-flex;
  align-items: center;
}

.article-kicker span + span::before {
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.article-view h1 {
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.85rem, 3.5vw, 2.55rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: 0;
}

.article-summary {
  max-width: 100%;
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.hero-action {
  min-height: 58px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 760;
}

.hero-action.primary {
  background: var(--accent);
  color: #ffffff;
}

.hero-action.secondary {
  background: var(--surface);
  color: var(--accent);
}

.hero-action:hover,
.hero-action:focus-visible {
  border-color: var(--accent-strong);
  outline: none;
}

.hero-action.primary:hover,
.hero-action.primary:focus-visible {
  background: var(--accent-strong);
}

.hero-action.secondary:hover,
.hero-action.secondary:focus-visible {
  background: var(--accent-soft);
}

.article-figure,
.content-figure {
  margin: 28px 0 0;
}

.article-figure img,
.content-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.article-figure figcaption,
.content-figure figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.pill.status {
  border-color: var(--accent);
  color: var(--accent);
}

.article-body {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.article-body h2 {
  margin: 34px 0 16px;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0;
}

.article-body h3 {
  margin: 28px 0 10px;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.article-body p,
.article-body li {
  color: color-mix(in srgb, var(--ink), var(--muted) 20%);
  font-size: 1.03rem;
  line-height: 1.62;
}

.article-body p {
  margin: 0 0 16px;
}

.article-body ol,
.article-body ul {
  margin: 0 0 20px;
  padding-left: 24px;
}

.article-body ol {
  position: relative;
  padding-left: 54px;
  list-style: none;
  counter-reset: step-list;
}

.article-body ol::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 14px;
  width: 3px;
  border-radius: 99px;
  background: var(--accent);
  content: "";
}

.article-body ol li {
  position: relative;
  min-height: 42px;
  counter-increment: step-list;
}

.article-body ol li::before {
  position: absolute;
  top: 2px;
  left: -54px;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  content: counter(step-list);
  font-size: 0.8rem;
  font-weight: 800;
}

.article-body li + li {
  margin-top: 7px;
}

.article-body ol li + li {
  margin-top: 20px;
}

.steps-carousel {
  margin: 8px 0 30px;
}

.steps-carousel-frame {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.step-slide {
  margin: 0;
}

.step-slide[hidden] {
  display: none;
}

.step-media {
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.step-media img {
  display: block;
  width: 100%;
  height: min(34vw, 280px);
  min-height: 210px;
  object-fit: contain;
}

.step-media figcaption {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.step-media-fallback {
  display: grid;
  min-height: 230px;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
}

.step-media-fallback span {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 2rem;
  font-weight: 850;
}

.step-slide-copy {
  padding: 20px 22px 24px;
}

.article-body .step-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 820;
  line-height: 1.3;
}

.article-body .step-slide-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 850;
  line-height: 1.25;
}

.steps-carousel-footer {
  display: grid;
  grid-template-columns: minmax(112px, auto) minmax(0, 1fr) minmax(112px, auto);
  gap: 14px;
  align-items: center;
  margin-top: 16px;
}

.step-nav-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 780;
}

.step-nav-button.primary {
  background: var(--accent);
  color: #ffffff;
}

.step-nav-button:hover,
.step-nav-button:focus-visible {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  outline: none;
}

.step-nav-button.primary:hover,
.step-nav-button.primary:focus-visible {
  background: var(--accent-strong);
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.step-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line-strong);
}

.step-dot.is-active {
  width: 24px;
  border-radius: 999px;
  background: var(--accent);
}

.article-body code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.94em;
}

.related-panel {
  margin-top: 44px;
  padding-top: 0;
  border-top: 1px solid var(--line);
}

.related-panel h2 {
  margin: 30px 0 16px;
  font-size: 1.55rem;
  font-weight: 850;
  letter-spacing: 0;
}

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

.related-link {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.related-link:hover,
.related-link:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.related-title {
  font-weight: 760;
  line-height: 1.32;
}

.related-category {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.admin-view {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.admin-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.admin-project-panel {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-project-panel h2,
.admin-project-panel p {
  margin: 0;
}

.admin-project-panel h2 {
  margin-top: 3px;
  font-size: 1.05rem;
}

.admin-project-panel p:last-child {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.admin-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-header h1,
.admin-editor h2,
.admin-empty h2 {
  margin: 0;
  color: var(--ink);
  font-weight: 850;
  letter-spacing: 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.file-button {
  display: inline-flex;
  align-items: center;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 24px;
}

.admin-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.admin-list-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-article-list {
  max-height: calc(100vh - 250px);
  overflow: auto;
}

.admin-article-row {
  display: grid;
  width: 100%;
  gap: 7px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.admin-article-row:last-child {
  border-bottom: 0;
}

.admin-article-row:hover,
.admin-article-row:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.admin-article-row.is-active {
  background: var(--accent-soft);
}

.admin-row-title {
  overflow: hidden;
  font-weight: 790;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.admin-row-meta span {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.admin-editor-shell,
.admin-editor,
.admin-empty {
  min-width: 0;
}

.admin-editor {
  display: grid;
  gap: 22px;
}

.admin-editor-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 780;
}

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

.admin-section-heading {
  display: grid;
  gap: 3px;
}

.admin-section-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 850;
}

.step-screenshot-editor {
  display: grid;
  gap: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.step-screenshot-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.step-screenshot-label {
  min-width: 0;
}

.step-screenshot-label span {
  display: block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.step-screenshot-label p,
.admin-helper {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.admin-field-wide {
  grid-column: 1 / -1;
}

.admin-editor label,
.translation-editor label,
.step-screenshot-row label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.admin-editor label span,
.translation-editor label span,
.step-screenshot-row label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 790;
}

.admin-editor input[type="text"],
.admin-editor input[type="number"],
.admin-editor input[type="date"],
.admin-editor textarea,
.add-language input,
.step-screenshot-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.admin-editor input[type="text"],
.admin-editor input[type="number"],
.admin-editor input[type="date"],
.add-language input,
.step-screenshot-row input {
  min-height: 42px;
  padding: 0 11px;
}

.admin-editor textarea {
  min-height: 88px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.45;
}

.admin-editor input:focus,
.admin-editor textarea:focus,
.add-language input:focus,
.step-screenshot-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.admin-editor input[readonly] {
  color: var(--muted);
}

.translation-editor {
  display: grid;
  gap: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.translation-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.translation-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.translation-tab {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 830;
}

.translation-tab:hover,
.translation-tab:focus-visible {
  background: var(--surface-soft);
  color: var(--ink);
  outline: none;
}

.translation-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.add-language {
  display: grid;
  grid-template-columns: 78px 88px auto;
  gap: 8px;
}

.admin-save-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-empty,
.empty-state {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 30px 0;
}

.admin-empty p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-view {
  display: grid;
  min-height: calc(100vh - 180px);
  align-items: start;
  padding-top: 26px;
}

.auth-panel {
  width: min(100%, 460px);
}

.auth-panel h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  font-weight: 850;
  line-height: 1.08;
}

.auth-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 790;
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid #db3b3b;
  border-radius: 8px;
  background: color-mix(in srgb, #db3b3b, transparent 90%);
  color: #db3b3b;
  font-weight: 760;
}

body.admin-page .sidebar,
body.admin-page .topbar,
body.admin-page .auth-panel,
body.admin-page .admin-list,
body.admin-page .admin-editor,
body.admin-page .admin-project-panel,
body.admin-page .admin-empty {
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  border-radius: 0;
  background: #c0c0c0;
  box-shadow: 1px 1px 0 #000000;
}

body.admin-page .sidebar {
  border-width: 0 2px 0 0;
  border-color: #ffffff #404040 #404040 #ffffff;
}

body.admin-page .topbar {
  border-width: 0 0 2px;
  border-color: #ffffff #404040 #404040 #ffffff;
}

body.admin-page .article-view {
  width: min(100%, 1240px);
}

body.admin-page .auth-panel,
body.admin-page .admin-editor,
body.admin-page .admin-project-panel,
body.admin-page .admin-empty {
  padding: 18px;
}

body.admin-page .admin-header,
body.admin-page .admin-list-header,
body.admin-page .admin-editor-top {
  padding: 8px 10px;
  border: 0;
  background: #000080;
  color: #ffffff;
}

body.admin-page .admin-header h1,
body.admin-page .admin-editor h2,
body.admin-page .admin-header .admin-kicker,
body.admin-page .admin-editor-top .admin-kicker {
  color: #ffffff;
}

body.admin-page .admin-header {
  align-items: center;
  margin-bottom: 16px;
}

body.admin-page .admin-layout {
  gap: 14px;
  margin-top: 0;
}

body.admin-page .brand-mark,
body.admin-page .category-group,
body.admin-page .step-screenshot-row,
body.admin-page .language-switch,
body.admin-page .theme-switch,
body.admin-page .icon-button,
body.admin-page .admin-toggle,
body.admin-page .admin-button,
body.admin-page .translation-tab,
body.admin-page .visibility-toggle,
body.admin-page .admin-row-meta span {
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  border-radius: 0;
  background: #c0c0c0;
  color: #000000;
  box-shadow: none;
}

body.admin-page .admin-button.primary,
body.admin-page .admin-button.secondary,
body.admin-page .admin-toggle,
body.admin-page .translation-tab {
  color: #000000;
}

body.admin-page .admin-button.danger {
  border-color: #ffffff #404040 #404040 #ffffff;
  color: #800000;
}

body.admin-page .admin-button:hover,
body.admin-page .admin-button:focus-visible,
body.admin-page .admin-toggle:hover,
body.admin-page .admin-toggle:focus-visible,
body.admin-page .icon-button:hover,
body.admin-page .icon-button:focus-visible,
body.admin-page .theme-switch:hover,
body.admin-page .theme-switch:focus-visible,
body.admin-page .translation-tab:hover,
body.admin-page .translation-tab:focus-visible,
body.admin-page .language-option:hover,
body.admin-page .language-option:focus-visible {
  background: #d4d0c8;
  outline: 1px dotted #000000;
  outline-offset: -5px;
}

body.admin-page .admin-button:active,
body.admin-page .admin-toggle:active,
body.admin-page .icon-button:active,
body.admin-page .theme-switch:active,
body.admin-page .translation-tab:active,
body.admin-page .language-option:active {
  border-color: #404040 #ffffff #ffffff #404040;
}

body.admin-page .language-option {
  border-radius: 0;
}

body.admin-page .language-option.is-active,
body.admin-page .translation-tab.is-active,
body.admin-page .article-link.is-active,
body.admin-page .admin-article-row.is-active {
  background: #000080;
  color: #ffffff;
}

body.admin-page .search-field input,
body.admin-page .knowledge-base-field select,
body.admin-page .auth-form input,
body.admin-page .admin-editor input[type="text"],
body.admin-page .admin-editor input[type="number"],
body.admin-page .admin-editor input[type="date"],
body.admin-page .admin-editor textarea,
body.admin-page .add-language input,
body.admin-page .step-screenshot-row input {
  border: 2px solid;
  border-color: #404040 #ffffff #ffffff #404040;
  border-radius: 0;
  background: #ffffff;
  color: #000000;
  box-shadow: none;
}

body.admin-page .search-field input:focus,
body.admin-page .knowledge-base-field select:focus,
body.admin-page .auth-form input:focus,
body.admin-page .admin-editor input:focus,
body.admin-page .admin-editor textarea:focus,
body.admin-page .add-language input:focus,
body.admin-page .step-screenshot-row input:focus {
  border-color: #000000 #ffffff #ffffff #000000;
  box-shadow: none;
}

body.admin-page .category-toggle,
body.admin-page .article-link,
body.admin-page .admin-article-row {
  border-radius: 0;
}

body.admin-page .category-toggle:hover,
body.admin-page .category-toggle:focus-visible,
body.admin-page .article-link:hover,
body.admin-page .article-link:focus-visible,
body.admin-page .admin-article-row:hover,
body.admin-page .admin-article-row:focus-visible {
  background: #000080;
  color: #ffffff;
}

body.admin-page .category-count,
body.admin-page .pill,
body.admin-page .auth-error {
  border-radius: 0;
}

body.admin-page .theme-switch-track {
  border: 2px solid;
  border-color: #404040 #ffffff #ffffff #404040;
  border-radius: 0;
  background: #ffffff;
}

body.admin-page .theme-switch-thumb {
  border-radius: 0;
  background: #000080;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .related-grid {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-article-list {
    max-height: 320px;
  }

  .step-screenshot-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: min(88vw, 336px);
    transform: translateX(-102%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  body.sidebar-collapsed .sidebar {
    align-items: stretch;
    gap: 18px;
    width: min(88vw, 336px);
    padding: 28px 18px;
    overflow: auto;
  }

  body.sidebar-collapsed .brand {
    grid-template-columns: 48px minmax(0, 1fr);
    justify-content: stretch;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .knowledge-base-switcher,
  body.sidebar-collapsed .search-field,
  body.sidebar-collapsed .category-nav {
    display: block;
  }

  body.sidebar-collapsed .category-nav {
    display: flex;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: none;
    background: rgba(12, 15, 13, 0.42);
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .menu-button {
    display: grid;
  }

  .article-view {
    padding: 40px 24px 64px;
  }

  .admin-header,
  .translation-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-project-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-actions {
    justify-content: flex-start;
  }

}

@media (max-width: 620px) {
  .topbar {
    min-height: 58px;
    padding: 9px 16px;
  }

  .topbar-status {
    padding: 0 10px;
    font-size: 0.84rem;
  }

  .topbar-actions {
    gap: 7px;
  }

  .language-option {
    min-width: 36px;
    padding: 0 8px;
  }

  .theme-switch-label {
    display: none;
  }

  .article-view {
    padding: 28px 20px 56px;
  }

  .article-hero {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
  }

  .article-hero-image,
  .article-hero-fallback {
    width: 112px;
    height: 112px;
  }

  .article-view h1 {
    font-size: clamp(1.35rem, 7vw, 1.9rem);
  }

  .article-summary {
    font-size: 0.94rem;
  }

  .article-meta {
    gap: 6px;
    margin-top: 12px;
  }

  .pill {
    min-height: 25px;
    padding: 3px 7px;
    font-size: 0.76rem;
  }

  .hero-actions {
    gap: 12px;
    margin-top: 24px;
  }

  .hero-action {
    min-height: 54px;
    font-size: 0.98rem;
  }

  .article-body {
    margin-top: 32px;
  }

  .article-body ol {
    padding-left: 48px;
  }

  .article-body ol li::before {
    left: -48px;
  }

  .step-media img {
    height: 220px;
    min-height: 220px;
  }

  .step-slide-copy {
    padding: 18px;
  }

  .steps-carousel-footer {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .step-dots {
    grid-column: 1 / -1;
    order: -1;
  }

  .step-nav-button {
    min-height: 50px;
    padding: 0 12px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .add-language {
    grid-template-columns: 1fr;
  }

  .admin-editor-top,
  .admin-save-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 440px) {
  .article-hero {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
  }

  .article-hero-image,
  .article-hero-fallback {
    width: 92px;
    height: 92px;
  }

  .article-kicker {
    font-size: 0.74rem;
  }

  .article-summary {
    display: none;
  }
}
