*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --surface: #1e1e2e;
  --surface2: #252535;
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --text: #f0f0f5;
  --text2: #9999b0;
  --text3: #666680;
  --accent: #7c6fff;
  --accent2: #a78bfa;
  --font-display: 'DM Serif Display', serif;
  --font-body: 'Pretendard', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }

/* NAV */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(10,10,15,0.85); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 2rem; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--font-display); font-size: 22px; color: var(--text); text-decoration: none; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { color: var(--text2); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.btn-nav { background: var(--accent); color: #fff !important; padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.btn-nav:hover { background: var(--accent2) !important; }

/* HERO */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 100px 2rem 60px; position: relative; overflow: hidden; max-width: 1100px; margin: 0 auto; gap: 4rem; }
.hero-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.12; }
.orb1 { width: 600px; height: 600px; background: var(--accent); top: -100px; left: -100px; animation: pulse 8s ease-in-out infinite; }
.orb2 { width: 400px; height: 400px; background: #06b6d4; bottom: 0; right: -50px; animation: pulse 10s ease-in-out infinite reverse; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 0.12; } 50% { transform: scale(1.15); opacity: 0.18; } }
.grid-overlay { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px); background-size: 60px 60px; }
.hero-content { flex: 1; animation: fadeUp 0.8s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(124,111,255,0.4); color: var(--accent2); font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 20px; background: rgba(124,111,255,0.08); margin-bottom: 1.5rem; letter-spacing: 0.03em; }
.hero-content h1 { font-family: var(--font-display); font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.15; letter-spacing: -1px; margin-bottom: 1.2rem; }
.hero-content h1 em { font-style: italic; color: var(--accent2); }
.hero-content p { font-size: 17px; color: var(--text2); line-height: 1.7; margin-bottom: 2rem; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 2.5rem; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; padding: 13px 26px; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: 15px; transition: all 0.2s; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 8px 30px rgba(124,111,255,0.4); }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border2); color: var(--text2); padding: 13px 26px; border-radius: 10px; text-decoration: none; font-size: 15px; transition: all 0.2s; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent2); }
.hero-stats { display: flex; align-items: center; gap: 1.5rem; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -0.5px; }
.stat small { font-size: 12px; color: var(--text3); }
.stat-divider { width: 1px; height: 36px; background: var(--border2); }

/* MOCK CARD */
.hero-visual { flex: 1; max-width: 420px; animation: fadeUp 0.8s 0.2s ease both; }
.mock-card { background: var(--surface); border: 1px solid var(--border2); border-radius: 16px; overflow: hidden; }
.mock-header { background: var(--surface2); padding: 12px 16px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); }
.mock-dot { width: 10px; height: 10px; border-radius: 50%; }
.mock-dot.r { background: #ff5f57; } .mock-dot.y { background: #febc2e; } .mock-dot.g { background: #28c840; }
.mock-title { font-size: 12px; color: var(--text3); margin-left: 6px; }
.mock-cards-row { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mock-chip { font-size: 11px; padding: 3px 10px; border-radius: 12px; border: 1px solid; font-weight: 500; }
.mock-total { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.mock-label { font-size: 12px; color: var(--text3); margin-bottom: 4px; }
.mock-amount { font-size: 28px; font-weight: 600; letter-spacing: -1px; }
.mock-amount small { font-size: 13px; color: var(--text2); }
.mock-bars { padding: 14px 20px; display: flex; flex-direction: column; gap: 10px; }
.mock-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text2); }
.mock-bar-row > span:first-child { width: 36px; flex-shrink: 0; }
.mock-bar-track { flex: 1; height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.mock-bar-fill { height: 100%; border-radius: 3px; animation: grow 1.2s cubic-bezier(.4,0,.2,1) both; }
@keyframes grow { from { width: 0 !important; } }
.mamt { width: 34px; text-align: right; font-size: 11px; color: var(--text3); }

/* HOW */
.how { padding: 100px 2rem; background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.container { max-width: 1100px; margin: 0 auto; }
.section-label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: 12px; }
h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 3.5vw, 3rem); line-height: 1.2; letter-spacing: -0.5px; margin-bottom: 3rem; }
.steps { display: flex; align-items: flex-start; gap: 1rem; }
.step { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; transition: border-color 0.2s; }
.step:hover { border-color: var(--accent); }
.step-num { font-size: 11px; letter-spacing: 0.1em; color: var(--accent); font-weight: 600; margin-bottom: 1rem; }
.step-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(124,111,255,0.12); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--accent2); margin-bottom: 1rem; }
.step h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--text2); line-height: 1.6; }
.step-arrow { font-size: 24px; color: var(--text3); margin-top: 80px; flex-shrink: 0; }

/* APP SECTION */
.app-section { padding: 100px 2rem; }
.app-section h2 { margin-bottom: 2rem; }
.app-layout { display: flex; flex-direction: column; gap: 1.5rem; }

/* PANELS */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2rem; width: 100%; }

/* CARD SLOTS */
.cards-section-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: 13px; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; }
.btn-add-card { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 7px 14px; border-radius: 8px; border: 1px dashed var(--border2); background: none; color: var(--accent2); cursor: pointer; font-family: var(--font-body); transition: all 0.2s; }
.btn-add-card:hover { border-color: var(--accent); background: rgba(124,111,255,0.08); }

.card-slots { display: flex; flex-direction: column; gap: 12px; margin-bottom: 1.5rem; }

.card-slot { background: var(--bg3); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; transition: border-color 0.2s; }
.card-slot:focus-within { border-color: rgba(124,111,255,0.35); }

.slot-header { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.slot-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.slot-name-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 13px; font-weight: 500; font-family: var(--font-body); }
.slot-name-input::placeholder { color: var(--text3); }
.slot-tab-bar { display: flex; gap: 4px; margin-left: auto; background: rgba(0,0,0,0.2); padding: 3px; border-radius: 8px; }
.slot-tab { font-size: 11px; padding: 4px 10px; border-radius: 6px; border: none; background: none; color: var(--text3); cursor: pointer; font-family: var(--font-body); transition: all 0.15s; }
.slot-tab.active { background: var(--surface); color: var(--text); }
.slot-del { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 13px; width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; margin-left: 4px; flex-shrink: 0; }
.slot-del:hover { color: #f87171; background: rgba(248,113,113,0.1); }

.slot-body { padding: 14px 16px; }
.slot-textarea { width: 100%; min-height: 110px; background: none; border: none; outline: none; color: var(--text); font-family: var(--font-body); font-size: 13px; line-height: 1.7; resize: vertical; }
.slot-textarea::placeholder { color: var(--text3); font-size: 13px; }

.slot-file-area { }
.slot-dropzone { border: 1.5px dashed var(--border2); border-radius: 10px; padding: 1.5rem; text-align: center; cursor: pointer; transition: all 0.2s; }
.slot-dropzone:hover { border-color: var(--accent); background: rgba(124,111,255,0.04); }
.slot-dropzone i { font-size: 22px; color: var(--text3); display: block; margin-bottom: 8px; }
.slot-dropzone p { font-size: 13px; color: var(--text2); }
.slot-dropzone p span { color: var(--accent2); }
.slot-dropzone small { font-size: 11px; color: var(--text3); margin-top: 4px; display: block; }
.slot-file-badge { display: flex; align-items: center; gap: 8px; background: rgba(124,111,255,0.08); border: 1px solid rgba(124,111,255,0.2); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--accent2); margin-top: 8px; }
.slot-file-badge span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-file-badge button { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 13px; }

/* STATUS + ANALYZE BTN */
.status-bar { display: flex; align-items: center; gap: 10px; background: rgba(124,111,255,0.08); border: 1px solid rgba(124,111,255,0.2); border-radius: 8px; padding: 12px 16px; margin-bottom: 1rem; font-size: 13px; color: var(--accent2); }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(124,111,255,0.3); border-top-color: var(--accent2); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-analyze { width: 100%; padding: 14px; background: var(--accent); color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 500; font-family: var(--font-body); cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-analyze:hover { background: var(--accent2); box-shadow: 0 8px 30px rgba(124,111,255,0.35); }
.btn-analyze:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* RESULT */
.result-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.result-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.fpill { font-size: 12px; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border2); color: var(--text2); cursor: pointer; background: none; font-family: var(--font-body); transition: all 0.15s; white-space: nowrap; }
.fpill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.result-actions { display: flex; gap: 8px; align-items: flex-start; }

/* EXPORT DROPDOWN */
.export-dropdown { position: relative; }
.btn-export { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border2); background: none; color: var(--text2); cursor: pointer; font-size: 13px; font-family: var(--font-body); transition: all 0.2s; white-space: nowrap; }
.btn-export:hover { border-color: var(--accent); color: var(--accent2); }
.export-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface2); border: 1px solid var(--border2); border-radius: 10px; padding: 6px; min-width: 170px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.export-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; background: none; border: none; color: var(--text2); font-size: 13px; font-family: var(--font-body); cursor: pointer; border-radius: 7px; transition: all 0.15s; text-align: left; }
.export-menu button:hover { background: rgba(124,111,255,0.12); color: var(--accent2); }
.export-menu button i { width: 16px; text-align: center; font-size: 14px; }

.btn-icon { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: none; color: var(--text2); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-icon:hover { border-color: var(--border2); color: var(--text); background: var(--surface2); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.5rem; }
.metric-card { background: var(--bg3); border-radius: 12px; padding: 14px 16px; }
.metric-card .label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.metric-card .value { font-size: 20px; font-weight: 600; letter-spacing: -0.5px; }
.metric-card .sub { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* CARD SUMMARY */
.card-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.card-sum-card { border-radius: 12px; padding: 14px 16px; border: 1px solid; }
.card-sum-name { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.card-sum-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.card-sum-amount { font-size: 20px; font-weight: 600; letter-spacing: -0.5px; margin-bottom: 2px; }
.card-sum-sub { font-size: 11px; opacity: 0.6; }

.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.chart-title { font-size: 13px; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; }

.cat-bars { display: flex; flex-direction: column; gap: 14px; }
.cat-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.cat-name { display: flex; align-items: center; gap: 8px; }
.cat-icon-wrap { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.cat-right { color: var(--text3); }
.cat-right strong { color: var(--text); margin-right: 4px; }
.cat-track { height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.cat-fill { height: 100%; border-radius: 3px; transition: width 0.9s cubic-bezier(.4,0,.2,1); }

.tx-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
select { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); border-radius: 8px; padding: 7px 12px; font-size: 13px; font-family: var(--font-body); cursor: pointer; outline: none; }
select:focus { border-color: var(--accent); }

.tx-list { display: flex; flex-direction: column; gap: 2px; }
.tx-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; transition: background 0.15s; }
.tx-row:hover { background: var(--surface2); }
.tx-cat-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.tx-info { flex: 1; min-width: 0; }
.tx-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { font-size: 11px; color: var(--text3); margin-top: 1px; display: flex; align-items: center; gap: 6px; }
.tx-card-badge { font-size: 10px; padding: 1px 6px; border-radius: 4px; border: 1px solid; }
.tx-right { text-align: right; flex-shrink: 0; }
.tx-amt { font-size: 14px; font-weight: 500; }
.tx-cat-badge { font-size: 11px; padding: 2px 7px; border-radius: 5px; margin-top: 2px; display: inline-block; }

.hidden { display: none !important; }

/* FOOTER */
.footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 2.5rem 2rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer p { font-size: 13px; color: var(--text3); }

/* PDF print styles */
@media print {
  body > *:not(#pdfArea) { display: none !important; }
  #pdfArea { display: block !important; background: white; color: #111; font-family: 'Pretendard', sans-serif; padding: 2rem; }
  #pdfArea h1 { font-size: 22px; margin-bottom: 4px; }
  #pdfArea .pdf-sub { font-size: 13px; color: #666; margin-bottom: 20px; }
  #pdfArea table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 16px; }
  #pdfArea th { background: #f3f4f6; font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 2px solid #e5e7eb; }
  #pdfArea td { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; }
  #pdfArea .pdf-section { margin-bottom: 28px; }
  #pdfArea .pdf-section-title { font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #e5e7eb; }
  #pdfArea .pdf-card-header { background: #f9fafb; padding: 10px; margin-bottom: 4px; border-radius: 6px; font-weight: 600; }
}

@media (max-width: 768px) {
  .hero { flex-direction: column; padding-top: 80px; gap: 2rem; }
  .hero-visual { max-width: 100%; }
  .steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); align-self: center; margin-top: 0; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}
