*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #a78bfa;
  --secondary: #f472b6;
  --primary-rgb: 167,139,250;
  --bg: #0f0f14;
  --bg-surface: #18181f;
  --bg-card: #1e1e28;
  --bg-input: #13131a;
  --border: rgba(255,255,255,.08);
  --text: #e8e8f0;
  --text-muted: #8888a8;
  --text-faint: #555570;
  --success: #34d399;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: .2s cubic-bezier(.4,0,.2,1);
  --shadow-glow: 0 0 40px rgba(167,139,250,.12);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; text-decoration: none; }

/* ── Header ──────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(15,15,20,.88); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); transition: box-shadow var(--transition); }
.site-header.scrolled { box-shadow: 0 4px 32px rgba(0,0,0,.4); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; max-width: 1280px; margin-inline: auto; padding-inline: clamp(16px,4vw,48px); }
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon { width: 36px; height: 36px; }
.logo-text { font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em; background: linear-gradient(135deg,#fff 40%,var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link { padding: 6px 14px; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500; color: var(--text-muted); transition: all var(--transition); }
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.06); }

/* ── Hero ────────────────────────────────────────────────── */
.tool-hero { padding: clamp(32px,5vw,56px) 0 0; text-align: center; position: relative; overflow: hidden; }
.tool-hero::before { content: ''; position: absolute; inset: -60px; background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(167,139,250,.14) 0%, transparent 70%); pointer-events: none; }
.container { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: clamp(16px,4vw,48px); }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(167,139,250,.1); border: 1px solid rgba(167,139,250,.25); color: #c4b5fd; margin-bottom: 18px; }
.hero-title { font-size: clamp(2rem,5vw,3.2rem); font-weight: 900; letter-spacing: -.04em; line-height: 1.1; margin-bottom: 14px; }
.gradient-text { background: linear-gradient(135deg,var(--primary),var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-desc { font-size: clamp(.95rem,2vw,1.1rem); color: var(--text-muted); max-width: 560px; margin-inline: auto; line-height: 1.7; margin-bottom: 32px; }

/* ── Main layout ─────────────────────────────────────────── */
.tool-section { padding: clamp(24px,4vw,40px) 0 clamp(40px,6vw,72px); }
.calc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 820px) { .calc-layout { grid-template-columns: 1fr; } }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: clamp(20px,3vw,32px); }
.card-title { font-size: 1rem; font-weight: 800; margin-bottom: 22px; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 18px; height: 18px; color: var(--primary); }

/* ── Form groups ─────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.input-wrap { position: relative; }
.input-prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: .95rem; font-weight: 700; color: var(--text-faint); pointer-events: none; }
.field-input { width: 100%; padding: 12px 16px 12px 32px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); font-size: 1rem; font-weight: 600; transition: border-color var(--transition), box-shadow var(--transition); outline: none; -moz-appearance: textfield; }
.field-input::-webkit-outer-spin-button, .field-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.field-input:focus { border-color: rgba(var(--primary-rgb),.5); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.1); }
.field-input.no-prefix { padding-left: 16px; }

/* ── Tip preset buttons ──────────────────────────────────── */
.tip-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 8px; }
.tip-preset-btn { padding: 10px 4px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted); font-size: .88rem; font-weight: 700; cursor: pointer; transition: all var(--transition); text-align: center; }
.tip-preset-btn:hover { border-color: rgba(var(--primary-rgb),.4); color: var(--text); background: rgba(var(--primary-rgb),.06); }
.tip-preset-btn.active { background: linear-gradient(135deg,rgba(167,139,250,.2),rgba(244,114,182,.2)); border-color: rgba(167,139,250,.5); color: var(--text); }

/* ── Split people ────────────────────────────────────────── */
.people-row { display: flex; align-items: center; gap: 12px; }
.people-btn { width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); color: var(--text); font-size: 1.2rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition); flex-shrink: 0; }
.people-btn:hover { border-color: rgba(var(--primary-rgb),.4); background: rgba(var(--primary-rgb),.08); color: var(--primary); }
.people-count { flex: 1; text-align: center; font-size: 1.3rem; font-weight: 800; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 0; }

/* ── Rounding toggle ─────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; margin-bottom: 20px; }
.toggle-row-label { font-size: .88rem; font-weight: 600; color: var(--text-muted); }
.toggle-switch { width: 40px; height: 22px; background: var(--border); border-radius: 999px; position: relative; transition: background var(--transition); flex-shrink: 0; }
.toggle-switch.on { background: linear-gradient(135deg,var(--primary),var(--secondary)); }
.toggle-switch::after { content: ''; position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: transform var(--transition); }
.toggle-switch.on::after { transform: translateX(18px); }

/* ── Result card ─────────────────────────────────────────── */
.result-card { background: linear-gradient(135deg,rgba(167,139,250,.08),rgba(244,114,182,.08)); border: 1px solid rgba(167,139,250,.2); border-radius: var(--radius-xl); padding: clamp(20px,3vw,32px); }
.result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.result-title { font-size: 1rem; font-weight: 800; }

/* Big number display */
.big-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.big-amount-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 16px; text-align: center; }
.big-amount-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 6px; }
.big-amount-value { font-size: clamp(1.4rem,3vw,2rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
.big-amount-value.gradient-text { background: linear-gradient(135deg,var(--primary),var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Breakdown rows */
.breakdown-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.breakdown-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: .9rem; }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row .row-label { color: var(--text-muted); }
.breakdown-row .row-value { font-weight: 700; color: var(--text); }
.breakdown-row.total-row { background: rgba(167,139,250,.05); }
.breakdown-row.total-row .row-label { font-weight: 700; color: var(--text); }
.breakdown-row.total-row .row-value { font-size: 1.05rem; background: linear-gradient(135deg,var(--primary),var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Per-person panel */
.per-person-panel { margin-top: 16px; background: rgba(52,211,153,.05); border: 1px solid rgba(52,211,153,.15); border-radius: var(--radius-lg); padding: 16px 18px; }
.per-person-panel.hidden { display: none; }
.per-person-title { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #6ee7b7; margin-bottom: 12px; }
.per-person-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.per-person-item { text-align: center; }
.per-person-item-label { font-size: .72rem; color: var(--text-faint); margin-bottom: 4px; }
.per-person-item-value { font-size: 1rem; font-weight: 800; color: #34d399; }

/* Buttons */
.btn-row { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn-primary { flex: 1; min-width: 120px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 12px 24px; border-radius: var(--radius-md); font-size: .92rem; font-weight: 700; background: linear-gradient(135deg,var(--primary),var(--secondary)); color: #fff; border: none; cursor: pointer; transition: all var(--transition); }
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(167,139,250,.3); }
.btn-secondary { flex: 1; min-width: 100px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 12px 20px; border-radius: var(--radius-md); font-size: .88rem; font-weight: 600; background: transparent; color: var(--text-muted); border: 1px solid var(--border); cursor: pointer; transition: all var(--transition); }
.btn-secondary:hover { border-color: rgba(var(--primary-rgb),.4); color: var(--text); }

/* ── Tip guide card ──────────────────────────────────────── */
.tip-guide-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px; margin-top: 28px; }
.tip-guide-title { font-size: .88rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 16px; }
.tip-guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tip-guide-item { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }
.tip-guide-service { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 4px; }
.tip-guide-range { font-size: 1rem; font-weight: 800; }
.tip-guide-note { font-size: .72rem; color: var(--text-faint); margin-top: 3px; }

/* ── Ad slots ────────────────────────────────────────────── */
.ad-slot { background: var(--bg-card); border: 1px dashed rgba(255,255,255,.06); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: .75rem; }
.ad-leaderboard { width: 100%; height: 90px; margin-bottom: 32px; }
.ad-incontent { width: 100%; min-height: 100px; margin: 28px 0; }

/* ── Info tabs ───────────────────────────────────────────── */
.info-section { padding: clamp(24px,4vw,40px) 0; }
.info-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.info-tab { padding: 7px 18px; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); color: var(--text-muted); background: transparent; transition: all var(--transition); }
.info-tab.active, .info-tab:hover { background: rgba(var(--primary-rgb),.1); border-color: rgba(var(--primary-rgb),.3); color: var(--text); }
.info-panel { display: none; }
.info-panel.active { display: block; }
.info-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.info-content h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.info-content p { font-size: .9rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 12px; }
.info-content p:last-child { margin-bottom: 0; }
.info-content ul { padding-left: 20px; color: var(--text-muted); font-size: .9rem; line-height: 1.75; }
.info-content li { margin-bottom: 6px; }

/* ── FAQ ─────────────────────────────────────────────────── */
.faq-section { padding: clamp(24px,4vw,40px) 0; }
.faq-section-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 20px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.faq-question { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; font-size: .92rem; font-weight: 700; cursor: pointer; user-select: none; gap: 12px; }
.faq-icon { width: 22px; height: 22px; border-radius: 50%; background: rgba(var(--primary-rgb),.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--transition); }
.faq-icon svg { width: 12px; height: 12px; color: var(--primary); transition: transform var(--transition); }
.faq-item.open .faq-icon { background: rgba(var(--primary-rgb),.2); }
.faq-item.open .faq-icon svg { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .35s ease; }
.faq-item.open .faq-answer { max-height: 300px; }
.faq-answer-inner { padding: 0 20px 16px; font-size: .88rem; color: var(--text-muted); line-height: 1.75; }

/* ── Related ─────────────────────────────────────────────── */
.related-section { padding: clamp(24px,4vw,40px) 0; border-top: 1px solid var(--border); }
.related-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.section-title { font-size: 1.4rem; font-weight: 800; }
.btn-view-all { display: inline-flex; align-items: center; gap: 5px; padding: 7px 16px; border-radius: var(--radius-sm); font-size: .83rem; font-weight: 600; border: 1px solid var(--border); color: var(--text-muted); transition: all var(--transition); }
.btn-view-all:hover { border-color: var(--primary); color: var(--text); }
.related-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }
.related-tool-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column; gap: 8px; transition: all var(--transition); }
.related-tool-card:hover { border-color: rgba(var(--primary-rgb),.4); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.related-tool-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.related-tool-icon svg { width: 18px; height: 18px; color: #fff; }
.related-tool-name { font-size: .9rem; font-weight: 700; }
.related-tool-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.related-tool-link { font-size: .8rem; font-weight: 600; color: var(--primary); }
.blog-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px; }
.blog-card-sm { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; gap: 8px; transition: all var(--transition); }
.blog-card-sm:hover { border-color: rgba(var(--primary-rgb),.4); transform: translateY(-2px); }
.blog-cat-badge { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; width: fit-content; }
.blog-card-title { font-size: .93rem; font-weight: 700; line-height: 1.4; }
.blog-card-excerpt { font-size: .82rem; color: var(--text-muted); line-height: 1.6; flex: 1; }
.blog-card-meta { font-size: .75rem; color: var(--text-faint); }
.blog-read-link { font-size: .8rem; font-weight: 600; color: var(--primary); }

/* ── Report modal ────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 28px; width: 100%; max-width: 440px; }
.modal-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 16px; }
.modal-textarea { width: 100%; min-height: 100px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); padding: 12px; font-size: .9rem; resize: vertical; outline: none; }
.modal-textarea:focus { border-color: rgba(var(--primary-rgb),.5); }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }

/* ── Toast ───────────────────────────────────────────────── */
.toast { position: fixed; bottom: 28px; right: 28px; background: var(--bg-card); border: 1px solid rgba(var(--primary-rgb),.3); border-radius: var(--radius-md); padding: 12px 20px; font-size: .88rem; font-weight: 600; color: var(--text); box-shadow: 0 8px 32px rgba(0,0,0,.4); transform: translateY(80px); opacity: 0; transition: all .35s cubic-bezier(.4,0,.2,1); pointer-events: none; z-index: 500; display: flex; align-items: center; gap: 8px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb { padding: 14px 0 0; }
.breadcrumb-list { display: flex; align-items: center; gap: 6px; list-style: none; font-size: .8rem; color: var(--text-faint); flex-wrap: wrap; }
.breadcrumb-list a { color: var(--text-muted); }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { background: var(--bg-surface); border-top: 1px solid var(--border); padding: clamp(32px,5vw,56px) 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand-text { font-size: .88rem; color: var(--text-muted); line-height: 1.7; margin: 12px 0 0; max-width: 260px; }
.footer-heading { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: .88rem; color: var(--text-muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 12px; font-size: .82rem; color: var(--text-faint); }

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .related-tools-grid { grid-template-columns: 1fr 1fr; }
  .blog-cards-grid { grid-template-columns: 1fr; }
  .tip-presets { grid-template-columns: repeat(3,1fr); }
  .per-person-grid { grid-template-columns: 1fr 1fr; }
  .big-amounts { grid-template-columns: 1fr; }
}
