/* ─────────────────────────────────────────────────────
   GeroEngine v5 — App CSS
   디자인 시스템: 다크 사이드바 + 라이트 본문 + 골드 액센트
   (GeroLetter / Spermidine Intelligence 통합)
   ───────────────────────────────────────────────────── */

:root {
  /* ── Canvas / surfaces (cool, clean) ── */
  --bg: #f4f5fb;
  --bg-soft: #fafbff;
  --surface: #ffffff;
  --surface-elev: #fbfcff;
  --border: #e7eaf3;
  --border-strong: #d3d8ea;
  --text-primary: #0e1222;
  --text-secondary: #4a5169;
  --text-tertiary: #727a97;
  --text-muted: #9aa2bd;

  /* ── Dark sidebar (AgingAtlas navy) ── */
  --side-bg: #0f2a43;
  --side-bg-hover: #1b3b5a;
  --side-text: #b9c8d8;
  --side-text-strong: #f2f7fb;
  --side-text-muted: #6a86a0;
  --side-border: #1e415f;

  /* ── Brand (AgingAtlas teal) ── */
  --accent: #03a696;
  --accent-strong: #038a7d;
  --accent-hover: #027669;
  --accent-light: #e4f6f4;
  --accent-border: #a3e2da;
  --accent-grad: linear-gradient(135deg, #03a696 0%, #0891b2 100%);
  --accent-soft-grad: linear-gradient(135deg, #e4f6f4 0%, #e6f4f8 100%);

  /* ── Status (modern) ── */
  --success: #0d9f6e;
  --success-light: #e6f7f0;
  --warning: #e08a00;
  --warning-light: #fdf3e0;
  --danger: #ef4363;
  --danger-light: #fdecef;
  --info: #3b82f6;
  --info-light: #e9f1ff;

  /* ── Layout (modern radii & layered shadows) ── */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16,20,45,.05), 0 1px 3px rgba(16,20,45,.04);
  --shadow: 0 8px 22px -6px rgba(16,20,45,.13), 0 2px 6px -2px rgba(16,20,45,.07);
  --shadow-lg: 0 24px 48px -14px rgba(16,20,45,.24);
  --ring: 0 0 0 3px rgba(3,166,150,.22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-overflow-scrolling: touch;
}

/* ─── Layout ─── */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  transition: grid-template-columns .25s ease;
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 64px 1fr;
}

/* ─── Sidebar (다크) ─── */
.sidebar {
  background: var(--side-bg);
  color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--side-border);
  overflow: hidden;
}
.brand {
  padding: 22px 18px 20px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--side-border);
}
.brand-mark {
  width: 40px; height: 40px; flex-shrink: 0;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.brand-mark img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
/* 로고 클릭 시 부드러운 360° 회전 */
@keyframes gg-logo-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.brand-mark.spin img { animation: gg-logo-spin .65s cubic-bezier(.34,1.56,.64,1); }
@media (prefers-reduced-motion: reduce) { .brand-mark.spin img { animation: none; } }
.brand-text-group { min-width: 0; flex: 1; }
.brand-text {
  font-size: 16px; font-weight: 700;
  color: var(--side-text-strong);
  letter-spacing: -0.01em; line-height: 1.2;
}
.brand-tag {
  font-size: 10.5px; color: var(--side-text-muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-top: 2px;
}

/* Nav */
.nav-main {
  flex: 1; padding: 14px 10px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.nav-section {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--side-text-muted);
  padding: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  background: transparent; border: none;
  border-radius: 7px;
  color: var(--side-text);
  font: inherit; font-size: 13.5px; text-align: left;
  cursor: pointer; transition: all .12s ease;
  width: 100%;
}
.nav-item:hover {
  background: var(--side-bg-hover);
  color: var(--side-text-strong);
}
.nav-item.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}
.nav-item.active .nav-icon { color: white; }
.nav-icon {
  width: 18px; flex-shrink: 0; text-align: center;
  font-size: 14px; opacity: 0.9;
}
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sidebar foot */
.sidebar-foot {
  padding: 12px 10px 14px;
  border-top: 1px solid var(--side-border);
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: transparent; border: none;
  color: var(--side-text-muted);
  font: inherit; font-size: 12.5px;
  cursor: pointer; border-radius: 6px;
  transition: all .12s;
}
.sidebar-toggle:hover { background: var(--side-bg-hover); color: var(--side-text); }
.collapse-icon { font-size: 14px; }

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--side-bg-hover);
  border-radius: 8px;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 12.5px; font-weight: 600;
  color: var(--side-text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-role {
  font-size: 10.5px; color: var(--side-text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-top: 1px;
}
.user-logout {
  width: 28px; height: 28px;
  background: transparent; border: 1px solid var(--side-border);
  color: var(--side-text-muted);
  border-radius: 6px; cursor: pointer;
  font-size: 14px;
  transition: all .12s;
}
.user-logout:hover {
  background: var(--danger); color: white; border-color: var(--danger);
}
.version-info {
  font-size: 10.5px; color: var(--side-text-muted);
  text-align: center; padding: 0 4px;
}

/* ─── Collapsed sidebar ─── */
.app-shell.sidebar-collapsed .brand-text-group,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-section,
.app-shell.sidebar-collapsed .user-info,
.app-shell.sidebar-collapsed .version-info {
  display: none !important;
}
.app-shell.sidebar-collapsed .brand { justify-content: center; padding: 22px 8px; }
.app-shell.sidebar-collapsed .nav-item { justify-content: center; padding: 9px 6px; }
.app-shell.sidebar-collapsed .user-card { justify-content: center; padding: 6px; }
.app-shell.sidebar-collapsed .sidebar-toggle { justify-content: center; }

/* ─── Main ─── */
.main {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 100vh;
  background: var(--bg);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--text-secondary);
}
.brand-mini {
  font-weight: 700; color: var(--accent);
  letter-spacing: -0.01em;
}
.sep { color: var(--text-muted); }
#page-title { color: var(--text-primary); font-weight: 600; }

.llm-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: 100px;
  font-size: 12px; font-weight: 600;
  color: var(--accent);
}
.llm-badge.vllm {
  background: var(--info-light);
  border-color: #93c5fd;
  color: var(--info);
}

.page-container {
  flex: 1; padding: 32px 28px;
  overflow-x: auto;
}

/* ─── Page header ─── */
.page-head {
  margin-bottom: 24px;
}
.page-head h1 {
  font-size: 26px; font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  word-break: keep-all;
}
.page-head .sub {
  color: var(--text-secondary); font-size: 14px;
  word-break: keep-all;
}

/* ─── Hero (애니메이션 배너 배경) ─── */
.hero-dark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  padding: 52px 40px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  background: #0f2a43;
  box-shadow: 0 24px 50px -20px rgba(15,42,67,.6);
}
/* 이미지 레이어 — 천천히 줌/패닝 (Ken Burns) */
.hero-dark::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url('/static/images/hero_bg.webp') center right / cover no-repeat;
  transform-origin: 70% 40%;
  animation: heroPan 30s ease-in-out infinite alternate;
}
/* 네이비→틸 오버레이 + 드리프트하는 틸 글로우 */
.hero-dark::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, rgba(15,42,67,.97) 0%, rgba(15,42,67,.82) 32%, rgba(15,42,67,.34) 60%, rgba(3,166,150,.10) 100%),
    radial-gradient(560px 300px at 78% 32%, rgba(3,166,150,.30), transparent 72%);
  background-size: 100% 100%, 170% 170%;
  animation: heroGlow 14s ease-in-out infinite alternate;
}
@keyframes heroPan {
  from { transform: scale(1.05) translateX(0); }
  to   { transform: scale(1.15) translateX(-2.5%); }
}
@keyframes heroGlow {
  from { background-position: 0 0, 58% 28%; }
  to   { background-position: 0 0, 92% 52%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-dark::before, .hero-dark::after,
  .hero-dark h1, .hero-dark p, .hero-dark .actions { animation: none; }
}
.hero-dark h1 {
  font-size: 30px; font-weight: 800;
  letter-spacing: -0.03em; margin-bottom: 10px;
  text-shadow: 0 2px 18px rgba(0,0,0,.28);
  animation: heroRise .7s cubic-bezier(.2,.7,.2,1) both;
}
.hero-dark p {
  color: #d3e0ec; font-size: 15px;
  word-break: keep-all; line-height: 1.65;
  max-width: 640px;
  text-shadow: 0 1px 12px rgba(0,0,0,.25);
  animation: heroRise .7s .08s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes heroRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero-dark .actions {
  margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap;
  animation: heroRise .7s .16s cubic-bezier(.2,.7,.2,1) both;
}

/* ─── Stat cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all .15s;
}
.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.stat-card.clickable {
  cursor: pointer;
}
.stat-card.clickable:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
}
.stat-card::before {
  content: ""; position: absolute;
  top: 0; left: 0; width: 3px; height: 100%;
  background: var(--accent);
}
.stat-card.green::before { background: var(--success); }
.stat-card.blue::before { background: var(--info); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.warn::before { background: var(--warning); }
.stat-label {
  font-size: 11px; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 8px; font-weight: 600;
}
.stat-value {
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.025em;
  font-feature-settings: 'tnum';
  line-height: 1.1; margin-bottom: 4px;
}
.stat-desc {
  font-size: 12px; color: var(--text-secondary);
}

/* ─── Cards ─── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 16px; font-weight: 700;
  margin-bottom: 14px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.card-sub {
  font-size: 12.5px; color: var(--text-secondary);
  margin-top: -8px; margin-bottom: 14px;
  word-break: keep-all;
}

/* ─── Form fields ─── */
.field { margin-bottom: 14px; }
.field-label {
  display: block; font-size: 12px;
  font-weight: 600; color: var(--text-secondary);
  margin-bottom: 6px; letter-spacing: 0.02em;
}
.input, .select, .textarea {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 13.5px; font-family: inherit;
  background: var(--surface); color: var(--text-primary);
  transition: border-color .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
}
.textarea { resize: vertical; min-height: 80px; font-family: inherit; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 768px) {
  .row-2, .row-3 { grid-template-columns: 1fr; }
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  background: white; color: var(--text-primary);
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .12s;
}
.btn:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary {
  background: var(--text-primary); color: white;
  border-color: var(--text-primary);
}
.btn.primary:hover { background: #000; border-color: #000; }
.btn.accent {
  background: var(--accent); color: white; border-color: var(--accent);
}
.btn.accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost {
  background: transparent; border-color: transparent;
  color: var(--text-secondary);
}
.btn.ghost:hover { background: var(--bg-soft); color: var(--text-primary); }

/* Hero (다크) 안의 버튼 — 흰 배경에 흰 글자 문제 fix */
.hero-dark .btn {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}
.hero-dark .btn:hover {
  background: rgba(255,255,255,0.2);
  color: white;
  border-color: rgba(255,255,255,0.3);
}
.hero-dark .btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.hero-dark .btn.accent:hover {
  background: #fff;
  border-color: #fff;
  color: var(--accent-strong);
}
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.danger {
  background: var(--danger); color: white; border-color: var(--danger);
}
.btn.danger:hover { background: #e11d48; border-color: #e11d48; }

/* ─── Tables ─── */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 16px;
}
table.data-table {
  width: 100%; border-collapse: collapse;
}
.data-table th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px; font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-soft); }
.data-table td strong { color: var(--text-primary); }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-go { background: var(--success-light); color: var(--success); }
.badge-nogo { background: var(--danger-light); color: var(--danger); }
.badge-review { background: var(--warning-light); color: var(--warning); }
.badge-running { background: var(--info-light); color: var(--info); }
.badge-completed { background: var(--success-light); color: var(--success); }
.badge-failed { background: var(--danger-light); color: var(--danger); }
.badge-queued { background: #f3f4f6; color: var(--text-secondary); }

/* ─── Progress ─── */
.progress-bar {
  width: 100%; height: 6px;
  background: var(--bg-soft); border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 100px;
  transition: width .4s ease;
}

/* ─── Callout ─── */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
  font-size: 13.5px; color: var(--text-primary);
}
.callout.success { border-left-color: var(--success); background: var(--success-light); }
.callout.warning { border-left-color: var(--warning); background: var(--warning-light); }
.callout.danger  { border-left-color: var(--danger); background: var(--danger-light); }
.callout.info    { border-left-color: var(--info); background: var(--info-light); }

/* ─── Loader / Empty ─── */
.loader {
  padding: 60px 20px; text-align: center;
  color: var(--text-tertiary); font-size: 14px;
}
.empty-state {
  padding: 48px 20px; text-align: center;
  color: var(--text-tertiary);
}
.empty-state-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 15px; color: var(--text-secondary); font-weight: 600; margin-bottom: 4px; }
.empty-state-desc { font-size: 13px; color: var(--text-muted); }

/* ─── LLM Provider radio cards ─── */
.provider-radio-row {
  display: flex; gap: 12px; margin-bottom: 8px;
}
.provider-card {
  flex: 1; padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  background: white;
}
.provider-card:hover { border-color: var(--border-strong); }
.provider-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
}
.provider-card input { margin-right: 8px; }
.provider-card-title {
  font-weight: 700; font-size: 14px;
  display: inline-block;
}
.provider-card-desc {
  font-size: 11.5px; color: var(--text-tertiary);
  margin-top: 4px;
}

/* ─── Toast ─── */
#toast-host {
  position: fixed; top: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
}
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  box-shadow: var(--shadow);
  font-size: 13px; min-width: 240px; max-width: 360px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: slide-in .25s ease;
  pointer-events: auto;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.danger { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ─── Mono / code ─── */
code, .mono {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-feature-settings: 'tnum';
}

/* ─── Helpers ─── */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-small { font-size: 12px; }
.text-soft { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-bold { font-weight: 600; }

/* ─────────────────────────────────────────────────
   v1.0 추가 컴포넌트
   ───────────────────────────────────────────────── */

/* Brand button (로고 클릭) */
.brand-btn {
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; text-align: left;
  width: 100%; transition: opacity .15s;
}
.brand-btn:hover { opacity: 0.85; }

/* Breadcrumb back */
.topbar-left { display: flex; align-items: center; gap: 12px; }
.breadcrumb-back {
  width: 32px; height: 32px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; font-size: 18px;
  color: var(--text-secondary); font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.breadcrumb-back:hover {
  background: white; border-color: var(--border-strong);
  color: var(--text-primary);
}
.breadcrumb-link {
  background: transparent; border: none;
  font: inherit; font-size: 13.5px;
  font-weight: 700; color: var(--accent);
  cursor: pointer; padding: 0;
  letter-spacing: -0.01em;
}
.breadcrumb-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════
   화려한 진행률 바 — Pipeline Stage Indicator
   ═══════════════════════════════════════════════════ */
.pipeline-progress {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.pipeline-stages {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 6px; margin-bottom: 18px;
  position: relative;
}
.pipeline-stage {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  position: relative; z-index: 2;
}
.pipeline-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  transition: all .3s ease;
  position: relative;
}
.pipeline-stage.pending .pipeline-circle {
  background: var(--bg-soft);
  color: var(--text-muted);
}
.pipeline-stage.active .pipeline-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow:
    0 0 0 4px rgba(184, 134, 11, 0.15),
    0 6px 16px rgba(184, 134, 11, 0.35);
  animation: pulse-glow 1.4s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(184, 134, 11, 0.15),
      0 6px 16px rgba(184, 134, 11, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(184, 134, 11, 0.08),
      0 8px 20px rgba(184, 134, 11, 0.5);
  }
}
.pipeline-stage.done .pipeline-circle {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.pipeline-stage.done .pipeline-circle::after {
  content: "✓"; position: absolute;
  font-size: 16px; font-weight: 800;
}
.pipeline-stage.done .pipeline-num { display: none; }
.pipeline-stage.failed .pipeline-circle {
  background: var(--danger); border-color: var(--danger);
  color: white;
}
.pipeline-label {
  font-size: 11px; color: var(--text-tertiary);
  text-align: center; line-height: 1.3;
  max-width: 110px; min-height: 28px;
  word-break: keep-all;
  font-weight: 500;
}
.pipeline-stage.active .pipeline-label {
  color: var(--accent); font-weight: 700;
}
.pipeline-stage.done .pipeline-label {
  color: var(--success); font-weight: 600;
}
/* Connector lines between stages */
.pipeline-stage:not(:last-child)::after {
  content: ""; position: absolute;
  top: 22px; left: 50%; right: -50%;
  height: 2px;
  background: var(--border);
  z-index: 1;
}
.pipeline-stage.done:not(:last-child)::after {
  background: var(--success);
}
.pipeline-stage.active:not(:last-child)::after {
  background: linear-gradient(90deg, var(--accent) 0%, var(--border) 100%);
}
.pipeline-progress-bar {
  width: 100%; height: 8px;
  background: var(--bg-soft); border-radius: 100px;
  overflow: hidden; margin-bottom: 8px;
  position: relative;
}
.pipeline-progress-fill {
  height: 100%;
  background: linear-gradient(90deg,
    var(--accent) 0%, #06b6d4 50%, var(--accent) 100%);
  background-size: 200% 100%;
  animation: progress-shimmer 2s linear infinite;
  border-radius: 100px;
  transition: width .5s ease;
  box-shadow: 0 0 8px rgba(184, 134, 11, 0.4);
}
@keyframes progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.pipeline-status-text {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-secondary);
}
.pipeline-percent {
  font-size: 18px; font-weight: 700; color: var(--accent);
  font-feature-settings: 'tnum';
}

/* ═══════════════════════════════════════════════════
   인앱 리포트 뷰어
   ═══════════════════════════════════════════════════ */
.report-viewer-wrap {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 0;
}
.report-viewer-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 12px 16px;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.report-viewer-title {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.report-viewer-iframe {
  width: 100%; height: calc(100vh - 200px);
  min-height: 600px; border: none; background: white;
}

/* Tabs (분석 / 의사결정 전환) */
.tab-bar {
  display: flex; gap: 4px; padding: 8px 12px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  padding: 6px 14px; background: transparent;
  border: none; border-radius: 6px;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; color: var(--text-secondary);
  transition: all .12s;
}
.tab-btn:hover { background: white; }
.tab-btn.active {
  background: white; color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ═══════════════════════════════════════════════════
   Modal (데이터 자산 등록용)
   ═══════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  animation: fade-in .15s;
}
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.modal-box {
  background: white; border-radius: 14px;
  width: 600px; max-width: 100%; max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em;
}
.modal-close {
  width: 30px; height: 30px;
  background: transparent; border: none;
  border-radius: 6px; cursor: pointer;
  font-size: 18px; color: var(--text-tertiary);
}
.modal-close:hover { background: var(--bg-soft); }
.modal-body { padding: 20px 22px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-radius: 0 0 14px 14px;
}

/* Data asset cards */
.asset-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.asset-card {
  background: white; border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
  transition: all .15s;
}
.asset-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.asset-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px; gap: 8px;
}
.asset-card-name {
  font-weight: 700; font-size: 14px;
  letter-spacing: -0.01em;
  flex: 1; word-break: keep-all;
}
.asset-card-desc {
  font-size: 12.5px; color: var(--text-secondary);
  line-height: 1.5; margin-bottom: 10px;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.asset-card-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted);
  padding-top: 8px; border-top: 1px solid var(--border);
}
.asset-card-meta span { display: inline-flex; gap: 3px; }
.badge-category-internal { background: var(--success-light); color: var(--success); }
.badge-category-external { background: var(--info-light); color: var(--info); }
.badge-category-api { background: var(--accent-light); color: var(--accent); }
.badge-seed { background: #fef3c7; color: var(--warning); }

/* ─────────────────────────────────────────────────
   v1.0.3 — 시스템 카드 시각화 + Hero word-break + 모바일
   ───────────────────────────────────────────────── */

/* Hero — 한국어 자연 줄바꿈 (word-break: keep-all → normal) */
.hero-dark h1,
.hero-dark p {
  word-break: normal !important;
  overflow-wrap: break-word;
  word-spacing: normal;
}

/* Live indicator (실시간 표시) */
.live-pulse {
  display: inline-block;
  width: 8px; height: 8px;
  color: var(--success);
  animation: live-blink 2s infinite;
  margin-right: 4px;
  transition: color 0.3s;
}
@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* 시스템 카드 그리드 */
.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.system-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}
.system-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.sys-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.sys-icon {
  font-size: 22px;
  width: 38px; height: 38px;
  background: var(--bg-soft);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.sys-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  flex: 1;
}

.sys-gauge-wrap {
  display: flex; align-items: baseline; justify-content: center;
  margin-bottom: 12px;
}
.sys-percent {
  font-size: 38px;
  font-weight: 800;
  font-feature-settings: 'tnum';
  letter-spacing: -0.03em;
  line-height: 1;
}
.sys-percent-unit {
  font-size: 18px;
  margin-left: 2px;
  font-weight: 600;
  opacity: 0.7;
}

.sys-bar {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 10px;
}
.sys-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width .5s ease-out, background .3s;
  box-shadow: 0 0 8px currentColor;
}

.sys-sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
  text-align: center;
  letter-spacing: -0.01em;
}
.sys-na {
  text-align: center;
  font-size: 28px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* 모바일 — 시스템 카드 / 페이지 헤더 */
/* (이전 모바일 미디어쿼리는 파일 맨 아래의 v1.0.5 overhaul로 통합됨) */

/* 진행률 바 (Korea10K 같은 대용량 표용 보조) */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-soft);
  border-radius: 100px;
  overflow: hidden;
}
.progress-bar .progress-fill {
  height: 100%;
  border-radius: 100px;
  transition: width .5s;
}

/* ═══════════════════════════════════════════════════════════════
   v1.0.5 — 완전 모바일 반응형 (전면 overhaul)
   ═══════════════════════════════════════════════════════════════ */

/* 햄버거 버튼 (데스크탑은 숨김) */
.mobile-menu-btn {
  display: none;
  width: 38px; height: 38px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform .2s;
}

/* 모바일 backdrop (사이드바 열렸을 때 뒤편) */
.mobile-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity .25s;
}

/* ═══════════════════════════════════════════════════════════════
   모바일 (≤ 768px) — 사이드바 슬라이드 + 모든 그리드 1-2 컬럼
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* App shell — 사이드바를 화면 밖으로 */
  .app-shell { grid-template-columns: 1fr !important; }

  .sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform .28s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
  }
  .app-shell.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }
  .app-shell.mobile-sidebar-open .mobile-backdrop {
    display: block; opacity: 1;
  }

  /* 사이드바 토글 버튼은 숨김 (햄버거가 대신함) */
  .sidebar-toggle { display: none !important; }

  /* 햄버거 버튼 표시 */
  .mobile-menu-btn { display: flex !important; }
  /* mobile-backdrop는 .app-shell.mobile-sidebar-open일 때만 표시 (위 규칙 참고) */

  /* topbar */
  .topbar {
    padding: 10px 12px !important;
    position: sticky; top: 0;
    background: white;
    z-index: 50;
    border-bottom: 1px solid var(--border);
  }
  .topbar-left { gap: 8px !important; min-width: 0; flex: 1; }
  .breadcrumb {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .breadcrumb-link { font-size: 13px !important; }
  .topbar-right { flex-shrink: 0; }
  .llm-badge { font-size: 11px !important; padding: 4px 8px !important; }
  .llm-icon { font-size: 12px !important; }

  /* 메인 컨테이너 */
  .main {
    padding: 0 !important;
    width: 100%;
    overflow-x: hidden;
  }
  .page-container {
    padding: 12px !important;
    overflow-x: hidden;
  }

  /* Hero */
  .hero-dark {
    padding: 24px 18px !important;
    border-radius: 12px !important;
    margin-bottom: 16px;
  }
  .hero-dark h1 {
    font-size: 19px !important;
    line-height: 1.35 !important;
    word-break: normal !important;
    margin-bottom: 8px !important;
  }
  .hero-dark p {
    font-size: 13px !important;
    line-height: 1.55 !important;
    word-break: normal !important;
    margin-bottom: 14px !important;
  }
  .hero-dark .actions {
    flex-direction: column !important;
    gap: 8px;
  }
  .hero-dark .actions .btn {
    width: 100% !important;
    justify-content: center;
    padding: 10px 14px !important;
    font-size: 13px !important;
  }

  /* Page head */
  .page-head { margin-bottom: 16px !important; }
  .page-head h1 {
    font-size: 20px !important;
    word-break: keep-all;
  }
  .page-head .sub {
    font-size: 12.5px !important;
    word-break: keep-all;
  }
  .page-head .flex-between {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }
  .page-head .flex-between > div:first-child { width: 100%; }

  /* Cards */
  .card {
    padding: 16px !important;
    margin: 0 0 12px 0 !important;
    border-radius: 10px !important;
  }
  .card-title {
    font-size: 14px !important;
    word-break: keep-all;
  }

  /* Stats grid — 2 컬럼 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .stat-card { padding: 14px 12px !important; }
  .stat-label {
    font-size: 9.5px !important;
    letter-spacing: 0.05em !important;
  }
  .stat-value { font-size: 22px !important; }
  .stat-desc { font-size: 11px !important; }

  /* System grid — 2 컬럼 */
  .system-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .system-card { padding: 14px 12px !important; border-radius: 10px !important; }
  .sys-head { margin-bottom: 10px !important; gap: 6px !important; }
  .sys-icon { width: 30px !important; height: 30px !important; font-size: 16px !important; }
  .sys-label { font-size: 11.5px !important; }
  .sys-percent { font-size: 24px !important; }
  .sys-percent-unit { font-size: 13px !important; }
  .sys-sub { font-size: 10.5px !important; }

  /* Asset grid — 1 컬럼 */
  .asset-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .asset-card { padding: 14px !important; }
  .asset-card-name { font-size: 13.5px !important; }
  .asset-card-desc { font-size: 12px !important; }

  /* Pipeline progress (분석 진행률) */
  .pipeline-progress { padding: 16px 12px !important; }
  .pipeline-stages {
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }
  .pipeline-stage {
    flex: 0 0 calc(33.33% - 6px) !important;
    min-width: 0;
  }
  .pipeline-circle { width: 36px !important; height: 36px !important; font-size: 12px !important; }
  .pipeline-label { font-size: 10px !important; max-width: 100% !important; min-height: 0 !important; }
  .pipeline-stage:not(:last-child)::after { display: none !important; }
  .pipeline-percent { font-size: 16px !important; }
  .pipeline-status-text { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Forms */
  .row-2, .row-3 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .input, .textarea, .select {
    font-size: 16px !important;       /* iOS 자동 줌 방지 */
    padding: 11px 12px !important;
  }
  .field-label { font-size: 12px !important; }

  /* Buttons */
  .btn {
    padding: 10px 14px !important;
    font-size: 13px !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .btn.sm {
    padding: 7px 10px !important;
    font-size: 12px !important;
  }

  /* Callouts */
  .callout {
    padding: 12px 14px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  /* Tables — 가로 스크롤 */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;            /* 화면 가장자리까지 스크롤 */
    padding: 0 12px;
    border-radius: 0;
  }
  .data-table, table {
    font-size: 12px !important;
    min-width: 600px;
  }
  .data-table th, table th {
    padding: 8px 10px !important;
    font-size: 10px !important;
  }
  .data-table td, table td { padding: 8px 10px !important; }

  /* 리포트 뷰어 (iframe) */
  .report-viewer-wrap {
    border-radius: 10px !important;
    margin: 0 -12px;
  }
  .report-viewer-toolbar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px !important;
  }
  .report-viewer-toolbar .flex {
    width: 100%;
    justify-content: stretch !important;
  }
  .report-viewer-toolbar .btn { flex: 1; justify-content: center; }
  .report-viewer-iframe {
    height: calc(100vh - 240px) !important;
    min-height: 400px !important;
  }
  .tab-bar { padding: 6px 8px !important; flex-wrap: wrap; }
  .tab-btn { padding: 5px 10px !important; font-size: 12px !important; flex: 1; }

  /* Modal */
  .modal-backdrop { padding: 12px !important; }
  .modal-box {
    max-height: 95vh !important;
    border-radius: 12px !important;
  }
  .modal-head { padding: 14px 16px !important; }
  .modal-title { font-size: 14px !important; }
  .modal-body { padding: 14px 16px !important; }
  .modal-foot { padding: 12px 16px !important; }

  /* Chart blocks (분석 리포트 차트) */
  .chart-block img { max-width: 100% !important; height: auto !important; }

  /* Footer / sidebar 사용자 카드 */
  .user-card { padding: 12px !important; }
  .user-name { font-size: 13px !important; }
  .user-role { font-size: 11px !important; }

  /* Toast */
  #toast-host {
    bottom: 16px !important;
    right: 12px !important;
    left: 12px !important;
  }
  #toast-host > div {
    width: 100%;
    font-size: 13px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   초소형 모바일 (≤ 480px) — 미세 조정
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* 1 컬럼으로 — 너무 좁아서 2 컬럼은 답답함 */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;  /* 2칸은 유지 */
  }
  .system-grid {
    grid-template-columns: 1fr !important;     /* 시스템은 1칸 */
  }
  .stat-value { font-size: 20px !important; }
  .hero-dark h1 { font-size: 17px !important; }
  .hero-dark p { font-size: 12.5px !important; }
  .page-head h1 { font-size: 18px !important; }

  /* Pipeline — 6단계가 너무 빡빡하면 더 작게 */
  .pipeline-circle { width: 32px !important; height: 32px !important; font-size: 11px !important; }

  /* 페이지네이션 버튼 */
  .btn.sm { min-width: 32px !important; padding: 6px 8px !important; font-size: 11px !important; }
}

/* iOS / Android 터치 최적화 */
@media (hover: none) and (pointer: coarse) {
  button, .btn, .nav-item, a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  /* hover 효과 제거 */
  .stat-card:hover, .system-card:hover, .asset-card:hover { transform: none !important; }
}

/* ─── Global Sync Bar (페이지 전환 시에도 유지) ─── */
#global-sync-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
  background: transparent;
}
.global-sync-bar-inner {
  background: linear-gradient(135deg, #fef9e7 0%, #fff8d6 100%);
  border-bottom: 2px solid var(--accent);
  border-left: 4px solid var(--accent);
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.15);
  animation: slideDown 0.3s ease-out;
}
.sync-bar-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.sync-bar-icon {
  font-size: 22px;
  flex-shrink: 0;
  animation: spin 2s linear infinite;
}
.sync-bar-content {
  flex: 1;
  min-width: 0;
}
.sync-bar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sync-bar-pct {
  background: var(--accent);
  color: white;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}
.sync-bar-names {
  font-size: 12px;
  color: var(--text-soft);
  word-break: keep-all;
  margin-bottom: 2px;
}
.sync-bar-message {
  font-size: 11.5px;
  color: var(--text-muted);
  word-break: keep-all;
}
.sync-bar-progress {
  height: 6px;
  background: rgba(184, 134, 11, 0.15);
  border-radius: 100px;
  overflow: hidden;
}
.sync-bar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #06b6d4 100%);
  transition: width 0.4s ease-out;
  border-radius: 100px;
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ─── 데이터 관리 페이지 내부 큰 진행 바 ─── */
.page-progress-box {
  background: linear-gradient(135deg, #fef9e7 0%, #fff8d6 100%);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 4px 20px rgba(184, 134, 11, 0.15);
  animation: fadeInUp 0.4s ease-out;
}
.page-progress-done {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: var(--success);
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.15);
}
.page-progress-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.page-progress-head-left {
  display: flex; align-items: center; gap: 14px;
}
.page-progress-spinner {
  font-size: 28px;
  animation: spin 2s linear infinite;
  display: inline-block;
}
.page-progress-title {
  font-size: 17px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.01em;
}
.page-progress-sub {
  font-size: 12.5px; color: var(--text-soft);
  margin-top: 2px;
}
.page-progress-overall-pct {
  font-size: 28px; font-weight: 800; color: var(--accent);
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}
.page-progress-overall-bar {
  height: 12px;
  background: rgba(184, 134, 11, 0.15);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}
.page-progress-overall-fill {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.page-progress-overall-fill::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.page-progress-assets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(184, 134, 11, 0.2);
}
.page-progress-asset {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  position: relative;
}
.page-progress-asset-name {
  font-size: 12.5px; font-weight: 700; color: var(--accent);
  margin-bottom: 3px;
}
.page-progress-asset-msg {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px;
}
.page-progress-asset-bar {
  height: 4px;
  background: rgba(184, 134, 11, 0.15);
  border-radius: 100px;
  overflow: hidden;
}
.page-progress-asset-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.5s ease-out;
}
.page-progress-asset-pct {
  position: absolute; top: 10px; right: 12px;
  font-size: 10.5px; font-weight: 700; color: var(--accent);
  font-feature-settings: "tnum";
}
.page-progress-more {
  display: flex; align-items: center; justify-content: center;
  padding: 10px;
  background: rgba(184, 134, 11, 0.08);
  border-radius: 8px; border: 1px dashed var(--accent);
  font-size: 12px; font-weight: 600; color: var(--accent);
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Rankings 상태 바 ─── */
.rankings-status-bar {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: keep-all;
  line-height: 1.5;
}
.rankings-status-bar.fresh {
  background: var(--success-light, #f0fdf4);
  border-left: 3px solid var(--success);
  color: var(--success);
}
.rankings-status-bar.stale {
  background: #fef9e7;
  border-left: 3px solid var(--warning, #f59e0b);
  color: var(--text);
}
.rankings-status-bar.warn {
  background: var(--warning-light, #fef3c7);
  border-left: 3px solid var(--warning, #f59e0b);
  color: var(--text);
}
.rankings-status-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.spin-inline {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* ─── Tab Bar (분석 / 비교분석) ─── */
.tab-bar {
  display: flex; gap: 4px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border-soft, #f3f4f6);
}
.tab-item {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: transparent; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text-soft, #6b7280);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  font-family: inherit;
}
.tab-item:hover {
  color: var(--accent);
  background: rgba(184, 134, 11, 0.04);
}
.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(184, 134, 11, 0.05);
}
.tab-icon { font-size: 16px; }
.tab-count {
  display: inline-block; padding: 1px 9px;
  background: var(--bg-soft, #f9fafb);
  border-radius: 100px;
  font-size: 11.5px; font-weight: 700;
  min-width: 22px; text-align: center;
}
.tab-item.active .tab-count {
  background: var(--accent); color: white;
}

/* ─── Comparative Analysis 페이지 ─── */
.comparative-list-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: white;
  height: 360px;
}
.comparative-cat-side {
  display: flex; flex-direction: column;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.comparative-cat-btn {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px;
  background: transparent; border: none; border-bottom: 1px solid var(--border-soft);
  cursor: pointer; font-family: inherit; font-size: 13px;
  color: var(--text-soft);
  text-align: left;
  transition: all 0.15s;
}
.comparative-cat-btn:hover {
  background: rgba(184, 134, 11, 0.06);
  color: var(--accent);
}
.comparative-cat-btn.active {
  background: white;
  color: var(--accent);
  font-weight: 700;
  border-left: 3px solid var(--accent);
  padding-left: 11px;
}
.comparative-cat-count {
  font-size: 11px; padding: 2px 8px;
  background: var(--accent-bg, #fef9e7);
  color: var(--accent); border-radius: 100px;
  font-weight: 600;
}
.comparative-cat-btn.active .comparative-cat-count {
  background: var(--accent); color: white;
}
.comparative-list {
  overflow-y: auto;
  padding: 8px;
}
.comparative-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.1s;
  margin-bottom: 2px;
}
.comparative-list-item:hover {
  background: rgba(184, 134, 11, 0.06);
}
.comparative-list-item.checked {
  background: rgba(184, 134, 11, 0.1);
}
.comparative-list-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.comparative-list-name {
  font-size: 13.5px; font-weight: 500;
  color: var(--text);
}
.comparative-list-item.checked .comparative-list-name {
  color: var(--accent); font-weight: 700;
}

.comparative-selected-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  min-height: 50px;
}
.comparative-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 5px 5px 12px;
  background: var(--accent);
  color: white; border-radius: 100px;
  font-size: 12.5px; font-weight: 600;
}
.comparative-chip-x {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  border: none; cursor: pointer;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-family: inherit;
  transition: background 0.15s;
}
.comparative-chip-x:hover { background: rgba(255, 255, 255, 0.45); }

/* Comparative 목록 — 모바일: 고정 240px 사이드 레일이 리스트를 짓눌러 1열로 스택 */
@media (max-width: 768px) {
  .comparative-list-wrap {
    grid-template-columns: 1fr !important;
    height: auto !important;
    max-height: 70vh;
  }
  .comparative-cat-side {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .comparative-cat-btn {
    border-bottom: none;
    border-right: 1px solid var(--border-soft);
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .comparative-cat-btn.active {
    border-left: none;
    border-bottom: 3px solid var(--accent);
    padding-left: 14px;
  }
  .comparative-list { max-height: 46vh; }
  .comparative-progress-card { padding: 18px 16px !important; }
  .comparative-progress-head { flex-wrap: wrap; gap: 10px; }
  .comparative-progress-title { font-size: 18px !important; }
  .comparative-progress-overall-pct { font-size: 28px !important; }
}

/* ─── Comparative Progress 페이지 ─── */
.comparative-progress-box { margin-top: 16px; }
.comparative-progress-card {
  background: linear-gradient(135deg, #fef9e7 0%, #fff8d6 100%);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 8px 24px rgba(184, 134, 11, 0.15);
}
.comparative-progress-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px; gap: 16px;
}
.comparative-progress-title {
  font-size: 22px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.02em; margin-bottom: 4px;
}
.comparative-progress-sub {
  font-size: 13px; color: var(--text-soft);
  word-break: keep-all;
}
.comparative-progress-overall-pct {
  font-size: 36px; font-weight: 800; color: var(--accent);
  font-feature-settings: "tnum"; letter-spacing: -0.03em;
}
.comparative-progress-overall-bar {
  height: 14px;
  background: rgba(184, 134, 11, 0.15);
  border-radius: 100px; overflow: hidden;
  margin-bottom: 12px;
}
.comparative-progress-overall-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #06b6d4, var(--accent));
  background-size: 200% 100%;
  animation: progress-flow 2s linear infinite;
  border-radius: 100px;
  transition: width 0.6s ease-out;
}
@keyframes progress-flow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.comparative-progress-stage {
  font-size: 13px; color: var(--text-soft);
  text-align: center;
  margin-bottom: 24px; padding: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  word-break: keep-all;
}
.comparative-progress-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.comparative-progress-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  transition: all 0.3s;
}
.comparative-progress-item.done {
  background: #f0fdf4;
  border-color: #16a34a;
}
.comparative-progress-item.active {
  background: white;
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.2);
  transform: scale(1.02);
}
.comparative-progress-item-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.comparative-progress-item.done .comparative-progress-item-icon {
  background: #16a34a; color: white;
}
.comparative-progress-item.active .comparative-progress-item-icon {
  background: var(--accent); color: white;
}
.comparative-progress-item-name {
  flex: 1; min-width: 0;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.comparative-progress-item-status {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.comparative-progress-item.done .comparative-progress-item-status { color: #16a34a; }
.comparative-progress-item.active .comparative-progress-item-status { color: var(--accent); }

.comparative-progress-done-msg {
  margin-top: 24px;
  padding: 18px;
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
}

/* ─── 분석 완료 모달 ─── */
.analysis-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
  padding: 20px;
}
.analysis-modal-overlay.closing { animation: fadeOut 0.2s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes successPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  50% { box-shadow: 0 0 0 16px rgba(22, 163, 74, 0); }
}
.analysis-modal {
  background: white;
  border-radius: 18px;
  padding: 36px 32px 28px;
  max-width: 480px; width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease-out;
}
.analysis-modal-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 800;
  margin: 0 auto 18px;
  animation: successPulse 1.5s ease-out infinite;
}
.analysis-modal-title {
  font-size: 22px; font-weight: 800;
  color: var(--text); letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.analysis-modal-subtitle {
  font-size: 15px; font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
  word-break: keep-all;
}
.analysis-modal-meta {
  font-size: 13px; color: var(--text-soft);
  margin-bottom: 22px;
  word-break: keep-all;
}
.analysis-modal-summary {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 12.5px; color: var(--text);
  text-align: left;
  line-height: 1.55;
  border-left: 3px solid var(--accent);
}
.analysis-modal-buttons {
  display: flex; gap: 10px; justify-content: center;
}
.analysis-modal-buttons .btn { padding: 11px 22px; font-size: 14px; }

/* ═══════════════════════════════════════════════════════════
   언어 토글 (사이드바)
   ═══════════════════════════════════════════════════════════ */
.lang-toggle-wrap {
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 8px;
}
.lang-toggle-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 6px;
  font-weight: 600;
}
.lang-toggle {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
  padding: 3px;
}
.lang-btn {
  flex: 1;
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.lang-btn:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.lang-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(3,166,150,0.35);
}

/* ═══════════════════════════════════════════════════════════
   영어 모드 — 긴 단어 처리 + 모바일 레이아웃 보강
   ═══════════════════════════════════════════════════════════ */
html[data-lang="en"] .nav-label,
html[data-lang="en"] .brand-text,
html[data-lang="en"] .brand-tag {
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* 영어 모드 사이드바 — 길어진 텍스트 수용 */
html[data-lang="en"] .nav-item {
  font-size: 13px;
}
html[data-lang="en"] .nav-label {
  white-space: normal;
  line-height: 1.3;
}

/* 모바일 — 다국어 공통 */
@media (max-width: 768px) {
  .lang-toggle-wrap { padding: 10px 14px; }
  .lang-btn { font-size: 11px; padding: 5px 8px; }

  /* 영어 모드 모바일 — topbar 폭 부족 시 */
  html[data-lang="en"] .breadcrumb { font-size: 13px; }
  html[data-lang="en"] .llm-text { display: none; }  /* 모바일에선 아이콘만 */

  /* page-head 영어 길이 대응 */
  html[data-lang="en"] .page-head h1 { font-size: 22px; line-height: 1.25; }
  html[data-lang="en"] .page-head .sub { font-size: 12px; }
}

/* 전역 — 영어/한국어 공통 안전망 */
.page-container * {
  min-width: 0;
}
.card, .stat-card, .table-wrap {
  min-width: 0;
  overflow-wrap: break-word;
}
.tab-bar {
  flex-wrap: wrap;
}
.tab-item {
  flex-shrink: 1;
  min-width: 0;
}

/* 표 — 모바일 가로 스크롤 강제 */
@media (max-width: 600px) {
  .table-wrap, [class*="data-table"] { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; }
}

/* ════════════════════════════════════════════════════════════
   ★ MOBILE COMPREHENSIVE OPTIMIZATION (v2)
   ════════════════════════════════════════════════════════════ */

/* 모든 페이지의 컨테이너 — 모바일 안전 여백 */
@media (max-width: 768px) {
  .page-content, .main-content, .app-content { padding: 12px !important; }

  /* Hero — 모바일에서 padding 축소 */
  .hero-dark, .hero {
    padding: 18px 14px !important;
    border-radius: 10px !important;
  }
  .hero-dark h1, .hero h1 {
    font-size: 20px !important;
    line-height: 1.35 !important;
  }
  .hero-dark p, .hero p {
    font-size: 13.5px !important;
    line-height: 1.55 !important;
  }
  .hero-dark .actions, .hero .actions {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .hero-dark .actions button, .hero .actions button {
    width: 100% !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
  }

  /* 모든 페이지 헤더 */
  .page-head, .page-header { padding: 0 !important; }
  .page-head h1, .page-header h1 { font-size: 17px !important; }
  .page-head .sub, .page-header .sub { font-size: 11.5px !important; }
  .flex-between {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  /* 모든 buttons — 모바일에서 적정 사이즈 */
  .btn {
    padding: 9px 14px !important;
    font-size: 12.5px !important;
  }
  .btn.sm { padding: 6px 10px !important; font-size: 11.5px !important; }

  /* 모든 grids — auto-fit 컬럼 자동 조정 */
  [style*="grid-template-columns:repeat(auto-fit"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  /* asset-grid 등 */
  .asset-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* 카드 일반 */
  .card, [style*="background:white"][style*="border-radius"] {
    padding: 12px 14px !important;
  }

  /* Modal 일반 */
  .modal, [class*="modal-content"] {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh !important;
    margin: 8px !important;
    border-radius: 10px !important;
  }
  .modal-header, [class*="modal-header"] {
    padding: 12px 14px !important;
  }
  .modal-body, [class*="modal-body"] {
    padding: 12px 14px !important;
  }

  /* Form */
  .field-label, label { font-size: 12.5px !important; }
  input[type="text"], input[type="number"], input[type="email"],
  input[type="password"], textarea, select {
    font-size: 14px !important; /* iOS 줌 방지: 14px 이상 */
    padding: 9px 12px !important;
  }

  /* Tabs */
  .tabs { overflow-x: auto !important; flex-wrap: nowrap !important; }
  .tab-item { white-space: nowrap !important; padding: 6px 10px !important; }

  /* 검색바 + 필터 toolbar */
  [style*="display:flex"][style*="gap"][style*="flex-wrap"] {
    flex-direction: column !important;
  }
  [style*="display:flex"][style*="gap"][style*="flex-wrap"] input,
  [style*="display:flex"][style*="gap"][style*="flex-wrap"] select {
    width: 100% !important;
  }

  /* 표 — 가로 스크롤 강제 */
  table { display: block; overflow-x: auto; white-space: nowrap; max-width: 100%; -webkit-overflow-scrolling: touch; }
  table thead, table tbody { display: table; width: 100%; }
  table tr { display: table-row; }
  table th, table td { padding: 8px 10px !important; font-size: 11.5px !important; }

  /* 차트 / iframe */
  iframe, .chart-block img, img { max-width: 100% !important; }
  iframe { width: 100% !important; }
}

@media (max-width: 480px) {
  /* 모든 grids → 1열 */
  [style*="grid-template-columns:repeat(auto-fit"] {
    grid-template-columns: 1fr !important;
  }
  .hero-dark h1, .hero h1 { font-size: 17px !important; }
  .hero-dark p, .hero p { font-size: 12.5px !important; }

  /* btn */
  .btn { padding: 8px 12px !important; font-size: 12px !important; }

  /* table → 더 작게 */
  table th, table td { padding: 6px 8px !important; font-size: 10.5px !important; }

  /* card padding */
  .card, [style*="background:white"][style*="border-radius"] {
    padding: 10px 12px !important;
  }

  /* 모달 더 작게 */
  .modal, [class*="modal-content"] {
    width: 98vw !important;
    max-height: 95vh !important;
    border-radius: 8px !important;
  }
}

/* Offline Dataset Preview Modal — 모바일 */
@media (max-width: 768px) {
  .offline-preview-overlay { padding: 8px !important; }
  .offline-preview-modal {
    border-radius: 8px !important;
    max-height: 95vh !important;
  }
  .offline-preview-modal > div:first-child {
    padding: 12px 14px !important;
  }
  .offline-preview-modal > div:first-child > div > div:nth-child(2) {
    font-size: 15px !important;
  }
  .offline-preview-modal table {
    font-size: 11px !important;
  }
  .offline-preview-modal th,
  .offline-preview-modal td {
    padding: 6px 8px !important;
    font-size: 11px !important;
    white-space: nowrap;
  }
}

/* ═══════════════════════════════════════════════════════════════
   NEO 2.0 — 현대화 레이어 (indigo/violet 팔레트)
   기존 클래스 위에 세련된 마감을 덧입힘 (레이아웃/JS 훅 불변)
   ═══════════════════════════════════════════════════════════════ */

/* 부드러운 스크롤바 */
* { scrollbar-width: thin; scrollbar-color: #c7cce0 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #c7cce0; border-radius: 100px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #aab0cc; background-clip: content-box; }

body { letter-spacing: -0.011em; }

/* ── Sidebar ── */
.sidebar { background: linear-gradient(185deg, #12314e 0%, #0f2a43 100%); }
.brand-tag { color: #8b93b5; }
.nav-item { border-radius: 11px; padding: 10px 11px; font-weight: 500; transition: background .16s ease, color .16s ease, transform .12s ease; }
.nav-item:hover { transform: translateX(2px); }
.nav-item.active {
  background: var(--accent-grad);
  box-shadow: 0 8px 20px -8px rgba(3,166,150,.55);
  font-weight: 600;
}
.nav-item.active:hover { transform: none; }
.nav-section { color: #5c6486; font-size: 10px; letter-spacing: .12em; }

/* SVG 아이콘 (nav / 버튼 공용) */
.nav-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; opacity: .92; }
.nav-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active .nav-icon { opacity: 1; }
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Topbar ── */
.topbar {
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand-mini { color: var(--accent-strong); }
.llm-badge { border-radius: 100px; box-shadow: var(--shadow-sm); }

/* ── Page header ── */
.page-head h1 { letter-spacing: -0.03em; }

/* ── Cards ── */
.card { border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.card:hover { box-shadow: var(--shadow); }
.stat-card { border-radius: var(--radius); }
.stat-card::before { width: 4px; border-radius: 0 4px 4px 0; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat-value { letter-spacing: -0.03em; }

/* ── Buttons ── */
.btn { border-radius: 11px; font-weight: 600; transition: all .16s ease; }
.btn:active { transform: translateY(1px); }
.btn.accent {
  background: var(--accent-grad); border-color: transparent;
  box-shadow: 0 8px 18px -6px rgba(3,166,150,.45);
}
.btn.accent:hover { filter: brightness(1.06); box-shadow: 0 10px 24px -6px rgba(3,166,150,.55); border-color: transparent; }
.btn.primary { background: #0f2a43; border-color: #0f2a43; border-radius: 11px; }
.btn.primary:hover { background: #1b3b5a; border-color: #1b3b5a; }
.btn.danger { background: var(--danger); border-color: var(--danger); }

/* ── Inputs ── */
.input, .select, .textarea { border-radius: 11px; border-width: 1.5px; transition: border-color .15s ease, box-shadow .15s ease; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }

/* ── Tables ── */
.table-wrap { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.data-table th { background: var(--bg-soft); letter-spacing: .05em; }
.data-table tr:hover td { background: var(--accent-light); }

/* ── Badges ── */
.badge { padding: 4px 11px; border-radius: 100px; font-weight: 700; letter-spacing: .01em; }

/* ── Callout ── */
.callout { border-left-width: 4px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── Progress ── */
.progress-fill { background: var(--accent-grad); }

/* ── Provider / radio cards ── */
.provider-card { border-radius: var(--radius-sm); transition: all .18s ease; }
.provider-card.active { border-color: var(--accent); background: var(--accent-light); box-shadow: var(--ring); }

/* ── Toast ── */
.toast { border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }

/* ── Focus visible (접근성) ── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-item:focus-visible, .btn:focus-visible { outline-offset: 3px; }

/* ── 접이식 nav 그룹 (BD/IR · Trust) ── */
.nav-group { display:flex; flex-direction:column; }
.nav-section-toggle{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  width:100%; background:transparent; border:0; cursor:pointer;
  padding:16px 12px 6px; margin:0; font:inherit;
  font-size:10px; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:#5c6486; text-align:left; transition:color .15s;
}
.nav-section-toggle:hover{ color:var(--side-text); }
.nav-chevron{ width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:2.4;
  stroke-linecap:round; stroke-linejoin:round; transition:transform .22s ease; flex:none; }
.nav-group.collapsed .nav-chevron{ transform:rotate(-90deg); }
.nav-group-body{ display:grid; grid-template-rows:1fr; transition:grid-template-rows .24s ease; }
.nav-group.collapsed .nav-group-body{ grid-template-rows:0fr; }
.nav-group-inner{ overflow:hidden; min-height:0; display:flex; flex-direction:column; gap:2px; }
/* 아이콘-only 사이드바: 토글 숨기고 항목은 항상 노출 */
.app-shell.sidebar-collapsed .nav-section-toggle{ display:none; }
.app-shell.sidebar-collapsed .nav-group-body{ grid-template-rows:1fr !important; }

/* ── 대시보드 아이콘/카드 폴리시 ── */
.ico { line-height:0; }
.ico svg { display:block; }
.sys-icon { color:var(--accent); font-size:20px; display:inline-flex; align-items:center;
  width:38px; height:38px; justify-content:center; background:var(--accent-light); border-radius:10px; }
.sys-head { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.sys-label { font-size:12.5px; font-weight:700; color:var(--text-secondary); letter-spacing:.02em; }
.system-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:18px 20px; box-shadow:var(--shadow-sm); transition:box-shadow .2s ease, transform .2s ease; }
.system-card:hover { box-shadow:var(--shadow); transform:translateY(-2px); }
.sys-percent { font-size:30px; font-weight:800; letter-spacing:-.03em; font-feature-settings:'tnum'; }
.sys-percent-unit { font-size:14px; font-weight:700; margin-left:2px; opacity:.7; }
.sys-bar { height:7px; background:var(--bg-soft); border-radius:100px; overflow:hidden; margin-top:8px; }
.sys-bar-fill { height:100%; border-radius:100px; transition:width .5s cubic-bezier(.22,1,.36,1); }
.sys-sub { font-size:11.5px; color:var(--text-tertiary); margin-top:8px; line-height:1.5; white-space:pre-line; }
.system-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin-bottom:24px; }

/* ── 폼 컨트롤 폰트 통일 (Pretendard) ── */
input, select, textarea, button, .input, .select, .textarea {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
}
input::placeholder, textarea::placeholder, .input::placeholder, .textarea::placeholder {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, sans-serif;
}

/* ── LLM 배지 (현대화) ── */
.llm-badge { display:inline-flex; align-items:center; gap:7px; padding:6px 13px 6px 11px;
  border-radius:100px; font-size:12px; font-weight:700; letter-spacing:-.01em;
  background:var(--accent-light); border:1px solid var(--accent-border); color:var(--accent-strong);
  box-shadow:var(--shadow-sm); }
.llm-badge.vllm { background:var(--accent-light); border-color:var(--accent-border); color:var(--accent-strong); }
.llm-badge .llm-icon { display:inline-flex; align-items:center; }
.llm-badge .llm-icon svg { display:block; }
.llm-badge .llm-dot { width:7px; height:7px; border-radius:50%; background:var(--success);
  box-shadow:0 0 0 3px rgba(13,159,110,.18); animation:llmPulse 2.2s ease-in-out infinite; flex:none; }
@keyframes llmPulse { 0%,100%{ opacity:1; } 50%{ opacity:.4; } }

/* ── AgingAtlas 연동 소스 카드 hover ── */
.atlas-src-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent) !important; }

/* ── 브랜드 로고/텍스트 확대 (AgingAtlas 수준) ── */
.brand { gap: 12px; }
.brand-mark { width: 54px !important; height: 54px !important; border-radius: 12px; }
.brand-text { font-size: 20px !important; font-weight: 800 !important; letter-spacing: -0.02em; }
.brand-tag { font-size: 11px !important; }
.app-shell.sidebar-collapsed .brand-mark { width: 40px !important; height: 40px !important; }

/* ─── 글로벌 "분석 진행 중" 알약(pill) ─── */
.job-pill{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:1200;
  display:flex;align-items:center;gap:2px;background:linear-gradient(135deg,#0f2a43,#0b3b46);
  color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:999px;
  box-shadow:0 14px 36px -12px rgba(3,166,150,.6),0 4px 12px rgba(0,0,0,.28);
  padding:6px 8px 6px 6px;overflow:hidden;max-width:min(92vw,460px);
  animation:jobPillIn .35s cubic-bezier(.22,1,.36,1) both}
.job-pill.closing{animation:jobPillOut .24s ease forwards;pointer-events:none}
@keyframes jobPillIn{from{opacity:0;transform:translateX(-50%) translateY(16px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}
@keyframes jobPillOut{to{opacity:0;transform:translateX(-50%) translateY(16px)}}
.job-pill-body{display:flex;align-items:center;gap:10px;background:none;border:none;color:inherit;
  cursor:pointer;font-family:inherit;padding:4px 8px;min-width:0}
.job-pill-spin{width:16px;height:16px;flex:0 0 auto;border-radius:50%;
  border:2.5px solid rgba(255,255,255,.22);border-top-color:#4fd6c6;animation:jobSpin .8s linear infinite}
@keyframes jobSpin{to{transform:rotate(360deg)}}
.job-pill-text{display:flex;flex-direction:column;align-items:flex-start;min-width:0;line-height:1.2}
.job-pill-title{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}
.job-pill-sub{font-size:11px;color:rgba(255,255,255,.72);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}
.job-pill-stop{flex:0 0 auto;width:30px;height:30px;border-radius:50%;border:1px solid rgba(255,120,120,.35);
  background:rgba(255,80,80,.16);color:#ff9a9a;font-size:10px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s}
.job-pill-stop:hover{background:rgba(255,80,80,.34);color:#fff}
.job-pill-bar{position:absolute;left:0;right:0;bottom:0;height:3px;background:rgba(255,255,255,.12)}
.job-pill-fill{display:block;height:100%;background:linear-gradient(90deg,#03a696,#4fd6c6);transition:width .6s ease}
@media(max-width:640px){.job-pill{bottom:14px}.job-pill-title,.job-pill-sub{max-width:52vw}}
@media(prefers-reduced-motion:reduce){.job-pill-spin{animation:none}.job-pill{animation:none}}

/* ─── PWA 설치 버튼 ─── */
.pwa-install-btn{position:fixed;right:16px;bottom:16px;z-index:1150;
  display:inline-flex;align-items:center;gap:6px;padding:10px 16px;border-radius:999px;
  border:1px solid rgba(3,166,150,.4);background:linear-gradient(135deg,#03a696,#0891b2);color:#fff;
  font-family:inherit;font-size:13px;font-weight:700;cursor:pointer;
  box-shadow:0 10px 26px -10px rgba(3,166,150,.7);animation:jobPillIn .35s cubic-bezier(.22,1,.36,1) both}
.pwa-install-btn:hover{transform:translateY(-2px);box-shadow:0 14px 32px -10px rgba(3,166,150,.8)}
@media(max-width:640px){.pwa-install-btn{right:12px;bottom:76px}}

/* 대시보드 AgingAtlas LIVE 카드 — 모바일: 새로고침/데이터관리 버튼 한 줄로 */
@media (max-width: 640px) {
  #aging-data-status-card .aa-live-btns { width: 100%; flex-wrap: nowrap; }
  #aging-data-status-card .aa-live-btns button { flex: 1; white-space: nowrap; }
}
