:root {
  --bg: #0c0f14;
  --bg-card: #151a24;
  --bg-card-hover: #1c2330;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf4;
  --muted: #8b95a8;
  --caption: #c5cedd;
  --link: #a8b4cc;
  --input-bg: #0e1218;
  --header-bg: rgba(12, 15, 20, 0.85);
  --accent: #ef3124;
  --accent-soft: rgba(239, 49, 36, 0.15);
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --font-sans: "Styrene A LC", "Styrene B LC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ui: "Styrene B LC", "Styrene A LC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Styrene B LC", "Styrene A LC", system-ui, sans-serif;
  --font: var(--font-sans);
  /* Ширина контента: читаемо на узких экранах и на 2K/4K (не «растягиваем» строки) */
  --content-max: 960px;
  --gutter-x: clamp(0.75rem, 4vw, 2.5rem);
  --gutter-y: clamp(1rem, 3vw, 2rem);
}

html[data-theme="light"] {
  /* Тёплый фон вместо холодного серого */
  --bg: #f2ece4;
  --bg-card: #fffdf8;
  --bg-card-hover: #f5efe6;
  --border: rgba(90, 70, 50, 0.12);
  --text: #1c1a17;
  --muted: #5c564e;
  --caption: #4a4540;
  --link: #1d4ed8;
  --input-bg: #fffdf8;
  --header-bg: rgba(252, 248, 242, 0.94);
  --shadow: 0 8px 32px rgba(60, 40, 20, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (min-width: 1200px) {
  :root {
    --content-max: 1040px;
  }
}

@media (min-width: 1440px) {
  :root {
    --content-max: 1140px;
  }
}

@media (min-width: 1920px) {
  :root {
    --content-max: 1240px;
  }
}

@media (min-width: 2560px) {
  :root {
    --content-max: 1320px;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

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

  html.page-loading .page-loading-bar {
    animation: none !important;
  }
}

.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(239, 49, 36, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(80, 120, 255, 0.08), transparent),
    var(--bg);
}

html[data-theme="light"] .bg-gradient {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(239, 49, 36, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(200, 150, 90, 0.06), transparent),
    var(--bg);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 0.85rem var(--gutter-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.header-right {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  gap: 0.75rem;
}

.header-tools {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
  order: 1;
}

.tools-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.15rem;
}

.btn-icon {
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0.35rem 0.55rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  line-height: 1.2;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
}

.btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
  appearance: none;
}

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

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-img {
  height: 2.25rem;
  width: auto;
  max-height: 40px;
  max-width: min(120px, 28vw);
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.logo-text {
  line-height: 1.2;
}

html[data-theme="dark"] .logo-link:hover {
  color: #fff;
}

html[data-theme="dark"] .logo-link:hover .logo-img {
  opacity: 0.95;
}

html[data-theme="light"] .logo-link:hover {
  color: #0f172a;
}

.main-content {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: var(--gutter-y) var(--gutter-x) 3rem;
}

.site-footer {
  text-align: center;
  padding: 1.5rem var(--gutter-x) 2rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: clamp(0.8rem, 2.5vw, 0.85rem);
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

/* Login */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-login {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.login-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.login-hint {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.label {
  font-size: 0.8rem;
  color: var(--muted);
}

.input {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: rgba(239, 49, 36, 0.45);
}

.btn {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  transition: background 0.15s, transform 0.05s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-block {
  margin-top: 0.5rem;
  width: 100%;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
}

.btn-secondary {
  display: inline-block;
  text-decoration: none;
  background: var(--bg-card-hover);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.logout-form {
  margin: 0;
  order: 3;
  align-self: center;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

html[data-theme="light"] .alert-success {
  color: #166534;
}

.alert-error {
  background: rgba(239, 49, 36, 0.12);
  border: 1px solid rgba(239, 49, 36, 0.35);
  color: #ffb4ad;
}

.login-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Page */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumbs a {
  color: var(--link);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--text);
}

.bc-sep {
  margin: 0 0.35rem;
  opacity: 0.5;
}

.bc-current {
  color: var(--text);
}

.page-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.2rem, 2.2vw + 0.85rem, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.blocks {
  display: flex;
  flex-direction: column;
  gap: 1.45rem;
  min-width: 0;
}

/* Сетка: боковое оглавление на широком экране */
.page-layout--has-toc {
  display: grid;
  grid-template-columns: minmax(12rem, 14rem) minmax(0, 1fr);
  gap: 1.75rem 2rem;
  align-items: start;
}

.page-toc-root[hidden] {
  display: none !important;
}

.page-toc {
  position: sticky;
  top: calc(4.25rem + env(safe-area-inset-top, 0px));
  max-height: calc(100vh - 5.5rem);
  overflow-y: auto;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.page-toc-heading {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.page-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.page-toc-link {
  display: block;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--link);
  text-decoration: none;
  padding: 0.25rem 0;
  border-radius: 6px;
}

.page-toc-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.page-toc-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page-toc-item--sub .page-toc-link {
  padding-left: 0.85rem;
  font-size: 0.82rem;
  border-left: 2px solid var(--accent-soft);
}

.block-text.md :is(h2, h3) {
  scroll-margin-top: 5.5rem;
  margin: 1.35rem 0 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.block-text.md h2 {
  font-size: clamp(1.05rem, 1.5vw + 0.75rem, 1.35rem);
}

.block-text.md h3 {
  font-size: clamp(0.98rem, 1vw + 0.72rem, 1.12rem);
  font-weight: 600;
}

.block-text.md :is(h2, h3):first-child {
  margin-top: 0;
}

@media (max-width: 900px) {
  .page-layout--has-toc {
    grid-template-columns: 1fr;
  }

  .page-toc {
    position: relative;
    top: auto;
    max-height: none;
  }
}

.block-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid rgba(239, 49, 36, 0.35);
  padding: clamp(1.15rem, 2.8vw, 1.55rem);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

@media (prefers-reduced-motion: no-preference) {
  .block-card.block-card--reveal {
    opacity: 0;
    transform: translateY(12px);
    transition:
      opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .block-card.block-card--reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

.block-text.md :is(p, ul, ol) {
  margin: 0 0 0.75rem;
}

.block-text.md ul,
.block-text.md ol {
  padding-left: 1.25rem;
}

.block-text.md p:last-child {
  margin-bottom: 0;
}

.block-text.md blockquote {
  margin: 1rem 0;
  padding: 0.95rem 1rem;
  border-left: 4px solid var(--color-primary, #f63737);
  border-radius: 0.85rem;
  background: rgba(255, 90, 95, 0.08);
  color: var(--color-text, #181818);
}

.block-text.md blockquote p {
  margin: 0;
}

.block-media img,
.block-media video {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.block-media img.zoomable {
  cursor: zoom-in;
}

.block-media img.zoomable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.block-media figcaption,
.video-caption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--caption);
}

.pdf-frame {
  width: 100%;
  min-height: clamp(280px, 55vh, 560px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.page-nav {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.nav-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 1rem;
}

.nav-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.65rem;
  justify-content: flex-start;
}

.nav-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  flex: 1 1 auto;
  min-width: min(100%, 9.5rem);
  max-width: 14rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.35;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.nav-tile--primary {
  background: var(--accent-soft);
  border-color: rgba(239, 49, 36, 0.4);
  font-weight: 600;
  color: var(--text);
}

.nav-tile--home {
  background: transparent;
  border-style: dashed;
  border-color: var(--border);
  color: var(--muted);
  font-weight: 500;
}

.nav-tile--home:hover {
  color: var(--text);
  border-color: rgba(239, 49, 36, 0.35);
  background: var(--bg-card-hover);
}

.nav-tile:hover {
  background: var(--bg-card-hover);
  border-color: rgba(239, 49, 36, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.nav-tile--primary:hover {
  background: rgba(239, 49, 36, 0.22);
  border-color: rgba(239, 49, 36, 0.55);
}

html[data-theme="dark"] .nav-tile:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

@media (max-width: 640px) {
  .nav-grid {
    flex-direction: column;
  }

  .nav-tile {
    max-width: none;
    width: 100%;
    min-width: 0;
    min-height: 3.1rem;
    justify-content: center;
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.88);
  cursor: default;
  box-sizing: border-box;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}

.lightbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.lightbox-tool-btn {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.5rem;
  border: 1px solid rgba(239, 49, 36, 0.45);
  border-radius: 10px;
  background: var(--accent-soft);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 14px rgba(239, 49, 36, 0.2);
}

.lightbox-tool-btn:hover {
  background: rgba(239, 49, 36, 0.28);
  border-color: rgba(239, 49, 36, 0.58);
}

.lightbox-tool-btn:active {
  filter: brightness(0.96);
}

.lightbox-tool-btn--text {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: auto;
  padding: 0 0.75rem;
}

.lightbox-zoom-pct {
  min-width: 3.25rem;
  text-align: center;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.9);
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.lightbox-img-el {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  cursor: zoom-in;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.lightbox-hint {
  flex-shrink: 0;
  margin: 0;
  padding: 0.55rem 0.5rem 0;
  font-size: clamp(0.95rem, 3.6vw, 1.125rem);
  line-height: 1.4;
  text-align: center;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.lightbox-close {
  position: relative;
  top: auto;
  right: auto;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
}

.lightbox-close:hover {
  background: #fff;
}

/* Страницы ошибок (404, 500, …) */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(70vh, 560px);
  padding: var(--gutter-y) var(--gutter-x);
}

.error-page__inner {
  max-width: 520px;
  text-align: center;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.error-page__code {
  margin: 0 0 0.5rem;
  font-size: clamp(3rem, 12vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
}

.error-page__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600;
}

.error-page__text {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.error-page__logout {
  display: inline;
  margin: 0;
}

/* Админ-панель */
.admin-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--gutter-y) var(--gutter-x);
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.admin-title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  font-weight: 700;
}

.admin-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Одна линия: у .btn-secondary иначе отступ снизу и меньший padding, чем у .btn */
.admin-bar__actions .btn {
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2.45rem;
}

.admin-bar__actions .btn-secondary {
  padding: 0.65rem 1rem;
}

.admin-bar__actions .logout-form {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.admin-section {
  margin-bottom: 2.25rem;
}

#stats-by-section,
#admin-health,
#admin-export {
  scroll-margin-top: 6rem;
}

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

.admin-health-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}

.admin-health-card__label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.admin-health-card__value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.admin-health-card__hint {
  display: block;
  font-size: 0.78rem;
  color: var(--caption);
  margin-top: 0.4rem;
  line-height: 1.35;
}

.admin-h3 {
  margin: 1.25rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--caption);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-live-intro {
  margin-top: 0.25rem !important;
}

.admin-live-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  animation: admin-live-pulse 2s ease-in-out infinite;
}

@keyframes admin-live-pulse {
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-live-dot {
    animation: none;
  }
}

.admin-health-live {
  margin-bottom: 1.25rem;
}

.admin-health-card--live {
  transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-health-card--level-ok {
  border-color: rgba(34, 197, 94, 0.35);
}

.admin-health-card--level-warn {
  border-color: rgba(234, 179, 8, 0.45);
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.12);
}

.admin-health-card--level-critical {
  border-color: rgba(239, 49, 36, 0.55);
  box-shadow: 0 0 0 1px rgba(239, 49, 36, 0.15);
}

.admin-live-badge {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
}

.admin-live-badge--ok {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.admin-live-badge--warn {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}

.admin-live-badge--critical {
  background: rgba(239, 49, 36, 0.22);
  color: #fecaca;
}

html[data-theme="light"] .admin-live-badge--ok {
  color: #166534;
}

html[data-theme="light"] .admin-live-badge--warn {
  color: #854d0e;
}

html[data-theme="light"] .admin-live-badge--critical {
  color: #991b1b;
}

.admin-health-card__value--small {
  font-size: 0.88rem;
  font-weight: 500;
}

.admin-health-card--time .admin-health-card__value {
  font-size: 0.85rem;
  font-weight: 500;
}

.admin-export-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
}

.admin-h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.admin-muted {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.admin-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.admin-stat__label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.admin-stat__value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.admin-stat__sub {
  display: block;
  font-size: 0.8rem;
  color: var(--caption);
  margin-top: 0.35rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

/* Статистика по разделам: фиксированная сетка, заголовки над цифрами */
.admin-stats-table {
  table-layout: fixed;
  min-width: 100%;
}

.admin-stats-col-label {
  width: 30%;
}

.admin-stats-col-num {
  width: 17.5%;
}

.admin-stats-table thead th:first-child,
.admin-stats-table tbody th[scope="row"] {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  vertical-align: middle;
  padding-right: 0.75rem;
  word-break: break-word;
}

.admin-stats-table .admin-stats-th-num,
.admin-stats-table td.admin-stats-num {
  text-align: right;
  vertical-align: middle;
  padding-left: 0.35rem;
  padding-right: 0.5rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-stats-table .admin-stats-th-num {
  color: var(--muted);
}

.admin-stats-table td.admin-stats-num {
  color: var(--caption);
}

/* Разделитель между названием раздела и колонками с цифрами */
.admin-stats-table thead th:nth-child(2),
.admin-stats-table tbody td:nth-child(2) {
  border-left: 1px solid var(--border);
}

.admin-code {
  font-size: 0.88em;
  background: var(--input-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.admin-inline-form {
  display: inline;
  margin: 0;
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
}

.admin-pre {
  margin: 0.5rem 0 1rem;
  padding: 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.admin-log-date-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.admin-log-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.admin-log-search-input {
  min-width: min(320px, 100%);
}

.admin-date-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-date-input {
  min-width: 0;
  max-width: 11rem;
}

.admin-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-log-toolbar__text {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.admin-clear-form {
  margin: 0;
  flex-shrink: 0;
}

.admin-log-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-filter {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--link);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, border-color 0.15s;
}

.admin-filter:hover {
  background: var(--bg-card-hover);
}

.admin-filter.is-active {
  border-color: rgba(239, 49, 36, 0.45);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.admin-log-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-log-pre {
  margin: 0;
  padding: 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-x: auto;
  max-height: min(70vh, 720px);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Планшеты */
@media (max-width: 900px) {
  .breadcrumbs {
    font-size: clamp(0.8rem, 2.5vw, 0.85rem);
  }
}

/* Телефоны и узкие экраны */
@media (max-width: 640px) {
  .tools-label {
    display: none;
  }

  .card-login {
    margin: 0 var(--gutter-x);
    padding: clamp(1.25rem, 5vw, 2rem);
  }

  .login-wrap {
    min-height: 50dvh;
  }

  .search-page-form__select {
    min-width: 0;
    width: 100%;
  }
}

/* Касание: крупнее зона нажатия */
@media (hover: none) and (pointer: coarse) {
  .btn-icon,
  .btn-theme {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-tile {
    padding: 1rem 1.1rem;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .block-media img.zoomable {
    cursor: pointer;
  }
}

/* Очень узкие экраны */
@media (max-width: 380px) {
  .btn-theme {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
  }
}

/* Доступность: видимый фокус клавиатуры */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

/* Поиск в шапке */
.header-search {
  display: flex;
  flex: 0 1 16rem;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 16rem;
  margin: 0;
  margin-left: auto;
}

.header-search__input {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  padding: 0.45rem 0.65rem;
}

.header-search__btn {
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
}

/* Недавние страницы */
.recent-bar {
  position: relative;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(239, 49, 36, 0.1) 0%,
    var(--bg-card) min(28rem, 55%)
  );
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.22);
}

html[data-theme="light"] .recent-bar {
  box-shadow: 0 2px 14px rgba(60, 40, 20, 0.08);
}

.recent-bar__inner {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 0.55rem var(--gutter-x);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  font-size: 0.88rem;
}

.recent-bar__label {
  flex-shrink: 0;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid rgba(239, 49, 36, 0.38);
}

.recent-bar__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-bar__list a {
  color: var(--link);
  text-decoration: none;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}

.recent-bar__list a:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}

/* Прогресс при переходе по ссылкам */
.page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1001;
  pointer-events: none;
  background: linear-gradient(90deg, var(--accent), #f97316);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

html.page-loading .page-loading-bar {
  transform: scaleX(0.35);
  animation: page-load-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes page-load-pulse {
  from {
    transform: scaleX(0.25);
  }
  to {
    transform: scaleX(0.55);
  }
}

/* Наверх */
.back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 50;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--accent);
  color: #fff;
  line-height: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 18px rgba(239, 49, 36, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.2);
  transition:
    filter 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}

.back-to-top:hover {
  filter: brightness(1.08);
  box-shadow:
    0 6px 22px rgba(239, 49, 36, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.22);
}

.back-to-top:active {
  transform: scale(0.96);
  filter: brightness(0.98);
}

.back-to-top:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.back-to-top__icon {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  flex-shrink: 0;
}

/* Копирование из pre */
.pre-copy-wrap {
  position: relative;
  margin: 0.5rem 0 0;
}

.pre-copy-wrap .copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 1;
  font-size: 0.72rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.pre-copy-wrap .copy-btn:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}

.block-text pre {
  padding: 2.25rem 0.85rem 0.85rem;
  overflow-x: auto;
}

/* Страница поиска */
.search-page-form {
  margin-bottom: 1.5rem;
  max-width: 36rem;
}

.search-page-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.search-page-form__input {
  flex: 1;
  min-width: 0;
}

.search-page-form__select {
  min-width: 13rem;
}

.search-hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.search-empty-hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.search-result__link {
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  font-size: 1rem;
}

.search-result__link:hover {
  color: var(--text);
  text-decoration: underline;
}

.search-result__snippet {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: var(--caption);
  line-height: 1.45;
}

.search-result__meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.search-result mark {
  background: rgba(239, 49, 36, 0.22);
  color: inherit;
  border-radius: 0.2rem;
  padding: 0 0.15rem;
}

.empty-state {
  padding: 2rem 1.25rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.empty-state__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.feedback-page {
  display: flex;
  justify-content: center;
}

.feedback-card {
  width: min(100%, 760px);
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.feedback-title {
  margin-bottom: 0.5rem;
}

.feedback-intro {
  margin: 0 0 1.1rem;
  color: var(--muted);
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.feedback-form__select {
  width: 100%;
}

.feedback-form__textarea,
.feedback-admin-form__textarea {
  min-height: 10rem;
  resize: vertical;
}

.feedback-form__actions,
.feedback-admin-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.feedback-admin-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feedback-admin-card {
  padding: 1rem;
}

.feedback-admin-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.feedback-admin-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.feedback-admin-card__meta,
.feedback-admin-card__path {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.feedback-admin-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.feedback-admin-card__path {
  margin-top: 0.3rem;
  word-break: break-word;
}

.feedback-admin-card__message {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
}

.feedback-admin-form {
  display: grid;
  gap: 0.55rem;
}

.feedback-admin-form__select {
  max-width: 15rem;
}

.feedback-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.feedback-status--new {
  background: rgba(239, 49, 36, 0.14);
  color: #ffb4ad;
  border-color: rgba(239, 49, 36, 0.28);
}

.feedback-status--in_progress {
  background: rgba(234, 179, 8, 0.16);
  color: #fde68a;
  border-color: rgba(234, 179, 8, 0.3);
}

.feedback-status--done {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.3);
}

html[data-theme="light"] .feedback-status--new {
  color: #991b1b;
}

html[data-theme="light"] .feedback-status--in_progress {
  color: #92400e;
}

html[data-theme="light"] .feedback-status--done {
  color: #166534;
}

@media (max-width: 720px) {
  .site-header {
    position: static;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    gap: 0.2rem;
  }

  .header-search {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    flex: 0 0 auto;
  }

  .logo-link {
    justify-content: flex-start;
    width: 100%;
  }

  .header-right {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.2rem;
    flex-wrap: nowrap;
  }

  .header-tools {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .btn-icon,
  .btn-theme,
  .logout-form .btn {
    min-height: 40px;
    height: 40px;
  }

  .logout-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
  }

  .logout-form {
    flex: 0 0 auto;
    margin: 0;
    align-self: flex-start;
  }

  .recent-bar__inner {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    gap: 0.35rem 0.6rem;
  }

  .feedback-admin-card__top {
    flex-direction: column;
  }
}

@media print {
  .bg-gradient,
  .site-header,
  .site-footer,
  .recent-bar,
  .back-to-top,
  .page-loading-bar,
  .lightbox,
  .header-search,
  .btn-theme,
  .btn-icon,
  .logout-form,
  .copy-btn,
  .page-nav,
  .page-toc-root {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .main-content {
    max-width: none;
    padding: 0;
  }

  .block-card {
    border: none;
    border-left: none;
    box-shadow: none;
    padding: 0;
    page-break-inside: avoid;
    opacity: 1 !important;
    transform: none !important;
  }

  .page-title {
    font-size: 1.5rem;
  }

  a[href]::after {
    content: "";
  }
}

/* Public redesign */
.recent-bar {
  display: none !important;
}

.guide-shell {
  display: grid;
  grid-template-columns: minmax(16rem, 21rem) minmax(0, 1fr);
  gap: 1.35rem;
  align-items: stretch;
  min-height: clamp(34rem, 72vh, 48rem);
}

.guide-shell__scene {
  position: relative;
  overflow: hidden;
  border-radius: 1.9rem;
  min-height: 100%;
  background:
    radial-gradient(circle at 22% 72%, rgba(255, 243, 202, 0.78), transparent 20%),
    radial-gradient(circle at 74% 18%, rgba(244, 105, 166, 0.34), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(185, 227, 255, 0.92)),
    var(--scene-image) left bottom / cover no-repeat;
  box-shadow: 0 20px 56px rgba(107, 121, 167, 0.16);
}

.guide-shell__scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.16));
  pointer-events: none;
}

.guide-shell__label {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  right: 1.25rem;
  padding: 1rem 1.5rem;
  border-radius: 1.2rem;
  background: linear-gradient(135deg, #ff6464, #ff4a57);
  color: #fff;
  font-size: clamp(1.6rem, 1.8vw + 1rem, 2.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  box-shadow: 0 16px 34px rgba(255, 73, 87, 0.24);
  z-index: 1;
}

.guide-card {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  padding: clamp(1.35rem, 2vw, 1.9rem);
  border-radius: 1.55rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.92));
  box-shadow:
    0 24px 64px rgba(113, 121, 161, 0.12),
    0 2px 8px rgba(104, 115, 150, 0.08);
}

.guide-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0.7rem;
  background: linear-gradient(90deg, #9de4ff, #ef5ca8 55%, #61b9ff);
  opacity: 0.88;
}

.guide-breadcrumbs {
  margin: 0 0 0.65rem;
}

.guide-hero {
  margin-bottom: 1.35rem;
  padding-top: 1rem;
}

.guide-hero__title {
  margin: 0 0 0.65rem;
  color: #151515;
  font-size: clamp(1.75rem, 2.2vw + 0.9rem, 2.7rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.guide-hero__lead {
  max-width: 52rem;
  color: #1d1d1d;
  font-size: clamp(1rem, 0.55vw + 0.92rem, 1.12rem);
  line-height: 1.45;
}

.guide-hero__lead p {
  margin: 0 0 0.65rem;
}

.guide-hero__lead p:last-child {
  margin-bottom: 0;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.landing-grid--work {
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
}

.landing-card {
  display: flex;
  flex-direction: column;
  min-height: 13rem;
  border-radius: 1.15rem;
  overflow: hidden;
  text-decoration: none;
  background: rgba(244, 236, 249, 0.74);
  box-shadow: 0 12px 28px rgba(164, 151, 181, 0.16);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.landing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(164, 151, 181, 0.22);
}

.landing-card__media {
  display: block;
  min-height: 9.25rem;
  background: linear-gradient(135deg, #c2f0ff, #feb3d5 55%, #8fc6ff);
}

.landing-card__media--sprite {
  background-image: var(--preview-image);
  background-repeat: no-repeat;
  background-position: var(--preview-position);
  background-size: var(--preview-size);
}

.landing-card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 1;
  padding: 0.7rem 0.8rem 0.85rem;
  text-align: center;
}

.landing-card__title {
  color: #161616;
  font-size: clamp(1rem, 0.65vw + 0.88rem, 1.16rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.landing-card--work .landing-card__title,
.landing-card--about .landing-card__title,
.landing-card--settings .landing-card__title {
  text-transform: none;
}

.landing-card__number {
  display: inline-block;
  margin-top: 0.35rem;
  color: #1b1b1b;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.guide-page-layout {
  display: block;
}

.guide-page-layout .page-toc-root {
  display: none !important;
}

.guide-blocks {
  gap: 1.1rem;
}

.guide-block {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.guide-block .block-text,
.guide-block .block-media,
.guide-block .block-pdf {
  color: #181818;
}

.guide-block .block-text.md :is(h2, h3) {
  color: #171717;
  margin-top: 1.3rem;
}

.guide-block .block-text.md :is(p, ul, ol) {
  font-size: 1.02rem;
  line-height: 1.58;
}

.guide-block .block-media img,
.guide-block .block-media video,
.guide-block .pdf-frame {
  border-radius: 1rem;
  border: 1px solid rgba(31, 37, 56, 0.08);
  box-shadow: 0 16px 34px rgba(112, 124, 167, 0.12);
}

.guide-page-nav {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
}

.guide-recent {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: center;
  margin-top: 1.75rem;
  color: #1c1c1c;
  font-size: 0.98rem;
}

.guide-recent__label {
  font-weight: 600;
}

.guide-recent__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-recent__list a {
  color: #be6d76;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.guide-search-form,
.feedback-form {
  max-width: 100%;
}

.guide-search-results .search-result {
  border-radius: 1rem;
  border: 1px solid rgba(31, 37, 56, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 30px rgba(112, 124, 167, 0.1);
}

.search-result__meta {
  margin: 0.4rem 0 0;
  color: #be6d76;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.entry-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: min(72vh, 48rem);
}

.entry-card {
  width: min(100%, 30rem);
  padding: clamp(1.5rem, 3vw, 2rem);
  border-radius: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.92));
  box-shadow: 0 24px 64px rgba(113, 121, 161, 0.12);
}

.entry-brand {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.2rem;
}

.entry-brand__mark {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ff6464, #ff4a57);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(255, 73, 87, 0.24);
}

.entry-title {
  margin: 0;
  color: #171717;
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.entry-subtitle {
  margin: 0.45rem 0 0;
  color: #5d6475;
}

html[data-theme="dark"] .guide-card,
html[data-theme="dark"] .entry-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(23, 26, 36, 0.96), rgba(18, 20, 29, 0.94));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .guide-card::before {
  opacity: 0.74;
}

html[data-theme="dark"] .guide-hero__title,
html[data-theme="dark"] .guide-hero__lead,
html[data-theme="dark"] .guide-block .block-text,
html[data-theme="dark"] .guide-block .block-media,
html[data-theme="dark"] .guide-recent,
html[data-theme="dark"] .landing-card__title,
html[data-theme="dark"] .landing-card__number,
html[data-theme="dark"] .entry-title {
  color: #f3f5fb;
}

html[data-theme="dark"] .entry-subtitle {
  color: #b6c1d4;
}

html[data-theme="dark"] .landing-card {
  background: rgba(28, 33, 45, 0.86);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .landing-card__media {
  filter: saturate(1.05);
}

html[data-theme="dark"] .guide-block .block-media img,
html[data-theme="dark"] .guide-block .block-media video,
html[data-theme="dark"] .guide-block .pdf-frame,
html[data-theme="dark"] .guide-search-results .search-result {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

@media (max-width: 980px) {
  .guide-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .guide-shell__scene {
    min-height: 17rem;
    background-position: left 60% bottom 30%;
  }

  .guide-shell__label {
    max-width: 22rem;
  }
}

@media (max-width: 720px) {
  .guide-card {
    padding: 1rem;
    border-radius: 1.2rem;
  }

  .guide-shell__label {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 0.9rem 1.1rem;
    font-size: 1.45rem;
  }

  .landing-grid,
  .landing-grid--work {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-card {
    min-height: 11.5rem;
  }

  .landing-card__media {
    min-height: 7.8rem;
  }
}

@media (max-width: 520px) {
  .guide-shell__scene {
    min-height: 14rem;
  }

  .landing-grid,
  .landing-grid--work {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .guide-recent {
    margin-top: 1.2rem;
    font-size: 0.92rem;
  }
}

/* Public redesign v2 */
body {
  background: #f7f2eb;
}

html[data-theme="light"] body {
  color: #161616;
  background:
    radial-gradient(circle at 20% 28%, rgba(255, 241, 176, 0.34), transparent 18%),
    radial-gradient(circle at 79% 72%, rgba(119, 199, 255, 0.16), transparent 24%),
    #f7f2eb;
}

html[data-theme="light"] .bg-gradient {
  background:
    radial-gradient(circle at 18% 64%, rgba(255, 234, 164, 0.28), transparent 16%),
    radial-gradient(circle at 77% 82%, rgba(105, 195, 255, 0.18), transparent 22%),
    linear-gradient(180deg, #faf5ee, #f3ece5);
}

html[data-theme="light"] .site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 251, 246, 0.92);
  border-bottom: 1px solid rgba(190, 175, 160, 0.18);
  box-shadow: 0 4px 18px rgba(145, 120, 92, 0.06);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .header-inner {
  width: min(100%, 1280px);
  padding: 1.2rem 1.8rem;
  gap: 1.2rem;
  justify-content: flex-start;
}

html[data-theme="light"] .logo-link {
  flex: 0 0 auto;
  gap: 0.8rem;
  color: #171717;
}

html[data-theme="light"] .logo-img {
  height: 2.85rem;
  max-height: 46px;
  max-width: 46px;
}

html[data-theme="light"] .logo-text {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.1;
}

html[data-theme="light"] .header-search {
  flex: 0 1 19rem;
  max-width: 19rem;
  margin-left: auto;
  gap: 0.65rem;
}

html[data-theme="light"] .header-search__input {
  min-height: 2.8rem;
  padding: 0.7rem 0.95rem;
  border-radius: 0.9rem;
  border-color: rgba(208, 193, 180, 0.55);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .header-search__btn {
  min-height: 2.8rem;
  padding: 0.72rem 1.3rem;
  border-radius: 0.9rem;
  box-shadow: 0 8px 18px rgba(239, 49, 36, 0.16);
}

html[data-theme="light"] .header-right {
  gap: 1rem;
  margin-left: 0;
}

html[data-theme="light"] .header-tools {
  gap: 0.42rem;
}

html[data-theme="light"] .tools-label,
html[data-theme="light"] .label {
  color: #6a645d;
}

html[data-theme="light"] .btn-icon,
html[data-theme="light"] .btn-theme,
html[data-theme="light"] .logout-form .btn {
  min-height: 2.85rem;
  height: 2.85rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(213, 202, 190, 0.84);
  background: rgba(255, 255, 255, 0.95);
  color: #202020;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85),
    0 6px 16px rgba(167, 139, 109, 0.06);
}

html[data-theme="light"] .btn-icon {
  min-width: 2.85rem;
  padding: 0.35rem 0.7rem;
}

html[data-theme="light"] .btn-theme {
  padding: 0.45rem 0.95rem;
  font-size: 0.92rem;
}

html[data-theme="light"] .btn-icon:hover,
html[data-theme="light"] .btn-theme:hover,
html[data-theme="light"] .logout-form .btn:hover {
  background: #fff;
  border-color: rgba(196, 179, 165, 0.95);
}

html[data-theme="light"] .main-content {
  width: min(100%, 1280px);
  padding: 0 1.8rem 2rem;
}

html[data-theme="light"] .guide-shell {
  position: relative;
  display: grid;
  grid-template-columns: 21.25rem minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 44rem;
  padding-top: 2rem;
}

html[data-theme="light"] .guide-shell::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 9.8rem;
  border-radius: 0 0 1.3rem 1.3rem;
  background:
    linear-gradient(90deg, rgba(194, 236, 255, 0.96) 0%, rgba(240, 157, 211, 0.92) 46%, rgba(112, 202, 255, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

html[data-theme="light"] .guide-shell__scene {
  z-index: 0;
  min-height: 44rem;
  border-radius: 0 0 0 1.3rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    var(--scene-image) center bottom / cover no-repeat;
  box-shadow: none;
}

html[data-theme="light"] .guide-shell__scene::after {
  background:
    radial-gradient(circle at 18% 76%, rgba(255, 251, 229, 0.38), transparent 16%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

html[data-theme="light"] .guide-shell__label {
  top: 2rem;
  left: 1.8rem;
  right: -2.3rem;
  min-height: 6.1rem;
  display: flex;
  align-items: center;
  padding: 1rem 1.75rem 1rem 1.9rem;
  border-radius: 1.35rem 0 0 1.35rem;
  background: linear-gradient(180deg, #ff5759, #ff4d4f);
  color: #fff;
  font-size: clamp(2.25rem, 2.35vw + 1.1rem, 3rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.05em;
  box-shadow:
    0 18px 28px rgba(255, 77, 79, 0.16),
    inset 0 -10px 18px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .guide-card {
  z-index: 1;
  min-height: 43.75rem;
  margin-top: 2rem;
  padding: 1.65rem 1.95rem 1.35rem;
  border: 1px solid rgba(214, 222, 230, 0.82);
  border-radius: 1.55rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 16px 32px rgba(125, 132, 168, 0.12),
    0 6px 12px rgba(146, 124, 104, 0.08);
}

html[data-theme="light"] .guide-card::before {
  display: none;
}

html[data-theme="light"] .guide-breadcrumbs {
  display: none;
}

html[data-theme="light"] .guide-hero {
  padding-top: 0;
  margin-bottom: 1.45rem;
}

html[data-theme="light"] .guide-hero__title {
  margin-bottom: 0.55rem;
  color: #0f0f10;
  font-size: clamp(2rem, 2.2vw + 1rem, 3rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.055em;
}

html[data-theme="light"] .guide-hero__lead,
html[data-theme="light"] .guide-block .block-text.md :is(p, ul, ol) {
  color: #1f1f20;
  font-size: 1rem;
  line-height: 1.38;
}

html[data-theme="light"] .landing-grid {
  gap: 1.45rem 1.7rem;
  margin-bottom: 1rem;
}

html[data-theme="light"] .landing-grid--main,
html[data-theme="light"] .landing-grid--back_to_main {
  grid-template-columns: repeat(4, minmax(0, 11.6rem));
}

html[data-theme="light"] .landing-grid--knowledge {
  grid-template-columns: repeat(3, minmax(0, 15.95rem));
}

html[data-theme="light"] .landing-grid--work {
  grid-template-columns: repeat(4, minmax(0, 11.6rem));
  max-width: 51rem;
}

html[data-theme="light"] .landing-card {
  min-height: 0;
  border-radius: 1rem;
  background: transparent;
  box-shadow: none;
  transition: transform 0.16s ease, filter 0.16s ease;
}

html[data-theme="light"] .landing-card:hover {
  transform: translateY(-2px);
  box-shadow: none;
  filter: saturate(1.02);
}

html[data-theme="light"] .landing-card--full {
  overflow: visible;
}

html[data-theme="light"] .landing-card__full {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 10px 22px rgba(145, 127, 162, 0.14);
}

html[data-theme="light"] .guide-feature {
  margin: 0 0 1rem;
}

html[data-theme="light"] .guide-feature img {
  display: block;
  width: 100%;
  max-width: 51.6rem;
  height: auto;
  border-radius: 1.1rem;
  box-shadow: 0 10px 24px rgba(140, 122, 102, 0.12);
}

html[data-theme="light"] .guide-page-layout {
  margin-top: 0.2rem;
}

html[data-theme="light"] .guide-page-nav {
  margin-top: 1.4rem;
  padding-top: 0;
  border-top: 0;
}

html[data-theme="light"] .nav-heading {
  color: #7f776f;
}

html[data-theme="light"] .nav-grid {
  gap: 0.8rem;
}

html[data-theme="light"] .nav-tile {
  min-height: 3.15rem;
  padding: 0.75rem 1.1rem;
  border-radius: 1rem;
  border-color: rgba(219, 209, 197, 0.9);
  background: rgba(255, 250, 246, 0.96);
  box-shadow: 0 10px 20px rgba(132, 118, 98, 0.06);
}

html[data-theme="light"] .nav-tile--primary {
  background: rgba(255, 92, 92, 0.1);
  border-color: rgba(255, 92, 92, 0.24);
}

html[data-theme="light"] .nav-tile--home {
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .guide-blocks {
  gap: 1.15rem;
}

html[data-theme="light"] .guide-block .block-text,
html[data-theme="light"] .guide-block .block-media,
html[data-theme="light"] .guide-block .block-pdf {
  color: #181818;
}

html[data-theme="light"] .guide-block .block-text.md :is(h2, h3) {
  color: #111;
  letter-spacing: -0.03em;
}

html[data-theme="light"] .guide-block .block-media img,
html[data-theme="light"] .guide-block .block-media video,
html[data-theme="light"] .guide-block .pdf-frame,
html[data-theme="light"] .guide-search-results .search-result,
html[data-theme="light"] .entry-card,
html[data-theme="light"] .feedback-form .input,
html[data-theme="light"] .guide-search-form .input {
  border: 1px solid rgba(221, 212, 201, 0.72);
  box-shadow: 0 10px 20px rgba(132, 118, 98, 0.06);
}

html[data-theme="light"] .guide-recent {
  margin-top: 1.5rem;
  color: #171717;
  font-size: 0.94rem;
}

html[data-theme="light"] .guide-recent__label {
  font-weight: 500;
}

html[data-theme="light"] .guide-recent__list a {
  color: #c46c76;
}

html[data-theme="light"] .search-page-form__row,
html[data-theme="light"] .feedback-form__actions {
  gap: 0.65rem;
}

html[data-theme="light"] .search-page-form__select {
  min-width: 12rem;
}

html[data-theme="light"] .guide-search-results .search-result {
  background: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .feedback-form,
html[data-theme="light"] .guide-search-form,
html[data-theme="light"] .login-form {
  gap: 0.8rem;
}

html[data-theme="light"] .feedback-form .input,
html[data-theme="light"] .guide-search-form .input,
html[data-theme="light"] .login-form .input {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 0.95rem;
}

html[data-theme="light"] .entry-shell {
  min-height: min(76vh, 52rem);
}

html[data-theme="light"] .entry-card {
  background: rgba(255, 255, 255, 0.97);
}

html[data-theme="light"] .entry-brand__mark {
  background: linear-gradient(180deg, #ff5759, #ff4d4f);
}

html[data-theme="light"] .site-footer {
  max-width: 1280px;
  text-align: left;
  color: #8a8177;
  padding: 0.35rem 1.8rem 1.2rem;
}

html[data-theme="light"] .back-to-top {
  right: 1.3rem;
  bottom: 1.25rem;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border-color: rgba(223, 163, 156, 0.52);
  box-shadow:
    0 10px 24px rgba(239, 49, 36, 0.24),
    0 4px 8px rgba(145, 120, 92, 0.14);
}

html[data-theme="light"] .back-to-top__icon {
  width: 1.5rem;
  height: 1.5rem;
}

html[data-theme="dark"] body {
  background: #0f1116;
}

html[data-theme="dark"] .main-content,
html[data-theme="dark"] .header-inner,
html[data-theme="dark"] .site-footer {
  width: min(100%, 1280px);
}

html[data-theme="dark"] .guide-shell {
  position: relative;
  grid-template-columns: 21.25rem minmax(0, 1fr);
  gap: 0;
  min-height: 44rem;
  padding-top: 2rem;
}

html[data-theme="dark"] .guide-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 9.8rem;
  border-radius: 0 0 1.3rem 1.3rem;
  background: linear-gradient(90deg, rgba(67, 117, 167, 0.78), rgba(163, 76, 126, 0.78), rgba(50, 125, 170, 0.78));
}

html[data-theme="dark"] .guide-shell__scene {
  min-height: 44rem;
  border-radius: 0 0 0 1.3rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)), var(--scene-image) center bottom / cover no-repeat;
}

html[data-theme="dark"] .guide-shell__label {
  top: 2rem;
  left: 1.8rem;
  right: -2.3rem;
  min-height: 6.1rem;
  display: flex;
  align-items: center;
  border-radius: 1.35rem 0 0 1.35rem;
}

html[data-theme="dark"] .guide-card {
  min-height: 43.75rem;
  margin-top: 2rem;
}

html[data-theme="dark"] .guide-page-nav {
  border-top: 0;
  padding-top: 0;
}

html[data-theme="dark"] .guide-card::before,
html[data-theme="dark"] .guide-breadcrumbs {
  display: none;
}

html[data-theme="dark"] .landing-card__full,
html[data-theme="dark"] .guide-feature img {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

@media (max-width: 1120px) {
  html[data-theme="light"] .header-inner,
  html[data-theme="dark"] .header-inner {
    flex-wrap: wrap;
  }

  html[data-theme="light"] .header-search,
  html[data-theme="dark"] .header-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }

  html[data-theme="light"] .header-right,
  html[data-theme="dark"] .header-right {
    margin-left: auto;
  }

  html[data-theme="light"] .guide-shell,
  html[data-theme="dark"] .guide-shell {
    grid-template-columns: 18.5rem minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  html[data-theme="light"] .main-content,
  html[data-theme="dark"] .main-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  html[data-theme="light"] .guide-shell,
  html[data-theme="dark"] .guide-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 1.1rem;
  }

  html[data-theme="light"] .guide-shell::before,
  html[data-theme="dark"] .guide-shell::before {
    height: 14rem;
  }

  html[data-theme="light"] .guide-shell__scene,
  html[data-theme="dark"] .guide-shell__scene {
    min-height: 20rem;
    border-radius: 1.25rem 1.25rem 0 0;
  }

  html[data-theme="light"] .guide-shell__label,
  html[data-theme="dark"] .guide-shell__label {
    right: 1rem;
    left: 1rem;
    top: 1rem;
    min-height: 5.1rem;
    border-radius: 1.15rem;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
  }

  html[data-theme="light"] .guide-card,
  html[data-theme="dark"] .guide-card {
    margin-top: 0;
    min-height: 0;
    border-radius: 0 0 1.25rem 1.25rem;
  }

  html[data-theme="light"] .landing-grid--main,
  html[data-theme="light"] .landing-grid--back_to_main,
  html[data-theme="light"] .landing-grid--knowledge,
  html[data-theme="light"] .landing-grid--work,
  html[data-theme="dark"] .landing-grid--main,
  html[data-theme="dark"] .landing-grid--back_to_main,
  html[data-theme="dark"] .landing-grid--knowledge,
  html[data-theme="dark"] .landing-grid--work {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  html[data-theme="light"] .guide-feature img,
  html[data-theme="dark"] .guide-feature img {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  html[data-theme="light"] .header-inner,
  html[data-theme="dark"] .header-inner {
    padding: 0.9rem 1rem;
    gap: 0.8rem;
  }

  html[data-theme="light"] .header-right,
  html[data-theme="dark"] .header-right {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 0;
    gap: 0.55rem;
  }

  html[data-theme="light"] .header-tools,
  html[data-theme="dark"] .header-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  html[data-theme="light"] .guide-card,
  html[data-theme="dark"] .guide-card {
    padding: 1rem;
  }

  html[data-theme="light"] .guide-hero__title,
  html[data-theme="dark"] .guide-hero__title {
    font-size: clamp(1.8rem, 7vw, 2.3rem);
  }
}

@media (max-width: 560px) {
  html[data-theme="light"] .landing-grid--main,
  html[data-theme="light"] .landing-grid--back_to_main,
  html[data-theme="light"] .landing-grid--knowledge,
  html[data-theme="light"] .landing-grid--work,
  html[data-theme="dark"] .landing-grid--main,
  html[data-theme="dark"] .landing-grid--back_to_main,
  html[data-theme="dark"] .landing-grid--knowledge,
  html[data-theme="dark"] .landing-grid--work {
    grid-template-columns: 1fr;
  }

  html[data-theme="light"] .search-page-form__row,
  html[data-theme="dark"] .search-page-form__row {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-theme="light"] .search-page-form__select,
  html[data-theme="dark"] .search-page-form__select {
    min-width: 0;
  }
}

/* Design system v3 */
@font-face {
  font-family: "Styrene B LC";
  src: url("../fonts/styrene/StyreneBLC-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene B LC";
  src: url("../fonts/styrene/StyreneBLC-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene B LC";
  src: url("../fonts/styrene/StyreneBLC-Medium.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene B LC";
  src: url("../fonts/styrene/StyreneBLC-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene B LC";
  src: url("../fonts/styrene/StyreneBLC-Bold.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene B LC";
  src: url("../fonts/styrene/StyreneBLC-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene A LC";
  src: url("../fonts/styrene/StyreneALC-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene A LC";
  src: url("../fonts/styrene/StyreneALC-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene A LC";
  src: url("../fonts/styrene/StyreneALC-Medium.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene A LC";
  src: url("../fonts/styrene/StyreneALC-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene A LC";
  src: url("../fonts/styrene/StyreneALC-Bold.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Styrene A LC";
  src: url("../fonts/styrene/StyreneALC-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: block;
}

:root {
  --color-primary: #ef3124;
  --color-primary-strong: #d9281d;
  --color-bg: #f6f1eb;
  --color-bg-accent: #fdf8f4;
  --color-card: rgba(255, 255, 255, 0.96);
  --color-card-soft: rgba(255, 248, 246, 0.92);
  --color-text: #17171b;
  --color-text-soft: #635d69;
  --color-border: rgba(205, 191, 180, 0.45);
  --color-border-strong: rgba(192, 175, 163, 0.65);
  --color-glow-a: rgba(255, 217, 152, 0.46);
  --color-glow-b: rgba(247, 161, 211, 0.3);
  --color-glow-c: rgba(131, 206, 255, 0.34);
  --color-card-grad-a: #d3f1ff;
  --color-card-grad-b: #f7cae8;
  --color-card-grad-c: #d8d9ff;
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 16px;
  --shadow-soft:
    0 18px 38px rgba(124, 106, 91, 0.12),
    0 6px 16px rgba(132, 107, 86, 0.08);
  --shadow-card:
    0 12px 28px rgba(131, 115, 162, 0.14),
    0 4px 10px rgba(120, 98, 138, 0.08);
}

html[data-theme="dark"] {
  --color-bg: #11141b;
  --color-bg-accent: #151a22;
  --color-card: rgba(25, 29, 39, 0.95);
  --color-card-soft: rgba(29, 34, 45, 0.9);
  --color-text: #f5f7fb;
  --color-text-soft: #b7c1d4;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.14);
  --color-glow-a: rgba(255, 196, 110, 0.14);
  --color-glow-b: rgba(222, 100, 178, 0.14);
  --color-glow-c: rgba(92, 156, 255, 0.16);
  --color-card-grad-a: rgba(68, 108, 164, 0.52);
  --color-card-grad-b: rgba(143, 80, 125, 0.42);
  --color-card-grad-c: rgba(71, 114, 180, 0.42);
  --shadow-soft:
    0 20px 44px rgba(0, 0, 0, 0.3),
    0 8px 18px rgba(0, 0, 0, 0.2);
  --shadow-card:
    0 16px 30px rgba(0, 0, 0, 0.24),
    0 4px 10px rgba(0, 0, 0, 0.18);
}

body {
  color: var(--color-text);
  background:
    radial-gradient(circle at 14% 24%, var(--color-glow-a), transparent 20%),
    radial-gradient(circle at 80% 20%, var(--color-glow-b), transparent 22%),
    radial-gradient(circle at 78% 78%, var(--color-glow-c), transparent 26%),
    linear-gradient(180deg, #fbf7f2, var(--color-bg));
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 14% 24%, var(--color-glow-a), transparent 20%),
    radial-gradient(circle at 80% 20%, var(--color-glow-b), transparent 22%),
    radial-gradient(circle at 78% 78%, var(--color-glow-c), transparent 26%),
    linear-gradient(180deg, #171b24, var(--color-bg));
}

.bg-gradient {
  background:
    radial-gradient(circle at 8% 60%, rgba(255, 224, 158, 0.28), transparent 18%),
    radial-gradient(circle at 85% 10%, rgba(255, 177, 220, 0.2), transparent 18%),
    radial-gradient(circle at 90% 88%, rgba(117, 208, 255, 0.18), transparent 22%);
}

.site-header {
  background: rgba(255, 251, 246, 0.88);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 14px rgba(136, 110, 86, 0.06);
}

html[data-theme="dark"] .site-header {
  background: rgba(18, 22, 30, 0.9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.header-inner {
  width: min(100%, 1280px);
  padding: 1rem 1.5rem;
  gap: 1rem;
}

.logo-link {
  gap: 0.8rem;
  color: var(--color-text);
}

.logo-img {
  height: 2.8rem;
  max-width: 2.8rem;
  max-height: 2.8rem;
}

.logo-text {
  line-height: 1.06;
  font-weight: 800;
  font-size: 1rem;
}

.header-search {
  flex: 1 1 18rem;
  max-width: 24rem;
  margin-left: auto;
}

.header-search__input,
.input {
  min-height: 2.9rem;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
}

html[data-theme="dark"] .header-search__input,
html[data-theme="dark"] .input {
  background: rgba(17, 21, 28, 0.92);
}

.header-search__btn,
.btn-primary {
  min-height: 2.9rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff4c45, var(--color-primary));
  box-shadow: 0 10px 20px rgba(239, 49, 36, 0.18);
}

.header-right {
  gap: 0.9rem;
}

.header-tools {
  gap: 0.4rem;
}

.btn-icon,
.btn-theme,
.logout-form .btn {
  min-height: 2.9rem;
  height: 2.9rem;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  box-shadow: 0 4px 10px rgba(128, 106, 91, 0.05);
}

html[data-theme="dark"] .btn-icon,
html[data-theme="dark"] .btn-theme,
html[data-theme="dark"] .logout-form .btn {
  background: rgba(28, 33, 43, 0.92);
}

.main-content {
  width: min(100%, 1280px);
  padding: 1.25rem 1.5rem 2rem;
}

.guide-shell {
  display: grid;
  grid-template-columns: 20rem minmax(0, 1fr);
  gap: 1.35rem;
  align-items: stretch;
}

.sidebar-hero {
  position: relative;
  min-height: 42rem;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 75%, rgba(255, 243, 207, 0.68), transparent 18%),
    radial-gradient(circle at 74% 18%, rgba(255, 188, 224, 0.4), transparent 18%),
    radial-gradient(circle at 85% 78%, rgba(126, 215, 255, 0.34), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(229, 243, 255, 0.82) 46%, rgba(255, 248, 239, 0.9));
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 1.75rem 1.25rem 1rem;
}

html[data-theme="dark"] .sidebar-hero {
  background:
    radial-gradient(circle at 20% 75%, rgba(255, 243, 207, 0.12), transparent 18%),
    radial-gradient(circle at 74% 18%, rgba(255, 188, 224, 0.1), transparent 18%),
    radial-gradient(circle at 85% 78%, rgba(126, 215, 255, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(37, 45, 60, 0.9), rgba(26, 31, 42, 0.94));
}

.sidebar-hero__badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-self: stretch;
}

.sidebar-hero__badge span {
  display: inline-flex;
  align-items: center;
  min-height: 6.3rem;
  padding: 1rem 2rem 1rem 1.6rem;
  border-radius: 24px;
  background: linear-gradient(180deg, #ff5a5a, #ff4b4d);
  color: #fff;
  font-size: clamp(2.2rem, 2.1vw + 1rem, 3rem);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.06em;
  box-shadow:
    0 18px 32px rgba(239, 49, 36, 0.16),
    inset 0 -10px 20px rgba(0, 0, 0, 0.08);
}

.sidebar-hero__mascot-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.5rem 0 0;
}

.sidebar-hero__mascot {
  width: min(100%, 21rem);
  max-height: 32rem;
  object-fit: contain;
  filter: drop-shadow(0 20px 26px rgba(95, 42, 34, 0.18));
}

.sidebar-hero__blob,
.sidebar-hero__spark {
  position: absolute;
  pointer-events: none;
}

.sidebar-hero__blob {
  border-radius: 999px;
  filter: blur(0.4px);
}

.sidebar-hero__blob--a {
  top: 8rem;
  right: 1.1rem;
  width: 3.8rem;
  height: 3.8rem;
  background: rgba(255, 197, 141, 0.72);
}

.sidebar-hero__blob--b {
  bottom: 6.2rem;
  left: 0.3rem;
  width: 4.6rem;
  height: 4.6rem;
  background: rgba(188, 153, 255, 0.34);
}

.sidebar-hero__spark {
  width: 0.9rem;
  height: 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0.8;
}

.sidebar-hero__spark--a {
  top: 12rem;
  left: 1.4rem;
}

.sidebar-hero__spark--b {
  right: 3rem;
  bottom: 10rem;
}

.sidebar-hero--tools .sidebar-hero__blob--a,
.sidebar-hero--tools .sidebar-hero__blob--b {
  background: rgba(206, 221, 255, 0.42);
}

.sidebar-hero--support .sidebar-hero__blob--a {
  background: rgba(255, 201, 233, 0.65);
}

.sidebar-hero--knowledge .sidebar-hero__blob--b {
  background: rgba(135, 221, 255, 0.42);
}

.content-card.guide-card {
  position: relative;
  min-height: 42rem;
  padding: 1.7rem 1.85rem 1.45rem;
  border-radius: var(--radius-lg);
  background: var(--color-card);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.content-card.guide-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1rem;
  background: linear-gradient(90deg, #9ce4ff, #f4add4 46%, #7ccfff);
  opacity: 0.95;
}

html[data-theme="dark"] .content-card.guide-card {
  border-color: var(--color-border);
}

.guide-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
  color: var(--color-text-soft);
}

.guide-breadcrumbs a {
  color: var(--color-text-soft);
}

.guide-hero {
  position: relative;
  z-index: 1;
  padding-top: 0.8rem;
  margin-bottom: 1.4rem;
}

.guide-hero__title {
  margin: 0 0 0.55rem;
  color: var(--color-text);
  font-size: clamp(2rem, 2.1vw + 1rem, 3rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.06em;
}

.guide-hero__lead {
  max-width: 54rem;
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.48;
}

.guide-hero__lead p {
  margin: 0 0 0.6rem;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.landing-grid--knowledge {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-grid--work {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 15rem;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 245, 251, 0.98));
  box-shadow: var(--shadow-card);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.section-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 18px 34px rgba(130, 112, 160, 0.18),
    0 8px 18px rgba(130, 112, 160, 0.1);
  filter: saturate(1.04);
}

.section-card:focus-visible {
  outline: 3px solid rgba(239, 49, 36, 0.28);
  outline-offset: 4px;
}

.section-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 10.1rem;
  padding: 0.9rem;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 236, 196, 0.66), transparent 22%),
    radial-gradient(circle at 72% 18%, rgba(255, 181, 222, 0.5), transparent 24%),
    linear-gradient(135deg, var(--color-card-grad-a), var(--color-card-grad-b) 54%, var(--color-card-grad-c));
}

html[data-theme="dark"] .section-card__media {
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 236, 196, 0.1), transparent 22%),
    radial-gradient(circle at 72% 18%, rgba(255, 181, 222, 0.12), transparent 24%),
    linear-gradient(135deg, var(--color-card-grad-a), var(--color-card-grad-b) 54%, var(--color-card-grad-c));
}

.section-card__image,
.section-card__fallback {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.section-card__image {
  object-fit: contain;
  border-radius: 14px;
}

.section-card__fallback--sprite {
  background-image: var(--preview-image);
  background-repeat: no-repeat;
  background-position: var(--preview-position);
  background-size: var(--preview-size);
}

.section-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  padding: 0.8rem 0.9rem 1rem;
  text-align: center;
  background: rgba(255, 248, 250, 0.88);
}

html[data-theme="dark"] .section-card__body {
  background: rgba(27, 31, 40, 0.88);
}

.section-card__title {
  color: var(--color-text);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.section-card__meta {
  color: var(--color-text);
  font-size: 1.08rem;
  font-weight: 800;
}

.guide-page-layout {
  margin-top: 0.5rem;
}

.guide-blocks {
  gap: 1rem;
}

.guide-block {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-card-soft);
  box-shadow: 0 8px 18px rgba(120, 109, 97, 0.05);
}

html[data-theme="dark"] .guide-block {
  box-shadow: none;
}

.guide-block .block-text,
.guide-block .block-media,
.guide-block .block-pdf {
  color: var(--color-text);
}

.guide-block .block-text.md :is(h2, h3) {
  color: var(--color-text);
  letter-spacing: -0.04em;
}

.guide-block .block-text.md :is(p, ul, ol) {
  color: var(--color-text);
  line-height: 1.58;
}

.guide-page-nav {
  margin-top: 1.5rem;
  padding-top: 0;
  border-top: 0;
}

.nav-heading {
  color: var(--color-text-soft);
}

.nav-grid {
  gap: 0.75rem;
}

.nav-tile {
  min-height: 3.15rem;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  background: rgba(255, 251, 248, 0.96);
  box-shadow: 0 10px 18px rgba(129, 110, 91, 0.05);
}

html[data-theme="dark"] .nav-tile {
  background: rgba(28, 32, 42, 0.94);
  box-shadow: none;
}

.nav-tile--primary {
  background: rgba(239, 49, 36, 0.1);
  border-color: rgba(239, 49, 36, 0.24);
}

.nav-tile--home {
  border-style: solid;
}

.guide-recent {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-soft);
}

.guide-recent__list a {
  color: #bf6771;
}

.guide-search-form,
.feedback-form {
  gap: 0.75rem;
}

.search-page-form__row,
.feedback-form__actions {
  gap: 0.65rem;
}

.search-page-form__select {
  min-width: 12rem;
}

.search-result,
.empty-state {
  border-radius: 20px;
  border-color: var(--color-border);
  background: var(--color-card-soft);
}

.entry-shell {
  min-height: min(76vh, 52rem);
}

.entry-card {
  border-radius: 26px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.entry-subtitle,
.login-note,
.search-hint,
.search-empty-hint {
  color: var(--color-text-soft);
}

.site-footer {
  width: min(100%, 1280px);
  text-align: left;
  color: var(--color-text-soft);
  padding: 0.5rem 1.5rem 1.25rem;
}

.back-to-top {
  right: 1.1rem;
  bottom: 1.1rem;
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(180deg, #ff564d, var(--color-primary));
  box-shadow:
    0 14px 28px rgba(239, 49, 36, 0.24),
    0 6px 14px rgba(116, 72, 64, 0.16);
}

@media (max-width: 1120px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .header-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }

  .guide-shell {
    grid-template-columns: 17.5rem minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .guide-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-hero {
    min-height: 18rem;
    padding-bottom: 0;
  }

  .sidebar-hero__badge span {
    min-height: 5.1rem;
    font-size: clamp(1.9rem, 4vw, 2.5rem);
  }

  .sidebar-hero__mascot {
    width: min(100%, 14rem);
    max-height: 14rem;
  }

  .content-card.guide-card {
    min-height: 0;
  }

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

  .landing-grid--knowledge,
  .landing-grid--work {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .header-inner {
    padding: 0.9rem 1rem;
  }

  .main-content {
    padding: 1rem;
  }

  .header-right {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .header-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .content-card.guide-card {
    padding: 1.2rem 1rem 1rem;
  }

  .guide-hero__title {
    font-size: clamp(1.8rem, 6.4vw, 2.3rem);
  }

  .sidebar-hero__badge span {
    padding-left: 1.2rem;
    padding-right: 1.4rem;
  }
}

@media (max-width: 560px) {
  .landing-grid,
  .landing-grid--knowledge,
  .landing-grid--work {
    grid-template-columns: 1fr;
  }

  .search-page-form__row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-page-form__select {
    min-width: 0;
  }

  .section-card__media {
    min-height: 8.8rem;
  }
}

/* Visual tune v4 */
.header-inner {
  padding: 0.95rem 1.75rem;
  gap: 1.15rem;
}

.header-search {
  flex: 0 1 13.5rem;
  max-width: 13.5rem;
  gap: 0.55rem;
}

.header-search__input {
  min-height: 2.7rem;
  padding: 0.64rem 0.9rem;
  border-radius: 13px;
}

.header-search__btn,
.btn-primary {
  min-height: 2.7rem;
  padding: 0.66rem 1.15rem;
  border-radius: 13px;
  font-weight: 700;
}

.btn-icon,
.btn-theme,
.logout-form .btn {
  min-height: 2.7rem;
  height: 2.7rem;
  border-radius: 13px;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.btn-icon {
  min-width: 2.75rem;
}

.btn-theme {
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

.logout-form .btn {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

html[data-theme="dark"] .logout-form .btn {
  color: #d6deee;
}

.guide-shell {
  position: relative;
  overflow: visible;
}

.guide-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  height: 10rem;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(198, 238, 255, 0.98) 0%, rgba(238, 170, 216, 0.94) 48%, rgba(111, 201, 255, 0.98) 100%);
  z-index: 0;
}

html[data-theme="dark"] .guide-shell::before {
  background:
    linear-gradient(90deg, rgba(74, 118, 168, 0.72) 0%, rgba(150, 82, 136, 0.68) 48%, rgba(63, 129, 184, 0.72) 100%);
}

.sidebar-hero {
  min-height: 43rem;
  background:
    radial-gradient(circle at 20% 75%, rgba(255, 243, 207, 0.74), transparent 18%),
    radial-gradient(circle at 74% 18%, rgba(255, 188, 224, 0.44), transparent 18%),
    radial-gradient(circle at 85% 78%, rgba(126, 215, 255, 0.38), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(247, 243, 255, 0.48) 48%, rgba(255, 247, 238, 0.64));
  box-shadow: none;
}

html[data-theme="dark"] .sidebar-hero {
  background:
    radial-gradient(circle at 20% 75%, rgba(255, 243, 207, 0.12), transparent 18%),
    radial-gradient(circle at 74% 18%, rgba(255, 188, 224, 0.1), transparent 18%),
    radial-gradient(circle at 85% 78%, rgba(126, 215, 255, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(31, 39, 52, 0.26), rgba(25, 31, 42, 0.42) 48%, rgba(19, 22, 31, 0.58));
}

.sidebar-hero__badge span {
  min-height: 6rem;
  padding: 0.95rem 1.8rem 0.95rem 1.45rem;
  border-radius: 22px;
}

.sidebar-hero__mascot-wrap {
  justify-content: flex-start;
  align-items: flex-end;
  padding: 0.9rem 0 0;
}

.sidebar-hero__mascot {
  width: min(100%, 19.5rem);
  max-height: 31rem;
  margin-left: -0.55rem;
}

.content-card.guide-card {
  min-height: 43rem;
  margin-top: 0.15rem;
}

.content-card.guide-card::before {
  display: none;
}

@media (max-width: 1120px) {
  .guide-shell::before {
    left: -1.5rem;
    width: calc(100% + 3rem);
  }
}

@media (max-width: 980px) {
  .guide-shell::before {
    left: calc(50% - 50vw);
    width: 100vw;
    height: 12rem;
  }

  .sidebar-hero {
    min-height: 19rem;
  }

  .sidebar-hero__mascot {
    width: min(100%, 13.2rem);
    max-height: 13.2rem;
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .header-search {
    flex-basis: 100%;
    max-width: none;
  }

  .btn-icon,
  .btn-theme,
  .logout-form .btn,
  .header-search__btn {
    min-height: 2.6rem;
    height: 2.6rem;
  }
}

/* Section tiles v5 */
.landing-grid--settings {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.landing-grid--work {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-card {
  min-height: 15.4rem;
  border-radius: 22px;
  background: rgba(255, 248, 251, 0.92);
}

.section-card--illustrated .section-card__media {
  min-height: 10.4rem;
}

.section-card--illustrated .section-card__body {
  min-height: 4.9rem;
}

.section-card__media--numbered {
  position: relative;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 1.1rem 1rem 0.95rem;
  min-height: 10.4rem;
}

.section-card__title--top {
  display: block;
  max-width: 92%;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  text-wrap: balance;
}

.section-card__ghost {
  position: absolute;
  right: 0.7rem;
  bottom: 0.55rem;
  opacity: 0.14;
  transform: scale(1.1);
}

.section-card__body--numbered {
  min-height: 4.9rem;
  background: rgba(255, 247, 250, 0.96);
}

.section-card__title--bottom {
  text-transform: lowercase;
}

.section-card__icon {
  display: inline-flex;
  width: 4.8rem;
  height: 4.8rem;
  align-items: center;
  justify-content: center;
  color: #251a2e;
  filter: drop-shadow(0 10px 14px rgba(97, 77, 124, 0.16));
}

.section-card__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.section-card--illustrated .section-card__icon {
  color: #2f1d3b;
}

.section-card--illustrated.section-card--back_to_main .section-card__icon,
.section-card--illustrated.section-card--main .section-card__icon,
.section-card--knowledge .section-card__icon {
  width: 5.2rem;
  height: 5.2rem;
}

.section-card--numbered .section-card__meta {
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.section-card--illustrated .section-card__title--bottom {
  font-size: 1.05rem;
}

html[data-theme="dark"] .section-card {
  background: rgba(30, 34, 45, 0.9);
}

html[data-theme="dark"] .section-card__body--numbered,
html[data-theme="dark"] .section-card__body--illustrated {
  background: rgba(24, 28, 37, 0.92);
}

html[data-theme="dark"] .section-card__title--top {
  color: #fff;
}

@media (max-width: 980px) {
  .landing-grid--settings,
  .landing-grid--work {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .landing-grid--settings,
  .landing-grid--work {
    grid-template-columns: 1fr;
  }

  .section-card__title--top {
    max-width: 88%;
  }
}

/* Designer polish v6 */
.header-inner,
.main-content {
  width: min(100%, 1340px);
}

.guide-shell {
  position: relative;
  isolation: isolate;
  gap: 0;
  grid-template-columns: 19rem minmax(0, 1fr);
  align-items: stretch;
}

.guide-shell::before {
  top: 0;
  bottom: -1.1rem;
  right: calc(50% - 50vw);
  left: calc(50% - 50vw);
  width: auto;
  height: auto;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 72%, rgba(255, 222, 144, 0.42), transparent 16%),
    radial-gradient(circle at 18% 38%, rgba(224, 198, 255, 0.28), transparent 15%),
    radial-gradient(circle at 74% 88%, rgba(154, 224, 255, 0.34), transparent 18%),
    radial-gradient(circle at 92% 18%, rgba(245, 170, 215, 0.28), transparent 15%),
    linear-gradient(180deg, rgba(252, 248, 242, 0.92), rgba(248, 243, 248, 0.96) 42%, rgba(235, 247, 255, 0.95) 100%);
}

html[data-theme="dark"] .guide-shell::before {
  background:
    radial-gradient(circle at 12% 74%, rgba(255, 196, 110, 0.12), transparent 16%),
    radial-gradient(circle at 78% 86%, rgba(92, 172, 236, 0.18), transparent 18%),
    radial-gradient(circle at 88% 16%, rgba(208, 106, 174, 0.14), transparent 16%),
    linear-gradient(180deg, rgba(27, 32, 42, 0.92), rgba(32, 38, 51, 0.94) 42%, rgba(26, 38, 53, 0.96) 100%);
}

.guide-shell::after {
  content: "";
  position: absolute;
  top: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  height: 9.25rem;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(170, 224, 255, 0.92) 0%, rgba(234, 161, 213, 0.9) 48%, rgba(151, 173, 245, 0.92) 100%);
}

html[data-theme="dark"] .guide-shell::after {
  background:
    linear-gradient(90deg, rgba(77, 124, 178, 0.72) 0%, rgba(157, 90, 145, 0.7) 48%, rgba(91, 114, 188, 0.74) 100%);
}

.sidebar-hero {
  min-height: 44rem;
  padding: 1.95rem 0 0.4rem;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

html[data-theme="dark"] .sidebar-hero {
  background: transparent;
}

.sidebar-hero__badge {
  position: relative;
  z-index: 2;
  width: calc(100% + 2.8rem);
  margin-right: -2.8rem;
}

.sidebar-hero__badge span {
  width: 100%;
  min-height: 6.3rem;
  padding: 0.95rem 2rem 0.95rem 1.55rem;
  border-radius: 24px;
  font-size: clamp(2.15rem, 1.45rem + 1.18vw, 2.95rem);
  line-height: 0.94;
  box-shadow:
    0 18px 34px rgba(239, 49, 36, 0.18),
    0 5px 14px rgba(174, 74, 60, 0.12),
    inset 0 -14px 22px rgba(0, 0, 0, 0.08);
}

.sidebar-hero__mascot-wrap {
  min-height: 33rem;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1.1rem 0 0;
}

.sidebar-hero__mascot {
  width: min(100%, 21.5rem);
  max-height: 33rem;
  margin-left: -0.95rem;
  filter: drop-shadow(0 18px 26px rgba(98, 45, 38, 0.18));
}

.sidebar-hero__blob--a {
  top: 13rem;
  right: 1.6rem;
}

.sidebar-hero__blob--b {
  bottom: 7rem;
  left: -0.2rem;
}

.content-card.guide-card {
  position: relative;
  z-index: 3;
  min-height: 44rem;
  margin: 0 0 0 0.85rem;
  padding: 1.85rem 2.25rem 1.6rem;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow:
    0 20px 38px rgba(120, 119, 155, 0.12),
    0 6px 16px rgba(116, 110, 136, 0.08);
}

.guide-breadcrumbs {
  margin-bottom: 1rem;
}

.guide-hero {
  padding-top: 0.45rem;
  margin-bottom: 1.9rem;
}

.guide-hero__title {
  font-size: clamp(1.95rem, 1.15rem + 1.35vw, 2.9rem);
}

.guide-hero__lead {
  max-width: 49rem;
  font-size: clamp(1rem, 0.96rem + 0.28vw, 1.12rem);
  line-height: 1.42;
}

.guide-shell--landing .guide-hero__title {
  max-width: 16ch;
}

.guide-shell--main .landing-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.35rem;
}

.landing-grid--work {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
}

.landing-grid--settings {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.3rem;
}

.landing-grid--knowledge {
  grid-template-columns: repeat(3, minmax(13.8rem, 15.7rem));
  justify-content: flex-start;
  gap: 1.55rem;
}

.section-card {
  min-height: 15.25rem;
  border-radius: 22px;
  background: rgba(255, 250, 252, 0.94);
}

.section-card__media {
  min-height: 10.15rem;
  padding: 0.95rem;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 221, 177, 0.55), transparent 20%),
    radial-gradient(circle at 80% 16%, rgba(254, 139, 188, 0.34), transparent 24%),
    radial-gradient(circle at 50% 88%, rgba(255, 179, 214, 0.28), transparent 20%),
    linear-gradient(135deg, #72d6ff 0%, #c68bff 44%, #ff6fa8 100%);
}

.section-card__body {
  background: linear-gradient(180deg, rgba(255, 245, 250, 0.98), rgba(245, 239, 251, 0.94));
}

.section-card--illustrated .section-card__media {
  min-height: 9.45rem;
}

.section-card--illustrated .section-card__body {
  min-height: 4.4rem;
}

.section-card--illustrated .section-card__icon {
  width: 5.35rem;
  height: 5.35rem;
  color: #231728;
  filter: drop-shadow(0 10px 16px rgba(65, 38, 86, 0.22));
}

.section-card--illustrated .section-card__title--bottom {
  color: #111216;
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.section-card__media--numbered {
  min-height: 10.7rem;
  padding: 1.08rem 1rem 0.95rem;
}

.section-card__title--top {
  max-width: 88%;
  font-size: 1.14rem;
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -0.04em;
  text-wrap: pretty;
}

.section-card__ghost {
  right: 0.7rem;
  bottom: 0.55rem;
  opacity: 0.14;
  transform: scale(1.14);
}

.section-card__body--numbered {
  min-height: 4.5rem;
  justify-content: center;
  align-items: center;
}

.section-card__meta {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.guide-shell--main .section-card {
  min-height: 13.85rem;
}

.guide-shell--main .section-card__media {
  min-height: 8.9rem;
}

.guide-shell--knowledge .section-card {
  min-height: 13.95rem;
}

.guide-shell--knowledge .section-card__media {
  min-height: 9.05rem;
}

html[data-theme="dark"] .section-card {
  background: rgba(30, 34, 45, 0.92);
}

html[data-theme="dark"] .section-card__body {
  background: linear-gradient(180deg, rgba(24, 28, 37, 0.96), rgba(31, 36, 48, 0.92));
}

@media (max-width: 1240px) {
  .guide-shell {
    grid-template-columns: 18.75rem minmax(0, 1fr);
  }

  .sidebar-hero__badge {
    width: calc(100% + 2rem);
    margin-right: -2rem;
  }

  .content-card.guide-card {
    margin-left: 0.6rem;
  }
}

@media (max-width: 1080px) {
  .landing-grid--knowledge,
  .landing-grid--work,
  .landing-grid--settings,
  .guide-shell--main .landing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .guide-shell {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .guide-shell::before {
    left: -1.5rem;
    width: calc(100% + 3rem);
    bottom: 0;
  }

  .guide-shell::after {
    left: -1.5rem;
    width: calc(100% + 3rem);
  }

  .sidebar-hero {
    min-height: auto;
    padding: 0.8rem 0 0;
  }

  .sidebar-hero__badge {
    width: min(100%, 24rem);
    margin-right: 0;
  }

  .sidebar-hero__mascot-wrap {
    min-height: 18rem;
    justify-content: center;
    padding-top: 0.6rem;
  }

  .sidebar-hero__mascot {
    width: min(100%, 15.75rem);
    max-height: 18rem;
    margin-left: 0;
  }

  .content-card.guide-card {
    min-height: auto;
    margin-left: 0;
    padding-inline: 1.45rem;
  }
}

/* Tile image correction v10: keep generated artwork from being squeezed by old card rules. */
.page-shell .section-card--illustrated .section-card__media {
  height: 8.25rem;
  min-height: 0;
  overflow: hidden;
}

.page-shell .section-card__image {
  min-height: 0;
}

.page-shell .section-card--illustrated .section-card__image:not(.section-card__image--decor) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.guide-shell--main .section-card--illustrated .section-card__media {
  height: 8.65rem;
}

.guide-shell--knowledge .section-card--illustrated .section-card__media {
  height: 8.35rem;
}

.page-shell .section-card__media--numbered {
  position: relative;
  overflow: hidden;
}

.page-shell .section-card__image--decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
}

.page-shell .section-card__image--decor + .section-card__title--top,
.page-shell .section-card__media--numbered .section-card__title--top {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(38, 20, 60, 0.22);
}

.guide-shell--settings .section-card__media--numbered {
  min-height: 10.9rem;
  padding: 1.05rem 1rem 0.95rem;
  background:
    radial-gradient(circle at 16% 18%, rgba(205, 245, 255, 0.58), transparent 24%),
    radial-gradient(circle at 78% 80%, rgba(255, 93, 153, 0.38), transparent 28%),
    linear-gradient(135deg, #6fd8ff 0%, #bd86ff 48%, #ff67a7 100%);
}

.guide-shell--settings .section-card__body--numbered {
  background: linear-gradient(180deg, rgba(255, 247, 252, 0.98), rgba(246, 239, 251, 0.96));
}

.guide-shell--settings .section-card__title--top {
  max-width: 58%;
  color: #fff;
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

html[data-theme="dark"] .guide-shell--settings .section-card__body--numbered {
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .guide-shell--settings .section-card__title--top {
  color: #fff;
}

@media (max-width: 900px) {
  .page-shell .section-card--illustrated .section-card__media,
  .guide-shell--main .section-card--illustrated .section-card__media,
  .guide-shell--knowledge .section-card--illustrated .section-card__media {
    height: 9rem;
  }

  .guide-shell--settings .section-card__title--top {
    max-width: 64%;
  }
}

@media (max-width: 560px) {
  .landing-grid--knowledge,
  .guide-shell--main .landing-grid,
  .landing-grid--work,
  .landing-grid--settings {
    grid-template-columns: 1fr;
  }

  .sidebar-hero__badge span {
    min-height: 5.6rem;
    padding: 0.9rem 1.4rem 0.9rem 1.2rem;
    font-size: clamp(2rem, 9vw, 2.55rem);
  }

  .content-card.guide-card {
    padding: 1.35rem 1.1rem 1.25rem;
    border-radius: 22px;
  }

  .guide-hero__title {
    font-size: clamp(1.9rem, 9vw, 2.35rem);
  }
}

/* Layout correction v7 */
.main-content {
  width: 100%;
  max-width: none;
  padding: 0 0 2rem;
}

.main-page-shell {
  min-height: calc(100vh - 5.5rem);
  position: relative;
  overflow: hidden;
  padding: 2.3rem 1.9rem 2rem;
  background:
    radial-gradient(circle at 13% 44%, rgba(79, 204, 255, 0.62), transparent 33%),
    radial-gradient(circle at 48% 8%, rgba(255, 111, 200, 0.48), transparent 34%),
    radial-gradient(circle at 86% 30%, rgba(129, 145, 255, 0.46), transparent 34%),
    radial-gradient(circle at 73% 88%, rgba(151, 229, 255, 0.34), transparent 28%),
    radial-gradient(circle at 30% 88%, rgba(255, 228, 159, 0.28), transparent 24%),
    linear-gradient(135deg, #bceefe 0%, #f4d0ea 40%, #f6eee5 100%);
}

html[data-theme="dark"] .main-page-shell {
  background:
    radial-gradient(circle at 16% 44%, rgba(83, 205, 255, 0.22), transparent 32%),
    radial-gradient(circle at 50% 12%, rgba(255, 95, 190, 0.18), transparent 34%),
    radial-gradient(circle at 84% 34%, rgba(116, 137, 255, 0.24), transparent 34%),
    linear-gradient(135deg, #16202a 0%, #31233b 42%, #202834 100%);
}

.main-page-shell::before,
.main-page-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.main-page-shell::before {
  top: 4.5rem;
  left: 4.5rem;
  width: 26rem;
  height: 26rem;
  background: radial-gradient(circle at 50% 50%, rgba(255, 241, 208, 0.78), rgba(255, 241, 208, 0.12) 58%, transparent 72%);
  filter: blur(8px);
}

.main-page-shell::after {
  inset: 0;
  background:
    radial-gradient(circle at 21% 29%, rgba(255, 255, 255, 0.9) 0 0.18rem, transparent 0.2rem),
    radial-gradient(circle at 75% 18%, rgba(255, 224, 131, 0.9) 0 0.16rem, transparent 0.18rem),
    radial-gradient(circle at 82% 20%, rgba(255, 179, 214, 0.8) 0 0.14rem, transparent 0.16rem),
    radial-gradient(circle at 70% 16%, rgba(156, 226, 255, 0.86) 0 0.18rem, transparent 0.2rem),
    radial-gradient(circle at 20% 71%, rgba(186, 157, 255, 0.55) 0 1.8rem, transparent 1.9rem),
    radial-gradient(circle at 33% 34%, rgba(255, 204, 147, 0.72) 0 1.65rem, transparent 1.76rem),
    radial-gradient(circle at 35% 69%, rgba(98, 209, 255, 0.5) 0 1.35rem, transparent 1.46rem);
  opacity: 0.92;
}

.guide-shell {
  max-width: 1320px;
  margin: 0 auto;
  min-height: calc(100vh - 5.5rem - 4.5rem);
  display: grid;
  grid-template-columns: 22.5rem minmax(0, 1fr);
  gap: 1.45rem;
  align-items: start;
  position: relative;
  z-index: 1;
  isolation: isolate;
}

.guide-shell::before,
.guide-shell::after {
  display: none;
}

.sidebar-hero {
  position: relative;
  min-height: 38.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2.1rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

html[data-theme="dark"] .sidebar-hero {
  background: transparent;
}

.sidebar-hero__badge {
  width: 100%;
  margin: 0;
  position: relative;
  z-index: 2;
}

.sidebar-hero__badge span {
  width: 100%;
  max-width: 21.75rem;
  min-height: 0;
  padding: 1.55rem 1.65rem;
  border-radius: 1.2rem;
  font-size: clamp(2.35rem, 2rem + 0.95vw, 2.95rem);
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0.875rem 1.75rem rgba(240, 52, 52, 0.32);
}

.sidebar-hero__mascot-wrap {
  width: 100%;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
}

.sidebar-hero__mascot {
  width: min(100%, 21rem);
  height: auto;
  max-height: 26rem;
  object-fit: contain;
  margin-left: 0;
  margin-top: 0.35rem;
  filter: drop-shadow(0 18px 24px rgba(126, 59, 47, 0.18));
}

.sidebar-hero__note {
  margin-top: auto;
  padding-left: 0.15rem;
  color: rgba(87, 80, 73, 0.78);
  font-size: 0.98rem;
  line-height: 1.2;
}

.sidebar-hero__blob--a {
  top: 14rem;
  right: 1.65rem;
  width: 3.3rem;
  height: 3.3rem;
  background: rgba(255, 201, 149, 0.82);
}

.sidebar-hero__blob--b {
  bottom: 11rem;
  left: 0.75rem;
  width: 3rem;
  height: 3rem;
  background: rgba(184, 146, 255, 0.52);
}

.content-card.guide-card {
  margin: 0;
  min-height: 39rem;
  padding: 2.15rem 2.35rem 1.75rem;
  border-radius: 1.3rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1.125rem 2.5rem rgba(0, 0, 0, 0.16);
  border: 0;
  display: flex;
  flex-direction: column;
}

html[data-theme="dark"] .content-card.guide-card {
  background: rgba(25, 29, 39, 0.94);
}

.guide-hero {
  padding-top: 0;
  margin-bottom: 1.95rem;
}

.guide-hero__title {
  font-size: clamp(2rem, 1.3rem + 1.5vw, 3.5rem);
  max-width: none;
}

.guide-shell--landing .guide-hero__title {
  max-width: none;
}

.guide-hero__lead {
  max-width: 53rem;
  font-size: 1.06rem;
  line-height: 1.48;
}

.landing-grid,
.guide-shell--main .landing-grid,
.landing-grid--knowledge,
.landing-grid--work,
.landing-grid--settings {
  gap: 1.3rem;
}

.guide-shell--main .landing-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.landing-grid--knowledge {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
  gap: 1.45rem;
}

.landing-grid--work {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-grid--settings {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-card {
  min-height: 14.75rem;
}

.guide-shell--main .section-card,
.guide-shell--knowledge .section-card {
  min-height: 13.25rem;
}

.guide-shell--main .section-card__media,
.guide-shell--knowledge .section-card__media {
  min-height: 8.5rem;
}

.guide-recent {
  margin-top: auto;
}

@media (max-width: 1100px) {
  .main-page-shell {
    padding-inline: 1.35rem;
  }

  .guide-shell {
    grid-template-columns: 18.25rem minmax(0, 1fr);
    gap: 1.2rem;
  }

  .sidebar-hero__badge span {
    max-width: 18rem;
    font-size: 2.2rem;
  }

  .sidebar-hero__mascot {
    width: min(100%, 17rem);
    max-height: 22rem;
  }

  .landing-grid--knowledge,
  .landing-grid--work,
  .landing-grid--settings,
  .guide-shell--main .landing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .main-page-shell {
    min-height: calc(100vh - 5.5rem);
    padding: 1.5rem 1rem 1.25rem;
  }

  .guide-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .sidebar-hero {
    min-height: auto;
    align-items: center;
  }

  .sidebar-hero__badge {
    margin-bottom: 1.5rem;
  }

  .sidebar-hero__badge span {
    max-width: 100%;
    text-align: center;
  }

  .sidebar-hero__mascot-wrap {
    justify-content: center;
  }

  .sidebar-hero__mascot {
    width: min(100%, 14.5rem);
    max-height: 18rem;
    margin-bottom: 0;
  }

  .sidebar-hero__note {
    margin-top: 0.15rem;
    align-self: center;
    text-align: center;
  }

  .content-card.guide-card {
    min-height: auto;
    padding: 1.5rem;
  }
}

@media (max-width: 560px) {
  .guide-shell--main .landing-grid,
  .landing-grid--knowledge,
  .landing-grid--work,
  .landing-grid--settings {
    grid-template-columns: 1fr;
  }

  .sidebar-hero__badge span {
    font-size: 2rem;
    padding: 1.35rem 1.2rem;
  }

  .sidebar-hero__mascot {
    width: min(100%, 13rem);
  }
}

/* Design alignment v8 */
.main-content {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 0 2rem;
}

.page-shell {
  width: 100%;
  min-height: calc(100vh - 80px);
  padding: 42px 32px 32px;
  background:
    radial-gradient(circle at 8% 35%, rgba(56, 203, 255, 0.75) 0%, rgba(56, 203, 255, 0.38) 24%, transparent 46%),
    radial-gradient(circle at 48% 8%, rgba(255, 85, 190, 0.62) 0%, rgba(255, 85, 190, 0.32) 28%, transparent 52%),
    radial-gradient(circle at 92% 28%, rgba(108, 128, 255, 0.62) 0%, rgba(108, 128, 255, 0.30) 30%, transparent 56%),
    radial-gradient(circle at 25% 88%, rgba(255, 224, 145, 0.48) 0%, transparent 42%),
    linear-gradient(135deg, #b9eeff 0%, #f7c8ec 42%, #d8e8ff 70%, #fff3df 100%);
  background-attachment: fixed;
  box-sizing: border-box;
}

html[data-theme="dark"] .page-shell {
  background:
    radial-gradient(circle at 10% 35%, rgba(35, 180, 255, 0.22), transparent 42%),
    radial-gradient(circle at 55% 8%, rgba(255, 75, 180, 0.18), transparent 45%),
    radial-gradient(circle at 90% 30%, rgba(130, 110, 255, 0.20), transparent 48%),
    linear-gradient(135deg, #10141c 0%, #171b26 48%, #102030 100%);
}

.page-shell::before,
.page-shell::after,
.page-shell .sidebar-hero__blob,
.page-shell .sidebar-hero__spark {
  display: none !important;
}

.page-shell > .page-layout {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 620px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.page-hero {
  width: 360px;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 36px;
  padding: 0;
}

.section-title-badge {
  width: 340px;
  max-width: 100%;
}

.section-title-badge span {
  width: 340px;
  max-width: 100%;
  height: 92px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  overflow: hidden;
  background: linear-gradient(135deg, #ff5a5f 0%, #f63737 100%);
  border-radius: 20px;
  box-shadow: 0 18px 34px rgba(243, 55, 55, 0.34);
  color: #fff;
  font-size: clamp(36px, 2vw, 40px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.page-hero .sidebar-hero__mascot-wrap {
  width: 100%;
  flex: 0 0 auto;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0;
}

.page-hero .mascot {
  width: 330px;
  max-width: 100%;
  height: auto;
  max-height: 390px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 18px 26px rgba(104, 61, 52, 0.16));
}

.footer-note {
  margin-top: auto;
  color: rgba(0, 0, 0, 0.45);
  font-size: 14px;
  line-height: 1.25;
}

html[data-theme="dark"] .footer-note {
  color: rgba(255, 255, 255, 0.52);
}

.content-panel {
  min-height: 620px;
  padding: 34px 36px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 45px rgba(38, 55, 77, 0.18);
  backdrop-filter: blur(8px);
  border: 0;
}

html[data-theme="dark"] .content-panel {
  background: rgba(22, 26, 36, 0.92);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.35);
}

.content-panel .guide-hero__title,
html[data-theme="dark"] .content-panel .guide-hero__title {
  color: #111216;
}

html[data-theme="dark"] .content-panel .guide-hero__title {
  color: #fff;
}

.content-panel .guide-hero__lead,
.content-panel .guide-block .block-text,
.content-panel .guide-block .block-media,
.content-panel .guide-block .block-pdf {
  color: rgba(17, 18, 22, 0.84);
}

html[data-theme="dark"] .content-panel .guide-hero__lead,
html[data-theme="dark"] .content-panel .guide-block .block-text,
html[data-theme="dark"] .content-panel .guide-block .block-media,
html[data-theme="dark"] .content-panel .guide-block .block-pdf {
  color: rgba(255, 255, 255, 0.82);
}

.content-panel .section-card {
  border-radius: 22px;
  overflow: hidden;
}

html[data-theme="dark"] .content-panel .section-card {
  background: rgba(31, 36, 48, 0.94);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.24),
    0 6px 16px rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] .content-panel .section-card__media {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 221, 177, 0.18), transparent 20%),
    radial-gradient(circle at 80% 16%, rgba(254, 139, 188, 0.18), transparent 24%),
    radial-gradient(circle at 50% 88%, rgba(255, 179, 214, 0.12), transparent 20%),
    linear-gradient(135deg, rgba(83, 182, 255, 0.92) 0%, rgba(167, 114, 255, 0.9) 44%, rgba(255, 98, 166, 0.92) 100%);
}

html[data-theme="dark"] .content-panel .section-card__body {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .content-panel .section-card__title--bottom,
html[data-theme="dark"] .content-panel .section-card__meta {
  color: #fff;
}

html[data-theme="dark"] .content-panel .section-card__title--top {
  color: #fff;
}

html[data-theme="dark"] .content-panel .guide-recent,
html[data-theme="dark"] .content-panel .guide-recent__label {
  color: rgba(255, 255, 255, 0.82);
}

html[data-theme="dark"] .content-panel .guide-recent__list a {
  color: #ff8f9a;
}

@media (max-width: 1100px) {
  .page-shell {
    padding: 36px 24px 28px;
  }

  .page-shell > .page-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 22px;
  }

  .page-hero {
    width: 280px;
  }

  .section-title-badge,
  .section-title-badge span {
    width: 280px;
  }

  .section-title-badge span {
    font-size: 34px;
  }

  .page-hero .mascot {
    width: 270px;
    max-height: 330px;
  }
}

@media (max-width: 900px) {
  .page-shell {
    min-height: calc(100vh - 80px);
    padding: 24px 16px 20px;
    background-attachment: scroll;
  }

  .page-shell > .page-layout {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .page-hero {
    width: 100%;
    min-height: auto;
    align-items: center;
    gap: 24px;
  }

  .section-title-badge {
    width: 100%;
  }

  .section-title-badge span {
    width: 100%;
    justify-content: center;
    text-align: center;
    font-size: clamp(30px, 7vw, 38px);
  }

  .page-hero .sidebar-hero__mascot-wrap {
    justify-content: center;
  }

  .page-hero .mascot {
    width: 220px;
    max-height: 280px;
  }

  .footer-note {
    margin-top: 0;
    text-align: center;
  }

  .content-panel {
    min-height: auto;
    padding: 28px 22px;
  }
}

/* Layout repair v9 */
html[data-theme="light"] .main-content,
html[data-theme="dark"] .main-content {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 0 2rem;
}

html[data-theme="light"] .page-shell,
html[data-theme="dark"] .page-shell {
  width: 100vw;
  min-height: calc(100vh - 80px);
  margin: 0;
  padding: 72px 32px 32px;
  box-sizing: border-box;
  background-attachment: fixed;
}

html[data-theme="light"] .page-shell {
  background:
    radial-gradient(circle at 8% 35%, rgba(56, 203, 255, 0.78) 0%, rgba(56, 203, 255, 0.42) 24%, transparent 47%),
    radial-gradient(circle at 48% 8%, rgba(255, 85, 190, 0.66) 0%, rgba(255, 85, 190, 0.34) 28%, transparent 53%),
    radial-gradient(circle at 92% 28%, rgba(108, 128, 255, 0.66) 0%, rgba(108, 128, 255, 0.34) 30%, transparent 57%),
    radial-gradient(circle at 24% 90%, rgba(255, 224, 145, 0.54) 0%, transparent 43%),
    linear-gradient(135deg, #b9eeff 0%, #f7c8ec 42%, #d8e8ff 70%, #fff3df 100%);
}

html[data-theme="dark"] .page-shell {
  background:
    radial-gradient(circle at 10% 35%, rgba(35, 180, 255, 0.22), transparent 42%),
    radial-gradient(circle at 55% 8%, rgba(255, 75, 180, 0.18), transparent 45%),
    radial-gradient(circle at 90% 30%, rgba(130, 110, 255, 0.2), transparent 48%),
    linear-gradient(135deg, #10141c 0%, #171b26 48%, #102030 100%);
}

html[data-theme="light"] .page-shell > .page-layout.guide-shell,
html[data-theme="dark"] .page-shell > .page-layout.guide-shell {
  max-width: 1280px;
  min-height: 620px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.page-shell .page-hero.sidebar-hero {
  width: 340px;
  min-height: 620px;
  gap: 36px;
  padding: 0;
}

.page-shell .section-title-badge,
.page-shell .section-title-badge span {
  width: 340px;
  max-width: 340px;
}

.page-shell .section-title-badge {
  margin: 0;
}

.page-shell .section-title-badge span {
  height: 92px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  border-radius: 20px;
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.page-shell .page-hero .mascot {
  width: 315px;
  max-width: 315px;
  max-height: 380px;
  object-fit: contain;
}

.page-shell .content-panel.content-card.guide-card {
  margin: 0;
  min-height: 620px;
  padding: 34px 36px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 45px rgba(38, 55, 77, 0.18);
  border: 0;
}

html[data-theme="dark"] .page-shell .content-panel.content-card.guide-card {
  background: rgba(22, 26, 36, 0.92);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.35);
}

.page-shell .section-card--illustrated .section-card__media {
  min-height: 8.5rem;
  padding: 0;
  background: none;
}

.page-shell .section-card__image {
  width: 100%;
  height: 100%;
  min-height: 8.5rem;
  display: block;
  object-fit: cover;
  border-radius: 0;
}

.page-shell .section-card--illustrated .section-card__body {
  min-height: 4.35rem;
}

.page-shell .section-card--illustrated .section-card__title--bottom {
  font-size: 1.05rem;
  letter-spacing: 0;
}

@media (max-width: 1100px) {
  html[data-theme="light"] .page-shell > .page-layout.guide-shell,
  html[data-theme="dark"] .page-shell > .page-layout.guide-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .page-shell .page-hero.sidebar-hero,
  .page-shell .section-title-badge,
  .page-shell .section-title-badge span {
    width: 280px;
    max-width: 280px;
  }

  .page-shell .section-title-badge span {
    font-size: 32px;
  }

  .page-shell .page-hero .mascot {
    width: 260px;
    max-width: 260px;
  }
}

@media (max-width: 900px) {
  html[data-theme="light"] .page-shell,
  html[data-theme="dark"] .page-shell {
    padding: 24px 16px 20px;
    background-attachment: scroll;
  }

  html[data-theme="light"] .page-shell > .page-layout.guide-shell,
  html[data-theme="dark"] .page-shell > .page-layout.guide-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .page-shell .page-hero.sidebar-hero,
  .page-shell .section-title-badge,
  .page-shell .section-title-badge span {
    width: 100%;
    max-width: 100%;
  }

  .page-shell .section-title-badge span {
    justify-content: center;
    font-size: 34px;
  }

  .page-shell .page-hero .mascot {
    width: 220px;
    max-width: 220px;
    max-height: 280px;
  }
}

/* Final card geometry v11: this must stay after older layout repair blocks. */
.page-shell .section-card--illustrated .section-card__media {
  aspect-ratio: 1.32 / 1;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  background: none !important;
}

.page-shell .section-card--illustrated .section-card__image:not(.section-card__image--decor) {
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}

.guide-shell--main .section-card--illustrated .section-card__media {
  aspect-ratio: 1.24 / 1;
}

.guide-shell--knowledge .section-card--illustrated .section-card__media {
  aspect-ratio: 1.36 / 1;
}

.page-shell .section-card__media--numbered {
  position: relative;
  overflow: hidden;
}

.page-shell .section-card__image--decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  object-fit: cover !important;
  object-position: right center !important;
  border-radius: 0;
}

.guide-shell--settings .section-card__media--numbered {
  min-height: 10.9rem;
  padding: 1.05rem 1rem 0.95rem;
}

.guide-shell--settings .section-card__title--top {
  position: relative;
  z-index: 1;
  max-width: 52%;
  text-shadow: 0 2px 10px rgba(38, 20, 60, 0.22);
}

@media (max-width: 900px) {
  .guide-shell--main .section-card--illustrated .section-card__media,
  .guide-shell--knowledge .section-card--illustrated .section-card__media {
    aspect-ratio: 1.45 / 1;
  }

  .guide-shell--settings .section-card__title--top {
    max-width: 58%;
  }
}

/* Final visual match v12: keep tile artwork proportional and fix settings text wrapping. */
.page-shell .section-card--illustrated .section-card__media {
  aspect-ratio: 1.34 / 1;
  height: auto !important;
  min-height: 0 !important;
  padding: 0.35rem !important;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(205, 242, 255, 0.58), transparent 25%),
    radial-gradient(circle at 76% 82%, rgba(255, 96, 153, 0.38), transparent 28%),
    linear-gradient(135deg, #65d7ff 0%, #ba86ff 48%, #ff69a8 100%) !important;
}

.page-shell .section-card--illustrated .section-card__image:not(.section-card__image--decor) {
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 14px;
}

.guide-shell--knowledge .section-card--illustrated .section-card__media {
  aspect-ratio: 1.48 / 1;
}

.guide-shell--settings .section-card__image--decor {
  object-fit: contain !important;
  object-position: right center !important;
  transform: translateX(4%);
}

.guide-shell--settings .section-card__title--top {
  max-width: 70%;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  text-wrap: balance;
}

.guide-shell--settings .section-card__media--numbered {
  padding: 1.05rem 0.9rem 0.95rem;
}

@media (max-width: 900px) {
  .page-shell .section-card--illustrated .section-card__media,
  .guide-shell--knowledge .section-card--illustrated .section-card__media {
    aspect-ratio: 1.45 / 1;
  }

  .guide-shell--settings .section-card__title--top {
    max-width: 72%;
  }
}

/* Compact tile grid v13: cards should be fixed-size tiles, not stretched panels. */
.page-shell .landing-grid {
  display: grid;
  justify-content: start;
  align-items: start;
  gap: 18px;
  width: auto;
  max-width: 100%;
  margin-top: 1.45rem;
}

.page-shell .guide-shell--main .landing-grid {
  grid-template-columns: repeat(4, 170px) !important;
}

.page-shell .landing-grid--knowledge {
  grid-template-columns: repeat(3, 190px) !important;
}

.page-shell .landing-grid--settings,
.page-shell .landing-grid--work {
  grid-template-columns: repeat(4, 180px) !important;
}

.page-shell .section-card {
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  border-radius: 18px;
}

.page-shell .section-card--illustrated {
  height: 178px;
}

.page-shell .section-card--illustrated .section-card__media {
  height: 118px !important;
  aspect-ratio: auto;
  padding: 10px !important;
}

.page-shell .section-card--illustrated .section-card__image:not(.section-card__image--decor) {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 12px;
}

.page-shell .section-card--illustrated .section-card__body {
  height: 60px;
  min-height: 60px;
  flex: 0 0 60px;
  padding: 0 10px;
}

.page-shell .section-card--illustrated .section-card__title--bottom {
  font-size: 0.98rem;
  line-height: 1.08;
  text-align: center;
}

.page-shell .landing-grid--knowledge .section-card--illustrated {
  height: 184px;
}

.page-shell .landing-grid--knowledge .section-card--illustrated .section-card__media {
  height: 124px !important;
}

.page-shell .section-card--numbered {
  height: 222px;
}

.page-shell .section-card__media--numbered {
  height: 168px;
  min-height: 168px !important;
  padding: 14px 12px !important;
}

.page-shell .section-card__body--numbered {
  height: 54px;
  min-height: 54px;
  flex: 0 0 54px;
  padding: 0 10px;
}

.guide-shell--settings .section-card__image--decor {
  inset: 8px 8px 8px 54px;
  width: auto;
  height: auto;
  object-fit: contain !important;
  object-position: right center !important;
  transform: none;
}

.guide-shell--settings .section-card__title--top,
.guide-shell--work .section-card__title--top {
  max-width: 92%;
  font-size: 0.96rem;
  line-height: 1.06;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  text-wrap: balance;
}

@media (max-width: 1180px) {
  .page-shell .guide-shell--main .landing-grid {
    grid-template-columns: repeat(2, 170px) !important;
  }

  .page-shell .landing-grid--knowledge {
    grid-template-columns: repeat(2, 190px) !important;
  }

  .page-shell .landing-grid--settings,
  .page-shell .landing-grid--work {
    grid-template-columns: repeat(2, 180px) !important;
  }
}

@media (max-width: 560px) {
  .page-shell .guide-shell--main .landing-grid,
  .page-shell .landing-grid--knowledge,
  .page-shell .landing-grid--settings,
  .page-shell .landing-grid--work {
    grid-template-columns: minmax(0, 100%) !important;
  }

  .page-shell .section-card--illustrated,
  .page-shell .section-card--numbered {
    width: min(100%, 210px);
    justify-self: center;
  }
}

/* Unified tile surface v14: CSS owns the card background, icons are transparent objects. */
.page-shell .section-card__media {
  background:
    radial-gradient(circle at 20% 20%, rgba(70, 211, 255, 0.9), transparent 34%),
    radial-gradient(circle at 84% 24%, rgba(255, 80, 176, 0.78), transparent 38%),
    radial-gradient(circle at 52% 88%, rgba(255, 176, 208, 0.78), transparent 44%),
    linear-gradient(135deg, #54d2ff 0%, #b980ff 46%, #ff5d9f 100%) !important;
}

.page-shell .section-card__media :is(img, svg),
.page-shell .section-card__icon {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.page-shell .section-card--illustrated .section-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-shell .section-card--illustrated .section-card__icon {
  width: 78px;
  height: 78px;
  color: #221827;
  filter:
    drop-shadow(0 8px 10px rgba(33, 20, 45, 0.18))
    drop-shadow(0 0 0 rgba(255, 255, 255, 0));
}

.page-shell .section-card--knowledge.section-card--illustrated .section-card__icon {
  width: 84px;
  height: 84px;
}

.page-shell .section-card__media--numbered {
  background:
    radial-gradient(circle at 16% 16%, rgba(155, 226, 255, 0.82), transparent 31%),
    radial-gradient(circle at 82% 78%, rgba(255, 93, 160, 0.55), transparent 36%),
    linear-gradient(135deg, #8ed6ff 0%, #bf7dff 48%, #f768ae 100%) !important;
}

.page-shell .section-card__ghost {
  right: 0.85rem;
  bottom: 0.7rem;
  opacity: 0.18;
  transform: scale(1.12);
}

.page-shell .section-card__ghost .section-card__icon {
  width: 4.5rem;
  height: 4.5rem;
  color: rgba(91, 42, 118, 0.72);
  filter: none;
}

.page-shell .section-card__title--top {
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

/* Render object tiles v15: transparent 3D objects sit on the CSS card surface. */
.page-shell .section-card__media img {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.page-shell .section-card--illustrated .section-card__image:not(.section-card__image--decor) {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain !important;
  object-position: center !important;
  filter: drop-shadow(0 10px 12px rgba(42, 22, 58, 0.18));
}

.guide-shell--main .section-card--illustrated .section-card__image:not(.section-card__image--decor) {
  max-width: 96%;
  max-height: 96%;
}

.guide-shell--knowledge .section-card--illustrated .section-card__image:not(.section-card__image--decor) {
  max-width: 94%;
  max-height: 94%;
}

.guide-shell--settings .section-card__image--decor {
  inset: 18px 12px 16px 76px;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain !important;
  object-position: right center !important;
  filter: drop-shadow(0 10px 12px rgba(42, 22, 58, 0.18));
}

.guide-shell--settings .section-card__title--top {
  max-width: 61%;
}

/* Settings object alignment v16: keep render objects inside the tile instead of clipping at the edge. */
.guide-shell--settings .section-card__image--decor {
  inset: auto 12px 12px auto;
  width: 82px;
  height: 82px;
  max-width: 46%;
  max-height: 62%;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}

.guide-shell--settings .section-card__media--numbered {
  padding: 14px 12px !important;
}

.guide-shell--settings .section-card__title--top {
  max-width: 76%;
  padding-right: 46px;
}

/* Typography system v17: Alfa Styrene fonts from local design assets. */
:root {
  --font-sans: "Styrene A LC", "Styrene B LC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ui: "Styrene B LC", "Styrene A LC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Styrene B LC", "Styrene A LC", system-ui, sans-serif;
  --font: var(--font-sans);
}

body,
button,
input,
textarea,
select {
  font-family: var(--font-sans);
  font-synthesis: none;
}

.logo-text,
.header-actions,
.header-search,
.btn,
.btn-icon,
.btn-theme,
.logout-form .btn,
.feedback-trigger,
.guide-recent,
.guide-block,
.block-text,
.block-media,
.block-pdf,
.feedback-form,
.admin-shell {
  font-family: var(--font-sans);
}

.guide-hero__title,
.section-title-badge span,
.section-card__title,
.section-card__meta,
.nav-tile,
.landing-card__body,
.login-card h1,
.admin-title,
.admin-card h2,
.page-toc-title {
  font-family: var(--font-display);
}

.guide-hero__title,
.section-title-badge span {
  font-weight: 900;
  letter-spacing: -0.055em;
}

.section-card__title,
.section-card__meta,
.nav-tile,
.btn,
.btn-icon,
.btn-theme,
.logout-form .btn,
.header-search__btn {
  font-weight: 700;
}

.guide-hero__lead,
.guide-block .block-text,
.guide-block .block-media,
.guide-block .block-pdf {
  font-weight: 400;
  letter-spacing: -0.015em;
}

/* Typography tuning v18: avoid the heavy uneven "fence" look on Cyrillic text. */
:root {
  --font-display: "Styrene B LC", "Styrene A LC", system-ui, sans-serif;
}

.guide-hero__title {
  font-family: "Styrene B LC", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.section-title-badge span {
  font-family: "Styrene B LC", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.section-card__title,
.section-card__meta,
.logo-text,
.btn,
.btn-icon,
.btn-theme,
.logout-form .btn,
.header-search__btn,
.guide-recent,
.guide-hero__lead {
  font-family: "Styrene B LC", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-card__title,
.section-card__meta,
.btn,
.btn-icon,
.btn-theme,
.logout-form .btn,
.header-search__btn {
  font-weight: 700;
}

/* Card image stability v19: prevent transient wide image flash on reload. */
.page-shell .section-card__media {
  contain: layout paint;
}

.page-shell .section-card--illustrated .section-card__image:not(.section-card__image--decor) {
  width: auto !important;
  height: auto !important;
  max-width: 88% !important;
  max-height: 88% !important;
  aspect-ratio: auto;
  display: block;
}

.guide-shell--main .section-card--illustrated .section-card__image:not(.section-card__image--decor) {
  max-width: 90% !important;
  max-height: 90% !important;
}

.guide-shell--knowledge .section-card--illustrated .section-card__image:not(.section-card__image--decor) {
  max-width: 86% !important;
  max-height: 86% !important;
}

.guide-shell--settings .section-card__image--decor {
  width: 82px !important;
  height: 82px !important;
  max-width: 82px !important;
  max-height: 82px !important;
  aspect-ratio: 1 / 1;
  display: block;
}

/* Footer gap removal v20: no grey strip after the full-page gradient shell. */
html,
body {
  overflow-x: hidden;
}

body {
  padding-bottom: 0 !important;
}

html[data-theme="light"] .main-content,
html[data-theme="dark"] .main-content {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-bottom: 0 !important;
  background: transparent;
}

html[data-theme="light"] .page-shell,
html[data-theme="dark"] .page-shell {
  width: 100%;
  min-height: calc(100dvh - 88px);
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

/* New material cards v21: show generated 3D objects on newly added work tiles. */
.guide-shell--work .section-card__image--decor {
  inset: auto 10px 12px auto !important;
  width: 86px !important;
  height: 86px !important;
  max-width: 86px !important;
  max-height: 86px !important;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain !important;
  object-position: center !important;
  opacity: 0.98;
  transform: none !important;
}

.guide-shell--work .section-card__image--decor + .section-card__title--top {
  max-width: 68%;
}

.guide-shell--work .section-card__media--numbered {
  padding: 14px 12px !important;
}

@media (max-width: 560px) {
  .guide-shell--work .section-card__image--decor {
    width: 78px !important;
    height: 78px !important;
    max-width: 78px !important;
    max-height: 78px !important;
  }
}

/* Typography and page navigation v22: calmer text, consistent bottom actions. */
:root {
  --font-sans: "Styrene A LC", "Styrene B LC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ui: "Styrene B LC", "Styrene A LC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Styrene B LC", "Styrene A LC", system-ui, sans-serif;
}

body,
input,
textarea,
select,
.guide-block,
.block-text,
.block-media,
.block-pdf,
.guide-hero__lead,
.feedback-form {
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0;
}

.guide-block,
.guide-hero__lead,
.block-text {
  line-height: 1.55;
}

.logo-text,
.header-actions,
.header-search,
.btn,
.btn-icon,
.btn-theme,
.logout-form .btn,
.feedback-trigger,
.guide-recent,
.nav-tile,
.section-card__title,
.section-card__meta {
  font-family: var(--font-ui);
  letter-spacing: 0;
}

.guide-hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.018em;
  line-height: 1.08;
}

.section-title-badge span {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.012em;
  line-height: 1;
}

.guide-hero__lead,
.guide-recent,
.guide-recent__label,
.guide-recent__list a {
  font-weight: 500;
}

.section-card__title,
.section-card__meta {
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}

.btn,
.btn-icon,
.btn-theme,
.logout-form .btn,
.header-search__btn,
.nav-tile {
  font-weight: 600;
}

.guide-page-nav {
  margin-top: 1.65rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--color-border);
}

.guide-page-nav .nav-heading {
  margin-bottom: 0.75rem;
  color: var(--color-text-soft);
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.guide-page-nav .nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 0.75rem;
}

.guide-page-nav .nav-tile {
  min-width: 0;
  max-width: none;
  min-height: 3.1rem;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  background: rgba(255, 251, 248, 0.96);
  color: var(--color-text);
  box-shadow: 0 10px 18px rgba(129, 110, 91, 0.05);
}

.guide-page-nav .nav-tile--primary {
  background: rgba(239, 49, 36, 0.1);
  border-color: rgba(239, 49, 36, 0.26);
}

.guide-page-nav .nav-tile--home {
  background: rgba(255, 255, 255, 0.78);
}

html[data-theme="dark"] .guide-page-nav .nav-tile {
  background: rgba(28, 32, 42, 0.94);
  color: var(--color-text);
  box-shadow: none;
}

html[data-theme="dark"] .guide-page-nav .nav-tile--primary {
  background: rgba(239, 49, 36, 0.18);
  border-color: rgba(255, 118, 110, 0.34);
}

html[data-theme="dark"] .guide-page-nav .nav-tile--home {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 560px) {
  .guide-hero__title {
    letter-spacing: -0.012em;
  }

  .guide-page-nav .nav-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar home back v23: quick return from section hubs without moving the layout. */
.page-shell .page-hero.sidebar-hero {
  overflow: visible;
}

.sidebar-hero__home-back {
  position: absolute;
  left: 0;
  top: -54px;
  z-index: 5;
  min-width: 156px;
  height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-text);
  box-shadow: 0 12px 26px rgba(58, 75, 100, 0.12);
  backdrop-filter: blur(12px);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.sidebar-hero__home-back:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 49, 36, 0.32);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 30px rgba(58, 75, 100, 0.16);
}

.sidebar-hero__home-back:focus-visible {
  outline: 3px solid rgba(239, 49, 36, 0.28);
  outline-offset: 3px;
}

html[data-theme="dark"] .sidebar-hero__home-back {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(24, 29, 40, 0.76);
  color: var(--color-text);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .sidebar-hero__home-back:hover {
  border-color: rgba(255, 118, 110, 0.34);
  background: rgba(31, 37, 51, 0.92);
}

@media (max-width: 900px) {
  .sidebar-hero__home-back {
    position: static;
    width: min(100%, 340px);
    margin-bottom: -4px;
  }
}

/* Typography reset v24: softer interface font instead of Styrene's dense Cyrillic. */
:root {
  --font-sans: "Segoe UI Variable Text", "Segoe UI", "Noto Sans", Arial, sans-serif;
  --font-ui: "Segoe UI Variable Text", "Segoe UI", "Noto Sans", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "Noto Sans", Arial, sans-serif;
  --font: var(--font-sans);
}

html,
body {
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body,
button,
input,
textarea,
select,
.logo-text,
.header-actions,
.header-search,
.btn,
.btn-icon,
.btn-theme,
.logout-form .btn,
.feedback-trigger,
.guide-recent,
.guide-recent__label,
.guide-recent__list a,
.guide-block,
.block-text,
.block-media,
.block-pdf,
.feedback-form,
.nav-tile,
.section-card__title,
.section-card__meta,
.footer-note,
.sidebar-hero__home-back {
  font-family: var(--font-ui) !important;
  letter-spacing: 0 !important;
}

.guide-hero__title,
.section-title-badge span,
.login-card h1,
.admin-title,
.admin-card h2,
.page-toc-title {
  font-family: var(--font-display) !important;
  letter-spacing: -0.01em !important;
}

.guide-hero__title {
  font-weight: 800;
  line-height: 1.08;
}

.section-title-badge span {
  font-weight: 800;
  line-height: 1;
}

.logo-text,
.btn,
.btn-icon,
.btn-theme,
.logout-form .btn,
.header-search__btn,
.nav-tile,
.sidebar-hero__home-back {
  font-weight: 650;
}

.guide-hero__lead,
.guide-block,
.block-text {
  font-weight: 400;
  line-height: 1.55;
}

.section-card__title,
.section-card__meta {
  font-weight: 700;
  line-height: 1.14;
}

.guide-recent,
.guide-recent__label,
.guide-recent__list a {
  font-weight: 600;
  line-height: 1.35;
}

.footer-note {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.01em !important;
}

.nav-heading {
  font-family: var(--font-ui) !important;
  font-weight: 700;
  letter-spacing: 0.055em !important;
}

/* Password visibility toggle v25. */
.password-field {
  position: relative;
  display: block;
}

.password-field__input {
  width: 100%;
  padding-right: 3.25rem !important;
}

.password-field__toggle {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-soft, var(--muted));
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.password-field__toggle:hover {
  background: rgba(239, 49, 36, 0.1);
  color: var(--color-primary, var(--accent));
}

.password-field__toggle:active {
  transform: translateY(-50%) scale(0.96);
}

.password-field__toggle:focus-visible {
  outline: 3px solid rgba(239, 49, 36, 0.24);
  outline-offset: 2px;
}

.password-field__icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.password-field__icon--hide,
.password-field.is-visible .password-field__icon--show {
  display: none;
}

.password-field.is-visible .password-field__icon--hide {
  display: block;
}

html[data-theme="dark"] .password-field__toggle:hover {
  background: rgba(255, 118, 110, 0.16);
}

/* Instruction navigation and feedback admin status v26. */
.guide-step-nav {
  margin-top: 1.7rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--color-border);
}

.guide-step-nav .nav-heading {
  margin-bottom: 0.75rem;
  color: var(--color-text-soft);
}

.step-nav__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.step-nav__link {
  min-height: 3.1rem;
  padding: 0.75rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(219, 205, 190, 0.9);
  border-radius: 16px;
  background: rgba(255, 251, 248, 0.96);
  color: var(--color-text);
  font-family: var(--font-ui) !important;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 18px rgba(129, 110, 91, 0.05);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.step-nav__link:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 49, 36, 0.26);
  box-shadow: 0 14px 24px rgba(129, 110, 91, 0.1);
}

.step-nav__link:focus-visible {
  outline: 3px solid rgba(239, 49, 36, 0.24);
  outline-offset: 3px;
}

.step-nav__link--next {
  background: rgba(239, 49, 36, 0.1);
  border-color: rgba(239, 49, 36, 0.28);
}

.step-nav__link--previous::before {
  content: "←";
  margin-right: 0.45rem;
}

.step-nav__link--next::after {
  content: "→";
  margin-left: 0.45rem;
}

.step-nav__link--home {
  background: rgba(255, 255, 255, 0.78);
}

.feedback-admin-card__meta span {
  white-space: nowrap;
}

html[data-theme="dark"] .step-nav__link {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(28, 32, 42, 0.94);
  color: var(--color-text);
  box-shadow: none;
}

html[data-theme="dark"] .step-nav__link--next {
  background: rgba(239, 49, 36, 0.18);
  border-color: rgba(255, 118, 110, 0.34);
}

html[data-theme="dark"] .step-nav__link--home {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 680px) {
  .step-nav__grid {
    grid-template-columns: 1fr;
  }

  .feedback-admin-card__meta span {
    white-space: normal;
  }
}

/* Smooth media loading v27: fade screenshots and card art in without layout jumps. */
html.smooth-images img[data-smooth-image] {
  opacity: 0;
  filter: blur(8px);
  transform: translate3d(0, 7px, 0) scale(0.992);
  transition:
    opacity 0.34s ease,
    filter 0.42s ease,
    transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, filter, transform;
}

html.smooth-images img[data-smooth-image].is-loaded {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
}

.block-media.media-loading,
.section-card__media.media-loading {
  position: relative;
  overflow: hidden;
}

.block-media.media-loading > *,
.section-card__media.media-loading > * {
  position: relative;
  z-index: 1;
}

.block-media.media-loading::before,
.section-card__media.media-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.38) 42%, transparent 58%),
    radial-gradient(circle at 18% 22%, rgba(116, 217, 255, 0.28), transparent 38%),
    radial-gradient(circle at 82% 24%, rgba(255, 102, 190, 0.18), transparent 42%);
  background-size: 220% 100%, 100% 100%, 100% 100%;
  animation: media-shimmer 1.15s ease-in-out infinite;
}

.block-media.media-loaded::before,
.section-card__media.media-loaded::before {
  display: none;
}

@keyframes media-shimmer {
  from {
    background-position: 130% 0, 0 0, 0 0;
  }
  to {
    background-position: -80% 0, 0 0, 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.smooth-images img[data-smooth-image] {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }

  .block-media.media-loading::before,
  .section-card__media.media-loading::before {
    animation: none;
  }
}
