:root {
  --bg: #f8fafc; --surface: #ffffff; --text: #0f172a; --muted: #475569;
  --border: #e2e8f0; --brand: #16a34a; --brand-dark: #15803d; --brand-soft: #dcfce7;
  --radius: 14px; --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 900; }
.nav-links { display: flex; align-items: center; gap: 20px; font-weight: 600; font-size: 0.94rem; }
.nav-links a:hover { color: var(--brand); }
.nav-dropdown { position: relative; }
.nav-dd-btn { background: none; border: none; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); padding: 8px 0; }
.nav-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,0.12); padding: 8px; }
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 0.9rem; font-weight: 500; }
.nav-dropdown-menu a:hover { background: var(--bg); color: var(--brand); }
.nav-dd-all { font-weight: 700 !important; color: var(--brand-dark); }
.nav-dd-divider { height: 1px; background: var(--border); margin: 6px 0; }
.lang-pill { border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 0.82rem; font-weight: 700; background: var(--bg); }

/* Hero */
.hero { background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%); border-bottom: 1px solid var(--border); padding: 52px 0 58px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 0.95fr; gap: 38px; align-items: center; }
.hero-badge { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 0.82rem; padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(1.85rem, 3.4vw, 2.65rem); line-height: 1.18; margin: 0 0 14px; letter-spacing: -0.03em; }
.hero p.lead { color: var(--muted); font-size: 1.03rem; margin: 0 0 22px; }
.hero-search { position: relative; }
.hero-search input { width: 100%; padding: 14px 18px; border: 2px solid var(--border); border-radius: 12px; font-size: 1rem; outline: none; background: #fff; }
.hero-search input:focus { border-color: var(--brand); }
.search-results { position: absolute; top: 106%; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; display: none; z-index: 50; }
.search-results a { display: flex; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 0.94rem; }
.search-results a:hover { background: var(--bg); }

/* Cards & Grids */
.preview-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: 0 12px 32px rgba(15,23,42,0.08); }
.preview-top { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 14px; }
.preview-kcal { font-size: 1.9rem; font-weight: 900; color: var(--brand-dark); }
.macro-row { margin-bottom: 10px; }
.macro-label { display: flex; justify-content: space-between; font-size: 0.86rem; font-weight: 600; margin-bottom: 4px; }
.macro-bar { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.macro-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width .2s; }

.section { padding: 44px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.45rem; letter-spacing: -0.02em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.94rem; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; display: grid; place-items: center; margin-bottom: 8px; font-size: 0.85rem; }

.chains-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 14px; }
.chain-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; display: flex; align-items: center; gap: 12px; transition: transform .15s, border-color .15s; }
.chain-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.chain-badge { width: 42px; height: 42px; border-radius: 10px; color: #fff; font-weight: 800; font-size: 0.84rem; display: grid; place-items: center; flex-shrink: 0; }
.chain-meta strong { display: block; font-size: 0.95rem; line-height: 1.25; }
.chain-meta span { font-size: 0.8rem; color: var(--muted); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.cat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; display: block; transition: border-color .15s; }
.cat-card:hover, .cat-card.active { border-color: var(--brand); background: #f0fdf4; }

/* Pills, Buttons, Pagination */
.pill-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill { border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.pill.active, .pill:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary { display: inline-block; background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 700; border: none; cursor: pointer; font-size: 0.94rem; }
.btn-outline { display: inline-block; border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 0.9rem; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Calculator & Snapshot */
.snapshot-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 20px; }
.snap-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; text-align: center; }
.snap-box strong { display: block; font-size: 1.2rem; color: var(--brand-dark); }
.snap-box span { font-size: 0.78rem; color: var(--muted); }
.auto-builder { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 14px; padding: 16px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.auto-builder input { width: 90px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; }

.calc-layout { display: grid; grid-template-columns: 1.45fr 0.85fr; gap: 26px; align-items: start; }
.sticky-panel { position: sticky; top: 86px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.item-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; margin-bottom: 10px; }
.qty-ctrl { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); font-weight: 800; cursor: pointer; }
.qty-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.rice-badge { background: #fef9c3; color: #854d0e; font-size: 0.84rem; font-weight: 700; padding: 8px 12px; border-radius: 10px; margin-bottom: 14px; text-align: center; }

.mobile-bar { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #0f172a; color: #fff; padding: 12px 18px; z-index: 120; justify-content: space-between; align-items: center; }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.data-table th { background: #f1f5f9; font-weight: 700; }

/* Footer */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 44px 0 56px; margin-top: 60px; font-size: 0.88rem; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 860px) {
  .hero-grid, .calc-layout, .steps-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 10px; font-size: 0.84rem; }
  .mobile-bar { display: flex; }
  body { padding-bottom: 58px; }
}