/**
 * assets/css/core.css — Reset, layout, typography, tables, navbar, notices, utilities
 * Aunssh v3 — Mobile-first responsive design, standardized system fonts
 */

/* ====== Reset & Base ====== */
* { box-sizing: border-box; }
body { 
  margin: 0; background: #e9edf2; color: #1c2733;
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", Tahoma, "Leelawadee UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap { 
  width: 1140px; max-width: 100%; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; padding: 0 6px;
}
a { color: #1f5a96; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: #74808d; } .small { font-size: 12px; } .mt { margin-top: 8px; }

/* ====== Masthead ====== */
.masthead { padding: 16px 4px 10px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo { font-size: 26px; font-weight: 800; color: #14385e; letter-spacing: -.5px; }
.logo span { color: #2e7dd1; } .logo:hover { text-decoration: none; }
.logo-img { max-height: 52px; vertical-align: middle; }
.tagline { color: #74808d; font-size: 13px; }

/* ====== Navbar ====== */
.navbar { 
  background: linear-gradient(#2c4d75, #1f3a5c); border-radius: 6px 6px 0 0;
  display: flex; align-items: center; padding: 0 12px; min-height: 44px; position: relative;
}
.nav-home { display: inline-block; font-weight: 600; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; flex: 1; margin-left: 6px; }
.nav-user { display: flex; align-items: center; gap: 2px; }
.navbar a { color: #dce8f5; font-size: 13.5px; padding: 6px 10px; border-radius: 5px; transition: background .15s; display: inline-block; white-space: nowrap; }
.navbar a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,0.10); }
.staff-link { color: #ffd47e !important; }

/* Desktop search in nav */
.nav-search-desktop { display: inline-flex; margin-left: 6px; }
.nav-search-desktop input { padding: 4px 10px; border-radius: 4px; border: 0; font-size: 13px; width: 140px; background: #1a3350; color: #dce8f5; }
.nav-search-desktop input::placeholder { color: #7a8fa5; }
.nav-search-desktop input:focus { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.2); }
.nav-search-mobile { display: none !important; }
.nav-notif-mobile { display: none !important; }
.nav-menu-mobile { display: none !important; }
.nav-guest-search { display: none !important; }
.nav-google-login { display: none !important; }

/* Notif bell badge */
.nav-notif-mobile, .nav-notif-desktop { position: relative; }
.notif-count-badge { position: absolute; top: 0; right: 2px; background: #e63946; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 10px; line-height: 1; min-width: 16px; text-align: center; }

/* Desktop Avatar */
.nav-desktop-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 5px; margin-top: -2px; }

/* Hamburger toggle — hidden on desktop */
.nav-toggle { display: none; background: none; border: none; color: #dce8f5; font-size: 22px; cursor: pointer; padding: 6px 10px; border-radius: 4px; line-height: 1; }

/* ====== Content ====== */
.content { 
  background: #fff; border: 1px solid #c9d3de; border-top: 0; padding: 16px 18px 26px; flex: 1; 
  border-radius: 0 0 8px 8px;
}

/* ====== Tables (Forum) ====== */
.forum-table { 
  border-collapse: collapse; margin: 10px 0 18px; width: 100%;
  border: 1px solid #c9d3de; background: #fff; border-radius: 6px; overflow: hidden;
}
.forum-table th, .forum-table td { padding: 8px 10px; border-bottom: 1px solid #e3e9f0; vertical-align: top; }
thead.thead th { 
  background: linear-gradient(#f4f7fa, #e6edf4); border-bottom: 1px solid #c9d3de;
  font-size: 12.5px; color: #3c5572; text-transform: none; font-weight: 600;
}
.forum-table tr:hover td { background: #f7fafd; }
.forum-row.pinned td { background: #fffbe9; }

/* Forum author column with avatar */
.forum-col-author { white-space: nowrap; font-size: 13px; }
.forum-col-author .avatar { width: 32px; height: 32px; vertical-align: middle; margin-right: 6px; }
.forum-col-author a { vertical-align: middle; }

/* Forum last-post column */
.forum-col-last { font-size: 12.5px; line-height: 1.5; white-space: nowrap; }
.forum-last-time { color: #4a5568; }
.forum-last-user { font-size: 11.5px; color: #7a8695; }
.cat-name { font-size: 15.5px; font-weight: 700; }
.topic-link { font-weight: 600; }
.topic-deleted { text-decoration: line-through; color: #9aa3ae; }
.topic-deleted-label { color: #b33939; font-size: 11.5px; margin-left: 4px; }
.section-head { border-bottom: 2px solid #2c4d75; padding-bottom: 5px; color: #1f3a5c;
  font-size: 17px; margin: 24px 0 6px; }
.cur-tab { color: #14385e; border-bottom: 2px solid #2e7dd1; }
.crumbs { font-size: 12.5px; color: #74808d; margin-bottom: 8px; padding: 4px 0; }
.topic-title { font-size: 21px; color: #14385e; margin: 6px 0 2px; }
.forum-title { font-size: 19px; color: #14385e; margin: 0; }
.topic-meta { font-size: 12.5px; margin-bottom: 10px; }
.bar-table td { vertical-align: middle; }
.cat-check { margin-right: 14px; display: inline-block; }
.av-pick { display: inline-block; margin: 4px 10px 4px 0; text-align: center; }
.cat-multi { min-width: 160px; }

/* ====== Google Ads‑style card grid ====== */
.ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 360px));
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}
.ad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  padding: 12px 14px;
  text-decoration: none !important;
  color: inherit;
  transition: box-shadow .15s, border-color .15s;
  min-width: 0;
}
.ad-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  border-color: #c4cdd6;
  text-decoration: none !important;
}
.ad-card.ad-col-2 { grid-column: span 2; }
.ad-card.ad-col-3 { grid-column: span 3; }

/* รูปด้านบนการ์ด */
.ad-card-img {
  display: block;
  width: 100%;
  margin: -12px -14px 10px -14px;
  width: calc(100% + 28px);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  max-height: 140px;
}
.ad-card-img img {
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: cover;
  display: block;
}

.ad-card-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

/* Headline — clamp to 2 lines */
.ad-card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #1a0dab;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.ad-card:hover .ad-card-title { text-decoration: underline; }

/* Domain — green like Google */
.ad-card-domain {
  font-size: 12px;
  color: #006621;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Description body — clamp to 2 lines */
.ad-card-body {
  font-size: 13px;
  color: #545454;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* "Ad" badge (AD label ในมุมการ์ด) */
.ad-card::before {
  content: "AD";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 9.5px;
  font-weight: 700;
  color: #8a96a3;
  letter-spacing: .6px;
  background: #f4f6f8;
  padding: 1px 5px;
  border-radius: 3px;
  z-index: 1;
}
.modbar { background: #f4f7fa; border: 1px solid #d4dde7; border-radius: 5px;
  padding: 7px 12px; margin: 8px 0; font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.modbar form { margin-right: 0; }
.modbar button { margin-right: 6px; }
.inline { display: inline; }

/* ====== Stats / Pagination / Footer ====== */
.stats-box { background: #f4f7fa; border: 1px solid #d4dde7; border-radius: 5px;
  padding: 10px 14px; margin: 18px 0 6px; font-size: 13.5px; }
.stats-online { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d4dde7; }
.footer-online { text-align: center; font-size: 13px; color: #5a6a7a; padding: 8px 0 0; }
.online-dot { display: inline-block; width: 8px; height: 8px; background: #2ecc71; border-radius: 50%; margin-right: 4px; animation: pulse 2s infinite; vertical-align: middle; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.pagination, .pager { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.pagination a, .pager a, .pagination .cur, .pager .cur { display: inline-block; border: 1px solid #c9d3de;
  border-radius: 4px; padding: 5px 12px; background: #fff; }
.pagination .cur, .pager .cur { background: #2c4d75; color: #fff; border-color: #2c4d75; font-weight: 600; }
.footer { text-align: center; color: #8a96a3; font-size: 12.5px; padding: 16px 0 26px; }
.page-body { font-size: 15px; }
details summary { cursor: pointer; }

/* ====== Admin tabs ====== */
.admin-tabs { 
  display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 16px;
  border-bottom: 2px solid #d4dde7; padding-bottom: 10px;
}
.admin-tabs a { 
  padding: 6px 14px; border-radius: 5px 5px 0 0; font-size: 13px; 
  color: #5c6b7a; background: transparent; transition: background .12s;
}
.admin-tabs a:hover { background: #f0f4f8; text-decoration: none; }
.admin-tabs a.cur { color: #fff; background: #2c4d75; font-weight: 700; }

/* ====== Admin forms ====== */
.admin-form input[type=text], .admin-form input[type=url], 
.admin-form input[type=number], .admin-form select, .admin-form textarea {
  margin: 3px 4px 3px 0; padding: 6px 10px; border: 1px solid #b9c8d6; border-radius: 4px;
}
.admin-form { margin: 8px 0 20px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ====== RESPONSIVE: Tablet (≤900px) ====== */
@media (max-width: 900px) {
  .wrap { max-width: 100%; padding: 0 2px; }
  .content { padding: 12px 10px 20px; border-radius: 0 0 5px 5px; }
  .navbar { padding: 0 8px; }
  .nav-links a, .nav-user a { font-size: 12.5px; padding: 5px 8px; }
  .masthead { padding: 12px 8px 8px; }
  .logo { font-size: 22px; }
  .topic-title { font-size: 18px; }
  .forum-title { font-size: 17px; }
  .section-head { font-size: 15px; }
  /* Push nav-user to the right on tablet */
  .nav-user { margin-left: auto; }
}

/* ====== RESPONSIVE: Phone (≤640px) ====== */
@media (max-width: 640px) {
  body { font-size: 13.5px; }
  .wrap { padding: 0; }
  .content { padding: 10px 8px 18px; }

  /* Masthead compact */
  .masthead { padding: 10px 8px 6px; gap: 8px; }
  .logo { font-size: 20px; }
  .logo-img { max-height: 36px; }
  .tagline { font-size: 11px; }

  /* Mobile navbar — hamburger menu */
  .navbar { flex-wrap: wrap; justify-content: flex-start; border-radius: 0; padding: 0 8px; min-height: 46px; }
  .nav-home { order: 1; padding-left: 4px; }
  .nav-menu-mobile { display: inline-block !important; order: 2; padding: 6px 8px; }
  /* Guest mobile specific */
  .nav-guest-search { display: inline-block !important; order: 3; padding: 6px 6px; font-size: 13px; white-space: nowrap; }
  .nav-google-login { display: flex !important; align-items: center; order: 4; margin-left: auto; padding: 5px 10px;
    background: #4285f4; color: #fff; border-radius: 4px; font-weight: 600; font-size: 13px; gap: 5px; }
  .nav-google-login:hover { background: #3367d6; color: #fff; text-decoration: none; }
  .google-g { display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; background: #fff; color: #4285f4; border-radius: 50%; font-weight: 700; font-size: 12px; }
  .nav-login-desktop { display: none !important; }

  .nav-toggle { display: flex; align-items: center; justify-content: center; order: 4; height: 44px; min-width: 44px; font-size: 24px; padding: 0 6px; margin-left: auto; }
  .nav-notif-mobile { order: 5; display: flex !important; align-items: center; font-size: 18px !important; padding: 6px 4px; }
  .nav-notif-mobile .notif-count-badge { top: 4px; right: 4px; }
  .nav-toggle-user { font-size: 13.5px; font-weight: 600; gap: 6px; }
  .nav-toggle-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
  .nav-toggle-name { white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  
  /* Dropdown section */
  .nav-links, .nav-user { display: none; flex: none; width: 100%; flex-direction: column; padding: 4px 0; border-top: 1px solid rgba(255,255,255,0.12); order: 6; margin: 0; }
  .nav-user { border-top: none; padding-bottom: 8px; }
  
  /* Hide desktop-only / duplicate elements on mobile */
  .nav-profile-desktop { display: none !important; }
  
  .navbar.nav-open .nav-links, .navbar.nav-open .nav-user { display: flex; }
  
  .nav-links a, .nav-user a { width: 100%; padding: 8px 10px; font-size: 14px; margin: 0; border-radius: 4px; }
  .nav-search-desktop { display: none; }
  .nav-search-mobile { display: inline-block !important; }
  .nav-notif-desktop { display: none !important; }

  /* Ad grid → single column on mobile */
  .ad-grid { grid-template-columns: 1fr; gap: 8px; }
  .ad-card.ad-col-2, .ad-card.ad-col-3 { grid-column: span 1; }

  /* ====== Forum table → card layout on mobile ====== */
  .forum-table { display: block; border: 0; background: transparent; border-radius: 0; overflow: visible; }
  .forum-table thead { display: none; }
  .forum-table tbody { display: block; }
  .forum-row {
    display: flex; flex-wrap: wrap; align-items: center;
    background: #fff; border: 1px solid #c9d3de; border-radius: 8px;
    margin-bottom: 8px; padding: 0; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .forum-row td { display: block; border-bottom: 0; padding: 0; }

  /* Row 1: Topic title — full width */
  .forum-col-topic {
    width: 100%; padding: 10px 12px 6px !important;
    border-bottom: 0 !important;
  }
  .forum-col-topic .topic-link { font-size: 15px; line-height: 1.4; display: block; }
  .forum-topic-icons { display: inline; }

  /* Row 2: Author (left) + Last post (right) */
  .forum-col-author {
    flex: 1; min-width: 0;
    padding: 4px 12px 10px !important;
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .forum-col-author .avatar { width: 26px; height: 26px; flex-shrink: 0; }
  .forum-col-author a { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Hide replies & views columns */
  .forum-col-replies, .forum-col-views { display: none !important; }

  /* Last post — right aligned */
  .forum-col-last {
    flex-shrink: 0;
    padding: 4px 12px 10px 6px !important;
    text-align: right; line-height: 1.4;
  }
  .forum-last-time { font-size: 12px; color: #4a5568; }
  .forum-last-user { font-size: 11px; color: #7a8695; }

  /* Pinned row tint */
  .forum-row.pinned { background: #fffbe9; }
  
  /* Stack pagination */
  .pagination, .pager { justify-content: center; }
  .pagination a, .pager a, .pagination .cur, .pager .cur { padding: 4px 8px; font-size: 12px; }

  .topic-title { font-size: 17px; }
  .forum-title { font-size: 16px; }
  .crumbs { font-size: 11.5px; }
  .section-head { font-size: 14px; }
  
  /* Admin tabs scroll */
  .admin-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .admin-tabs a { font-size: 11.5px; padding: 5px 10px; white-space: nowrap; flex-shrink: 0; }
  
  /* Admin forms stack */
  .admin-form { flex-direction: column; align-items: stretch; }
  .admin-form input, .admin-form select, .admin-form textarea { width: 100%; margin: 2px 0; }
  
  /* Modbar stack */
  .modbar { flex-direction: column; gap: 6px; }
  .modbar form { display: flex; flex-wrap: wrap; gap: 4px; }
  
  .bar-table, .bar-table tbody, .bar-table tr, .bar-table td { display: block; width: 100%; }
  .bar-table td { padding: 4px 0; }
  .cat-multi { min-width: auto; }
}
/**
 * assets/css/postbit.css — Post display, avatars, badges, signatures, codebox, images, quote blocks
 * Aunssh v3 — Responsive post layout, classic forum spacing
 */

/* ====== Postbit (two-column classic board layout) ====== */
.postbit { 
  border: 1px solid #bac5d2; border-collapse: collapse; margin: 0 0 16px; 
  width: 100%; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.post-head td { 
  background: #e8eef5; border-bottom: 1px solid #c8d2de;
  padding: 7px 14px; font-size: 12px; color: #4a5568;
}
.post-actions { float: right; }
.post-actions a, .post-actions .linklike { margin-left: 12px; font-size: 12px; color: #4a5568; }
.post-actions a:hover, .post-actions .linklike:hover { color: #1f5a96; }

/* Level 1 — darkest blue: user info column */
.post-user { 
  background: #dce6f0; border-right: 1px solid #c8d2de; 
  width: 180px; min-width: 145px; vertical-align: top;
}
.post-user-inner {
  padding: 14px 12px;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px;
  text-align: center;
  font-size: 13px;
}
.post-user .avatar { flex-shrink: 0; }
.post-user .ulink { font-size: 14px; font-weight: 600; line-height: 1.2; }
.post-user .ulink:hover { text-decoration: underline; }
.post-user .rank-line { color: #5c6b7a; font-size: 12px; line-height: 1.3; }
.post-user .rank-img { max-height: 24px; }
.post-user .stars { font-size: 11px; letter-spacing: 1px; line-height: 1.2; }

/* Post count with separator */
.post-user-stats {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid #c8d2de;
  width: 70%; min-width: 60px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.post-user-stats span:first-child {
  font-size: 10.5px; color: #7a8695; text-transform: uppercase; letter-spacing: 0.3px;
}
.post-user-stat-count {
  font-size: 13px; font-weight: 700; color: #3c5572;
}

/* Level 2 — medium light blue: post content */
.post-body { 
  background: #f2f6fa;
  padding: 16px 18px; font-size: 14.5px; line-height: 1.75;
  overflow-wrap: break-word; word-break: break-word; vertical-align: top;
}
.avatar { border-radius: 50%; object-fit: cover; border: 2px solid #c8d2de; background: #fff; }
.rank-img { max-height: 28px; margin: 3px 0; }
.staff-badge { display: inline-block; background: #c0392b; color: #fff; border-radius: 4px;
  font-size: 11px; padding: 2px 10px; font-weight: 600; }
.mini-badge { background: #6c7a89; color: #fff; border-radius: 4px; font-size: 10.5px; padding: 2px 8px; }
.signature { border-top: 1px dashed #c8d2de; margin-top: 16px; padding-top: 10px;
  color: #8a96a3; font-size: 12.5px; }
.edited-note { color: #a08327; font-size: 12px; margin-top: 12px; font-style: italic; }
.file-chip { display: inline-block; background: #eef2f7; border: 1px solid #c8d2de;
  border-radius: 5px; padding: 5px 12px; margin: 6px 0; font-size: 13px; }
.deleted-peek { background: #fef5f5; border: 1px dashed #e3b3b3; padding: 10px 12px;
  margin-top: 8px; font-size: 13px; border-radius: 5px; }
.tag { color: #2e7dd1; font-weight: 600; }

/* ====== Reactions row — anchored at bottom ====== */
.post-react-row { 
  background: #f2f6fa;
}
.post-react-spacer {
  background: #dce6f0; border-right: 1px solid #c8d2de;
  width: 180px; min-width: 145px;
}
.post-react-cell {
  padding: 6px 18px 10px;
}

/* ====== Reactions ====== */
.react-bar { 
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
}
.react { 
  background: #f7f9fb; border: 1px solid #dde3ea; border-radius: 14px;
  padding: 4px 11px; cursor: pointer; font-size: 13px; transition: all .12s; 
  display: inline-flex; align-items: center; gap: 3px;
}
.react:hover:not(:disabled) { background: #e8f0fe; border-color: #7fb1e3; }
.react.on { background: #dcebfb; border-color: #5b9bd5; }
.react:disabled { cursor: default; opacity: .7; }
.rc { font-size: 11px; color: #6b7785; }

/* ====== Quote Block ====== */
.post-quote {
  border-left: 3px solid #7fb1e3;
  margin: 10px 0;
  padding: 10px 14px;
  background: #eef2f7;
  border-radius: 0 6px 6px 0;
  color: #4a5568;
  font-size: 13.5px;
}
.post-quote-header {
  font-size: 11.5px;
  font-weight: 600;
  color: #3c5572;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.post-quote-header::before {
  content: "💬";
  font-size: 12px;
}

/* ====== Post Images ====== */
.post-img { 
  max-width: 100%; height: auto; max-height: 500px; object-fit: contain;
  border-radius: 6px; margin: 10px 0; display: block;
  cursor: zoom-in; transition: transform 0.15s ease;
}
.post-img:hover { filter: brightness(0.95); }
.post-img:active { max-height: none; cursor: zoom-out; }

/* ====== Code / Prompt Box ====== */
.codebox { border: 1px solid #cdd8e3; border-radius: 5px; margin: 10px 0; overflow: hidden; }
.codebar { background: #eef3f8; border-bottom: 1px solid #cdd8e3; padding: 5px 10px;
  font-size: 12px; color: #3c5572; display: flex; justify-content: space-between; align-items: center; }
.codebox pre { margin: 0; padding: 10px 12px; background: #f8fafc; overflow-x: auto;
  font: 13px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; white-space: pre-wrap; }
.copy-btn { background: #fff; border: 1px solid #b9c8d6; border-radius: 4px;
  font-size: 11.5px; padding: 2px 9px; cursor: pointer; }
.copy-btn:hover { background: #eef3f8; }

/* ====== File Preview Grid ====== */
.files-preview-grid {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0;
}
.preview-item {
    position: relative; width: 64px; cursor: grab; user-select: none; transition: all 0.15s ease, box-shadow 0.15s ease;
}
.preview-item:active { cursor: grabbing; }
.preview-item.is-dragging { opacity: 0.4; transform: scale(0.9); }
.preview-item .img-wrap, .preview-item .doc-wrap {
    width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
    overflow: hidden; background: #fff; border: 1px solid #c9d3de; border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.preview-item .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .doc-wrap { flex-direction: column; background: #f1f5f9; }
.preview-item .doc-icon { font-size: 18px; }
.preview-item .doc-ext { font-size: 9px; font-weight: bold; color: #475569; background: #e2e8f0; padding: 0 3px; border-radius: 2px; }
.preview-item .file-name { font-size: 10px; display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; color: #74808d; text-align: center; }
.remove-file-btn {
    position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
    background: #ef4444; color: #fff; border: 1px solid #fff; border-radius: 50%;
    font-size: 10px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2); z-index: 10;
}
.remove-file-btn:hover { background: #dc2626; }
.preview-item.uploading { opacity: 0.6; pointer-events: none; }
.preview-item.uploading::after { content: "⏳"; position: absolute; top: 35%; left: 40%; font-size: 14px; }

/* ====== RESPONSIVE: Tablet (≤900px) ====== */
@media (max-width: 900px) {
  .postbit { border-radius: 6px; }
  .post-user { width: 140px; min-width: 120px; }
  .post-user-inner { padding: 10px 8px; }
  .post-user .avatar { width: 56px !important; height: 56px !important; }
  .post-user .ulink { font-size: 13px; }
  .post-user .rank-line { font-size: 11px; }
  .post-user-stats { width: 80%; }
  .post-body { padding: 12px 14px; font-size: 14px; }
  .post-head td { padding: 5px 10px; }
  .post-actions a, .post-actions .linklike { margin-left: 8px; font-size: 11px; }
  .post-react-spacer { width: 140px; min-width: 120px; }
  .post-react-cell { padding: 4px 14px 8px; }
  .reply-section { padding: 10px 12px 8px; }
}

/* ====== RESPONSIVE: Phone (≤640px) ====== */
@media (max-width: 640px) {
  .postbit, .postbit tbody { display: block; }
  .postbit { border-radius: 6px; }
  .postbit tr { display: flex; flex-wrap: wrap; }
  
  /* All td in postbit → full-width blocks */
  .post-head td, .post-user, .post-body, .post-react-spacer, .post-react-cell {
    display: block !important; width: 100% !important;
  }
  
  /* Post head bar — flex row */
  .post-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .post-head td { 
    padding: 7px 10px; font-size: 11.5px; background: #e8eef5;
    display: flex !important; flex-wrap: wrap; align-items: center; gap: 6px;
  }
  .post-head td .muted { flex: 1; min-width: 0; }
  .post-actions { float: none; display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
  .post-actions a, .post-actions .linklike { margin-left: 0; font-size: 11.5px; }
  
  /* User column → horizontal card above post */
  .post-user { 
    min-width: 0;
    border-right: 0; border-bottom: 1px solid #c8d2de;
  }
  .post-user-inner {
    flex-direction: row; align-items: center; gap: 10px;
    padding: 10px 12px;
    text-align: left;
    flex-wrap: wrap;
  }
  .post-user .avatar { 
    width: 40px !important; height: 40px !important; flex-shrink: 0;
  }
  /* Name + badges column */
  .post-user .ulink { font-size: 14px; display: inline; }
  .post-user .rank-line { font-size: 11.5px; display: inline; }
  .post-user .staff-badge { font-size: 10.5px; padding: 1px 8px; }
  .post-user .stars { font-size: 11px; }
  /* Hide post count separator on mobile — show inline */
  .post-user-stats { 
    border-top: 0; margin-top: 0; padding-top: 0; 
    width: auto; min-width: 0;
    flex-direction: row; gap: 4px;
    margin-left: auto;
  }
  .post-user-stats span:first-child { font-size: 10.5px; }
  .post-user-stat-count { font-size: 12px; }
  
  /* Post body — full-width block */
  .post-body { 
    padding: 12px; font-size: 14px; line-height: 1.7;
  }
  
  /* React row — full-width block below post */
  .post-react-row { display: flex; }
  .post-react-spacer { display: none !important; }
  .post-react-cell { 
    padding: 6px 12px 12px;
    background: #f2f6fa;
  }
  
  /* Quote block */
  .post-quote { margin: 8px 0; padding: 8px 12px; font-size: 13px; }
  
  .post-img { max-height: 350px; }
  .codebox pre { font-size: 12px; padding: 8px 10px; }
  .react { padding: 6px 12px; font-size: 14px; }
  .signature { font-size: 11.5px; }
  .react-bar { gap: 6px; }
}
/**
 * assets/css/editor.css — Editor toolbar, forms, buttons, inputs, upload drop zone
 * Aunssh v3 — Modern toolbar, mobile-optimized inputs
 */

/* ====== Forms & Inputs ====== */
input[type=text], input[type=url], input[type=number], input[type=search], input[type=email], select {
  border: 1px solid #b9c8d6; border-radius: 5px; padding: 7px 10px; 
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, input[type=url]:focus, input[type=number]:focus, 
input[type=search]:focus, input[type=email]:focus, select:focus, textarea:focus {
  border-color: #2e7dd1; box-shadow: 0 0 0 3px rgba(46,125,209,0.12);
  outline: none;
}
textarea {
  border: 1px solid #b9c8d6; border-radius: 5px; padding: 10px 12px; 
  font: inherit; font-size: 14px; line-height: 1.7;
  transition: border-color .15s, box-shadow .15s; resize: vertical;
}
.btn, button.btn { 
  background: linear-gradient(#3a6ea8, #2c557f); color: #fff; border: 1px solid #234668;
  border-radius: 5px; padding: 7px 18px; cursor: pointer; font: inherit; display: inline-block;
  transition: background .15s, transform .1s;
}
.btn:hover { background: #2c557f; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-sm { font-size: 12px; padding: 4px 12px; }
button { font: inherit; cursor: pointer; }
.linklike { background: none; border: 0; color: #1f5a96; padding: 0; cursor: pointer; }

/* ====== Editor ====== */
.editor { margin: 12px 0; }
/* Level 3 — lightest blue: reply section wrapper */
.reply-section {
  background: #f5f8fb;
  border: 1px solid #c8d2de;
  border-radius: 8px;
  padding: 14px 16px 10px;
  margin: 12px 0 20px;
}
.reply-section .section-head {
  margin-top: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #c8d2de;
}
.reply-form {
  margin: 0;
}
.editor textarea, .reply-form textarea, .admin-form textarea {
  width: 100%; border: 1px solid #b9c8d6; border-radius: 0 0 6px 6px; 
  padding: 12px; font: inherit; font-size: 14px; line-height: 1.7;
  min-height: 180px; resize: vertical;
}
.ed-toolbar { 
  background: #f1f5f9; border: 1px solid #b9c8d6; border-bottom: 0;
  border-radius: 6px 6px 0 0; padding: 6px 8px; 
  display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; 
  align-items: center;
}
.ed-toolbar button, .ed-attach { 
  background: #fff; border: 1px solid #c9d3de; border-radius: 4px;
  padding: 4px 10px; cursor: pointer; font-size: 12.5px; 
  transition: background .12s, border-color .12s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 3px;
}
.ed-toolbar button:hover, .ed-attach:hover { background: #e8f0fe; border-color: #7fb1e3; }
.ed-toolbar .ed-sep { width: 1px; background: #d4dde7; height: 22px; margin: 0 2px; align-self: center; }
.ed-queue:not(:empty) { margin: 6px 0; font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px; }
.ed-queue span { background: #f0f5fa; border: 1px solid #cfdce9; border-radius: 4px;
  padding: 2px 8px; margin-right: 6px; display: inline-block; }

/* ====== Upload Drop Zone ====== */
.upload-drop-zone { position: relative; border-radius: 5px; transition: all 0.2s ease; }
.upload-drop-zone.drag-over { background: #f0f7ff; }
.upload-drop-zone.drag-over textarea { border-color: #2e7dd1; box-shadow: 0 0 0 3px rgba(46, 125, 209, 0.15); }

/* ====== Form helper ====== */
.field { margin-bottom: 14px; }
.field > label > b { display: block; margin-bottom: 5px; font-size: 13.5px; }
.field .hint { color: #74808d; font-size: 12px; font-weight: normal; margin-top: 3px; }
.form-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 180px; }

/* ====== RESPONSIVE: Phone ====== */
@media (max-width: 640px) {
  .editor textarea, .reply-form textarea { font-size: 16px; min-height: 150px; padding: 10px; }
  .reply-section { padding: 10px 8px 6px; border-radius: 6px; }
  .reply-form { padding: 0; }
  .ed-toolbar { padding: 4px 6px; gap: 2px; }
  .ed-toolbar button, .ed-attach { font-size: 11.5px; padding: 4px 8px; }
  .ed-toolbar .ed-sep { display: none; }
  
  input[type=text], input[type=url], input[type=number], select { 
    width: 100%; font-size: 16px; padding: 8px 10px; 
  }
  .btn, button.btn { padding: 8px 16px; font-size: 14px; width: 100%; text-align: center; }
  
  .form-row { flex-direction: column; gap: 0; }
  .form-row .field { min-width: 0; }
}
/**
 * assets/css/diary.css — Diary grid, view, comments, write form, showcase bar
 * Aunssh v3 — Mobile-first responsive
 */

/* ====== Diary Hero ====== */
.diary-hero {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 8px; flex-wrap: wrap;
}

/* ====== Diary Grid ====== */
.diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.diary-card {
    position: relative;
    display: flex; gap: 12px;
    background: #fff; border: 1px solid #d4dde7; border-radius: 8px;
    padding: 16px; padding-bottom: 38px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    text-decoration: none; color: inherit;
}
.diary-card:hover {
    border-color: #7fb1e3; box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    text-decoration: none;
}
.diary-card-feeling {
    font-size: 11px; color: #5c6b7a;
    background: #f0f4f8; border: 1px solid #dce3eb; border-radius: 12px;
    padding: 3px 10px; display: inline-block;
    position: absolute; bottom: 12px; right: 14px;
    white-space: nowrap;
}
.diary-card-content { flex: 1; min-width: 0; }
.diary-card-content h3 {
    margin: 0 0 6px; font-size: 15px; color: #14385e;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.diary-card-preview { font-size: 13px; margin-bottom: 10px; line-height: 1.55; }
.diary-card-meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    align-items: center; font-size: 12px;
}
.diary-card-meta img { border-radius: 50%; vertical-align: middle; margin-right: 3px; }

/* ====== Diary View ====== */
.diary-view-layout {
    display: flex; gap: 28px; align-items: flex-start;
}
.diary-view-main { flex: 3; min-width: 0; }
.diary-view-sidebar { flex: 1; min-width: 250px; max-width: 320px; }
.diary-sidebar-section {
    background: #fff; border: 1px solid #d4dde7; border-radius: 8px;
    padding: 16px 18px; margin-bottom: 16px;
}
.diary-sidebar-section h4 {
    margin: 0 0 10px; font-size: 13px; color: #2c4d75;
    padding-bottom: 8px; border-bottom: 1px solid #edf1f5;
}
.diary-sidebar-list { list-style: none; margin: 0; padding: 0; }
.diary-sidebar-list li {
    padding: 7px 0; border-bottom: 1px solid #f4f6f9;
    font-size: 13.5px; line-height: 1.5;
}
.diary-sidebar-list li:last-child { border-bottom: none; }
.diary-sidebar-list li a { font-weight: 500; }
.diary-sidebar-list li .muted { font-size: 11px; color: #8a96a3; display: block; margin-top: 2px; }
.diary-sidebar-more {
    display: block; margin-top: 8px; font-size: 12px; color: #2c4d75; font-weight: 600;
}
.diary-view-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.diary-view-meta { font-size: 13px; margin-top: 6px; }
.diary-view-author { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.diary-view-author a { font-size: 14px; }
.diary-view-info { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12px; color: #74808d; }
.diary-view-meta .edited-note { margin-top: 0; color: #a08327; }
.diary-view-body {
    background: #fff; border: 1px solid #d4dde7; border-radius: 8px;
    padding: 22px 26px; min-height: 200px; font-size: 16px; line-height: 1.85;
    margin: 16px 0;
}
.diary-view-feeling { display: block; font-size: 12px; color: #5c6b7a; margin: -8px 0 14px 0; padding-bottom: 10px; border-bottom: 1px dashed #dce3eb; }
.diary-view-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ====== Diary Write Form ====== */
.diary-form { max-width: 700px; }
.diary-form .field { margin-bottom: 16px; }
.diary-form .field-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.diary-form .field-row .field { flex: 1; min-width: 200px; }
.diary-form input[type=text], .diary-form select {
    width: 100%; border: 1px solid #b9c8d6; border-radius: 5px;
    padding: 10px 12px; font: inherit;
}

/* ====== Diary Comments ====== */
.diary-comments { margin-top: 20px; }
.diary-comments h3 { font-size: 15px; margin: 0 0 12px; color: #2c4d75; }
.diary-comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf1f5; }
.diary-comment:last-child { border-bottom: none; }
.diary-comment-avatar { flex-shrink: 0; }
.diary-comment-avatar img { border-radius: 50%; }
.diary-comment-body { flex: 1; min-width: 0; font-size: 14px; line-height: 1.65; }
.diary-comment-body p { margin: 4px 0 0; }
.diary-comment-meta { font-size: 12px; color: #8a96a3; margin-bottom: 4px; }
.diary-comment-meta a { font-weight: 600; }
.diary-comment-form { margin-top: 16px; }
.diary-comment-form textarea {
    width: 100%; border: 1px solid #b9c8d6; border-radius: 5px;
    padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.7;
    resize: vertical; min-height: 80px;
}

/* ====== Diary Reactions ====== */
.diary-reactions { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.diary-react-btn {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid #d4dde7; border-radius: 20px;
    padding: 4px 12px; font-size: 15px; cursor: pointer;
    background: #fff; transition: all 0.15s ease;
}
.diary-react-btn:hover { border-color: #7fb1e3; background: #f0f7fd; }
.diary-react-btn.active { border-color: #2c4d75; background: #e8f0fe; }
.diary-react-btn .count { font-size: 12px; color: #5e6e7e; margin-left: 2px; }

/* ====== Diary Showcase Bar ====== */
table.diary-showcase {
    width: 100%; max-width: 1060px; margin: 0 auto 12px auto;
    background: #f9fafc; border: 1px solid #e2e7ed; border-radius: 8px;
    border-collapse: collapse; font-size: 13px; line-height: 1.5;
}
table.diary-showcase td { padding: 6px 10px; white-space: nowrap; }
.diary-showcase-label { font-weight: 700; color: #2c4d75; width: 1%; font-size: 14px; }
.diary-showcase-sep { width: 1%; color: #d4dde7; padding: 6px 6px !important; user-select: none; }
table.diary-showcase td a { font-weight: 600; color: #1b2b3e; }
table.diary-showcase td a:hover { color: #2c4d75; text-decoration: underline; }
.diary-showcase-more { width: 1%; text-align: right; font-size: 11px; }
.diary-showcase-more a { font-size: 11px !important; color: #2c4d75 !important; }

/* ====== Diary Responsive ====== */
@media (max-width: 900px) {
    .diary-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
    .diary-view-body { padding: 16px 18px; font-size: 15px; }
    .diary-view-layout { gap: 18px; }
    .diary-view-sidebar { min-width: 220px; }
}
@media (max-width: 640px) {
    .diary-grid { grid-template-columns: 1fr; }
    .diary-hero { flex-direction: column; align-items: flex-start; }
    .diary-form .field-row { flex-direction: column; }
    .diary-comment { flex-direction: column; }
    .diary-view-layout { flex-direction: column; }
    .diary-view-sidebar { max-width: none; min-width: 0; width: 100%; }
    .diary-view-body { padding: 14px; font-size: 15px; line-height: 1.75; }
    .diary-view-header { flex-direction: column; }
    .diary-sidebar-section { padding: 12px 14px; }
    
    /* Diary Showcase scroll horizontally on mobile */
    .diary-showcase-container {
        width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
        margin: 0 auto 12px auto; background: #f9fafc; border: 1px solid #e2e7ed; border-radius: 8px;
    }
    table.diary-showcase { 
      border: none; margin: 0; background: transparent; border-radius: 0;
    }
    table.diary-showcase td { padding: 8px 10px; }
    .diary-showcase-sep { display: table-cell; }
}
/**
 * assets/css/homepage.css — Home grid, unified feed, diary mini cards, tag index,
 *   announcements, vBulletin-style forum category cards
 * Aunssh v3 — Mobile-first responsive
 */

/* ====== Announcements ====== */
.announce-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(135deg, #eef4fb 0%, #f4f8fc 100%);
  border: 1px solid #c8d8eb; border-radius: 8px;
  padding: 16px 18px; margin: 0 0 14px;
}
.announce-icon { font-size: 28px; line-height: 1.2; flex-shrink: 0; }
.announce-body { flex: 1; min-width: 0; }
.announce-title { font-size: 15px; font-weight: 700; color: #1c3d5e; margin-bottom: 4px; }
.announce-text { font-size: 13px; color: #4a5e73; line-height: 1.6; }

/* ====== Forum Category Cards (vBulletin-style) ====== */
.forum-cat-list {
  display: flex; flex-direction: column;
  border: 1px solid #c9d3de; border-radius: 6px;
  background: #fff; margin: 0 0 18px; overflow: hidden;
}
.forum-cat-card {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  padding: 14px 16px; border-bottom: 1px solid #e3e9f0;
  transition: background 0.12s ease; gap: 16px;
}
.forum-cat-card:last-child { border-bottom: none; }
.forum-cat-card:hover { background: #f8fafc; }

.cat-card-main {
  display: flex; gap: 12px; flex: 1; min-width: 200px; align-items: flex-start;
}
.cat-icon {
  font-size: 28px; line-height: 1.3; flex-shrink: 0;
  width: 36px; text-align: center;
}
.cat-card-info { flex: 1; min-width: 0; }
.cat-card-name {
  font-size: 15.5px; font-weight: 700; color: #1c3d5e;
  display: inline; margin-right: 6px;
}
.cat-card-name:hover { color: #1f5a96; text-decoration: underline; }
.cat-card-desc {
  font-size: 12.5px; color: #74808d; margin-top: 2px; line-height: 1.5;
}
.cat-card-stats {
  display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px;
}
.cat-stat {
  font-size: 11.5px; color: #5c6b7a;
  background: #f0f4f8; border-radius: 4px;
  padding: 3px 9px; white-space: nowrap;
}
.cat-stat-val { font-weight: 700; color: #1f5a96; }
.cat-stat-total { background: #e3edf7; }
.cat-stat-total .cat-stat-val { color: #2e7dd1; }

.cat-card-last {
  width: 280px; flex-shrink: 0; padding-left: 12px;
  border-left: 1px solid #edf1f5;
}
.cat-last-title {
  font-size: 13px; font-weight: 600; color: #14385e;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-last-title:hover { color: #1f5a96; }
.cat-last-meta {
  font-size: 11.5px; color: #8a96a3; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-last-meta a { color: #5c6b7a; }
.cat-last-time { color: #8a96a3; }
.cat-last-cats { font-size: 10px; color: #9aa3ae; }

.mini-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  background: #ffd47e; color: #5c4200; padding: 1px 6px; border-radius: 3px;
  vertical-align: middle; margin-left: 4px;
}

/* ====== Homepage: 2-column grid ====== */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  margin: 0 0 18px;
}
.home-col { min-width: 0; }

/* ====== Unified Feed (topics + replies) ====== */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.feed-item {
  padding: 10px 14px;
  border-bottom: 1px solid #edf1f5;
  transition: background 0.12s ease;
}
.feed-item:hover { background: #f7fafd; }
.feed-item:last-child { border-bottom: none; }
.feed-title {
  font-size: 14px;
  font-weight: 600;
  color: #14385e;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}
.feed-title:hover { color: #1f5a96; text-decoration: underline; }
.feed-meta {
  font-size: 12px;
  color: #74808d;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.feed-cat { color: #2c4d75; font-weight: 600; }
.feed-stat { color: #5c6b7a; }
.feed-snippet {
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-reply-icon { margin-right: 4px; font-size: 12px; }

/* ====== Diary Mini Cards ====== */
.diary-mini-list { display: flex; flex-direction: column; gap: 0; }
.diary-mini-item {
  padding: 10px 12px; border: 1px solid #e3e9f0; border-radius: 6px;
  margin-bottom: 8px; transition: box-shadow 0.15s ease, border-color 0.15s ease;
  background: #fcfdfe;
}
.diary-mini-item:hover { border-color: #7fb1e3; box-shadow: 0 1px 6px rgba(0,0,0,0.05); }
.diary-mini-title { font-size: 14px; font-weight: 600; color: #14385e; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diary-mini-preview { font-size: 12.5px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ====== Tag Index ====== */
.tag-index { max-width: 900px; }
.tag-group { margin-bottom: 18px; }
.tag-group-letter { font-size: 16px; font-weight: 700; color: #14385e; margin: 0 0 8px 0; padding-bottom: 4px; border-bottom: 2px solid #2c4d75; }

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr 280px; gap: 16px; }
  .feed-title { font-size: 13px; }
  .cat-card-last { width: 220px; }
}
@media (max-width: 640px) {
  .announce-card { padding: 12px 14px; gap: 10px; }
  .announce-icon { font-size: 22px; }
  .announce-title { font-size: 14px; }
  .announce-text { font-size: 12px; }

  .forum-cat-list { border-radius: 0; border-left: 0; border-right: 0; }
  .forum-cat-card { flex-direction: column; gap: 8px; padding: 12px 12px; }
  .cat-card-main { gap: 10px; }
  .cat-icon { font-size: 24px; width: 30px; }
  .cat-card-name { font-size: 14.5px; }
  .cat-card-desc { font-size: 12px; }
  .cat-card-stats { gap: 4px; margin-top: 8px; }
  .cat-stat { font-size: 11px; padding: 2px 7px; }

  .cat-card-last {
    width: 100%; border-left: none; border-top: 1px solid #edf1f5;
    padding: 8px 0 0; margin-top: 2px;
  }
  .cat-last-title { font-size: 12.5px; }
  .cat-last-meta { font-size: 11px; }

  .home-grid { grid-template-columns: 1fr; gap: 10px; }
  .home-col:last-child { order: 1; }
  .home-col:first-child { order: 0; }
  .feed-item { padding: 8px 10px; }
  .feed-title { font-size: 13px; white-space: normal; }
  .feed-meta { font-size: 11px; gap: 6px; }
  .feed-snippet { font-size: 12px; white-space: normal; }
  .diary-mini-item { padding: 8px 10px; margin-bottom: 6px; }
  .diary-mini-title { font-size: 13px; }

  /* Hide old "ความเคลื่อนไหวล่าสุด" column — already shown in cards */
  .forum-table th:nth-child(3),
  .forum-table td:nth-child(3) { display: none; }
  .forum-table { overflow-x: visible; white-space: normal; }
}
