:root {
  --paper: #ece0c9;
  --paper-dark: #d3c1a2;
  --ink: #2b2217;
  --wood: #6a4f2a;
  --wood-dark: #453117;
  --gold: #c7a35a;
  --wine: #7b2d1b;
  --moss: #4d5836;
  --panel: #f8f1df;
  --shadow: rgba(43, 34, 23, 0.28);
  --thread-border: #b39156;
  --body-font: "Trebuchet MS", Verdana, sans-serif;
  --heading-font: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 30%),
    repeating-linear-gradient(
      90deg,
      rgba(121, 89, 48, 0.14) 0,
      rgba(121, 89, 48, 0.14) 2px,
      transparent 2px,
      transparent 12px
    ),
    linear-gradient(180deg, #baa06e 0%, #d7c29a 18%, #efe3c8 100%);
  font-family: var(--body-font);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(77, 88, 54, 0.03) 0,
      rgba(77, 88, 54, 0.03) 1px,
      transparent 1px,
      transparent 5px
    );
}

a {
  color: #214a72;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.mention-link {
  font-weight: 700;
  color: #7b2d1b;
}

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

.page-frame {
  width: min(1100px, calc(100% - 24px));
  margin: 16px auto 40px;
}

.site-header {
  width: min(1100px, calc(100% - 24px));
  margin: 14px auto 0;
  border: 3px solid var(--wood-dark);
  box-shadow: 0 6px 18px var(--shadow);
  background: linear-gradient(180deg, #8d6b38 0%, #5b421f 100%);
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  color: #fff4d8;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(255, 230, 184, 0.22), transparent 100%);
}

.brand-mark {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-crest {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 241, 213, 0.8);
  background: radial-gradient(circle, #e3c67d 0%, #a97d3b 58%, #613f1f 100%);
  font-family: var(--heading-font);
  font-size: 2rem;
  font-weight: 700;
}

.brand-text h1,
.hero-copy h1,
.panel-titlebar h1,
.panel-titlebar h2,
.panel-titlebar h3,
.profile-card h2 {
  margin: 0;
  font-family: var(--heading-font);
  letter-spacing: 0.03em;
}

.brand-text p {
  margin: 4px 0 0;
  color: #f4e6c0;
}

.top-utility {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.status-chip,
.language-picker select {
  border: 2px solid rgba(255, 241, 213, 0.4);
  background: rgba(48, 28, 10, 0.5);
  color: #fff9ec;
  padding: 6px 10px;
}

.language-picker {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.92rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 244, 216, 0.25);
  background: linear-gradient(180deg, #372413 0%, #5a3b18 100%);
}

.site-nav a,
.button-link,
.tiny-button {
  display: inline-block;
  border: 1px solid #3d2710;
  border-right-color: #201206;
  border-bottom-color: #201206;
  border-left-color: #8c6a35;
  border-top-color: #dbc483;
  background: linear-gradient(180deg, #ead3a0 0%, #b0823d 50%, #8b632d 100%);
  color: #241606;
  padding: 8px 12px;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 241, 213, 0.35);
  box-shadow: 1px 1px 0 rgba(32, 18, 6, 0.4);
}

.site-nav a.active {
  background: linear-gradient(180deg, #f2e6c8 0%, #caa562 45%, #926628 100%);
}

.button-link.muted {
  background: linear-gradient(180deg, #d6d0c2 0%, #b0a593 50%, #8a7a64 100%);
}

.tiny-button {
  padding: 4px 9px;
  font-size: 0.8rem;
}

.hero-panel,
.panel {
  border: 3px solid var(--wood-dark);
  background: var(--panel);
  box-shadow: 0 6px 16px var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  margin-bottom: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(180deg, #fdf7ea 0%, #efe3c8 100%);
}

.hero-copy,
.hero-ornament,
.panel-content {
  padding: 18px;
}

.hero-copy .lede {
  max-width: 42rem;
  font-size: 1.05rem;
}

.micro-copy {
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--wine);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.blink {
  animation: blink 1.4s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0.55;
  }
}

.hero-actions,
.thread-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-ornament {
  display: grid;
  place-content: center;
  text-align: center;
  border-left: 2px dashed rgba(69, 49, 23, 0.18);
  background:
    radial-gradient(circle at top, rgba(255, 232, 184, 0.55), transparent 58%),
    linear-gradient(180deg, #efe0bb 0%, #d5bc8c 100%);
}

.crest {
  width: 160px;
  height: 160px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 5px double var(--wood-dark);
  background: radial-gradient(circle, #fae9be 0%, #d3b06b 55%, #78582a 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 247, 228, 0.3);
}

.crest span {
  font-family: var(--heading-font);
  font-size: 5rem;
  color: var(--wine);
}

.panel {
  margin-bottom: 18px;
}

.panel-titlebar {
  padding: 12px 18px;
  border-bottom: 2px solid var(--wood-dark);
  background:
    linear-gradient(180deg, rgba(245, 221, 170, 0.85), rgba(186, 138, 66, 0.92)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent);
}

.panel-titlebar-wide {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.split-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.classic-list,
.stack-list,
.post-stack {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-list article,
.post-card,
.forum-blurb,
.stat-card {
  border: 1px solid var(--thread-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(243, 230, 203, 0.86));
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 249, 236, 0.75);
}

.classic-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff8e9;
}

.classic-table th,
.classic-table td {
  border: 1px solid var(--thread-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.classic-table th {
  background: linear-gradient(180deg, #e7d0a4 0%, #c79f58 100%);
  font-family: var(--heading-font);
}

.classic-table tbody tr:nth-child(even) {
  background: rgba(229, 213, 179, 0.25);
}

.compact-panel {
  width: min(620px, 100%);
  margin-inline: auto;
}

.classic-form {
  display: grid;
  gap: 12px;
}

.classic-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.turnstile-block {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #8f6831;
  background: rgba(248, 235, 204, 0.72);
}

.turnstile-copy {
  margin: 0;
  font-size: 0.9rem;
  color: #4d3820;
}

.turnstile-slot {
  min-height: 65px;
}

.toolbar-row,
.link-row,
.moderation-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.classic-form input,
.classic-form textarea,
.classic-form select {
  width: 100%;
  padding: 10px;
  border: 2px solid #856437;
  background: #fffbf1;
  box-shadow: inset 1px 1px 0 rgba(99, 71, 31, 0.2);
}

.flash-message {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #8f6831;
  background: #f3e0b9;
}

.flash-message.error {
  background: #efd0c4;
  border-color: #8b442f;
}

.media-uploader {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--thread-border);
  background: rgba(255, 255, 255, 0.35);
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.pending-attachment {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--thread-border);
  background: rgba(255, 255, 255, 0.55);
}

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

.media-card {
  border: 1px solid var(--thread-border);
  background: rgba(255, 255, 255, 0.6);
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 249, 236, 0.75);
}

.media-card figcaption {
  margin-top: 8px;
  color: #5d4a34;
  font-size: 0.9rem;
  word-break: break-word;
}

.embedded-image,
.embedded-video {
  width: 100%;
  display: block;
  border: 1px solid rgba(69, 49, 23, 0.18);
  background: #fff8e9;
}

.media-link-card a {
  word-break: break-word;
}

.muted-line,
.translation-note,
.crumb {
  color: #5d4a34;
  font-size: 0.92rem;
}

button:disabled,
.button-link:disabled {
  opacity: 0.68;
  cursor: wait;
}

.empty-state {
  margin: 0;
  padding: 16px;
  text-align: center;
  color: #6d5a42;
}

.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.profile-card {
  text-align: center;
}

.profile-main {
  display: grid;
  gap: 14px;
}

.profile-bio {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--thread-border);
  background: rgba(255, 255, 255, 0.48);
  text-align: left;
  white-space: pre-wrap;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-card {
  text-align: center;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  font-family: var(--heading-font);
}

.profile-badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 5px 10px;
  border: 1px solid #6b4f23;
  background: linear-gradient(180deg, #e8d09e 0%, #bf934a 100%);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-badge.admin-badge {
  background: linear-gradient(180deg, #f0d8a7 0%, #a55f28 100%);
  color: #2f1408;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-card {
  border: 1px solid var(--thread-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(243, 230, 203, 0.9));
  padding: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 249, 236, 0.75);
}

.detail-card-wide {
  grid-column: 1 / -1;
}

.detail-label {
  display: block;
  margin-bottom: 6px;
  color: #684f30;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-value {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
  word-break: break-word;
}

.signature-box {
  min-height: 58px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.avatar-panel {
  border-left: 2px dashed rgba(69, 49, 23, 0.18);
  padding-left: 18px;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--wood-dark);
  background: radial-gradient(circle, #f5e0ab 0%, #c59549 70%, #6d4a21 100%);
  font-family: var(--heading-font);
  color: var(--wine);
  font-size: 1.3rem;
  font-weight: 700;
}

.large-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  font-size: 2.6rem;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
}

.is-pinned {
  border-color: #99671c;
}

.post-author {
  border-right: 1px dashed rgba(69, 49, 23, 0.18);
  padding-right: 10px;
  text-align: center;
}

.post-body {
  white-space: pre-wrap;
  line-height: 1.6;
}

.post-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: #604b30;
  font-size: 0.9rem;
}

.pin-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid #7c561d;
  background: linear-gradient(180deg, #f2d48a 0%, #c08a2b 100%);
  color: #2c1908;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.unread-mail {
  border-color: #8b442f;
}

.hidden {
  display: none !important;
}

.site-footer {
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto 24px;
  padding: 12px 18px;
  border: 2px solid var(--wood-dark);
  background: linear-gradient(180deg, #5a3b18 0%, #342111 100%);
  color: #f8eccf;
  text-align: center;
  box-shadow: 0 4px 12px var(--shadow);
}

@media (max-width: 840px) {
  .hero-panel,
  .split-columns,
  .profile-grid,
  .post-card {
    grid-template-columns: 1fr;
  }

  .hero-ornament,
  .avatar-panel,
  .post-author {
    border-left: 0;
    border-right: 0;
    border-top: 1px dashed rgba(69, 49, 23, 0.18);
    padding-top: 14px;
    padding-left: 0;
    padding-right: 0;
  }

  .panel-titlebar-wide,
  .masthead {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }

  .profile-detail-grid {
    grid-template-columns: 1fr;
  }
}
