/* ==========================================================================
   Community Cafe UI Design System
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
  --theme-primary: #03c75a;
  --theme-primary-hover: #02b150;
  --theme-primary-dark: #009e44;
  --theme-primary-light: #e8f9ed;
  --theme-bg: #f5f6f8;
  --theme-border: #ebeef1;
  --theme-border-dark: #d3d8df;
  --theme-text-main: #222222;
  --theme-text-sub: #666666;
  --theme-text-muted: #8e8e8e;
  --theme-point-red: #f4361e;
  --theme-point-blue: #0988ff;
  --theme-card-bg: #ffffff;
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Reset & Global */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

body {
  font-family: var(--font-family);
  background-color: var(--theme-bg);
  color: var(--theme-text-main);
  line-height: 1.5;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

ul,
ol {
  list-style: none;
}

.hidden {
  display: none !important;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Utility Helpers */
.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1 {
  gap: 4px;
}

.gap-1\.5 {
  gap: 6px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.h-full {
  height: 100%;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-1\.5 {
  margin-bottom: 6px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mr-1 {
  margin-right: 4px;
}

.mr-1\.5 {
  margin-right: 6px;
}

.mr-2 {
  margin-right: 8px;
}

.w-4 {
  width: 16px;
}

.h-4 {
  height: 16px;
}

.w-5 {
  width: 20px;
}

.h-5 {
  height: 20px;
}

.w-16 {
  width: 64px;
}

.h-16 {
  height: 64px;
}

.rounded-full {
  border-radius: 9999px;
}

.text-xs {
  font-size: 11px;
}

.text-sm {
  font-size: 13px;
}

.text-base {
  font-size: 15px;
}

.text-lg {
  font-size: 18px;
}

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

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-green-500 {
  color: #10b981;
}

.text-green-600 {
  color: var(--theme-primary);
}

.text-green-800 {
  color: #065f46;
}

.text-emerald-600 {
  color: #059669;
}

.text-red-500 {
  color: #ef4444;
}

.text-blue-500 {
  color: #3b82f6;
}

.text-yellow-200 {
  color: #fef08a;
}

.text-yellow-300 {
  color: #fde047;
}

.text-gray-300 {
  color: #d1d5db;
}

.text-gray-400 {
  color: #9ca3af;
}

.text-gray-500 {
  color: #6b7280;
}

.text-gray-600 {
  color: #4b5563;
}

.text-gray-700 {
  color: #374151;
}

.text-gray-800 {
  color: #1f2937;
}

.text-gray-900 {
  color: #111827;
}

.bg-gray-100 {
  background-color: #f3f4f6;
}

.bg-green-50 {
  background-color: #ecfdf5;
}

.border-green-500 {
  border-color: var(--theme-primary);
}

.border-2 {
  border-width: 2px;
  border-style: solid;
}

.hover\:underline:hover {
  text-decoration: underline;
}

/* ==========================================================================
   1. GNB (Global Navigation Bar)
   ========================================================================== */
.app-gnb {
  background-color: #ffffff;
  border-bottom: 1px solid var(--theme-border);
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.gnb-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.gnb-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-logo-badge {
  background-color: var(--theme-primary);
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.cafe-logo-title {
  font-size: 16px;
  font-weight: 800;
  color: #111;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.5px;
}

.cafe-logo-title .cafe-tag {
  color: var(--theme-primary);
  font-weight: 800;
}

.gnb-center {
  flex: 1;
  max-width: 380px;
  margin: 0 20px;
}

.gnb-search-box {
  display: flex;
  align-items: center;
  border: 2px solid var(--theme-primary);
  border-radius: 20px;
  padding: 4px 12px;
  background: #ffffff;
  transition: box-shadow 0.2s;
}

.gnb-search-box:focus-within {
  box-shadow: 0 0 0 3px rgba(3, 199, 90, 0.15);
}

.gnb-search-box input {
  border: none;
  width: 100%;
  padding: 2px 6px;
}

.gnb-search-box button {
  color: var(--theme-primary);
  font-size: 14px;
  padding: 2px 4px;
}

.gnb-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gnb-auth-guest {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-gnb-login {
  border: 1px solid var(--theme-border-dark);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  background: #ffffff;
  transition: all 0.15s;
}

.btn-gnb-login:hover {
  border-color: var(--theme-primary);
  color: var(--theme-primary);
}

.btn-gnb-signup {
  background: var(--theme-primary);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  transition: all 0.15s;
}

.btn-gnb-signup:hover {
  background: var(--theme-primary-hover);
}

.gnb-auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gnb-user-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 3px 4px;
  background: #f7f9fa;
  border: 1px solid var(--theme-border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.gnb-user-pill:hover {
  border-color: var(--theme-primary);
  background: #ffffff;
}

.gnb-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e9ecef;
}

.gnb-user-name {
  font-weight: 700;
  font-size: 12px;
  color: #333;
}

.gnb-user-grade-tag {
  font-size: 10px;
  background: #e8f9ed;
  color: var(--theme-primary-dark);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.gnb-user-grade-tag.grade-manager {
  background: #fef3c7;
  color: #b45309;
}

.btn-gnb-logout {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #666;
  border: 1px solid var(--theme-border);
  background: #fff;
  transition: all 0.15s;
}

.btn-gnb-logout:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

/* ==========================================================================
   2. Cafe Header & Banner
   ========================================================================== */
.cafe-header-section {
  width: 100%;
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 16px;
  box-sizing: border-box;
}

.cafe-banner-card {
  width: 100%;
  background: linear-gradient(135deg, #03c75a 0%, #00a843 50%, #048237 100%);
  border-radius: var(--radius-md);
  color: #ffffff;
  padding: 24px 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.cafe-banner-card::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -40px;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.cafe-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cafe-title-main {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cafe-sub-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 6px;
}

.cafe-header-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  flex-wrap: wrap;
}

.cafe-stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cafe-stat-item strong {
  font-size: 13px;
  font-weight: 700;
}

/* ==========================================================================
   3. Main Cafe Layout (Sidebar & Content)
   ========================================================================== */
.cafe-main-container {
  width: 100%;
  max-width: 1100px;
  margin: 16px auto 40px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
  box-sizing: border-box;
}

/* ==========================================================================
   4. Sidebar Styles
   ========================================================================== */
.cafe-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

/* Profile Box */
.my-profile-box {
  text-align: center;
}

.profile-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--theme-primary);
  background: #f8f9fa;
}

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}

.profile-nickname {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.profile-grade-badge {
  font-size: 11px;
  color: var(--theme-primary-dark);
  background: var(--theme-primary-light);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.profile-grade-badge.badge-manager,
.detail-grade-tag.grade-manager,
.comment-badge.grade-manager {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a;
  font-weight: 700;
}

.btn-change-nickname {
  font-size: 11px;
  color: var(--theme-text-sub);
  padding: 3px 8px;
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  margin-top: 4px;
  transition: all 0.15s;
}

.btn-change-nickname:hover {
  border-color: var(--theme-primary);
  color: var(--theme-primary);
  background: #f8fdf9;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--theme-border);
  text-align: center;
}

.stat-box-title {
  font-size: 11px;
  color: var(--theme-text-muted);
}

.stat-box-value {
  font-size: 13px;
  font-weight: 700;
  color: #222;
  margin-top: 2px;
}

.profile-quick-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.btn-profile-filter {
  flex: 1;
  padding: 6px;
  font-size: 11px;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  background: #fbfbfc;
  color: #444;
  transition: all 0.15s;
}

.btn-profile-filter:hover {
  background: #f1f3f5;
  color: #111;
}

.btn-profile-logout {
  padding: 6px 10px;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  background: #fbfbfc;
  color: #777;
  transition: all 0.15s;
}

.btn-profile-logout:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

/* Guest Profile Box */
.guest-profile-box {
  text-align: center;
  padding: 18px 14px;
  background: #fafbfc;
}

.guest-avatar-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e9ecef;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 10px;
}

.guest-title {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  margin-bottom: 4px;
}

.guest-desc {
  font-size: 11px;
  color: #777;
  line-height: 1.4;
  margin-bottom: 12px;
}

.guest-action-buttons {
  display: flex;
  gap: 6px;
}

.btn-guest-login {
  flex: 1;
  padding: 7px;
  background: #ffffff;
  border: 1px solid var(--theme-border-dark);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  transition: all 0.15s;
}

.btn-guest-login:hover {
  border-color: var(--theme-primary);
  color: var(--theme-primary);
}

.btn-guest-signup {
  flex: 1;
  padding: 7px;
  background: var(--theme-primary);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  transition: all 0.15s;
}

.btn-guest-signup:hover {
  background: var(--theme-primary-hover);
}

/* Primary Write Button */
.btn-cafe-write-primary {
  width: 100%;
  background-color: var(--theme-primary);
  color: #ffffff;
  padding: 13px 0;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 3px 8px rgba(3, 199, 90, 0.3);
  transition: all 0.2s ease;
}

.btn-cafe-write-primary:hover {
  background-color: var(--theme-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(3, 199, 90, 0.35);
}

.btn-cafe-write-primary:active {
  transform: translateY(0);
}

/* Menu List */
.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.board-menu-list {
  display: flex;
  flex-direction: column;
}

.board-menu-item {
  border-radius: 6px;
  transition: background 0.15s;
}

.board-menu-item.active {
  background-color: var(--theme-primary-light);
  font-weight: 700;
}

.board-menu-item.active .board-name {
  color: var(--theme-primary-dark);
}

.board-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 13px;
  color: #333;
}

.board-menu-item:hover:not(.active) {
  background-color: #f7f9fa;
}

.board-count {
  font-size: 11px;
  color: var(--theme-text-muted);
}

/* Chat Sidebar Widget */
.sidebar-chat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.sidebar-chat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-chat-item:hover {
  background: #eef2f5;
  color: var(--theme-primary-dark);
}

.chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--theme-primary);
  flex-shrink: 0;
}

.chat-title {
  flex: 1;
}

.chat-members {
  font-size: 11px;
  color: var(--theme-text-muted);
}

.btn-open-create-room-sidebar {
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px dashed var(--theme-primary);
  color: var(--theme-primary-dark);
  border-radius: 4px;
  background: #ffffff;
  transition: background 0.15s;
}

.btn-open-create-room-sidebar:hover {
  background: var(--theme-primary-light);
}

/* ==========================================================================
   5. Main Content Area
   ========================================================================== */
.cafe-content-card {
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  min-height: 600px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* View 1: Post List View */
.board-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid #222;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.board-title-group h2 {
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.board-title-group p {
  font-size: 12px;
  color: var(--theme-text-sub);
  margin-top: 2px;
}

.board-filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cafe-select {
  padding: 5px 8px;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  font-size: 12px;
  color: #333;
  background-color: #fff;
}

.cafe-select:focus {
  border-color: var(--theme-primary);
}

/* Post Table */
.post-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.post-table th {
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid var(--theme-border-dark);
  background: #fbfbfc;
  white-space: nowrap;
}

.post-table td {
  padding: 12px 8px;
  font-size: 13px;
  border-bottom: 1px solid var(--theme-border);
  color: #333;
}

.post-row {
  cursor: pointer;
  transition: background 0.1s;
}

.post-row:hover {
  background-color: #f9fbfd;
}

.post-row.is-notice {
  background-color: #fffbfb;
}

.post-row.is-notice .post-title-link {
  font-weight: 700;
  color: #000;
}

.col-num {
  width: 52px;
  white-space: nowrap;
}

.col-title {
  width: auto;
}

.col-author {
  width: 125px;
  white-space: nowrap;
}

.col-date {
  width: 80px;
  white-space: nowrap;
}

.col-views {
  width: 55px;
  white-space: nowrap;
}

.col-likes {
  width: 50px;
  white-space: nowrap;
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  white-space: nowrap;
}

.post-title-link {
  display: inline-block;
  color: var(--theme-text-main);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}

.post-title-link:hover {
  text-decoration: underline;
}

.post-has-image-badge {
  color: #666;
  font-size: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge-notice {
  display: inline-block;
  background: #fff0ef;
  color: var(--theme-point-red);
  font-weight: 700;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid #ffdcd9;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-new {
  display: inline-block;
  background: var(--theme-point-red);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 2px;
  flex-shrink: 0;
}

.comment-count-badge {
  color: var(--theme-point-red);
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.board-category-tag {
  color: var(--theme-text-muted);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
}

/* Pagination */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 28px 0 20px;
}

.page-btn {
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #444;
}

.page-btn:hover {
  background: #f1f3f5;
}

.page-btn.active {
  font-weight: 700;
  color: var(--theme-primary-dark);
  border-color: var(--theme-primary);
  background: var(--theme-primary-light);
}

.page-nav-btn {
  border-color: var(--theme-border);
}

/* Bottom Search Bar */
.bottom-search-section {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--theme-border);
  width: 100%;
}

.bottom-search-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 460px;
}

.bottom-search-form select {
  max-width: 110px;
  flex-shrink: 0;
}

.bottom-search-form input {
  padding: 6px 12px;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  flex: 1;
  min-width: 110px;
  max-width: 100%;
}

.bottom-search-form input:focus {
  border-color: var(--theme-primary);
}

.btn-search-primary {
  padding: 6px 14px;
  background: #f7f9fa;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

.btn-search-primary:hover {
  background: #eef1f4;
}

/* ==========================================================================
   6. View 2: Post Detail View
   ========================================================================== */
.post-detail-wrap {
  padding: 4px 0;
}

.detail-category-link {
  color: var(--theme-primary);
  font-weight: 700;
  font-size: 13px;
  display: inline-block;
  margin-bottom: 8px;
}

.detail-category-link:hover {
  text-decoration: underline;
}

.detail-post-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: #111;
  margin-bottom: 16px;
}

.detail-author-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--theme-border);
  border-bottom: 1px solid var(--theme-border);
  margin-bottom: 24px;
}

.detail-author-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f0f2f5;
}

.detail-author-info {
  display: flex;
  flex-direction: column;
}

.detail-author-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-author-nickname {
  font-weight: 700;
  font-size: 13px;
  color: #222;
}

.detail-grade-tag {
  font-size: 10px;
  color: var(--theme-primary-dark);
  background: var(--theme-primary-light);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}

.detail-meta-row {
  font-size: 11px;
  color: var(--theme-text-muted);
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.detail-author-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-action {
  font-size: 12px;
  color: var(--theme-text-sub);
  padding: 4px 8px;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
}

.btn-icon-action:hover {
  background: #f7f9fa;
  color: #111;
}

.btn-text-danger {
  color: var(--theme-point-red);
  padding: 4px 8px;
  border: 1px solid #ffdcd9;
  border-radius: 4px;
  background: #fff5f5;
}

.btn-text-danger:hover {
  background: #ffe8e8;
}

/* Post Content Body */
.detail-content-body {
  font-size: 15px;
  line-height: 1.8;
  color: #222;
  min-height: 180px;
  margin-bottom: 28px;
  word-break: break-word;
}

.detail-content-body p {
  margin-bottom: 12px;
}

.detail-content-body blockquote {
  border-left: 4px solid var(--theme-primary);
  background: #f8faf9;
  padding: 12px 16px;
  margin: 14px 0;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  color: #444;
}

.detail-content-body code {
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
  color: #d63384;
}

.detail-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.tag-chip {
  background: #f1f3f5;
  color: #555;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 14px;
}

/* Like & Share Action Area */
.detail-reactions-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--theme-border);
  border-bottom: 1px solid var(--theme-border);
}

.btn-like-heart {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px solid var(--theme-border);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 700;
  color: #444;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.btn-like-heart i {
  font-size: 16px;
  color: #aaa;
  transition: all 0.2s;
}

.btn-like-heart:hover {
  border-color: #ffd2cc;
  background: #fffafa;
}

.btn-like-heart.liked {
  border-color: var(--theme-point-red);
  color: var(--theme-point-red);
  background: #fff5f5;
}

.btn-like-heart.liked i {
  color: var(--theme-point-red);
  animation: heartPop 0.3s ease;
}

@keyframes heartPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.35);
  }

  100% {
    transform: scale(1);
  }
}

/* Comments Section */
.detail-comments-section {
  margin-top: 24px;
}

.comments-header-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 16px;
}

.comments-list {
  display: flex;
  flex-direction: column;
}

.comment-item {
  border-bottom: 1px solid var(--theme-border);
  padding: 14px 0;
}

.comment-main {
  display: flex;
  gap: 10px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e9ecef;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 700;
  font-size: 13px;
  color: #222;
}

.comment-badge {
  font-size: 10px;
  background: #f1f3f5;
  color: #666;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

.comment-date {
  font-size: 11px;
  color: var(--theme-text-muted);
  margin-left: 4px;
  white-space: nowrap;
}

.comment-text {
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

.comment-actions {
  display: flex;
  gap: 10px;
  font-size: 11px;
}

.btn-reply-toggle {
  color: var(--theme-text-sub);
}

.btn-reply-toggle:hover {
  color: var(--theme-primary-dark);
}

/* Nested Replies */
.replies-list {
  margin-left: 28px;
  margin-top: 10px;
  background: #f8fafc;
  border-radius: 6px;
  padding: 4px 12px;
}

.reply-item {
  border-bottom: 1px solid #edf1f5;
  padding: 10px 0;
}

.reply-item:last-child {
  border-bottom: none;
}

.reply-icon {
  margin-right: 4px;
  color: #aaa;
}

.reply-form-container {
  margin-left: 36px;
  margin-top: 10px;
}

.reply-input-box {
  background: #f8f9fa;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  padding: 10px;
}

.reply-textarea {
  width: 100%;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  padding: 6px 8px;
  resize: vertical;
  background: #ffffff;
}

/* Main Comment Input Form */
.comment-write-box {
  margin-top: 20px;
  background: #f9fbfd;
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.comment-write-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.comment-write-textarea {
  width: 100%;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  padding: 10px;
  resize: vertical;
  min-height: 70px;
  background: #ffffff;
}

.comment-write-textarea:focus {
  border-color: var(--theme-primary);
}

.comment-write-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-primary-action {
  background: var(--theme-primary);
  color: #ffffff;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 13px;
  transition: background 0.15s;
}

.btn-primary-action:hover {
  background: var(--theme-primary-hover);
}

/* Detail Bottom Nav */
.detail-bottom-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--theme-border);
}

/* ==========================================================================
   7. View 3: Post Editor View
   ========================================================================== */
.editor-wrap {
  padding: 4px 0;
}

.editor-header-bar {
  border-bottom: 2px solid #222;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.editor-header-bar h2 {
  font-size: 18px;
  font-weight: 700;
}

.editor-form-row {
  margin-bottom: 14px;
}

.editor-select-category {
  width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  font-weight: 600;
}

.editor-title-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  background: #ffffff;
}

.editor-title-input:focus {
  border-color: var(--theme-primary);
}

/* Formatting Toolbar */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid var(--theme-border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 6px 8px;
}

.editor-tool-btn {
  width: 32px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 13px;
  color: #444;
  transition: background 0.15s;
}

.editor-tool-btn:hover {
  background: #e2e8f0;
  color: #000;
}

.toolbar-separator {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
  margin: 0 4px;
}

.editor-content-area {
  min-height: 320px;
  border: 1px solid var(--theme-border);
  border-radius: 0 0 6px 6px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
  outline: none;
  background: #ffffff;
}

.editor-content-area:focus {
  border-color: var(--theme-primary);
}

.editor-content-area:empty:before {
  content: '자유롭게 글을 작성해보세요. 서식 툴바를 이용해 텍스트를 꾸미거나 이미지를 넣을 수 있습니다.';
  color: #aaa;
}

.editor-tags-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
  font-size: 13px;
}

.editor-footer-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--theme-border);
}

.btn-secondary {
  padding: 9px 20px;
  border: 1px solid var(--theme-border);
  background: #ffffff;
  color: #555;
  border-radius: 4px;
  font-weight: 600;
}

.btn-secondary:hover {
  background: #f7f9fa;
  color: #222;
}

/* Image Attachment Styles (Max 2 images) */
.attached-images-section {
  background: #f8fafc;
  border-left: 1px solid var(--theme-border);
  border-right: 1px solid var(--theme-border);
  padding: 10px 14px;
  border-bottom: 1px dashed var(--theme-border);
}

.attached-images-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-add-photo-trigger {
  font-size: 11px;
  color: var(--theme-primary-dark);
  background: var(--theme-primary-light);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid rgba(3, 199, 90, 0.3);
  transition: all 0.15s;
}

.btn-add-photo-trigger:hover {
  background: #dcf5e3;
}

.attached-images-grid {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.attached-image-card {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--theme-border-dark);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.attached-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-image {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background 0.15s;
}

.btn-remove-image:hover {
  background: var(--theme-point-red);
}

/* Detail View Attached Images Gallery */
.detail-attached-images-wrap {
  margin: 20px 0 24px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
}

.detail-attached-images-title {
  font-size: 12px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
}

.detail-images-gallery {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-gallery-img {
  max-width: calc(50% - 8px);
  max-height: 420px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--theme-border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s;
}

.detail-gallery-img:hover {
  transform: scale(1.02);
}

.post-has-image-badge {
  color: #0988ff;
  font-size: 11px;
  margin-left: 3px;
}

/* ==========================================================================
   8. Cafe Chat Modal & Popup
   ========================================================================== */
.cafe-chat-popup {
  position: fixed;
  bottom: 24px;
  right: 28px;
  width: 380px;
  height: 540px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 2000;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cafe-chat-popup.minimized {
  height: 48px;
}

.cafe-chat-header {
  background: var(--theme-primary);
  color: #ffffff;
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  user-select: none;
}

.chat-header-title-text {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-ctrl-btn {
  color: #ffffff;
  opacity: 0.85;
  padding: 4px;
  font-size: 13px;
  transition: opacity 0.15s;
}

.chat-ctrl-btn:hover {
  opacity: 1;
}

/* Chat Body */
.chat-body-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f4f6f8;
}

/* Room List View */
.chat-room-list-header {
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--theme-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-room-scroll-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-room-item {
  display: flex;
  gap: 10px;
  background: #ffffff;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--theme-border);
  cursor: pointer;
  transition: all 0.15s;
}

.chat-room-item:hover {
  border-color: var(--theme-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.chat-room-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--theme-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.chat-room-info {
  flex: 1;
  min-width: 0;
}

.chat-room-title {
  font-weight: 700;
  font-size: 13px;
  color: #222;
}

.chat-room-time {
  font-size: 10px;
  color: var(--theme-text-muted);
}

.chat-room-last-msg {
  font-size: 12px;
  color: var(--theme-text-sub);
  display: block;
}

.chat-room-count {
  font-size: 11px;
  color: var(--theme-primary-dark);
  font-weight: 600;
}

/* Inside Room Chat View */
.chat-inside-header {
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--theme-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-system-msg {
  text-align: center;
  margin: 6px 0;
}

.chat-system-msg span {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.06);
  color: #666;
  padding: 3px 10px;
  border-radius: 12px;
}

/* Message Bubble Rows */
.chat-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.chat-bubble-row.my-msg {
  justify-content: flex-end;
}

.chat-bubble-row.my-msg .chat-bubble-text {
  background: var(--theme-primary);
  color: #ffffff;
  border-radius: 14px 14px 2px 14px;
}

.chat-bubble-row.other-msg {
  justify-content: flex-start;
}

.chat-bubble-row.other-msg .chat-bubble-text {
  background: #ffffff;
  color: #222;
  border-radius: 14px 14px 14px 2px;
  border: 1px solid var(--theme-border);
}

.chat-sender-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e5e8eb;
  flex-shrink: 0;
  align-self: flex-start;
}

.chat-bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.chat-sender-name {
  font-size: 11px;
  color: #666;
  font-weight: 600;
  margin-bottom: 3px;
  margin-left: 2px;
}

.chat-bubble-text {
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chat-msg-time {
  font-size: 10px;
  color: #999;
  flex-shrink: 0;
  margin-bottom: 2px;
}

/* Chat Input Bar */
.chat-input-bar {
  background: #ffffff;
  border-top: 1px solid var(--theme-border);
  padding: 8px 10px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  border: 1px solid var(--theme-border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
}

.chat-input-field:focus {
  border-color: var(--theme-primary);
}

.btn-send-chat {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--theme-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 0.15s;
}

.btn-send-chat:hover {
  background: var(--theme-primary-hover);
}

/* ==========================================================================
   9. Modals (Nickname & Create Room)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  backdrop-filter: blur(2px);
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 420px;
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--theme-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #111;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--theme-border);
  background: #fbfbfc;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #444;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--theme-border);
  border-radius: 4px;
}

.form-control:focus {
  border-color: var(--theme-primary);
}

/* Footer */
.app-cafe-footer {
  background: #ffffff;
  border-top: 1px solid var(--theme-border);
  padding: 30px 16px;
  margin-top: 40px;
  text-align: center;
  color: var(--theme-text-muted);
  font-size: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
  font-weight: 600;
  color: #555;
}

/* Default Desktop Hidden State for Mobile-only Elements */
.btn-mobile-menu {
  display: none;
}

.btn-mobile-search-toggle {
  display: none;
}

.mobile-search-dropdown {
  display: none;
}

.mobile-sidebar-header {
  display: none;
}

.mobile-sidebar-backdrop {
  display: none;
}

.mobile-fab-write {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

.post-mobile-thumb {
  display: none;
}

.post-mobile-meta {
  display: none;
}

.post-title-main-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

/* ==========================================================================
   10. Mobile & Tablet Responsive Experience (가로폭 완벽 보정)
   ========================================================================== */
@media (max-width: 960px) {

  /* Body & General Spacing */
  body {
    padding-bottom: 65px;
    /* Bottom Nav buffer */
    background-color: #f7f9fa;
  }

  body.no-scroll {
    overflow: hidden;
  }

  .cafe-header-section {
    padding: 0 12px;
    margin-top: 10px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .cafe-banner-card {
    padding: 18px 14px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .cafe-title-main {
    font-size: 17px;
  }

  .cafe-sub-desc {
    font-size: 11.5px;
    margin-top: 4px;
    opacity: 0.9;
  }

  .cafe-header-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 11px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .cafe-main-container {
    grid-template-columns: 1fr;
    padding: 0 12px;
    margin-top: 10px;
    margin-bottom: 24px;
    gap: 12px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .cafe-content-card {
    padding: 14px 12px;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
    min-height: auto;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* 1. Mobile GNB */
  .app-gnb {
    height: 52px;
    padding: 0 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
  }

  .gnb-inner {
    padding: 0;
    width: 100%;
    max-width: 100%;
  }

  .btn-mobile-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 18px;
    color: #222;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    margin-right: 4px;
  }

  .btn-mobile-menu:active {
    background-color: #f0f2f5;
  }

  .gnb-center {
    display: none;
  }

  .btn-mobile-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 16px;
    color: #444;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 50%;
  }

  .btn-mobile-search-toggle:active {
    background-color: #f0f2f5;
  }

  .gnb-action-btn {
    display: none;
  }

  .btn-gnb-login,
  .btn-gnb-signup {
    padding: 4px 9px;
    font-size: 11.5px;
  }

  .btn-gnb-logout {
    display: none;
  }

  .gnb-user-name,
  .gnb-user-grade-tag {
    display: none;
  }

  .gnb-user-pill {
    padding: 2px;
    background: transparent;
    border: none;
  }

  /* Mobile Dropdown Search Box */
  .mobile-search-dropdown {
    display: block;
    position: absolute;
    top: 52px;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid var(--theme-border);
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 99;
    box-sizing: border-box;
  }

  .mobile-search-dropdown.hidden {
    display: none;
  }

  .mobile-search-form {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .mobile-search-form input {
    flex: 1;
    height: 38px;
    border: 1px solid var(--theme-border-dark);
    border-radius: 20px;
    padding: 0 16px;
    font-size: 13px;
    outline: none;
    min-width: 0;
  }

  .mobile-search-form input:focus {
    border-color: var(--theme-primary);
  }

  .mobile-search-form button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  /* 2. Mobile Sidebar Slide Drawer */
  .mobile-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
  }

  .mobile-sidebar-backdrop.hidden {
    display: none;
  }

  .cafe-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(290px, 82vw);
    height: 100vh;
    background: #ffffff;
    z-index: 1001;
    overflow-y: auto;
    padding: 16px 14px 70px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
  }

  .cafe-sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--theme-border);
  }

  .mobile-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #111;
  }

  .btn-close-mobile-sidebar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f3f5;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
  }

  .sidebar-write-box {
    display: none;
  }

  /* 3. Mobile Post List Card/Feed View */
  .board-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 10px;
  }

  .board-header-tools {
    width: 100%;
    justify-content: space-between;
  }

  .post-table {
    display: block;
    width: 100%;
    table-layout: auto;
  }

  .post-table thead {
    display: none;
  }

  .post-table tbody {
    display: block;
    width: 100%;
  }

  .post-row {
    display: block;
    width: 100%;
    padding: 13px 2px;
    border-bottom: 1px solid #f0f2f5;
    box-sizing: border-box;
  }

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

  .post-row:hover {
    background-color: transparent;
  }

  .post-row:active {
    background-color: #f7faf8;
  }

  .col-num,
  .col-author,
  .col-date,
  .col-views,
  .col-likes {
    display: none !important;
  }

  .col-title {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
  }

  .post-title-main-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }

  .title-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .post-title-link {
    font-size: 14.5px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    display: inline;
    word-break: break-word;
  }

  .board-category-tag {
    font-size: 11px;
    color: var(--theme-primary-dark);
    background: var(--theme-primary-light);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-right: 2px;
    white-space: nowrap;
    display: inline-block;
  }

  .post-mobile-thumb {
    display: block;
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eaecef;
    flex-shrink: 0;
  }

  .post-mobile-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #777;
    margin-top: 6px;
    flex-wrap: wrap;
    line-height: 1.4;
  }

  .m-author {
    color: #4b5563;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
  }

  .m-author-name {
    display: inline-block;
    word-break: break-all;
  }

  .m-dot {
    color: #d1d5db;
    font-size: 10px;
    user-select: none;
    margin: 0 1px;
  }

  .m-date,
  .m-views,
  .m-likes {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }

  /* 4. Mobile Floating Action Button (FAB) */
  .mobile-fab-write {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 16px;
    bottom: 74px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-dark));
    color: #ffffff;
    font-size: 19px;
    box-shadow: 0 4px 16px rgba(3, 199, 90, 0.4);
    border: none;
    z-index: 90;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .mobile-fab-write:active {
    transform: scale(0.9);
  }

  /* 5. Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 58px;
    background: #ffffff;
    border-top: 1px solid var(--theme-border);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
  }

  .m-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: #8e959e;
    font-size: 10px;
    gap: 3px;
    cursor: pointer;
    transition: color 0.15s;
    text-decoration: none;
  }

  .m-nav-item i {
    font-size: 17px;
  }

  .m-nav-item.active {
    color: var(--theme-primary);
    font-weight: 700;
  }

  .m-nav-item.m-nav-write-btn {
    position: relative;
    top: -7px;
  }

  .m-write-icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(3, 199, 90, 0.35);
    border: 2px solid #ffffff;
  }

  /* 6. Mobile Post Detail View */
  .post-detail-header {
    padding-bottom: 12px;
  }

  .post-detail-title {
    font-size: 18px;
    line-height: 1.35;
    word-break: break-word;
  }

  .detail-author-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .detail-right-stats {
    width: 100%;
    justify-content: space-between;
    font-size: 12px;
    flex-wrap: wrap;
  }

  .post-detail-body {
    font-size: 14.5px;
    line-height: 1.65;
    padding: 16px 0;
    word-break: break-word;
  }

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

  .detail-gallery-img {
    max-height: 280px;
    width: 100%;
    object-fit: cover;
  }

  .detail-reaction-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .detail-reaction-bar>div {
    display: flex;
    justify-content: center;
  }

  /* Mobile Comments & Nested Replies Spacing */
  .replies-list {
    margin-left: 14px;
    padding: 4px 8px;
  }

  .reply-form-container {
    margin-left: 14px;
  }

  /* 7. Mobile Write Form */
  .editor-select-category {
    width: 100%;
    max-width: 100%;
  }

  .editor-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
  }

  .editor-tool-btn {
    flex-shrink: 0;
  }

  .attached-images-preview-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* 8. Mobile Live Chat Popup */
  .cafe-chat-popup {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    bottom: 0;
    right: 0;
    z-index: 1050;
  }

  .cafe-chat-popup.minimized {
    display: none;
  }

  /* ==========================================================================
   Prefix (말머리) System
   ========================================================================== */
  .prefix-filter-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid var(--theme-border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .prefix-filter-wrap::-webkit-scrollbar {
    display: none;
  }

  .prefix-tab-btn {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    background: #ffffff;
    border: 1px solid var(--theme-border-dark);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
  }

  .prefix-tab-btn:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
  }

  .prefix-tab-btn.active {
    background: var(--theme-primary);
    color: #ffffff;
    border-color: var(--theme-primary);
  }

  .post-prefix {
    color: #009e44;
    font-weight: 700;
    margin-right: 4px;
    font-size: 12px;
    display: inline-block;
    flex-shrink: 0;
  }

  .detail-prefix-tag {
    color: var(--theme-primary-dark);
    font-weight: 800;
    margin-right: 6px;
    display: inline-block;
  }

  .editor-select-prefix {
    padding: 6px 10px;
    border: 1px solid var(--theme-border-dark);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: #333;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    outline: none;
  }

  .editor-select-prefix:focus {
    border-color: var(--theme-primary);
  }

  /* ==========================================================================
   Previous / Next Post Navigation Card
   ========================================================================== */
  .detail-prev-next-card {
    border-top: 1px solid var(--theme-border);
    border-bottom: 1px solid var(--theme-border);
    margin-top: 24px;
    background: #ffffff;
  }

  .prev-next-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 12px;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    transition: background 0.15s;
  }

  .prev-next-row:last-child {
    border-bottom: none;
  }

  .prev-next-row:hover:not(.disabled) {
    background-color: #f7faf8;
  }

  .prev-next-row.disabled {
    cursor: default;
    color: #adb5bd;
  }

  .prev-next-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
  }

  .prev-next-tag {
    font-weight: 700;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 65px;
    flex-shrink: 0;
  }

  .prev-next-row.disabled .prev-next-tag {
    color: #adb5bd;
  }

  .prev-next-title {
    color: #222;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .prev-next-row:hover:not(.disabled) .prev-next-title {
    color: var(--theme-primary);
    text-decoration: underline;
  }

  .prev-next-date {
    font-size: 11px;
    color: #888;
    flex-shrink: 0;
    margin-left: 12px;
  }

  /* ==========================================================================
   Same Board Mini Post List Table
   ========================================================================== */
  .detail-mini-posts-section {
    margin-top: 20px;
    border: 1px solid var(--theme-border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    overflow: hidden;
  }

  .detail-mini-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--theme-border);
    font-size: 12px;
  }

  .detail-mini-title {
    font-weight: 700;
    color: #333;
  }

  .detail-mini-more-link {
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
  }

  .detail-mini-more-link:hover {
    color: var(--theme-primary);
  }

  .detail-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }

  .detail-mini-row {
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    transition: background 0.15s;
  }

  .detail-mini-row:last-child {
    border-bottom: none;
  }

  .detail-mini-row:hover:not(.current-post-row) {
    background-color: #f8faf9;
  }

  .detail-mini-row.current-post-row {
    background-color: #f0faf4;
    font-weight: 700;
  }

  .detail-mini-row td {
    padding: 8px 12px;
    vertical-align: middle;
  }

  .mini-col-title-wrap {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 6px;
  }

  .mini-col-title {
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .detail-mini-row.current-post-row .mini-col-title {
    color: var(--theme-primary-dark);
  }

  .mini-current-badge {
    display: inline-block;
    font-size: 10px;
    background: var(--theme-primary);
    color: #ffffff;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .mini-col-author {
    color: #666;
    white-space: nowrap;
    width: 110px;
  }

  .mini-col-date {
    color: #888;
    text-align: right;
    white-space: nowrap;
    width: 80px;
    font-size: 11px;
  }

  /* Extra small screens (<= 480px) */
  @media (max-width: 480px) {
    .cafe-title-main {
      font-size: 15px;
    }

    .cafe-header-stats {
      font-size: 10.5px;
      gap: 6px 10px;
    }

    .cafe-stat-item strong {
      font-size: 11.5px;
    }

    .btn-like-heart {
      padding: 8px 18px;
      font-size: 13px;
    }

    .modal-dialog {
      width: calc(100% - 20px);
      margin: 10px auto;
    }
  }

}