:root {
  --bg: #09090b;
  --bg-elevated: #0c0c0e;
  --surface: #131316;
  --surface-hover: #1a1a1f;
  --border: #232329;
  --border-strong: #3f3f46;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-border: rgba(56, 189, 248, 0.28);
  --success: #34d399;
  --error: #f87171;
  --kofi: #ff5e5b;
  --radius: 10px;
  --radius-lg: 14px;
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 3px; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding: 0 28px; }

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-mark {
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 7px;
  display: grid;
  place-items: center;
}
.logo-mark svg { width: 13px; height: 13px; color: #09090b; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  padding: 6px 11px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover, .nav a.active { color: var(--text); background: rgba(255,255,255,0.04); }

.btn-kofi {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: var(--kofi);
  border-radius: 8px;
  margin-left: 6px;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-kofi:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-kofi svg { width: 14px; height: 14px; }

.menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  color: var(--text-muted);
}
.menu-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  padding: 8px 20px 14px;
  background: var(--bg-elevated);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 11px 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { color: var(--text); }
.mobile-nav .btn-kofi {
  margin: 10px 0 0;
  width: 100%;
  justify-content: center;
  padding: 10px;
}

.hero {
  padding: 56px 0 40px;
  text-align: center;
}
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.hero-status-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}
.hero h1 {
  font-size: clamp(1.85rem, 4.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 12px;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-lead {
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.55;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: left;
  max-width: 560px;
  margin: 0 auto;
}
.field { position: relative; margin-bottom: 10px; }
.field input {
  width: 100%;
  padding: 13px 40px 13px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--text-faint);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.field-clear.show { opacity: 1; pointer-events: auto; }
.field-clear:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.row-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #09090b;
}
.btn-primary:hover:not(:disabled) { background: #7dd3fc; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 12px 14px;
}
.btn-secondary:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  color: var(--text-faint);
  cursor: pointer;
  user-select: none;
}
.toggle:hover { color: var(--text-muted); }
.toggle-track {
  width: 34px;
  height: 18px;
  background: #3f3f46;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
#autoOpen:checked + .toggle-track { background: var(--accent); }
#autoOpen:checked + .toggle-track::after { transform: translateX(16px); }
#autoOpen { display: none; }
.link-quiet {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-faint);
  transition: color 0.15s;
}
.link-quiet:hover { color: var(--accent); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 40px 0;
}
.stat {
  background: var(--surface);
  padding: 20px 12px;
  text-align: center;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-weight: 500;
}

.section { padding: 8px 0 40px; }
.section-head { margin-bottom: 20px; }
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feature {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
}
.feature-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  min-width: 24px;
  padding-top: 2px;
}
.feature h3 { font-size: 0.92rem; font-weight: 600; margin-bottom: 3px; }
.feature p { font-size: 0.84rem; color: var(--text-muted); line-height: 1.5; }

.support-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
}
.support-banner h2 {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.support-banner p { font-size: 0.88rem; color: var(--text-muted); }

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a {
  font-size: 0.78rem;
  color: var(--text-faint);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text-muted); }
.footer-copy { font-size: 0.78rem; color: var(--text-faint); }

.page-hero {
  padding: 44px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.page-hero h1 {
  font-size: clamp(1.5rem, 3.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.page-hero p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 560px;
}

.faq-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 48px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 550;
}
.faq-q:hover { background: rgba(255,255,255,0.015); }
.faq-q svg {
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: transform 0.25s, color 0.15s;
}
.faq-q.open svg { transform: rotate(45deg); color: var(--accent); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s;
}
.faq-a.open { max-height: 240px; opacity: 1; }
.faq-a-body {
  padding: 0 18px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.faq-a-body a { color: var(--accent); }
.faq-a-body a:hover { text-decoration: underline; }

.support-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 12px;
}
.support-group h3 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.support-group ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2px 14px;
}
.support-group li {
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 5px 0 5px 12px;
  position: relative;
}
.support-group li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.note {
  margin: 20px 0 40px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.note a { color: var(--accent); }

.legal h2 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 28px 0 10px;
  letter-spacing: -0.02em;
}
.legal h2:first-child { margin-top: 0; }
.legal h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 16px 0 8px;
}
.legal p, .legal li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 10px;
}
.legal ul { list-style: none; padding: 0; }
.legal ul li {
  padding-left: 16px;
  position: relative;
}
.legal ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}
.legal a { color: var(--accent); }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay.show { display: flex; }
.modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: scale(0.97) translateY(8px);
  opacity: 0;
  transition: all 0.22s ease;
}
.modal.show { transform: scale(1) translateY(0); opacity: 1; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-head-left { display: flex; align-items: center; gap: 10px; }
.modal-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.modal-icon.ok { background: rgba(52,211,153,0.15); color: var(--success); }
.modal-icon.err { background: rgba(248,113,113,0.15); color: var(--error); }
.modal-title { font-weight: 600; font-size: 0.9rem; }
.modal-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--text-faint);
}
.modal-close:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.modal-body { padding: 16px; }
.result-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
  max-height: 130px;
  overflow-y: auto;
  line-height: 1.5;
}
.modal-support {
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.5;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(255, 94, 91, 0.06);
  border: 1px solid rgba(255, 94, 91, 0.18);
  border-radius: 8px;
}
.modal-support a {
  color: var(--kofi);
  font-weight: 600;
}
.modal-support a:hover { text-decoration: underline; }
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.modal-actions .btn { padding: 10px 14px; font-size: 0.85rem; }
.modal-actions .btn-kofi-modal {
  grid-column: 1 / -1;
  background: var(--kofi);
  color: #fff;
  margin-top: 2px;
}
.modal-actions .btn-kofi-modal:hover { opacity: 0.92; }

.loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(9,9,11,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
}
.loading.show { display: flex; }
.spinner {
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }

.toasts {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 11px 15px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: #fff;
  animation: toastIn 0.2s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.toast.ok { background: #0d9488; }
.toast.err { background: #b91c1c; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 640px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .stats { grid-template-columns: 1fr 1fr; }
  .row-actions { grid-template-columns: 1fr; }
  .support-banner { flex-direction: column; text-align: center; }
  .support-group ul { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 32px; }
}
