:root {
  --panel: #1c1c1f;
  --surface: #1c1c1f;
  --line: #f3f3f3;
  --text: #ffffff;
  --muted: #d9d9d9;
  --link: #6aa8ff;
  --hero-fallback-top: #cebb96;
  --hero-fallback-bottom: #f59441;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: auto;
}

body.guidebook-body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--panel);
  color: var(--text);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.guidebook-layout {
  --sidebar-width: 378px;
  display: flex;
  height: 100vh;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.guidebook-layout.sidebar-collapsed {
  --sidebar-width: 0px;
}

.guidebook-sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  transition: width 0.22s ease, flex-basis 0.22s ease, opacity 0.18s ease;
}

.guidebook-layout.sidebar-collapsed .guidebook-sidebar {
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  min-height: 106px;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-close {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  width: 100%;
}

.brand-logo {
  width: 43px;
  height: 56px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand-wordmark {
  font-size: 1.72rem;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--text);
}

.brand-strong {
  font-weight: 700;
}

.brand-light {
  font-weight: 400;
}

.search-nav {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px 14px;
}

.search-field {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.search-icon {
  color: var(--muted);
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.search-icon svg {
  width: 20px;
  height: 20px;
}

.search-input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.2;
  width: 100%;
  min-width: 0;
  outline: none;
}

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

.search-results[hidden] {
  display: none;
}

.search-results {
  position: absolute;
  left: 20px;
  right: 20px;
  top: calc(100% - 2px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 310px;
  overflow-y: auto;
  z-index: 22;
}

.search-result {
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.16s ease;
}

.search-result:hover,
.search-result:focus-visible {
  background: rgba(243, 243, 243, 0.1);
}

.search-result-title {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 600;
}

.search-result-slug {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.search-empty {
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

.category-nav {
  position: relative;
  border-bottom: 1px solid var(--line);
  min-height: 350px;
  overflow: hidden;
}

.category-view {
  width: 100%;
  padding: 36px 40px 32px 72px;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.category-view-topics {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.category-view-topic-pages {
  display: flex;
  flex-direction: column;
}

.category-view.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
  visibility: visible;
}

.category-view:not(.is-active) {
  opacity: 0;
  transform: translateX(14px);
  pointer-events: none;
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.category-nav.is-topic-pages-view .category-view-topics:not(.is-active) {
  transform: translateX(-14px);
}

.category-nav.is-animating .category-view {
  visibility: visible;
}

.category-link {
  display: flex;
  width: fit-content;
  align-items: baseline;
  gap: 8px;
  min-height: 52px;
}

.category-label-row {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.category-link:hover .category-label,
.category-link:focus-visible .category-label {
  transform: translateX(3px);
}

.category-link.active {
  background: transparent;
}

.category-link.active .category-label {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
}

.category-label {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.04;
  color: var(--text);
  transition: transform 0.18s ease;
}

.category-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  transform: translateY(-0.46em);
}

.topic-lock-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--muted);
  cursor: help;
}

.topic-lock-indicator svg {
  width: 14px;
  height: 14px;
}

.topic-lock-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(28, 28, 31, 0.96);
  color: #f3f3f3;
  font-size: 0.72rem;
  line-height: 1.25;
  padding: 6px 8px;
  min-width: 220px;
  max-width: 280px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
  z-index: 8;
}

.topic-lock-indicator:hover .topic-lock-tooltip,
.topic-lock-indicator:focus-within .topic-lock-tooltip {
  opacity: 1;
}

.topic-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin-bottom: 18px;
}

.topic-panel-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text);
}

.topic-panel-back svg {
  width: 24px;
  height: 24px;
}

.topic-panel-current {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.topic-panel-name {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.04;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
}

.topic-panel-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  transform: translateY(-0.46em);
}

.topic-page-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 36px;
}

.topic-page-link {
  color: var(--text);
  font-size: 1.22rem;
  line-height: 1.2;
  font-weight: 500;
}

.topic-page-link.active {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.topic-page-list.is-locked {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.utility-nav {
  padding: 34px 40px 0 72px;
}

.utility-link {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.22;
  margin-bottom: 4px;
  transition: color 0.16s ease, transform 0.16s ease;
}

.utility-link:last-child {
  margin-bottom: 0;
}

.utility-link:hover,
.utility-link:focus-visible {
  color: var(--text);
  transform: translateX(2px);
}

.theme-toggle {
  margin: auto auto 28px 96px;
  width: 148px;
  height: 49px;
  border-radius: 999px;
  border: 3px solid var(--muted);
  background: transparent;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.theme-segment {
  border: none;
  background: transparent;
  color: var(--muted);
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.theme-segment[aria-pressed="true"] {
  background: rgba(243, 243, 243, 0.16);
  color: var(--text);
}

.theme-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.theme-icon svg {
  width: 24px;
  height: 24px;
}

.theme-divider {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 100%;
  background: var(--muted);
  pointer-events: none;
}

.mobile-theme-toggle {
  display: none;
}

.guidebook-main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--panel);
}

.guidebook-main.topic-locked .hero,
.guidebook-main.topic-locked .content-grid,
.guidebook-main.topic-locked .content-body {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

.hero {
  height: 811px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--hero-fallback-top) 0%, var(--hero-fallback-bottom) 100%);
}

.main-topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 26px 12px;
}

.hero-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.sidebar-toggle {
  position: absolute;
  z-index: 3;
  top: 42px;
  left: 26px;
  width: 44px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0;
  cursor: pointer;
}

.sidebar-toggle-inline {
  position: static;
  width: 34px;
  height: 34px;
  display: inline-flex;
}

.sidebar-toggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle .icon-expand {
  display: none;
}

.guidebook-layout.sidebar-collapsed .sidebar-toggle {
  left: 18px;
}

.guidebook-layout.sidebar-collapsed .sidebar-toggle .icon-collapse {
  display: none;
}

.guidebook-layout.sidebar-collapsed .sidebar-toggle .icon-expand {
  display: block;
}

.banner-edit-trigger {
  border: 1px solid var(--line);
  background: rgba(28, 28, 31, 0.9);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.banner-edit-trigger:hover,
.banner-edit-trigger:focus-visible {
  border-color: var(--muted);
  color: var(--muted);
}

.banner-edit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.banner-edit-icon svg {
  width: 14px;
  height: 14px;
}

.hero .banner-edit-trigger {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
}

.hero:hover .banner-edit-trigger,
.hero:focus-within .banner-edit-trigger {
  opacity: 1;
  pointer-events: auto;
}

.content {
  min-height: 269px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  position: relative;
  padding-bottom: 48px;
}

.content.content-no-hero {
  border-top: 0;
}

.content.content-no-hero::before {
  display: none;
}

.content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: var(--line);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 560px) minmax(420px, 1fr);
  gap: 150px;
  align-items: start;
  padding: 48px 60px 36px;
}

.content-title {
  margin: 0;
  font-size: 6rem;
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--text);
}

.content-heading {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.32;
}

.content-meta-item {
  color: inherit;
}

.content-meta-sep {
  color: inherit;
}

.content-intro {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.35;
  color: var(--text);
  max-width: 760px;
  padding-top: 6px;
}

.content-body {
  margin: 0 60px;
  min-height: 420px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.content-note {
  margin: 0 0 14px;
  color: var(--muted);
}

.topic-guides {
  margin-bottom: 24px;
}

.topic-guides h2 {
  margin: 0 0 10px;
  font-size: 1.42rem;
  font-weight: 600;
  color: var(--text);
}

.topic-guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.topic-guide-list li {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.topic-guide-list li::before {
  content: "·";
  font-weight: 800;
  color: var(--text);
}

.topic-guide-list a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(217, 217, 217, 0.55);
}

.topic-guide-list a:hover,
.topic-guide-list a:focus-visible {
  text-decoration-color: currentColor;
}

.topic-guides-empty {
  margin: 0;
  color: var(--muted);
}

.content-block {
  margin-bottom: 28px;
  color: var(--text);
}

.content-block:last-child {
  margin-bottom: 0;
}

.content-block h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--text);
}

.content-block-subtext {
  margin: 0 0 12px;
  color: var(--muted);
}

.content-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

.content-media {
  margin: 0;
}

.content-media img {
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  display: block;
}

.content-video {
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  display: block;
}

.content-embed iframe,
.content-html iframe {
  width: 100%;
  max-width: 100%;
  border: 0;
}

.markdown-content p {
  margin: 0 0 12px;
}

.markdown-content p:last-child {
  margin-bottom: 0;
}

.markdown-content ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.markdown-content li {
  margin-bottom: 6px;
}

.markdown-content li:last-child {
  margin-bottom: 0;
}

.markdown-content .md-heading {
  margin: 0 0 10px;
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--text);
}

.markdown-content a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  position: relative;
}

.markdown-content a:visited {
  color: var(--link);
}

.link-preview-tooltip[hidden] {
  display: none;
}

.link-preview-tooltip {
  position: fixed;
  z-index: 130;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(460px, calc(100vw - 24px));
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(28, 28, 31, 0.96);
  color: #f3f3f3;
  padding: 7px 10px;
  pointer-events: none;
  font-size: 0.78rem;
  line-height: 1.25;
}

.link-preview-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.link-preview-icon svg {
  width: 14px;
  height: 14px;
}

.link-preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-empty {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.editable-text {
  position: relative;
}

.edit-trigger {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.editable-text:hover .edit-trigger,
.editable-text:focus-within .edit-trigger {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.edit-trigger:hover,
.edit-trigger:focus-visible {
  border-color: var(--muted);
  color: var(--muted);
}

.edit-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.edit-trigger-icon svg {
  width: 14px;
  height: 14px;
}

.edit-modal[hidden] {
  display: none;
}

.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
}

.edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
}

.edit-panel {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  color: var(--text);
}

.edit-panel h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 700;
}

.edit-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.edit-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.95rem;
}

.edit-input-file {
  width: 100%;
  margin-top: 2px;
  color: var(--muted);
}

.edit-help {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.edit-textarea {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
  font-size: 0.98rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.edit-status {
  min-height: 1.3em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.edit-status.is-error {
  color: #d94d4d;
}

.edit-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.edit-action {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.edit-action-secondary {
  background: transparent;
  color: var(--muted);
}

.edit-action-primary {
  background: var(--text);
  color: var(--panel);
  border-color: var(--text);
}

.edit-action:disabled {
  opacity: 0.65;
  cursor: wait;
}

body.guidebook-body.modal-open {
  overflow: hidden;
}

.mobile-menu-toggle {
  display: none;
}

.mobile-topbar {
  display: none;
}

.guidebook-layout[data-theme="light"] {
  --panel: #ffffff;
  --surface: #ffffff;
  --line: #e1e1e1;
  --text: #000000;
  --muted: #4d4d4d;
  --link: #1f5dd9;
}

.guidebook-layout[data-theme="light"] .theme-segment[aria-pressed="true"] {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
}

.guidebook-layout[data-theme="light"] .brand-logo {
  filter: none;
}

.guidebook-layout[data-theme="light"] .category-link.active {
  background: transparent;
}

.guidebook-layout[data-theme="light"] .link-preview-tooltip {
  background: rgba(255, 255, 255, 0.96);
  color: #0e0e11;
}

.guidebook-layout[data-theme="light"] .topic-lock-tooltip {
  background: rgba(255, 255, 255, 0.96);
  color: #0e0e11;
}

.guidebook-layout[data-theme="light"] .search-result:hover,
.guidebook-layout[data-theme="light"] .search-result:focus-visible {
  background: rgba(0, 0, 0, 0.06);
}

.guidebook-layout[data-theme="light"] .search-results {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.guidebook-layout[data-theme="light"] .banner-edit-trigger {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border-color: var(--line);
}

@media (max-width: 1600px) {
  .content-title {
    font-size: 5.2rem;
  }

  .content-intro {
    font-size: 1rem;
  }
}

@media (max-width: 1280px) {
  .brand-wordmark {
    font-size: 1.48rem;
  }

  .category-label {
    font-size: 1.7rem;
  }

  .topic-panel-name {
    font-size: 1.7rem;
  }

  .topic-page-link {
    font-size: 1.08rem;
  }

  .utility-link {
    font-size: 0.86rem;
  }

  .content-grid {
    gap: 64px;
    grid-template-columns: minmax(300px, 470px) minmax(320px, 1fr);
  }

  .content-title {
    font-size: 4.4rem;
  }

  .content-intro {
    font-size: 0.98rem;
  }
}

@media (max-width: 1100px) {
  .guidebook-layout,
  .guidebook-layout.sidebar-collapsed {
    --sidebar-width: 378px;
    height: auto;
    min-height: 100dvh;
  }

  .guidebook-sidebar {
    width: min(88vw, 370px);
    flex: 0 0 min(88vw, 370px);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    transform: translateX(-100%);
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.22s ease;
    overflow-y: auto;
  }

  .guidebook-layout.sidebar-collapsed .guidebook-sidebar {
    opacity: 1;
    pointer-events: auto;
  }

  .guidebook-layout.menu-open .guidebook-sidebar {
    transform: translateX(0);
  }

  .guidebook-main {
    width: 100%;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    background: var(--panel);
  }

  .guidebook-main.topic-locked .hero,
  .guidebook-main.topic-locked .content-grid,
  .guidebook-main.topic-locked .content-body {
    filter: blur(4px);
  }

  .sidebar-toggle {
    display: none;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    min-height: 60px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-topbar-brand {
    min-width: 0;
    flex: 1 1 auto;
    max-width: calc(100% - 84px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-topbar-logo {
    display: inline-block;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    background: currentColor;
    -webkit-mask-image: url("/static/img/vectors/logo.svg");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-image: url("/static/img/vectors/logo.svg");
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    color: var(--text);
  }

  .mobile-topbar-wordmark {
    display: block;
    font-size: 1.1rem;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-bottom: 1px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
    gap: 7px;
  }

  .mobile-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
  }

  .mobile-menu-icon svg {
    width: 16px;
    height: 16px;
  }

  .mobile-menu-text {
    display: inline-block;
    white-space: nowrap;
  }

  .hero {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .hero-banner {
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
  }

  .hero .banner-edit-trigger {
    top: 12px;
    right: 12px;
  }

  .main-topbar {
    min-height: 0;
    padding: 10px 14px 0;
  }

  .content {
    min-height: 0;
    padding-bottom: 20px;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .guidebook-layout {
    background: #0b0b0d;
  }

  .guidebook-main {
    max-width: min(980px, calc(100vw - 52px));
    margin: 22px auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
  }

  .content-grid {
    grid-template-columns: minmax(210px, 330px) minmax(320px, 1fr);
    gap: 42px;
    padding: 30px 30px 26px;
  }

  .content-title {
    font-size: clamp(3.2rem, 7vw, 5.2rem);
  }

  .content-meta {
    font-size: 0.94rem;
    gap: 8px;
  }

  .content-intro {
    font-size: 1.02rem;
    line-height: 1.4;
  }

  .content-body {
    margin: 0 30px;
    min-height: 320px;
    font-size: 1rem;
  }
}

@media (max-width: 767px) {
  .guidebook-layout,
  .guidebook-layout.sidebar-collapsed {
    --sidebar-width: 100vw;
    min-height: 100dvh;
  }

  .guidebook-sidebar {
    width: 100vw;
    flex: 0 0 100vw;
    inset: 0;
    transform: translateX(100%);
    z-index: 40;
    background: var(--surface);
  }

  .guidebook-layout.menu-open .guidebook-sidebar {
    transform: translateX(0);
  }

  .guidebook-layout.menu-open .guidebook-main {
    pointer-events: none;
  }

  .sidebar-header {
    min-height: 96px;
    padding: 22px 20px 18px;
    justify-content: center;
  }

  .sidebar-header .brand {
    width: auto;
    justify-content: center;
    gap: 12px;
  }

  .sidebar-header .brand-logo {
    width: 38px;
    height: 49px;
  }

  .sidebar-header .brand-wordmark {
    font-size: 1.02rem;
    line-height: 1.14;
    letter-spacing: -0.01em;
  }

  .mobile-menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 16px;
    top: 16px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }

  .mobile-menu-close svg {
    width: 18px;
    height: 18px;
  }

  .search-nav {
    padding: 16px 18px;
  }

  .search-field {
    min-height: 48px;
  }

  .search-results {
    left: 18px;
    right: 18px;
  }

  .category-nav {
    min-height: 0;
  }

  .category-view {
    padding: 24px 20px 22px;
  }

  .category-view-topics {
    gap: 16px;
  }

  .category-link {
    width: auto;
    margin: 0 auto;
    justify-content: center;
  }

  .category-label {
    font-size: 2.05rem;
  }

  .topic-panel-header {
    justify-content: center;
    gap: 10px;
  }

  .topic-panel-back {
    width: 28px;
    height: 28px;
  }

  .topic-panel-current {
    justify-content: center;
  }

  .topic-page-list {
    padding-left: 0;
    align-items: center;
  }

  .topic-page-link {
    text-align: center;
  }

  .utility-nav {
    padding: 24px 20px 0;
    text-align: center;
  }

  .utility-link {
    margin-bottom: 6px;
    font-size: 1.04rem;
  }

  .utility-link:hover,
  .utility-link:focus-visible {
    transform: none;
  }

  .theme-toggle {
    display: none;
  }

  .mobile-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 28px auto calc(26px + env(safe-area-inset-bottom));
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    position: relative;
    flex: 0 0 auto;
  }

  .mobile-theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px;
    height: 22px;
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.16s ease, transform 0.16s ease;
  }

  .mobile-theme-icon svg {
    width: 22px;
    height: 22px;
  }

  .mobile-theme-toggle[data-theme="dark"] .mobile-theme-icon-moon,
  .mobile-theme-toggle[data-theme="light"] .mobile-theme-icon-sun {
    opacity: 1;
    transform: scale(1);
  }

  .guidebook-main {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border: 0;
    min-height: 100dvh;
    background: var(--panel);
  }

  .mobile-topbar {
    min-height: 56px;
    padding: 9px 12px;
  }

  .mobile-topbar-logo {
    width: 21px;
    height: 21px;
  }

  .mobile-topbar-wordmark {
    font-size: 1rem;
  }

  .mobile-menu-toggle {
    font-size: 0.8rem;
    padding: 6px 9px;
  }

  .mobile-menu-icon {
    width: 15px;
    height: 15px;
  }

  .mobile-menu-icon svg {
    width: 15px;
    height: 15px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 16px 20px;
  }

  .content-title {
    font-size: clamp(2.35rem, 11vw, 3.45rem);
    line-height: 0.98;
  }

  .content-meta {
    font-size: 0.87rem;
    gap: 7px;
  }

  .content-intro {
    font-size: 0.99rem;
    line-height: 1.38;
  }

  .content-body {
    margin: 0 16px;
    min-height: 240px;
    font-size: 0.95rem;
    padding-top: 16px;
  }
}
