/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

:root {
  --bg: #EDF0F4;
  --card: #ffffff;
  --border: #e4e4e4;
  --border-light: #efefef;
  --accent: #1a56db;
  --text: #111111;
  --text-dim: #555555;
  --text-muted: #aaaaaa;
  --rank1: #e63312;
  --rank2: #e67e00;
  --rank3: #1a56db;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --radius: 6px;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 40px;
}

body.sheet-open {
  overflow: hidden;
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== Search Bar ===== */
.search-bar {
  position: sticky;
  top: var(--header-h, 49px);
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-input {
  width: 100%;
  height: 32px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
.search-input:focus { border-color: var(--accent); }
.search-clear-btn {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 15px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.search-clear-btn:active { opacity: .5; }
.search-close-btn {
  flex-shrink: 0;
  padding: 0 10px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-sub, #888);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.search-close-btn:active { opacity: .6; }
.post-wrap[data-search-hidden] { display: none; }
#searchToggleBtn.active { color: var(--accent); }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
}

.logo {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 1px; /* 로고 사이 간격 */
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.logo-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ===== Weather Info ===== */
.weather-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-left: auto;
  margin-right: 8px;
  line-height: 1.3;
}

.weather-temp {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.weather-dust {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.2px;
}

/* ===== Refresh Button ===== */
.refresh-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 5px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.refresh-btn:active {
  color: var(--accent);
}

.refresh-btn.spinning svg {
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 헤더 북마크  */
#bookmarkBtn {
  padding-right: 10px;
}

/* ===== 앱 설치 배너 ===== */
.app-promo-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: #2875d5;
  color: #fff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.app-promo-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.app-promo-text {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-promo-cta {
  flex-shrink: 0;
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.app-promo-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #fff;
  opacity: 0.75;
  font-size: 13px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Main Tabs Bar (wrapper) ===== */
.main-tabs-bar {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 42px;
  z-index: 90;
  box-shadow: 0 3px 0 0 var(--card);
}

/* ===== Main Tabs ===== */
.main-tabs {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 0 4px;
}

.main-tab {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.main-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--text);
  transform: scaleX(0);
  transition: transform 0.2s ease;
  border-radius: 2px;
}

.main-tab.active {
  color: var(--text);
}

.main-tab.active::after {
  transform: scaleX(1);
}

/* ===== Section ===== */
.section {
  display: none;
}

.section.active {
  display: block;
}

/* 시작화면 설정이 기본값(이슈모음)이 아닐 때 최초 렌더링 깜빡임 방지 (index.html 인라인 스크립트와 연동) */
html[data-home-section] #hotissue-section {
  display: none;
}
html[data-home-section] .main-tab[data-section="hotissue"] {
  color: var(--text-muted);
}
html[data-home-section] .main-tab[data-section="hotissue"]::after {
  transform: scaleX(0);
}
html[data-home-section="community"] #community-section,
html[data-home-section="news"] #news-section,
html[data-home-section="hotdeal"] #hotdeal-section,
html[data-home-section="freeboard"] #freeboard-section {
  display: block;
}
html[data-home-section="community"] .main-tab[data-section="community"],
html[data-home-section="news"] .main-tab[data-section="news"],
html[data-home-section="hotdeal"] .main-tab[data-section="hotdeal"],
html[data-home-section="freeboard"] .main-tab[data-section="freeboard"] {
  color: var(--text);
}
html[data-home-section="community"] .main-tab[data-section="community"]::after,
html[data-home-section="news"] .main-tab[data-section="news"]::after,
html[data-home-section="hotdeal"] .main-tab[data-section="hotdeal"]::after,
html[data-home-section="freeboard"] .main-tab[data-section="freeboard"]::after {
  transform: scaleX(1);
}

/* ===== Sub Tabs Bar (wrapper) ===== */
.sub-tabs-bar {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 79px;
  z-index: 80;
  box-shadow: 0 -3px 0 0 var(--card);
}

/* ===== Sub Tabs ===== */
.sub-tabs {
  flex: 1;
  display: flex;
  overflow-x: auto;
  padding: 0 4px 0 10px;
  gap: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-width: 0;
}

.sub-tabs::-webkit-scrollbar {
  display: none;
}

/* ===== 네이버 로그인 버튼 ===== */
#userArea {
  display: flex;
  align-items: center;
  margin-right: 2px;
}

.user-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 1000;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.user-login-btn:active { opacity: 0.7; }

.naver-btn {
  background: #03C75A;
  color: #fff;
}

.user-loggedin {
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.user-admin {
  background: #1a56db;
  color: #fff;
  border: none;
  font-weight: 900;
}

.user-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.user-nick {
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Main Tab Edit Button ===== */
.main-edit-btn {
  flex-shrink: 0;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-left: 1px solid var(--border-light);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}

.main-edit-btn:active {
  color: var(--accent);
  background: var(--bg);
}

/* ===== Edit Tabs Button ===== */
.edit-tabs-btn {
  flex-shrink: 0;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-left: 1px solid var(--border-light);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}

.edit-tabs-btn:active {
  color: var(--accent);
  background: var(--bg);
}

.sub-tab {
  flex-shrink: 0;
  padding: 8px 10px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s;
  letter-spacing: -0.1px;
}

.sub-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 6px;
  right: 6px;
  height: 2px;
  background: var(--text);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.15s ease;
}

.sub-tab.active {
  color: var(--text);
  font-weight: 700;
}

.sub-tab.active::after {
  transform: scaleX(1);
}

/* ===== List Container ===== */
.list-container {
  background: var(--card);
  margin-top: 6px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ssr-hotissue-list .post-wrap {
  display: block;
  padding: 0 0 12px;
  border-bottom: 8px solid var(--bg);
  text-decoration: none;
  color: inherit;
}

.ssr-hotissue-list .post-wrap:active {
  background: #f7f7f8;
}

.ssr-hotissue-list .post-thumb {
  display: block;
  width: 100%;
  overflow: hidden;
  background: #fff;
}

.ssr-hotissue-list .post-thumb img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  object-position: top;
}

.ssr-hotissue-list .post-title {
  padding: 10px 14px 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.ssr-hotissue-list .post-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  padding: 0 14px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Post Item ===== */
.post-wrap {
  border-bottom: 1px solid var(--border-light);
}

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

.post-item {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
  -webkit-user-select: none;
  user-select: none;
  min-height: 44px;
  position: relative;
}

.post-item:active {
  background: #f7f7f8;
}

/* 랭크 번호 */
.post-rank {
  min-width: 18px;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.post-rank.r1 { color: var(--rank1); }
.post-rank.r2 { color: var(--rank2); }
.post-rank.r3 { color: var(--rank3); }

/* 게시글 제목 */
.post-title {
  flex: 1;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  word-break: keep-all;
  overflow: hidden;
  overflow-wrap: anywhere;
  letter-spacing: -0.15px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* 출처 배지 */
.post-badge {
  flex-shrink: 0;
  font-size: 0.70rem;
  font-weight: 600;
  color: #7d8aa9;
  background: rgba(26, 86, 219, 0.08);
  border-radius: 3px;
  padding: 2px 4px;
  align-self: center;
  white-space: nowrap;
}

/* 이슈모음 카드형(썸네일 + 제목) */
.hotissue-card {
  border-bottom: 8px solid var(--bg);
}

.post-item.has-thumb {
  display: block;
  padding: 0;
  min-height: 0;
}

.post-item.has-thumb .post-thumb {
  display: block;
  width: 100%;
  overflow: hidden;
  background: #fff;
}

.post-item.has-thumb .post-thumb img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  object-position: top;
}

.post-item.has-thumb .post-badge {
  margin: 10px 14px 0;
}

.post-item.has-thumb .post-title {
  display: -webkit-box;
  padding: 10px 14px 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.hotissue-card .post-list-actions {
  margin-top: 0;
  padding: 6px 12px 10px 14px;
}

/* HOT 뱃지 */
/* ===== 댓글 토글 버튼 ===== */
.post-row {
  position: relative;
  display: flex;
  align-items: center;
}

.post-row .post-item {
  flex: 1;
  min-width: 0;
}

.bm-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px 10px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.bm-btn:active { color: var(--accent); }
.bm-btn.bm-on { color: var(--accent); }

.comment-toggle {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px 10px;
  transition: color 0.15s;
  line-height: 1;
}

.comment-toggle:active { color: var(--accent); }

.comment-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  min-height: 12px;
}

.post-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px 9px 14px;
  margin-top: -4px;
  color: var(--text-muted);
}

.post-list-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.post-author-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.post-meta-sep,
.post-created-at {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.post-created-at {
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-like-btn,
.post-list-actions .comment-toggle,
.post-view-count,
.post-like-count,
.post-comment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 4px;
  min-width: 34px;
  min-height: 24px;
  padding: 2px 3px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  cursor: default;
}
.post-view-count span,
.post-like-count span,
.post-comment-count span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-muted);
}

.post-list-stats {
  justify-content: flex-start;
}

.post-like-btn.liked {
  color: #e6335a;
}

.like-count,
.post-list-actions .comment-count {
  min-width: 8px;
  min-height: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

/* ===== 댓글 박스 ===== */
.comment-box {
  background: var(--bg);
  border-top: 1px solid var(--border-light);
  padding: 10px 14px 12px;
}

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

.comment-item.comment-reply {
  margin-left: 20px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.comment-item:last-of-type { border-bottom: none; }

.comment-nick {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-right: 6px;
}

.comment-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 5px;
}

.comment-action {
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.comment-action-delete {
  color: var(--rank1);
}

.comment-reply-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-dim);
  font-size: 12px;
}

.comment-reply-status button {
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.comment-content {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 3px;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.comment-loading,
.comment-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0;
}

/* ===== 댓글 입력 폼 ===== */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.comment-form input.comment-nick,
.comment-form input[type="password"],
.comment-form .comment-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
}

.comment-form input.comment-nick:focus,
.comment-form input[type="password"]:focus,
.comment-form .comment-input:focus {
  border-color: var(--accent);
}

.comment-form .comment-input {
  resize: none;
}

.comment-submit {
  align-self: flex-end;
  background: #4c8dd1;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.comment-submit:disabled { opacity: 0.5; }

/* ===== Spinner ===== */
.spinner-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  background: var(--card);
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ===== Skeleton (스와이프 ghost용으로만 유지) ===== */
.skeleton-list {
  background: var(--card);
  padding: 4px 0;
}

.skeleton-item {
  height: 44px;
  margin: 1px 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== Error / Empty ===== */
.error-msg, .empty-msg {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 6px;
}

.error-msg {
  color: var(--rank1);
}

/* ===== Sentinel ===== */
.sentinel {
  height: 1px;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 14px;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: -0.1px;
}

/* ===== Bottom Sheet ===== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overscroll-behavior: contain;
}

.sheet-backdrop[hidden] {
  display: none;
}

.sheet-panel {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overscroll-behavior: contain;
}

.sheet-backdrop.open .sheet-panel {
  transform: translateY(0);
}

#authSheet,
#fbPwdSheet,
#deleteAcctSheet {
  align-items: center;
  padding: 16px;
}

#authSheet .sheet-panel,
#fbPwdSheet .sheet-panel,
#deleteAcctSheet .sheet-panel {
  width: min(100%, 360px);
  max-height: calc(100dvh - 32px);
  border-radius: 16px;
  padding-bottom: 0;
  overflow-y: auto;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.22s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.18s ease;
}

#authSheet.open .sheet-panel,
#fbPwdSheet.open .sheet-panel,
#deleteAcctSheet.open .sheet-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

#authSheet .sheet-handle-area,
#fbPwdSheet .sheet-handle-area,
#deleteAcctSheet .sheet-handle-area {
  display: none;
}

#fbComposeSheet {
  align-items: center;
  padding: 12px;
}

#fbComposeSheet .sheet-panel-tall {
  height: min(92dvh, 720px);
  max-height: calc(100dvh - 24px);
  border-radius: 16px;
  padding-bottom: 0;
  transform: translateY(18px);
}

#fbComposeSheet.open .sheet-panel-tall {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto;
  flex-shrink: 0;
  pointer-events: none; /* 터치는 .sheet-handle-area가 처리 */
}

.sheet-handle-area {
  padding: 20px 0 14px;
  cursor: grab;
  touch-action: none;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px 12px;
  flex-shrink: 0;
}

.sheet-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.sheet-close {
  border: none;
  background: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.sheet-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 0 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sheet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border-light);
  user-select: none;
  -webkit-user-select: none;
  background: var(--card);
  border-radius: 6px;
  transition: background 0.1s;
}

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

.sheet-item.dragging {
  opacity: 0.5;
  background: var(--bg);
}

.drag-handle {
  width: 45px;
  min-width: 45px;
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: -4px 0;
  border: none;
  background: none;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.drag-handle:active {
  background: #f1f4f8;
}

.sheet-item-label {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.sheet-footer {
  padding: 12px 16px;
  flex-shrink: 0;
  border-top: 1px solid var(--border-light);
}

.sheet-done {
  width: 100%;
  padding: 11px;
  border: none;
  background: var(--text);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: -0.1px;
}

.sheet-done:active {
  opacity: 0.8;
}

/* ===== 차단 키워드 시트 ===== */
.block-kw-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.block-kw-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--bg);
}
.block-kw-input:focus { border-color: var(--accent); }

.block-kw-add {
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.block-kw-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 8px 16px;
}

.block-kw-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.block-kw-item:last-child { border-bottom: none; }

.block-kw-label {
  font-size: 14px;
  color: var(--text);
}

.block-kw-del {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.block-kw-del:active { color: var(--rank1); }

/* ===== 북마크 시트 ===== */
.bm-sheet-list { list-style: none; overflow-y: auto; flex: 1; }

.bm-sheet-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
}

.bm-link {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bm-link:active { color: var(--accent); }

.bm-del {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}
.bm-del:active { color: var(--rank1); }

.bm-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 0;
}

.block-kw-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 0;
}

/* ===== 자게 (Freeboard) ===== */
.fb-post-item {
  padding: 12px 14px 11px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-bottom: 1px solid var(--border-light);
}

.fb-post-item:active {
  background: var(--bg);
}

.fb-post-title {
  font-size: 16px;
  color: var(--text);
  line-height: 1.45;
  letter-spacing: -0.15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fb-post-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: -0.1px;
}

.fb-post-nick {
  font-weight: 600;
  margin-right: 4px;
}

.fb-post-actions {
  padding: 4px 0 0 0;
  margin-top: 0;
}

.fb-post-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* 자게 FAB */
.fb-fab {
  position: fixed;
  bottom: 22px;
  right: max(16px, calc(50% - 224px));
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(26, 86, 219, 0.35);
  z-index: 85;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.fb-fab:active {
  transform: scale(0.93);
  box-shadow: 0 1px 6px rgba(26, 86, 219, 0.3);
}

/* 자게 글쓰기 폼 */
.fb-form {
  padding: 12px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fb-form-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.fb-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  font-family: inherit;
}

.fb-input:focus {
  border-color: var(--accent);
}

.fb-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
  min-height: 140px;
}

#fbComposeSheet .fb-form-scroll {
  flex: 1 1 auto;
  padding-bottom: 16px;
}

#fbComposeSheet .fb-textarea {
  min-height: 220px;
}

.fb-textarea:focus {
  border-color: var(--accent);
}

.fb-char-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -4px;
}

/* 공지 체크박스 */
.fb-notice-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}

/* 자게 상세 시트 */
.sheet-panel-tall {
  max-height: 90vh;
}

.sheet-panel-full {
  height: 92vh;
  display: flex;
  flex-direction: column;
}

.fb-detail-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 공지 배지 */
.fb-notice-badge {
  display: inline-block;
  background: #e63312;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
  letter-spacing: 0.2px;
}

.fb-category-badge {
  display: inline-block;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
  letter-spacing: 0;
}

/* 댓글 섹션 */
.fb-comment-section {
  border-top: 6px solid var(--bg);
  padding: 12px 0 80px;
}

.fb-comment-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 0 16px 8px;
}

.fb-comment-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
}

.fb-comment-item.fb-comment-reply {
  margin-left: 18px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

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

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

.fb-comment-nick {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.fb-comment-date {
  font-size: 11px;
  color: var(--text-muted);
}

.fb-comment-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.fb-cmt-btn {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
}

.fb-cmt-del { color: var(--rank1); }

.fb-comment-content {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.fb-comment-empty {
  padding: 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* 댓글 작성 폼 */
.fb-comment-form--hidden { display: none !important; }

.fb-comment-form {
  position: sticky;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.fb-comment-form .fb-comment-nick { grid-column: 1; }
.fb-comment-form .fb-comment-pwd  { grid-column: 2; }
.fb-comment-form .fb-comment-content {
  grid-column: 1 / -1;
  resize: none;
  height: 56px;
}

.fb-cmt-submit {
  grid-column: 1 / -1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* 인라인 수정/삭제 폼 */
.fb-inline-form {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fb-inline-textarea {
  resize: vertical;
  min-height: 60px;
  font-size: 13px;
  line-height: 1.6;
}

.fb-inline-pwd {
  font-size: 13px;
}

.fb-inline-btns {
  display: flex;
  gap: 6px;
}

.fb-inline-save,
.fb-inline-del-confirm {
  flex: 1;
  padding: 7px;
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.fb-inline-del-confirm {
  background: #3b2f33;
}

.fb-inline-cancel {
  flex: 1;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  color: var(--text-dim);
}

/* URL 링크 */
.content-link {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}

.fb-detail-header {
  justify-content: space-between;
  flex-direction: row-reverse;
}

.fb-detail-actions {
  display: flex;
  gap: 6px;
}

.fb-action-btn {
  padding: 5px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}

.fb-action-btn:active { background: var(--bg); }

.fb-del-btn {
  color: var(--rank1);
  border-color: rgba(230, 51, 18, 0.3);
}

.fb-detail-body {
  padding: 16px 18px 24px;
  overflow-y: auto;
  flex: 1;
}

.fb-detail-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.fb-detail-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.fb-detail-content {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.fb-detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.fb-detail-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.fb-detail-comment-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 로그인 버튼 (비로그인) ===== */
.login-text-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  height: auto;
  width: auto;
}

.login-text-btn:active { background: var(--bg); }

/* ===== 인증 시트 ===== */
.auth-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}

.auth-tab {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-tab.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.auth-form {
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.auth-link-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
}

.auth-link-sep {
  font-size: 12px;
  color: var(--border);
}

.auth-find-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

.auth-naver-wrap {
  padding: 12px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-naver-btn,
.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.auth-naver-btn {
  background: #03C75A;
  color: #fff;
}

.auth-google-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-find-result {
  font-size: 12px;
  font-weight: 600;
  min-height: 18px;
  text-align: center;
}

/* ===== 사이트 인포 푸터 ===== */
.site-info {
  text-align: center;
  padding: 28px 20px 32px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.site-info a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}

.site-info a:hover { text-decoration: underline; }

.site-info-sep {
  font-size: 12px;
  color: var(--border);
  margin: 0 6px;
}

.site-info-copy {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  opacity: 0.7;
}

.site-info-delete-btn {
  font-size: 12px;
  color: #e63312;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

/* ===== Community Detail SSR ===== */
.detail-page {
  background: var(--bg);
  max-width: none;
  margin: 0;
  padding-bottom: 24px;
}

.detail-page .site-header,
.community-detail {
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.detail-header-inner {
  min-height: 44px;
  gap: 12px;
  padding-left: 10px;
  padding-right: 12px;
}

.detail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.detail-back-icon {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  flex-shrink: 0;
}

.detail-back-icon::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: rotate(45deg);
}

.detail-source-link {
  color: #292526;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.detail-page .app-promo-banner {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.app-promo-bottom {
  margin: 16px -16px -22px;
  border-radius: 0;
}

.detail-recommend {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-recommend-block {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}

.detail-recommend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  margin-bottom: 10px;
}

.detail-recommend-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.detail-recommend-more {
  font-size: 12px;
  color: var(--text-muted);
}

.detail-recommend-header:hover .detail-recommend-more {
  color: var(--accent);
}

.detail-recommend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-recommend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 8px 6px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.detail-recommend-item:hover {
  background: var(--bg);
}

.detail-recommend-rank {
  flex-shrink: 0;
  width: 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
}

.detail-recommend-rank.rank-1 { color: var(--rank1); }
.detail-recommend-rank.rank-2 { color: var(--rank2); }
.detail-recommend-rank.rank-3 { color: var(--rank3); }

.detail-recommend-text {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-recommend-loading {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 6px;
}

.detail-explore-nav {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px;
  margin-top: 10px;
  text-align: center;
}

.detail-explore-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.detail-explore-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.detail-explore-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.detail-explore-tab:hover,
.detail-explore-tab:active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.detail-explore-source {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}

.detail-explore-source:hover {
  color: var(--accent);
}

.community-detail {
  padding: 8px 0 28px;
}

.community-article {
  width: 100%;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 16px 22px;
}

.community-detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.community-detail-meta {
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-detail-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  line-height: 1.34;
  letter-spacing: 0;
  margin-bottom: 14px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.community-post-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 14px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.community-post-author-main {
  min-width: 0;
  overflow-wrap: anywhere;
}

.community-post-author-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.post-stat-view,
.post-stat-cache {
  white-space: nowrap;
}

.post-stat-referrer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ref-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}
.ref-google    { background: #e8f0fe; color: #1a56db; }
.ref-naver     { background: #e6f4ea; color: #1d6f42; }
.ref-instagram { background: #fce7f3; color: #9d174d; }
.ref-facebook  { background: #e0e7ff; color: #3730a3; }
.ref-kakao     { background: #fef9c3; color: #713f12; }
.ref-youtube   { background: #fee2e2; color: #991b1b; }
.ref-direct    { background: #f0f0f0; color: #555; }
.ref-other     { background: #fef3c7; color: #92400e; }

.post-action-edit,
.post-action-delete {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
  background: none;
}

.post-action-edit {
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}
.post-action-edit:hover {
  border-color: var(--text-muted);
  color: var(--text-dim);
}

.post-action-delete {
  border: 1px solid rgba(230, 51, 18, 0.3);
  color: var(--rank1);
}
.post-action-delete:hover {
  border-color: var(--rank1);
  background: rgba(230, 51, 18, 0.05);
}

.community-post-author strong {
  color: var(--text);
  font-weight: 900;
}

.community-stat-row {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 4px;
}

.community-stat-row span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.community-image-list {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: calc(100% + 32px);
  margin: 0 -16px 18px;
  overflow: hidden;
  background: var(--bg);
}

.community-image-list img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg);
}

.community-video-list {
  display: grid;
  gap: 10px;
  width: calc(100% + 32px);
  margin: 0 -16px 18px;
  background: var(--bg);
}

.community-video-list iframe,
.community-video-list video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

.community-media-list {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: calc(100% + 32px);
  margin: 0 -16px 18px;
  overflow: hidden;
  background: var(--bg);
}

.community-media-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg);
}

.community-media-iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

.community-media-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 92vh;
  border: 0;
  background: #000;
}

.community-detail-content {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.78;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.community-detail-content p + p {
  margin-top: 10px;
}

.community-detail-content img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
  object-fit: contain;
  border-radius: var(--radius);
}

.community-detail-content div,
.community-detail-content p {
  margin: 0 0 10px;
}

.community-detail-content p:empty,
.community-detail-content div:empty,
.community-detail-content span:empty,
.community-detail-content p:has(> br:only-child),
.community-detail-content div:has(> br:only-child) {
  display: none;
}

.community-detail-content a {
  color: var(--accent);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.community-source-credit {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.community-source-credit a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.hotissue-write-page {
  background: #fff;
}

.hotissue-compose {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px;
}

.hotissue-compose-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border-light);
  padding: 16px;
}

.hotissue-compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hotissue-compose-head h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.hotissue-compose-head button {
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
}

.hotissue-compose-error {
  margin: 0;
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
}

.hotissue-compose-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: #374151;
}

.hotissue-compose-field small {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.hotissue-compose-field input,
.hotissue-compose-field select,
.hotissue-compose-field textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 500;
  color: #111827;
  resize: vertical;
}

.hotissue-notice-field {
  align-self: flex-start;
  margin-top: -2px;
}

.hotissue-detail-admin {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 6px;
}

.hotissue-detail-admin a,
.hotissue-detail-admin button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.hotissue-detail-admin button {
  color: #dc2626;
}

.community-original-frame-wrap {
  position: relative;
  width: calc(100% + 32px);
  margin: 0 -16px -22px;
  background: var(--bg);
}

.community-original-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 52px);
  min-height: 620px;
  border: 0;
  background: #fff;
}

.community-original-fallback {
  display: grid;
  gap: 8px;
  padding: 12px 16px 16px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.community-original-fallback a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.community-original-open {
  display: grid;
  gap: 10px;
  place-items: center;
  width: calc(100% + 32px);
  min-height: 80px;
  margin: 0 -16px -22px;
  padding: 24px 18px;
  background: var(--bg);
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

.community-original-open a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.community-detail-empty {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.community-detail-empty a {
  color: var(--accent);
}

.community-comments {
  width: 100%;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
  padding: 14px 16px 18px;
}

.community-section-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 10px;
}

.community-source-comments {
  display: grid;
  gap: 8px;
}

.community-source-comments p {
  color: var(--text-dim);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.community-comment-form {
  margin-top: 12px;
}

.detail-reaction-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 34px 0 4px;
  color: var(--text-muted);
}

.detail-like-btn,
.detail-comment-jump,
.detail-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 38px;
  min-height: 34px;
  padding: 5px 4px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.detail-like-btn svg,
.detail-comment-jump svg,
.detail-share-btn svg {
  pointer-events: none;
}

.detail-like-btn.liked {
  color: #e6335a;
}

.detail-like-btn.liked svg {
  fill: #e6335a;
  stroke: #e6335a;
}

.detail-share-btn.copied {
  color: var(--accent);
}

.detail-toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom, 0px) + 18px);
  z-index: 500;
  transform: translate(-50%, 10px);
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.detail-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.community-detail-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
}

.community-detail-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 200px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

/* ===== My Account 페이지 ===== */
#myAcctPage {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  overscroll-behavior: contain;
  overflow: hidden;
}

#myAcctPage[hidden] { display: none; }

#myAcctPage.open { transform: translateX(0); }

.my-acct-appbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  height: 48px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.my-acct-appbar-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.3px;
}

.my-acct-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.my-acct-page-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  min-height: 0;
}

.my-acct-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.my-acct-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #8397c3;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.my-acct-section-label {
  padding: 16px 16px 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.my-acct-form-wrap {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.my-acct-form-wrap .fb-input { margin: 0; }

.my-acct-posts-wrap {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.my-acct-posts-loading {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.my-acct-stats-wrap {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.my-acct-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.my-acct-stats-row:last-child { border-bottom: none; }
.my-acct-stats-row.divider-top { border-top: 2px solid var(--border); }

.my-acct-stats-label { color: var(--text-dim); }

.my-acct-stats-val {
  text-align: right;
}
.my-acct-stats-val strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.my-acct-stats-val small {
  font-size: 11px;
  color: var(--text-muted);
}

.my-acct-stats-refresh {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  padding: 0 4px;
  line-height: 1;
}
.my-acct-stats-refresh:hover { color: var(--text); }

.my-acct-stats-ref-block {
  border-top: 1px solid var(--border);
  padding-top: 2px;
}
.my-acct-stats-ref-title {
  font-size: 11px;
  color: var(--text-dim);
  padding: 6px 14px 2px;
}
.my-acct-stats-ref-block .my-acct-stats-row {
  border-bottom: none;
  padding-top: 3px;
  padding-bottom: 3px;
}
.my-acct-stats-ref-block .my-acct-stats-label {
  font-size: 12px;
  padding-left: 6px;
}
.my-acct-stats-ref-block .my-acct-stats-val strong {
  font-size: 13px;
  font-weight: 600;
}
.my-acct-stats-other-hosts {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 14px 6px 20px;
  word-break: break-all;
}

.my-acct-search-posts {
  padding: 4px 14px 8px;
}

.my-acct-search-post-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text);
}

.my-acct-search-post-item:last-child {
  border-bottom: none;
}

.my-acct-search-post-title {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-acct-search-post-stats {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
}

.my-acct-search-post-stats .ref-badge {
  font-size: 10.5px;
  padding: 1px 5px;
}

.my-acct-post-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.my-acct-post-item:last-child { border-bottom: none; }

.my-acct-home-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  user-select: none;
}
.my-acct-home-opt:last-child { border-bottom: none; }
.my-acct-home-opt:active { background: var(--bg); }

.my-acct-home-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}
.my-acct-home-opt.active .my-acct-home-check {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--card);
}

.my-acct-post-title {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
}

.my-acct-post-date {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.my-acct-empty {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 공통 커스텀 모달 ===== */
.app-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.app-modal {
  background: var(--card);
  border-radius: 14px;
  padding: 22px 20px 14px;
  width: min(300px, 88vw);
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
}
.app-modal-title {
  font-size: 15px; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
  line-height: 1.4;
}
.app-modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.app-modal-btn {
  padding: 8px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 700;
  border: none; cursor: pointer;
}
.app-modal-btn-cancel { background: var(--bg); color: var(--text-muted); }
.app-modal-btn-ok     { background: var(--accent); color: #fff; }
.app-modal-btn-del    { background: var(--rank1); color: #fff; }

/* ===== 반응형 ===== */
@media (min-width: 480px) {
  body {
    background: #e8e9ec;
  }

  .site-header,
  .main-tabs-bar,
  .sub-tabs-bar {
    box-shadow: var(--shadow-sm);
  }
}
