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

:root {
  --bg: #0b0b10;
  --surface: #14141e;
  --border: #252535;
  --accent: #84cc16;
  --accent-hover: #65a30d;
  --text: #e8e8f0;
  --muted: #7878a0;
  --radius: 14px;
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.65; }
a { color: inherit; text-decoration: none; }

/* Navbar */
.navbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; height: 60px; background: rgba(11,11,16,0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-logo { font-size: 1.15rem; font-weight: 800; }
.nav-logo span { color: var(--accent); }

/* Hero */
.hero { padding: 100px 20px 80px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -200px; left: 50%; transform: translateX(-50%); width: 800px; height: 600px; background: radial-gradient(ellipse, rgba(132,204,22,0.1) 0%, transparent 70%); pointer-events: none; }
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.hero-badge { display: inline-block; background: rgba(132,204,22,0.12); border: 1px solid rgba(132,204,22,0.3); color: #a3e635; font-size: 0.8rem; font-weight: 600; padding: 4px 14px; border-radius: 20px; margin-bottom: 24px; letter-spacing: 0.04em; text-transform: uppercase; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 20px; }
.gradient-text { background: linear-gradient(135deg, #84cc16, #a3e635); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 580px; margin: 0 auto 32px; }
.hero-sub strong { color: var(--text); }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 48px; }
.hero-note { font-size: 0.8rem; color: var(--muted); }
.hero-stats { display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 32px; flex-wrap: wrap; gap: 8px; }
.hstat { display: flex; flex-direction: column; align-items: center; padding: 0 24px; }
.hstat strong { font-size: 1.5rem; font-weight: 800; background: linear-gradient(135deg, #84cc16, #a3e635); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hstat span { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.hstat-div { width: 1px; height: 36px; background: var(--border); }

/* Sections */
.section-inner { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.section-inner--wide { max-width: 1200px; }
.section-inner--narrow { max-width: 720px; }
.section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; text-align: center; margin-bottom: 48px; letter-spacing: -0.02em; }
.tool-section { padding: 80px 20px; border-top: 1px solid var(--border); background: var(--surface); }

/* Mode bar */
.mode-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.mode-btn { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; color: var(--muted); font-size: 0.9rem; font-weight: 600; padding: 9px 22px; cursor: pointer; transition: all 0.15s; }
.mode-btn:hover { color: var(--text); border-color: var(--accent); }
.mode-btn.active { background: var(--accent); color: #0b0b10; border-color: var(--accent); }

/* Panels */
.panels { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; margin-bottom: 16px; }
.panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.panel-mid { display: flex; align-items: center; justify-content: center; padding-top: 52px; }
.swap-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 50%; width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; color: var(--muted); transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.swap-btn:hover { color: var(--accent); border-color: var(--accent); }

.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.panel-actions { display: flex; gap: 8px; }
.panel-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; color: var(--muted); font-size: 0.8rem; font-weight: 600; padding: 5px 12px; cursor: pointer; transition: all 0.15s; }
.panel-btn:hover { color: var(--text); border-color: var(--accent); }

.panel-textarea { flex: 1; min-height: 360px; background: transparent; border: none; color: var(--text); font-size: 0.9rem; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; line-height: 1.7; padding: 18px; resize: none; }
.panel-textarea:focus { outline: none; }
.panel-textarea::placeholder { color: var(--muted); font-family: inherit; }

.panel-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-top: 1px solid var(--border); }
.char-count { font-size: 0.78rem; color: var(--muted); }
.error-msg { font-size: 0.78rem; color: #f87171; font-weight: 600; }

/* Options */
.options-row { display: flex; flex-wrap: wrap; gap: 20px; padding: 14px 0; margin-bottom: 28px; }
.opt-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.88rem; color: var(--muted); user-select: none; }
.opt-toggle input { display: none; }
.toggle-track { width: 36px; height: 20px; background: var(--border); border-radius: 20px; position: relative; flex-shrink: 0; transition: background 0.2s; }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--muted); border-radius: 50%; transition: left 0.2s, background 0.2s; }
.opt-toggle input:checked + .toggle-track { background: var(--accent); }
.opt-toggle input:checked + .toggle-track .toggle-thumb { left: 19px; background: #0b0b10; }
.opt-hint { font-size: 0.78rem; color: var(--muted); opacity: 0.7; }

/* File section */
.file-section { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.file-header { padding: 14px 20px; font-size: 0.85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); background: var(--bg); }
.file-drop { padding: 40px 20px; text-align: center; background: var(--bg); transition: background 0.15s; border-bottom: 1px solid var(--border); }
.file-drop.drag-over { background: rgba(132,204,22,0.07); border-color: var(--accent); }
.file-drop-icon { font-size: 2rem; margin-bottom: 10px; }
.file-drop-text { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.file-drop-sub { font-size: 0.85rem; color: var(--muted); }
.file-label { color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.file-label:hover { color: var(--accent-hover); }

.file-result { background: var(--bg); }
.file-result-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.file-result-header span { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.file-output { min-height: 160px; max-height: 260px; }

/* FAQ */
.faq-section { padding: 80px 20px; border-top: 1px solid var(--border); }
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.faq-item summary { padding: 18px 20px; font-weight: 600; font-size: 0.95rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--accent); transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 20px 18px; font-size: 0.9rem; color: var(--muted); line-height: 1.7; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 9px; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; transition: background 0.15s, transform 0.1s; white-space: nowrap; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #0b0b10; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* Toast */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1e1e2e; border: 1px solid var(--border); color: var(--text); font-size: 0.88rem; font-weight: 500; padding: 10px 20px; border-radius: 30px; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { max-width: 1000px; margin: 0 auto; padding: 60px 20px 40px; display: flex; gap: 60px; flex-wrap: wrap; }
.footer-brand { flex: 2; min-width: 220px; }
.footer-brand p { color: var(--muted); font-size: 0.88rem; margin-top: 10px; line-height: 1.7; }
.footer-home-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 0.85rem; font-weight: 600; color: var(--accent); border: 1px solid var(--border); padding: 7px 14px; border-radius: 8px; transition: background 0.15s, border-color 0.15s; }
.footer-home-link:hover { background: var(--surface); border-color: var(--accent); color: var(--text); }
.footer-links { flex: 1; min-width: 120px; }
.footer-links h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 14px; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 0.88rem; color: var(--muted); transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); text-align: center; padding: 20px; font-size: 0.8rem; color: var(--muted); }
.footer-bottom a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; transition: color 0.15s; }
.footer-bottom a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 860px) {
  .panels { grid-template-columns: 1fr; }
  .panel-mid { padding-top: 0; }
  .swap-btn { transform: rotate(90deg); }
  .panel-textarea { min-height: 220px; }
}
@media (max-width: 600px) {
  .navbar { padding: 0 20px; }
  .hero { padding: 70px 16px 60px; }
  .hstat-div { display: none; }
  .footer-inner { gap: 32px; }
}
