:root {
  --bg: #fbfaf8;
  --text: #161616;
  --muted: #66605b;
  --line: #ddd8d0;
  --accent: #9d2f2f;
  --accent-dark: #742323;
  --paper: #ffffff;
  --max: 720px;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  color-scheme: light;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body {
  max-width: 100%;
  margin: 0;
  font-size: 18px;
  overflow-x: hidden;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.citation {
  font-size: 0.92em;
  font-weight: 650;
  text-decoration: none;
}

.citation:hover {
  text-decoration: underline;
}

.reference-target {
  scroll-margin-top: 24px;
}

.reference-target:target + .reference-number {
  background: rgba(157, 47, 47, 0.14);
  border-radius: 3px;
}

.reference-number {
  font-weight: 700;
}

.footnote-ref {
  scroll-margin-top: 24px;
  font-size: 0.72em;
  line-height: 0;
  vertical-align: super;
}

.footnote-ref a {
  text-decoration: none;
}

.footnote-target {
  scroll-margin-top: 24px;
}

.footnote-target:target + .footnote-number {
  background: rgba(157, 47, 47, 0.14);
  border-radius: 3px;
}

.footnote-number {
  font-weight: 700;
}

.footnote-number a {
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

.wrap {
  width: min(var(--page-max, var(--max)), calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 248, 0.96);
}

.site-header .wrap {
  --page-max: 1080px;
  padding: 28px 0 18px;
}

.brand {
  display: inline-block;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
}

.subtitle {
  max-width: 840px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

.nav a,
.nav summary {
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.nav a:hover,
.nav summary:hover {
  color: var(--accent);
}

.nav-categories {
  position: relative;
}

.category-menu {
  position: absolute;
  z-index: 4;
  display: grid;
  min-width: 280px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.category-menu a {
  padding: 5px 6px;
}

.main {
  --page-max: 1080px;
  padding: 44px 0 72px;
}

.post,
.page {
  min-width: 0;
  max-width: var(--max);
  margin-inline: 0 auto;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--max)) minmax(220px, 280px);
  gap: 48px;
  align-items: start;
}

.article-layout.no-toc {
  display: block;
}

.article-layout .post {
  min-width: 0;
  max-width: 100%;
}

.article-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  max-height: calc(100vh - 36px);
  gap: 18px;
  overflow: auto;
  align-self: start;
}

.article-layout.no-toc .article-sidebar {
  display: none;
}

.article-toc {
  max-height: none;
  overflow: visible;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

.article-toc details {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.article-toc summary {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  font-weight: 800;
  list-style-position: inside;
  box-shadow: 0 1px 0 var(--line);
}

.toc-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0 0 10px;
  list-style: none;
}

.toc-list a {
  display: block;
  position: relative;
  padding: 5px 12px 5px 10px;
  border-left: 3px solid transparent;
  color: var(--muted);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.toc-list a:hover,
.toc-list a.is-active {
  border-left-color: var(--accent);
  color: var(--accent-dark);
  background: #f1ede7;
}

.toc-list a.is-read {
  color: #4f6b43;
}

.toc-list a.is-read::after {
  position: absolute;
  top: 0.75em;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #4f6b43;
  content: "";
}

.toc-list a.is-read.is-active::after {
  background: var(--accent);
}

.toc-level-2 a {
  padding-left: 20px;
  padding-right: 22px;
}

.toc-level-3 a {
  padding-left: 32px;
  padding-right: 22px;
  font-size: 12px;
}

@media (min-width: 1040px) {
  .article-sidebar {
    position: fixed;
    top: 18px;
    right: max(16px, calc((100vw - 1080px) / 2));
    z-index: 8;
    width: 280px;
    max-height: calc(100vh - 36px);
  }
}

.article-ai {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 20;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

.article-ai-toggle {
  appearance: none;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  margin-left: auto;
  border: 1px solid var(--accent-dark);
  border-radius: 50%;
  color: #fff;
  background: var(--accent-dark);
  box-shadow: 0 12px 30px rgba(38, 28, 24, 0.22);
  cursor: pointer;
}

.article-ai:not(.is-open) .article-ai-toggle {
  animation: ai-pulse 2.8s ease-in-out infinite;
}

@keyframes ai-pulse {
  0%,
  100% {
    box-shadow: 0 12px 30px rgba(38, 28, 24, 0.22), 0 0 0 0 rgba(116, 35, 35, 0.24);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 14px 34px rgba(38, 28, 24, 0.26), 0 0 0 10px rgba(116, 35, 35, 0);
    transform: scale(1.035);
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-ai:not(.is-open) .article-ai-toggle {
    animation: none;
  }
}

.article-ai-toggle svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.article-ai-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 106px));
  gap: 12px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 48px rgba(38, 28, 24, 0.22);
}

.article-ai-panel[hidden] {
  display: none;
}

.article-ai-panel header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.article-ai h2 {
  margin: 0;
  font-size: 16px;
}

.article-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-ai-panel button {
  appearance: none;
  padding: 6px 8px;
  border: 1px solid var(--line);
  color: var(--accent-dark);
  background: var(--paper);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
}

.article-ai-panel button:hover,
.article-ai-panel button:focus-visible {
  border-color: var(--accent);
}

.article-ai-panel button:disabled,
.article-ai textarea:disabled {
  cursor: wait;
  opacity: 0.65;
}

.article-ai-close {
  min-width: 30px;
  min-height: 30px;
  font-size: 20px;
}

.article-ai-form {
  display: grid;
  gap: 8px;
}

.article-ai textarea {
  width: 100%;
  min-height: 96px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  resize: vertical;
  font: inherit;
}

.article-ai-answer {
  display: none;
  max-height: 420px;
  overflow: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: #2e2a26;
  font-size: 13px;
}

.article-ai-answer:not(:empty) {
  display: block;
}

.article-ai-answer > * {
  margin: 0 0 10px;
}

.article-ai-answer > *:last-child {
  margin-bottom: 0;
}

.article-ai-answer h1,
.article-ai-answer h2,
.article-ai-answer h3 {
  font-size: 15px;
  line-height: 1.25;
}

.article-ai-answer ul,
.article-ai-answer ol {
  padding-left: 20px;
}

.article-ai-answer.is-loading {
  color: var(--muted);
}

.article-ai-loading {
  display: grid;
  gap: 7px;
}

.article-ai-loading span:first-child {
  color: #1f1b18;
  font-weight: 700;
}

.article-ai-progress {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ddd2;
}

.article-ai-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: var(--accent);
  animation: article-ai-progress 1.15s ease-in-out infinite;
}

@keyframes article-ai-progress {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(240%);
  }
}

.article-ai-cache-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: #f8f5f0;
  color: var(--muted);
  font-size: 12px;
}

.article-ai-cache-actions button {
  padding: 4px 7px;
  font-size: 12px;
}

.intro {
  margin-bottom: 44px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
h3 {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.16;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 7vw, 64px);
}

.post-head h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.18;
}

.prose h1 {
  margin: 24px 0 10px;
  font-size: 24px;
}

.prose h1,
.prose h2,
.prose h3 {
  scroll-margin-top: 88px;
}

h2 {
  margin: 36px 0 10px;
  font-size: 28px;
}

h3 {
  margin: 28px 0 8px;
  font-size: 22px;
}

.intro p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
}

.post-list {
  display: grid;
  gap: 34px;
}

.index-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--max)) minmax(190px, 260px);
  gap: 44px;
  align-items: start;
}

.index-posts {
  min-width: 0;
}

.filter-bar {
  position: sticky;
  top: 18px;
  display: block;
  margin: 0;
  padding-bottom: 0;
  border-bottom: 0;
  font-size: 14px;
}

.filter-bar h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.filter-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.filter-mode-tabs button {
  appearance: none;
  padding: 4px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
}

.filter-mode-tabs button:hover,
.filter-mode-tabs button.is-active {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.filter-panel[hidden] {
  display: none;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.filter-category-group {
  margin: 0 0 18px;
}

.filter-category-group h3 {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.25;
}

.filter-category-group h3 a {
  color: var(--text);
  text-decoration: none;
}

.filter-bar a,
.tag-list a {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  padding: 3px 7px;
  border: 1px solid var(--line);
  color: var(--accent-dark);
  background: var(--paper);
  text-decoration: none;
}

.filter-bar a:hover,
.tag-list a:hover {
  border-color: var(--accent);
}

.filter-bar small {
  color: var(--muted);
  font-size: 11px;
}

.post-teaser {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.post-teaser h2 {
  margin: 4px 0 10px;
}

.post-teaser h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-teaser h2 a:hover {
  color: var(--accent);
}

.teaser-image {
  float: left;
  width: 30%;
  min-width: 140px;
  margin: 4px 18px 10px 0;
  overflow: hidden;
  background: var(--paper);
}

.teaser-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter 160ms ease;
}

.teaser-image:hover img,
.teaser-image:focus-visible img {
  filter: grayscale(0);
}

.post-teaser p {
  margin: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
}

.post-teaser::after {
  display: block;
  clear: both;
  content: "";
}

.meta,
.empty,
.more-link,
.archive-note,
.pagination,
.filter-bar,
.tag-list,
.editor-actions,
.post-navigation,
.share,
.site-footer {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.archive-note {
  margin: 20px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: #f1ede7;
  color: #3a3430;
  font-size: 14px;
}

.history-context {
  margin: 34px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-dark);
  background: #f7f3ed;
  font-size: 0.92em;
}

.history-context .prose h2:first-child {
  margin-top: 0;
}

.history-context .prose h2 {
  font-size: 22px;
}

.history-context .prose h3 {
  font-size: 18px;
}

.history-context-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-style: italic;
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 36px;
  font-size: 15px;
}

.pagination a:last-child {
  justify-self: end;
}

.pagination > span {
  color: var(--muted);
}

.post-head {
  margin-bottom: 30px;
}

.media-grid {
  display: grid;
  max-width: 100%;
  gap: 14px;
  margin: 0 0 32px;
}

.media-gallery {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(92px, 1fr);
  max-width: 100%;
  gap: 14px;
  align-items: start;
  margin: 0 0 32px;
}

.media-gallery.is-many-media {
  grid-template-columns: minmax(0, 2.6fr) minmax(180px, 1.1fr);
}

.media-gallery.is-very-many-media {
  grid-template-columns: minmax(0, 2.4fr) minmax(210px, 1.25fr);
}

.media-stage {
  margin: 0;
}

.media-thumbnails {
  display: grid;
  gap: 10px;
}

.media-gallery.is-many-media .media-thumbnails {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-gallery.is-very-many-media .media-thumbnails {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.media-thumb {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid transparent;
  background: var(--paper);
  cursor: pointer;
}

.media-thumb:hover,
.media-thumb:focus-visible,
.media-thumb.is-active {
  border-color: var(--accent);
}

.media-thumb img,
.thumb-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.thumb-video {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.media-grid figure {
  margin: 0;
}

.media-grid.is-tall-single-media {
  justify-items: center;
}

.media-grid.is-tall-single-media figure {
  width: min(62%, 440px);
}

.media-grid img,
.media-grid video,
.media-stage img,
.media-stage video {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
}

.media-gallery.is-many-media .media-stage img,
.media-gallery.is-many-media .media-stage video {
  max-height: min(72vh, 620px);
  object-fit: contain;
}

.media-grid.is-tall-single-media img {
  max-height: min(68vh, 620px);
  object-fit: contain;
}

.media-grid figcaption,
.media-stage figcaption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  line-height: 1.35;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose {
  min-width: 0;
  max-width: 100%;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6,
.prose p,
.prose li {
  overflow-wrap: anywhere;
}

.table-wrap {
  width: 100%;
  margin: 24px 0;
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.prose th {
  background: var(--paper);
  font-weight: 700;
}

.prose blockquote {
  max-width: 100%;
  margin: 28px 0;
  padding-left: 18px;
  border-left: 4px solid var(--line);
  color: #3f3b36;
  overflow-wrap: anywhere;
}

.prose code {
  padding: 0.1em 0.25em;
  background: #eee8df;
  font-size: 0.92em;
}

.prose pre {
  overflow-x: auto;
  padding: 16px;
  background: #eee8df;
}

.shared-embed,
.share {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.podcast {
  margin: 34px 0 34px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-left: 6px solid var(--accent);
  background: linear-gradient(135deg, #fff 0%, #f3eee8 100%);
  box-shadow: 0 14px 34px rgba(57, 45, 35, 0.08);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.podcast-label {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.podcast h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.podcast-description {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.podcast audio {
  width: 100%;
  max-width: 720px;
  display: block;
}

.podcast-download {
  margin: 16px 0 0;
}

.podcast-download a {
  display: inline-flex;
  padding: 8px 11px;
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.podcast-download a:hover {
  background: #fff;
}

.shared-embed iframe {
  width: min(500px, 100%);
  max-width: 100%;
  background: var(--paper);
}

.shared-missing {
  margin-top: 34px;
  padding: 12px 14px;
  border-left: 4px solid var(--line);
  background: #f1ede7;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.contact-page {
  max-width: 860px;
}

.search-page {
  max-width: 860px;
}

.search-form {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.search-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-form input,
.search-form select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.search-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.search-form button {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: #f8f5f0;
  color: var(--accent-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.search-form button:hover,
.search-form button:focus-visible {
  border-color: var(--accent);
}

.search-status {
  margin: 0 0 16px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.search-results {
  display: grid;
  gap: 20px;
}

.search-result {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.search-result h2 {
  margin: 2px 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.search-result h2 a {
  color: var(--text);
  text-decoration: none;
}

.search-result h2 a:hover {
  color: var(--accent);
}

.search-result p {
  margin: 0;
}

.search-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px !important;
}

.search-result-tags span {
  padding: 2px 6px;
  border: 1px solid var(--line);
  color: var(--accent-dark);
  background: var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
}

.search-empty,
.search-more {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.contact-note {
  margin: 0 0 24px;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  background: #f1ede7;
}

.contact-note p {
  margin: 0 0 10px;
}

.contact-note p:last-child {
  margin-bottom: 0;
}

.contact-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
}

.contact-form small {
  color: var(--muted);
  font-weight: 400;
}

.contact-form input,
.contact-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form button {
  width: fit-content;
  padding: 10px 16px;
  border: 1px solid var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.form-message {
  padding: 12px 14px;
  font-weight: 700;
}

.form-message.success {
  border-left: 4px solid #176b34;
  background: #edf6ef;
  color: #176b34;
}

.form-message.error {
  border-left: 4px solid #9d2f2f;
  background: #f9eeee;
  color: #9d2f2f;
}

.hp-field {
  position: absolute;
  left: -9999px;
}

.share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  font-size: 15px;
}

.share button {
  appearance: none;
  padding: 0;
  border: 0;
  color: var(--accent-dark);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.share button:hover {
  color: var(--accent);
}

.share small {
  color: var(--muted);
  font-size: 13px;
}

.editor-actions {
  display: none;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 28px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

body.local-editor .editor-actions {
  display: flex;
}

.delete-post-button {
  appearance: none;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #8c1f1f;
  background: #8c1f1f;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
}

.delete-post-button:hover {
  background: #6f1818;
}

.delete-post-button:disabled {
  border-color: var(--line);
  background: #7a7470;
  cursor: wait;
}

.delete-post-button span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 8px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1;
}

.editor-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.post-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.post-arrow {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.post-arrow:hover {
  border-color: var(--accent);
}

.post-arrow-next {
  justify-content: flex-end;
  text-align: right;
}

.arrow-symbol {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
}

.arrow-label,
.arrow-title {
  display: block;
}

.arrow-label {
  color: var(--muted);
  font-size: 13px;
}

.arrow-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.35;
}

.site-footer {
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer-note {
  --page-max: 1080px;
  margin: 0;
  margin-inline: auto;
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

@media (min-width: 760px) {
  .media-grid:has(figure:nth-child(2), video:nth-child(2)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    font-size: 17px;
  }

  .wrap {
    width: min(var(--page-max, var(--max)), calc(100% - 24px));
  }

  .site-header .wrap {
    padding-top: 22px;
  }

  .category-menu {
    position: fixed;
    right: 12px;
    left: 12px;
    min-width: 0;
  }

  .main {
    padding-top: 32px;
  }

  .index-layout {
    display: flex;
    flex-direction: column;
    gap: 34px;
  }

  .filter-bar {
    position: static;
    order: 2;
    width: 100%;
    padding-top: 24px;
    border-top: 1px solid var(--line);
  }

  .index-posts {
    order: 1;
    width: 100%;
  }

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

  .pagination a:last-child {
    justify-self: start;
  }

  .post-navigation {
    grid-template-columns: 1fr;
  }

  .article-layout {
    display: flex;
    flex-direction: column;
  }

  .article-layout:not(.no-toc) {
    padding-top: 58px;
  }

  .article-layout.no-toc {
    display: block;
    padding-top: 0;
  }

  .article-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 30;
    order: -1;
    width: 100%;
    max-height: none;
    overflow: visible;
    margin: 0;
    padding: 8px 12px;
    background: rgba(251, 250, 248, 0.98);
    box-shadow: 0 8px 22px rgba(38, 28, 24, 0.08);
  }

  .article-toc {
    width: min(var(--max), 100%);
    max-height: none;
    margin: 0 auto;
    overflow: visible;
  }

  .article-toc details {
    background: rgba(255, 255, 255, 0.96);
  }

  .article-toc details[open] {
    max-height: calc(100vh - 16px);
    overflow: auto;
  }

  .article-ai-answer {
    max-height: none;
  }

  .search-filter-row {
    grid-template-columns: 1fr;
  }

  .search-result h2 {
    font-size: 21px;
  }

  .media-gallery {
    grid-template-columns: 1fr;
  }

  .media-gallery.is-many-media,
  .media-gallery.is-very-many-media {
    grid-template-columns: 1fr;
  }

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

  .media-gallery.is-many-media .media-thumbnails,
  .media-gallery.is-very-many-media .media-thumbnails {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .media-grid.is-tall-single-media figure {
    width: min(82%, 360px);
  }

  .teaser-image {
    float: none;
    width: 100%;
    min-width: 0;
    margin: 12px 0;
  }
}
