/* Theme tokens */
:root,
[data-theme="slate"] {
  --sidebar-width: 280px;
  --sidebar-bg: #2c3e50;
  --sidebar-header-bg: #243342;
  --sidebar-text: #ecf0f1;
  --sidebar-muted: #95a5a6;
  --sidebar-link-hover-bg: rgba(255, 255, 255, 0.08);
  --sidebar-link-active: #fff;
  --sidebar-border: transparent;
  --sidebar-shadow: none;
  --brand-title: #fff;
  --accent: #3498db;
  --accent-soft: rgba(52, 152, 219, 0.12);
  --page-bg: #f7f8fa;
  --content-bg: #f7f8fa;
  --content-color: #2c3e50;
  --header-muted: #7f8c8d;
  --topbar-bg: #fff;
  --topbar-border: #e5e7eb;
  --image-border: #e5e7eb;
  --blockquote-color: #555;
  --search-bg: #fff;
  --search-border: #ced4da;
  --search-color: #212529;
  --close-btn-color: #adb5bd;
  --content-max: 800px;
  --theme-switcher-bg: rgba(255, 255, 255, 0.06);
  --theme-switcher-border: rgba(255, 255, 255, 0.12);
  --callout-note: #358c43;
  --callout-tip: #1f8ef1;
  --callout-important: #e67e22;
  --callout-warning: #e74c3c;
  --callout-example: #8e44ad;
  --callout-bg: rgba(0, 0, 0, 0.03);
  --callout-text: var(--content-color);
}

/* Original Jekyll Edition look — green brand */
[data-theme="classic"] {
  --sidebar-bg: #f5f5f5;
  --sidebar-header-bg: #358c43;
  --sidebar-text: #222;
  --sidebar-muted: #555;
  --sidebar-link-hover-bg: rgba(53, 140, 67, 0.1);
  --sidebar-link-active: #358c43;
  --sidebar-border: rgba(0, 0, 0, 0.06);
  --sidebar-shadow: inset -10px 0 10px -10px rgba(0, 0, 0, 0.1);
  --brand-title: #fff;
  --accent: #358c43;
  --accent-soft: rgba(53, 140, 67, 0.1);
  --page-bg: #2b2e31;
  --content-bg: #fff;
  --content-color: #222;
  --header-muted: #777;
  --topbar-bg: #f5f5f5;
  --topbar-border: #e0e0e0;
  --image-border: #e5e5e5;
  --blockquote-color: #555;
  --search-bg: #fff;
  --search-border: #ddd;
  --search-color: #222;
  --close-btn-color: #fff;
  --theme-switcher-bg: rgba(0, 0, 0, 0.04);
  --theme-switcher-border: rgba(0, 0, 0, 0.08);
  --callout-bg: #f7faf7;
  --callout-text: #222;
}

[data-theme="ocean"] {
  --sidebar-bg: #0f2744;
  --sidebar-header-bg: #0a1c31;
  --sidebar-text: #e8f1fa;
  --sidebar-muted: #8aa4bf;
  --sidebar-link-hover-bg: rgba(255, 255, 255, 0.08);
  --sidebar-link-active: #fff;
  --sidebar-border: transparent;
  --sidebar-shadow: none;
  --brand-title: #fff;
  --accent: #1f8ef1;
  --accent-soft: rgba(31, 142, 241, 0.14);
  --page-bg: #eef3f8;
  --content-bg: #eef3f8;
  --content-color: #1a2b3c;
  --header-muted: #6b7c8f;
  --topbar-bg: #fff;
  --topbar-border: #d7e0ea;
  --image-border: #d7e0ea;
  --blockquote-color: #4a5d70;
  --search-bg: #fff;
  --search-border: #b8c7d6;
  --search-color: #1a2b3c;
  --close-btn-color: #9db2c7;
  --theme-switcher-bg: rgba(255, 255, 255, 0.06);
  --theme-switcher-border: rgba(255, 255, 255, 0.12);
  --callout-bg: #f3f8fc;
  --callout-text: #1a2b3c;
}

[data-theme="dark"] {
  --sidebar-bg: #1a1d21;
  --sidebar-header-bg: #121418;
  --sidebar-text: #e6e8eb;
  --sidebar-muted: #8b929a;
  --sidebar-link-hover-bg: rgba(255, 255, 255, 0.06);
  --sidebar-link-active: #fff;
  --sidebar-border: #2a2f36;
  --sidebar-shadow: none;
  --brand-title: #fff;
  --accent: #3dd68c;
  --accent-soft: rgba(61, 214, 140, 0.12);
  --page-bg: #121418;
  --content-bg: #1a1d21;
  --content-color: #e6e8eb;
  --header-muted: #8b929a;
  --topbar-bg: #1a1d21;
  --topbar-border: #2a2f36;
  --image-border: #2a2f36;
  --blockquote-color: #aeb5bd;
  --search-bg: #24282e;
  --search-border: #3a4149;
  --search-color: #e6e8eb;
  --close-btn-color: #8b929a;
  --theme-switcher-bg: rgba(255, 255, 255, 0.04);
  --theme-switcher-border: rgba(255, 255, 255, 0.1);
  --callout-bg: rgba(255, 255, 255, 0.04);
  --callout-text: #e6e8eb;
}

body {
  font-family: "Open Sans", system-ui, sans-serif;
  background: var(--page-bg);
  color: var(--content-color);
}

.docs-shell {
  display: flex;
  min-height: 100vh;
  background: var(--content-bg);
}

.docs-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 0 0 1rem;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sidebar-shadow);
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  padding: 0.85rem 1rem;
  background: var(--sidebar-header-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  min-height: 60px;
}

.brand-title {
  color: var(--brand-title);
  font-weight: 700;
  font-size: 1.15rem;
}

.sidebar-search {
  padding: 0.85rem 0.75rem 0.5rem;
}

.sidebar-search .form-control {
  background: var(--search-bg);
  border-color: var(--search-border);
  color: var(--search-color);
}

.sidebar-search .form-control::placeholder {
  color: var(--sidebar-muted);
}

.sidebar-search .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem var(--accent-soft);
}

.sidebar-nav {
  padding: 0 0.5rem;
  flex: 1;
}

.sidebar-nav .nav-link {
  color: var(--sidebar-muted);
  border-radius: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.92rem;
}

.sidebar-nav .nav-link:hover {
  color: var(--sidebar-link-active);
  background: var(--sidebar-link-hover-bg);
}

.sidebar-nav .nav-link.active {
  color: var(--sidebar-link-active);
  background: var(--sidebar-link-hover-bg);
  font-weight: 600;
}

.nav-group {
  margin-top: 0.75rem;
}

.nav-group-title {
  display: block;
  color: var(--sidebar-text);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.65rem;
  text-decoration: none;
}

.nav-group-title:hover,
.nav-group-title.active {
  color: var(--accent);
}

.nav-group-items {
  padding-left: 0.25rem;
}

.theme-switcher {
  margin: 1rem 0.75rem 0;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--theme-switcher-bg);
  border: 1px solid var(--theme-switcher-border);
}

.theme-switcher-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sidebar-muted);
  margin-bottom: 0.45rem;
}

.theme-switcher-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.theme-btn {
  appearance: none;
  border: 1px solid var(--theme-switcher-border);
  background: transparent;
  color: var(--sidebar-text);
  border-radius: 0.35rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-btn:hover {
  background: var(--sidebar-link-hover-bg);
}

.theme-btn.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 600;
}

.theme-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.theme-dot[data-theme-preview="classic"] { background: #358c43; }
.theme-dot[data-theme-preview="slate"] { background: #2c3e50; }
.theme-dot[data-theme-preview="ocean"] { background: #1f8ef1; }
.theme-dot[data-theme-preview="dark"] { background: #3dd68c; }

#closeNav {
  color: var(--close-btn-color);
  border-color: currentColor;
}

.docs-main {
  flex: 1;
  min-width: 0;
  background: var(--content-bg);
}

.docs-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  color: var(--content-color);
}

.docs-content {
  max-width: calc(var(--content-max) + 4rem);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.docs-content:has(.home-page) {
  max-width: 960px;
}

.home-intro {
  margin-bottom: 1.5rem;
}

.home-intro h2:first-child {
  display: none; /* heading already in page header */
}

.home-search {
  margin: 0 0 2.25rem;
}

.home-section {
  margin-bottom: 2.5rem;
}

.home-section-head {
  margin-bottom: 1rem;
}

.home-section-title {
  font-family: Merriweather, Georgia, serif;
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
  color: var(--content-color);
}

.home-section-sub {
  margin: 0;
  color: var(--header-muted);
  font-size: 0.95rem;
}

.home-popular {
  display: grid;
  gap: 0.55rem;
}

.home-popular-link {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 0.55rem;
  text-decoration: none;
  color: inherit;
  background: var(--callout-bg, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--topbar-border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-popular-link:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  color: inherit;
}

.home-popular-rank {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.home-popular-title {
  display: block;
  font-weight: 600;
  color: var(--content-color);
}

.home-popular-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: var(--header-muted);
}

.home-sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.home-card {
  border: 1px solid var(--topbar-border);
  border-radius: 0.65rem;
  padding: 1.1rem 1.15rem 1.15rem;
  background: var(--content-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="classic"] .home-card {
  background: #fff;
}

[data-theme="dark"] .home-card {
  background: #24282e;
}

.home-card-title {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
  font-family: Merriweather, Georgia, serif;
}

.home-card-title a {
  color: var(--content-color);
  text-decoration: none;
}

.home-card-title a:hover {
  color: var(--accent);
}

.home-card-blurb {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--header-muted);
  line-height: 1.45;
}

.home-card-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-card-list li {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
}

.home-card-list a {
  color: var(--accent);
  text-decoration: none;
}

.home-card-list a:hover {
  text-decoration: underline;
}

.home-card-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

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

/* Share bar */
.share-bar {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--topbar-border);
  position: relative;
}

.share-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.share-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--header-muted);
  margin-right: 0.15rem;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.share-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--topbar-border);
  background: var(--callout-bg, rgba(0, 0, 0, 0.03));
  color: var(--content-color);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.share-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.share-btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, #000);
  border-color: color-mix(in srgb, var(--accent) 88%, #000);
  color: #fff;
}

.share-toast {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.5rem);
  padding: 0.4rem 0.7rem;
  border-radius: 0.4rem;
  background: #1f2933;
  color: #fff;
  font-size: 0.8rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.share-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 575.98px) {
  .share-label {
    width: 100%;
  }
}

.page-header h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--header-muted);
  margin-bottom: 0.35rem;
}

.page-header h1 {
  font-family: Merriweather, Georgia, serif;
  font-size: 1.85rem;
  margin-bottom: 1.5rem;
  color: var(--content-color);
}

.content-body {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--content-color);
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4 {
  font-family: Merriweather, Georgia, serif;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--content-color);
}

.content-body img,
.content-body .doc-figure-img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--image-border);
  border-radius: 0.5rem;
  margin: 0;
  background: #fff;
}

/* Documentation screenshots */
.content-body .doc-figure {
  margin: 1.75rem auto;
  text-align: center;
  max-width: 100%;
}

.content-body .doc-figure-img {
  display: block;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.content-body .doc-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--header-muted);
  line-height: 1.4;
}

/* Full phone screenshots — device bezel */
.content-body .doc-figure--phone {
  width: min(100%, 400px);
}

.content-body .doc-phone-frame {
  position: relative;
  margin: 0 auto;
  padding: 14px 12px 18px;
  border-radius: 2.4rem;
  background:
    linear-gradient(160deg, #3a3a3e 0%, #1c1c1f 42%, #111114 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.22),
    0 4px 12px rgba(0, 0, 0, 0.12);
}

.content-body .doc-phone-speaker {
  display: block;
  width: 28%;
  max-width: 7rem;
  height: 0.35rem;
  margin: 0.15rem auto 0.85rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.content-body .doc-figure--phone .doc-figure-img {
  width: 100%;
  border: none;
  border-radius: 1.35rem;
  box-shadow: none;
  background: #000;
}

.content-body .doc-phone-bar {
  display: block;
  width: 36%;
  max-width: 8rem;
  height: 0.3rem;
  margin: 0.85rem auto 0.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .content-body .doc-phone-frame {
  background: linear-gradient(160deg, #4a4a50 0%, #2a2a30 45%, #18181c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Mid-size UI panels / cropped sheets */
.content-body .doc-figure--panel .doc-figure-img,
.content-body .doc-figure--card .doc-figure-img {
  width: min(100%, 520px);
  border-radius: 0.85rem;
}

/* Small icons / buttons */
.content-body .doc-figure--icon .doc-figure-img {
  width: auto;
  max-width: 112px;
  border: none;
  box-shadow: none;
  background: transparent;
}

@media (max-width: 575.98px) {
  .content-body .doc-figure--phone {
    width: min(100%, 320px);
  }

  .content-body .doc-phone-frame {
    padding: 12px 10px 14px;
    border-radius: 2rem;
  }

  .content-body .doc-figure--phone .doc-figure-img {
    border-radius: 1.15rem;
  }
}

.content-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--blockquote-color);
  margin: 1rem 0;
}

/* Callouts: Примечание / Совет / Важно / Предупреждение / Пример */
.content-body .callout {
  --callout-accent: var(--accent);
  margin: 1.25rem 0;
  padding: 0.9rem 1rem 0.95rem;
  border-radius: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--callout-accent) 28%, transparent);
  border-left: 4px solid var(--callout-accent);
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--callout-accent) 10%, transparent),
      transparent 42%
    ),
    var(--callout-bg);
  color: var(--callout-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.content-body .callout-note { --callout-accent: var(--callout-note); }
.content-body .callout-tip { --callout-accent: var(--callout-tip); }
.content-body .callout-important { --callout-accent: var(--callout-important); }
.content-body .callout-warning { --callout-accent: var(--callout-warning); }
.content-body .callout-example { --callout-accent: var(--callout-example); }

.content-body .callout-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--callout-accent);
  margin-bottom: 0.35rem;
}

.content-body .callout-title::before {
  content: "i";
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--callout-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
}

.content-body .callout-tip .callout-title::before,
.content-body .callout-important .callout-title::before {
  content: "!";
}

.content-body .callout-warning .callout-title::before {
  content: "!";
  background: var(--callout-warning);
}

.content-body .callout-example .callout-title::before {
  content: "★";
  font-size: 0.58rem;
}

.content-body .callout-body {
  font-size: 0.98rem;
  line-height: 1.6;
}

.content-body .callout-body p {
  margin: 0;
}

.content-body .callout-body p + p {
  margin-top: 0.55rem;
}

/* Markdown footnotes ([^1]) */
.content-body .footnote,
.content-body .footnotes {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--topbar-border);
  font-size: 0.9rem;
  color: var(--header-muted);
}

.content-body .footnote hr,
.content-body .footnotes hr {
  display: none;
}

.content-body .footnote ol,
.content-body .footnotes ol {
  padding-left: 1.25rem;
  margin: 0;
}

.content-body .footnote li,
.content-body .footnotes li {
  margin-bottom: 0.5rem;
}

.content-body .footnote-ref {
  font-weight: 700;
  text-decoration: none;
  margin-left: 0.1rem;
  padding: 0 0.2rem;
  border-radius: 0.25rem;
  background: var(--accent-soft);
}

.content-body .footnote-backref {
  margin-left: 0.35rem;
  text-decoration: none;
  opacity: 0.75;
}

.content-body a {
  color: var(--accent);
}

.search-results a {
  color: var(--accent);
}

.admin-body {
  background: #f0f2f5;
}

.EasyMDEContainer .CodeMirror {
  min-height: 320px;
}

.EasyMDEContainer .CodeMirror.is-dragover {
  outline: 2px dashed #0d6efd;
  outline-offset: -2px;
  background: rgba(13, 110, 253, 0.04);
}

.media-dropzone {
  position: relative;
  border: 2px dashed #ced4da;
  border-radius: 0.5rem;
  background: #f8f9fa;
  min-height: 110px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.media-dropzone:hover,
.media-dropzone.is-dragover {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.06);
}

.media-dropzone-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 110px;
  padding: 1rem;
  color: #6c757d;
  font-size: 0.92rem;
}

.media-dropzone-editor {
  min-height: auto;
  margin-bottom: 0.5rem;
}

.media-dropzone-editor .media-dropzone-inner,
.media-dropzone-editor {
  min-height: 48px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.media-grid-picker {
  max-height: 55vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.media-card {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.media-card.is-used {
  border-color: #198754;
  box-shadow: 0 0 0 1px rgba(25, 135, 84, 0.25);
}

.media-thumb {
  aspect-ratio: 4 / 3;
  background: #f1f3f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.media-meta {
  padding: 0.45rem 0.55rem 0.25rem;
  font-size: 0.78rem;
}

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

.media-folder {
  font-size: 0.72rem;
}

.media-actions {
  padding: 0.4rem 0.45rem 0.55rem;
  width: 100%;
}

.media-actions .btn {
  font-size: 0.72rem;
}

/* Internal / staff docs */
.nav-section-label {
  margin: 1rem 0.85rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.nav-badge-internal {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.55rem;
  vertical-align: middle;
  color: var(--accent);
  opacity: 0.85;
}

.badge-internal {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #7a4e00;
  background: #ffe8a3;
}

[data-theme="dark"] .badge-internal {
  color: #ffe8a3;
  background: rgba(255, 193, 7, 0.18);
}

.home-section-internal .home-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.home-card-internal {
  border-color: rgba(230, 162, 60, 0.35);
}

.login-page {
  max-width: 420px;
  margin: 0 auto;
}

.login-form {
  margin-top: 1.25rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--image-border);
  border-radius: 0.75rem;
  background: var(--content-bg);
}

.login-hint {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--header-muted);
  line-height: 1.45;
}

@media (max-width: 991.98px) {
  .docs-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

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

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1025;
  }
}
