:root {
  --forum-bg: #f2f2f2;
  --forum-panel: #ffffff;
  --forum-ink: #111111;
  --forum-accent: #000000;
  --forum-deep: #000000;
  --forum-line: #1a1a1a;
  --forum-rind: #ebebeb;
  --touch-target: 44px;
}

.nav-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.nav-actions {
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
  gap: 0.75rem;
}

.search-box {
  flex: 1;
  min-width: 220px;
  max-width: 640px;
}

.search-input {
  width: 100%;
  min-width: 0;
}

.user-menu-wrapper {
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.user-menu-btn {
  margin: 0;
  white-space: nowrap;
}

@media (min-width: 993px) {
  .detail-container {
    grid-template-columns: 116px minmax(0, 1fr) 280px;
    align-items: start;
  }

  .back-float-btn {
    grid-column: 1;
    width: 100%;
    justify-content: center;
  }

  .post-article {
    grid-column: 2;
  }

  .related-sidebar {
    grid-column: 3;
  }
}

#board-detail-view,
#board-thread-content {
  min-width: 0;
}

.board-detail-header {
  align-items: flex-start;
}

.ghost-btn,
.btn-primary,
.btn-danger {
  min-height: var(--touch-target);
  padding: 0.7rem 1rem;
  border: 1px solid var(--forum-line);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.86);
  color: var(--forum-ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ghost-btn:hover,
.btn-primary:hover,
.btn-danger:hover {
  transform: translateY(-1px);
}

.small-btn {
  min-height: 38px;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: #111111;
  color: #ffffff;
}

.btn-danger {
  background: #7f1d1d;
  border-color: #7f1d1d;
  color: #ffffff;
}

.report-btn {
  background: #f1dfb5;
}

.like-btn.active {
  background: rgba(0, 0, 0, 0.12);
}

.form-input {
  width: 100%;
  min-height: var(--touch-target);
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--forum-line);
  background: #ffffff;
  color: var(--forum-ink);
  font: inherit;
}

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

.section-heading,
.section-heading.compact,
.thread-tags,
.attachment-card,
.detail-like-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-heading {
  margin-bottom: 0.85rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.section-heading p {
  margin: 0.2rem 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #444444;
}

.thread-tags span {
  display: inline-flex;
  padding: 0.28rem 0.6rem;
  background: #111111;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 800;
}

.attachment-grid {
  display: grid;
  gap: 0.85rem;
}

.attachment-card {
  border: 1px solid var(--forum-line);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.85rem 1rem;
}

.attachment-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.attachment-card span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #444444;
}

.detail-like-row,
.thread-insight-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.thread-insight-bar,
.detail-like-row,
.empty-card {
  border: 1px solid var(--forum-line);
  border-left: 6px solid var(--forum-accent);
  background: rgba(255, 255, 255, 0.88);
}

.thread-insight-bar,
.empty-card {
  padding: 0.85rem 1rem;
}

.thread-insight-bar {
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #444444;
}

.detail-like-row {
  padding: 0.75rem 0.9rem;
  justify-content: space-between;
}

.reply-form {
  display: grid;
  gap: 0.75rem;
}

.reply-form .btn-primary {
  justify-self: end;
}

@media (max-width: 992px) {
  .nav-container {
    gap: 0.75rem;
    padding: 0 0.75rem;
  }

  .nav-actions {
    gap: 0.5rem;
  }

  .search-box {
    min-width: 180px;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0;
  }

  .nav-actions {
    padding-right: 0.75rem;
  }

  .reply-form .btn-primary,
  .detail-like-actions,
  .detail-like-actions .ghost-btn,
  .detail-like-actions .btn-primary,
  .detail-like-actions .btn-danger {
    width: 100%;
  }

  .section-heading,
  .section-heading.compact,
  .detail-like-row,
  .thread-insight-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .attachment-card {
    padding: 0.75rem 0.85rem;
  }
}

@media (max-width: 480px) {
  .nav-actions {
    padding-right: 0.5rem;
  }
}
