.board-header-actions {
  display: grid;
  min-width: 180px;
  gap: 8px;
}

.board-header-actions .compact-button {
  width: 100%;
  margin: 0;
}

#boardTenantPicker {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

#boardTenantPicker[hidden] {
  display: none;
}

#boardTenantPicker label,
.board-editor-grid > label,
.board-post-form > label,
.board-catalog-grid form > label,
.student-board-post-form > label,
.student-board-comment-form > label {
  display: grid;
  gap: 7px;
  color: #27496b;
  font-weight: 900;
}

#boardTenantPicker select,
.board-editor-grid input,
.board-editor-grid select,
.board-editor-grid textarea,
.board-post-form input,
.board-post-form select,
.board-post-form textarea,
.board-catalog-grid input,
.board-post-card input,
.student-board-post-form input,
.student-board-post-form select,
.student-board-post-form textarea,
.student-board-comment-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(23, 50, 77, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  color: #17324d;
  background: #fff;
}

.board-editor-grid textarea,
.board-post-form textarea,
.student-board-post-form textarea,
.student-board-comment-form textarea {
  resize: vertical;
  line-height: 1.6;
}

.board-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.board-wide {
  grid-column: 1 / -1;
}

.board-check,
.board-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
}

.board-check {
  align-self: end;
  min-height: 46px;
}

.board-check input,
.board-inline-check input {
  width: auto;
  min-height: auto;
}

.field-help {
  color: #52677c;
  font-size: 12px;
  font-weight: 700;
}

.board-form-actions,
.board-row-actions,
.board-reaction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.board-form-actions .student-login-submit,
.board-form-actions .compact-button {
  min-width: 180px;
  margin: 0;
}

.board-row-actions .compact-button,
.board-reaction-actions .compact-button {
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
}

.board-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.board-catalog-grid form {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #dbe7ee;
  border-radius: 14px;
  background: #f8fcfd;
}

.board-catalog-grid h3 {
  margin: 0;
}

.board-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.board-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid #dbe7ee;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
}

.board-chip button {
  min-width: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 50%;
  color: #991b1b;
  background: #fee2e2;
  cursor: pointer;
}

.board-table td:nth-child(2) {
  min-width: 230px;
}

.board-row-title {
  display: block;
  margin-bottom: 4px;
}

.board-row-meta,
.board-post-meta,
.student-board-meta {
  color: #52677c;
  font-size: 13px;
}

.board-post-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.board-post-list,
.board-comment-list,
.student-board-post-list,
.student-board-comment-list {
  display: grid;
  gap: 12px;
}

.board-post-card,
.board-comment-card,
.student-board-post-card,
.student-board-comment-card {
  padding: 16px;
  border: 1px solid #dbe7ee;
  border-radius: 14px;
  background: #fff;
}

.board-post-card[data-status="pending"] {
  border-color: #f59e0b;
  background: #fffbeb;
}

.board-post-card[data-status="rejected"] {
  border-color: #fca5a5;
  background: #fff7f7;
}

.board-post-card h3,
.student-board-post-card h3 {
  margin: 0 0 5px;
}

.board-post-copy,
.student-board-post-copy,
.student-board-comment-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.board-rich-text ul,
.board-rich-text ol {
  margin: .45em 0;
  padding-left: 1.5em;
  white-space: normal;
}

.board-rich-text ul { list-style: disc; }
.board-rich-text ol { list-style: decimal; }
.board-rich-text li { margin: .18em 0; }
.board-rich-text p,
.board-rich-text div { margin: 0 0 .35em; }
.board-rich-text > :last-child { margin-bottom: 0; }
.board-rich-text a {
  color: #4f46e5;
  text-decoration: underline;
  text-underline-offset: .15em;
  overflow-wrap: anywhere;
}
.board-rich-text a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.board-post-link,
.student-board-post-link {
  display: inline-block;
  margin: 8px 0;
  color: #0f766e;
  font-weight: 900;
}

.board-file-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.board-file-card {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  border: 1px solid #dbe7ee;
  border-radius: 12px;
  background: #f8fcfd;
  overflow-wrap: anywhere;
}

.board-file-card img {
  width: 100%;
  max-height: 220px;
  border-radius: 9px;
  object-fit: contain;
  background: #eef6f8;
}

.board-file-card span {
  color: #52677c;
  font-size: 12px;
}

.board-moderation-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  margin-top: 12px;
}

.board-comment-card[data-depth="1"],
.student-board-comment-card[data-depth="1"] {
  margin-left: 28px;
  border-left: 4px solid #99f6e4;
}

.student-board-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.student-board-header,
.student-board-guide,
.student-board-list-card,
.student-board-detail {
  border: 1px solid rgba(23, 50, 77, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(23, 50, 77, 0.12);
}

.student-board-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  padding: clamp(24px, 5vw, 40px);
}

.student-board-guide {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 0;
  overflow: hidden;
  list-style: none;
}

.student-board-guide li {
  display: grid;
  gap: 6px;
  padding: 18px;
  background: #f8fcfd;
}

.student-board-guide strong {
  color: #0f766e;
}

.student-board-guide span {
  color: #52677c;
  font-size: 14px;
  line-height: 1.5;
}

.student-board-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.5fr);
  gap: 18px;
}

.student-board-list-card,
.student-board-detail {
  padding: 22px;
}

.student-board-list-button {
  width: 100%;
  display: grid;
  gap: 5px;
  margin-bottom: 9px;
  padding: 14px;
  border: 1px solid #dbe7ee;
  border-radius: 12px;
  color: #17324d;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.student-board-list-button[data-selected="true"] {
  border-color: #0f766e;
  background: #f0fdfa;
}

.student-board-post-form,
.student-board-comment-form {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 16px;
  border-radius: 14px;
  background: #f8fcfd;
}

.student-board-shelves {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 16px;
}

.student-board-shelves button {
  min-height: 36px;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 0 12px;
  color: #115e59;
  background: #f0fdfa;
  cursor: pointer;
}

@media (max-width: 860px) {
  .board-editor-grid,
  .board-catalog-grid,
  .student-board-layout {
    grid-template-columns: 1fr;
  }

  .board-post-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-board-guide {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .board-post-form,
  .student-board-guide {
    grid-template-columns: 1fr;
  }

  .board-moderation-row {
    grid-template-columns: 1fr;
  }

  .student-board-header {
    display: grid;
  }
}

.board-record-preset {
  display: flex;
  align-items: end;
  gap: 8px;
}

.board-record-preset label {
  flex: 1;
}

.board-record-form-panel {
  padding: 16px;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  background: #f8faff;
}

.board-record-field-list,
.board-review-list,
.board-review-detail,
.student-board-record-fields {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.board-record-field {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
}

.board-record-field legend {
  padding: 0 6px;
  font-weight: 800;
  color: #3730a3;
}

.board-record-field .board-row-actions,
.board-record-field label:has(textarea) {
  grid-column: 1 / -1;
}

.board-review-card,
.board-record-submission {
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
}

.board-review-card p {
  margin: 0 0 10px;
}

.board-record-submission dl {
  display: grid;
  grid-template-columns: minmax(112px, 0.35fr) 1fr;
  gap: 6px 12px;
  margin-bottom: 0;
}

.board-record-submission dt {
  font-weight: 800;
}

.board-record-submission dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.student-board-record-form {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  background: #f8faff;
}

.board-record-answer-field {
  display: grid;
  gap: 6px;
}

.board-record-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #fff;
}

.board-record-choice-group label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 720px) {
  .board-record-field {
    grid-template-columns: 1fr;
  }

  .board-record-field > * {
    grid-column: 1;
  }

  .board-record-preset {
    align-items: stretch;
    flex-direction: column;
  }
}
