/* ==========================================================================
   오투깨비 (O2kkaebi) - Main Stylesheet
   한국 전래동화 그림책 · 한지 · 낮의 초가 마을 밝은 테마
   ========================================================================== */

:root {
  /* 배경 & 서페이스 (따뜻하고 포근한 한지/미색 크림톤) */
  --bg-main: #FAF8F5;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FBF9F5;
  --bg-input: #FFFFFF;
  --bg-modal-overlay: rgba(38, 33, 28, 0.45);

  /* 테두리 & 디바이더 (정갈한 한지 선) */
  --border-subtle: #E8E2D8;
  --border-focus: #D97706;
  --border-glow: rgba(217, 119, 6, 0.2);

  /* 포인트 색상 (한국 전통 감빛 · 호박 · 비취 청록 · 다홍 · 쪽빛) */
  --color-primary: #D97706;      /* 따뜻한 감빛 · 호박석 골드 */
  --color-primary-hover: #B45309;
  --color-primary-light: #FEF3C7;
  --color-primary-soft: #FFFBEB;
  --color-goblin: #059669;       /* 비취빛 도깨비 청록 */
  --color-goblin-glow: #0284C7;
  --color-talisman: #DC2626;     /* 부적 다홍 */
  --color-purple: #7C3AED;       /* 주술 보라 */

  /* 텍스트 (깊고 또렷한 먹색) */
  --text-primary: #26211C;
  --text-secondary: #5C5449;
  --text-muted: #8C8275;
  --text-dim: #A89F91;

  /* 시스템 상태 */
  --status-online: #059669;
  --status-offline: #8C8275;
  --status-gold: #B45309;
  --status-orange: #C2410C;
  --status-green: #15803D;
  --status-gray: #64748B;
  --status-red: #B91C1C;

  /* 폰트 */
  --font-brand: 'Gowun Dodum', -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
  --font-body: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;

  /* 애니메이션 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;

  /* Safe Area */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

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

html {
  font-size: 16px;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  height: 100%;
}

body {
  min-height: 100%;
  height: 100%;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Atmosphere (은은한 한지 햇살 무드) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 380px;
  background: radial-gradient(ellipse at 50% -100px, rgba(217, 119, 6, 0.05) 0%, rgba(5, 150, 105, 0.03) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: 0.95rem;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  touch-action: manipulation;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--border-glow);
}

/* ==========================================================================
   인라인 선 아이콘 공통 규격
   ========================================================================== */

.ui-icon {
  width: 1.15em;
  height: 1.15em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.ui-icon.spin {
  animation: ui-spin 1s linear infinite;
}

@keyframes ui-spin {
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Header & Nav
   ========================================================================== */

#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding-top: var(--sat);
  box-shadow: 0 1px 3px rgba(90, 75, 55, 0.04);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 56px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

@media (min-width: 600px) {
  .header-inner {
    height: 60px;
    padding: 0 16px;
    gap: 12px;
  }
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  min-width: 0;
  flex-shrink: 1;
}

.brand-logo-wrap {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.15);
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .brand-logo-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
}

.brand-logo-svg {
  width: 19px;
  height: 19px;
  stroke: var(--color-primary);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-title {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

@media (max-width: 375px) {
  .brand-title {
    font-size: 1rem;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Claude 고정 버튼 (지시문 1절) */
.btn-header-claude {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1.5px solid rgba(217, 119, 6, 0.45);
  color: #B45309;
  border-radius: 18px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 4px rgba(217, 119, 6, 0.12);
  cursor: pointer;
  white-space: nowrap;
}

.claude-btn-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--status-red);
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 6px rgba(185, 28, 28, 0.6);
  pointer-events: none;
}

.btn-header-claude:hover {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.22);
}

.btn-header-claude:active {
  transform: translateY(0);
}

.claude-btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background-color: var(--status-offline);
}

.claude-btn-dot.online {
  background-color: var(--status-online);
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.6);
}

.claude-btn-dot.offline {
  background-color: var(--status-offline);
}

.claude-btn-icon {
  width: 15px;
  height: 15px;
  stroke: #B45309;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.claude-btn-text {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Install Button (Header에서 제거됨) */
.btn-header-install {
  display: none !important;
}

/* User Profile Trigger */
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(90, 75, 55, 0.05);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.user-menu-trigger:hover {
  border-color: var(--border-focus);
  box-shadow: 0 2px 8px rgba(90, 75, 55, 0.08);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #E8E2D8;
  display: block;
}

.user-avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F3EEE5, #E5DDD3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  border: 1px solid rgba(90, 75, 55, 0.12);
}

.user-nickname {
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

/* User Menu Dropdown */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  width: 220px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(90, 75, 55, 0.12);
  padding: 8px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  animation: fadeInDown 0.15s ease-out;
}

.user-dropdown-menu.show {
  display: flex;
}

.dropdown-user-info {
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.dropdown-user-nickname {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.dropdown-user-grade {
  font-size: 0.78rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 2px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-radius: 8px;
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

.dropdown-item.danger {
  color: #DC2626;
}

.dropdown-item.danger:hover {
  background-color: #FEF2F2;
  color: #B91C1C;
}

/* PC Online Status Sub-bar (Claude 버튼으로 통합되어 머리 아래 줄 숨김) */
.pc-status-bar {
  display: none !important;
}

/* ==========================================================================
   Main App Container
   ========================================================================== */

#app-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 10px calc(28px + var(--sab));
  position: relative;
  z-index: 1;
}

@media (min-width: 600px) {
  #app-main {
    padding: 20px 16px calc(36px + var(--sab));
  }
}

/* ==========================================================================
   3-1. Login Screen
   ========================================================================== */

.login-container {
  max-width: 440px;
  margin: 32px auto 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(90, 75, 55, 0.08);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-talisman), var(--color-primary), var(--color-goblin));
  z-index: 2;
}

.login-hero-img-wrap {
  width: 100%;
  height: 180px;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  background: #F4EFEA;
}

.login-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.login-content-wrap {
  padding: 24px 24px 28px;
}

.login-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--color-primary-soft);
  border: 1px solid rgba(217, 119, 6, 0.3);
  color: var(--color-primary);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.login-title {
  font-family: var(--font-brand);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-desc {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin-bottom: 28px;
  word-break: keep-all;
}

/* Login Error Alert */
.login-error-alert {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 24px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

/* Google Sign-In Wrap */
.gsi-button-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  min-height: 44px;
}

/* Dev Login Box */
.dev-login-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-subtle);
  text-align: left;
}

.dev-login-toggle-btn {
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 500;
}

.dev-login-toggle-btn:hover {
  color: var(--color-primary);
}

.dev-login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FBF9F5;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.dev-login-form select,
.dev-login-form input {
  font-size: 0.9rem;
  padding: 8px 12px;
}

.btn-dev-login {
  background: #2563EB;
  color: #FFFFFF;
  font-weight: 600;
  padding: 9px;
  border-radius: 8px;
  transition: background var(--transition-fast);
}

.btn-dev-login:hover {
  background: #1D4ED8;
}

.login-footer-links {
  margin-top: 24px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.login-footer-links a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* ==========================================================================
   3-2. Main Dashboard Screen (#/)
   ========================================================================== */

/* Main Hero Banner with hero.jpg */
.main-hero-card {
  margin-bottom: 16px;
}

.main-hero-banner {
  width: 100%;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 18px rgba(90, 75, 55, 0.06);
  margin-bottom: 10px;
  background-color: #F4EFEA;
}

@media (min-width: 600px) {
  .main-hero-card {
    margin-bottom: 24px;
  }
  .main-hero-banner {
    height: 190px;
    border-radius: 18px;
    margin-bottom: 14px;
  }
}

.main-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}

.main-welcome {
  padding: 0 4px;
}

.main-welcome-greeting {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.main-welcome-name {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1px;
}

@media (min-width: 600px) {
  .main-welcome-greeting {
    font-size: 1.05rem;
  }
  .main-welcome-name {
    font-size: 1.6rem;
    margin-top: 2px;
  }
}

/* Feature Tiles Grid (첫 화면에서 타일까지 바로 보이게) */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 600px) {
  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
  }
}

.feature-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(90, 75, 55, 0.04);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

@media (min-width: 600px) {
  .feature-tile {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 18px;
    gap: 12px;
    border-radius: 16px;
  }
}

.feature-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 119, 6, 0.4);
  box-shadow: 0 8px 20px rgba(90, 75, 55, 0.08);
}

.feature-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transition: background var(--transition-fast);
}

.feature-tile.tile-qna::before {
  background: linear-gradient(90deg, #2563EB, #059669);
}

.feature-tile.tile-decks::before {
  background: linear-gradient(90deg, #D97706, #DC2626);
}

.feature-tile.tile-guides::before {
  background: linear-gradient(90deg, #059669, #D97706);
}

.feature-tile.tile-news::before {
  background: linear-gradient(90deg, #0284C7, #2563EB);
}

.feature-tile.tile-wiki::before {
  background: linear-gradient(90deg, #7C3AED, #2563EB);
}

.tile-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .tile-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.4rem;
  }
}

.tile-qna .tile-icon-wrap {
  background: #EFF6FF;
  color: #2563EB;
}

.tile-decks .tile-icon-wrap {
  background: #FFFBEB;
  color: #D97706;
}

.tile-guides .tile-icon-wrap {
  background: #ECFDF5;
  color: #059669;
}

.tile-news .tile-icon-wrap {
  background: #F0F9FF;
  color: #0284C7;
}

.tile-wiki .tile-icon-wrap {
  background: #F5F3FF;
  color: #7C3AED;
}

.tile-content {
  flex: 1;
  min-width: 0;
}

.tile-title {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

@media (min-width: 600px) {
  .tile-title {
    font-size: 1.3rem;
    margin-bottom: 4px;
  }
}

.tile-desc {
  font-size: 0.875rem; /* 본문 최소 14px */
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 600px) {
  .tile-desc {
    font-size: 0.92rem;
    white-space: normal;
  }
}

.tile-arrow {
  font-size: 1.1rem;
  color: var(--color-primary);
  font-weight: bold;
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .tile-arrow {
    align-self: flex-end;
  }
}

/* Empty Features Notice */
.empty-features-card {
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.empty-features-card p {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

/* Past QnA Section on Main Dashboard (지시문 2절) */
.main-past-qna-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 10px;
  box-shadow: 0 2px 8px rgba(90, 75, 55, 0.04);
}

@media (min-width: 600px) {
  .main-past-qna-card {
    border-radius: 16px;
    padding: 16px 18px;
    margin-top: 12px;
  }
}

.past-qna-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.past-qna-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.past-qna-link {
  font-size: 0.85rem;
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.past-qna-link:hover {
  text-decoration: underline;
}

.main-recent-threads-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.main-recent-thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.main-recent-thread-row:hover {
  background: var(--color-primary-soft);
  border-color: rgba(217, 119, 6, 0.35);
}

.main-recent-thread-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
}

.main-recent-empty {
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 4px 0;
}

/* Home Install Card */
.install-guide-card {
  background: linear-gradient(135deg, #FFFDF8 0%, #FEF9EE 100%);
  border: 1px solid #FDE68A;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.06);
}

@media (min-width: 600px) {
  .install-guide-card {
    border-radius: 16px;
    padding: 18px 20px;
    gap: 16px;
    margin-top: 10px;
    box-shadow: 0 4px 18px rgba(217, 119, 6, 0.08);
  }
}

.install-guide-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

@media (min-width: 600px) {
  .install-guide-left {
    gap: 14px;
  }
}

.install-guide-icon {
  font-size: 1.5rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .install-guide-icon {
    font-size: 1.8rem;
  }
}

.install-guide-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

@media (min-width: 600px) {
  .install-guide-title {
    font-size: 1rem;
  }
}

.install-guide-desc {
  font-size: 0.875rem; /* 본문 최소 14px */
  color: var(--text-secondary);
  margin-top: 1px;
}

.btn-install-card {
  padding: 8px 14px;
  background: var(--color-primary);
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 0.875rem; /* 본문 최소 14px */
  transition: background var(--transition-fast);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .btn-install-card {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.92rem;
  }
}

.btn-install-card:hover {
  background: var(--color-primary-hover);
}

/* ==========================================================================
   3-3. QnA Screen (#/qna & #/qna/:id)
   ========================================================================== */

/* QnA Layout (PC 2단 레이아웃 지원) */
.qna-view-container {
  display: flex;
  gap: 20px;
  min-height: calc(100vh - 160px);
}

.qna-list-pane {
  flex: 1;
  max-width: 100%;
}

.qna-detail-pane {
  flex: 1.35;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 140px);
  box-shadow: 0 4px 18px rgba(90, 75, 55, 0.05);
}

/* 반응형 분기: 모바일에서는 단일 화면, PC에서는 2단 */
@media (max-width: 859px) {
  .qna-view-container.mode-list .qna-detail-pane {
    display: none;
  }
  .qna-view-container.mode-detail .qna-list-pane {
    display: none;
  }
  .qna-detail-pane {
    height: calc(100vh - 120px);
    border-radius: 14px;
  }
}

@media (min-width: 860px) {
  .qna-list-pane {
    max-width: 380px;
    height: calc(100vh - 140px);
    overflow-y: auto;
    padding-right: 4px;
  }
  .qna-view-container.mode-list .qna-detail-placeholder {
    display: flex;
  }
}

/* QnA List Header */
.qna-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.qna-page-title {
  font-family: var(--font-brand);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-new-thread {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary);
  color: #FFFFFF;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  transition: background var(--transition-fast);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2);
}

.btn-new-thread:hover {
  background: var(--color-primary-hover);
}

/* Thread Item */
.thread-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
  display: block;
  box-shadow: 0 1px 3px rgba(90, 75, 55, 0.03);
}

.thread-item:hover {
  border-color: #D5CCBF;
  background: var(--bg-card-hover);
  box-shadow: 0 3px 8px rgba(90, 75, 55, 0.06);
}

.thread-item.active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.12);
}

.thread-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.thread-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 8px;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.status-badge.new {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.status-badge.seen {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.status-badge.answered {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.status-badge.failed {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.thread-last-msg {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.thread-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.thread-deck-chip {
  background: #F4EFEA;
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Detail Pane Header */
.detail-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: #FAF8F5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 8px;
  border-radius: 6px;
}

.btn-detail-back:hover {
  background: var(--color-primary-soft);
}

.detail-header-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Chat Messages Stream */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #FAF8F5;
}

@media (min-width: 600px) {
  .chat-messages-container {
    padding: 16px;
    gap: 14px;
  }
}

/* Message Bubble */
.chat-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  margin-bottom: 2px;
}

@media (min-width: 600px) {
  .chat-bubble-wrap {
    max-width: 75%;
    margin-bottom: 4px;
  }
}

.chat-bubble-wrap.user {
  align-self: flex-end;
}

.chat-bubble-wrap.claude {
  align-self: flex-start;
}

.chat-sender-info {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

@media (min-width: 600px) {
  .chat-sender-info {
    margin-bottom: 4px;
    font-size: 0.8rem;
  }
}

.sender-lantern {
  width: 14px;
  height: 14px;
  stroke: var(--color-primary);
}

.chat-bubble-wrap.user .chat-sender-info {
  justify-content: flex-end;
}

.chat-bubble {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.875rem; /* 본문 최소 14px */
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

@media (min-width: 600px) {
  .chat-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
  }
}

/* User Bubble (마크다운 없음, 줄바꿈 유지) */
.chat-bubble.user {
  background: #2563EB;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* Claude Bubble (마크다운 렌더링) */
.chat-bubble.claude {
  background: #FFFFFF;
  border: 1px solid #E5DFD5;
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  box-shadow: 0 3px 12px rgba(90, 75, 55, 0.05);
}

/* Claude Markdown Rendering Styles (밝은 바탕 최적화) */
.chat-bubble.claude h1,
.chat-bubble.claude h2,
.chat-bubble.claude h3,
.chat-bubble.claude h4 {
  color: #1F1A16;
  margin-top: 14px;
  margin-bottom: 8px;
  font-weight: 700;
  line-height: 1.35;
}

.chat-bubble.claude h1 { font-size: 1.25rem; }
.chat-bubble.claude h2 { font-size: 1.15rem; }
.chat-bubble.claude h3 { font-size: 1.05rem; }

.chat-bubble.claude p {
  margin-bottom: 10px;
  color: var(--text-primary);
}

.chat-bubble.claude p:last-child {
  margin-bottom: 0;
}

.chat-bubble.claude strong,
.chat-bubble.claude b {
  font-weight: 700;
  color: #111827;
}

.chat-bubble.claude ul,
.chat-bubble.claude ol {
  margin-left: 20px;
  margin-bottom: 10px;
}

.chat-bubble.claude li {
  margin-bottom: 4px;
  color: var(--text-primary);
}

.chat-bubble.claude code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #F4EFEA;
  border: 1px solid #EAE1D5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88rem;
  color: #B45309;
  font-weight: 600;
}

.chat-bubble.claude pre {
  background: #F9F7F3;
  border: 1px solid #E5DDD3;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 10px 0;
}

.chat-bubble.claude pre code {
  background: none;
  border: none;
  padding: 0;
  color: #26211C;
  font-weight: normal;
}

.chat-bubble.claude blockquote {
  border-left: 3px solid var(--color-primary);
  background: #FDFBF7;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
  margin: 10px 0;
}

/* 표 가로 스크롤 허용 (지시문 요구사항: 표는 가로 스크롤 허용, 표 바깥 페이지는 가로 스크롤 금지) */
.chat-bubble.claude table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.chat-bubble.claude th,
.chat-bubble.claude td {
  border: 1px solid #DFD7CA;
  padding: 8px 14px;
  text-align: left;
  font-size: 0.88rem;
}

.chat-bubble.claude th {
  background: #F3EEE5;
  color: #1F1A16;
  font-weight: 700;
}

.chat-bubble.claude tr:nth-child(even) td {
  background: #FAF8F5;
}

/* Attachments in Chat */
.chat-attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.chat-thumb-img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.chat-thumb-img:hover {
  transform: scale(1.03);
}

/* Claude Writing Indicator (답을 쓰고 있어요...) */
.claude-writing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #FFFBEB;
  border: 1px dashed #FCD34D;
  border-radius: 12px;
  color: var(--color-primary);
  font-size: 0.88rem;
  font-weight: 600;
  width: fit-content;
  margin-top: 4px;
}

.writing-dots {
  display: inline-flex;
  gap: 4px;
}

.writing-dots span {
  width: 5px;
  height: 5px;
  background-color: var(--color-primary);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.writing-dots span:nth-child(1) { animation-delay: -0.32s; }
.writing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Chat Input Bar (하단 고정) */
.chat-input-bar {
  padding: 8px 12px calc(8px + var(--sab));
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (min-width: 600px) {
  .chat-input-bar {
    padding: 12px 16px calc(12px + var(--sab));
    gap: 10px;
  }
}

.input-deck-chip-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  background: var(--color-primary-soft);
  border: 1px solid rgba(217, 119, 6, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--color-primary);
  font-weight: 600;
  width: fit-content;
}

@media (min-width: 600px) {
  .input-deck-chip-bar {
    gap: 8px;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 8px;
  }
}

.btn-remove-deck-chip {
  cursor: pointer;
  color: var(--color-primary);
  font-weight: bold;
}

.input-preview-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
}

@media (min-width: 600px) {
  .input-preview-bar {
    gap: 8px;
    padding-bottom: 4px;
  }
}

.preview-thumb-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .preview-thumb-wrap {
    width: 60px;
    height: 60px;
  }
}

.preview-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.btn-remove-thumb {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #EF4444;
  color: #FFFFFF;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #FFFFFF;
}

.input-controls-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

@media (min-width: 600px) {
  .input-controls-row {
    gap: 10px;
  }
}

.chat-textarea {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 140px;
  line-height: 1.4;
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  background-color: #FFFFFF;
  font-size: 0.92rem;
}

@media (min-width: 600px) {
  .chat-textarea {
    min-height: 44px;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 1rem;
  }
}

.btn-attach-img {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F7F4EE;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

@media (min-width: 600px) {
  .btn-attach-img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.25rem;
  }
}

.btn-attach-img:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.btn-send-msg {
  height: 40px;
  padding: 0 16px;
  background: var(--color-primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.875rem; /* 본문 최소 14px */
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  transition: background var(--transition-fast);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

@media (min-width: 600px) {
  .btn-send-msg {
    height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 0.92rem;
  }
}

.btn-send-msg:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-send-msg:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Detail Placeholder (PC) */
.qna-detail-placeholder {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--text-muted);
  height: 100%;
}

.placeholder-icon {
  font-size: 3rem;
  opacity: 0.35;
  color: var(--color-primary);
}

.empty-icon-wrap {
  font-size: 2.2rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

/* ==========================================================================
   3-4. Decks Screen (#/decks) — 3단 구조 (지시문 3절)
   ========================================================================== */

.decks-view-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
}

/* 3-1. 상단 틀 고정 프로필 띠 (머리줄 바로 아래 스크롤해도 고정) */
.decks-sticky-bar {
  position: sticky;
  top: calc(56px + var(--sat));
  z-index: 70;
  background-color: rgba(250, 248, 245, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 10px;
  margin: -12px -10px 12px -10px;
  box-shadow: 0 1px 3px rgba(90, 75, 55, 0.04);
}

@media (min-width: 600px) {
  .decks-sticky-bar {
    margin: -20px -16px 16px -16px;
    padding: 8px 16px;
    top: calc(60px + var(--sat));
  }
}

.sticky-profile-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sticky-profile-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.sticky-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.sticky-nick {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.sticky-level {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border: 1px solid rgba(217, 119, 6, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
}

.sticky-power {
  font-size: 0.8rem;
  font-weight: 700;
  color: #B45309;
}

.sticky-styles-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.sticky-styles-chips::-webkit-scrollbar {
  display: none;
}

.sticky-style-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(90, 75, 55, 0.03);
}

.sticky-style-chip .style-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.sticky-updated-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.sticky-owner-line {
  font-size: 0.86rem;
  color: #B45309;
  font-weight: 600;
  padding: 2px 0;
}

/* 3-4. PC 넓은 화면 나란히 (2단 레이아웃) & 모바일 단일 패널 */
.decks-layout-container {
  display: flex;
  gap: 16px;
  width: 100%;
  min-height: calc(100vh - 160px);
}

@media (max-width: 859px) {
  .decks-layout-container.mode-list .decks-detail-pane {
    display: none;
  }
  .decks-layout-container.mode-detail .decks-list-pane {
    display: none;
  }
  .decks-list-pane {
    width: 100%;
    max-width: 100%;
  }
  .decks-detail-pane {
    width: 100%;
    max-width: 100%;
  }
}

@media (min-width: 860px) {
  .decks-layout-container {
    gap: 20px;
  }
  .decks-list-pane {
    max-width: 380px;
    width: 380px;
    flex-shrink: 0;
    height: calc(100vh - 150px);
    overflow-y: auto;
    padding-right: 4px;
  }
  .decks-detail-pane {
    flex: 1;
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 16px;
    height: calc(100vh - 150px);
    overflow-y: auto;
    box-shadow: 0 4px 18px rgba(90, 75, 55, 0.05);
  }
}

/* 3-2. 지금 쓰는 덱 카드 */
.current-decks-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(90, 75, 55, 0.04);
}

.current-decks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.current-decks-title {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.current-decks-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.current-decks-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 6px;
  text-align: center;
  background: #FAF8F5;
  border-radius: 6px;
  border: 1px dashed var(--border-subtle);
  line-height: 1.4;
}

.current-deck-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.current-deck-item:hover {
  background: var(--color-primary-soft);
  border-color: rgba(217, 119, 6, 0.4);
}

.current-deck-cat {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  flex-shrink: 0;
}

.current-ult-wrap {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
}

.current-ult-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.current-ult-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: bold;
  background: #F3E8FF;
  color: #7C3AED;
}

.current-deck-texts {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.current-deck-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-deck-measure {
  font-size: 0.74rem;
  color: var(--status-green);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-deck-arrow {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 상황 탭 (사냥, 보스, 레이드, PvP, 기타) */
.deck-category-tabs-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
  scrollbar-width: none;
}

.deck-category-tabs-bar::-webkit-scrollbar {
  display: none;
}

.deck-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(90, 75, 55, 0.03);
}

.deck-category-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.deck-category-tab.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.deck-category-tab .tab-count {
  font-size: 0.72rem;
  opacity: 0.85;
  font-weight: 700;
}

.tab-decks-list-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tab-decks-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px dashed var(--border-subtle);
}

.deck-rows-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 탭 안 목록: 덱 하나 = 한 줄 */
.deck-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(90, 75, 55, 0.03);
}

.deck-list-row:hover {
  background: var(--bg-card-hover);
  border-color: #D5CCBF;
  box-shadow: 0 2px 6px rgba(90, 75, 55, 0.06);
}

.deck-list-row.selected {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.12);
}

.deck-list-row.is-current {
  border-left: 3.5px solid var(--color-primary);
}

.deck-row-ult-box {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.deck-row-ult-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  display: block;
}

.deck-row-ult-fallback {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  background: #F3E8FF;
  color: #7C3AED;
  font-size: 0.7rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #D8B4FE;
}

.deck-row-style-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid #FFFFFF;
}

.deck-row-name-wrap {
  flex: 1;
  min-width: 0;
}

.deck-row-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.deck-row-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.deck-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
  white-space: nowrap;
}

.deck-chip.is-current-badge {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  font-weight: 700;
}

.deck-chip.cat-badge {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
  font-weight: 700;
}

/* Status 칩 색상 규칙 (지시문 85줄: 실측 시작=초록, 추정=주황, 추천 시작=금색, 그 밖=회색) */
.deck-chip.status-green {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.deck-chip.status-orange {
  background: #FFEDD5;
  color: #C2410C;
  border: 1px solid #FDBA74;
}

.deck-chip.status-gold {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE047;
}

.deck-chip.status-gray {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

.deck-chip.ult-badge {
  background: #F3E8FF;
  color: #7C3AED;
  border: 1px solid #D8B4FE;
}

.deck-row-arrow {
  font-size: 0.95rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 지난 덱 N개 접힌 영역 */
.archived-decks-accordion {
  margin-top: 10px;
  background: #FAF8F5;
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.archived-decks-summary {
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.archived-decks-summary:hover {
  color: var(--text-primary);
}

.summary-caret {
  font-size: 0.75rem;
  transition: transform var(--transition-fast);
}

.archived-decks-accordion[open] .summary-caret {
  transform: rotate(180deg);
}

.archived-decks-list {
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ==========================================================================
   3-3. 덱 상세 화면 (#/decks/<key>)
   ========================================================================== */

.deck-detail-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 10px;
  box-shadow: 0 2px 10px rgba(90, 75, 55, 0.04);
}

@media (min-width: 600px) {
  .deck-detail-view {
    border-radius: 16px;
    padding: 16px;
    gap: 12px;
  }
}

.deck-detail-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-deck-back {
  align-self: flex-start;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-primary);
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  margin-bottom: 2px;
}

.btn-deck-back:hover {
  background: var(--color-primary-soft);
}

@media (min-width: 860px) {
  .btn-deck-back {
    display: none;
  }
}

.deck-detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.deck-detail-name {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

@media (min-width: 600px) {
  .deck-detail-name {
    font-size: 1.3rem;
  }
}

.deck-detail-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.deck-detail-note {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* 도술 판 (Game Board Matrix) — 폭 360~390px 폰에서도 절대 넘치지 않게 */
.game-skill-board {
  background: #F3EEE5;
  border: 1px solid #DFD7CA;
  border-radius: 10px;
  padding: 6px 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  overflow: hidden;
}

@media (min-width: 600px) {
  .game-skill-board {
    border-radius: 12px;
    padding: 8px 6px;
    gap: 6px;
  }
}

/* 판 윗줄 (4칸: 추가1, 멤버십, 추가2, 궁극기) */
.board-row-top {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

/* 판 아랫줄 (5칸: 기본1 ~ 기본5) */
.board-row-bottom {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
}

/* 개별 도술 슬롯 */
.skill-slot {
  background: #FFFFFF;
  border: 1.5px solid #DCD4C7;
  border-radius: 7px;
  padding: 2px 1px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  box-shadow: 0 1px 2px rgba(90, 75, 55, 0.04);
  cursor: pointer;
  user-select: none;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: transform 0.12s, border-color 0.12s;
}

.skill-slot:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(90, 75, 55, 0.1);
}

.skill-slot:active {
  transform: scale(0.97);
}

/* 궁극기 칸 돋보이게 */
.skill-slot.is-ult {
  background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
  border: 2px solid #8B5CF6;
}

/* 궁극기와 같은 계열인 칸 강조 */
.skill-slot.is-matched-style {
  box-shadow: 0 0 6px var(--match-color);
  border: 2px solid var(--match-color) !important;
}

.slot-pos-label {
  font-size: 10px;
  color: #786F63;
  margin-bottom: 1px;
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.1;
}

.skill-slot.is-ult .slot-pos-label {
  color: #7C3AED;
  font-weight: 700;
}

.skill-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #DDD6CB;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 auto 2px;
}

@media (min-width: 480px) {
  .skill-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 6px;
  }
}

.skill-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.skill-icon-fallback {
  font-size: 1.1rem;
  color: var(--text-dim);
}

/* 칸 안 도술 이름 (지시문: 최소 11px) */
.skill-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.15;
  width: 100%;
  min-width: 0;
  padding: 0 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.skill-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.skill-style-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.skill-cooldown {
  font-size: 10px;
  color: #786F63;
  margin-top: 1px;
  line-height: 1;
  font-weight: 500;
}

/* 판 아래 설명 */
.board-footer-guide {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-align: center;
  padding-top: 3px;
  border-top: 1px dashed #DDD4C7;
  font-weight: 500;
  line-height: 1.2;
}

.board-footer-guide strong {
  color: var(--match-color, #D97706);
}

/* 추천 시전 순서 (노안 친화 대형 아이콘 · 선명한 번호/화살표) */
.deck-order-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-flow-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 3px;
  background: #F3EEE5;
  border: 1.5px solid #DFD7CA;
  border-radius: 10px;
  padding: 10px 8px 8px 8px;
  box-shadow: inset 0 1px 3px rgba(90, 75, 55, 0.04);
}

.order-item-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #FFFFFF;
  border: 1.5px solid #D5CCBF;
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(90, 75, 55, 0.08);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.order-item-chip:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.22);
}

.order-item-chip:active {
  transform: scale(0.95);
}

.order-item-num {
  position: absolute;
  top: -5px;
  left: -5px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #B45309;
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  z-index: 2;
  padding: 0 3px;
  line-height: 1;
}

.order-item-icon {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.order-item-name {
  display: none;
}

.order-item-chip:not(:has(.order-item-icon)) .order-item-name {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-arrow {
  color: #B45309;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  flex-shrink: 0;
  padding: 0 1px;
  text-shadow: 0 1px 1px rgba(217, 119, 6, 0.2);
}

@media (max-width: 359px) {
  .order-item-chip {
    width: 39px;
    height: 39px;
  }

  .order-item-num {
    min-width: 17px;
    height: 17px;
    font-size: 0.72rem;
    top: -4px;
    left: -4px;
  }

  .order-arrow {
    font-size: 0.9rem;
  }
}

@media (min-width: 600px) {
  .order-flow-wrap {
    gap: 8px 6px;
    padding: 10px 10px 8px 10px;
  }

  .order-item-chip {
    width: auto;
    height: 46px;
    padding: 0 8px 0 0;
    gap: 6px;
  }

  .order-item-icon {
    width: 44px;
    height: 44px;
  }

  .order-item-name {
    display: inline;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
  }
}

/* Tip */
.deck-tip-box {
  background: var(--color-primary-soft);
  border-left: 3px solid var(--color-primary);
  padding: 4px 8px;
  border-radius: 0 6px 6px 0;
  font-size: 0.84rem;
  color: #453E35;
  line-height: 1.35;
}

.deck-tip-box strong {
  color: var(--color-primary);
}

/* 실측 기록 */
.deck-measures-section {
  background: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.measures-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.measures-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.measure-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.measure-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #EFEAE2;
  padding: 1px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}

.measure-text {
  color: var(--text-primary);
  flex: 1;
}

.measures-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* 버튼 두 개 (이 덱으로 질문, 지금 쓰는 덱으로) */
.deck-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.btn-detail-action {
  flex: 1;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-detail-action.btn-ask {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
}

.btn-detail-action.btn-ask:hover {
  background: #DBEAFE;
}

.btn-detail-action.btn-toggle-current {
  background: var(--color-primary-soft);
  border: 1px solid rgba(217, 119, 6, 0.4);
  color: var(--color-primary);
}

.btn-detail-action.btn-toggle-current:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.btn-detail-action.btn-toggle-current.is-active {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

/* 이전 덱 · 다음 덱 */
.deck-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2px;
}

.btn-nav-step {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition-fast);
  max-width: 45%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none;
}

.btn-nav-step:hover:not(:disabled) {
  background: var(--color-primary-soft);
}

.btn-nav-step:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-step-counter {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.decks-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--text-muted);
  height: 100%;
  min-height: 240px;
}

/* ==========================================================================
   3-5. Admin Screen (#/admin)
   ========================================================================== */

.admin-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.admin-title {
  font-family: var(--font-brand);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.admin-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(90, 75, 55, 0.05);
}

.admin-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Users Table */
.users-table-wrap {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  white-space: nowrap;
}

.users-table th {
  background: #F7F3EC;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.users-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.users-table tr:hover td {
  background: var(--bg-card-hover);
}

.user-td-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #E8E2D8;
}

.select-grade {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
}

/* Features Table */
.features-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.features-table th,
.features-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.features-table th {
  background: #F7F3EC;
  color: var(--text-secondary);
  text-align: left;
  font-weight: 700;
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(90, 75, 55, 0.15);
  transform: translateY(16px);
  transition: transform var(--transition-fast);
}

.modal-overlay.show .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  padding: 9px 16px;
  background: #F7F4EE;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 10px;
  font-weight: 600;
}

.btn-secondary:hover {
  background: #EFEAE0;
  color: var(--text-primary);
}

.btn-primary {
  padding: 9px 18px;
  background: var(--color-primary);
  color: #FFFFFF;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

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

/* ==========================================================================
   도술 정보 팝업 (폰은 아래 시트, PC는 가운데 작은 창, 지시문 2절)
   ========================================================================== */

.skill-modal-overlay {
  z-index: 1500;
}

@media (max-width: 600px) {
  .skill-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .skill-modal-dialog {
    max-width: 100%;
    width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 84vh;
    padding: 16px 14px calc(14px + var(--sab));
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 28px rgba(38, 33, 28, 0.18);
    display: flex;
    flex-direction: column;
    margin: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-bottom: none;
  }

  .skill-modal-overlay.show .skill-modal-dialog {
    transform: translateY(0);
  }
}

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

  .skill-modal-dialog {
    width: 100%;
    max-width: 440px;
    border-radius: 18px;
    padding: 22px 20px;
    max-height: 85vh;
    transform: translateY(14px) scale(0.98);
    transition: transform 0.2s ease-out;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 40px rgba(90, 75, 55, 0.15);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
  }

  .skill-modal-overlay.show .skill-modal-dialog {
    transform: translateY(0) scale(1);
  }
}

.skill-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.skill-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.skill-modal-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #FAF8F5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(90, 75, 55, 0.08);
}

.skill-modal-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.skill-modal-icon-fallback {
  font-size: 1.4rem;
  color: var(--text-dim);
}

.skill-modal-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.skill-modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.skill-modal-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.skill-modal-badge.ult-badge {
  background: #F3E8FF;
  color: #7C3AED;
  border: 1px solid #D8B4FE;
}

.skill-modal-name {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-modal-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
  scrollbar-width: thin;
}

/* 수치 속성 그리드 (쿨타임, 대상 수, 총 계수, 타수) */
.skill-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.skill-stat-card {
  background: #FAF8F5;
  border: 1px solid #EFEAE2;
  border-radius: 8px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.skill-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.skill-stat-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 700;
  word-break: break-all;
}

.skill-modal-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skill-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.skill-desc-box {
  background: #FAF8F5;
  border: 1px solid #EFEAE2;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.875rem; /* 본문 최소 14px */
  line-height: 1.5;
  color: var(--text-primary);
}

.skill-effects-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-effect-item {
  background: #FAF8F5;
  border: 1px solid #EFEAE2;
  border-radius: 8px;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.skill-effect-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.skill-effect-type {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.skill-effect-type.type-buff {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.skill-effect-type.type-debuff {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.skill-effect-type.type-default {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

.skill-effect-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}

.skill-effect-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.skill-effect-lines li {
  font-size: 0.875rem; /* 본문 최소 14px */
  color: var(--text-secondary);
  line-height: 1.45;
  position: relative;
  padding-left: 12px;
}

.skill-effect-lines li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.skill-modal-footer {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  flex-shrink: 0;
}

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

/* Lightbox Overlay (사진 크게 보기 - 사진 뷰어는 어두운 딤 배경 유지) */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 12, 10, 0.92);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-overlay.show {
  display: flex;
}

.lightbox-img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* In-App Browser Escape Overlay (인앱 브라우저 탈출 안내) */
.inapp-escape-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-main);
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.inapp-escape-overlay.show {
  display: flex;
}

.inapp-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 16px 40px rgba(90, 75, 55, 0.12);
}

.inapp-icon-wrap {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}

.inapp-lead-icon {
  width: 44px;
  height: 44px;
  stroke: var(--color-primary);
}

.guide-icon-lead {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.guide-lead-icon {
  width: 44px;
  height: 44px;
  stroke: var(--color-primary);
}

.install-notice-box {
  background: var(--color-primary-soft);
  border-left: 3px solid var(--color-primary);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.88rem;
  color: #B45309;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.inapp-title {
  font-family: var(--font-brand);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.inapp-guide-text {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  word-break: keep-all;
}

.inapp-guide-graphic {
  background: #F7F3EC;
  border: 1px dashed var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--color-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.inapp-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-copy-url {
  background: var(--color-primary);
  color: #FFFFFF;
  font-weight: 700;
  padding: 12px;
  border-radius: 10px;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.btn-close-inapp {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 8px;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

#toast-container {
  position: fixed;
  bottom: calc(24px + var(--sab));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}

.toast {
  background: #26211C;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.25s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.error {
  background: #991B1B;
  border-color: #B91C1C;
  color: #FEE2E2;
}

.toast.success {
  background: #14532D;
  border-color: #15803D;
  color: #DCFCE7;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 관리자: 폰으로 열기 QR (폰 화면에서는 숨김) */
.admin-qr-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(90, 75, 55, 0.04);
}

.admin-qr-img {
  width: 112px;
  height: 112px;
  flex: none;
  background: #FFFFFF;
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
}

.admin-qr-img svg {
  width: 100%;
  height: 100%;
  display: block;
}

.admin-qr-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.admin-qr-text strong {
  color: var(--text-primary);
}

.admin-qr-text span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-qr-text code {
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--text-secondary);
}

/* 창 폭이 아니라 기기로 가른다: 터치 폰 · 태블릿에서만 숨김 (PC 창을 폰 크기로 줄여도 보이게) */
@media (hover:none) and (pointer:coarse) {
  .admin-qr-card {
    display: none;
  }
}

/* Claude 검수 수정 (2026-10-23) */
/* 강화 칩은 왼쪽부터 보이게, 폰에서는 이름 줄 아래 한 줄을 통째로 쓴다 */
.sticky-styles-chips{justify-content:flex-start}
@media (max-width:520px){.sticky-profile-main{flex-wrap:wrap}.sticky-styles-chips{flex-basis:100%}}
/* 목록 줄: 이름이 먼저, 칩은 남는 폭 안에서 말줄임 */
.deck-row-chips{flex-shrink:1;min-width:0;max-width:52%;overflow:hidden}
.deck-row-chips .deck-chip{overflow:hidden;text-overflow:ellipsis;min-width:0}
.deck-row-name-wrap{flex:1 1 auto;min-width:5.5em}
/* 머리줄: 좁은 폰에서 제목이 Claude 버튼에 닿지 않게 */
@media (max-width:420px){.brand-title{font-size:1rem}}
@media (max-width:370px){.brand-title{display:none}}

/* ==========================================================================
   Claude 팝업 패널 (지시문 확정본)
   ========================================================================== */

/* 폰용 배경 딤 오버레이 (PC에서는 왼쪽 화면을 쓸 수 있도록 완전 미노출) */
.cp-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

@media (max-width: 768px) {
  .cp-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 769px) {
  .cp-backdrop {
    display: none !important;
  }
}

/* 패널 본체 기본 (모바일: 바텀 시트, 화면 높이의 약 85%) */
.cp-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 85vh;
  max-height: 85vh;
  background: var(--bg-surface);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -8px 28px rgba(38, 33, 28, 0.18);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  border-top: 1px solid var(--border-subtle);
}

.cp-panel.show {
  transform: translateY(0);
}

/* 시트 상단 손잡이 (모바일 전용) */
.cp-sheet-handle {
  width: 40px;
  height: 4px;
  background: #D8D0C5;
  border-radius: 2px;
  margin: 8px auto 4px;
  flex-shrink: 0;
}

/* PC 넓은 화면: 오른쪽 옆 패널 (폭 420px 안팎, 왼쪽 화면 그대로 사용 가능) */
@media (min-width: 769px) {
  .cp-panel {
    left: auto;
    right: 0;
    top: 56px;
    bottom: 0;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    max-height: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
    border-left: 1px solid var(--border-subtle);
    box-shadow: -4px 0 24px rgba(38, 33, 28, 0.1);
    z-index: 95;
    transform: translateX(105%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @media (min-width: 600px) {
    .cp-panel {
      top: 60px;
      height: calc(100vh - 60px);
      height: calc(100dvh - 60px);
    }
  }

  .cp-panel.show {
    transform: translateX(0);
  }

  .cp-sheet-handle {
    display: none;
  }
}

/* 패널 머리 */
.cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: #FAF8F5;
  flex-shrink: 0;
  gap: 8px;
}

.cp-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.cp-title {
  font-family: var(--font-brand);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.cp-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background-color: var(--status-offline);
  transition: background-color var(--transition-fast);
}

.cp-status-dot.online {
  background-color: var(--status-online);
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.6);
}

.cp-status-dot.offline {
  background-color: var(--status-offline);
}

.cp-header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cp-nav-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.cp-nav-btn:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: rgba(217, 119, 6, 0.4);
}

.cp-nav-btn.active {
  background: var(--color-primary-light);
  color: #B45309;
  border-color: rgba(217, 119, 6, 0.45);
  font-weight: 700;
}

.cp-close-btn {
  font-size: 1.4rem;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.cp-close-btn:hover {
  color: var(--text-primary);
  background: #EFE9E0;
}

/* 지금 보는 덱 연동 배너 버튼 */
.cp-deck-context-banner {
  width: 100%;
  padding: 9px 14px;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: none;
  border-bottom: 1px solid rgba(217, 119, 6, 0.25);
  color: #B45309;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.cp-deck-context-banner:hover {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
}

.cp-deck-context-banner-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-deck-context-arrow {
  font-size: 1.1rem;
  line-height: 1;
  margin-left: 6px;
  flex-shrink: 0;
}

/* 패널 몸통 공통 */
.cp-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #FAF8F5;
  min-height: 0;
}

/* 1. 대화 보기 (View: Thread) */
.cp-view-thread {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.cp-thread-subhead {
  padding: 8px 14px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.cp-thread-subhead-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.cp-messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

/* 이어 묻기 하단 바 */
.cp-reply-bar {
  padding: 8px 12px;
  background: #FFFFFF;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  padding-bottom: max(8px, var(--sab));
}

.cp-reply-controls-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.cp-reply-textarea {
  flex: 1;
  min-height: 38px;
  max-height: 100px;
  padding: 8px 10px;
  font-size: 0.9rem;
  line-height: 1.4;
  resize: none;
}

/* 2. 새 대화 보기 (View: New) */
.cp-view-new {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 14px;
  gap: 12px;
  box-sizing: border-box;
}

.cp-new-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cp-new-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cp-new-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.92rem;
}

.cp-deck-chip-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #B45309;
  width: fit-content;
}

.cp-btn-remove-deck-chip {
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  border: none;
  background: none;
  color: #B45309;
  padding: 0 2px;
}

.cp-new-textarea {
  width: 100%;
  flex: 1;
  min-height: 140px;
  padding: 10px 12px;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
}

.cp-new-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* 3. 대화 목록 보기 (View: List) */
.cp-view-list {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 10px;
  gap: 8px;
}

.cp-thread-row {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--transition-fast);
}

.cp-thread-row:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(90, 75, 55, 0.06);
}

.cp-thread-row.active {
  border-color: var(--color-primary);
  background: #FFFBEB;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.12);
}

.cp-empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   3-5. 팁 화면 (#/guides 및 #/guides/<slug>)
   ========================================================================== */

.guides-view-container {
  width: 100%;
}

.guides-layout-container {
  display: flex;
  gap: 16px;
  width: 100%;
  min-height: calc(100vh - 160px);
}

@media (max-width: 859px) {
  .guides-layout-container.mode-list .guides-detail-pane {
    display: none;
  }
  .guides-layout-container.mode-detail .guides-list-pane {
    display: none;
  }
  .guides-list-pane {
    width: 100%;
    max-width: 100%;
  }
  .guides-detail-pane {
    width: 100%;
    max-width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(90, 75, 55, 0.04);
  }
}

@media (min-width: 860px) {
  .guides-layout-container {
    gap: 20px;
  }
  .guides-list-pane {
    max-width: 380px;
    width: 380px;
    flex-shrink: 0;
    height: calc(100vh - 150px);
    overflow-y: auto;
    padding-right: 4px;
  }
  .guides-detail-pane {
    flex: 1;
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
    height: calc(100vh - 150px);
    overflow-y: auto;
    box-shadow: 0 4px 18px rgba(90, 75, 55, 0.05);
  }
}

/* 검색창 */
.guide-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.guide-search-input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  font-size: 0.92rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.guide-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--border-glow);
}

.guide-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.guide-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px;
  border-radius: 50%;
}

.guide-search-clear:hover {
  color: var(--text-primary);
}

/* 분류 탭 */
.guide-category-tabs-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.guide-category-tabs-bar::-webkit-scrollbar {
  display: none;
}

.guide-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(90, 75, 55, 0.03);
}

.guide-category-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.guide-category-tab.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.guide-category-tab .tab-count {
  font-size: 0.72rem;
  opacity: 0.85;
  font-weight: 700;
}

/* 카드 목록 */
.guide-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab-guides-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px dashed var(--border-subtle);
}

.guide-card-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(90, 75, 55, 0.03);
  cursor: pointer;
}

.guide-card-row:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(90, 75, 55, 0.07);
}

.guide-card-row.active {
  border-color: var(--color-primary);
  background: #FFFBEB;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.12);
}

.guide-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.guide-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.guide-card-summary {
  font-size: 0.84rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.guide-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.guide-card-basis {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.guide-card-arrow {
  color: var(--text-muted);
  font-size: 1rem;
  flex-shrink: 0;
}

.guide-card-row:hover .guide-card-arrow {
  color: var(--color-primary);
}

/* 새로 바뀜 배지 */
.badge-changed-new {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
  line-height: 1.2;
  flex-shrink: 0;
}

/* 상세 화면 */
.guide-detail-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.btn-guide-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: #F4EFEA;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 12px;
  width: fit-content;
  text-decoration: none;
}

.btn-guide-back:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: rgba(217, 119, 6, 0.3);
}

@media (min-width: 860px) {
  .btn-guide-back {
    display: none;
  }
}

.guide-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  margin-bottom: 2px;
}

.guide-detail-cat-chip {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.guide-detail-basis {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.guide-detail-title {
  font-family: var(--font-brand);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: keep-all;
  margin-bottom: 6px;
}

@media (min-width: 600px) {
  .guide-detail-title {
    font-size: 1.65rem;
  }
}

/* summary 강조 상자 */
.guide-detail-summary-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 4px solid var(--color-primary);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-primary);
  line-height: 1.55;
  font-size: 0.95rem;
}

.guide-summary-icon {
  color: var(--color-primary);
  font-size: 1.2rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.guide-summary-content {
  flex: 1;
  font-weight: 500;
  word-break: keep-all;
}

/* 본문 마크다운 영역 */
.guide-detail-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
  word-break: keep-all;
  overflow-wrap: break-word;
  margin-bottom: 24px;
}

.guide-detail-body h1,
.guide-detail-body h2,
.guide-detail-body h3,
.guide-detail-body h4 {
  font-family: var(--font-brand);
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 10px;
  font-weight: 700;
}

.guide-detail-body h1 {
  font-size: 1.4rem;
}

.guide-detail-body h2 {
  font-size: 1.22rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
}

.guide-detail-body h3 {
  font-size: 1.08rem;
}

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

.guide-detail-body ul,
.guide-detail-body ol {
  margin: 12px 0 16px 20px;
  padding: 0;
}

.guide-detail-body li {
  margin-bottom: 6px;
}

.guide-detail-body strong {
  color: #1c1917;
  font-weight: 700;
}

.guide-detail-body blockquote {
  border-left: 3px solid var(--border-subtle);
  padding-left: 12px;
  color: var(--text-secondary);
  margin: 12px 0;
  font-style: italic;
}

.guide-detail-body code {
  background: #F4EFEA;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: monospace;
}

.guide-detail-body pre {
  background: #2E2924;
  color: #FAF8F5;
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 14px 0;
}

.guide-detail-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* 표 가로 스크롤 (폰에서 표 바깥 페이지 가로 스크롤 방지) */
.guide-table-scroll-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #FFFFFF;
}

.guide-detail-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.guide-detail-body th,
.guide-detail-body td {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.guide-detail-body th {
  background-color: #F8F5EE;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.guide-detail-body tr:nth-child(even) td {
  background-color: #FAF8F5;
}

/* 출처 링크 목록 */
.guide-sources-card {
  background: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 24px;
  margin-bottom: 20px;
}

.guide-sources-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.guide-sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-source-item {
  display: flex;
  align-items: center;
}

.guide-source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
  word-break: break-all;
  transition: color var(--transition-fast);
}

.guide-source-link:hover {
  color: var(--color-primary-hover);
}

.guide-source-link .ui-icon {
  font-size: 0.95em;
  text-decoration: none;
  flex-shrink: 0;
}

.guide-source-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* Claude에 묻기 버튼 */
.guide-detail-actions {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-start;
}

.btn-guide-ask-claude {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-guide-ask-claude:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.15);
}

/* Placeholder */
.guides-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 280px;
  color: var(--text-muted);
  text-align: center;
}

.guides-detail-placeholder .placeholder-icon {
  font-size: 2.2rem;
  color: var(--text-dim);
}
/* 머리줄: 폰에서는 닉네임을 숨기고 프로필 사진만 (닉네임은 메뉴 안에 있다), 제목은 남는 폭에서 말줄임 */
.brand-link{min-width:0;flex:1 1 auto}
.brand-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.header-right{flex:none}
@media (max-width:560px){
  .user-nickname{display:none}
  .brand-title{display:block}
}
@media (max-width:340px){.brand-title{display:none}}

/* ==========================================================================
   3-6. 소식 화면 (#/news 및 #/news/<seq>)
   ========================================================================== */

.news-view-container {
  width: 100%;
}

.news-layout-container {
  display: flex;
  gap: 16px;
  width: 100%;
  min-height: calc(100vh - 160px);
}

@media (max-width: 859px) {
  .news-layout-container.mode-list .news-detail-pane {
    display: none;
  }
  .news-layout-container.mode-detail .news-list-pane {
    display: none;
  }
  .news-list-pane {
    width: 100%;
    max-width: 100%;
  }
  .news-detail-pane {
    width: 100%;
    max-width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(90, 75, 55, 0.04);
  }
}

@media (min-width: 860px) {
  .news-layout-container {
    gap: 20px;
  }
  .news-list-pane {
    max-width: 380px;
    width: 380px;
    flex-shrink: 0;
    height: calc(100vh - 150px);
    overflow-y: auto;
    padding-right: 4px;
  }
  .news-detail-pane {
    flex: 1;
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px;
    height: calc(100vh - 150px);
    overflow-y: auto;
    box-shadow: 0 4px 18px rgba(90, 75, 55, 0.05);
  }
}

/* 맨 위 이번 주 정리 카드 */
.news-summary-card {
  background: #FFFDF9;
  border: 1px solid #FDE68A;
  border-left: 4px solid var(--color-primary);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.06);
}

.news-summary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.news-summary-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-summary-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.news-summary-basis {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-toggle-summary {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  padding: 3px 8px;
  border-radius: 6px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-toggle-summary:hover {
  background: #FDE68A;
  color: #92400E;
}

.news-summary-title {
  font-family: var(--font-brand);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.35;
}

.news-summary-card.is-collapsed .news-summary-collapsed-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.4;
}

.news-summary-card.is-collapsed .news-summary-expanded-content {
  display: none;
}

.news-summary-card.is-expanded .news-summary-collapsed-line {
  display: none;
}

.news-summary-card.is-expanded .news-summary-expanded-content {
  display: block;
  margin-top: 10px;
}

.news-summary-callout {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.news-summary-callout .callout-icon {
  color: var(--color-primary);
  font-size: 1.1rem;
  margin-top: 1px;
  flex-shrink: 0;
}

.news-summary-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-primary);
  word-break: keep-all;
  overflow-wrap: break-word;
  margin-bottom: 12px;
}

.news-summary-body p {
  margin-bottom: 10px;
}

.news-summary-body ul,
.news-summary-body ol {
  margin: 8px 0 12px 18px;
  padding: 0;
}

.news-summary-body li {
  margin-bottom: 4px;
}

.news-summary-body strong {
  color: #1c1917;
  font-weight: 700;
}

/* 공식 공지 섹션 */
.news-notices-section {
  display: flex;
  flex-direction: column;
}

.news-section-header {
  margin-bottom: 10px;
}

.news-section-title {
  font-family: var(--font-brand);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.news-kind-tabs-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.news-kind-tabs-bar::-webkit-scrollbar {
  display: none;
}

.news-kind-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(90, 75, 55, 0.03);
}

.news-kind-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.news-kind-tab.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.news-kind-tab .tab-count {
  font-size: 0.72rem;
  opacity: 0.85;
  font-weight: 700;
}

.news-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab-notices-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px dashed var(--border-subtle);
}

.notice-card-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(90, 75, 55, 0.03);
  cursor: pointer;
}

.notice-card-row:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(90, 75, 55, 0.07);
}

.notice-card-row.active {
  border-color: var(--color-primary);
  background: #FFFBEB;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.12);
}

.notice-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notice-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.notice-kind-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.2;
  flex-shrink: 0;
}

.notice-kind-badge.kind-update {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.notice-kind-badge.kind-event {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.notice-kind-badge.kind-notice {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.notice-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.badge-notice-new {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
  line-height: 1.2;
  flex-shrink: 0;
}

.notice-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.notice-card-arrow {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.notice-card-row:hover .notice-card-arrow {
  color: var(--color-primary);
}

/* 공지 상세 화면 */
.news-detail-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.btn-news-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: #F4EFEA;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 12px;
  width: fit-content;
  text-decoration: none;
}

.btn-news-back:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: rgba(217, 119, 6, 0.3);
}

@media (min-width: 860px) {
  .btn-news-back {
    display: none;
  }
}

.news-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.news-detail-posted {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.news-detail-title {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: keep-all;
}

@media (min-width: 600px) {
  .news-detail-title {
    font-size: 1.55rem;
  }
}

.news-detail-body {
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 24px;
}

.news-notice-footer-link {
  margin-top: 16px;
  margin-bottom: 16px;
}

.btn-notice-external-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary);
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-notice-external-link:hover {
  background: #FEF3C7;
  border-color: var(--color-primary);
}

.btn-notice-external-link .ui-icon {
  font-size: 0.95em;
}

.news-detail-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-start;
}

.btn-news-ask-claude {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-news-ask-claude:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.15);
}

.news-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 280px;
  color: var(--text-muted);
  text-align: center;
}

.news-detail-placeholder .placeholder-icon {
  font-size: 2.2rem;
  color: var(--text-dim);
}

/* ==========================================================================
   3-7. 도감 (위키) 화면 (#/wiki)
   ========================================================================== */

.wiki-view-container {
  width: 100%;
}

.wiki-loading-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 240px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.wiki-layout-container {
  display: flex;
  gap: 16px;
  width: 100%;
  min-height: calc(100vh - 160px);
}

@media (max-width: 859px) {
  .wiki-layout-container.mode-list .wiki-detail-pane {
    display: none;
  }
  .wiki-layout-container.mode-detail .wiki-list-pane {
    display: none;
  }
  .wiki-list-pane {
    width: 100%;
    max-width: 100%;
  }
  .wiki-detail-pane {
    width: 100%;
    max-width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(90, 75, 55, 0.04);
  }
}

@media (min-width: 860px) {
  .wiki-layout-container {
    gap: 20px;
  }
  .wiki-list-pane {
    max-width: 380px;
    width: 380px;
    flex-shrink: 0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(90, 75, 55, 0.04);
  }
  .wiki-detail-pane {
    flex: 1;
    min-width: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(90, 75, 55, 0.04);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
}

/* 검색창 */
.wiki-search-box {
  position: relative;
  margin-bottom: 14px;
}

.wiki-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.wiki-search-input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  font-size: 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background-color: #FFFFFF;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.wiki-search-input:focus {
  border-color: var(--color-purple);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

.wiki-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1.25rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 50%;
}

.wiki-search-clear:hover {
  color: var(--text-primary);
  background-color: #F4EFEA;
}

.wiki-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(90, 75, 55, 0.12);
  max-height: 380px;
  overflow-y: auto;
  z-index: 100;
  padding: 6px;
}

.wiki-search-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.wiki-search-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.wiki-search-item:hover {
  background-color: #FAF8F5;
}

.wiki-search-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.wiki-search-badge.item {
  background: #F5F3FF;
  color: #7C3AED;
}

.wiki-search-badge.mon {
  background: #FEF2F2;
  color: #DC2626;
}

.wiki-search-badge.zone {
  background: #ECFDF5;
  color: #059669;
}

.wiki-search-badge.skill {
  background: #FFFBEB;
  color: #D97706;
}

.wiki-search-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-search-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 큰 갈래 탭 바 */
.wiki-main-tabs-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: #F4EFEA;
  padding: 4px;
  border-radius: 10px;
}

.wiki-main-tab {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
  cursor: pointer;
}

.wiki-main-tab.active {
  background: #FFFFFF;
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(90, 75, 55, 0.08);
}

/* 탭별 분류 칩 */
.wiki-filters-area {
  margin-bottom: 12px;
}

.wiki-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.wiki-1st-chips {
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 8px;
}

.wiki-chip-btn {
  padding: 5px 11px;
  border-radius: 16px;
  font-size: 0.85rem;
  background: #FAF8F5;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.wiki-chip-btn:hover {
  background: #F4EFEA;
  color: var(--text-primary);
}

.wiki-chip-btn.active {
  background: #F5F3FF;
  border-color: #DDD6FE;
  color: #7C3AED;
  font-weight: 700;
}

.wiki-subchip-btn {
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 0.82rem;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.wiki-subchip-btn:hover {
  color: var(--text-primary);
  border-color: #D1C7B7;
}

.wiki-subchip-btn.active {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
  font-weight: 700;
}

/* 목록 항목 리스트 */
.wiki-items-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wiki-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid transparent;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.wiki-list-row:hover {
  background: #FAF8F5;
  border-color: var(--border-subtle);
}

.wiki-list-row.active {
  background: #F5F3FF;
  border-color: #DDD6FE;
}

.wiki-grade-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wiki-row-name {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-row-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.wiki-skill-icon-thumb {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F4EFEA;
  flex-shrink: 0;
}

.wiki-skill-icon-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wiki-load-more-wrap {
  margin-top: 12px;
  text-align: center;
}

.btn-wiki-more {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: #F4EFEA;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.btn-wiki-more:hover {
  background: #E8E2D8;
  color: var(--text-primary);
}

.wiki-list-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* 항목 상세 패널 */
.wiki-detail-content {
  width: 100%;
}

.wiki-detail-header {
  margin-bottom: 16px;
}

.btn-wiki-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #F4EFEA;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 12px;
  transition: all var(--transition-fast);
}

.btn-wiki-back:hover {
  background: #E8E2D8;
  color: var(--text-primary);
}

@media (min-width: 860px) {
  /* PC에서는 뒤로가기 버튼이 있어도 되지만 주로 목록 클릭으로 이동하므로 단정하게 유지 */
  .btn-wiki-back {
    display: inline-flex;
  }
}

.wiki-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.wiki-grade-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.wiki-cat-breadcrumb {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.wiki-lv-chip {
  font-size: 0.82rem;
  padding: 2px 7px;
  background: #F4EFEA;
  border-radius: 4px;
  color: var(--text-secondary);
  font-weight: 600;
}

.wiki-detail-title {
  font-family: var(--font-brand);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.wiki-desc-box {
  background: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  white-space: pre-line;
  margin-bottom: 20px;
}

.wiki-detail-section {
  margin-bottom: 22px;
}

.wiki-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 능력치 그리드 */
.wiki-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
}

.wiki-stat-card {
  background: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wiki-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.wiki-stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* 특수 효과 및 세트 효과 */
.wiki-bullet-list {
  list-style: disc;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

.wiki-set-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wiki-set-row {
  background: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.wiki-set-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
}

.wiki-set-effect {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.4;
}

/* 획득처 및 링크 칩 */
.wiki-source-subgroup {
  margin-bottom: 12px;
}

.wiki-subgroup-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.wiki-region-group {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 6px;
  background: #FFFFFF;
  overflow: hidden;
}

.wiki-region-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: #FAF8F5;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.wiki-region-summary:hover {
  background: #F4EFEA;
}

.wiki-region-name {
  color: var(--text-primary);
}

.wiki-region-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
  margin-right: 8px;
}

.wiki-region-arrow {
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: transform var(--transition-fast);
}

.wiki-region-group[open] .wiki-region-arrow {
  transform: rotate(90deg);
}

.wiki-region-mons-grid {
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #FFFFFF;
}

.wiki-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wiki-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  background: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.wiki-link-chip:hover {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #B45309;
}

.wiki-chip-title {
  font-weight: 600;
}

.wiki-chip-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.wiki-chip-qty {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-primary);
}

.wiki-chip-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.wiki-text-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wiki-text-chip {
  padding: 5px 10px;
  background: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.wiki-empty-notice {
  padding: 14px;
  background: #FAF8F5;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

.wiki-meta-muted {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* 푸터 및 Claude 질문 버튼 */
.wiki-footer-section {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wiki-footer-snapshot {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wiki-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.wiki-external-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-purple);
  padding: 8px 14px;
  border: 1px solid #DDD6FE;
  border-radius: 8px;
  background: #F5F3FF;
  transition: all var(--transition-fast);
}

.wiki-external-link:hover {
  background: #EDE9FE;
}

.btn-wiki-ask-claude {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-wiki-ask-claude:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.15);
}

.wiki-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 280px;
  color: var(--text-muted);
  text-align: center;
}

.wiki-detail-placeholder .placeholder-icon {
  font-size: 2.2rem;
  color: var(--text-dim);
}
