/* =========================================================
   KAMPUS RESPONSIVE UI
   Desktop + Tablet + Mobile
========================================================= */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --surface-hover: #f3f4f6;

  --text: #111827;
  --text-soft: #4b5563;
  --text-muted: #8b95a5;

  --border: #e5e7eb;
  --border-soft: #eef0f3;
  --border-strong: #d1d5db;

  --brand: #111827;
  --brand-soft: #f1f3f5;

  --blue: #2563eb;

  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  --success: #15803d;

  --shadow-sm:
    0 1px 2px rgba(15, 23, 42, 0.03);

  --shadow-md:
    0 6px 18px rgba(15, 23, 42, 0.055);

  --shadow-lg:
    0 24px 70px rgba(15, 23, 42, 0.15);
}


/* =========================================================
   RESET
========================================================= */

* {
  box-sizing: border-box;
}

html {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body {
  margin: 0;

  background: var(--bg);

  color: var(--text);

  line-height: 1.5;

  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button {
  border: 1px solid var(--brand);

  background: var(--brand);

  color: #ffffff;

  padding: 9px 14px;

  border-radius: 9px;

  font-size: 13px;
  font-weight: 700;

  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.primary-button:hover {
  background: #252c36;
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  opacity: 0.55;
}


.secondary-button {
  border: 1px solid var(--border);

  background: #ffffff;

  color: #374151;

  padding: 9px 13px;

  border-radius: 9px;

  font-size: 13px;
  font-weight: 650;

  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.secondary-button:hover {
  background: var(--surface-hover);

  border-color: var(--border-strong);
}


.danger-button {
  border: 1px solid var(--danger-border);

  background: var(--danger-soft);

  color: var(--danger);

  padding: 9px 13px;

  border-radius: 9px;

  font-size: 13px;
  font-weight: 700;
}

.danger-button:hover {
  background: #fee2e2;
}


.text-button {
  border: none;

  background: transparent;

  color: var(--text-soft);

  padding: 6px;

  font-size: 12px;
  font-weight: 650;
}

.text-button:hover {
  color: var(--text);
}


.icon-button {
  width: 34px;
  height: 34px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  border: none;

  background: transparent;

  color: #9ca3af;

  border-radius: 8px;

  font-size: 22px;

  line-height: 1;
}

.icon-button:hover {
  background: var(--surface-hover);

  color: var(--text);
}


/* =========================================================
   FORMS
========================================================= */

label {
  display: block;

  margin-top: 15px;
  margin-bottom: 6px;

  color: #374151;

  font-size: 12px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;

  border: 1px solid var(--border);

  border-radius: 9px;

  background: #ffffff;

  padding: 10px 12px;

  color: var(--text);

  outline: none;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #b2bac6;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #aeb5bf;

  box-shadow:
    0 0 0 3px rgba(17, 24, 39, 0.045);
}

textarea {
  resize: vertical;
}


/* =========================================================
   STATUS
========================================================= */

.status {
  min-height: 18px;

  margin-top: 8px;

  font-size: 12px;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}


/* =========================================================
   AUTH
========================================================= */

.auth-view {
  min-height: 100vh;

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 410px;

  padding: 30px;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: 18px;

  box-shadow: var(--shadow-md);
}

.brand-area {
  margin-bottom: 26px;

  text-align: center;
}

.brand-area h1 {
  margin: 0;

  font-size: 34px;
  font-weight: 850;

  letter-spacing: -1.5px;
}

.brand-area p {
  margin: 5px 0 0;

  color: var(--text-muted);

  font-size: 13px;
}

.auth-tabs {
  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 4px;

  padding: 4px;

  margin-bottom: 20px;

  background: #f3f4f6;

  border-radius: 10px;
}

.auth-tab {
  border: none;

  background: transparent;

  padding: 9px;

  border-radius: 7px;

  color: var(--text-muted);

  font-weight: 700;
}

.auth-tab.active {
  background: #ffffff;

  color: var(--text);

  box-shadow: var(--shadow-sm);
}

#authForm .primary-button,
#recoveryView .primary-button {
  width: 100%;

  margin-top: 19px;
}

.auth-note,
.legal-note {
  color: var(--text-muted);

  font-size: 11px;
}

.auth-note {
  text-align: center;
}

.auth-footer {
  display: flex;

  justify-content: center;

  gap: 8px;

  margin-top: 22px;
  padding-top: 16px;

  border-top: 1px solid var(--border);

  font-size: 11px;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
  position: sticky;

  top: 0;

  z-index: 100;

  height: 64px;

  background:
    rgba(255, 255, 255, 0.96);

  border-bottom:
    1px solid var(--border);

  backdrop-filter: blur(12px);
}

.header-inner {
  width: 100%;
  max-width: 1520px;
  height: 64px;

  margin: 0 auto;

  padding: 0 24px;

  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.header-brand {
  border: none;

  background: transparent;

  padding: 0;

  color: #111827;

  font-size: 25px;
  font-weight: 850;

  letter-spacing: -1.2px;
}

.header-brand:hover {
  opacity: 0.78;
}

.header-user {
  display: flex;

  align-items: center;

  gap: 7px;
}

#userEmail {
  margin-right: 8px;

  color: #9ca3af;

  font-size: 11px;
}


.header-icon-button {
  position: relative;

  height: 38px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 6px;

  padding: 0 11px;

  border: 1px solid var(--border);

  border-radius: 9px;

  background: #ffffff;

  color: #374151;

  font-size: 12px;
  font-weight: 650;
}

.header-icon-button:hover {
  background: var(--surface-hover);
}

.header-icon {
  font-size: 13px;
}

.header-badge {
  min-width: 17px;
  height: 17px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  padding: 0 4px;

  background: #dc2626;

  color: #ffffff;

  border-radius: 999px;

  font-size: 8px;
  font-weight: 800;
}

.mobile-messages-button {
  display: none;
}


/* =========================================================
   DESKTOP APP LAYOUT
========================================================= */

.site-layout {
  width: 100%;

  max-width: 1520px;

  margin: 0 auto;

  padding: 30px 24px 70px;

  display: grid;

  grid-template-columns:
    210px
    minmax(0, 1fr)
    300px;

  gap: 32px;
}

.board-area {
  min-width: 0;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  position: sticky;

  top: 92px;

  align-self: start;

  display: flex;

  flex-direction: column;

  gap: 3px;
}

.board-tab {
  width: 100%;

  border: none;

  background: transparent;

  padding: 9px 11px;

  border-radius: 8px;

  color: #667085;

  text-align: left;

  font-size: 13px;
  font-weight: 650;

  transition:
    background 0.14s ease,
    color 0.14s ease;
}

.nav-icon {
  display: none;
}

.board-tab:hover {
  background: #eef0f3;

  color: #111827;
}

.board-tab.active {
  background: #ebeef2;

  color: #111827;

  font-weight: 750;
}

.sidebar-divider {
  height: 1px;

  margin: 13px 0;

  background: var(--border);
}

.sidebar-label {
  margin-bottom: 6px;

  padding: 0 9px;

  color: #a0a8b5;

  font-size: 9px;
  font-weight: 850;

  letter-spacing: 1.1px;
}

.school-sidebar-button {
  width: 100%;

  min-width: 0;

  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  padding: 12px;

  border: 1px solid var(--border);

  background: #ffffff;

  border-radius: 11px;

  text-align: left;

  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.school-sidebar-button:hover {
  border-color: #cdd2da;

  background: #fbfbfc;
}

.school-sidebar-button.active {
  border-color: #aeb5bf;
}

.school-sidebar-name {
  display: block;

  color: #111827;

  font-size: 13px;
  font-weight: 800;
}

.school-sidebar-subtitle {
  display: block;

  margin-top: 2px;

  color: #9ca3af;

  font-size: 9px;
}

.school-sidebar-arrow {
  color: #9ca3af;
}


/* =========================================================
   GLOBAL + SCHOOL HOME
========================================================= */

.global-home-view,
.school-home-view {
  display: flex;

  flex-direction: column;

  gap: 34px;
}

.global-home-header {
  padding-bottom: 20px;

  border-bottom:
    1px solid var(--border-soft);
}

.page-eyebrow {
  margin: 0 0 7px;

  color: #a0a8b5;

  font-size: 9px;
  font-weight: 850;

  letter-spacing: 1.4px;
}

.global-home-header h1 {
  max-width: 700px;

  margin: 0;

  font-size: 30px;

  line-height: 1.2;

  font-weight: 820;

  letter-spacing: -1px;
}

.global-home-header > p:last-child {
  max-width: 650px;

  margin: 8px 0 0;

  color: #7a8493;

  font-size: 13px;

  line-height: 1.55;
}


/* =========================================================
   HOME SECTIONS
========================================================= */

.home-section {
  min-width: 0;
}

.home-section-header {
  display: flex;

  align-items: flex-end;
  justify-content: space-between;

  gap: 18px;

  margin-bottom: 12px;
}

.home-section-header h2 {
  margin: 0;

  font-size: 18px;
  font-weight: 800;

  letter-spacing: -0.2px;
}

.home-section-header p {
  margin: 3px 0 0;

  color: #9ca3af;

  font-size: 11px;
}

.home-section-link,
.school-home-board-link {
  flex: 0 0 auto;

  border: none;

  background: transparent;

  color: #727b89;

  padding: 4px;

  font-size: 11px;
  font-weight: 700;
}

.home-section-link:hover,
.school-home-board-link:hover {
  color: #111827;
}


/* =========================================================
   SHARED HOME CARDS / EMPTY STATES
========================================================= */

.home-trending-list,
.global-preview-list,
.school-home-board-card {
  overflow: hidden;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: 14px;

  box-shadow: var(--shadow-sm);
}


.empty {
  min-height: 116px;

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 24px;

  background: #ffffff;

  border: 1px dashed #d9dde4;

  border-radius: 14px;

  color: #98a1af;

  font-size: 12px;

  line-height: 1.55;

  text-align: center;
}


.home-trending-list > .empty,
.global-preview-list > .empty,
.school-home-board-card .empty {
  min-height: 104px;

  border: none;

  border-radius: 0;

  box-shadow: none;
}


.home-recent-empty {
  min-height: 104px;

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 22px 16px;

  background: #ffffff;

  color: #98a1af;

  font-size: 12px;

  line-height: 1.5;

  text-align: center;
}


.event-grid > .empty {
  grid-column: 1 / -1;

  min-height: 145px;

  border:
    1px dashed #d9dde4;

  background: #ffffff;
}


/* =========================================================
   TRENDING
========================================================= */

.home-trending-card {
  display: grid;

  grid-template-columns:
    34px minmax(0, 1fr);

  gap: 10px;

  padding: 15px 17px;

  cursor: pointer;

  transition:
    background 0.14s ease;
}

.home-trending-card +
.home-trending-card {
  border-top:
    1px solid var(--border-soft);
}

.home-trending-card:hover {
  background: #fafbfc;
}

.home-trending-rank {
  color: #c4cad3;

  font-size: 18px;
  font-weight: 800;

  text-align: center;
}

.home-trending-card:first-child
.home-trending-rank {
  color: #111827;
}

.home-trending-content {
  min-width: 0;
}

.home-post-meta {
  display: flex;

  align-items: center;
  flex-wrap: wrap;

  gap: 5px;

  color: #98a1af;

  font-size: 10px;
}

.school-badge,
.badge {
  display: inline-flex;

  align-items: center;

  padding: 2px 6px;

  background: #f7f8fa;

  color: #4b5563;

  border-radius: 999px;

  font-size: 8px;
  font-weight: 800;
}

.home-trending-content h3 {
  margin: 5px 0 3px;

  font-size: 14px;
}

.home-trending-content p {
  margin: 0;

  color: #697386;

  font-size: 12px;

  line-height: 1.5;
}

.home-post-stats {
  display: flex;

  align-items: center;
  flex-wrap: wrap;

  gap: 10px;

  margin-top: 7px;

  color: #9ca3af;

  font-size: 10px;
}


/* =========================================================
   EVENTS
========================================================= */

.event-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;
}

.event-card {
  overflow: hidden;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: 14px;

  box-shadow: var(--shadow-sm);
}

.event-card-image {
  width: 100%;

  height: 145px;

  display: block;

  object-fit: cover;
}

.event-card-body {
  padding: 15px 16px;
}

.event-organizer {
  color: #929baa;

  font-size: 9px;
  font-weight: 800;
}

.event-date {
  margin-top: 4px;

  color: #4b5563;

  font-size: 10px;
}

.event-card h3 {
  margin: 5px 0;

  font-size: 14px;
}

.event-location,
.event-description {
  color: #6b7280;

  font-size: 11px;
}


/* =========================================================
   SCHOOL PAGE
========================================================= */

.school-page-header {
  margin-bottom: 27px;
}

.school-page-heading h1 {
  margin: 0;

  font-size: 29px;

  font-weight: 820;
}

.school-page-heading > p:last-child {
  margin: 5px 0 0;

  color: #7e8795;

  font-size: 12px;
}

.school-subnav {
  display: flex;

  gap: 20px;

  margin-top: 18px;

  overflow-x: auto;

  border-bottom: 1px solid var(--border);

  scrollbar-width: none;
}

.school-subnav::-webkit-scrollbar {
  display: none;
}

.school-tab {
  position: relative;

  flex: 0 0 auto;

  border: none;

  background: transparent;

  padding: 9px 0 11px;

  color: #98a1af;

  font-size: 12px;
  font-weight: 700;
}

.school-tab.active {
  color: #111827;
}

.school-tab.active::after {
  content: "";

  position: absolute;

  left: 0;
  right: 0;
  bottom: -1px;

  height: 2px;

  background: #111827;
}

.school-home-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;
}

.school-home-board-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  padding: 13px 14px 10px;

  border-bottom:
    1px solid var(--border-soft);
}

.school-home-board-header h3 {
  margin: 0;

  font-size: 12px;
}


/* =========================================================
   RECENT POSTS
========================================================= */

.home-recent-list {
  display: flex;

  flex-direction: column;
}

.home-recent-post {
  width: 100%;

  border: none;

  background: transparent;

  padding: 11px 14px;

  text-align: left;

  transition:
    background 0.14s ease;
}

.home-recent-post:hover {
  background: #fafbfc;
}

.home-recent-post +
.home-recent-post {
  border-top:
    1px solid var(--border-soft);
}

.home-recent-title {
  overflow: hidden;

  font-size: 12px;
  font-weight: 700;

  text-overflow: ellipsis;

  white-space: nowrap;
}

.home-recent-meta {
  display: flex;

  align-items: center;
  flex-wrap: wrap;

  gap: 4px;

  margin-top: 5px;

  color: #a1a9b6;

  font-size: 9px;
}

/* =========================================================
   BOARD
========================================================= */

.board-header {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 17px;
}

.board-header h2 {
  margin: 0;

  font-size: 24px;
}

.board-header p {
  margin: 4px 0 0;

  color: #9098a6;

  font-size: 12px;
}

.board-search {
  display: flex;

  gap: 7px;

  margin-bottom: 15px;
}

.board-search input,
.board-search select {
  flex: 1;
}

#feed {
  display: flex;

  flex-direction: column;

  gap: 9px;
}

.post-card {
  padding: 16px 18px;

  background: #ffffff;

  border: 1px solid var(--border);

  border-radius: 13px;

  box-shadow: var(--shadow-sm);
}

.post-card.clickable {
  cursor: pointer;

  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease;
}

.post-card.clickable:hover {
  transform: translateY(-1px);

  box-shadow: var(--shadow-md);
}

.post-meta {
  display: flex;

  align-items: center;
  flex-wrap: wrap;

  gap: 5px;

  color: #9ca3af;

  font-size: 10px;
}

.post-title {
  margin: 8px 0 5px;

  font-size: 16px;
}

.post-preview {
  margin: 0;

  color: #596273;

  font-size: 12px;

  line-height: 1.58;

  white-space: pre-wrap;
}

.post-footer {
  display: flex;

  justify-content: space-between;

  gap: 12px;

  margin-top: 11px;
  padding-top: 9px;

  border-top:
    1px solid var(--border-soft);

  color: #a0a8b5;

  font-size: 10px;
}


/* =========================================================
   DM — DESKTOP
========================================================= */

.dm-panel {
  position: sticky;

  top: 92px;

  align-self: start;

  height:
    calc(100vh - 116px);

  min-height: 500px;

  overflow: hidden;

  background: #ffffff;

  border:
    1px solid var(--border);

  border-radius: 14px;

  box-shadow: var(--shadow-sm);
}

.dm-conversation-view,
.dm-chat-view {
  height: 100%;

  min-height: 0;

  display: flex;

  flex-direction: column;
}

.dm-panel-header,
.dm-chat-header {
  min-height: 62px;

  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  padding: 13px 14px;

  border-bottom:
    1px solid var(--border-soft);
}

.dm-panel-header h2 {
  margin: 0;

  font-size: 15px;
}

.dm-panel-header p {
  margin: 2px 0 0;

  color: #9ca3af;

  font-size: 9px;
}

.dm-panel-header-actions {
  display: flex;

  align-items: center;

  gap: 5px;
}

.dm-unread-badge {
  min-width: 20px;
  height: 20px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  padding: 0 6px;

  background: #111827;

  color: #ffffff;

  border-radius: 999px;

  font-size: 9px;
  font-weight: 800;
}

.dm-mobile-close {
  display: none;
}

.dm-conversation-list {
  flex: 1;

  min-height: 0;

  overflow-y: auto;
}

.dm-conversation-item {
  width: 100%;

  display: flex;

  align-items: center;

  gap: 9px;

  padding: 10px 12px;

  border: none;

  background: transparent;

  text-align: left;
}

.dm-conversation-item:hover {
  background: #f8f9fb;
}

.dm-avatar {
  width: 34px;
  height: 34px;

  flex: 0 0 34px;

  display: flex;

  align-items: center;
  justify-content: center;

  background: #eff1f4;

  border-radius: 50%;

  font-size: 12px;
  font-weight: 800;
}

.dm-conversation-content {
  flex: 1;

  min-width: 0;
}

.dm-conversation-top {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 6px;
}

.dm-conversation-name {
  min-width: 0;

  overflow: hidden;

  font-size: 11px;
  font-weight: 700;

  text-overflow: ellipsis;

  white-space: nowrap;
}

.dm-conversation-time {
  flex: 0 0 auto;

  color: #a5acb7;

  font-size: 8px;
}

.dm-conversation-bottom {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 5px;

  margin-top: 3px;
}

.dm-last-message {
  flex: 1;

  min-width: 0;

  overflow: hidden;

  color: #8b95a5;

  font-size: 9px;

  text-overflow: ellipsis;

  white-space: nowrap;
}

.dm-conversation-unread {
  min-width: 17px;
  height: 17px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  padding: 0 4px;

  background: #111827;

  color: #ffffff;

  border-radius: 999px;

  font-size: 7px;
  font-weight: 800;
}

.dm-empty-state {
  min-height: 130px;

  display: flex;

  flex-direction: column;

  align-items: center;
  justify-content: center;

  gap: 4px;

  padding: 20px;

  color: #9ca3af;

  text-align: center;

  font-size: 10px;
}

.dm-empty-state strong {
  color: #697386;

  font-size: 11px;
}

.dm-back-button {
  width: 30px;
  height: 30px;

  border: none;

  background: transparent;

  border-radius: 7px;

  color: #6b7280;
}

.dm-message-list {
  flex: 1;

  min-height: 0;

  overflow-y: auto;

  display: flex;

  flex-direction: column;

  gap: 7px;

  padding: 13px 11px;

  background: #fafbfc;
}

.dm-message-row {
  display: flex;
}

.dm-message-row.mine {
  justify-content: flex-end;
}

.dm-message-row.theirs {
  justify-content: flex-start;
}

.dm-message-bubble {
  max-width: 82%;

  padding: 8px 10px;

  border-radius: 12px;

  font-size: 10px;

  line-height: 1.45;
}

.dm-message-row.mine
.dm-message-bubble {
  background: #111827;

  color: #ffffff;

  border-bottom-right-radius: 4px;
}

.dm-message-row.theirs
.dm-message-bubble {
  background: #ffffff;

  color: #273142;

  border: 1px solid #e7e9ed;

  border-bottom-left-radius: 4px;
}

.dm-message-text {
  white-space: pre-wrap;

  overflow-wrap: anywhere;
}

.dm-message-time {
  margin-top: 4px;

  font-size: 7px;
}

.dm-composer {
  flex: 0 0 auto;

  display: flex;

  align-items: flex-end;

  gap: 6px;

  padding: 10px;

  background: #ffffff;

  border-top:
    1px solid var(--border-soft);
}

.dm-composer textarea {
  flex: 1;

  min-width: 0;

  min-height: 36px;
  max-height: 105px;

  resize: none;

  padding: 8px 9px;

  font-size: 10px;
}

.dm-send-button {
  min-height: 36px;

  padding: 7px 10px;

  font-size: 10px;
}


/* =========================================================
   MODALS
========================================================= */

.modal-backdrop {
  position: fixed;

  inset: 0;

  z-index: 500;

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 20px;

  background:
    rgba(17, 24, 39, 0.48);

  backdrop-filter: blur(3px);
}

.modal {
  width: 100%;

  max-width: 640px;
  max-height: 90vh;

  overflow-y: auto;

  padding: 21px;

  background: #ffffff;

  border-radius: 16px;

  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 18px;
}

.modal-header h2 {
  margin: 0;

  font-size: 20px;
}

.modal-header p {
  margin: 4px 0 0;

  color: #9ca3af;

  font-size: 11px;
}

.modal-actions {
  display: flex;

  justify-content: flex-end;

  gap: 7px;

  margin-top: 14px;
}

.checkbox-row {
  display: flex;

  align-items: center;

  gap: 7px;

  margin-top: 11px;
}

.checkbox-row input {
  width: auto;

  margin: 0;
}

.checkbox-row label {
  margin: 0;
}

.post-detail-modal {
  max-width: 720px;
}

.post-detail-modal #detailTitle {
  margin: 13px 0 7px;
}

.detail-content {
  color: #374151;

  font-size: 13px;

  line-height: 1.65;

  white-space: pre-wrap;
}

.post-interactions {
  display: flex;

  align-items: center;
  flex-wrap: wrap;

  gap: 6px;

  margin-top: 11px;
}

.like-button,
.bookmark-button {
  padding: 6px 9px;

  border: 1px solid var(--border);

  background: #ffffff;

  color: #4b5563;

  border-radius: 8px;

  font-size: 11px;
  font-weight: 700;
}


/* =========================================================
   COMMENTS
========================================================= */

.comments-section h3 {
  margin-bottom: 11px;

  font-size: 15px;
}

#commentList {
  display: flex;

  flex-direction: column;

  gap: 7px;
}

.comment {
  padding: 11px 12px;

  background: #f8fafc;

  border: 1px solid #edf0f3;

  border-radius: 10px;
}

.comment-meta {
  margin: 0 0 4px;

  color: #9ca3af;

  font-size: 9px;
}

.comment-body {
  margin: 0;

  font-size: 12px;

  line-height: 1.5;

  white-space: pre-wrap;
}

.comment-actions {
  display: flex;

  flex-wrap: wrap;

  gap: 2px;

  margin-top: 6px;
}

.comment-action-button,
.reply-toggle-button {
  border: none;

  background: transparent;

  color: #7c8594;

  font-size: 10px;
}

.reply-list {
  display: flex;

  flex-direction: column;

  gap: 5px;

  margin: 5px 0 0 24px;
}

.reply-comment {
  display: flex;

  gap: 6px;

  padding: 9px 10px;

  background: #f3f5f7;

  border-left:
    2px solid #d4d9e0;

  border-radius: 9px;
}


/* =========================================================
   PROFILE
========================================================= */

.profile-modal {
  max-width: 430px;
}

.profile-save-button {
  width: 100%;

  margin-top: 17px;
}

.mobile-account-menu {
  display: none;
}

.profile-danger-zone {
  margin-top: 25px;
  padding-top: 19px;

  border-top:
    1px solid var(--border);
}

.profile-danger-zone h3 {
  color: var(--danger);
}

.profile-danger-zone .danger-button {
  width: 100%;
}


/* =========================================================
   IMAGES
========================================================= */

.image-preview {
  display: grid;

  grid-template-columns:
    repeat(5, minmax(0, 1fr));

  gap: 8px;
}

.image-preview-item {
  position: relative;

  aspect-ratio: 1;

  overflow: hidden;
}

.image-preview-item img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.detail-image {
  width: 100%;

  max-height: 700px;

  object-fit: contain;
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
  margin-top: 50px;

  padding: 20px 0;

  border-top:
    1px solid var(--border);

  color: #a0a8b5;

  font-size: 9px;

  text-align: center;
}

.site-footer-links {
  display: flex;

  justify-content: center;

  gap: 7px;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1180px) {

  .site-layout {
    max-width: 1100px;

    grid-template-columns:
      190px
      minmax(0, 1fr);

    gap: 30px;
  }


  .dm-panel {
    position: fixed;

    top: 0;
    right: 0;
    bottom: 0;

    z-index: 600;

    width:
      min(360px, 92vw);

    height: 100dvh;

    min-height: 0;

    border-radius: 0;

    transform:
      translateX(105%);

    transition:
      transform 0.2s ease;

    box-shadow:
      -10px 0 35px
      rgba(15, 23, 42, 0.14);
  }


  .dm-panel.mobile-open {
    transform:
      translateX(0);
  }


  .mobile-messages-button {
    display: inline-flex;
  }


  .dm-mobile-close {
    display: inline-flex;
  }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 760px) {

  body {
    padding-bottom:
      calc(
        70px +
        env(safe-area-inset-bottom)
      );
  }


  /* -------------------------
     Header
  ------------------------- */

  .site-header {
    height: 58px;
  }


  .header-inner {
    height: 58px;

    padding: 0 14px;

    gap: 10px;
  }


  .header-brand {
    flex: 0 0 auto;

    font-size: 23px;

    line-height: 1;

    letter-spacing: -1.05px;
  }


  #userEmail,
  .desktop-logout-button {
    display: none;
  }


  .header-user {
    flex: 0 0 auto;

    gap: 5px;
  }


  .header-icon-button {
    width: 37px;
    min-width: 37px;
    height: 37px;

    padding: 0;

    border-radius: 10px;
  }


  .desktop-button-text {
    display: none;
  }


  .header-icon {
    font-size: 16px;
  }


  .header-badge {
    position: absolute;

    top: -4px;
    right: -4px;

    border:
      2px solid #ffffff;
  }


  /* -------------------------
     Main
  ------------------------- */

  .site-layout {
    display: block;

    width: 100%;

    max-width: none;

    margin: 0;

    padding:
      21px 16px 32px;
  }


  .board-area {
    width: 100%;
  }


  /* -------------------------
     Bottom navigation
  ------------------------- */

  .sidebar {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;
    top: auto;

    z-index: 400;

    height:
      calc(
        64px +
        env(safe-area-inset-bottom)
      );

    display: grid;

    grid-template-columns:
      repeat(4, 1fr);

    align-items: stretch;

    gap: 0;

    margin: 0;

    padding:
      3px 4px
      env(safe-area-inset-bottom);

    background:
      rgba(255, 255, 255, 0.985);

    border-top:
      1px solid var(--border);

    box-shadow:
      0 -4px 20px
      rgba(15, 23, 42, 0.04);

    backdrop-filter:
      blur(16px);
  }


  .sidebar-divider,
  .sidebar-label,
  .secondary-nav-item {
    display: none !important;
  }


  #globalHomeBtn {
    grid-column: 1;
  }

  #globalAnonymousBtn {
    grid-column: 2;
  }

  #globalEventsBtn {
    grid-column: 3;
  }

  #yourSchoolBtn {
    grid-column: 4;
  }


  .board-tab {
    position: relative;

    width: 100%;
    height: 60px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 3px;

    padding: 5px 2px;

    border-radius: 0;

    background: transparent;

    color: #929baa;

    font-size: 10px;

    line-height: 1.15;

    text-align: center;

    white-space: nowrap;
  }


  .nav-icon {
    display: block;

    color: currentColor;

    font-size: 18px;

    line-height: 1;
  }


  .board-tab.active {
    background: transparent;

    color: #111827;
  }


  .board-tab.active::before {
    content: "";

    position: absolute;

    top: 0;

    width: 24px;
    height: 2px;

    background: #111827;

    border-radius:
      0 0 2px 2px;
  }


  #globalEventsBtn >
  span:last-child {
    font-size: 0;
  }


  #globalEventsBtn >
  span:last-child::after {
    content: "Events";

    font-size: 10px;
  }


  /* -------------------------
     School bottom-nav item
  ------------------------- */

  .school-sidebar-button {
    position: relative;

    width: 100%;
    min-width: 0;
    height: 60px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 5px 2px;

    border: none;

    border-radius: 0;

    background: transparent;

    text-align: center;
  }


  .school-sidebar-button::before {
    content: "▦";

    position: absolute;

    top: 8px;

    color: #929baa;

    font-size: 18px;

    line-height: 1;
  }


  .school-sidebar-name {
    margin-top: 24px;

    color: #929baa;

    font-size: 10px;

    font-weight: 700;
  }


  .school-sidebar-button.active::after {
    content: "";

    position: absolute;

    top: 0;

    width: 24px;
    height: 2px;

    background: #111827;

    border-radius:
      0 0 2px 2px;
  }


  .school-sidebar-button.active::before,
  .school-sidebar-button.active
  .school-sidebar-name {
    color: #111827;
  }


  .school-sidebar-subtitle,
  .school-sidebar-arrow {
    display: none;
  }


  /* -------------------------
     Global Home
  ------------------------- */

  .global-home-view,
  .school-home-view {
    gap: 32px;
  }


  .global-home-header {
    padding:
      4px 0 21px;
  }


  .page-eyebrow {
    margin-bottom: 8px;

    font-size: 9px;

    letter-spacing: 1.6px;
  }


  .global-home-header h1 {
    max-width: 520px;

    font-size: 26px;

    line-height: 1.18;

    letter-spacing: -0.75px;
  }


  .global-home-header > p:last-child {
    max-width: 520px;

    margin-top: 10px;

    font-size: 12px;

    line-height: 1.55;
  }


  /* -------------------------
     Sections
  ------------------------- */

  .home-section-header {
    align-items: flex-end;

    gap: 10px;

    margin-bottom: 11px;
  }


  .home-section-header h2 {
    font-size: 19px;

    letter-spacing: -0.2px;
  }


  .home-section-header p {
    max-width: 290px;

    font-size: 11px;

    line-height: 1.45;
  }


  .home-section-link {
    padding:
      3px 0 1px;

    font-size: 11px;
  }


  /* -------------------------
     Empty states
  ------------------------- */

  .empty {
    min-height: 112px;

    padding: 22px 16px;

    font-size: 12px;
  }


  .home-trending-list >
  .empty,
  .global-preview-list >
  .empty,
  .school-home-board-card
  .empty,
  .home-recent-empty {
    min-height: 108px;

    padding: 22px 16px;
  }


  .event-grid > .empty {
    min-height: 135px;
  }


  /* -------------------------
     Trending
  ------------------------- */

  .home-trending-list,
  .global-preview-list,
  .school-home-board-card {
    border-radius: 15px;
  }


  .home-trending-card {
    grid-template-columns:
      26px minmax(0, 1fr);

    gap: 8px;

    padding: 14px 13px;
  }


  .home-trending-rank {
    font-size: 16px;
  }


  .home-post-meta {
    font-size: 9px;
  }


  .home-trending-content h3 {
    font-size: 14px;
  }


  .home-trending-content p {
    font-size: 11px;
  }


  /* -------------------------
     Events
  ------------------------- */

  .event-grid {
    grid-template-columns:
      1fr;

    gap: 10px;
  }


  .event-card {
    border-radius: 15px;
  }


  .event-card-image {
    height: 170px;
  }


  /* -------------------------
     School page
  ------------------------- */

  .school-page-header {
    margin-bottom: 24px;
  }


  .school-page-heading h1 {
    font-size: 27px;
  }


  .school-subnav {
    gap: 18px;

    -webkit-overflow-scrolling:
      touch;
  }


  .school-tab {
    font-size: 11px;
  }


  .school-home-grid {
    grid-template-columns:
      1fr;

    gap: 10px;
  }


  /* -------------------------
     Board
  ------------------------- */

  .board-header h2 {
    font-size: 23px;
  }


  .board-search {
    display: grid;

    grid-template-columns:
      1fr auto;

    gap: 7px;
  }


  #clearSearchBtn {
    grid-column:
      1 / -1;

    justify-self: start;
  }


  .post-card {
    padding: 15px;

    border-radius: 14px;
  }


  /* -------------------------
     DM full screen
  ------------------------- */

  .dm-panel {
    position: fixed;

    inset: 0;

    z-index: 600;

    width: 100vw;
    height: 100dvh;

    min-height: 0;

    border: none;

    border-radius: 0;

    transform:
      translateX(105%);

    transition:
      transform 0.22s ease;

    box-shadow: none;
  }


  .dm-panel.mobile-open {
    transform:
      translateX(0);
  }


  .dm-mobile-close {
    display: inline-flex;
  }


  .dm-panel-header,
  .dm-chat-header {
    min-height:
      calc(
        58px +
        env(safe-area-inset-top)
      );

    padding:
      calc(
        10px +
        env(safe-area-inset-top)
      )
      14px
      10px;
  }


  .dm-panel-header h2 {
    font-size: 17px;
  }


  .dm-message-list {
    padding:
      14px 12px;
  }


  .dm-message-bubble {
    max-width: 84%;

    padding: 9px 11px;

    font-size: 12px;
  }


  .dm-composer {
    padding:
      10px
      10px
      calc(
        10px +
        env(safe-area-inset-bottom)
      );
  }


  .dm-composer textarea {
    min-height: 40px;

    font-size: 12px;
  }


  .dm-send-button {
    min-height: 40px;

    font-size: 11px;
  }


  /* -------------------------
     Mobile Profile Account Menu
  ------------------------- */

  .mobile-account-menu {
    display: block;

    margin-top: 25px;

    padding-top: 18px;

    border-top:
      1px solid var(--border);
  }


  .profile-section-title {
    margin-bottom: 6px;

    color: #9ca3af;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.8px;

    text-transform: uppercase;
  }


  .profile-menu-button {
    width: 100%;

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 13px 2px;

    border: none;

    border-bottom:
      1px solid var(--border-soft);

    background: transparent;

    color: #374151;

    text-align: left;

    font-size: 13px;

    font-weight: 650;
  }


  /* -------------------------
     Mobile generic modals
  ------------------------- */

  .modal-backdrop {
    align-items: flex-end;

    padding: 0;
  }


  .modal {
    max-height: 92dvh;

    padding: 18px;

    border-radius:
      18px 18px 0 0;
  }


  .site-footer {
    margin-bottom: 18px;
  }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

  .header-inner {
    padding:
      0 12px;
  }


  .header-brand {
    font-size: 22px;
  }


  .header-icon-button {
    width: 35px;
    min-width: 35px;
    height: 35px;
  }


  .header-icon {
    font-size: 15px;
  }


  .site-layout {
    padding:
      20px 12px 28px;
  }


  .global-home-header h1 {
    font-size: 24px;

    line-height: 1.19;
  }


  .global-home-header >
  p:last-child {
    font-size: 12px;
  }


  .home-section-header h2 {
    font-size: 18px;
  }


  .home-trending-content p {
    display: none;
  }


  .board-header {
    display: block;
  }


  .board-header
  .primary-button {
    width: 100%;

    margin-top: 10px;
  }


  .reply-list {
    margin-left: 8px;
  }
}


/* =========================================================
   ADMIN CENTER
========================================================= */

#adminControls {
  display: block;

  margin-bottom: 18px;
}


.admin-toolbar {
  display: flex;

  flex-direction: column;

  gap: 12px;
}


.admin-tabs {
  display: flex;

  gap: 6px;

  flex-wrap: wrap;
}


.admin-tab {
  background: #ffffff;
}


.admin-tab.active {
  background: #111827;

  border-color: #111827;

  color: #ffffff;
}


.admin-toolbar-actions {
  display: flex;

  align-items: center;

  gap: 7px;

  flex-wrap: wrap;
}


.admin-toolbar-actions input {
  flex:
    1 1 260px;
}


.admin-toolbar-actions select {
  width: auto;

  min-width: 130px;
}


.admin-report-actions {
  display: flex;

  align-items: flex-end;

  gap: 8px;

  flex-wrap: wrap;

  margin-top: 15px;
}


.admin-report-actions select {
  width: auto;

  min-width: 150px;
}


.admin-report-actions label {
  margin: 0;
}


.admin-archive-note {
  margin-top: 10px;

  padding: 9px 11px;

  background: #f8fafc;

  border-radius: 8px;

  color: #7a8493;

  font-size: 10px;
}


.deleted-admin-card {
  border-style: dashed;
}


@media (max-width: 760px) {

  .admin-tabs {
    display: grid;

    grid-template-columns:
      repeat(3, 1fr);

    gap: 5px;
  }


  .admin-tab {
    padding-left: 6px;
    padding-right: 6px;

    font-size: 11px;
  }


  .admin-toolbar-actions {
    display: grid;

    grid-template-columns:
      1fr auto;

    width: 100%;
  }


  .admin-toolbar-actions input {
    grid-column:
      1 / -1;

    width: 100%;
  }


  .admin-toolbar-actions select {
    width: 100%;
  }


  .admin-report-actions {
    align-items: stretch;
  }


  .admin-report-actions button,
  .admin-report-actions select {
    width: 100%;
  }
}

/* =========================================================
   CUSTOM FILE INPUT
========================================================= */

.custom-file-field {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;

  padding: 10px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: #ffffff;
}


.custom-file-button {
  flex: 0 0 auto;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin: 0;

  cursor: pointer;
}


.custom-file-label {
  min-width: 0;

  overflow: hidden;

  color: #8b95a5;

  font-size: 11px;

  text-overflow: ellipsis;
  white-space: nowrap;
}


.visually-hidden-file {
  position: absolute;

  width: 1px;
  height: 1px;

  padding: 0;
  margin: -1px;

  overflow: hidden;

  clip: rect(0, 0, 0, 0);

  white-space: nowrap;

  border: 0;
}


/* =========================================================
   EVENT DATE / TIME
========================================================= */

.event-datetime-row {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    88px
    88px;

  align-items: center;

  gap: 8px;
}


.event-datetime-row input,
.event-datetime-row select {
  margin: 0;
}


.optional-label {
  margin-left: 5px;

  color: #9ca3af;

  font-size: 10px;
  font-weight: 500;
}


#eventDateRequiredMark,
#editEventRequiredMark {
  color: #dc2626;
}


/* =========================================================
   EVENT DETAIL
========================================================= */

.event-detail-box {
  display: flex;

  flex-direction: column;

  gap: 9px;

  margin-top: 16px;
  margin-bottom: 10px;

  padding: 14px 15px;

  background: #f9fafb;

  border: 1px solid var(--border);

  border-radius: 11px;

  font-size: 12px;
}


.event-detail-row {
  display: grid;

  grid-template-columns:
    78px
    minmax(0, 1fr);

  gap: 10px;

  color: #4b5563;
}


.event-detail-label {
  color: #8b95a5;

  font-weight: 700;
}


.event-detail-row a {
  color: #2563eb;

  text-decoration: none;
}


.event-detail-row a:hover {
  text-decoration: underline;
}


.event-detail-empty {
  color: #9ca3af;

  font-size: 11px;
}


/* =========================================================
   NEW POST PHOTO MANAGEMENT
========================================================= */

#imagePreview {
  display: grid;

  grid-template-columns:
    repeat(
      3,
      minmax(0, 1fr)
    );

  gap: 9px;

  margin-top: 10px;
}


#imagePreview:empty {
  display: none;
}


.post-photo-manage-card {
  overflow: hidden;

  min-width: 0;

  background: #ffffff;

  border:
    1px solid
    var(--border);

  border-radius: 10px;
}


.post-photo-manage-image {
  width: 100%;

  aspect-ratio: 4 / 3;

  overflow: hidden;

  background: #f3f4f6;
}


.post-photo-manage-image img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
}


.post-photo-remove-button {
  width: 100%;

  padding: 7px 8px;

  border: none;

  border-top:
    1px solid
    var(--border-soft);

  background: #ffffff;

  color: #b91c1c;

  font-size: 9px;
  font-weight: 750;

  text-align: center;

  transition:
    background 0.15s ease;
}


.post-photo-remove-button:hover {
  background: #fef2f2;
}


/* =========================================================
   EDIT POST — LARGE MODAL
========================================================= */

.edit-post-modal {
  width:
    min(
      1080px,
      calc(
        100vw - 48px
      )
    );

  max-width: 1080px;

  max-height: 94vh;

  padding: 24px;

  overflow-y: auto;
}


.edit-post-modal textarea {
  min-height: 180px;

  resize: vertical;
}


/* =========================================================
   EDIT PHOTO SECTION
========================================================= */

.edit-photo-section {
  margin-top: 20px;
}


.edit-photo-heading {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 10px;
}


.edit-photo-heading label {
  margin: 0;
}


.edit-photo-count {
  color: #8b95a5;

  font-size: 10px;
  font-weight: 700;
}


/* =========================================================
   EDIT PHOTO GRID
========================================================= */

.edit-photo-grid {
  display: grid;

  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    );

  gap: 10px;

  margin-bottom: 12px;
}


.edit-photo-grid:empty {
  display: none;
}


.edit-photo-card {
  overflow: hidden;

  min-width: 0;

  background: #ffffff;

  border:
    1px solid
    var(--border);

  border-radius: 10px;
}


.edit-photo-image {
  width: 100%;

  aspect-ratio: 1 / 1;

  overflow: hidden;

  background: #f3f4f6;
}


.edit-photo-image img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
}


.edit-image-fallback {
  width: 100%;
  height: 100%;

  display: flex;

  align-items: center;
  justify-content: center;

  color: #9ca3af;

  font-size: 10px;
}


/* =========================================================
   EDIT PHOTO FOOTER
========================================================= */

.edit-photo-card-footer {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 7px;

  padding: 7px 8px;

  border-top:
    1px solid
    var(--border-soft);

  font-size: 8px;
}


.edit-photo-card-footer span {
  min-width: 0;

  overflow: hidden;

  color: #8b95a5;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.edit-photo-new-label {
  display: inline-flex;

  align-items: center;

  padding: 2px 5px;

  border-radius: 999px;

  background: #111827;

  color: #ffffff !important;

  font-size: 7px !important;
  font-weight: 800;
}


/* =========================================================
   EDIT PHOTO REMOVE BUTTON
========================================================= */

.edit-photo-remove-button {
  flex: 0 0 auto;

  border:
    1px solid
    #fecaca;

  background: #ffffff;

  color: #b91c1c;

  padding:
    5px 9px;

  border-radius: 7px;

  font-size: 9px;
  font-weight: 750;

  line-height: 1.2;

  transition:
    background 0.15s ease,
    transform 0.1s ease;
}


.edit-photo-remove-button:hover {
  background: #fef2f2;
}


.edit-photo-remove-button:active {
  transform:
    translateY(1px);
}


/* =========================================================
   EDIT ADD PHOTOS
========================================================= */

.edit-photo-section
.custom-file-field {
  padding:
    9px 10px;
}


.edit-photo-section
.custom-file-button {
  padding:
    8px 12px;

  font-size: 11px;
}


.edit-photo-section
.custom-file-label {
  font-size: 10px;
}


/* =========================================================
   TABLET — EDIT PHOTO LAYOUT
========================================================= */

@media
(max-width: 900px) {

  .edit-post-modal {
    width:
      min(
        860px,
        calc(
          100vw - 28px
        )
      );

    max-width: 860px;
  }


  .edit-photo-grid {
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      );
  }

}


/* =========================================================
   MOBILE — EDIT MODAL + PHOTOS
========================================================= */

@media
(max-width: 760px) {

  /*
    Generic mobile modal behavior in Part 3
    makes modals bottom sheets.

    Edit Post gets a larger centered workspace
    so users can see more of the form.
  */

  .modal-backdrop:has(
    .edit-post-modal
  ) {
    align-items: center;

    padding: 10px;
  }


  .edit-post-modal {
    width: 100%;

    max-width: none;

    max-height:
      calc(
        100dvh - 20px
      );

    padding: 16px;

    border-radius: 16px;

    overflow-y: auto;
  }


  .edit-post-modal
  textarea {
    min-height: 135px;
  }


  /* -------------------------
     Event date/time
  ------------------------- */

  .event-datetime-row {
    grid-template-columns:
      1fr 1fr;
  }


  .event-datetime-row
  input {
    grid-column:
      1 / -1;
  }


  /* -------------------------
     New Post photos
  ------------------------- */

  #imagePreview {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap: 8px;
  }


  .post-photo-manage-image {
    aspect-ratio: 1 / 1;
  }


  .post-photo-remove-button {
    min-height: 32px;

    padding: 6px 7px;

    font-size: 10px;
  }


  /* -------------------------
     Edit photos
  ------------------------- */

  .edit-photo-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap: 8px;
  }


  .edit-photo-image {
    aspect-ratio: 1 / 1;
  }


  .edit-photo-card-footer {
    display: flex;

    flex-direction: column;

    align-items: stretch;

    gap: 5px;

    padding: 6px;
  }


  .edit-photo-card-footer
  span {
    display: block;

    margin: 0;

    font-size: 8px;
  }


  .edit-photo-remove-button {
    width: 100%;

    min-height: 28px;

    padding:
      5px 7px;

    font-size: 9px;

    text-align: center;
  }


  /* -------------------------
     Edit Add photos
  ------------------------- */

  .edit-photo-section
  .custom-file-field {
    flex-direction: row;

    align-items: center;
  }


  .edit-photo-section
  .custom-file-button {
    width: auto;

    min-height: 36px;
  }


  .edit-photo-section
  .custom-file-label {
    font-size: 9px;
  }


  /* -------------------------
     Sticky Cancel / Save
  ------------------------- */

  .edit-post-modal
  .modal-actions {
    position: sticky;

    bottom: -16px;

    z-index: 5;

    display: grid;

    grid-template-columns:
      1fr 1fr;

    margin:
      18px
      -16px
      -16px;

    padding:
      12px
      16px
      calc(
        12px +
        env(
          safe-area-inset-bottom
        )
      );

    background:
      rgba(
        255,
        255,
        255,
        0.97
      );

    border-top:
      1px solid
      var(--border);

    backdrop-filter:
      blur(12px);
  }


  .edit-post-modal
  .modal-actions
  button {
    width: 100%;
  }


  /* -------------------------
     Event detail
  ------------------------- */

  .event-detail-row {
    grid-template-columns:
      1fr;

    gap: 2px;
  }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media
(max-width: 420px) {

  .edit-post-modal {
    padding: 14px;
  }


  #imagePreview,
  .edit-photo-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap: 7px;
  }


  .edit-photo-card-footer {
    padding: 5px;
  }


  .edit-photo-remove-button {
    min-height: 27px;

    padding:
      5px 6px;

    font-size: 9px;
  }


  /*
    Hide helper text on tiny screens
    to keep the Add photos row compact.
  */

  .edit-photo-section
  .custom-file-label {
    display: none;
  }


  .edit-post-modal
  .modal-actions {
    margin:
      16px
      -14px
      -14px;

    padding:
      10px
      14px
      calc(
        10px +
        env(
          safe-area-inset-bottom
        )
      );
  }

}

/* =========================================================
   CUSTOM FILE INPUT
========================================================= */

.custom-file-field {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;

  padding: 10px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: #ffffff;
}


.custom-file-button {
  flex: 0 0 auto;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin: 0;

  cursor: pointer;
}


.custom-file-label {
  min-width: 0;

  overflow: hidden;

  color: #8b95a5;

  font-size: 11px;

  text-overflow: ellipsis;
  white-space: nowrap;
}


.visually-hidden-file {
  position: absolute;

  width: 1px;
  height: 1px;

  padding: 0;
  margin: -1px;

  overflow: hidden;

  clip: rect(0, 0, 0, 0);

  white-space: nowrap;

  border: 0;
}


/* =========================================================
   EVENT DATE / TIME
========================================================= */

.event-datetime-row {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    88px
    88px;

  align-items: center;

  gap: 8px;
}


.event-datetime-row input,
.event-datetime-row select {
  margin: 0;
}


.optional-label {
  margin-left: 5px;

  color: #9ca3af;

  font-size: 10px;
  font-weight: 500;
}


#eventDateRequiredMark,
#editEventRequiredMark {
  color: #dc2626;
}


/* =========================================================
   EVENT DETAIL
========================================================= */

.event-detail-box {
  display: flex;

  flex-direction: column;

  gap: 9px;

  margin-top: 16px;
  margin-bottom: 10px;

  padding: 14px 15px;

  background: #f9fafb;

  border: 1px solid var(--border);

  border-radius: 11px;

  font-size: 12px;
}


.event-detail-row {
  display: grid;

  grid-template-columns:
    78px
    minmax(0, 1fr);

  gap: 10px;

  color: #4b5563;
}


.event-detail-label {
  color: #8b95a5;

  font-weight: 700;
}


.event-detail-row a {
  color: #2563eb;

  text-decoration: none;
}


.event-detail-row a:hover {
  text-decoration: underline;
}


.event-detail-empty {
  color: #9ca3af;

  font-size: 11px;
}


/* =========================================================
   NEW POST PHOTO MANAGEMENT
========================================================= */

#imagePreview {
  display: grid;

  grid-template-columns:
    repeat(
      3,
      minmax(0, 1fr)
    );

  gap: 9px;

  margin-top: 10px;
}


#imagePreview:empty {
  display: none;
}


.post-photo-manage-card {
  overflow: hidden;

  min-width: 0;

  background: #ffffff;

  border:
    1px solid
    var(--border);

  border-radius: 10px;
}


.post-photo-manage-image {
  width: 100%;

  aspect-ratio: 4 / 3;

  overflow: hidden;

  background: #f3f4f6;
}


.post-photo-manage-image img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
}


.post-photo-remove-button {
  width: 100%;

  padding: 7px 8px;

  border: none;

  border-top:
    1px solid
    var(--border-soft);

  background: #ffffff;

  color: #b91c1c;

  font-size: 9px;
  font-weight: 750;

  text-align: center;

  transition:
    background 0.15s ease;
}


.post-photo-remove-button:hover {
  background: #fef2f2;
}


/* =========================================================
   EDIT POST — LARGE MODAL
========================================================= */

.edit-post-modal {
  width:
    min(
      1080px,
      calc(
        100vw - 48px
      )
    );

  max-width: 1080px;

  max-height: 94vh;

  padding: 24px;

  overflow-y: auto;
}


.edit-post-modal textarea {
  min-height: 180px;

  resize: vertical;
}


/* =========================================================
   EDIT PHOTO SECTION
========================================================= */

.edit-photo-section {
  margin-top: 20px;
}


.edit-photo-heading {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 10px;
}


.edit-photo-heading label {
  margin: 0;
}


.edit-photo-count {
  color: #8b95a5;

  font-size: 10px;
  font-weight: 700;
}


/* =========================================================
   EDIT PHOTO GRID
========================================================= */

.edit-photo-grid {
  display: grid;

  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    );

  gap: 10px;

  margin-bottom: 12px;
}


.edit-photo-grid:empty {
  display: none;
}


.edit-photo-card {
  overflow: hidden;

  min-width: 0;

  background: #ffffff;

  border:
    1px solid
    var(--border);

  border-radius: 10px;
}


.edit-photo-image {
  width: 100%;

  aspect-ratio: 1 / 1;

  overflow: hidden;

  background: #f3f4f6;
}


.edit-photo-image img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;
}


.edit-image-fallback {
  width: 100%;
  height: 100%;

  display: flex;

  align-items: center;
  justify-content: center;

  color: #9ca3af;

  font-size: 10px;
}


/* =========================================================
   EDIT PHOTO FOOTER
========================================================= */

.edit-photo-card-footer {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 7px;

  padding: 7px 8px;

  border-top:
    1px solid
    var(--border-soft);

  font-size: 8px;
}


.edit-photo-card-footer span {
  min-width: 0;

  overflow: hidden;

  color: #8b95a5;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.edit-photo-new-label {
  display: inline-flex;

  align-items: center;

  padding: 2px 5px;

  border-radius: 999px;

  background: #111827;

  color: #ffffff !important;

  font-size: 7px !important;
  font-weight: 800;
}


/* =========================================================
   EDIT PHOTO REMOVE BUTTON
========================================================= */

.edit-photo-remove-button {
  flex: 0 0 auto;

  border:
    1px solid
    #fecaca;

  background: #ffffff;

  color: #b91c1c;

  padding:
    5px 9px;

  border-radius: 7px;

  font-size: 9px;
  font-weight: 750;

  line-height: 1.2;

  transition:
    background 0.15s ease,
    transform 0.1s ease;
}


.edit-photo-remove-button:hover {
  background: #fef2f2;
}


.edit-photo-remove-button:active {
  transform:
    translateY(1px);
}


/* =========================================================
   EDIT ADD PHOTOS
========================================================= */

.edit-photo-section
.custom-file-field {
  padding:
    9px 10px;
}


.edit-photo-section
.custom-file-button {
  padding:
    8px 12px;

  font-size: 11px;
}


.edit-photo-section
.custom-file-label {
  font-size: 10px;
}


/* =========================================================
   TABLET — EDIT PHOTO LAYOUT
========================================================= */

@media
(max-width: 900px) {

  .edit-post-modal {
    width:
      min(
        860px,
        calc(
          100vw - 28px
        )
      );

    max-width: 860px;
  }


  .edit-photo-grid {
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      );
  }

}


/* =========================================================
   MOBILE — EDIT MODAL + PHOTOS
========================================================= */

@media
(max-width: 760px) {

  /*
    Generic mobile modal behavior in Part 3
    makes modals bottom sheets.

    Edit Post gets a larger centered workspace
    so users can see more of the form.
  */

  .modal-backdrop:has(
    .edit-post-modal
  ) {
    align-items: center;

    padding: 10px;
  }


  .edit-post-modal {
    width: 100%;

    max-width: none;

    max-height:
      calc(
        100dvh - 20px
      );

    padding: 16px;

    border-radius: 16px;

    overflow-y: auto;
  }


  .edit-post-modal
  textarea {
    min-height: 135px;
  }


  /* -------------------------
     Event date/time
  ------------------------- */

  .event-datetime-row {
    grid-template-columns:
      1fr 1fr;
  }


  .event-datetime-row
  input {
    grid-column:
      1 / -1;
  }


  /* -------------------------
     New Post photos
  ------------------------- */

  #imagePreview {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap: 8px;
  }


  .post-photo-manage-image {
    aspect-ratio: 1 / 1;
  }


  .post-photo-remove-button {
    min-height: 32px;

    padding: 6px 7px;

    font-size: 10px;
  }


  /* -------------------------
     Edit photos
  ------------------------- */

  .edit-photo-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap: 8px;
  }


  .edit-photo-image {
    aspect-ratio: 1 / 1;
  }


  .edit-photo-card-footer {
    display: flex;

    flex-direction: column;

    align-items: stretch;

    gap: 5px;

    padding: 6px;
  }


  .edit-photo-card-footer
  span {
    display: block;

    margin: 0;

    font-size: 8px;
  }


  .edit-photo-remove-button {
    width: 100%;

    min-height: 28px;

    padding:
      5px 7px;

    font-size: 9px;

    text-align: center;
  }


  /* -------------------------
     Edit Add photos
  ------------------------- */

  .edit-photo-section
  .custom-file-field {
    flex-direction: row;

    align-items: center;
  }


  .edit-photo-section
  .custom-file-button {
    width: auto;

    min-height: 36px;
  }


  .edit-photo-section
  .custom-file-label {
    font-size: 9px;
  }


  /* -------------------------
     Sticky Cancel / Save
  ------------------------- */

  .edit-post-modal
  .modal-actions {
    position: sticky;

    bottom: -16px;

    z-index: 5;

    display: grid;

    grid-template-columns:
      1fr 1fr;

    margin:
      18px
      -16px
      -16px;

    padding:
      12px
      16px
      calc(
        12px +
        env(
          safe-area-inset-bottom
        )
      );

    background:
      rgba(
        255,
        255,
        255,
        0.97
      );

    border-top:
      1px solid
      var(--border);

    backdrop-filter:
      blur(12px);
  }


  .edit-post-modal
  .modal-actions
  button {
    width: 100%;
  }


  /* -------------------------
     Event detail
  ------------------------- */

  .event-detail-row {
    grid-template-columns:
      1fr;

    gap: 2px;
  }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media
(max-width: 420px) {

  .edit-post-modal {
    padding: 14px;
  }


  #imagePreview,
  .edit-photo-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );

    gap: 7px;
  }


  .edit-photo-card-footer {
    padding: 5px;
  }


  .edit-photo-remove-button {
    min-height: 27px;

    padding:
      5px 6px;

    font-size: 9px;
  }


  /*
    Hide helper text on tiny screens
    to keep the Add photos row compact.
  */

  .edit-photo-section
  .custom-file-label {
    display: none;
  }


  .edit-post-modal
  .modal-actions {
    margin:
      16px
      -14px
      -14px;

    padding:
      10px
      14px
      calc(
        10px +
        env(
          safe-area-inset-bottom
        )
      );
  }

}

/* =========================================================
   BLOCK USER
========================================================= */

.post-block-button {
  color: #b91c1c;
}


.post-block-button:hover {
  color: #991b1b;

  background: #fef2f2;
}


.post-block-button.is-unblock {
  color: #4b5563;
}


.post-block-button.is-unblock:hover {
  color: #111827;

  background: #f3f4f6;
}


/* =========================================================
   BLOCKED USERS MODAL
========================================================= */

.blocked-users-modal {
  max-width: 500px;
}


.blocked-users-list {
  display: flex;

  flex-direction: column;

  gap: 8px;

  margin-top: 14px;
}


.blocked-user-row {
  display: flex;

  align-items: center;

  gap: 10px;

  padding: 11px 12px;

  border:
    1px solid
    var(--border);

  border-radius: 11px;

  background: #ffffff;
}


.blocked-user-avatar {
  width: 36px;
  height: 36px;

  flex:
    0 0 36px;

  display: flex;

  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #f1f3f5;

  color: #374151;

  font-size: 12px;
  font-weight: 800;
}


.blocked-user-info {
  flex: 1;

  min-width: 0;

  display: flex;

  flex-direction: column;

  gap: 2px;
}


.blocked-user-info strong {
  overflow: hidden;

  font-size: 12px;

  text-overflow: ellipsis;

  white-space: nowrap;
}


.blocked-user-info span {
  color: #9ca3af;

  font-size: 9px;
}


.blocked-user-unblock-button {
  flex: 0 0 auto;

  padding: 6px 9px;

  font-size: 10px;
}


.blocked-users-empty {
  min-height: 130px;

  display: flex;

  flex-direction: column;

  align-items: center;
  justify-content: center;

  gap: 4px;

  padding: 20px;

  color: #9ca3af;

  border:
    1px dashed
    var(--border);

  border-radius: 11px;

  text-align: center;
}


.blocked-users-empty strong {
  color: #4b5563;

  font-size: 12px;
}


.blocked-users-empty span {
  font-size: 10px;
}


/* =========================================================
   MOBILE BLOCK UI
========================================================= */

@media (max-width: 760px) {

  .blocked-users-modal {
    width: 100%;

    max-width: none;
  }


  .blocked-user-row {
    padding: 10px;
  }


  .blocked-user-unblock-button {
    min-height: 34px;
  }

}

/* =========================================================
   BOARD FILTER + SORT
========================================================= */

.board-filter-select {
  flex: 0 1 175px;

  width: auto;
  min-width: 150px;

  background: #ffffff;

  color: #374151;

  font-size: 11px;
  font-weight: 650;
}


.board-sort-select {
  flex-basis: 155px;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 980px) {

  .board-search {
    display: grid;

    grid-template-columns:
      minmax(0, 1fr)
      160px
      150px
      auto;

    gap: 7px;
  }


  .board-filter-select {
    width: 100%;

    min-width: 0;
  }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 760px) {

  .board-search {
    display: grid;

    grid-template-columns:
      1fr 1fr;

    gap: 7px;
  }


  #searchInput {
    grid-column:
      1 / -1;
  }


  #boardCategoryFilter,
  #boardSortSelect {
    width: 100%;

    min-width: 0;
  }


  #searchBtn {
    grid-column:
      1 / 2;

    width: 100%;
  }


  #clearSearchBtn {
    grid-column:
      2 / 3;

    justify-self: stretch;

    width: 100%;

    border:
      1px solid
      var(--border);

    border-radius: 9px;

    background: #ffffff;
  }

}
