/* ═══════════════════════════════════════════════════════════
   1. CSS VARIABLES & RESET — 다크모드 강제
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg-deep: #06060f;
  --bg-space: #0a0a1a;
  --bg-nebula: #0f0f24;
  --bg-card: rgba(18, 18, 40, 0.7);
  --bg-card-solid: #121228;
  --bg-hover: rgba(30, 30, 60, 0.8);
  --bg-glass: rgba(20, 20, 45, 0.5);
  --text-bright: #f0f0ff;
  --text-primary: #d0d0e8;
  --text-secondary: #8888aa;
  --text-muted: #555570;
  --accent: #7c6cf0;
  --accent-light: #a78bfa;
  --accent-glow: rgba(124, 108, 240, 0.35);
  --accent-gradient: linear-gradient(135deg, #7c6cf0, #a78bfa, #c084fc);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --border: rgba(100, 100, 160, 0.2);
  --border-accent: rgba(124, 108, 240, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
  --content-max: 1600px;
  --content-pad: 2rem;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font) !important;
  background: var(--bg-deep) !important;
  color: var(--text-primary) !important;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════
   2. STARRY BACKGROUND
   ═══════════════════════════════════════════════════════════ */
body::before, body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background: radial-gradient(ellipse at 15% 30%, rgba(124,108,240,0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 20%, rgba(99,102,241,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 80%, rgba(139,92,246,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(96,165,250,0.05) 0%, transparent 45%);
  animation: nebulaFlow 30s ease-in-out infinite alternate;
}
body::after {
  background-image:
    linear-gradient(45deg, transparent 0%, rgba(167,139,250,0.08) 48%, rgba(255,255,255,0.12) 50%, rgba(167,139,250,0.08) 52%, transparent 100%),
    radial-gradient(2px 2px at 8% 15%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(2px 2px at 45% 25%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(2px 2px at 85% 35%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at 15% 85%, rgba(167,139,250,1) 0%, transparent 100%),
    radial-gradient(2.5px 2.5px at 75% 60%, rgba(167,139,250,0.9) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 25% 65%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 65% 75%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 35% 45%, rgba(167,139,250,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 55%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 85%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.4) 0%, transparent 100%);
  animation: starTwinkle 20s ease-in-out infinite;
  background-size: 300% 300%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}
#gate-page, #app-container, #toast-container, #scroll-to-top, #side-panel-overlay,
.app-footer, .warp-overlay, #admin-panel {
  position: relative; z-index: 1;
}

/* ═══════════════════════════════════════════════════════════
   3. ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes nebulaFlow {
  0% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0.7; transform: scale(0.98); }
}
@keyframes starTwinkle {
  0% { opacity: 0.5; background-position: -150% -150%, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  25% { opacity: 0.9; }
  50% { opacity: 0.6; background-position: 250% 250%, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  75% { opacity: 1; }
  100% { opacity: 0.5; }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rocketFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes rocketPrepare { 0%,100% { transform: translateY(0) rotate(0deg); } 25% { transform: translateY(-8px) rotate(-2deg); } 75% { transform: translateY(-4px) rotate(2deg); } }
@keyframes bounce { 0% { transform: scale(1); } 100% { transform: scale(1.15); } }
@keyframes pulse { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 10px var(--accent-glow); } 50% { box-shadow: 0 0 25px var(--accent-glow); } }

/* ═══════════════════════════════════════════════════════════
   4. GATE PAGE
   ═══════════════════════════════════════════════════════════ */
#gate-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem; text-align: center;
}
.gate-step { display: none; width: 100%; max-width: 600px; }
.gate-step.active { display: flex; flex-direction: column; align-items: center; animation: fadeSlideUp 0.6s ease; }
.gate-rocket { font-size: 3.5rem; animation: rocketFloat 3s ease-in-out infinite; margin-bottom: 1rem; }
.gate-title { font-size: 2.2rem; font-weight: 800; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.3rem; }
.gate-subtitle { color: var(--text-secondary); font-size: 1rem; margin-bottom: 0.5rem; }
.gate-star-count { color: var(--accent-light); font-size: 0.9rem; margin-bottom: 2rem; animation: pulse 3s ease-in-out infinite; }
.gate-input-group { width: 100%; margin-bottom: 1rem; }
.gate-input-group label { display: block; text-align: left; margin-bottom: 0.4rem; font-weight: 600; font-size: 0.9rem; color: var(--text-bright); }
.gate-input-group .hint { text-align: left; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }
.gate-input { width: 100%; padding: 0.85rem 1.2rem; background: var(--bg-glass); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-bright); font-size: 1rem; transition: var(--transition); }
.gate-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-glow); }
.gate-input::placeholder { color: var(--text-muted); }
.gate-preview { text-align: left; font-size: 0.82rem; color: var(--success); margin-top: 0.3rem; min-height: 1.2em; }
.btn-warp { width: 100%; padding: 0.95rem; background: var(--accent-gradient); color: white; border: none; border-radius: var(--radius-sm); font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: var(--transition); position: relative; overflow: hidden; margin-top: 0.5rem; }
.btn-warp:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-warp:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-warp::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%); animation: shimmer 3s infinite; }
.gate-history { margin-top: 1.5rem; font-size: 0.82rem; color: var(--text-muted); }
.gate-history a { color: var(--accent-light); text-decoration: none; cursor: pointer; }
.gate-job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.7rem; width: 100%; margin: 1rem 0; }
.gate-job-card { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 1rem 0.5rem; background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); user-select: none; }
.gate-job-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.gate-job-card.selected { border-color: var(--accent); background: rgba(124, 108, 240, 0.15); animation: glowPulse 2s ease-in-out infinite; }
.gate-job-card .emoji { font-size: 1.8rem; }
.gate-job-card .label { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.btn-skip { background: none; border: 1px solid var(--border); color: var(--text-secondary); padding: 0.7rem 1.5rem; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.9rem; transition: var(--transition); margin-top: 0.5rem; }
.btn-skip:hover { border-color: var(--accent); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════
   5. WARP TRANSITION
   ═══════════════════════════════════════════════════════════ */
.warp-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; background: var(--bg-deep); justify-content: center; align-items: center; }
.warp-overlay.active { display: flex; }
.launch-status { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; color: var(--text-bright); }
.launch-rocket { font-size: 4rem; animation: rocketPrepare 2s ease-in-out infinite; }
.launch-text { display: flex; align-items: center; gap: 0.8rem; font-size: 1.1rem; font-weight: 600; min-height: 2em; }
.launch-emoji { font-size: 1.5rem; animation: bounce 0.6s ease-in-out infinite alternate; }
.progress-bar { width: 300px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-gradient); width: 0%; transition: width 0.3s ease; border-radius: 3px; box-shadow: 0 0 10px var(--accent-glow); }

/* ═══════════════════════════════════════════════════════════
   6. 고정 헤더 + 통계 + 탭 + 여백
   ═══════════════════════════════════════════════════════════ */
#app-container { display: none; animation: fadeSlideUp 0.6s ease; }

.fixed-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(6, 6, 15, 0.95); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 0.7rem 0; }
.header-inner { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--content-pad); display: flex; justify-content: space-between; align-items: center; }

/* ★ 수정 #6: 헤더 제목 — 클릭 가능 + 로켓 이모지 색상 분리 */
.header-title {
  font-size: 1.3rem; font-weight: 800; margin: 0; white-space: nowrap;
  cursor: pointer; display: flex; align-items: center; gap: 0.3rem;
  transition: opacity 0.2s;
}
.header-title:hover { opacity: 0.85; }
.header-title .title-emoji {
  -webkit-text-fill-color: initial;
  background: none; -webkit-background-clip: initial;
  font-size: 1.3rem;
}
.header-title .title-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.header-nav { display: flex; gap: 0.4rem; }
.header-nav-btn { padding: 0.45rem 1rem; background: var(--bg-glass); border: 1px solid var(--border); border-radius: 20px; color: var(--text-secondary); cursor: pointer; font-size: 0.8rem; transition: var(--transition); white-space: nowrap; }
.header-nav-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.header-nav-btn.active { background: var(--accent-gradient); color: white; border-color: transparent; }
.header-spacer { height: 65px; }

.welcome { text-align: center; font-size: 1rem; color: var(--text-secondary); margin: 1rem auto; max-width: var(--content-max); padding: 0 var(--content-pad); }
.welcome strong { color: var(--accent-light); }

.stats-section { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin: 1.5rem auto; max-width: var(--content-max); padding: 0 var(--content-pad); }
.stats-card { display: flex; align-items: center; gap: 1rem; background: var(--bg-glass); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.5rem; flex: 1; min-width: 250px; max-width: 400px; transition: var(--transition); }
.stats-card.clickable { cursor: pointer; }
.stats-card.clickable:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.stats-icon { font-size: 2rem; flex-shrink: 0; }
.stats-info { flex: 1; display: flex; flex-direction: column; gap: 0.2rem; }
.stats-value { font-size: 1.8rem; font-weight: 800; color: var(--text-bright); }
.stats-label { font-size: 0.78rem; color: var(--text-muted); }
.stats-download-btn { padding: 0.35rem 0.7rem; background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: var(--radius-xs); cursor: pointer; font-size: 0.72rem; transition: var(--transition); white-space: nowrap; }
.stats-download-btn:hover { border-color: var(--accent); color: var(--accent-light); }

.tab-panel { display: none; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--content-pad); }
.tab-panel.active { display: block; animation: fadeSlideUp 0.4s ease; }

/* ═══════════════════════════════════════════════════════════
   7. SCANNER + 스마트 검색 제안 + 필터 토글
   ═══════════════════════════════════════════════════════════ */
.scanner-section { margin-bottom: 1.5rem; }

/* ★ 수정 #2: gap 넓히고 정렬 보장 */
.scanner-bar { display: flex; gap: 0.6rem; align-items: stretch; margin-bottom: 0.6rem; position: relative; }
.scanner-input-wrap { flex: 1; position: relative; min-width: 0; }
.scanner-input { width: 100%; padding: 0.85rem 1.2rem 0.85rem 2.8rem; background: var(--bg-glass); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-bright); font-size: 1rem; transition: var(--transition); }
.scanner-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-glow); }

/* ★ 수정 #2: glow-enhanced에서 scale 제거 */
.scanner-input.glow-enhanced { box-shadow: 0 0 20px rgba(124, 108, 240, 0.4); border: 2px solid rgba(124, 108, 240, 0.5); }
.scanner-input.glow-enhanced:focus { box-shadow: 0 0 40px rgba(124, 108, 240, 0.8), 0 0 80px rgba(124, 108, 240, 0.4); border: 2px solid var(--accent); }

.scanner-input::placeholder { color: var(--text-muted); }
.scanner-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.1rem; pointer-events: none; }

/* 스마트 검색 제안 */
.search-suggestions { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 300; background: var(--bg-card-solid); border: 1px solid var(--accent); border-radius: 0 0 var(--radius) var(--radius); max-height: 300px; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.5); margin-top: -2px; }
.search-suggestions.open { display: block; }
.suggestion-item { padding: 0.6rem 1rem; cursor: pointer; transition: background 0.15s; display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--text-primary); }
.suggestion-item:hover { background: var(--bg-hover); }
.suggestion-item .suggestion-icon { font-size: 0.9rem; opacity: 0.6; }
.suggestion-item .suggestion-text { flex: 1; }
.suggestion-item .suggestion-badge { font-size: 0.7rem; color: var(--text-muted); }
.suggestion-category { padding: 0.3rem 1rem; font-size: 0.7rem; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); }

/* ★ 수정 #2: AI 버튼 flex-shrink:0 + min-width */
.btn-ai-scan { padding: 0 1.5rem; min-width: 100px; flex-shrink: 0; background: var(--accent-gradient); color: white; border: none; border-radius: var(--radius); font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: var(--transition); white-space: nowrap; }
.btn-ai-scan:hover { box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.btn-ai-scan:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-reset-inline { padding: 0 1rem; flex-shrink: 0; background: none; border: 1px solid var(--border); color: var(--text-secondary); border-radius: var(--radius); cursor: pointer; font-size: 0.85rem; transition: var(--transition); white-space: nowrap; }
.btn-reset-inline:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-filter-toggle { padding: 0 1rem; flex-shrink: 0; background: var(--bg-glass); border: 1px solid var(--border); color: var(--text-secondary); border-radius: var(--radius); cursor: pointer; font-size: 0.85rem; transition: var(--transition); white-space: nowrap; }
.btn-filter-toggle:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-filter-toggle.active { background: var(--accent); color: white; border-color: var(--accent); }

.scanner-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; font-size: 0.82rem; }
.scan-controls { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.scan-mode-toggle { display: flex; gap: 0.2rem; }
.scan-mode-btn { padding: 0.35rem 0.7rem; border: 1px solid var(--border); background: var(--bg-glass); color: var(--text-secondary); border-radius: 15px; cursor: pointer; font-size: 0.75rem; transition: var(--transition); }
.scan-mode-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.scan-results-count { color: var(--text-muted); }
.scan-results-count strong { color: var(--accent-light); }
.sensitivity-toggle { display: flex; gap: 0.2rem; }
.sensitivity-btn { padding: 0.3rem 0.55rem; border: 1px solid var(--border); background: var(--bg-glass); color: var(--text-secondary); border-radius: 12px; cursor: pointer; font-size: 0.7rem; transition: var(--transition); }
.sensitivity-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.sensitivity-btn:hover:not(.active) { border-color: var(--accent-light); }

/* ═══════════════════════════════════════════════════════════
   8. FILTERS + AI PANEL
   ═══════════════════════════════════════════════════════════ */
.active-filters { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.filter-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.65rem; background: rgba(124, 108, 240, 0.15); border: 1px solid var(--border-accent); border-radius: 15px; font-size: 0.75rem; color: var(--accent-light); animation: fadeSlideUp 0.2s ease; }
.filter-chip-x { cursor: pointer; font-weight: bold; opacity: 0.7; background: none; border: none; color: var(--accent-light); font-size: 0.85rem; line-height: 1; padding: 0 0.2rem; }
.filter-chip-x:hover { opacity: 1; }
.filters-grid { display: none; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; padding: 1rem; background: var(--bg-glass); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 1.5rem; overflow: visible; position: relative; z-index: 50; }
.filters-grid.open { display: grid; }
.f-group { display: flex; flex-direction: column; gap: 0.25rem; }
.f-group label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.f-group select, .f-group input { padding: 0.5rem 0.7rem; background: var(--bg-card-solid); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text-primary); font-size: 0.82rem; transition: var(--transition); }
.f-group select:focus, .f-group input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.ms-wrap { position: relative; }
.ms-btn { width: 100%; padding: 0.5rem 0.7rem; background: var(--bg-card-solid); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text-primary); font-size: 0.82rem; text-align: left; cursor: pointer; transition: var(--transition); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-btn:hover { border-color: var(--accent); }
.ms-panel { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 200; background: var(--bg-card-solid); border: 1px solid var(--accent); border-radius: var(--radius-xs); max-height: 250px; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.5); margin-top: 3px; }
.ms-panel.open { display: block; }
.ms-item { padding: 0.35rem 0.7rem; transition: background 0.15s; }
.ms-item:hover { background: var(--bg-hover); }
.ms-item label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.82rem; color: var(--text-primary); font-weight: 400; }
.ms-item input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.f-actions { grid-column: 1 / -1; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.f-actions button { padding: 0.5rem 0.9rem; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--bg-card-solid); color: var(--text-primary); cursor: pointer; font-size: 0.8rem; transition: var(--transition); }
.f-actions button:hover { border-color: var(--accent); }
.ai-panel { display: none; background: rgba(124, 108, 240, 0.06); border: 1px solid var(--border-accent); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 0.8rem; animation: fadeSlideUp 0.4s ease; }
.ai-panel.open { display: block; }
.ai-panel h4 { color: var(--accent-light); margin-bottom: 0.3rem; font-size: 0.95rem; }
.ai-guide { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.8rem; font-style: italic; }
.ai-kw-group { margin-bottom: 0.7rem; }
.ai-kw-group .group-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.ai-kw-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ai-kw-tag { display: inline-flex; align-items: center; padding: 0.28rem 0.65rem; background: var(--bg-card-solid); border: 1px solid var(--border); border-radius: 15px; font-size: 0.78rem; cursor: pointer; transition: var(--transition); user-select: none; color: var(--text-primary); }
.ai-kw-tag.selected { background: var(--accent); border-color: var(--accent); color: white; }
.ai-kw-tag:hover:not(.selected) { border-color: var(--accent-light); }
.ai-panel-actions { display: flex; gap: 0.4rem; margin-top: 0.8rem; }
.ai-panel-actions button { padding: 0.5rem 1rem; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--bg-card-solid); color: var(--text-primary); cursor: pointer; font-size: 0.82rem; transition: var(--transition); }
.ai-panel-actions .btn-apply-ai { background: var(--accent-gradient); border: none; color: white; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   9. HIGHLIGHT SECTION
   ═══════════════════════════════════════════════════════════ */
.highlight-section { margin: 2rem auto; max-width: var(--content-max); padding: 0 var(--content-pad); }
.highlight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.highlight-panel { background: var(--bg-glass); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; min-height: 280px; display: flex; flex-direction: column; }
.highlight-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-shrink: 0; }
.highlight-header h3 { font-size: 1rem; color: var(--text-bright); margin: 0; }
.highlight-controls { display: flex; align-items: center; gap: 0.5rem; }
.highlight-prev, .highlight-next { width: 28px; height: 28px; border: 1px solid var(--border); background: var(--bg-card-solid); color: var(--text-secondary); border-radius: 50%; cursor: pointer; font-size: 0.7rem; transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.highlight-prev:hover, .highlight-next:hover { border-color: var(--accent); color: var(--accent-light); }
.highlight-indicator { font-size: 0.75rem; color: var(--text-muted); min-width: 40px; text-align: center; }
.highlight-carousel { flex: 1; display: flex; align-items: center; }
.highlight-card { display: flex; gap: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; transition: var(--transition); position: relative; overflow: hidden; width: 100%; min-height: 180px; }
.highlight-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--card-color, var(--accent)); }
.highlight-card:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.highlight-card.curator-pick::before { background: linear-gradient(90deg, var(--warning), var(--accent)); }
.highlight-thumbnail { flex-shrink: 0; width: 80px; height: 60px; border-radius: var(--radius-xs); overflow: hidden; }
.highlight-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.highlight-content { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.highlight-category { font-size: 0.7rem; font-weight: 600; opacity: 0.8; }
.highlight-title { font-size: 0.85rem; font-weight: 600; color: var(--text-bright); margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.highlight-title:hover { color: var(--accent-light); }
.highlight-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.highlight-meta { display: flex; gap: 0.5rem; font-size: 0.7rem; color: var(--text-secondary); margin-top: auto; flex-wrap: wrap; }
.highlight-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-shrink: 0; }
.highlight-cta { display: inline-block; padding: 0.3rem 0.8rem; background: var(--accent-gradient); color: white; text-decoration: none; border-radius: var(--radius-xs); font-size: 0.75rem; font-weight: 600; transition: var(--transition); flex: 1; text-align: center; }
.highlight-cta:hover { box-shadow: var(--shadow-glow); }
.highlight-detail-btn { padding: 0.3rem 0.8rem; background: none; border: 1px solid var(--border); color: var(--text-secondary); border-radius: var(--radius-xs); cursor: pointer; font-size: 0.75rem; transition: var(--transition); flex: 1; }
.highlight-detail-btn:hover { border-color: var(--accent); color: var(--accent-light); }

/* ═══════════════════════════════════════════════════════════
   10. TABLE + VIEWS
   ═══════════════════════════════════════════════════════════ */
.list-section { margin: 1rem auto; max-width: var(--content-max); padding: 0 var(--content-pad); }
.list-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.list-header h2 { font-size: 1.1rem; color: var(--text-bright); }
.view-toggle { display: flex; gap: 0.3rem; }
.view-btn { padding: 0.35rem 0.7rem; border: 1px solid var(--border); background: var(--bg-glass); color: var(--text-secondary); border-radius: var(--radius-xs); cursor: pointer; font-size: 0.78rem; transition: var(--transition); }
.view-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); width: 100%; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; table-layout: auto; }
thead { background: var(--bg-nebula); position: sticky; top: 0; z-index: 10; }

/* ★ 수정 #3: 모든 th에 hover 효과 추가 */
th {
  padding: 0.7rem 0.6rem; text-align: left; font-weight: 700;
  color: var(--accent-light); white-space: nowrap;
  border-bottom: 2px solid var(--accent); font-size: 0.76rem;
  transition: color 0.2s, background 0.2s;
}
th:hover {
  color: var(--text-bright) !important;
  background: rgba(124, 108, 240, 0.1);
}

td { padding: 0.6rem; border-bottom: 1px solid rgba(100, 100, 160, 0.1); vertical-align: middle; }
tr { transition: background 0.2s; position: relative; }
tr:hover { background: rgba(124, 108, 240, 0.06); }
tr:nth-child(even) { background: rgba(255, 255, 255, 0.01); }
tr:nth-child(even):hover { background: rgba(124, 108, 240, 0.06); }
tr::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--row-cat-color, var(--accent)); opacity: 0; transition: opacity 0.2s; border-radius: 0 2px 2px 0; }
tr:hover::before { opacity: 1; }
.td-title { min-width: 200px; white-space: normal; word-break: break-word; line-height: 1.4; }
.td-score { text-align: center; width: 55px; }
.course-link { color: var(--accent-light); text-decoration: none; font-weight: 500; transition: color 0.2s; cursor: pointer; }
.course-link:hover { color: var(--accent); text-decoration: underline; }
.cat-badge { display: inline-block; padding: 0.12rem 0.45rem; border-radius: 8px; font-size: 0.72rem; white-space: nowrap; border: 1px solid var(--border); background: var(--bg-card-solid); }
.badge-new { display: inline-block; padding: 0.08rem 0.35rem; border-radius: 6px; font-size: 0.68rem; font-weight: 600; background: rgba(251, 191, 36, 0.15); color: var(--warning); }
th.col-check, td.col-check { width: 35px; text-align: center; }
td.col-check input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.score-badge { display: inline-block; padding: 0.15rem 0.45rem; border-radius: 8px; font-size: 0.72rem; font-weight: 700; text-align: center; min-width: 30px; }
.score-high { background: rgba(52, 211, 153, 0.2); color: var(--success); border: 1px solid rgba(52, 211, 153, 0.3); }
.score-mid { background: rgba(251, 191, 36, 0.2); color: var(--warning); border: 1px solid rgba(251, 191, 36, 0.3); }
.score-low { background: rgba(136, 136, 170, 0.15); color: var(--text-secondary); border: 1px solid var(--border); }
th.sortable { cursor: pointer; user-select: none; position: relative; padding-right: 1.2rem; }
th.sortable:hover { color: var(--text-bright); }
th.sortable::after { content: '⇅'; position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%); font-size: 0.65rem; opacity: 0.3; }
th.sortable.sort-desc::after { content: '▼'; opacity: 1; color: var(--accent-light); }
th.sortable.sort-asc::after { content: '▲'; opacity: 1; color: var(--accent-light); }
td:nth-child(8) { text-align: center; width: 60px; }
.card-grid { display: none; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.8rem; }
.card-grid.active { display: grid; }
.course-card { background: var(--bg-card); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; transition: var(--transition); cursor: pointer; position: relative; overflow: hidden; animation: fadeSlideUp 0.4s ease backwards; }
.course-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.course-card .card-cat-stripe { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--card-cat-color, var(--accent)); }
.course-card h4 { font-size: 0.92rem; margin: 0.5rem 0 0.3rem; color: var(--text-bright); }
.course-card .card-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.course-card .card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.6rem; }
.course-card .card-cta { display: inline-block; padding: 0.4rem 1rem; background: var(--accent-gradient); color: white; border-radius: var(--radius-xs); font-size: 0.8rem; font-weight: 600; text-decoration: none; transition: var(--transition); }
.course-card .card-cta:hover { box-shadow: var(--shadow-glow); }
.compact-list { display: none; }
.compact-list.active { display: block; }
.compact-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.compact-item:hover { background: var(--bg-hover); }
.compact-item .compact-title { flex: 1; font-size: 0.85rem; }
.compact-item .compact-title a { color: var(--accent-light); text-decoration: none; }
.compact-item .compact-title a:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 0.5rem; }

/* ═══════════════════════════════════════════════════════════
   11. PAGINATION + FAB
   ═══════════════════════════════════════════════════════════ */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.25rem; padding: 1rem 0; flex-wrap: wrap; }
.pagination button { padding: 0.35rem 0.7rem; background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text-secondary); cursor: pointer; font-size: 0.8rem; transition: var(--transition); }
.pagination button:hover { border-color: var(--accent); }
.pagination button.active { background: var(--accent); color: white; border-color: var(--accent); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }
.fab { display: none; position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--bg-card-solid); border: 1px solid var(--accent); border-radius: var(--radius); padding: 0.7rem 1.5rem; box-shadow: var(--shadow), var(--shadow-glow); z-index: 500; align-items: center; gap: 1rem; font-size: 0.85rem; animation: fadeSlideUp 0.3s ease; }
.fab.visible { display: flex; }
.fab button { padding: 0.4rem 0.9rem; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--bg-card-solid); color: var(--text-primary); cursor: pointer; font-size: 0.8rem; transition: var(--transition); }
.fab button:hover { border-color: var(--accent); }
.fab .btn-fab-csv { background: var(--accent-gradient); border: none; color: white; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   12. SIDE PANEL
   ═══════════════════════════════════════════════════════════ */
#side-panel-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; }
#side-panel-overlay.open { display: block; }
#side-panel { position: fixed; top: 65px; right: 0; width: 450px; max-width: 90vw; height: calc(100vh - 65px); background: var(--bg-nebula); border-left: 1px solid var(--border); overflow-y: auto; transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1001; padding: 1.5rem; }
#side-panel.open { transform: translateX(0); }
.sp-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
.sp-close:hover { color: var(--text-bright); }

/* ★ 수정 #5: 사이드바 제목 가운데 정렬 */
.sp-title { font-size: 1.15rem; margin-bottom: 1rem; padding-right: 2rem; color: var(--text-bright); line-height: 1.4; text-align: center; }

.sp-thumbnail { margin-bottom: 1rem; text-align: center; }
.sp-thumbnail img { max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.sp-section { margin-bottom: 1rem; }
.sp-section h4 { color: var(--accent-light); font-size: 0.9rem; margin-bottom: 0.4rem; }
.sp-section p, .sp-section ul, .sp-section div { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; overflow: visible !important; display: block !important; -webkit-line-clamp: unset !important; max-height: none !important; white-space: normal !important; word-break: break-word; }
.sp-section ul { padding-left: 1.2rem; }

/* ★ 수정 #5: 태그 가운데 정렬 */
.sp-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; justify-content: center; }
.sp-meta-tag { padding: 0.2rem 0.6rem; background: var(--bg-card-solid); border: 1px solid var(--border); border-radius: 12px; font-size: 0.78rem; color: var(--text-secondary); }

.sp-cta { display: block; width: 100%; padding: 0.75rem; background: var(--accent-gradient); color: white; text-align: center; text-decoration: none; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.95rem; transition: var(--transition); margin-bottom: 1rem; }
.sp-cta:hover { box-shadow: var(--shadow-glow); }

/* ★ 추가 #4: 사이드바 내부 번역 버튼 */
.sp-translate-btn { display: block; width: 100%; padding: 0.55rem; background: none; border: 1px solid var(--border); color: var(--text-secondary); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem; transition: var(--transition); margin-bottom: 0.8rem; }
.sp-translate-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.sp-translate-btn.translated { border-color: var(--success); color: var(--success); }
.sp-translate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.translated-text { color: var(--text-primary); font-style: italic; border-left: 2px solid var(--accent); padding-left: 0.6rem; margin-top: 0.3rem; font-size: 0.82rem; line-height: 1.6; }

.sp-similar-btn { display: block; width: 100%; padding: 0.6rem; background: none; border: 1px solid var(--border); color: var(--text-secondary); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem; transition: var(--transition); }
.sp-similar-btn:hover { border-color: var(--accent); color: var(--accent-light); }

/* ═══════════════════════════════════════════════════════════
   13. MISSION CENTER + STARS
   ═══════════════════════════════════════════════════════════ */
.mission-search { margin-bottom: 0.8rem; }
.mission-search input { width: 100%; padding: 0.75rem 1rem; background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-bright); font-size: 0.9rem; }
.mission-search input:focus { outline: none; border-color: var(--accent); }
.galaxy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; margin-bottom: 1.2rem; }
.galaxy-card { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 1rem 0.5rem; background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.galaxy-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.galaxy-card.active { border-color: var(--accent); background: rgba(124,108,240,0.12); }
.galaxy-card .emoji { font-size: 1.6rem; }
.galaxy-card .label { font-size: 0.8rem; font-weight: 600; }
.level-bar { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.level-bar label { padding: 0.45rem 1rem; background: var(--bg-glass); border: 1px solid var(--border); border-radius: 20px; cursor: pointer; font-size: 0.82rem; color: var(--text-secondary); transition: var(--transition); }
.level-bar input { display: none; }
.level-bar input:checked + label { background: var(--accent); color: white; border-color: var(--accent); }
.orbit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.7rem; }
.orbit-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; cursor: pointer; transition: var(--transition); animation: fadeSlideUp 0.4s ease backwards; }
.orbit-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.orbit-card h4 { font-size: 0.92rem; margin-bottom: 0.5rem; }
.orbit-card .orbit-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.stars-section { text-align: center; }
.stars-section h2 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.stars-section .subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.stars-toggle { display: flex; gap: 0.3rem; justify-content: center; margin-bottom: 1rem; }
.hero-card { background: var(--bg-card); border: 1px solid var(--border-accent); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem; text-align: left; position: relative; overflow: hidden; transition: var(--transition); }
.hero-card::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%); opacity: 0.3; pointer-events: none; }
.hero-card:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.hero-card .rank { font-size: 0.85rem; color: var(--warning); font-weight: 700; }
.hero-card h3 { font-size: 1.1rem; margin: 0.3rem 0; }
.hero-card h3 a { color: var(--text-bright); text-decoration: none; }
.hero-card h3 a:hover { color: var(--accent-light); }
.hero-card p { color: var(--text-secondary); font-size: 0.85rem; }
.hero-card .hero-cta { display: inline-block; margin-top: 0.8rem; padding: 0.5rem 1.2rem; background: var(--accent-gradient); color: white; border-radius: var(--radius-xs); text-decoration: none; font-weight: 600; font-size: 0.85rem; transition: var(--transition); }
.hero-card .hero-cta:hover { box-shadow: var(--shadow-glow); }
.stars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.7rem; }
.star-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: left; transition: var(--transition); }
.star-card:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.star-card .rank { font-size: 0.78rem; color: var(--warning); }
.star-card h4 { font-size: 0.88rem; margin: 0.2rem 0; }
.star-card h4 a { color: var(--accent-light); text-decoration: none; }
.star-card p { font-size: 0.78rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ═══════════════════════════════════════════════════════════
   14. TOAST + SCROLL + FOOTER + HELP + CSV + 번역기
   ═══════════════════════════════════════════════════════════ */
#toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: 0.4rem; }
.toast { padding: 0.7rem 1.1rem; background: var(--bg-card-solid); border: 1px solid var(--success); border-radius: var(--radius-xs); color: var(--text-primary); font-size: 0.83rem; box-shadow: var(--shadow); transform: translateX(120%); transition: transform 0.3s ease; max-width: 350px; }
.toast.show { transform: translateX(0); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

/* ★ 수정 #1: 맨위로 버튼 — 번역 버튼 위로 */
#scroll-to-top { position: fixed; bottom: 6rem; right: 1.5rem; width: 42px; height: 42px; border-radius: 50%; background: var(--accent-gradient); color: white; border: none; font-size: 1.1rem; cursor: pointer; opacity: 0; visibility: hidden; transition: var(--transition); z-index: 500; box-shadow: var(--shadow); }
#scroll-to-top.visible { opacity: 1; visibility: visible; }
#scroll-to-top:hover { transform: translateY(-3px); }

/* ★ 수정 #1: 번역 플로팅 버튼 — 아래 고정 */
.float-btn-translate { position: fixed; bottom: 2rem; right: 1.5rem; padding: 0.5rem 1rem; border-radius: 25px; background: var(--bg-card-solid); border: 1px solid var(--border); color: var(--text-secondary); font-size: 0.8rem; cursor: pointer; transition: var(--transition); z-index: 500; box-shadow: var(--shadow); display: flex; align-items: center; gap: 0.4rem; }
.float-btn-translate:hover { border-color: var(--accent); color: var(--accent-light); transform: translateY(-3px); }

#google_translate_element { position: fixed !important; bottom: 5rem; right: 1.5rem; z-index: 600; background: var(--bg-card-solid) !important; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem; box-shadow: var(--shadow); }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; }
.app-footer { text-align: center; padding: 2rem 0 1rem; color: var(--text-muted); font-size: 0.75rem; max-width: var(--content-max); margin: 0 auto; padding-left: var(--content-pad); padding-right: var(--content-pad); }
.app-footer p:nth-child(2) { font-size: 0.7rem; margin-top: 0.3rem; opacity: 0.7; }
.help-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 0.4rem 1rem; border-radius: var(--radius-xs); cursor: pointer; font-size: 0.8rem; transition: var(--transition); margin-top: 0.5rem; }
.help-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.help-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); z-index: 3000; justify-content: center; align-items: center; padding: 2rem; }
.help-overlay.active { display: flex; }
.help-content { background: var(--bg-nebula); border: 1px solid var(--border); border-radius: var(--radius); max-width: 700px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 2rem; position: relative; animation: fadeSlideUp 0.3s ease; }
.help-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
.help-close:hover { color: var(--text-bright); }
.help-content h2 { font-size: 1.3rem; color: var(--text-bright); margin-bottom: 1.5rem; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.help-section { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.help-section:last-child { border-bottom: none; }
.help-section h3 { font-size: 1rem; color: var(--accent-light); margin-bottom: 0.5rem; }
.help-section p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 0.5rem; }
.help-section ul { padding-left: 1.2rem; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.8; }
.help-section li strong { color: var(--text-primary); }
.csv-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.csv-columns label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }
.csv-columns input[type="checkbox"] { accent-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   15. GOOGLE TRANSLATE
   ═══════════════════════════════════════════════════════════ */
.goog-te-gadget { font-size: 0 !important; }
.goog-te-gadget .goog-te-combo { padding: 0.3rem 0.5rem; background: var(--bg-card-solid); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text-primary); font-size: 0.8rem; }
body.translated-ltr, body.translated-rtl { padding-top: 40px !important; }
body.translated-ltr .fixed-header { top: 40px !important; }
body.translated-ltr .header-spacer { height: 105px; }
body.translated-ltr #side-panel { top: 105px !important; height: calc(100vh - 105px) !important; }
.goog-te-banner-frame { position: fixed !important; top: 0 !important; z-index: 10000 !important; }

/* ═══════════════════════════════════════════════════════════
   16. ADMIN PANEL
   ═══════════════════════════════════════════════════════════ */
#admin-panel { position: relative; z-index: 1; min-height: 100vh; padding: 2rem; }
.admin-container { max-width: 1000px; margin: 0 auto; }
.admin-header { text-align: center; margin-bottom: 2rem; position: relative; }
.admin-header h1 { font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, #f59e0b, #ef4444, #f59e0b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.admin-subtitle { color: var(--text-secondary); font-size: 0.9rem; }
.admin-exit-btn { position: absolute; top: 0; right: 0; padding: 0.5rem 1rem; background: none; border: 1px solid var(--border); color: var(--text-secondary); border-radius: var(--radius-xs); cursor: pointer; font-size: 0.85rem; transition: var(--transition); }
.admin-exit-btn:hover { border-color: var(--danger); color: var(--danger); }
.admin-status-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.admin-card { background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; transition: var(--transition); }
.admin-card:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.admin-card-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.admin-card-title { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.admin-card-value { font-size: 1.3rem; font-weight: 800; color: var(--text-bright); }
.admin-card-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; }
.admin-sections { display: flex; flex-direction: column; gap: 1.5rem; }
.admin-section { background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.admin-section h3 { font-size: 1.1rem; color: var(--text-bright); margin-bottom: 0.3rem; }
.admin-desc { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; }
.admin-btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.admin-btn { padding: 0.6rem 1.2rem; border: 1px solid var(--border); background: var(--bg-card-solid); color: var(--text-primary); border-radius: var(--radius-xs); cursor: pointer; font-size: 0.85rem; transition: var(--transition); }
.admin-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.admin-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.admin-btn-primary { background: var(--accent-gradient); border: none; color: white; font-weight: 600; }
.admin-btn-primary:hover { box-shadow: var(--shadow-glow); }
.admin-btn-warning { border-color: var(--warning); color: var(--warning); }
.admin-btn-warning:hover { background: rgba(251, 191, 36, 0.1); }
.admin-btn-danger { border-color: var(--danger); color: var(--danger); }
.admin-btn-danger:hover { background: rgba(248, 113, 113, 0.1); }
.admin-log { max-height: 400px; overflow-y: auto; background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 0.8rem; font-family: 'Consolas', monospace; font-size: 0.78rem; line-height: 1.6; color: var(--text-secondary); }
.admin-log:empty { display: none; }
.log-entry { padding: 0.4rem 0; border-bottom: 1px solid rgba(100, 100, 160, 0.1); }
.log-entry:last-child { border-bottom: none; }
.log-entry.log-success { color: var(--success); }
.log-entry.log-error { color: var(--danger); }
.log-entry.log-info { color: var(--info); }

/* ═══════════════════════════════════════════════════════════
   17. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --content-pad: 1rem; }
  .header-inner { flex-direction: column; gap: 0.5rem; align-items: stretch; padding: 0 1rem; }
  .header-title { justify-content: center; font-size: 1.1rem; }
  .header-nav { justify-content: center; }
  .header-nav-btn { padding: 0.35rem 0.8rem; font-size: 0.75rem; }
  .header-spacer { height: 100px; }
  .stats-section { flex-direction: column; align-items: center; }
  .stats-card { min-width: auto; width: 100%; max-width: none; }
  .scanner-bar { flex-direction: column; }
  .btn-ai-scan, .btn-reset-inline, .btn-filter-toggle { padding: 0.7rem 1rem; width: 100%; }
  .highlight-grid { grid-template-columns: 1fr; gap: 1rem; }
  .highlight-card { flex-direction: column; text-align: center; min-height: auto; }
  .highlight-thumbnail { width: 100%; height: 120px; }
  .highlight-actions { flex-direction: column; }
  .highlight-panel { min-height: auto; }
  #side-panel { width: 100vw; top: 100px; height: calc(100vh - 100px); }
  .fab { padding: 0.5rem 1rem; gap: 0.5rem; font-size: 0.78rem; bottom: 4rem; }
  /* ★ 수정 #1: 모바일에서도 겹치지 않게 */
  #scroll-to-top { bottom: 8rem; right: 1rem; }
  .float-btn-translate { bottom: 4rem; right: 1rem; font-size: 0.75rem; padding: 0.4rem 0.8rem; }
  .app-footer { padding-bottom: 5rem; }
  .admin-status-cards { grid-template-columns: 1fr 1fr; }
  .admin-btn-group { flex-direction: column; }
  .admin-btn { width: 100%; }
}

@media (max-width: 480px) {
  .filters-grid { grid-template-columns: 1fr; }
  .galaxy-grid { grid-template-columns: repeat(2, 1fr); }
  .gate-job-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .stars-grid { grid-template-columns: 1fr; }
  .progress-bar { width: 200px; }
  .header-nav-btn { padding: 0.3rem 0.6rem; font-size: 0.7rem; }
}

/* ═══════════════════════════════════════════════════════════
   18. SCROLLBAR & SELECTION
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-light); }
::selection { background: rgba(124, 108, 240, 0.3); color: var(--text-bright); }
