@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&family=Outfit:wght@400;600;800&family=Space+Grotesk:wght@500;700&family=Montserrat:wght@700;800&display=swap");

:root {
  --primary-color: #3b82f6;
  --primary-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --bg-color: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --accent-red: #f43f5e;
  --glass-blur: blur(16px);
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  background-image:
    radial-gradient(circle at 0% 0%, #e0e7ff 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, #e0e7ff 0%, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Light mode: 흰색 계열 배경 + 진한 글자 (대비) ===== */
body.light-mode {
  --bg-color: #f8fafc;
  /* boards.css 판 화면(.pans-page, .compose-panel 등)과 공유 */
  --bg-primary: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: rgba(15, 23, 42, 0.1);
  background-color: #f8fafc;
  background-image: none;
  color: #0f172a;
}

body.light-mode .header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.light-mode .logo {
  color: #0f172a;
}

body.light-mode .logo-accent {
  color: #ca8a04;
  text-shadow: none;
}

body.light-mode .tab-menu {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .tab-item {
  color: #64748b;
  opacity: 0.85;
}

body.light-mode .tab-item.active {
  color: #0f172a;
  opacity: 1;
}

body.light-mode .tab-item.tab-dynamic {
  color: #6d28d9;
  opacity: 0.9;
}

body.light-mode .tab-item.tab-dynamic:hover,
body.light-mode .tab-item.tab-dynamic.active {
  color: #5b21b6;
  opacity: 1;
}

body.light-mode .tab-item.tab-group-header {
  color: #64748b; /* Unified color like news app */
  opacity: 0.85;
}

body.light-mode .tab-item.tab-group-header.active {
  color: #0f172a;
  opacity: 1;
}

body.light-mode .community-source-filter {
  background: #f1f5f9;
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .community-filter-chip {
  border-color: rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: #475569;
}

body.light-mode .community-filter-chip.active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

body.light-mode .pancard {
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.08);
  backdrop-filter: none;
}

body.light-mode #panfeed.list-mode .pancard,
body.light-mode .panfeed.list-mode .pancard {
  background: #ffffff;
  border-bottom-color: rgba(15, 23, 42, 0.07);
}

body.light-mode #panfeed.list-mode .pancard:active,
body.light-mode .panfeed.list-mode .pancard:active {
  background: #f1f5f9;
}

body.light-mode #panfeed.community-list-mode .pancard,
body.light-mode .panfeed.community-list-mode .pancard {
  background: #ffffff;
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.light-mode #panfeed.community-list-mode .pantitle,
body.light-mode .panfeed.community-list-mode .pantitle {
  color: #0f172a;
}

body.light-mode .pantitle {
  color: #0f172a;
}

body.light-mode .publisher-name {
  color: #475569;
}

body.light-mode .time {
  color: #64748b;
  opacity: 1;
}

body.light-mode .action-item {
  color: #475569;
}

body.light-mode .action-item:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

body.light-mode .publisher-icon {
  background: rgba(15, 23, 42, 0.06);
}

body.light-mode .header-avatar {
  background: #e2e8f0;
}

body.light-mode .toast {
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
}

body.light-mode .search-result-count strong {
  color: #a16207;
}

body.light-mode .my-pan-row:hover {
  background: rgba(15, 23, 42, 0.04);
}

body.light-mode .detail-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

body.light-mode .back-btn {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

body.light-mode .back-btn:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.18);
}

body.light-mode .font-controls {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.1);
}

body.light-mode .font-btn {
  color: #64748b;
}

body.light-mode .font-btn:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
}

body.light-mode .detail-footer {
  background: rgba(255, 255, 255, 0.97);
  border-top-color: rgba(15, 23, 42, 0.1);
}

body.light-mode .detail-action-item:hover {
  background: rgba(15, 23, 42, 0.06);
}

body.light-mode #pull-to-refresh-indicator .refresh-spinner,
body.light-mode #pull-to-refresh-indicator .refresh-text {
  color: #334155;
}

body.light-mode .ad-banner-slot.is-bottom {
  background: rgba(255, 255, 255, 0.92);
  border-top-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .ad-banner-inner {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
  color: #64748b;
}

.search-highlight {
  color: #fde047;
  font-weight: 700;
}

body.light-mode .search-highlight {
  color: #ca8a04;
}

body.light-mode .search-overlay {
  background: rgba(241, 245, 249, 0.98);
}

body.light-mode .search-input-wrapper input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}

body.light-mode .search-clear-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #64748b;
}

body.light-mode .search-submit-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

body.light-mode .search-result-count {
  border-bottom-color: rgba(0, 0, 0, 0.05);
  color: #64748b;
}

body.light-mode .search-result-item {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .search-result-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

body.light-mode .search-result-thumb {
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .search-result-item--pan {
  border-left-color: #0ea5e9;
}

body.light-mode .search-result-thumb--pan {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
}

body.light-mode .breaking-badge {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.32);
}

.header {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: var(--glass-blur);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.logo-container:active {
  transform: scale(0.96);
}

.header-logo {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(140, 85, 33, 0.2);
  border: 1.5px solid rgba(140, 85, 33, 0.3);
  content: url("../assets/logo_retro.png");
}

body.light-mode .header-logo {
  content: url("../assets/logo_retro.png");
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .user-profile-btn,
body.light-mode .icon-btn {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 5px 6px;
  color: #1e293b;
}

body.light-mode .user-profile-btn:hover,
body.light-mode .icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.logo {
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.logo-accent {
  display: inline-block;
  position: relative;
  top: 2px;
  margin: 0 1px;
  color: #fde047;
  text-shadow: 0 0 12px rgba(253, 224, 71, 0.5);
  transform: rotate(180deg);
}

.logo-pan {
  color: #8c5521; /* Warm brown matching the retro board frame */
  text-shadow: 0 0 10px rgba(140, 85, 33, 0.2);
  letter-spacing: -0.06em;
}

body.light-mode .logo-pan {
  color: #8c5521;
  text-shadow: none;
}

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

.user-profile-btn {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.08);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.user-profile-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.header-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: #334155;
  flex-shrink: 0;
}

.header-nickname {
  display: none !important;
}

#join-board-header-btn svg {
  display: block;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.icon-btn:active {
  transform: scale(0.9);
}

.ad-banner-slot {
  margin: 10px 14px 0 14px;
  text-align: center;
}

.ad-banner-slot.is-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) 14px;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-color);
  z-index: 950;
}

.ad-banner-inner {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 14px 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.tab-menu {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: var(--glass-blur);
  padding: 4px 20px;
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  gap: 24px;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 50px;
  z-index: 900;
}

.tab-menu::-webkit-scrollbar {
  display: none;
}

.community-source-filter {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 14px 9px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  position: sticky;
  top: 92px;
  z-index: 890;
}

.community-source-filter::-webkit-scrollbar {
  display: none;
}

.community-filter-chip {
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.community-filter-chip.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}

@media (max-width: 380px) {
  .header-nickname {
    display: none;
  }

  .user-profile-btn {
    padding: 5px;
  }

  .logo {
    font-size: 18px;
  }
}

.tab-item {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  padding: 6px 4px;
  letter-spacing: -0.02em;
}

.tab-item.active {
  color: var(--text-primary);
  opacity: 1;
}

.tab-item.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3.5px;
  background: #3b82f6; /* Bold blue from news app */
  border-radius: 2px;
}

/* 동적 AI 해시태그 탭 (해시태그로 시작하는 애들) */
.tab-item.tab-dynamic {
  font-size: 14px;
  color: #a78bfa;
  opacity: 0.8;
}

.tab-item.tab-dynamic:hover,
.tab-item.tab-dynamic.active {
  color: #c4b5fd;
  opacity: 1;
}

/* 그룹핑 단어 탭 ([정치], [경제] 등) */
.tab-item.tab-group-header {
  font-size: 15px;
  font-weight: 800;
  color: #fde047;
  opacity: 1;
  margin-left: 12px;
}

.tab-item.tab-group-header:first-of-type {
  margin-left: 0;
}

.tab-item.tab-group-header:hover,
.tab-item.tab-group-header.active {
  color: #fbbf24;
}

.panfeed {
  max-width: 600px;
  margin: 0 auto;
  padding: 4px 0 100px 0;
}

.pancard {
  background: var(--card-bg);
  margin: 2px 14px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.pancard:active {
  transform: scale(0.98);
}

.panimage {
  width: 100%;
  aspect-ratio: 18 / 9;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.panvideo {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  margin-bottom: 20px;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
}

.detail-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
  overflow: hidden;
}

/* panDetail UI Improvements */
.detail-footer-icons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.detail-footer-left {
  display: flex;
  align-items: center;
}

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

.detail-action-item.liked .icon {
  color: #fde047;
  text-shadow: 0 0 10px rgba(253, 224, 71, 0.4);
}

/* ===== List View Mode ===== (#panfeed = 메인 피드 컨테이너) */
#panfeed.list-mode .pancard,
.panfeed.list-mode .pancard {
  border-radius: 0;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-left: none;
  border-right: none;
  border-top: none;
  box-shadow: none;
  backdrop-filter: none;
  background: rgba(255, 255, 255, 0.01);
  /* Solid hit area */
  cursor: pointer;
  position: relative;
  pointer-events: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "content image"
    "meta meta";
  align-items: start;
}

#panfeed.list-mode .pancard:active,
.panfeed.list-mode .pancard:active {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(0.998);
  transition:
    transform 0.1s,
    background 0.1s;
}

#panfeed.list-mode .ppanmage,
.panfeed.list-mode .ppanmage {
  grid-area: image;
  width: 90px;
  height: 64px;
  border-radius: 8px;
  margin: 8px 16px 0 8px;
  object-fit: cover;
  aspect-ratio: auto;
  max-height: none;
}

#panfeed.list-mode .pancontent,
.panfeed.list-mode .pancontent {
  grid-area: content;
  padding: 8px 8px 4px 16px;
}

#panfeed.list-mode .pantitle,
.panfeed.list-mode .pantitle {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#panfeed.list-mode .publisher-row,
.panfeed.list-mode .publisher-row {
  margin-bottom: 2px;
}

#panfeed.list-mode .publisher-icon,
.panfeed.list-mode .publisher-icon {
  width: 18px;
  height: 18px;
}

#panfeed.list-mode .publisher-name,
.panfeed.list-mode .publisher-name {
  font-size: 12px;
}

#panfeed.list-mode .panmeta,
.panfeed.list-mode .panmeta {
  grid-area: meta;
  padding: 4px 16px 8px 16px !important;
  margin-top: 0;
}

#panfeed.list-mode .action-bar,
.panfeed.list-mode .action-bar {
  gap: 8px;
}

#panfeed.list-mode .action-item .icon,
.panfeed.list-mode .action-item .icon {
  font-size: 14px;
}

#panfeed.list-mode .action-item,
.panfeed.list-mode .action-item {
  font-size: 12px;
  padding: 3px 6px;
}

/* 이웃판·랭킹: 큰 썸네일 없이 출처 아이콘+제목 위주 */
#panfeed.community-list-mode .pancard,
.panfeed.community-list-mode .pancard {
  border-radius: 0;
  margin: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
  backdrop-filter: none;
  background: rgba(255, 255, 255, 0.01);
}

#panfeed.community-list-mode .ppanmage,
.panfeed.community-list-mode .ppanmage {
  display: none !important;
}

#panfeed.community-list-mode .pancontent,
.panfeed.community-list-mode .pancontent {
  padding: 10px 16px 4px 16px;
}

#panfeed.community-list-mode .publisher-row,
.panfeed.community-list-mode .publisher-row {
  margin-bottom: 3px;
}

#panfeed.community-list-mode .publisher-icon,
.panfeed.community-list-mode .publisher-icon {
  width: 18px;
  height: 18px;
}

#panfeed.community-list-mode .pantitle,
.panfeed.community-list-mode .pantitle {
  font-size: 15px;
  line-height: 1.42;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#panfeed.community-list-mode .panmeta,
.panfeed.community-list-mode .panmeta {
  padding: 4px 16px 10px 16px !important;
}

/* 내판·관심판·전체판: 출처 행 아래 제목(좌) + 판 대표 이미지(우), 뉴스 목록과 동일 톤 */
#panfeed.community-list-mode .pancard.community-card .pan-title-row,
.panfeed.community-list-mode .pancard.community-card .pan-title-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  margin-top: 4px;
}

#panfeed.community-list-mode .pancard.community-card .pan-title-row .pantitle,
.panfeed.community-list-mode .pancard.community-card .pan-title-row .pantitle {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

#panfeed.community-list-mode .pancard.community-card .pan-post-thumb-wrap,
.panfeed.community-list-mode .pancard.community-card .pan-post-thumb-wrap {
  flex-shrink: 0;
  width: 92px;
  max-width: 30%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a5f, #0f172a);
  align-self: flex-start;
}

#panfeed.community-list-mode .pancard.community-card .pan-post-thumb,
.panfeed.community-list-mode .pancard.community-card .pan-post-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.light-mode #panfeed.community-list-mode .pancard.community-card .pan-post-thumb-wrap,
body.light-mode .panfeed.community-list-mode .pancard.community-card .pan-post-thumb-wrap {
  background: #e2e8f0;
}

/* 내판 탭: 표 형식 목록 (레거시 — 카드 UI로 대체됨, 호환용 유지) */
#panfeed.my-pan-feed,
.panfeed.my-pan-feed {
  padding: 0;
}

.my-pan-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.my-pan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.my-pan-table thead th {
  background: rgba(15, 23, 42, 0.92);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  white-space: nowrap;
}

.my-pan-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.my-pan-table .col-no {
  width: 42px;
  text-align: center;
  color: var(--text-secondary);
}

.my-pan-table .col-pan {
  max-width: 100px;
  word-break: break-word;
}

.my-pan-table .col-title {
  word-break: break-word;
  line-height: 1.35;
}

.my-pan-table .col-num {
  width: 52px;
  text-align: right;
  color: var(--text-secondary);
  white-space: nowrap;
}

.my-pan-row {
  cursor: pointer;
}

.my-pan-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

body.light-mode .my-pan-table thead th {
  background: rgba(248, 250, 252, 0.95);
}

body.light-mode .my-pan-table td {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* View toggle icon styling */
.view-toggle-icon {
  transition: transform 0.2s ease;
}

.view-toggle-icon:active {
  transform: scale(0.85);
}

.pancontent {
  padding: 4px 16px 0 16px;
}

.publisher-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 0;
}

.publisher-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.publisher-name {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.breaking-badge {
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  line-height: 1.2;
}

.pantitle {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 1px;
}

.panmeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 6px 16px;
  border-top: none;
  margin-top: 0;
}

.time {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
  opacity: 0.7;
}

/* ===== panArticle Footer (source, reporter info) ===== */
.panarticle-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-item {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.action-bar {
  display: flex;
  gap: 20x;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 13px;
}

.action-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.icon {
  font-size: 16px;
}

.ad-banner {
  background: var(--primary-gradient);
  border-radius: 20px;
  margin: 16px;
  padding: 30px;
  text-align: center;
  font-weight: 800;
  color: white;
  font-size: 18px;
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}

.ad-banner::before {
  content: "AD";
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.floating-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: var(--glass-blur);
  padding: 12px 24px;
  border-radius: 100px;
  display: flex;
  gap: 32px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 2000;
}

.nav-item {
  font-size: 24px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.nav-item.active {
  opacity: 1;
  color: var(--primary-color);
}

/* ===== Search Overlay ===== */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(20px);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.search-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.search-bar {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-input-wrapper input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 14px 44px 14px 20px;
  /* Extra right padding for X button */
  font-size: 16px;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.search-input-wrapper input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.search-submit-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
  flex-shrink: 0;
}

.search-submit-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.search-submit-btn:active {
  transform: scale(0.95);
}

.search-close-btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 0 5px;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.8;
}

.search-close-btn-text:hover {
  opacity: 1;
  color: var(--text-primary);
}

/* Search Result Count */
.search-result-count {
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  font-weight: 500;
}

.search-result-count strong {
  color: #fde047;
  font-weight: 700;
}

/* panFeed Loading & Empty States */
.feed-loading-container {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.3s ease-in-out;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.infinite-loader {
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
}

.infinite-loader.hidden {
  display: none;
}

#panfeed.loading,
.panfeed.loading {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

/* 앱(WebView) 전용: 당겨서 새로고침 — 기본은 화면 밖, 당길 때만 노출 */
#pull-to-refresh-indicator.pull-to-refresh {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  transform: translateY(-72px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
}

#pull-to-refresh-indicator.pull-to-refresh.ptr-dragging {
  transition: none;
}

#pull-to-refresh-indicator .refresh-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#pull-to-refresh-indicator .refresh-spinner {
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
}

#pull-to-refresh-indicator .refresh-text {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
}

#pull-to-refresh-indicator.pull-to-refresh.ptr-refreshing .refresh-spinner {
  animation: ptr-pull-spin 0.75s linear infinite;
}

@keyframes ptr-pull-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Search History */
.search-history {
  padding: 16px 20px;
}

.search-history-title {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-history-clear {
  font-size: 12px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.search-history-clear:hover {
  opacity: 1;
}

.search-history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.search-chip:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.search-chip-delete {
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.search-chip-delete:hover {
  opacity: 1;
  color: #f43f5e;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.search-result-item:active {
  background: rgba(255, 255, 255, 0.1);
}

.search-result-thumb {
  width: 72px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.search-result-pub {
  font-size: 12px;
  color: var(--text-secondary);
}

.search-result-category {
  font-size: 11px;
  color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.search-result-item--pan {
  border-left: 3px solid rgba(34, 211, 238, 0.45);
}

.search-result-thumb--pan {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: rgba(34, 211, 238, 0.95);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.search-result-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 20px;
  font-size: 15px;
  line-height: 1.6;
}

.search-empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ===== YouTube-style Comment Panel ===== */
.comment-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 6000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  box-sizing: border-box;
  padding-bottom: calc(
    env(safe-area-inset-bottom, 0px) + var(--comment-keyboard-inset, 0px)
  );
  transition: opacity 0.25s ease;
}

@media (min-width: 601px) {
  .comment-overlay {
    justify-content: center;
    align-items: center;
  }

  .comment-overlay > .comment-slider,
  .comment-overlay > .comment-input-bar {
    width: 100%;
    max-width: 450px;
  }

  .comment-panel {
    width: 450px !important;
    height: 80vh !important;
    border-radius: 24px !important;
  }
}

.comment-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.comment-overlay.hidden .comment-slider {
  transform: translateY(100%);
}

.comment-slider {
  width: 100%;
  height: 75vh;
  display: flex;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  /* This will be used to slide between panels */
}

/* When this class is added, the slider moves to show the reply panel */
.comment-slider.show-replies {
  transform: translateX(-100%);
}

.comment-panel {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  background: #0f172a;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: #0f172a;
  z-index: 10;
}

.comment-header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.comment-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-sort-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.comment-sort-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* ===== Comment Sort Dropdown ===== */
.comment-sort-wrapper {
  position: relative;
}

.comment-sort-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #1e293b;
  border-radius: 10px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 100;
  min-width: 200px;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease-out;
}

.comment-sort-dropdown.hidden {
  display: none;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.comment-sort-item {
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s;
}

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

.comment-sort-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.comment-sort-item.active {
  background: rgba(59, 130, 246, 0.12);
}

.sort-item-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 3px;
}

.comment-sort-item.active .sort-item-title {
  color: #60a5fa;
}

.sort-item-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.comment-back-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background 0.2s;
}

.comment-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.reply-parent-container {
  padding: 16px 16px 8px 16px;
  background: rgba(255, 255, 255, 0.03);
}

.comment-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0 16px;
  opacity: 0.5;
}

.comment-close-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  opacity: 0.8;
}

.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 16px 0; /* Reduced from 100px to 16px to prevent excessive empty space at bottom */
}

/* Comment Item Style */
.comment-item {
  display: flex;
  gap: 10px;
  padding: 8px 16px;
  position: relative;
}

.comment-item.is-reply {
  padding: 4px 16px 4px 48px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.comment-item.is-reply .comment-avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-avatar.sun {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.comment-avatar.ocean {
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

.comment-avatar.silver {
  background: linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%);
}

.comment-avatar.pastel {
  background: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
}

.comment-avatar.volcanic {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.comment-avatar.forest {
  background: linear-gradient(135deg, #5ee7df 0%, #b490ca 100%);
}

.comment-avatar.night {
  background: linear-gradient(135deg, #243949 0%, #517fa4 100%);
}

.comment-avatar.lavender {
  background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

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

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

.comment-menu-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.6;
  padding: 4px;
}

.comment-nickname {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
}

.comment-time {
  font-size: 11px;
  color: #64748b;
}

.comment-text {
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 3px;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.comment-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 18px;
  transition: background 0.2s;
}

.comment-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.comment-action-btn.liked {
  color: #f1f5f9;
  /* Active color in dark theme often stays light */
}

.comment-action-btn.disliked {
  color: #f1f5f9;
}

.comment-action-btn .icon {
  font-size: 16px;
  opacity: 0.9;
}

.comment-action-btn .count {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
}

.comment-action-btn.liked .count,
.comment-action-btn.liked .icon {
  color: #60a5fa;
}

.comment-action-btn.disliked .count,
.comment-action-btn.disliked .icon {
  color: #f87171;
}

/* Redesigned View Replies as a blue link */
.view-replies-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #60a5fa;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  padding: 4px 0;
  width: fit-content;
}

.view-replies-btn:after {
  content: " >";
  font-size: 12px;
  margin-left: 2px;
}

/* Connector line for main parent in reply view */
/* Parent comment in reply view adjustments */
.comment-item.reply-view-parent {
  padding-bottom: 4px;
}

.reply-view .comment-item:first-child:after {
  display: block;
}

/* Bottom Input Bar Style */
/* Consolidated with line 2704 */

.comment-input-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.comment-bar-input {
  flex: 1;
  background: #0f172a;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  color: #f1f5f9;
  font-size: 14px;
  cursor: pointer;
}

.comment-input-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 12px;
}

.comment-input-bar-right .icon {
  font-size: 20px;
  cursor: pointer;
}

/* Expanded Input Area */
.expanded-comment-area {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0f172a;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.expanded-comment-area.hidden {
  transform: translateY(100%);
  visibility: hidden;
  pointer-events: none;
  display: flex !important;
  /* Keep flex to allow transition but hide with transform */
}

.expanded-input-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.expanded-input-header button {
  background: none;
  border: none;
  color: #f1f5f9;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.expanded-input-header .submit-btn {
  color: #3b82f6;
}

.expanded-comment-area textarea {
  flex: 1;
  background: none;
  border: none;
  color: #f1f5f9;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.comment-avatar.mini {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.view-replies-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3b82f6;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  padding: 8px 0;
  margin-left: 2px;
  /* Pull back slightly for YouTube look */
}

.view-replies-btn:hover {
  color: #60a5fa;
}

.view-replies-btn .icon {
  font-size: 10px;
  transition: transform 0.2s;
}

.view-replies-btn.open .icon {
  transform: rotate(180deg);
}

/* Consolidating is-reply styles */
.comment-item.is-reply .comment-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

/* Comment Input Area */
/* Removed unused legacy styles */

.comment-text-input:focus + .comment-input-actions,
.comment-input-actions:hover,
.comment-input-actions.active {
  display: flex;
}

.comment-cancel-btn {
  background: none;
  border: none;
  color: white;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 20px;
}

.comment-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.comment-submit-btn {
  background: #3b82f6;
  border: none;
  color: white;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 20px;
  opacity: 0.6;
}

.comment-submit-btn.ready {
  opacity: 1;
}

/* Nested Reply Input */
.reply-input-area {
  margin-top: 12px;
  display: flex;
  gap: 12px;
}

/* Level 3+ comments should not indent their reply input containers further */
.comment-item[data-level="3"] .reply-input-area,
.comment-item[data-level="4"] .reply-input-area {
  margin-left: 0 !important;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

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

.comment-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
}

.comment-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.comment-action-btn.liked {
  color: #3b82f6;
}

.comment-action-btn.disliked {
  color: #ef4444;
  /* Use red for dislike */
}

.comment-action-group .count {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.view-replies-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #3b82f6;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  transition: background 0.2s;
}

.view-replies-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

.view-replies-btn .icon {
  display: flex;
  align-items: center;
}

.comment-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 20px;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.comment-empty::before {
  content: "💬";
  font-size: 40px;
  opacity: 0.3;
}

/* Comment Input Area */
.comment-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: #1a2332;
  border-radius: 0 0 0 0;
}

.comment-nickname-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  margin-bottom: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.comment-nickname-input:focus {
  border-color: var(--primary-color);
}

.comment-nickname-input::placeholder {
  color: var(--text-secondary);
}

.comment-input-row {
  display: flex;
  gap: 8px;
}

.comment-text-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  min-height: 80px;
}

.comment-text-input:focus {
  border-color: var(--primary-color);
}

.comment-text-input::placeholder {
  color: var(--text-secondary);
}

.comment-submit-btn {
  background: var(--primary-gradient);
  border: none;
  color: white;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition:
    opacity 0.2s,
    transform 0.1s;
  white-space: nowrap;
}

.comment-submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.comment-submit-btn:active {
  transform: translateY(0);
}

.comment-item {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Bottom Sheet Menu ===== */
.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.bottom-sheet-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.bottom-sheet {
  width: 100%;
  max-width: 600px;
  background: #1e293b;
  border-radius: 20px 20px 0 0;
  padding: 12px 0 32px 0;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.bottom-sheet-overlay.hidden .bottom-sheet {
  transform: translateY(100%);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  margin: 0 auto 16px auto;
}

.bottom-sheet-title {
  padding: 0 20px 12px 20px;
  font-size: 14px;
  color: #94a3b8;
  font-weight: 600;
}

.bottom-sheet-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  width: 100%;
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.bottom-sheet-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.bottom-sheet-item .icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

/* Edit Mode */
.comment-edit-area {
  margin-top: 8px;
}

.comment-edit-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  color: white;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}

.comment-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* ===== Redesigned Share Sheet ===== */
.share-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.share-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.share-sheet {
  width: 100%;
  max-width: 500px;
  background: #121212;
  /* Very dark background */
  border-radius: 20px 20px 0 0;
  padding: 16px 0 32px 0;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.share-overlay.hidden .share-sheet {
  transform: translateY(100%);
}

.share-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 16px 20px;
}

.share-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.share-close-x {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.share-url-area {
  padding: 0 16px 24px 16px;
}

.share-url-box {
  background: #262626;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-url-icon {
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.share-url-text {
  flex: 1;
  font-size: 14px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-copy-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.share-scroll-container {
  margin-bottom: 24px;
}

.share-row-label {
  padding: 0 20px 12px 20px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.share-horizontal-scroll {
  display: flex;
  gap: 20px;
  padding: 0 20px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.share-horizontal-scroll::-webkit-scrollbar {
  display: none;
}

.share-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 64px;
  cursor: pointer;
}

.share-item-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  background: #334155;
  overflow: hidden;
}

.share-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-item-label {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  white-space: nowrap;
  max-width: 64px;
  overflow: hidden;
}

/* Icon Colors */
.bg-gray {
  background: #475569;
}

.bg-green {
  background: #15803d;
}

.bg-blue-dark {
  background: #000000;
  border: 1px solid #334155;
}

.bg-blue-lite {
  background: #1877f2;
}

.bg-yellow {
  background: #fee500;
  color: #3c1e1e !important;
}

.bg-red {
  background: #dc2626;
}

.bg-blue {
  background: #2563eb;
}

/* Like button active state */
.action-item.liked .icon {
  color: #3b82f6;
}

.action-item.liked span:last-child {
  color: #3b82f6;
  font-weight: 600;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 41, 59, 0.95);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition:
    opacity 0.3s,
    transform 0.3s;
  pointer-events: none;
  border: 1px solid var(--border-color);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== About Modal ===== */
.about-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.about-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.about-modal {
  width: 100%;
  max-width: 400px;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.about-overlay.hidden .about-modal {
  transform: scale(0.9);
}

.about-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.about-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.about-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.about-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.about-content {
  padding: 32px 24px;
  text-align: center;
}

.about-logo-section {
  margin-bottom: 24px;
}

.about-logo-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-gradient);
  border-radius: 22px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

.about-logo-icon img {
  width: 50px;
  height: 50px;
}

.about-app-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.about-version {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  opacity: 0.7;
}

.about-info-grid {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 24px;
  display: grid;
  gap: 12px;
}

.about-info-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.info-label {
  color: var(--text-secondary);
}

.info-value {
  color: var(--text-primary);
  font-weight: 600;
}

.about-description {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
  background: linear-gradient(to bottom, var(--text-secondary), #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.about-footer {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.5;
}

/* 앱 정보 모달 — 라이트 모드(배경·설명 그라데이션 등이 다크 전용으로 고정돼 있던 부분 보정) */
body.light-mode .about-overlay {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(10px);
}

body.light-mode .about-modal {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.08),
    0 25px 50px -12px rgba(15, 23, 42, 0.12);
}

body.light-mode .about-header {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .about-title {
  color: #64748b;
}

body.light-mode .about-close-btn {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

body.light-mode .about-close-btn:hover {
  background: rgba(15, 23, 42, 0.11);
}

body.light-mode .about-info-grid {
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

body.light-mode .about-description {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: unset;
  color: #475569;
}

body.light-mode .about-footer {
  color: #94a3b8;
  opacity: 1;
}

/* ===== Mobile Responsive Adjustments ===== */
@media (max-width: 600px) {
  .header {
    padding: 12px 16px;
  }

  .logo {
    font-size: 26px;
  }

  .tab-menu {
    padding: 10px 16px;
    gap: 16px;
    top: 56px;
  }

  .tab-item {
    font-size: 14px;
  }

  .tab-item.tab-group-header {
    font-size: 14px;
    margin-left: 8px;
  }

  .tab-item.active::after {
    bottom: -10px;
  }

  .panfeed {
    padding: 4px 0 20px 0;
  }

  .pancard {
    margin: 10px 12px;
    border-radius: 20px;
  }

  .pancontent {
    padding: 15px;
  }

  .pantitle {
    font-size: 17px;
    line-height: 1.4;
    margin-bottom: 12px;
  }

  .publisher-row {
    gap: 8px;
    margin-bottom: 8px;
  }

  .publisher-icon {
    width: 20px;
    height: 20px;
  }

  .publisher-name {
    font-size: 13px;
  }

  .panmeta {
    padding-top: 15px;
  }

  .action-bar {
    gap: 12px;
  }

  .action-item {
    padding: 6px 8px;
    gap: 6px;
  }

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

/* ===== panDetail Overlay ===== */
.pandetail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  z-index: 5500;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    visibility 0.3s ease;
}

.pandetail-overlay.hidden {
  transform: translateY(100%);
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.detail-header {
  height: 50px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.detail-header-left,
.detail-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.back-btn:active {
  transform: scale(0.95);
}

.original-link-btn {
  background: var(--accent-gradient);
  color: white;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
  transition: all 0.2s ease;
}

.original-link-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.3);
  filter: brightness(1.1);
}

.font-controls {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2px;
}

.font-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.font-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.detail-scroll-area {
  flex: 1;
  overflow-y: hidden;
  padding: 0;
  /* Space for fixed footer */
  background: var(--bg-color);
}

.detail-content {
  max-width: 800px;
  margin: 0 auto;
}

.detail-content .panimage,
.detail-content .panvideo {
  width: 100%;
  height: auto;
  object-fit: contain;
  max-height: 70vh;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
}

.detail-media {
  margin-bottom: 24px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.detail-body {
  padding: 24px 24px 100px 24px;
}

.detail-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.detail-meta {
  margin-bottom: 30px;
}

.detail-text {
  font-size: var(--detail-text-size, 17px);
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
}

.detail-text div {
  margin-bottom: 20px;
}

/* panArticle Footer (Reporter, Copyright, Tags) */
.panarticle-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-item {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-item:first-child {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.font-adjust-btn {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-secondary);
}

.font-adjust-btn:hover {
  color: var(--text-primary);
}

/* ===== Detail Footer ===== */
.detail-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 54px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 5600;
}

.detail-footer-btn-group {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-footer-btn-group {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-footer-icons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.detail-action-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.detail-action-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.detail-action-item .icon {
  font-size: 20px;
}

.detail-action-item span:last-child {
  font-size: 14px;
  font-weight: 600;
}

.detail-action-item.liked {
  color: var(--primary-color);
}

/* ===== Article Content Image Constraints ===== */
.detail-text img {
  max-width: 100%;
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  margin: 8px auto;
}

.panarticle-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-item {
  margin-bottom: 4px;
  line-height: 1.5;
}

/* Paragraph spacing inside article body */
.detail-text p {
  margin: 0 0 14px 0;
  line-height: 1.85;
  word-break: break-word;
}

.detail-text p:last-child {
  margin-bottom: 0;
}

/* ===== Emoji Picker & Unified Comment Auto-Resize ===== */
.comment-input-bar {
  display: flex;
  align-items: flex-end;
  padding: 10px 16px;
  background: var(--bg-color, #1e293b);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  gap: 12px;
  flex-shrink: 0; /* Ensure the input bar doesn't shrink when list grows */
  z-index: 100;
}

.reply-content-scroll-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  background: transparent;
}

.reply-content-scroll-area .comment-list {
  overflow-y: visible !important;
  height: auto !important;
  flex: none !important;
}

body.light-mode .reply-content-scroll-area {
  background: #ffffff;
}

.comment-input-bar-left {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: 1;
}

.comment-bar-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 165, 0, 0.5); /* Subtle orange border matching user screenshot */
}

body.light-mode .comment-bar-input-wrapper {
  background: #f8fafc;
  border: 1px solid #eab308;
}

.comment-bar-input.auto-resize {
  flex: 1;
  background: transparent !important;
  border: none !important;
  color: var(--text-primary, white);
  font-size: 15px;
  padding: 8px 32px 8px 8px;
  resize: none;
  outline: none !important;
  box-shadow: none !important;
  max-height: 120px;
  min-height: 38px;
  line-height: 1.4;
  overflow-y: auto;
  scrollbar-width: none;
  font-family: inherit;
  box-sizing: border-box;
}

.comment-bar-emoji-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  color: inherit;
  opacity: 0.8;
}

.comment-bar-emoji-btn:hover {
  opacity: 1;
}

.comment-input-submit-btn {
  background: #eab308;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  flex-shrink: 0;
  margin-bottom: 2px;
  transition: transform 0.1s;
}

.comment-input-submit-btn:active {
  transform: scale(0.95);
}

.comment-input-bar .emoji-picker {
  position: absolute;
  bottom: 100%;
  right: 16px;
  margin-bottom: 8px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 10px;
  display: grid !important;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  z-index: 1000;
  width: 280px;
  max-height: 200px;
  overflow-y: auto;
}

body.light-mode .comment-input-bar .emoji-picker {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.comment-input-bar .emoji-picker.hidden {
  display: none !important;
}

.emoji-item {
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  text-align: center;
  transition:
    background 0.2s,
    transform 0.1s;
  user-select: none;
}

.emoji-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

body.light-mode .emoji-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Detail Loading & Iframe Fallback */
.detail-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-secondary);
  width: 100%;
  z-index: 10;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3.5px solid var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

/* ===== Comment Light Mode Redesign ===== */
body.light-mode .comment-panel {
  background: #ffffff !important;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1) !important;
}

body.light-mode .comment-container {
  background: #ffffff !important;
}

body.light-mode .comment-header {
  background: #ffffff !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .comment-header-title,
body.light-mode .comment-nickname,
body.light-mode .comment-text {
  color: #0f172a !important;
}

body.light-mode .comment-time {
  color: #64748b !important;
}

body.light-mode .comment-action-btn {
  color: #64748b !important;
}

body.light-mode .comment-action-btn:hover {
  background: rgba(0, 0, 0, 0.03) !important;
  color: #0f172a !important;
}

body.light-mode .comment-input-bar {
  background: #ffffff !important;
  border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Removed unused legacy styles */

body.light-mode .comment-bar-input.auto-resize {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body.light-mode .comment-bar-input::placeholder,
body.light-mode .comment-text-input::placeholder {
  color: #94a3b8 !important;
}

/* Removed unused legacy styles */

body.light-mode .reply-parent-container {
  background: #f8fafc !important;
}

body.light-mode .comment-cancel-btn {
  color: #64748b !important;
}

body.light-mode .comment-cancel-btn:hover {
  background: rgba(0, 0, 0, 0.03) !important;
}

body.light-mode .comment-nickname-input {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .expanded-comment-area {
  background: #ffffff !important;
}

body.light-mode .expanded-input-header button {
  color: #0f172a !important;
}

body.light-mode .expanded-input-header .submit-btn {
  color: #3b82f6 !important;
}

body.light-mode .expanded-comment-area textarea {
  color: #0f172a !important;
}

/* AI 브리핑 Card */
.ai-briefing-container {
  padding: 12px 16px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.briefing-card {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1) 0%,
    rgba(147, 51, 234, 0.1) 100%
  );
  border: 1px solid rgba(147, 51, 234, 0.2);
  border-radius: 16px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.briefing-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.briefing-badge {
  background: linear-gradient(135deg, #3b82f6 0%, #9333ea 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-right: 10px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(147, 51, 234, 0.3);
}

.briefing-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.briefing-content {
  position: relative;
  max-height: none;
  transition: max-height 0.4s ease-out;
  overflow: hidden;
}

.briefing-content.collapsed {
  max-height: 100px;
  /* Approximately 3 lines of bullet points */
}

.briefing-content.collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(239, 246, 255, 0.9));
  /* Light blue/purple gradient fallback */
  pointer-events: none;
}

/* Dark mode override for the fade-out gradient */
.dark-mode .briefing-content.collapsed::after {
  background: linear-gradient(to bottom, transparent, rgba(15, 23, 42, 0.9));
}

.briefing-content ul {
  margin: 0;
  padding-left: 20px;
  list-style-type: none;
}

.briefing-content ul li {
  position: relative;
  margin-bottom: 8px;
  line-height: 1.5;
  font-size: 0.95rem;
  color: var(--text-primary);
  opacity: 0.9;
}

.briefing-content ul li::before {
  content: "•";
  color: #9333ea;
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

.briefing-toggle-container {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.briefing-expand-btn {
  background: rgba(147, 51, 234, 0.1);
  border: 1px solid rgba(147, 51, 234, 0.2);
  color: #9333ea;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.briefing-expand-btn:hover {
  background: rgba(147, 51, 234, 0.2);
  transform: translateY(-1px);
}

.briefing-expand-btn svg {
  transition: transform 0.3s ease;
}

.briefing-expand-btn.expanded svg {
  transform: rotate(180deg);
}

.briefing-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  max-width: 100%;
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border-radius: 6px;
  margin-left: 6px;
  margin-bottom: 2px;
  padding: 4px 8px;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.15s;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(59, 130, 246, 0.25);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.briefing-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.briefing-link-title {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.briefing-link:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.5);
  transform: scale(1.02);
}

.briefing-link:active {
  background: #3b82f6;
  color: white;
  transform: scale(0.98);
}

body.light-mode .briefing-link {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
}

body.light-mode .briefing-link:hover {
  background: rgba(59, 130, 246, 0.22);
}

body.light-mode .briefing-link:active {
  background: #2563eb;
  color: white;
}

.briefing-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.briefing-icon-mini {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  opacity: 0.7;
}

/* Dark mode adjustments */
.dark-mode .briefing-card {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.15) 0%,
    rgba(147, 51, 234, 0.15) 100%
  );
  border: 1px solid rgba(147, 51, 234, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
