:root {
  --bg: #eef0ea;
  --paper: rgba(249, 250, 246, 0.9);
  --paper-strong: #fdfdf9;
  --ink: #1c231d;
  --muted: #5e6a60;
  --line: rgba(50, 64, 53, 0.14);
  --accent: #5f705a;
  --accent-dark: #3f4d3c;
  --accent-soft: #dbe1d4;
  --shadow: 0 10px 24px rgba(42, 57, 45, 0.08);
  --radius: 10px;
  --body-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --heading-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --heading-color: var(--ink);
  --body-text-color: var(--ink);
  --text-scale: 1;
}

html[data-color-scheme="dark"] {
  --bg: #151b17;
  --paper: rgba(29, 36, 31, 0.92);
  --paper-strong: #202721;
  --ink: #edf3ea;
  --muted: #bcc8bc;
  --line: rgba(220, 228, 220, 0.12);
  --accent: #8da181;
  --accent-dark: #d8e4d0;
  --accent-soft: #253027;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body-font);
  color: var(--body-text-color);
  font-size: calc(16px * var(--text-scale));
  background:
    radial-gradient(circle at top left, rgba(95, 112, 90, 0.09), transparent 24%),
    linear-gradient(180deg, #f4f5f1 0%, var(--bg) 45%, #ebeee7 100%);
  min-height: 100vh;
}

html[data-color-scheme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(141, 161, 129, 0.12), transparent 24%),
    linear-gradient(180deg, #0f1411 0%, var(--bg) 45%, #18201a 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(86, 102, 89, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 102, 89, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 82%);
}

html[data-color-scheme="dark"] body::before {
  background-image:
    linear-gradient(rgba(213, 223, 210, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(213, 223, 210, 0.03) 1px, transparent 1px);
}

html[data-color-scheme="dark"] ::placeholder {
  color: rgba(216, 228, 208, 0.52);
}

.hero,
main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  padding: 1rem 0 2rem;
}

.hero-compact {
  padding-bottom: 0.5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.brand,
.nav-links a {
  color: var(--ink);
  text-decoration: none;
}

.nav-links a {
  position: relative;
}

.brand {
  font-family: var(--heading-font);
  font-size: 1.2rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 1rem;
  font-weight: 600;
  margin-left: auto;
  align-items: center;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.topbar-tools .nav-links {
  margin-left: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(63, 77, 60, 0.18);
  border-radius: 999px;
  background: rgba(248, 250, 245, 0.92);
  color: var(--accent-dark);
  cursor: pointer;
}

.nav-toggle-bars {
  display: grid;
  gap: 4px;
}

.nav-toggle-bars span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.admin-alert-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: #c63c2f;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
  vertical-align: middle;
}

.admin-alert-indicator.hidden {
  display: none;
}

html[data-color-scheme="dark"] .admin-alert-indicator {
  box-shadow: 0 0 0 2px rgba(18, 24, 19, 0.9);
}

.site-preferences {
  position: relative;
}

.site-preferences-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(63, 77, 60, 0.18);
  border-radius: 999px;
  background: rgba(248, 250, 245, 0.92);
  color: var(--accent-dark);
  cursor: pointer;
}

.site-preferences-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-preferences-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(300px, calc(100vw - 2rem));
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
  z-index: 30;
}

.site-preferences-menu[hidden] {
  display: none !important;
}

.site-preferences-title {
  margin: 0;
  font-family: var(--heading-font);
  font-size: 1rem;
  color: var(--heading-color);
}

.site-preferences-group {
  display: grid;
  gap: 0.45rem;
}

.site-preferences-group-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-preferences-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.site-preferences-choice {
  min-height: 34px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(248, 250, 245, 0.78);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.site-preferences-choice.active {
  border-color: rgba(95, 112, 90, 0.42);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.site-preferences-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.hero-content {
  background: linear-gradient(180deg, rgba(252, 252, 248, 0.96), rgba(242, 245, 238, 0.94));
  border: 1px solid rgba(69, 83, 71, 0.12);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: clamp(1.8rem, 5vw, 4rem);
  overflow: hidden;
  position: relative;
}

.hero-content::after {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 180px;
  height: 180px;
  background: linear-gradient(135deg, rgba(95, 112, 90, 0.1), rgba(95, 112, 90, 0));
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 0.75rem;
}

h1,
h2,
h3 {
  font-family: var(--heading-font);
  color: var(--heading-color);
  line-height: 1.05;
  margin: 0;
  max-width: none;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
}

.hero-content h1 {
  max-width: 30ch;
}

h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.45rem);
}

h3 {
  font-size: 1.02rem;
  margin-bottom: 0.8rem;
}

.lead {
  max-width: 62ch;
  font-size: 1.03rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 1.25rem 0 0;
}

.text-font-serif {
  font-family: "Fraunces", serif;
}

.text-font-sans {
  font-family: "Manrope", sans-serif;
}

.text-tone-default {
  color: var(--ink);
}

.text-tone-accent {
  color: var(--accent-dark);
}

.text-tone-soft {
  color: var(--muted);
}

.text-size-sm {
  font-size: 0.94em;
}

.text-size-md {
  font-size: 1em;
}

.text-size-lg {
  font-size: 1.12em;
}

.text-width-narrow {
  max-width: 46ch;
}

.text-width-regular {
  max-width: 62ch;
}

.text-width-wide {
  max-width: 76ch;
}

.news-card-tone-default {
  background: var(--paper-strong);
}

.news-card-tone-soft {
  background: linear-gradient(180deg, rgba(247, 249, 244, 0.96), rgba(238, 242, 235, 0.92));
}

.news-card-tone-accent {
  background: linear-gradient(180deg, rgba(236, 242, 232, 0.98), rgba(221, 230, 216, 0.96));
  border-color: rgba(95, 112, 90, 0.2);
}

.hero-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.45rem 0.78rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.1;
  white-space: nowrap;
}

.button.primary {
  background: var(--accent);
  color: #f7faf4;
}

.button.secondary {
  border: 1px solid rgba(63, 77, 60, 0.18);
  color: var(--accent-dark);
  background: rgba(248, 250, 245, 0.9);
}

.button.tertiary {
  border: 0;
  padding-inline: 0.2rem;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

main {
  padding: 0 0 4rem;
}

.overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.news-panel {
  margin: 1.5rem 0 1.25rem;
}

.resource-panel {
  margin: 1.5rem 0 1.25rem;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.news-card {
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: var(--paper-strong);
  border-radius: 12px;
  padding: 1.1rem;
}

.news-card.featured {
  background: linear-gradient(180deg, rgba(248, 250, 245, 0.98), rgba(234, 239, 230, 0.96));
}

.news-card p:last-child {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0;
}

.stat-card,
.panel {
  background: var(--paper);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 1.5rem;
}

.stat-value {
  display: block;
  font-family: var(--heading-font);
  font-size: 2.6rem;
  color: var(--accent-dark);
}

.stat-label {
  color: var(--muted);
  font-weight: 600;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 1.25rem;
}

.panel {
  padding: 1.5rem;
}

.section-heading p:last-child {
  color: var(--muted);
  line-height: 1.7;
  max-width: 62ch;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.5rem 0 1rem;
}

.filters label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.filters input,
.filters select {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid rgba(67, 50, 35, 0.14);
  background: rgba(255, 251, 245, 0.95);
  padding: 0.8rem 0.9rem;
  font: inherit;
  color: var(--ink);
}

.filter-actions {
  display: flex;
  align-items: end;
}

.feature-panel {
  padding-top: 0;
}

.feature-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.feature-card,
.preview-feature-card,
.feature-editor-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

.feature-card {
  padding: 1rem;
}

.feature-card h2 {
  margin-bottom: 0.45rem;
}

.feature-search-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.85rem;
}

.feature-search-form input {
  flex: 1;
}

.frontpage-feature-editor,
.preview-feature-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.feature-editor-card {
  padding: 0.9rem;
}

.feature-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.preview-feature-card {
  padding: 0.75rem 0.9rem;
}

.preview-feature-card span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.preview-feature-card p {
  margin: 0.35rem 0 0;
}

.archive-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  margin-bottom: 1rem;
}

.archive-list {
  display: grid;
  gap: 0.9rem;
}

.archive-list.archive-list-compact,
#archive-list {
  gap: 0;
}

.archive-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.archive-page-panel {
  margin-bottom: 1.25rem;
}

.alphabet-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.alphabet-item {
  min-width: 34px;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(63, 77, 60, 0.18);
  background: rgba(248, 250, 245, 0.92);
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  font-size: 0.83rem;
  cursor: pointer;
}

.alphabet-item.active {
  background: rgba(219, 225, 212, 0.9);
}

.archive-card {
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: var(--paper-strong);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.archive-card:hover,
.archive-card:focus-visible,
.archive-card.active {
  transform: translateY(-1px);
  border-color: rgba(140, 59, 47, 0.35);
  box-shadow: 0 8px 18px rgba(42, 57, 45, 0.08);
  outline: none;
}

.archive-thumb {
  margin-bottom: 0.9rem;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: rgba(219, 225, 212, 0.55);
}

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

.archive-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.archive-card h3 {
  margin: 0;
}

.archive-card p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.75rem 0;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid rgba(67, 50, 35, 0.1);
  background: transparent;
  box-shadow: none;
}

.archive-row:hover,
.archive-row:focus-visible,
.archive-row.active {
  transform: none;
  border-color: rgba(67, 50, 35, 0.1);
  box-shadow: none;
}

.archive-row-main {
  min-width: 0;
}

.archive-row .archive-thumb,
.archive-row p,
.archive-row .tag-row {
  display: none;
}

.archive-row header {
  margin: 0;
}

.archive-row h3 {
  font-size: 1rem;
  margin: 0;
}

.archive-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.archive-row-meta span {
  white-space: nowrap;
}

.archive-row .card-actions {
  margin-top: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.tag-row,
.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.tag,
.link-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.58rem;
  border-radius: 999px;
  background: rgba(219, 225, 212, 0.7);
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
}

.detail-panel {
  position: sticky;
  top: 1rem;
  align-self: start;
  min-height: 460px;
}

.detail-empty,
.detail-view {
  animation: fadeUp 300ms ease;
}

.detail-subtitle,
#detail-description,
.about-copy p {
  color: var(--muted);
  line-height: 1.75;
}

.detail-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1rem;
  margin: 1.5rem 0;
}

.detail-meta dt {
  font-weight: 700;
}

.detail-meta dd {
  margin: 0;
  color: var(--muted);
}

.detail-section {
  padding-top: 1rem;
  border-top: 1px solid rgba(67, 50, 35, 0.1);
  margin-top: 1rem;
}

.detail-page-link {
  margin: 1rem 0 0;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.source-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
}

.about-panel {
  margin-top: 1.25rem;
}

.about-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.hidden {
  display: none !important;
}

.larp-shell,
.empty-state {
  margin-bottom: 1.25rem;
}

.larp-lead {
  margin-bottom: 0;
}

.larp-media-hero {
  margin: 1.1rem 0 1.2rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: rgba(240, 244, 237, 0.9);
}

.larp-media-hero img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

.larp-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.larp-gallery-item {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: rgba(240, 244, 237, 0.9);
}

.larp-gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.admin-main {
  padding-bottom: 4rem;
}

.auth-panel {
  max-width: 1040px;
  margin: 0 auto 1.25rem;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.auth-form-secondary {
  padding: 1.2rem;
  border-radius: 10px;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: rgba(247, 249, 244, 0.88);
}

.auth-form label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.auth-form input,
.auth-form textarea {
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid rgba(67, 50, 35, 0.14);
  background: rgba(255, 251, 245, 0.95);
  padding: 0.8rem 0.9rem;
  font: inherit;
  color: var(--ink);
}

.auth-form textarea {
  min-height: 120px;
  resize: vertical;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(95, 112, 90, 0.1);
  color: var(--accent-dark);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.4fr);
  gap: 1.25rem;
}

.admin-sidebar,
.admin-editor {
  min-width: 0;
}

.admin-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.admin-search {
  display: grid;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 1rem 0 0;
}

.admin-search input {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(67, 50, 35, 0.14);
  background: rgba(255, 251, 245, 0.95);
  padding: 0.8rem 0.9rem;
  font: inherit;
  color: var(--ink);
}

.admin-mode-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.admin-mode-item {
  width: 100%;
  text-align: left;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: var(--paper-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.93rem;
  cursor: pointer;
}

.admin-mode-item.active {
  border-color: rgba(140, 59, 47, 0.35);
  box-shadow: 0 8px 18px rgba(42, 57, 45, 0.08);
}

.admin-list-shell {
  margin-top: 1rem;
}

.admin-userbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: rgba(255, 250, 241, 0.7);
  margin: 1.25rem 0 1rem;
}

.admin-userbar span {
  display: block;
  color: var(--muted);
  margin-top: 0.25rem;
}

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

.admin-subnav-item {
  border: 1px solid rgba(92, 36, 29, 0.2);
  color: var(--accent-dark);
  background: rgba(255, 250, 241, 0.7);
  border-radius: 999px;
  min-height: 42px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 700;
}

.admin-subnav-item.active {
  background: rgba(223, 194, 167, 0.42);
}

.admin-subnav-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-pane {
  display: block;
}

.file-button {
  cursor: pointer;
}

.admin-status {
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 1rem;
}

.admin-status[data-tone="success"] {
  color: #2f6b41;
}

.admin-status[data-tone="error"] {
  color: #8a3b2f;
}

html[data-color-scheme="dark"] .admin-status[data-tone="success"] {
  color: #9ad0a9;
}

html[data-color-scheme="dark"] .admin-status[data-tone="error"] {
  color: #f0a799;
}

.admin-list {
  display: grid;
  gap: 0.75rem;
}

.admin-list-item {
  display: grid;
  gap: 0.3rem;
  grid-template-columns: auto 1fr;
  align-items: center;
  text-align: left;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: var(--paper-strong);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.admin-list-item-main {
  display: grid;
  gap: 0.3rem;
}

.admin-list-item-main span:last-child {
  font-size: 0.88rem;
}

.admin-list-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 0.75rem 0 0;
}

.admin-list-item span {
  color: var(--muted);
}

.admin-list-item.active {
  border-color: rgba(140, 59, 47, 0.35);
  box-shadow: 0 8px 18px rgba(42, 57, 45, 0.08);
}

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

.admin-note {
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: rgba(246, 248, 242, 0.92);
  margin-bottom: 1rem;
}

.admin-note p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-inline-note {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(67, 50, 35, 0.1);
  border-radius: 8px;
  background: rgba(247, 249, 244, 0.82);
}

.admin-inline-note .admin-actions {
  margin-bottom: 0.5rem;
}

.admin-inline-note p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.field-help {
  margin: -0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.notification-preferences {
  display: grid;
  gap: 0.6rem;
}

.notification-preferences-head,
.notification-preference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 90px;
  gap: 0.8rem;
  align-items: center;
}

.notification-preferences-head {
  padding: 0 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notification-preference-row {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(67, 50, 35, 0.1);
  border-radius: 10px;
  background: rgba(247, 249, 244, 0.82);
}

.notification-preference-row span {
  display: grid;
  gap: 0.25rem;
}

.notification-preference-row strong {
  font-size: 0.98rem;
}

.notification-preference-row small {
  color: var(--muted);
  line-height: 1.5;
}

.notification-preference-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  justify-self: center;
}

.notification-inbox {
  display: grid;
  gap: 0.8rem;
}

.notification-list {
  display: grid;
  gap: 0.75rem;
}

.notification-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(67, 50, 35, 0.1);
  border-radius: 10px;
  background: var(--paper-strong);
}

.notification-card.unread {
  border-color: rgba(140, 59, 47, 0.28);
  box-shadow: 0 8px 18px rgba(42, 57, 45, 0.06);
}

.notification-card-copy {
  display: grid;
  gap: 0.45rem;
}

.notification-card-copy h3,
.notification-card-copy p {
  margin: 0;
}

.admin-preview {
  display: grid;
  gap: 0.75rem;
}

.editor-field {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(67, 50, 35, 0.1);
  border-radius: 10px;
  background: rgba(247, 249, 244, 0.78);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid rgba(67, 50, 35, 0.08);
}

.editor-toolbar label {
  display: grid;
  gap: 0.35rem;
  min-width: 120px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.editor-toolbar input,
.editor-toolbar select {
  min-height: 38px;
  padding: 0.5rem 0.65rem;
}

.preview-card {
  border: 1px solid rgba(67, 50, 35, 0.1);
  border-radius: 10px;
  background: var(--paper-strong);
  padding: 1.1rem;
  color: var(--body-text-color);
  font-family: var(--body-font);
  font-size: calc(16px * var(--text-scale));
}

.preview-card h1,
.preview-card h2,
.preview-card h3,
.preview-card .brand {
  color: var(--heading-color);
  font-family: var(--heading-font);
}

.preview-divider {
  border: 0;
  border-top: 1px solid rgba(67, 50, 35, 0.1);
  margin: 1.1rem 0;
}

.preview-copy p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0.75rem 0 0;
}

.upload-section {
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: rgba(246, 248, 242, 0.92);
}

.upload-list {
  display: grid;
  gap: 0.75rem;
}

.upload-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: var(--paper-strong);
}

.upload-item-document {
  grid-template-columns: 1fr auto auto;
}

.upload-thumb-preview {
  width: 120px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.upload-item-copy {
  display: grid;
  gap: 0.35rem;
}

.upload-item-copy span {
  color: var(--muted);
}

.upload-radio-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--muted);
}

.upload-item-choice {
  grid-template-columns: 1fr;
}

.upload-remove {
  justify-self: end;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.admin-form label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(67, 50, 35, 0.14);
  background: rgba(252, 253, 249, 0.98);
  padding: 0.8rem 0.9rem;
  font: inherit;
  color: var(--ink);
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.stats-hero {
  margin-bottom: 1.5rem;
}

.stats-controls-panel {
  margin-bottom: 1.25rem;
}

.stats-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.stats-grid-enhanced {
  align-items: start;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.chart-panel {
  overflow: hidden;
}

.chart-shell {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(67, 50, 35, 0.08);
  background:
    linear-gradient(180deg, rgba(250, 251, 247, 0.96), rgba(240, 244, 237, 0.9)),
    linear-gradient(90deg, rgba(95, 112, 90, 0.05), rgba(95, 112, 90, 0));
}

.stats-chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart-bg {
  fill: transparent;
}

.chart-bar {
  fill: rgba(95, 112, 90, 0.9);
}

.chart-label {
  fill: var(--ink);
  font-family: var(--body-font);
  font-size: 13px;
  font-weight: 700;
}

.chart-value {
  fill: var(--muted);
  font-family: var(--body-font);
  font-size: 12px;
  font-weight: 600;
}

.stats-list {
  display: grid;
  gap: 0.75rem;
}

.stats-list.secondary {
  margin-top: 1rem;
}

.stats-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: var(--paper-strong);
}

.stats-item span {
  color: var(--muted);
  text-align: right;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.insight-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(67, 50, 35, 0.1);
  background: linear-gradient(180deg, rgba(247, 249, 244, 0.96), rgba(237, 242, 234, 0.92));
}

.insight-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.insight-value {
  color: var(--accent-dark);
  font-family: var(--heading-font);
  font-size: 1.15rem;
  line-height: 1.2;
}

.stats-caption {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 1rem;
}

html[data-color-scheme="dark"] .site-preferences-toggle {
  border-color: rgba(216, 228, 208, 0.12);
  background: rgba(35, 43, 36, 0.95);
  color: var(--ink);
}

html[data-color-scheme="dark"] .nav-toggle {
  border-color: rgba(216, 228, 208, 0.12);
  background: rgba(35, 43, 36, 0.95);
  color: var(--ink);
}

html[data-color-scheme="dark"] .site-preferences-choice {
  background: rgba(39, 48, 41, 0.92);
  color: var(--ink);
}

html[data-color-scheme="dark"] .hero-content {
  background: linear-gradient(180deg, rgba(29, 36, 31, 0.96), rgba(22, 28, 24, 0.95));
  border-color: rgba(216, 228, 208, 0.08);
}

html[data-color-scheme="dark"] .hero-content::after {
  background: linear-gradient(135deg, rgba(141, 161, 129, 0.16), rgba(141, 161, 129, 0));
}

html[data-color-scheme="dark"] .button.secondary,
html[data-color-scheme="dark"] .alphabet-item {
  border-color: rgba(216, 228, 208, 0.12);
  background: rgba(39, 48, 41, 0.92);
  color: var(--ink);
}

html[data-color-scheme="dark"] .button.tertiary {
  color: var(--muted);
}

html[data-color-scheme="dark"] .alphabet-item.active,
html[data-color-scheme="dark"] .site-preferences-choice.active,
html[data-color-scheme="dark"] .admin-subnav-item.active {
  background: rgba(95, 112, 90, 0.4);
}

html[data-color-scheme="dark"] .news-card.featured {
  background: linear-gradient(180deg, rgba(34, 42, 35, 0.98), rgba(27, 34, 28, 0.96));
}

html[data-color-scheme="dark"] .archive-thumb,
html[data-color-scheme="dark"] .larp-media-hero,
html[data-color-scheme="dark"] .larp-gallery-item {
  border-color: rgba(216, 228, 208, 0.08);
  background: rgba(30, 39, 32, 0.92);
}

html[data-color-scheme="dark"] .tag,
html[data-color-scheme="dark"] .link-chip {
  background: rgba(70, 85, 72, 0.72);
  color: var(--ink);
}

html[data-color-scheme="dark"] .filters input,
html[data-color-scheme="dark"] .filters select,
html[data-color-scheme="dark"] .feature-search-form input,
html[data-color-scheme="dark"] .auth-form input,
html[data-color-scheme="dark"] .auth-form textarea,
html[data-color-scheme="dark"] .admin-search input,
html[data-color-scheme="dark"] .editor-toolbar input,
html[data-color-scheme="dark"] .editor-toolbar select,
html[data-color-scheme="dark"] .admin-form input,
html[data-color-scheme="dark"] .admin-form textarea,
html[data-color-scheme="dark"] .admin-form select {
  border-color: rgba(216, 228, 208, 0.1);
  background: rgba(31, 39, 33, 0.96);
  color: #edf3ea;
}

html[data-color-scheme="dark"] input:-webkit-autofill,
html[data-color-scheme="dark"] textarea:-webkit-autofill,
html[data-color-scheme="dark"] select:-webkit-autofill {
  -webkit-text-fill-color: #edf3ea;
  box-shadow: 0 0 0 1000px rgba(31, 39, 33, 0.96) inset;
}

html[data-color-scheme="dark"] .auth-form-secondary,
html[data-color-scheme="dark"] .admin-userbar,
html[data-color-scheme="dark"] .admin-subnav-item,
html[data-color-scheme="dark"] .admin-note,
html[data-color-scheme="dark"] .admin-inline-note,
html[data-color-scheme="dark"] .editor-field,
html[data-color-scheme="dark"] .upload-section,
html[data-color-scheme="dark"] .notification-preference-row,
html[data-color-scheme="dark"] .notification-card {
  border-color: rgba(216, 228, 208, 0.08);
  background: rgba(30, 38, 31, 0.9);
}

html[data-color-scheme="dark"] .chart-shell {
  border-color: rgba(216, 228, 208, 0.08);
  background:
    linear-gradient(180deg, rgba(28, 35, 29, 0.96), rgba(21, 28, 23, 0.94)),
    linear-gradient(90deg, rgba(141, 161, 129, 0.08), rgba(141, 161, 129, 0));
}

html[data-color-scheme="dark"] .password-toggle:hover,
html[data-color-scheme="dark"] .password-toggle:focus-visible {
  background: rgba(141, 161, 129, 0.16);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .overview,
  .news-grid,
  .content-grid,
  .about-copy,
  .auth-grid,
  .filters,
  .archive-grid-compact,
  .admin-grid,
  .form-grid,
  .stats-grid,
  .notification-preferences-head,
  .notification-preference-row {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

  .stats-controls,
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .admin-userbar,
  .feature-editor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .larp-gallery,
  .upload-item {
    grid-template-columns: 1fr;
  }

  .upload-item-document {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero,
  main {
    width: min(100% - 1rem, 1180px);
  }

  .hero {
    padding-top: 0.55rem;
  }

  .topbar {
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
  }

  .topbar-tools {
    width: 100%;
    margin-left: 0;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
    order: 1;
  }

  .nav-links {
    display: none;
    order: 3;
    width: 100%;
    margin-left: 0;
    padding-top: 0.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(248, 250, 245, 0.9);
  }

  .site-preferences {
    order: 2;
    margin-left: auto;
  }

  .site-preferences-menu {
    width: min(300px, calc(100vw - 1rem));
  }

  .hero-content {
    padding: 1.25rem 1rem 1.4rem;
  }

  .hero-content h1 {
    max-width: none;
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .lead {
    font-size: 0.98rem;
    margin-top: 1rem;
  }

  .hero-actions .button,
  .detail-page-link .button,
  .filter-actions .button {
    width: 100%;
  }

  .archive-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .archive-row {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    align-items: start;
    padding: 0.8rem 0;
  }

  .archive-row-meta {
    gap: 0.35rem 0.55rem;
    font-size: 0.84rem;
  }

  .archive-row-meta span {
    white-space: normal;
  }

  .archive-row .card-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .detail-meta {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .larp-media-hero img {
    max-height: 300px;
  }

  .auth-form input,
  .auth-form textarea,
  .admin-form input,
  .admin-form textarea,
  .admin-form select,
  .filters input,
  .filters select,
  .admin-search input {
    min-height: 44px;
    padding: 0.72rem 0.82rem;
  }

  .admin-userbar {
    padding: 0.9rem;
  }

  .admin-mode-item,
  .admin-list-item {
    padding: 0.82rem 0.9rem;
  }

  .admin-list-item {
    grid-template-columns: 1fr;
  }

  .admin-list-item input[type="checkbox"] {
    margin: 0;
  }

  .panel,
  .stat-card {
    padding: 1.1rem;
  }

  .admin-actions {
    flex-wrap: wrap;
  }

  .admin-actions .button {
    width: 100%;
  }

  .notification-preferences-head {
    display: none;
  }

  .notification-preference-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.65rem;
    padding: 0.85rem;
  }

  .stats-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .stats-item span {
    text-align: left;
  }

  .chart-shell {
    padding: 0.75rem;
    overflow-x: auto;
  }
}
