/* ── Home board panels ── */
.home-board {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.home-board-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.25rem;
}

/* ── Board theme (uses roka.css variables) ── */
.home-board {
  background: var(--bg);
}

.home-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: none;
}

.post-view {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.home-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--border);
}

.home-panel-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.home-panel-more {
  font-size: 1.25rem;
  color: var(--text-muted);
  text-decoration: none !important;
  line-height: 1;
}

.home-featured {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none !important;
  color: var(--text);
  transition: background 0.15s;
}

.home-featured:hover { background: var(--bg); }

.home-featured-date {
  flex-shrink: 0;
  width: 64px;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #333;
  background: #fff;
}

[data-theme='dark'] .home-featured-date { color: #333; border-color: #ddd; background: #fff; }

.home-featured-date .ym { font-size: 0.65rem; }
.home-featured-date .day { font-size: 1.35rem; line-height: 1; }

.home-featured-body strong {
  display: block;
  font-size: 0.95rem;
  margin: 0.35rem 0;
  color: var(--text);
}

.home-featured-body p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.home-banner-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-banner-card {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  text-decoration: none !important;
}

.home-banner-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.home-banner-placeholder {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  color: #666;
  font-weight: 800;
  font-size: 1.5rem;
}

.home-banner-caption {
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-board-cta {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.btn-board-list,
.btn-board-write,
.btn-board-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none !important;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-elevated);
}

.btn-board-write {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}

.btn-board-list:hover,
.btn-board-tab:hover { background: var(--bg); }

/* ── DC-style list ── */
.board-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.board-wrap.narrow { max-width: 720px; }

.board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.board-top h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.board-top-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.dc-filter {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none !important;
}

.dc-filter.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

.dc-filter:hover {
  background: #2563eb;
  color: #ffffff !important;
  border-color: #2563eb;
}

.dc-table-head {
  display: grid;
  grid-template-columns: 52px 56px minmax(0, 1fr) minmax(200px, 240px);
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  border-top: 2px solid var(--text);
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.dc-table-head span:nth-child(1) { justify-self: center; }
.dc-table-head span:nth-child(2) { justify-self: center; text-align: center; }
.dc-table-head span:nth-child(4) { justify-self: end; text-align: right; }

.dc-list { border-bottom: 1px solid var(--border); }

.dc-list.compact .dc-row { padding: 0.55rem 0.5rem; }

.dc-row {
  display: grid;
  grid-template-columns: 52px 56px minmax(0, 1fr) minmax(200px, 240px);
  gap: 0.5rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none !important;
  color: var(--text);
  font-size: 0.88rem;
  transition: background 0.12s;
}

.dc-row:hover { background: var(--bg); }

.dc-row.featured { background: transparent; }

.dc-num {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  justify-self: center;
  text-align: center;
}

.dc-rank {
  font-size: 0.95rem;
  font-weight: 800;
  color: #2563eb;
  justify-self: center;
  text-align: center;
  min-width: 1.5rem;
}

.dc-hidden-badge,
.dc-pin-badge,
.hidden-notice,
.pin-notice {
  display: none;
}

.post-status-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.post-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  line-height: 0;
}

.post-status-pin { color: #2563eb; }
.post-status-hidden { color: #dc2626; }
.post-status-anon { color: #7c3aed; }

.post-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0.5rem 0;
  color: var(--text);
}

.post-title-text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.admin-menu {
  position: relative;
  margin-left: auto;
}

.admin-menu-btn {
  list-style: none;
  cursor: pointer;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  user-select: none;
  outline: none;
}

.admin-menu-btn:focus,
.admin-menu-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

.admin-menu-btn::-webkit-details-marker { display: none; }

.admin-menu[open] .admin-menu-btn {
  border-color: #2563eb;
  color: #2563eb;
}

.admin-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 20;
  min-width: 9rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.admin-menu-panel form { margin: 0; }

.admin-menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.55rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}

.admin-menu-panel button:hover {
  background: rgba(37, 99, 235, 0.08);
}

.dc-cat {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  justify-self: center;
  white-space: nowrap;
  min-width: 2.75rem;
}

.cat-general { background: #f0f0f0; color: #333; }
.cat-gallery { background: #f5f5f5; color: #555; }
.cat-info { background: #f0f0f0; color: #444; }
.cat-chat { background: #f5f5f5; color: #555; }

[data-theme='dark'] .cat-general { background: #f0f0f0; color: #333; }
[data-theme='dark'] .cat-gallery { background: #f5f5f5; color: #555; }
[data-theme='dark'] .cat-info { background: #f0f0f0; color: #444; }
[data-theme='dark'] .cat-chat { background: #f5f5f5; color: #555; }

.dc-title {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  min-width: 0;
}

.dc-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.dc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  justify-content: flex-end;
}

.dc-stat.rec { color: #2563eb; font-weight: 600; }

.dc-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dc-pagination {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.dc-pagination a {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  text-decoration: none !important;
  color: var(--text-muted);
}

.dc-pagination a.active {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}

/* ── Post view ── */
.post-header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0.5rem 0;
  color: var(--text);
}

.post-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.post-content {
  margin: 1.25rem 0;
  line-height: 1.8;
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
}

.post-media {
  margin: 1rem 0;
}

.post-media img,
.post-media video {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.vote-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.vote-bar form { margin: 0; }

.vote-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.vote-btn.like.active {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1d4ed8;
}

.vote-btn.dislike.active {
  background: #fee2e2;
  border-color: #dc2626;
  color: #b91c1c;
}

[data-theme='dark'] .vote-btn.like.active { background: #dbeafe; color: #1d4ed8; }
[data-theme='dark'] .vote-btn.dislike.active { background: #fee2e2; color: #b91c1c; }

.vote-bar.small .vote-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

/* ── Comments ── */
.comments-section h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
  max-width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
}

.comment-form textarea:focus,
.write-form input:focus,
.write-form select:focus,
.write-form textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.comment-form button {
  padding: 0.45rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.comment {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.comment-av {
  border-radius: 50%;
  flex-shrink: 0;
}

.comment-head {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
}

.comment-head strong { color: var(--text); }
.comment-head span { color: var(--text-muted); }

.comment-body p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 0.35rem;
}

.dc-login-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.back-link { margin-top: 1rem; font-size: 0.88rem; }

.admin-panel-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.admin-panel-section {
  margin-bottom: 1.75rem;
}

.admin-panel-section h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--text);
}

.admin-user-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.admin-user-row:last-child { border-bottom: none; }

.admin-tag-default {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.admin-revoke-form { margin: 0; }

.admin-revoke-form button {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: #b91c1c;
  font-size: 0.78rem;
  cursor: pointer;
}

.admin-appoint-form .form-field input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

/* ── Write form ── */
.write-form {
  margin-top: 0.5rem;
}

.write-form label,
.write-form .form-field {
  display: block;
  margin-bottom: 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.write-form-section {
  margin-bottom: 1.15rem;
  padding: 1rem 1rem 0.15rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.write-form-section .form-field {
  margin-bottom: 1rem;
}

.write-form input[type="text"],
.write-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.write-form textarea {
  resize: vertical;
  min-height: 280px;
  max-width: 100%;
  min-width: 100%;
  line-height: 1.65;
}

.field-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Category pills */
.cat-mode-segment {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.cat-segment {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.cat-segment input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.cat-segment span {
  display: block;
  text-align: center;
  padding: 0.6rem 0.35rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  user-select: none;
}

.cat-segment:hover span {
  color: var(--text);
  background: rgba(37, 99, 235, 0.07);
}

.cat-segment input:checked + span {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.cat-segment input:focus-visible + span {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Author mode */
.name-mode-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.45rem;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
}

.name-segment {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.name-segment input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.segment-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  user-select: none;
}

.name-segment:hover .segment-chip {
  color: var(--text);
  background: rgba(37, 99, 235, 0.07);
}

.name-segment input:checked + .segment-chip {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.name-segment input:checked + .segment-chip svg {
  stroke: #fff;
}

.name-segment input:focus-visible + .segment-chip {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* File upload zone */
.file-upload-field .field-hint {
  margin-bottom: 0.15rem;
}

.file-upload-zone {
  position: relative;
  margin-top: 0.45rem;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}

.file-upload-zone:hover,
.file-upload-zone:focus-within {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.05);
}

.file-upload-zone.has-files {
  border-color: #2563eb;
  border-style: solid;
  background: rgba(37, 99, 235, 0.06);
}

.form-file-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.file-upload-content {
  padding: 1.65rem 1rem;
  text-align: center;
  pointer-events: none;
}

.file-upload-icon {
  display: block;
  margin: 0 auto 0.65rem;
  color: var(--text-muted);
}

.file-upload-zone:hover .file-upload-icon,
.file-upload-zone.has-files .file-upload-icon {
  color: #2563eb;
}

.file-upload-title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.file-upload-names {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  word-break: break-all;
}

.file-upload-zone.has-files .file-upload-names {
  color: #2563eb;
  font-weight: 500;
}

.form-file {
  display: none;
}

.write-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.btn-cancel {
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none !important;
}

.btn-submit {
  padding: 0.55rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.anon-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #666666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .home-board {
    padding: 1.5rem 1rem 2rem;
  }

  .home-board-grid {
    grid-template-columns: 1fr;
  }

  .board-wrap {
    padding: 1.25rem 1rem 3rem;
  }

  .board-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .board-top-actions {
    width: 100%;
  }

  .btn-board-write {
    margin-left: auto;
  }

  .dc-table-head {
    display: none;
  }

  .dc-row {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "cat title"
      "meta meta";
    gap: 0.35rem 0.5rem;
    padding: 0.85rem 0.5rem;
  }

  .dc-num {
    display: none;
  }

  .dc-cat {
    grid-area: cat;
    align-self: start;
  }

  .dc-title {
    grid-area: title;
    align-items: flex-start;
  }

  .dc-title-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .dc-meta {
    grid-area: meta;
    justify-content: flex-start;
    width: 100%;
  }

  .post-view {
    padding: 1rem;
  }

  .post-header h1 {
    font-size: 1.15rem;
  }

  .write-form textarea {
    min-height: 200px;
  }

  .name-mode-segment {
    max-width: 100%;
  }

  .cat-mode-segment {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .write-form-section {
    padding: 0.85rem 0.85rem 0.1rem;
  }
}

@media (max-width: 480px) {
  .dc-filters {
    gap: 0.3rem;
  }

  .dc-filter {
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
  }

  .vote-bar {
    flex-wrap: wrap;
  }

  .home-banner-card img {
    height: 100px;
  }
}
