:root {
  color-scheme: light dark;

  --bg: light-dark(#f6f1e7, #171614);
  --surface: light-dark(#fcf9f3, #211f1c);
  --surface-alt: light-dark(#eee6d7, #2b2824);
  --text: light-dark(#2b2a27, #ece7dd);
  --text-muted: light-dark(#645e54, #a9a194);
  --border: light-dark(#dfd5c3, #3a3630);
  --accent: light-dark(#b5532f, #e07a55);
  --accent-soft: light-dark(#f8ebe4, #3d241b);
  --jade: light-dark(#3c7a6a, #5fb39e);
  --jade-soft: light-dark(#e6f1ee, #1c352f);
  --pass-fg: light-dark(#21664d, #74cfa9);
  --pass-bg: light-dark(#e3f3ec, #19362b);
  --minor-fg: light-dark(#8a5a00, #e5b34b);
  --minor-bg: light-dark(#fbf1d8, #382b12);
  --touch-fg: light-dark(#a43a24, #eb866e);
  --touch-bg: light-dark(#fbeae5, #3d1f19);
  --mark-bg: light-dark(#ffe082, #7a5c0c);
  --mark-fg: light-dark(#2b2a27, #fff7df);
  --shadow: light-dark(0 4px 16px rgba(43, 42, 39, 0.08), 0 6px 22px rgba(0, 0, 0, 0.45));
  --scrollbar-track: light-dark(#ebe3d4, #201e1b);
  --scrollbar-thumb: light-dark(#b4aa98, #57524a);

  accent-color: var(--accent);
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
}

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

html {
  font-family: "PingFang TC", "Noto Sans TC", "Heiti TC", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

: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-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.brand-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-seal {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: clamp(1rem, 0.92rem + 0.35vw, 1.15rem);
}

.brand-text small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.primary-nav a:hover {
  background: var(--surface-alt);
}

.primary-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  font-weight: 600;
}

.nav-count {
  font-size: 0.78rem;
  padding: 0.05rem 0.42rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 320px;
  justify-content: flex-end;
}

/* Search */
.search-wrap {
  position: relative;
  flex: 1 1 220px;
  max-width: 340px;
}

.search-wrap input[type="search"] {
  width: 100%;
  padding: 0.46rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(92vw, 460px);
  max-height: 70dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.45rem;
  z-index: 50;
}

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

.search-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.35rem 0.6rem 0.2rem;
}

.search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.search-item:hover,
.search-item:focus-visible {
  background: var(--surface-alt);
}

.search-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.search-item-snippet {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.search-empty {
  padding: 0.9rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

mark {
  background: var(--mark-bg);
  color: var(--mark-fg);
  padding: 0 0.14rem;
  border-radius: 3px;
}

/* Header buttons */
.icon-btn,
.notebook-btn,
.tool-btn,
.primary-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.44rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.icon-btn:hover,
.tool-btn:hover {
  border-color: var(--accent);
}

.notebook-btn,
.primary-link-btn {
  background: var(--jade);
  color: #fff;
  border-color: transparent;
}

.notebook-btn:hover,
.primary-link-btn:hover {
  filter: brightness(1.06);
}

/* Theme icon reflects active color-scheme without JS flicker */
.theme-icon-light {
  display: none;
}
.theme-icon-dark {
  display: inline;
}

@media (prefers-color-scheme: dark) {
  .theme-icon-light {
    display: inline;
  }
  .theme-icon-dark {
    display: none;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-light {
  display: inline;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-dark {
  display: none;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-icon-light {
  display: none;
}
:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-icon-dark {
  display: inline;
}

/* Route Schematic Strip */
.route-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.route-strip-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem 0.9rem;
}

.route-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.route-active-hint {
  color: var(--accent);
  font-weight: 600;
}

.route-diagram {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.route-node {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.45rem 0.78rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.route-node:hover {
  border-color: var(--accent);
}

.route-node[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.route-node-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.route-node-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.route-node[aria-pressed="true"] .route-node-meta {
  color: var(--accent);
}

.route-arrow {
  width: 22px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* Main Shell */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  container-type: inline-size;
}

.section-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin-bottom: 1.1rem;
}

.section-bar h1 {
  margin: 0;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
}

.section-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}

.chip-btn {
  padding: 0.36rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.chip-btn:hover {
  border-color: var(--accent);
}

.chip-btn[aria-pressed="true"] {
  background: var(--jade-soft);
  border-color: var(--jade);
  color: var(--jade);
  font-weight: 600;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 1rem;
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--jade-soft);
  color: var(--jade);
}

.card-map-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.guide-card h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.38;
}

.guide-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.card-alert-pill {
  align-self: flex-start;
  margin-top: auto;
  font-size: 0.76rem;
  color: var(--touch-fg);
  background: var(--touch-bg);
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
}

/* Guide Reader Layout */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.guide-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

.toc-sidebar {
  position: sticky;
  top: 4.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  max-height: calc(100dvh - 6rem);
  overflow-y: auto;
}

.toc-sidebar h2 {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.toc-nav {
  scroll-target-group: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toc-nav a {
  display: block;
  padding: 0.3rem 0.55rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.toc-nav a.toc-sub {
  padding-left: 1.15rem;
  font-size: 0.81rem;
}

.toc-nav a:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.toc-nav a:is(:target-current, .target-current) {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.toc-mobile {
  display: none;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
}

.toc-mobile summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}

@container (max-width: 860px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    display: none;
  }
  .toc-mobile {
    display: block;
  }
}

.guide-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(1.25rem, 1rem + 1.2vw, 2rem);
  box-shadow: var(--shadow);
  min-width: 0;
}

.guide-article header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.guide-article h1 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.9rem);
  line-height: 1.32;
}

.guide-content h2 {
  margin-top: 1.85rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  font-size: clamp(1.16rem, 1.08rem + 0.4vw, 1.38rem);
  scroll-margin-top: 5.5rem;
}

.guide-content h3 {
  margin-top: 1.35rem;
  margin-bottom: 0.45rem;
  font-size: 1.05rem;
  scroll-margin-top: 5.5rem;
}

.guide-content p {
  margin: 0.7rem 0;
}

.guide-content ul,
.guide-content ol {
  margin: 0.65rem 0;
  padding-left: 1.35rem;
}

.guide-content li {
  margin: 0.35rem 0;
}

.guide-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.4rem 0;
}

.guide-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--surface-alt);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.guide-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.guide-content th,
.guide-content td {
  padding: 0.58rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.guide-content th {
  background: var(--surface-alt);
  font-weight: 700;
  white-space: nowrap;
}

.guide-content tr:last-child td {
  border-bottom: 0;
}

/* Callouts */
.callout {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
}

.callout-warning,
.callout-caution {
  border-left-color: var(--touch-fg);
  background: var(--touch-bg);
}

.callout-important {
  border-left-color: var(--minor-fg);
  background: var(--minor-bg);
}

.callout-tip,
.callout-note {
  border-left-color: var(--jade);
  background: var(--jade-soft);
}

.callout-badge {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.callout-body p {
  margin: 0.3rem 0;
}

/* Maps Grid & Related Maps */
.related-maps-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.related-maps-section h2 {
  margin: 0 0 0.9rem;
  font-size: 1.15rem;
}

.maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}

.map-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.map-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.map-thumb-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-alt);
  cursor: pointer;
  overflow: hidden;
}

.map-thumb-btn img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.map-card-body {
  padding: 0.8rem 0.95rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.map-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.qa-badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.qa-PASS {
  background: var(--pass-bg);
  color: var(--pass-fg);
}

.qa-MINOR_IMPERFECTION {
  background: var(--minor-bg);
  color: var(--minor-fg);
}

.qa-NEEDS_LIGHT_TOUCHUP {
  background: var(--touch-bg);
  color: var(--touch-fg);
}

.res-pill {
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}

.map-card h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.38;
}

.map-card-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.48;
}

/* Alerts View */
.alerts-group {
  margin-bottom: 1.6rem;
}

.alerts-group h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--accent);
}

.alert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.05rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}

.alert-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.alert-card-head a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.alert-card-head a:hover {
  text-decoration: underline;
}

/* Lightbox Dialog */
dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(96dvw, 1360px);
  height: min(92dvh, 920px);
  max-width: none;
  max-height: none;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(16, 15, 13, 0.74);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.lightbox-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.lightbox-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.lightbox-heading-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.lightbox-heading-wrap h1 {
  margin: 0;
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.2rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.zoom-group {
  display: inline-flex;
  gap: 0.25rem;
}

.close-btn {
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--touch-bg);
  color: var(--touch-fg);
  font-weight: 700;
  cursor: pointer;
}

.lightbox-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  flex: 1;
  min-height: 0;
}

.lightbox-stage {
  position: relative;
  overflow: hidden;
  background: light-dark(#e9e2d4, #100f0d);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.lightbox-stage.is-dragging {
  cursor: grabbing;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  transform-origin: center center;
  pointer-events: none;
  display: block;
}

.lightbox-meta {
  padding: 1rem 1.1rem;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.meta-block h2 {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.meta-note {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.related-guide-list {
  margin: 0;
  padding-left: 1.15rem;
}

.related-guide-list li {
  margin: 0.3rem 0;
}

.related-guide-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.related-guide-list a:hover {
  text-decoration: underline;
}

.meta-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hint-text {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 840px) {
  dialog {
    width: 98dvw;
    height: 94dvh;
  }
  .lightbox-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .lightbox-meta {
    border-left: 0;
    border-top: 1px solid var(--border);
    max-height: 36dvh;
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface);
}
