:root {
  --bg: #090907;
  --bg-2: #11100d;
  --panel: #171511;
  --panel-2: #201d17;
  --line: #393324;
  --line-strong: #6f5d35;
  --paper: #e7dcc2;
  --muted: #a99c80;
  --amber: #c99a45;
  --red: #8f2f24;
  --green: #6f7d56;
  --shadow: rgba(0, 0, 0, 0.55);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--paper);
  font-family: "Tomorrow", sans-serif;
  line-height: 1.6;
  background:
    linear-gradient(rgba(9, 9, 7, 0.78), rgba(9, 9, 7, 0.92)),
    radial-gradient(circle at 12% 10%, rgba(143, 47, 36, 0.24), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(111, 125, 86, 0.16), transparent 30%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 4px),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}

a {
  color: var(--amber);
  text-decoration: none;
}

a:hover {
  color: var(--paper);
}

button,
input,
textarea,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 12, 10, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.site-nav {
  width: min(1180px, calc(100% - 2rem));
  min-height: 68px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.site-mark {
  display: grid;
  gap: 0.1rem;
  color: var(--paper);
}

.site-mark__stamp,
.eyebrow,
.case-tag {
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-mark__title {
  font-family: "Special Elite", serif;
  font-size: 1.15rem;
}

.site-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.site-links a {
  color: var(--muted);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.site-links a:hover {
  color: var(--paper);
  background: rgba(201, 154, 69, 0.1);
}

.site-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.admin-access,
.account-menu summary {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--paper);
  background: rgba(32, 29, 23, 0.72);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}

.admin-access:hover,
.account-menu summary:hover {
  border-color: var(--amber);
  background: rgba(201, 154, 69, 0.12);
}

.admin-access svg,
.account-menu svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.nav-avatar,
.identity-avatar {
  width: 42px;
  height: 42px;
  max-width: none;
  aspect-ratio: 1;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.identity-avatar {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
}

.identity-chip,
.author-line {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.author-line {
  color: var(--paper);
  font-weight: 700;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.7rem);
  width: 220px;
  padding: 0.75rem;
  display: grid;
  gap: 0.4rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #15130f;
  box-shadow: 0 18px 38px var(--shadow);
}

.account-menu__panel::before {
  content: "CLEARANCE";
  color: var(--red);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
}

.account-menu__panel a,
.account-menu__panel button {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-radius: 4px;
  color: var(--paper);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.account-menu__panel a:hover,
.account-menu__panel button:hover {
  background: rgba(201, 154, 69, 0.12);
}

.account-menu__identity {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
}

.account-menu__avatar {
  width: 42px;
  height: 42px;
  grid-row: span 2;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  object-fit: cover;
}

.account-menu__identity span,
.account-menu__identity small {
  display: block;
}

.account-menu__identity small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dossier-page,
.admin-panel-container,
.admin-edit-container,
.forum-post-container,
.wiki-container,
.article-container,
.admin-login-container {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 21, 17, 0.88);
  box-shadow: 0 20px 54px var(--shadow);
  content-visibility: auto;
  contain-intrinsic-size: auto 640px;
}

.dossier-page::before,
.admin-panel-container::before,
.admin-edit-container::before,
.forum-post-container::before,
.wiki-container::before,
.article-container::before,
.admin-login-container::before {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--amber), transparent 75%);
}

.page-intro {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.page-intro--compact {
  margin-bottom: 1rem;
}

h1,
h2,
h3 {
  color: var(--paper);
  line-height: 1.12;
}

h1 {
  margin: 0.25rem 0 0.75rem;
  font-family: "Special Elite", serif;
  font-size: clamp(2rem, 5vw, 4.8rem);
  letter-spacing: 0;
}

h2 {
  margin: 0.25rem 0 0.65rem;
  font-size: 1.25rem;
}

p {
  color: var(--muted);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-edit,
.btn-delete,
.btn-save,
.btn-cancel,
.btn-logout,
.admin-nav a,
.header-actions a,
.back-link,
.back-button,
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.62rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--paper);
  background: rgba(32, 29, 23, 0.9);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.btn-primary,
.cta-button {
  border-color: var(--amber);
  background: #3a2b15;
  color: var(--paper);
}

.btn-secondary,
.back-link,
.back-button {
  border-color: var(--line);
  color: var(--muted);
}

.btn-delete,
.btn-logout {
  border-color: rgba(143, 47, 36, 0.8);
  color: #e2b7aa;
}

.btn-save {
  border-color: rgba(111, 125, 86, 0.9);
  color: #d8dfc4;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-edit:hover,
.btn-delete:hover,
.btn-save:hover,
.btn-cancel:hover,
.btn-logout:hover,
.admin-nav a:hover,
.header-actions a:hover,
.back-link:hover,
.back-button:hover,
.cta-button:hover {
  border-color: var(--paper);
  background: rgba(201, 154, 69, 0.16);
  color: var(--paper);
}

.evidence-card,
.dashboard-card,
.info-card,
.case-panel,
.post-card,
.comment,
.comment-card,
.wiki-item,
.edit-section,
.moderation-comment {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    rgba(24, 22, 18, 0.92);
}

.form-group,
.evidence-form {
  display: grid;
  gap: 0.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--paper);
  background: rgba(7, 7, 6, 0.78);
}

input,
select {
  min-height: 42px;
  padding: 0.65rem 0.75rem;
}

textarea {
  min-height: 130px;
  padding: 0.8rem;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--amber);
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 154, 69, 0.12);
}

.error-message,
.success-message,
.auth-prompt,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(12, 11, 9, 0.72);
}

.error-message {
  border-color: rgba(143, 47, 36, 0.8);
  color: #efc5ba;
}

.success-message {
  border-color: rgba(111, 125, 86, 0.9);
  color: #dce8c2;
}

.auth-prompt {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.auth-prompt p {
  margin: 0.2rem 0 0;
}

.auth-prompt__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.auth-prompt--compact {
  margin: 0 0 1rem;
}

.post-meta,
.comment-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill--visible {
  border-color: rgba(111, 125, 86, 0.8);
  color: #d8dfc4;
}

.status-pill--hidden {
  border-color: rgba(201, 154, 69, 0.75);
  color: #e7cf98;
}

.status-pill--removed {
  border-color: rgba(143, 47, 36, 0.8);
  color: #e2b7aa;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.pagination-info {
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(rgba(9, 9, 7, 0.86), rgba(9, 9, 7, 0.95)),
      var(--bg);
  }

  body::before {
    display: none;
  }

  main {
    width: min(100% - 1rem, 1180px);
    padding-top: 1rem;
  }

  .site-header {
    backdrop-filter: none;
  }

  .site-nav {
    min-height: auto;
    padding: 0.75rem 0;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
  }

  .site-mark__title {
    font-size: 1rem;
  }

  .site-links {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scrollbar-width: thin;
  }

  .site-links a {
    flex: 0 0 auto;
    padding-inline: 0.65rem;
  }

  .auth-prompt {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }
}
