:root {
  color-scheme: dark;
  --beige: #f4e7cf;
  --beige-muted: #e3d4c0;
  --graphite: #1b1612;
  --graphite-soft: #2a231f;
  --amber: #f59e0b;
}

body {
  font-family:
    "Inter",
    "SF Pro Display",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(4, 4, 4, 0.35), rgba(10, 8, 8, 0.92), #060405),
    url("/assets/background.jpg") center top / cover no-repeat fixed;
  color: #f6f3ea;
  min-height: 100vh;
  /* padding-top: 80px; */
}

.site-nav {
  position: relative;
  height: 74px;
  background: rgba(5, 5, 5, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  z-index: 11;
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 16px;
  font-weight: 500;
  color: #f6f2e6;
  text-decoration: none;
}

.lore-logo {
  color: #f59e0b;
}

.nav-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45));
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  text-decoration: none;
  color: rgba(244, 231, 207, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 11px;
  padding: 10px 14px;
  border-radius: 999px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.nav-link:hover {
  color: #fff3db;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.nav-link:active {
  transform: translateY(0);
}

.nav-link.active {
  background: #f59e0b;
  color: #1c1206;
  font-weight: 600;
}

.nav-link:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.6);
  outline-offset: 2px;
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 12;
  gap: 4px;
}

.nav-burger span {
  width: 100%;
  height: 2px;
  background: #f6f2e6;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.nav-burger:hover span {
  background: #fff3db;
}

.nav-burger:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.6);
  outline-offset: 2px;
  border-radius: 4px;
}

.nav-burger[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.nav-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-burger[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.hero {
  background: transparent;
  color: #fff;
  padding: 100px 24px 20px;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  /* box-shadow: inset 0 80px 160px rgba(0, 0, 0, 0.8); */
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 960px;
  width: min(92vw, 960px);
  margin: 0 auto;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.crumbs {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 12px;
  opacity: 0.85;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-sub {
  font-size: 16px;
  opacity: 0.9;
}

.hero-divider {
  width: 240px;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  position: relative;
}

.hero-search {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.search-form {
  width: min(780px, 100%);
  display: flex;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 13, 15, 0.92);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.55);
}

.search-field {
  position: relative;
  flex: 1;
}

.search-input {
  font-size: 22px;
  padding: 18px 64px 18px 22px;
  border: none;
  outline: none;
  background: transparent;
  color: #fdfbf7;
  width: 100%;
  transition: box-shadow 0.2s ease;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.clear-btn {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fdfbf7;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    background 0.15s ease,
    transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-50%) scale(1.1);
}

.clear-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.clear-btn:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.6);
  outline-offset: 2px;
}

.clear-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.search-btn {
  background: #f59e0b;
  color: #1c1206;
  border: none;
  font-size: 18px;
  font-weight: 700;
  padding: 0 34px;
  cursor: pointer;
  transition:
    filter 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
  min-width: 140px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  border-radius: 0 0 12px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.search-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.search-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.search-btn:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.search-panel {
  margin: 0 auto 60px;
  width: min(1040px, calc(100% - 24px));
  border-radius: 38px;
  padding-top: 30px;
  position: relative;
  z-index: 3;
  color: var(--graphite);
}

.panel-layout {
  display: block;
}

.results-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 24px;
  padding: 20px 24px;
  background: var(--graphite);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f5ecdd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  min-height: 420px;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.copy-link {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f6f3ea;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
}

.copy-link:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.copy-link:active {
  transform: translateY(0);
}

.meta-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  color: #f5c04a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #f6f3ea;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.05em;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.type-chip .count {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: #cfd3da;
}

.type-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.type-chip.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.6);
  color: #f5c04a;
}

.type-chip-clear {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #9aa0a6 !important;
  font-size: 20px;
  line-height: 1;
  padding: 8px 14px;
  min-width: 36px;
}

.type-chip-clear:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #cfd3da !important;
}

.no-animations *,
.no-animations *::before,
.no-animations *::after {
  transition: none !important;
  animation: none !important;
}

.zero-state {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 20px;
}

.zero-text {
  width: 60%;
  color: #f6f3ea;
  line-height: 1.6;
  margin-left: 20px;
  margin-top: 20px;
}

.zero-text h3 {
  font-size: 23px;
  margin: 0;
  font-weight: 500;
  font-family: "Oswald", sans-serif;
}

.zero-text .note-source {
  display: block;
  color: #f38900;
  margin-top: -4px;
  margin-bottom: 12px;
  font-weight: 400;
  border-bottom: 1px solid #1f1b18;
  padding-bottom: 10px;
}

.zero-text p {
  color: #9a9d94;
  line-height: 1.7;
  margin-top: 5px;
}

.zero-text code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  color: #f9e4bd;
}

.zero-map {
  overflow: hidden;
  background: url("/assets/documents.png") center / cover no-repeat;
  width: 40%;
  height: 230px;
  margin-left: auto;
  border-radius: 12px;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  margin-top: 14px;
}

.filters label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 16px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transition:
    transform 0.2s,
    border 0.2s,
    background 0.2s;
}

.filters label:hover {
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.filters label:active {
  transform: translateX(2px);
}

.filters label:has(input:focus-visible) {
  outline: 2px solid rgba(245, 158, 11, 0.6);
  outline-offset: -2px;
}

.filters label.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.03);
}

.filters input {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  position: relative;
  background: transparent;
  flex-shrink: 0;
}

.filters input:checked {
  background: #fff;
  border-color: #fff;
}

.filters input:checked::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 10px;
  border: 2px solid #000;
  border-top: 0;
  border-left: 0;
  top: 0;
  left: 4px;
  transform: rotate(45deg);
}

.filters .filter-name {
  font-weight: 600;
  text-transform: lowercase;
  flex: 1;
  text-align: left;
}

.filters .count {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.13);
  padding: 2px 8px;
  border-radius: 999px;
  color: #f5ecdd;
  margin-left: auto;
  flex-shrink: 0;
}

.filters-card.collapsed .filters,
.filters-card.collapsed .filters-clear {
  display: none;
}

.meta {
  margin-top: 0;
  color: rgba(245, 236, 221, 0.6);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.results {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.truncation-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
  color: #f4e7cf;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.truncation-warning strong {
  color: #f59e0b;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.suggestions {
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: rgba(244, 231, 207, 0.85);
}

.suggestions-title {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  margin-bottom: 12px;
  color: rgba(244, 231, 207, 0.65);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(245, 158, 11, 0.18);
  color: #f8e4c1;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.chip:hover {
  transform: translateY(-1px);
  background: rgba(245, 158, 11, 0.28);
}

.zero-map {
  margin-top: 16px;
  overflow: hidden;
  height: 330px;
  background: url("/assets/documents.png") center / cover no-repeat;
  width: 50%;
  margin-left: auto;
}

.card {
  background: rgba(51, 48, 44, 1);
  border-radius: 22px;
  padding: 20px 24px;
  box-shadow: 0 20px 40px rgba(7, 5, 4, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.card:hover {
  /* transform: translateY(-2px); */
  /* box-shadow: 0 24px 48px rgba(7, 5, 4, 0.45); */
  /* border-color: rgba(255, 255, 255, 0.12); */
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.pill {
  font-size: 11px;
  text-transform: lowercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fdf6ea;
  font-weight: 600;
}

.doc-id {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  color: rgba(207, 199, 186, 0.8);
  word-break: break-all;
  overflow-wrap: anywhere;
}

.card-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
  color: #fdf9ee;
}

.note-subtitle {
  display: block;
  color: #f38900;
  margin-top: -2px;
  margin-bottom: 8px;
  font-weight: 600;
}

.search-subtitle {
  margin-top: -4px;
  margin-bottom: 10px;
}

.note-footer {
  margin-top: 12px;
  text-align: left;
  color: #d8d5cc;
  font-style: italic;
  font-size: 14px;
}

.note-footer-right {
  text-align: right;
}

.hidden-snippet {
  display: none;
}

.snippet {
  white-space: pre-wrap;
  color: #f2e8d9;
  font-size: 15px;
  line-height: 1.48;
}

.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: rgba(244, 231, 207, 0.7);
  font-size: 15px;
}

.loading-state::before {
  content: "⏳";
  display: block;
  font-size: 32px;
  margin-bottom: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dialog-toggle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgb(91 91 91 / 20%);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
  color: #f4e7d0;
  transition: all 0.2s ease;
  font-weight: 500;
  white-space: nowrap;
}

.dialog-toggle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.dialog-toggle:active:not(:disabled) {
  transform: translateY(0);
}

.dialog-toggle:disabled {
  opacity: 0.5;
  cursor: progress;
}

.dialog-toggle:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.6);
  outline-offset: 2px;
}

.dialog-icon,
.translation-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.8;
}

.dialog-area {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 8px;
}

.translation-toggle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgb(91 91 91 / 20%);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
  color: #f4e7d0;
  transition: all 0.2s ease;
  font-weight: 500;
  white-space: nowrap;
}

.translation-toggle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.translation-toggle:active:not(:disabled) {
  transform: translateY(0);
}

.translation-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.translation-toggle:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.6);
  outline-offset: 2px;
}

.translation-area {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 8px;
}

.translation-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 12px 0 16px;
}

.translation-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(244, 231, 207, 0.6);
  margin-bottom: 12px;
}

.translation-title {
  color: #e1ddca;
  margin-bottom: 8px;
}

.translation-subtitle {
  margin-bottom: 8px;
}

.translation-snippet {
  color: #9a9d94;
  line-height: 1.7;
  margin-top: 8px;
}

.translation-footer {
  margin-top: 12px;
  color: #9a9d94;
}

.translation-loading {
  color: rgba(244, 231, 207, 0.7);
  font-size: 14px;
  text-align: center;
  padding: 8px 0;
  animation: fadeIn 0.2s ease-in;
}

.translation-area {
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.translation-error {
  color: rgba(231, 76, 60, 0.9);
  font-size: 14px;
  padding: 8px 0;
  animation: fadeIn 0.2s ease-in;
}

.dialog-line + .dialog-line {
  margin-top: 12px;
}

.dialog-line-meta {
  font-size: 11px;
  color: rgba(247, 238, 226, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  opacity: 0.8;
}

.lore-footer {
  text-align: center;
  color: rgba(244, 231, 207, 0.8);
  padding: 30px 12px 50px;
  font-size: 15px;
}

.counter-label {
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 13px;
  color: rgba(244, 231, 207, 0.75);
}

.counter-board {
  margin: 8px auto 0;
  display: inline-flex;
  gap: 4px;
  background: #16161a;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.08);
}

.counter-board span {
  display: inline-block;
  min-width: 18px;
  padding: 4px 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.2));
  border-radius: 6px;
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 18px;
  color: #fdf6ea;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

mark {
  background: rgb(238 153 26 / var(--tw-text-opacity, 1));
  color: #1f1302;
  padding: 0 3px;
  border-radius: 4px;
  font-weight: 600;
}

.pills-container {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.version-pill,
.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 18, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f4e9d6;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.data-version,
.lang-switcher {
  background: transparent;
  border: none;
  color: #f4e9d6;
  font-size: 12px;
  font-family: inherit;
  letter-spacing: 0.05em;
  cursor: pointer;
  outline: none;
}

.data-version:hover,
.lang-switcher:hover {
  color: #fff3db;
}

.data-version:focus,
.lang-switcher:focus {
  color: #f59e0b;
}

@media (max-width: 960px) {
  .pills-container {
    top: 14px;
    right: 14px;
    gap: 8px;
  }

  .version-pill,
  .lang-pill {
    font-size: 10px;
    padding: 5px 10px;
  }
}

@media (max-width: 960px) {
  .site-nav {
    height: 64px;
  }

  .nav-inner {
    padding: 0 16px;
  }

  .nav-burger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(5, 5, 5, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: stretch;
    padding: 20px 0;
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition:
      transform 0.3s ease,
      opacity 0.3s ease,
      visibility 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
    z-index: 10;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .site-nav.nav-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    width: 100%;
    max-width: 100%;
    padding: 16px 24px;
    border-radius: 0;
    text-align: left;
    font-size: 13px;
    letter-spacing: 0.2em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: none;
  }

  .nav-link.active {
    background: rgba(245, 158, 11, 0.15);
    border-left: 3px solid #f59e0b;
    color: #f59e0b;
    font-weight: 600;
  }

  body.nav-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .panel-layout {
    flex-direction: column;
    width: 100%;
    overflow: hidden;
  }

  .filters-card {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
    position: relative;
    top: auto;
  }

  .filters-mobile-toggle {
    display: inline-flex;
  }

  .results-panel {
    width: 100%;
    box-sizing: border-box;
    padding: 16px;
  }

  .search-panel {
    padding: 0;
    border-radius: 28px;
    margin-top: 0;
  }

  .search-input {
    font-size: 18px;
  }

  .search-btn {
    font-size: 16px;
  }

  .filters label {
    padding: 8px 10px;
  }

  .hero {
    background-attachment: scroll;
  }
}

@media (max-width: 640px) {
  body {
    /* padding-top: 70px; */
  }

  .zero-state {
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
  }

  .zero-text {
    width: 100%;
    margin-left: 0;
    margin-top: 0;
  }

  .zero-text h3 {
    font-size: 20px;
  }

  .zero-map {
    width: 100%;
    height: 200px;
    margin-left: 0;
    margin-top: 0;
  }

  .site-nav {
    height: 56px;
  }

  .wrap {
    padding: 0;
  }

  .hero {
    padding: 60px 16px 20px;
    min-height: 260px;
    background-attachment: scroll;
  }

  .hero-content {
    gap: 10px;
  }

  .crumbs {
    font-size: 10px;
    letter-spacing: 0.25em;
  }

  .hero-sub {
    font-size: 13px;
  }

  .hero-divider {
    width: 160px;
  }

  .hero-search {
    margin-top: 4px;
  }

  .pills-container {
    top: 12px;
    right: 12px;
    gap: 6px;
  }

  .version-pill,
  .lang-pill {
    font-size: 9px;
    padding: 4px 8px;
  }

  .search-form {
    flex-direction: column;
    gap: 10px;
  }

  .search-btn {
    width: 100%;
    padding: 12px 20px;
    border-radius: 12px;
    min-height: 44px;
    font-size: 15px;
    touch-action: manipulation;
  }

  .search-input {
    font-size: 15px;
    padding: 12px 40px 12px 16px;
    min-height: 44px;
  }

  .clear-btn {
    right: 10px;
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .search-panel {
    padding: 0;
    border-radius: 24px;
    margin-top: 20px;
  }

  .results-panel {
    padding: 16px;
  }

  .filters label {
    flex-wrap: wrap;
    padding: 12px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .card {
    padding: 16px;
    border-radius: 18px;
  }

  .card:hover {
    transform: none;
  }

  .nav-burger {
    width: 24px;
    height: 24px;
    gap: 3px;
  }

  .nav-burger span {
    height: 2px;
  }

  .nav-inner {
    gap: 12px;
    padding: 0 12px;
  }

  .nav-logo {
    flex-shrink: 0;
    min-width: auto;
  }

  .nav-logo span {
    font-size: 12px;
    letter-spacing: 0.15em;
  }

  .nav-logo img {
    width: 32px;
    height: 32px;
  }

  .nav-links {
    top: 56px;
    max-height: calc(100vh - 56px);
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .site-nav {
    height: 56px;
  }

  .filters-mobile-toggle {
    min-height: 40px;
    padding: 16px 16px;
    touch-action: manipulation;
  }

  .filters-clear {
    min-height: 44px;
    touch-action: manipulation;
  }

  .card-actions {
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .dialog-toggle {
    min-height: 40px;
    padding: 8px 14px;
    touch-action: manipulation;
    font-size: 10px;
  }

  .translation-toggle {
    min-height: 40px;
    padding: 8px 14px;
    touch-action: manipulation;
    font-size: 10px;
  }

  .chip {
    min-height: 40px;
    padding: 10px 16px;
    touch-action: manipulation;
  }

  .meta {
    font-size: 14px;
    line-height: 1.5;
  }

  .meta-row {
    gap: 8px;
  }

  .type-chips {
    gap: 8px;
    margin-bottom: 4px;
  }

  .type-chip {
    font-size: 12px;
    padding: 6px 10px;
  }

  .truncation-warning {
    padding: 12px 16px;
    font-size: 13px;
  }

  .results-panel {
    gap: 12px;
  }
}

.article-hero {
  /* min-height: 60vh; */
  /* padding: 160px 24px 120px; */
}

.article-hero .hero-content {
  gap: 20px;
}

.article-hero .hero-sub {
  max-width: 640px;
  font-size: 18px;
}

.article-layout {
  max-width: 900px;
  margin: 0 auto 60px;
  padding: 32px;
  border-radius: 34px;
  background: var(--graphite);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f5ecdd;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
}

.article-intro {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  color: rgba(245, 231, 210, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  margin-bottom: 24px;
}

.article-body {
  font-size: 17px;
  line-height: 1.72;
  color: #f4ede1;
}

.article-body h2 {
  margin-top: 40px;
  margin-bottom: 12px;
  font-size: 26px;
  color: #fdf6ea;
  letter-spacing: 0.04em;
}

.article-body h3 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 20px;
  color: #f9e3c0;
}

.article-body p {
  margin: 0 0 16px;
}

.article-body ul {
  padding-left: 20px;
  margin: 0 0 18px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-meta {
  list-style: none;
  padding: 0;
  margin: 14px 0 18px;
}

.article-meta li {
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.article-meta strong {
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.article-figure {
  margin: 26px auto;
  text-align: center;
}

.article-figure img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.article-figure figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.article-callout {
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 18px;
  padding: 18px 22px 2px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.02));
  margin: 24px 0;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.article-callout strong {
  color: var(--amber);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

blockquote {
  border-left: 4px solid var(--amber);
  margin: 24px 0;
  padding: 8px 0 1px 16px;
  color: rgba(255, 230, 196, 0.9);
  font-style: italic;
}

.article-body h2 {
  color: var(--amber);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 32px;
  margin-bottom: 12px;
}

.article-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 28px 0 20px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 22px;
  margin-top: 20px;
}

.article-card {
  background: rgba(30, 27, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.article-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.65));
  overflow: hidden;
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-thumb.placeholder {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.4));
  filter: grayscale(1);
}

.article-card-link-block {
  display: block;
  text-decoration: none;
  color: inherit;
}

.article-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.72) 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.article-status {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f59e0b;
}

.article-status.muted {
  color: rgba(255, 255, 255, 0.6);
}

.article-card h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.04em;
}

.article-card.wip .article-thumb {
  filter: grayscale(1);
}

.article-card.wip .article-overlay h3 {
  color: rgba(255, 255, 255, 0.7);
}

.article-cta {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #1c1206;
  background: var(--amber);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 640px) {
  .article-hero {
    padding: 20px 18px 20px;
    /* min-height: 40vh; */
  }

  .article-layout {
    margin-top: 0;
    padding: 22px;
    border-radius: 26px;
  }

  .article-cta {
    width: 100%;
    justify-content: center;
  }
}

.diff-wrap {
  max-width: 1040px;
  margin: 0 auto 60px;
  padding: 0 24px;
}

.diff-panel {
  background: var(--graphite);
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 32px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
  color: #f4ebda;
}

.diff-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.diff-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 12px;
  color: rgba(244, 231, 207, 0.75);
}

.diff-control select {
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fdf6ea;
  font-size: 16px;
}

.diff-run {
  padding: 14px 28px;
  border-radius: 18px;
  border: none;
  background: var(--amber);
  color: #1c1206;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
}

.diff-meta {
  margin: 24px 0 12px;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: rgba(244, 231, 207, 0.8);
}

.diff-tabs {
  margin-top: 24px;
  display: inline-flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.diff-tab {
  border: none;
  background: transparent;
  color: rgba(244, 231, 207, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 11px;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.diff-tab.active {
  background: #f59e0b;
  color: #1c1206;
  font-weight: 600;
}

.diff-search {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.diff-search input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #f8ebd7;
  font-size: 15px;
}

.diff-search-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.diff-search-actions .filter-button {
  padding: 14px;
  border-radius: 18px;
  border: none;
  background: var(--amber);
  color: #1c1206;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  transition:
    filter 0.2s ease,
    transform 0.15s ease;
}

.diff-search-actions .filter-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.diff-search-actions .filter-button:active {
  transform: translateY(0);
}

.diff-search-actions .filter-button:focus-visible {
  outline: 2px solid #1c1206;
  outline-offset: 2px;
}

.diff-search-actions .filter-button svg {
  width: 18px;
  height: 18px;
}

.diff-search-actions button {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.4);
  color: #f6f0df;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
  line-height: 1;
}

.diff-search-actions button#diff-search-clear {
  width: 40px;
  padding: 10px 0;
  border-radius: 999px;
  font-size: 18px;
}

.diff-sections {
  margin-top: 24px;
}

.diff-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  display: none;
}

.diff-section.active {
  display: block;
}

.diff-section h3 {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 13px;
  color: rgba(244, 231, 207, 0.75);
}

.diff-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.diff-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px;
  background: rgba(51, 48, 44, 0.85);
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.diff-card-header {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  word-break: break-word;
  overflow-wrap: break-word;
  color: rgba(244, 231, 207, 0.7);
}

.diff-card-header span {
  word-break: break-word;
  overflow-wrap: break-word;
}

.diff-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.diff-status.added {
  background: rgba(46, 204, 113, 0.25);
  color: #b9f3cf;
}

.diff-status.removed {
  background: rgba(231, 76, 60, 0.25);
  color: #ffb3a8;
}

.diff-status.changed {
  background: rgba(241, 196, 15, 0.25);
  color: #fde6a9;
}

.diff-text {
  font-size: 15px;
  color: #f2e8d9;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.diff-change-body {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.diff-change-column {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diff-change-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(244, 231, 207, 0.65);
}

.diff-change-column .diff-text {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.35);
  min-height: 110px;
  display: block;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.diff-mark {
  padding: 0 2px;
  border-radius: 3px;
}

.diff-mark.diff-new {
  background: rgb(51 112 91 / 80%);
  color: #fff;
  font-weight: 500;
}

.diff-mark.diff-old {
  background: rgb(123 39 39 / 80%);
  color: #fff;
  font-weight: 500;
}

@media (max-width: 640px) {
  .diff-wrap {
    /* margin-top: -80px; */
    padding: 0 16px 40px;
  }

  .diff-panel {
    padding: 20px;
    border-radius: 24px;
  }

  .diff-control {
    width: 100%;
  }

  .diff-controls {
    flex-direction: column;
  }

  .diff-run {
    width: 100%;
    justify-content: center;
  }

  .diff-tabs {
    flex-direction: column;
    width: 100%;
    border-radius: 20px;
  }

  .diff-tab {
    width: 100%;
    text-align: center;
  }

  .diff-search {
    flex-direction: column;
    gap: 10px;
  }

  .diff-search input {
    width: 100%;
    box-sizing: border-box;
  }

  .diff-search-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .diff-card {
    padding: 14px;
    border-radius: 16px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .diff-card-header {
    font-size: 11px;
    gap: 8px;
  }

  .diff-text {
    font-size: 14px;
    line-height: 1.5;
  }

  .diff-change-body {
    flex-direction: column;
  }

  .diff-change-column {
    width: 100%;
    min-width: 100%;
    flex: 1 1 100%;
  }

  .diff-change-column .diff-text {
    min-height: auto;
  }
}
