    /* Outfit 폰트는 index.html <link>에서 병렬 로드 (CSS @import는 렌더 블로킹이라 제거) */

    /* Tailwind이 defer 로드되기 전에도 .hidden이 동작하도록 명시 */
    .hidden { display: none !important; }

    :root {
      --bg: #fafafa;
      --surface: #ffffff;
      --secondary: #666666;
      --tertiary: #999999;
      --border: #eeeeee;
      --accent: #111111;
      --ease: cubic-bezier(0.16, 1, 0.3, 1);
    }

    * {
      font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
      box-sizing: border-box;
      -webkit-font-smoothing: antialiased;
    }

    body {
      background: var(--bg);
      color: var(--accent);
      min-height: 100dvh;
      margin: 0;
      line-height: 1.5;
    }

    /* Noise overlay - very subtle */
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
      pointer-events: none;
      z-index: 100;
      opacity: 0.5;
    }

    /* Scrollbar */
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-track { background: var(--bg); }
    ::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }
    ::-webkit-scrollbar-thumb:hover { background: #ccc; }

    /* Layout */
    .glass-nav {
      background: rgba(255, 255, 255, 0.8);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
    }

    /* Hero / Home State */
    .hero-section {
      background: var(--bg);
      border-bottom: 1px solid transparent;
      padding-top: 15dvh;
      padding-bottom: 50px;
      transition: all 0.4s var(--ease);
      overflow: hidden;
    }

    .hero-title {
      font-family: 'Outfit', sans-serif;
      font-size: clamp(3rem, 8vw, 5.5rem);
      font-weight: 800;
      letter-spacing: -0.05em;
      line-height: 1;
      color: var(--accent);
      margin-bottom: 24px;
      transition: all 0.3s var(--ease);
    }

    .hero-subtitle {
      color: var(--secondary);
      font-size: 1.125rem;
      font-weight: 400;
      margin-bottom: 40px;
      transition: all 0.3s var(--ease);
    }

    /* Search Mode (Results) */
    .search-mode .hero-section {
      padding-top: 20px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border);
    }

    .search-mode .hero-title {
      font-size: 1.5rem;
      margin-bottom: 4px;
      display: none; /* Hide big title during results */
    }

    .search-mode .hero-subtitle {
      display: none;
    }

    .search-mode .hero-badge {
      display: none;
    }

    .search-mode .db-selector-wrap {
      display: none;
    }

    .search-mode .home-only {
      display: none;
    }

    /* .search-mode .glass-nav — 검색 모드에서도 nav 유지 (홈 이동 위해) */

    .search-mode-only {
      display: none;
    }

    .search-mode .search-mode-only {
      display: block;
    }

    .search-mode .home-only {
      display: none;
    }

    /* Search */
    .search-input {
      background: var(--surface);
      border: 1px solid #ddd;
      border-radius: 999px; /* Pill shape */
      padding: 1.1rem 1.75rem;
      padding-left: 3.5rem; /* Space for icon */
      font-size: 1.05rem;
      width: 100%;
      max-width: 650px;
      outline: none;
      transition: all 0.2s var(--ease);
      box-shadow: 0 1px 6px rgba(32,33,36,0.1);
    }

    .search-input:focus, .search-input:hover {
      box-shadow: 0 1px 8px rgba(32,33,36,0.16);
      border-color: transparent;
    }

    /* Buttons */
    .btn-primary {
      background: #f8f9fa;
      color: #3c4043;
      padding: 10px 24px;
      border-radius: 4px;
      font-weight: 500;
      font-size: 14px;
      border: 1px solid transparent;
      cursor: pointer;
      transition: all 0.15s;
    }

    .btn-primary:hover {
      box-shadow: 0 1px 1px rgba(0,0,0,0.1);
      background-image: linear-gradient(top,#f8f8f8,#f1f1f1);
      background-color: #f8f9fa;
      border: 1px solid #c6c6c6;
      color: #202124;
    }

    .btn-secondary {
      background: #f8f9fa;
      color: #3c4043;
      padding: 10px 24px;
      border-radius: 4px;
      font-weight: 500;
      font-size: 14px;
      border: 1px solid transparent;
      cursor: pointer;
      transition: all 0.15s;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .btn-secondary:hover {
      box-shadow: 0 1px 1px rgba(0,0,0,0.1);
      background-color: #f8f9fa;
      border: 1px solid #c6c6c6;
      color: #202124;
    }

    /* Tabs */
    .tab-btn {
      padding: 0.375rem 1rem;
      border-radius: 4px;
      font-size: 0.8125rem;
      font-weight: 500;
      color: var(--tertiary);
      cursor: pointer;
      border: 1px solid transparent;
      transition: all 0.2s;
    }

    .tab-btn:hover { color: var(--accent); }
    .tab-btn.active {
      color: var(--accent);
      background: #f0f0f0;
      font-weight: 600;
    }

    /* DB Selector */
    .db-btn {
      padding: 0.5rem 1.25rem;
      border-radius: 999px;
      font-weight: 600;
      font-size: 0.8125rem;
      color: var(--secondary);
      cursor: pointer;
      border: none;
      background: transparent;
      transition: all 0.2s;
    }

    .db-btn.active {
      background: #111 !important;
      color: white !important;
    }
    
    .db-toggle-wrap { background: #fff; }
    .search-mode .db-toggle-wrap { border-color: transparent; box-shadow: none; padding: 0; background: transparent;}
    .search-mode .db-btn { font-size: 0.875rem; color: var(--tertiary); }
    .search-mode .db-btn.active { background: transparent !important; color: #111 !important; border-bottom: 2px solid #111; border-radius: 0; padding-bottom: 2px; }

    /* Cards */
    .result-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 1.75rem;
      transition: border-color 0.3s;
    }

    .result-card:hover {
      border-color: #bbbbbb;
    }

    /* NTIS project results: compact table view */
    .ntis-table-wrap {
      width: 100%;
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--surface);
    }
    .ntis-result-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.84rem;
      min-width: 920px;
    }
    .ntis-result-table th {
      background: #f9fafb;
      color: #6b7280;
      font-size: 0.75rem;
      font-weight: 700;
      text-align: left;
      padding: 0.8rem 0.9rem;
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }
    .ntis-result-table td {
      padding: 0.78rem 0.9rem;
      border-bottom: 1px solid #f1f5f9;
      color: #374151;
      vertical-align: middle;
    }
    .ntis-result-table tr:last-child td { border-bottom: none; }
    .ntis-result-table tbody tr:hover td { background: #fafafa; }
    .ntis-result-row,
    .scienceon-result-row { transition: background 0.15s; }
    .ntis-result-title {
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      color: #111;
      font-weight: 700;
      line-height: 1.45;
      text-decoration: none;
      max-width: 360px;
      word-break: keep-all;
    }
    .ntis-result-title:hover { text-decoration: underline; }
    .ntis-result-title.no-link {
      color: #111;
      cursor: default;
      text-decoration: none;
    }
    .ntis-result-meta {
      margin-top: 0.25rem;
      color: #9ca3af;
      font-size: 0.72rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 360px;
    }
    .ntis-money {
      color: #111;
      font-weight: 800;
      white-space: nowrap;
    }
    .ntis-muted {
      color: #6b7280;
      white-space: nowrap;
    }
    .ntis-cell-ellipsis {
      max-width: 190px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .ntis-row-actions {
      display: flex;
      align-items: center;
      gap: 0.35rem;
      white-space: nowrap;
    }
    .ntis-row-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      border: 1px solid #e5e7eb;
      border-radius: 6px;
      background: #fff;
      color: #374151;
      padding: 0.35rem 0.55rem;
      font-size: 0.72rem;
      font-weight: 700;
      text-decoration: none;
      cursor: pointer;
    }
    .ntis-row-btn:hover { background: #f9fafb; border-color: #d1d5db; }
    .ntis-table-note {
      padding: 0.65rem 0.9rem;
      border-top: 1px solid var(--border);
      color: #9ca3af;
      font-size: 0.72rem;
    }

    .badge {
      font-size: 0.7rem;
      font-weight: 700;
      padding: 0.2rem 0.5rem;
      border-radius: 3px;
      text-transform: uppercase;
      background: #f0f0f0;
      color: #777;
    }

    .badge-arti { background: #111; color: #fff; }
    .badge-patent { background: #eee; color: #111; border: 1px solid #ddd; }
    .badge-report { background: #f5f5f5; color: #666; border: 1px solid #eee; }
    .badge-ntis-prjt { background: #111; color: #fff; }
    .badge-ntis-requip { background: #eee; color: #111; border: 1px solid #ddd; }

    .tag {
      background: #f8f8f8;
      border: 1px solid #eee;
      color: #888;
      font-size: 0.75rem;
      padding: 0.125rem 0.4rem;
      border-radius: 4px;
    }

    .abstract-text {
      color: #444;
      font-size: 0.9rem;
      line-height: 1.6;
      margin-top: 1rem;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    /* Modal */
    .modal-bg {
      position: fixed;
      inset: 0;
      background: rgba(255, 255, 255, 0.8);
      backdrop-filter: blur(8px);
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .modal-box {
      background: white;
      border: 1px solid #ddd;
      border-radius: 12px;
      padding: 2.5rem;
      width: 100%;
      max-width: 500px;
      box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    }

    /* Others */
    .api-status-pill { border: 1px solid #eee; background: white; }
    .hero-badge { background: #f0f0f0; color: #555; }
    
    .stat-card {
      background: white;
      border: 1px solid var(--border);
      transition: all 0.3s var(--ease);
    }
    .stat-card:hover {
      border-color: var(--accent);
      transform: translateY(-2px);
    }
    .spinner {
      border: 2px solid #f3f3f3;
      border-top: 2px solid var(--accent);
      border-radius: 50%;
      width: 30px; height: 30px;
      animation: spin 0.8s linear infinite;
    }
    @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

    .fade-up { animation: fadeUp 0.6s var(--ease) both; }
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .page-btn {
      width: 34px; height: 34px;
      border: 1px solid #eee;
      background: white;
      color: #888;
      border-radius: 4px;
      cursor: pointer;
    }
    .page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
    .toast {
      background: var(--accent); color: white;
      border-radius: 8px; padding: 1rem 2rem;
    }
    .input-field {
      border: 1px solid #eee; padding: 0.75rem; border-radius: 6px; width: 100%;
    }
    .input-field:focus { border-color: #999; outline: none; }
    .type-icon { background: #f5f5f5; color: #111; }

    /* Analysis Dashboard Styles */
    .analysis-card {
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 16px;
      overflow: hidden;
      transition: all 0.4s var(--ease);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    }
    .analysis-header {
      background: linear-gradient(135deg, #111 0%, #333 100%);
      color: white;
      padding: 1.25rem 1.5rem;
    }
    .analysis-body { padding: 1.5rem; }
    .stat-badge {
      padding: 0.5rem 1rem;
      border-radius: 999px;
      font-size: 0.75rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
    }
    .blue-ocean { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
    .gauge-container {
      height: 12px;
      background: #f3f4f6;
      border-radius: 6px;
      overflow: hidden;
      position: relative;
    }
    .gauge-fill {
      height: 100%;
      background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
      border-radius: 6px;
      transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .analysis-tag {
      font-size: 0.65rem;
      font-weight: 700;
      padding: 0.2rem 0.5rem;
      border-radius: 4px;
      text-transform: uppercase;
      background: #f9fafb;
      color: #6b7280;
      border: 1px solid #e5e7eb;
    }
    .btn-analysis {
      background: #111;
      color: white;
      padding: 10px 24px;
      border-radius: 4px;
      font-weight: 500;
      font-size: 14px;
      border: 1px solid #111;
      cursor: pointer;
      transition: all 0.2s;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
    }
    .btn-analysis:hover {
      background: #333;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    .analysis-loading-pulse {
      animation: pulse 2s infinite;
    }
    @keyframes pulse {
      0% { opacity: 1; }
      50% { opacity: 0.5; }
      100% { opacity: 1; }
    }
    .search-icon-wrap { position: relative; width: 100%; max-width: 650px; }
    .search-icon-wrap .search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); pointer-events: none; color: #9ca3af; z-index: 10; }
    .modal-box-wide { max-width: 760px; width: 95vw; }

    /* =========================================================
       적정 연구비 산출 기능 스타일
    ========================================================= */
    .budget-modal-bg {
      position: fixed; inset: 0;
      background: rgba(255,255,255,0.85);
      backdrop-filter: blur(10px);
      z-index: 2000;
      display: flex; align-items: center; justify-content: center;
      padding: 1rem;
    }
    .budget-modal-box {
      background: #fff;
      border: 1px solid #e5e7eb;
      border-radius: 16px;
      padding: 2rem;
      width: 100%;
      max-width: 680px;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 24px 60px rgba(0,0,0,0.12);
    }
    .budget-result-box {
      max-width: 920px;
    }
    /* 인라인 표출 — 다른 분석 결과처럼 페이지 흐름에 카드로 표시 */
    .budget-inline-box {
      max-width: 1000px;
      margin: 0 auto;
      max-height: none;
      box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    }
    /* ── 결과 레이아웃 — 사이트 모노크롬 스타일에 정렬 ── */
    .budget-hero {
      background: #fff;
      border: 1px solid #d1d5db;
      border-radius: 12px;
      padding: 1.15rem 1.25rem;
      color: #111827;
      margin-bottom: 1.15rem;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }
    .budget-hero-eyebrow {
      font-size: 0.78rem; font-weight: 600;
      color: #6b7280;
      margin-bottom: 0.5rem;
    }
    .budget-hero-value {
      font-size: 2rem; font-weight: 800;
      letter-spacing: 0; line-height: 1.12;
    }
    .budget-hero-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.85rem; }
    .budget-chip {
      display: inline-flex; align-items: center; gap: 0.35rem;
      background: #f9fafb;
      border: 1px solid #e5e7eb;
      color: #374151; font-size: 0.72rem; font-weight: 600;
      padding: 0.28rem 0.7rem; border-radius: 999px;
    }
    .budget-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .budget-hero-diagnostic {
      margin-top: 0.8rem;
      padding-top: 0.75rem;
      border-top: 1px solid #f3f4f6;
      font-size: 0.76rem;
      line-height: 1.55;
      color: #6b7280;
      min-width: 0;
      word-break: keep-all;
    }
    .budget-hero-diagnostic strong { color: #374151; font-weight: 700; }
    .budget-diagnostic-title {
      color: #667085;
      font-size: .7rem;
      font-weight: 700;
      letter-spacing: .01em;
      white-space: nowrap;
    }
    .budget-diagnostic-main {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: .28rem .45rem;
      margin-top: .12rem;
      color: #475467;
      line-height: 1.35;
    }
    .budget-diagnostic-main span {
      white-space: nowrap;
    }
    .budget-diagnostic-badge {
      display: inline-flex;
      align-items: center;
      width: fit-content;
      border-radius: 999px;
      padding: .12rem .48rem;
      border: 1px solid #e5e7eb;
      background: #f9fafb;
      font-size: .72rem;
      line-height: 1.35;
      white-space: nowrap;
    }
    .budget-diagnostic-badge.is-high { color: #b42318; background: #fff6f5; border-color: #fecdca; }
    .budget-diagnostic-badge.is-medium { color: #b54708; background: #fffcf5; border-color: #fedf89; }
    .budget-diagnostic-badge.is-low { color: #344054; background: #f8fafc; border-color: #e4e7ec; }
    .budget-diagnostic-copy {
      margin-top: .18rem;
      color: #667085;
      font-size: .72rem;
      line-height: 1.45;
      word-break: keep-all;
      overflow-wrap: anywhere;
    }
    .budget-section-title {
      font-size: 0.95rem; font-weight: 700; color: #111;
      display: flex; align-items: center; gap: 0.45rem;
      margin: 1.75rem 0 0.9rem;
    }
    .budget-section-title .muted { font-size: 0.72rem; font-weight: 600; color: #9ca3af; }
    .budget-note {
      background: #fafafa; border: 1px solid #eee; border-radius: 12px;
      padding: 1.05rem 1.2rem; font-size: 0.84rem; line-height: 1.75; color: #555;
    }
    .budget-note strong { color: #111; font-weight: 700; }
    .budget-disclaimer {
      margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #f0f0f0;
      font-size: 0.7rem; color: #9ca3af;
    }
    html.dark .budget-note { background: #161616; border-color: #2a2a2a; color: #aaa; }
    html.dark .budget-note strong { color: #f5f5f5; }
    html.dark .budget-section-title { color: #f5f5f5; }
    html.dark .budget-hero { background: #161616; border-color: #2a2a2a; color: #f5f5f5; box-shadow: none; }
    html.dark .budget-hero-eyebrow,
    html.dark .budget-hero-diagnostic { color: #9ca3af; }
    html.dark .budget-hero-diagnostic { border-top-color: #2a2a2a; }
    html.dark .budget-hero-diagnostic strong { color: #e5e7eb; }
    html.dark .budget-diagnostic-title,
    html.dark .budget-diagnostic-copy { color: #9ca3af; }
    html.dark .budget-diagnostic-main { color: #d1d5db; }
    html.dark .budget-diagnostic-badge { background: #1f1f1f; border-color: #333; }
    html.dark .budget-chip { background: #1f1f1f; border-color: #333; color: #d1d5db; }
    html.dark .budget-scale-btn { background: #161616; border-color: #2a2a2a; }
    html.dark .budget-scale-btn.is-active { background: #1f1f1f; border-color: #f5f5f5; }
    html.dark .budget-scale-btn.is-active .bs-title { color: #f5f5f5; }
    /* 예산 결과 — 완전 다크 대응 (클래스 기반 컴포넌트) */
    html.dark .budget-modal-box,
    html.dark .budget-inline-box { background: #111; border-color: #222; box-shadow: 0 2px 12px rgba(0,0,0,0.45); }
    html.dark .budget-kpi-card { background: #161616; border-color: #2a2a2a; }
    html.dark .budget-kpi-value { color: #f5f5f5; }
    html.dark .budget-kpi-label { color: #888; }
    html.dark .budget-kpi-sub { color: #999; }
    html.dark .budget-table th { background: #161616; border-color: #2a2a2a; color: #888; }
    html.dark .budget-table td { border-color: #222; color: #ccc; }
    html.dark .budget-table tr:hover td { background: #161616; }
    html.dark .budget-process-log { background: #161616; border-color: #2a2a2a; color: #aaa; }
    html.dark .budget-disclaimer { border-color: #222; }
    html.dark .budget-input { background: #1a1a1a; border-color: #333; color: #f5f5f5; }
    html.dark .budget-step { background: #2a2a2a; }

    /* =========================================================
       Unified product visual language
       - one neutral canvas, one ink scale, one action accent
       - shared focus, radius, border and elevation across modules
       ========================================================= */
    :root {
      --bg: #f7f8fb;
      --surface: #ffffff;
      --surface-subtle: #f8fafc;
      --secondary: #667085;
      --tertiary: #98a2b3;
      --border: #e4e7ec;
      --border-strong: #d0d5dd;
      --accent: #101828;
      --brand: #4f46e5;
      --brand-soft: #eef2ff;
      --success: #039855;
      --warning: #b54708;
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 16px;
      --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
      --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
    }

    body { background: var(--bg); color: var(--accent); }
    :where(button, input, select, textarea, a):focus-visible {
      outline: 3px solid rgba(79, 70, 229, .25);
      outline-offset: 2px;
    }
    .glass-nav {
      background: rgba(255, 255, 255, .88);
      border-bottom-color: var(--border);
      box-shadow: 0 1px 0 rgba(16, 24, 40, .02);
    }
    .btn-primary, .btn-secondary, .btn-analysis {
      min-height: 40px;
      border-radius: var(--radius-sm);
      font-weight: 650;
      letter-spacing: -.01em;
    }
    .btn-primary {
      background: var(--accent);
      color: #fff;
      border-color: var(--accent);
      box-shadow: var(--shadow-sm);
    }
    .btn-primary:hover { background: #1d2939; border-color: #1d2939; box-shadow: var(--shadow-md); }
    .btn-secondary {
      background: var(--surface);
      color: #344054;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
    }
    .btn-secondary:hover { background: var(--surface-subtle); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
    .search-input {
      border-color: var(--border-strong);
      box-shadow: 0 2px 8px rgba(16, 24, 40, .06);
    }
    .search-input:focus, .search-input:hover {
      border-color: rgba(79, 70, 229, .6);
      box-shadow: 0 0 0 4px rgba(79, 70, 229, .1), var(--shadow-md);
    }
    .db-toggle-wrap { border-color: var(--border) !important; box-shadow: var(--shadow-sm) !important; }
    .db-btn.active { background: var(--accent) !important; }
    .tab-btn { border-radius: var(--radius-sm); color: var(--secondary); }
    .tab-btn.active { background: var(--brand-soft); color: #3730a3; }
    .result-card, .ntis-table-wrap, .analysis-card, .budget-modal-box, .budget-inline-box {
      border-color: var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
    }
    .result-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
    .ntis-result-table th { background: var(--surface-subtle); color: #667085; border-bottom-color: var(--border); }
    .ntis-result-table td { border-bottom-color: #f2f4f7; color: #344054; }
    .ntis-result-table tbody tr:hover td { background: #fafbff; }
    .ntis-result-title, .ntis-money { color: var(--accent); }
    .ntis-row-btn { border-color: var(--border); border-radius: var(--radius-sm); color: #344054; }
    .ntis-row-btn:hover { background: var(--brand-soft); border-color: #c7d2fe; color: #3730a3; }
    .badge, .tag, .analysis-tag { border-radius: 999px; }
    .tag { background: var(--surface-subtle); border-color: var(--border); color: var(--secondary); }
    .analysis-header { background: linear-gradient(135deg, #101828 0%, #344054 100%); }
    .blue-ocean { background: var(--brand-soft); color: #4338ca; border-color: #c7d2fe; }
    .gauge-fill { background: linear-gradient(90deg, #6366f1 0%, #4f46e5 100%); }
    .btn-analysis { background: var(--accent); border-color: var(--accent); }
    .btn-analysis:hover { background: #1d2939; border-color: #1d2939; }
    .modal-bg, .budget-modal-bg { background: rgba(16, 24, 40, .28); backdrop-filter: blur(12px); }
    .modal-box { border-color: var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
    .page-btn { border-color: var(--border); border-radius: var(--radius-sm); color: var(--secondary); }
    .page-btn.active { background: var(--accent); border-color: var(--accent); }
    .toast { border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
    .stat-card { border-color: var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
    .stat-card:hover { border-color: #c7d2fe; }
    @media (max-width: 640px) {
      .hero-section { padding-top: 10dvh; }
      .hero-title { font-size: clamp(2.5rem, 15vw, 4rem); }
      .search-input { padding-top: .9rem; padding-bottom: .9rem; }
      .ntis-table-wrap { border-radius: var(--radius-md); }
      .analysis-body { padding: 1.1rem; }
    }
    html.dark .btn-budget-secondary { background: #1f1f1f; border-color: #333; color: #ccc; }
    html.dark .btn-budget-secondary:hover { background: #2a2a2a; }
    html.dark #runBtn { background: #f5f5f5 !important; color: #111 !important; }

    /* ── 규모 래더 · 분포 스트립 · 방법론 (적정 연구비 결과) ── */
    .budget-ladder { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: -0.4rem 0 1.25rem; }
    .budget-ladder-chip {
      border: 1.5px solid #e5e7eb; background: #fff; color: #6b7280;
      font-size: 0.78rem; font-weight: 600; padding: 0.35rem 0.85rem;
      border-radius: 999px; cursor: pointer; transition: all .15s;
    }
    .budget-ladder-chip:hover { border-color: #bbb; }
    .budget-ladder-chip.is-active { border-color: #111; background: #111; color: #fff; }
    .budget-dist {
      position: relative; height: 48px;
      background: #fafafa; border: 1px solid #eee; border-radius: 10px;
      margin-bottom: 2px; overflow: hidden;
    }
    .bd-dot {
      position: absolute; bottom: 9px; width: 7px; height: 7px; margin-left: -3.5px;
      border-radius: 50%; background: rgba(17,17,17,0.32);
    }
    .bd-marker { position: absolute; top: 0; bottom: 0; width: 0; }
    .bd-marker i { position: absolute; top: 4px; bottom: 4px; left: 0; border-left: 2px dashed #9ca3af; }
    .bd-marker.main i { border-left: 2.5px solid #111; }
    .bd-marker em {
      position: absolute; top: 3px; left: 4px;
      font-style: normal; font-size: 9px; font-weight: 700; color: #6b7280; white-space: nowrap;
    }
    .bd-marker.main em { color: #111; }
    .budget-dist-axis { display: flex; justify-content: space-between; font-size: 10px; color: #9ca3af; margin-bottom: 1rem; }
    .budget-method {
      margin-top: 1.25rem; background: #fafafa; border: 1px solid #eee; border-radius: 12px;
      padding: 0.9rem 1.15rem; font-size: 0.8rem; color: #555;
    }
    .budget-method summary { cursor: pointer; font-weight: 700; color: #374151; font-size: 0.82rem; }
    .budget-method ol { margin: 0.6rem 0 0.4rem 1.1rem; padding: 0; line-height: 1.85; }
    .budget-method p { margin: 0.4rem 0 0; font-size: 0.72rem; color: #9ca3af; }
    html.dark .budget-ladder-chip { background: #161616; border-color: #2a2a2a; color: #aaa; }
    html.dark .budget-ladder-chip.is-active { background: #f5f5f5; border-color: #f5f5f5; color: #111; }
    html.dark .budget-dist { background: #161616; border-color: #2a2a2a; }
    html.dark .bd-dot { background: rgba(245,245,245,0.38); }
    html.dark .bd-marker.main i { border-left-color: #f5f5f5; }
    html.dark .bd-marker.main em { color: #f5f5f5; }
    html.dark .budget-method { background: #161616; border-color: #2a2a2a; color: #aaa; }
    html.dark .budget-method summary { color: #ddd; }

    /* 연구과제 규모 선택 */
    .budget-scale-group {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.6rem;
    }
    .budget-scale-btn {
      display: flex; flex-direction: column; gap: 0.3rem;
      text-align: left;
      padding: 0.8rem 0.9rem;
      border: 1.5px solid #e5e7eb;
      border-radius: 0.75rem;
      background: #fff;
      cursor: pointer;
      transition: border-color .15s, background .15s, box-shadow .15s;
    }
    .budget-scale-btn:hover { border-color: #bbb; background: #fafafa; }
    .budget-scale-btn.is-active {
      border-color: #111;
      background: #fafafa;
      box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
    }
    .budget-scale-btn .bs-title {
      font-size: 0.9rem; font-weight: 800; color: #111827;
    }
    .budget-scale-btn.is-active .bs-title { color: #111; }
    .budget-scale-btn .bs-desc {
      font-size: 0.7rem; color: #6b7280; line-height: 1.45;
    }
    @media (max-width: 640px) {
      .budget-scale-group { grid-template-columns: 1fr; }
    }
    .budget-step-bar {
      display: flex; gap: 4px; margin-bottom: 1.5rem;
    }
    .budget-step {
      flex: 1; height: 4px; border-radius: 2px;
      background: #f3f4f6;
      transition: background 0.3s;
    }
    .budget-step.done { background: #22c55e; }
    .budget-step.active { background: #111; animation: pulse 1.2s ease infinite; }
    .budget-input-group {
      margin-bottom: 1rem;
    }
    .budget-input-label {
      font-size: 0.8125rem;
      font-weight: 600;
      color: #374151;
      margin-bottom: 0.375rem;
      display: block;
    }
    .budget-input-label span {
      font-size: 0.7rem;
      font-weight: 400;
      color: #9ca3af;
      margin-left: 4px;
    }
    .budget-input {
      width: 100%;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      padding: 0.7rem 0.875rem;
      font-size: 0.9rem;
      outline: none;
      transition: border-color 0.2s;
      font-family: inherit;
    }
    .budget-input:focus { border-color: #111; box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
    .budget-select-group {
      display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
      margin-bottom: 1rem;
    }
    .budget-select {
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      padding: 0.625rem 0.875rem;
      font-size: 0.875rem;
      outline: none;
      background: #fff;
      transition: border-color 0.2s;
      font-family: inherit;
      width: 100%;
    }
    .budget-select:focus { border-color: #111; }
    .btn-budget {
      background: #111;
      color: #fff;
      border: none;
      border-radius: 8px;
      padding: 0.8rem 1.75rem;
      font-size: 0.9375rem;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      transition: all 0.2s;
    }
    .btn-budget:hover { background: #333; transform: translateY(-1px); }
    .btn-budget:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
    .budget-kpi-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 1rem;
      margin-bottom: 1.5rem;
    }
    .budget-kpi-card {
      background: #fafafa;
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      padding: 1.25rem;
      text-align: center;
    }
    .budget-kpi-card.primary {
      background: linear-gradient(135deg, #111 0%, #333 100%);
      color: #fff;
      border-color: transparent;
    }
    .budget-kpi-label {
      font-size: 0.7rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #9ca3af;
      margin-bottom: 0.5rem;
    }
    .budget-kpi-card.primary .budget-kpi-label { color: rgba(255,255,255,0.6); }
    .budget-kpi-value {
      font-size: 1.5rem;
      font-weight: 800;
      color: #111;
      line-height: 1.2;
    }
    .budget-kpi-card.primary .budget-kpi-value { color: #fff; }
    .budget-kpi-sub {
      font-size: 0.75rem;
      color: #6b7280;
      margin-top: 0.25rem;
    }
    .budget-kpi-card.primary .budget-kpi-sub { color: rgba(255,255,255,0.7); }
    .budget-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.8125rem;
    }
    .budget-table th {
      background: #f9fafb;
      border-bottom: 1px solid #e5e7eb;
      padding: 0.625rem 0.75rem;
      text-align: left;
      font-weight: 600;
      color: #6b7280;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .budget-table td {
      border-bottom: 1px solid #f3f4f6;
      padding: 0.75rem;
      color: #374151;
      vertical-align: top;
    }
    .budget-table tr:last-child td { border-bottom: none; }
    .budget-table tr:hover td { background: #fafafa; }
    .budget-more-btn {
      display: flex;
      align-items: center;
      gap: .3rem;
      width: max-content;
      margin: .55rem auto 0;
      padding: .42rem .75rem;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: var(--surface);
      color: var(--secondary);
      font-family: inherit;
      font-size: .75rem;
      font-weight: 600;
      line-height: 1;
      cursor: pointer;
      transition: background .15s, border-color .15s, color .15s;
    }
    .budget-more-btn:hover {
      background: var(--brand-soft);
      border-color: #c7d2fe;
      color: #3730a3;
    }
    .budget-more-count { color: var(--tertiary); font-weight: 500; }
    .identifier-copy {
      display: block;
      width: 100%;
      min-width: 0;
      overflow: hidden;
      padding: 0;
      border: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      text-align: left;
      text-overflow: ellipsis;
      white-space: nowrap;
      cursor: copy;
    }
    .identifier-copy:hover { color: #3730a3; text-decoration: underline; text-underline-offset: 2px; }
    .identifier-copy.is-copied { color: var(--success); text-decoration: none; }
    .card-identifier-copy { max-width: 220px; font-size: .75rem; color: var(--tertiary); }
    .ntis-project-id { max-width: 220px; }
    .home-search-controls { gap: .5rem; margin-top: .1rem; }
    .home-search-controls #searchBtn { margin: 0; white-space: nowrap; }
    @media (max-width: 560px) {
      .home-search-controls { gap: .4rem; }
      .home-search-controls #searchBtn { flex-basis: 100%; justify-content: center; }
    }

    /* Softer Apple-style graphite accents: reserve pure black for text only. */
    :root {
      --accent: #273444;
      --graphite: #344054;
      --graphite-hover: #475467;
      --silver-ink: #667085;
    }
    .brand-mark { background: var(--graphite); }
    .brand-wordmark { color: var(--accent); }
    .btn-primary,
    .btn-analysis,
    .db-btn.active,
    .budget-ladder-chip.is-active {
      background: var(--graphite) !important;
      border-color: var(--graphite) !important;
    }
    .btn-primary:hover,
    .btn-analysis:hover,
    .budget-ladder-chip.is-active:hover {
      background: var(--graphite-hover) !important;
      border-color: var(--graphite-hover) !important;
    }
    .analysis-header { background: linear-gradient(135deg, #344054 0%, #475467 100%); }
    .budget-kpi-card.primary { background: linear-gradient(135deg, #344054 0%, #475467 100%); }
    .budget-score-fill { background: linear-gradient(90deg, #344054, #98a2b3); }
    .budget-step.active { background: var(--graphite); }
    #runBtn { background: var(--graphite) !important; }
    .search-mode .db-btn.active {
      color: var(--graphite) !important;
      border-bottom-color: var(--graphite);
    }
    html.dark .brand-mark { background: #475467; }
    html.dark .btn-primary,
    html.dark .btn-analysis { background: #d0d5dd !important; border-color: #d0d5dd !important; color: #1d2939; }

    /* Trend analysis result surface: compact, shared with the rest of the app. */
    .trend-analysis-card {
      width: min(900px, 100%);
      margin: 0 auto;
      overflow: hidden;
    }
    .trend-analysis-card .analysis-header {
      padding: 1rem 1.35rem;
      min-height: 72px;
    }
    .trend-analysis-card .analysis-header p { letter-spacing: -.01em; }
    .trend-analysis-body {
      padding: 1.25rem 1.35rem;
      background: var(--surface);
    }
    .trend-analysis-loading {
      min-height: 180px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: .7rem;
      padding: 1.5rem;
      background: var(--surface);
      text-align: center;
    }
    .trend-analysis-loading .spinner { margin: 0 auto; }
    .trend-analysis-error {
      width: min(900px, 100%);
      margin: 0 auto;
      padding: 1.5rem;
      color: #b42318;
      background: #fffbfa;
      border-color: #fecdca;
      text-align: center;
    }
    .trend-kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: .6rem;
      margin-bottom: 1rem;
    }
    .trend-kpi-grid > div {
      min-width: 0 !important;
      padding: .75rem .9rem !important;
      border-radius: var(--radius-md) !important;
      background: var(--surface-subtle) !important;
      border-color: var(--border) !important;
    }
    .trend-kpi-grid > div > div:nth-child(2) {
      font-size: 1.05rem !important;
      line-height: 1.25;
    }
    .trend-analysis-body > div[style*="linear-gradient(180deg,#0f172a"] {
      background: linear-gradient(180deg, #1f2937 0%, #344054 100%) !important;
      border-radius: var(--radius-md) !important;
      padding: 1.1rem 1.1rem .8rem !important;
      margin-bottom: .8rem !important;
    }
    .trend-analysis-body > div[style*="linear-gradient(180deg,#0f172a"] > div[style*="background-image"] {
      opacity: .45;
    }
    .trend-analysis-body > div[style*="background:#f8fafc"] {
      border-color: var(--border) !important;
      border-radius: var(--radius-md) !important;
      padding: .85rem !important;
      margin-bottom: .8rem !important;
    }
    /* Keep the trend report in the same quiet graphite/silver language as the
       search and budget surfaces. The chart remains visually prominent
       without introducing a second dark-theme UI inside the report. */
    .trend-analysis-card .analysis-header {
      background: linear-gradient(135deg, #f8fafc 0%, #e4e7ec 100%) !important;
      color: var(--text) !important;
      border-bottom: 1px solid var(--border);
    }
    .trend-analysis-card .analysis-header iconify-icon { color: #667085; }
    .trend-analysis-card .analysis-header button { color: #98a2b3 !important; }
    .trend-analysis-card .analysis-header button:hover { color: #344054 !important; }
    .trend-analysis-body > div[style*="linear-gradient(180deg,#0f172a"] {
      background: linear-gradient(180deg, #f8fafc 0%, #eef1f5 100%) !important;
      border: 1px solid var(--border);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
    }
    .trend-analysis-body > div[style*="linear-gradient(180deg,#0f172a"] > div[style*="background-image"] {
      opacity: .35;
      background-image: linear-gradient(rgba(52,64,84,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(52,64,84,.08) 1px,transparent 1px) !important;
    }
    .trend-analysis-body > div[style*="linear-gradient(180deg,#0f172a"] [style*="color:#f1f5f9"],
    .trend-analysis-body > div[style*="linear-gradient(180deg,#0f172a"] [style*="color:#94a3b8"] {
      color: #667085 !important;
    }
    .trend-analysis-body > div[style*="linear-gradient(180deg,#0f172a"] [style*="color:#f1f5f9"] {
      color: #1d2939 !important;
    }
    .trend-analysis-body > div[style*="linear-gradient(180deg,#0f172a"] canvas { position: relative; z-index: 1; }
    .trend-analysis-body > div[style*="background:#f8fafc"] > div[style*="background:"] > div {
      background: linear-gradient(135deg, #667085, #98a2b3) !important;
      color: #fff !important;
    }
    .trend-analysis-body > div[style*="background:#eff6ff"] {
      background: #f2f4f7 !important;
      border-left-color: #667085 !important;
    }
    .trend-analysis-body > div[style*="background:#eff6ff"] div,
    .trend-analysis-body > div[style*="background:#eff6ff"] li { color: #475467 !important; }
    .trend-analysis-body details { background: #f8fafc !important; border-color: var(--border) !important; }
    .trend-analysis-body details summary { color: #344054 !important; }
    @media (max-width: 700px) {
      .trend-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .trend-analysis-card .analysis-header { padding: .85rem 1rem; }
      .trend-analysis-body { padding: .9rem; }
    }
    @media (max-width: 420px) {
      .trend-kpi-grid { grid-template-columns: 1fr 1fr; gap: .45rem; }
      .trend-kpi-grid > div { padding: .65rem .7rem !important; }
    }
    .budget-score-bar {
      height: 6px;
      background: #f3f4f6;
      border-radius: 3px;
      overflow: hidden;
      margin-top: 4px;
    }
    .budget-score-fill {
      height: 100%;
      background: linear-gradient(90deg, #111, #555);
      border-radius: 3px;
      transition: width 1s ease;
    }
    .budget-process-log {
      background: #f9fafb;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      padding: 1rem;
      font-size: 0.8rem;
      color: #6b7280;
      font-family: 'Pretendard', monospace;
      max-height: 200px;
      overflow-y: auto;
      margin-bottom: 1rem;
    }
    .budget-log-line {
      display: flex; align-items: flex-start; gap: 8px;
      margin-bottom: 4px;
      animation: fadeUp 0.3s ease;
    }
    .budget-log-icon { flex-shrink: 0; margin-top: 1px; }
    .btn-budget-secondary {
      background: #f3f4f6;
      color: #374151;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      padding: 0.6rem 1.25rem;
      font-size: 0.875rem;
      font-weight: 500;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      transition: all 0.15s;
      font-family: inherit;
    }
    .btn-budget-secondary:hover { background: #e5e7eb; }

    /* ── 다크/라이트 모드 ── */
    html.dark {
      --bg: #0a0a0a;
      --surface: #111111;
      --secondary: #999999;
      --tertiary: #666666;
      --border: #222222;
      --accent: #f5f5f5;
    }
    html.dark body { background: var(--bg); color: var(--accent); }
    html.dark .glass-nav { background: rgba(10,10,10,0.85); }
    html.dark .search-input { background: #1a1a1a; color: #f5f5f5; border-color: #333; }
    html.dark .search-input::placeholder { color: #555; }
    html.dark .result-card { background: var(--surface); border-color: var(--border); }
    html.dark .ntis-table-wrap { background: var(--surface); border-color: var(--border); }
    html.dark .ntis-result-table th { background: #161616; border-color: #2a2a2a; color: #888; }
    html.dark .ntis-result-table td { border-color: #222; color: #ccc; }
    html.dark .ntis-result-table tbody tr:hover td { background: #161616; }
    html.dark .ntis-result-title { color: #f5f5f5; }
    html.dark .ntis-money { color: #f5f5f5; }
    html.dark .ntis-row-btn { background: #1a1a1a; border-color: #333; color: #ccc; }
    html.dark .ntis-row-btn:hover { background: #222; }
    html.dark .ntis-table-note { border-color: #222; }
    html.dark .btn-secondary { background: #1a1a1a; border-color: #333; color: #ccc; }
    html.dark .btn-secondary:hover { background: #222; }
    html.dark .tag { background: #1a1a1a; color: #aaa; border-color: #333; }
    html.dark .select-field { background: #1a1a1a; border-color: #333; color: #ccc; }
    html.dark .options-bar { background: #111; border-color: #222; }
    html.dark .db-toggle-wrap { background: #111; border-color: #333; }
    html.dark .db-btn { color: #888; }
    html.dark .db-btn.active { background: #222; color: #f5f5f5; }
    html.dark .tab-btn { color: #888; }
    html.dark .tab-btn.active { background: #222; color: #f5f5f5; border-color: #444; }
    html.dark .stat-card { background: #111; border-color: #222; }
    html.dark .setup-guide { background: #111; border-color: #222; }
    html.dark mark { background: rgba(255,255,100,0.25); color: inherit; }
    html.dark .modal-box { background: #111; color: var(--accent); }
    html.dark .modal-bg { background: rgba(0,0,0,0.7); }
    html.dark input, html.dark textarea { background: #1a1a1a; color: #f5f5f5; border-color: #333; }

    /* ── 홈 예시 키워드 칩 ── */
    .example-chip {
      padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 500;
      border: 1px solid var(--border); background: var(--surface);
      color: var(--secondary); cursor: pointer; transition: all 0.15s var(--ease);
    }
    .example-chip:hover {
      border-color: var(--accent); color: var(--accent);
      transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    html.dark .example-chip { background: #161616; border-color: #2a2a2a; color: #aaa; }
    html.dark .example-chip:hover { border-color: #f5f5f5; color: #f5f5f5; }

    /* ── 검색 히스토리 드롭다운 ── */
    .search-wrap-rel { position: relative; width: 100%; display: flex; justify-content: center; }
    #historyDropdown {
      position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
      width: min(600px, 90vw); background: var(--surface); border: 1px solid var(--border);
      border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.1); z-index: 200;
      overflow: hidden;
    }
    #historyList li {
      padding: 0.6rem 1rem; font-size: 0.85rem; cursor: pointer; display: flex;
      align-items: center; gap: 0.5rem; color: var(--secondary);
      transition: background 0.1s; border-bottom: 1px solid var(--border);
    }
    #historyList li:last-child { border-bottom: none; }
    #historyList li:hover { background: var(--bg); }
    #historyList li.clear-btn { color: #ef4444; font-size: 0.75rem; justify-content: center; }

    /* ── 즐겨찾기 패널 ── */
    #favPanel {
      position: fixed; top: 0; right: -420px; width: 420px; height: 100dvh;
      background: var(--surface); border-left: 1px solid var(--border);
      box-shadow: -8px 0 32px rgba(0,0,0,0.08); z-index: 500;
      transition: right 0.3s var(--ease); overflow-y: auto;
      display: flex; flex-direction: column;
    }
    #favPanel.open { right: 0; }
    #favPanel .fav-header {
      padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
      position: sticky; top: 0; background: var(--surface); z-index: 1;
    }
    .fav-card {
      padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
      cursor: pointer; transition: background 0.1s;
    }
    .fav-card:hover { background: var(--bg); }
    #favOverlay {
      position: fixed; inset: 0; background: rgba(0,0,0,0.3);
      z-index: 499; display: none;
    }
    #favOverlay.open { display: block; }

    /* ── 연구자/기관 프로필 패널 ── */
    #profilePanel {
      position: fixed; top: 0; left: -460px; width: 460px; height: 100dvh;
      background: var(--surface); border-right: 1px solid var(--border);
      box-shadow: 8px 0 32px rgba(0,0,0,0.08); z-index: 500;
      transition: left 0.3s var(--ease); overflow-y: auto;
    }
    #profilePanel.open { left: 0; }

    /* ── 비교 검색 ── */
    #compareSection { display: none; }
    #compareSection.active { display: block; }
    .compare-col { flex: 1; min-width: 0; }
    .compare-divider { width: 2px; background: var(--border); flex-shrink: 0; }

    /* ── 키워드 네트워크 ── */
    #networkModal {
      position: fixed; inset: 0; background: rgba(0,0,0,0.5);
      z-index: 600; display: none; align-items: center; justify-content: center;
    }
    #networkModal.open { display: flex; }
    #networkContainer { width: 100%; height: 100%; }
    #networkContainer svg { width: 100%; height: 100%; }
    .node circle { stroke: var(--border); stroke-width: 1.5px; cursor: pointer; }
    .node text { font-size: 11px; fill: var(--secondary); pointer-events: none; }
    .link { stroke: var(--border); stroke-opacity: 0.5; }

    /* ── 카드 즐겨찾기 버튼 ── */
    .fav-btn {
      background: none; border: none; cursor: pointer; padding: 4px;
      color: var(--tertiary); transition: color 0.15s; line-height: 1;
    }
    .fav-btn.active { color: #f59e0b; }
    .fav-btn:hover { color: #f59e0b; }
    /* ── 클라이언트 정렬 버튼 ── */
    .sort-btn {
      padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 500;
      border: 1px solid var(--border); background: transparent;
      color: var(--secondary); cursor: pointer; transition: all 0.15s;
      white-space: nowrap;
    }
    .sort-btn:hover { border-color: #3b82f6; color: #3b82f6; }
    .sort-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }

    /* ── 키워드 클라우드 태그 ── */
    .keyword-cloud-tag {
      display: inline-flex; align-items: center; gap: 2px;
      padding: 3px 10px; border-radius: 999px;
      border: 1px solid var(--border); background: transparent;
      color: var(--secondary); cursor: pointer; transition: all 0.15s;
      white-space: nowrap; line-height: 1.4;
    }
    .keyword-cloud-tag:hover { border-color: #3b82f6; color: #3b82f6; background: rgba(59,130,246,0.06); }

    /* ── 저자 링크 (클릭 가능) ── */
    .author-link {
      cursor: pointer; color: var(--secondary);
      border-bottom: 1px dashed var(--border);
      transition: color 0.15s, border-color 0.15s;
    }
    .author-link:hover { color: #3b82f6; border-color: #3b82f6; }

    /* ── 인사이트 모달 차트 래퍼 ── */
    #yearChartWrap, #instChartWrap {
      height: 200px; position: relative;
    }

    /* ────────────────────────────────────────────────────────
       Features: 신규 기능 스타일
    ──────────────────────────────────────────────────────── */

    /* 메모 버튼 활성화 */
    .fav-btn.memo-active {
      color: #f59e0b;
    }
    .fav-btn.memo-active:hover {
      background: rgba(245, 158, 11, 0.08);
    }

    /* 컬렉션 카드 */
    .col-card {
      padding: 0.75rem 1rem;
      background: #fafafa;
      border: 1px solid var(--border);
      border-radius: 0.75rem;
      transition: box-shadow 0.15s;
    }
    .col-card:hover {
      box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    /* 연구자 프로필 KPI 카드 */
    .profile-kpi {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.875rem;
      background: #fafafa;
      border: 1px solid var(--border);
      border-radius: 0.75rem;
    }

    /* 공동저자 칩 */
    .coauthor-chip {
      display: inline-flex;
      align-items: center;
      gap: 0.375rem;
      padding: 0.25rem 0.75rem;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: white;
      font-size: 0.75rem;
      color: #374151;
      cursor: pointer;
      transition: all 0.15s;
    }
    .coauthor-chip:hover {
      border-color: #111;
      background: #111;
      color: white;
    }

    /* 내보내기 드롭다운 */
    #exportMenu button:hover {
      background: #f9fafb;
    }

    /* 기관 비교 테이블 */
    #instCompareResult table th,
    #instCompareResult table td {
      white-space: nowrap;
    }

    /* Dark-mode action contrast for the shared button language. */
    html.dark .btn-primary,
    html.dark .btn-analysis {
      background: #f5f5f5;
      border-color: #f5f5f5;
      color: #111;
    }
    html.dark .btn-primary:hover,
    html.dark .btn-analysis:hover {
      background: #fff;
      border-color: #fff;
    }

    /* Budget result density and neutral callout surface. */
    .budget-inline-box {
      padding: 1.25rem;
    }
    .budget-hero {
      padding: .9rem 1rem;
      margin-bottom: .75rem;
    }
    .budget-hero-eyebrow { margin-bottom: .3rem; }
    .budget-hero-value { font-size: 1.85rem; }
    .budget-hero-chips { gap: .35rem; margin-top: .6rem; }
    .budget-chip { padding: .24rem .6rem; }
    .budget-hero-diagnostic {
      margin-top: .55rem;
      padding-top: .55rem;
    }
    .budget-ladder {
      gap: .4rem;
      margin: -.1rem 0 .8rem;
    }
    .budget-ladder-chip { padding: .3rem .7rem; }
    .budget-warning {
      display: flex;
      flex-direction: column;
      gap: .18rem;
      margin-bottom: .8rem;
      padding: .65rem .8rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      background: var(--surface-subtle);
      color: var(--secondary);
      font-size: .76rem;
      line-height: 1.5;
    }
    .budget-kpi-grid {
      gap: .65rem;
      margin-bottom: .8rem;
    }
    .budget-kpi-card {
      padding: .85rem .9rem;
      border-radius: var(--radius-md);
    }
    .budget-kpi-label { margin-bottom: .3rem; font-size: .66rem; }
    .budget-kpi-value { font-size: 1.25rem; }
    .budget-kpi-sub { font-size: .7rem; }
    .budget-section-title {
      margin: 1rem 0 .55rem;
      font-size: .88rem;
    }
    .budget-note {
      padding: .8rem .9rem;
      font-size: .78rem;
      line-height: 1.6;
    }
    .budget-dist { height: 42px; }
    .budget-dist-axis { margin-bottom: .65rem; }
    .budget-table { font-size: .76rem; }
    .budget-table th { padding: .5rem .6rem; font-size: .68rem; }
    .budget-table td { padding: .55rem .6rem; }
    .budget-method { margin-top: .9rem; padding: .7rem .85rem; }
    .budget-disclaimer { margin-top: .9rem; padding-top: .7rem; }
    @media (max-width: 640px) {
      .budget-inline-box { padding: .85rem; }
      .budget-hero-value { font-size: 1.6rem; }
      .budget-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .budget-kpi-card { padding: .7rem; }
    }

    /* Use the wide result surface instead of leaving the hero's right half empty. */
    .budget-hero {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr);
      column-gap: 1.5rem;
      align-items: center;
    }
    .budget-hero-eyebrow,
    .budget-hero-value,
    .budget-hero-chips { grid-column: 1; }
    .budget-hero-diagnostic {
      grid-column: 2;
      grid-row: 1 / span 3;
      align-self: stretch;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
      margin-top: 0;
      padding: .25rem 0 .25rem 1.1rem;
      border-top: 0;
      border-left: 1px solid var(--border);
      word-break: keep-all;
      overflow-wrap: normal;
      line-height: 1.55;
    }
    .budget-hero-diagnostic strong,
    .budget-hero-diagnostic span { white-space: nowrap; }
    @media (max-width: 700px) {
      .budget-hero {
        display: block;
      }
      .budget-hero-diagnostic {
        align-items: flex-start;
        margin-top: .55rem;
        padding: .55rem 0 0;
        border-left: 0;
        border-top: 1px solid var(--border);
      }
    }
