:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #18181f;
  --bg4: #20202a;
  --border: rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.10);
  --border3: rgba(255,255,255,0.18);
  --text: #eeedf2;
  --text2: #8b8a9e;
  --text3: #525166;
  --accent: #14d9c4;
  --accent2: #0fb8a6;
  --accent-glow: rgba(20,217,196,0.06);
  --accent-glow2: rgba(20,217,196,0.15);
  --red: #f25f6d;
  --green: #00d68f;
  --yellow: #f0c929;
  --orange: #f28a4e;
  --purple: #9b8aed;
  --font: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow: 0 2px 20px rgba(0,0,0,0.5);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: #000; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex; align-items: center; gap: 1.75rem;
  height: 56px;
}

.nav-brand {
  font-size: 1.05rem; font-weight: 700;
  color: var(--accent); text-decoration: none;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.nav-brand svg { width: 18px; height: 18px; }

.nav-links {
  display: flex; gap: 0.125rem;
  overflow-x: auto; flex: 1;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  color: var(--text2); text-decoration: none;
  font-size: 0.8rem; font-weight: 500;
  padding: 5px 10px; border-radius: 6px;
  white-space: nowrap;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--text); background: var(--bg3); }
.nav-links a.active { color: var(--accent); }

.nav-privacy {
  color: var(--text3); font-size: 0.75rem;
  text-decoration: none; flex-shrink: 0;
  padding: 5px 8px; border-radius: 6px;
  transition: all 0.15s;
}
.nav-privacy:hover { color: var(--accent); background: var(--accent-glow); }

.hero {
  text-align: center;
  padding: 6rem 2rem 3.5rem;
  max-width: 740px; margin: 0 auto;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute; top: -40%; left: 50%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(20,217,196,0.04) 0%, transparent 70%);
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-glow); border: 1px solid rgba(20,217,196,0.18);
  color: var(--accent); font-size: 0.72rem; font-weight: 600;
  padding: 5px 13px; border-radius: 100px;
  margin-bottom: 1.75rem; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hero-badge span {
  width: 5px; height: 5px; background: var(--accent);
  border-radius: 50%;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 700; line-height: 1.12;
  margin-bottom: 1.1rem;
  letter-spacing: -0.025em;
}
h1 em { color: var(--accent); font-style: normal; }

.hero-sub {
  color: var(--text2); font-size: 1.05rem;
  max-width: 520px; margin: 0 auto 1.75rem;
  line-height: 1.65;
}

.hero-features {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem 2rem;
  margin-bottom: 2rem;
}
.hero-feat {
  color: var(--text2); font-size: 0.82rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.hero-feat svg { width: 14px; height: 14px; flex-shrink: 0; }

.privacy-note {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green); font-size: 0.78rem; font-weight: 500;
  background: rgba(0,214,143,0.06);
  padding: 6px 14px; border-radius: 100px;
  border: 1px solid rgba(0,214,143,0.12);
}
.privacy-note svg { width: 13px; height: 13px; }

.ad-zone {
  background: var(--bg2); border: 1px dashed var(--border2);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); font-size: 0.7rem;
  font-family: var(--mono);
  margin: 2rem auto; max-width: 1100px;
  letter-spacing: 0.04em;
}
.ad-zone-leaderboard { height: 80px; }
.ad-zone-rect { height: 240px; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 2rem;
}
.section-icon {
  width: 36px; height: 36px;
  background: var(--accent-glow); border: 1px solid rgba(20,217,196,0.15);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
  color: var(--accent);
}
.section-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.015em; }
.section-desc { color: var(--text2); font-size: 0.85rem; margin-top: 1px; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.tool-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.tool-card:hover {
  border-color: var(--border3);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.tool-card h3 {
  font-size: 0.93rem; font-weight: 600;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.01em;
}
.tool-card h3 .icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}

label {
  display: block; font-size: 0.72rem; font-weight: 600;
  color: var(--text2); margin-bottom: 4px; letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
select, textarea, .tool-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 12px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow2);
}
input[type="range"] {
  width: 100%; accent-color: var(--accent); cursor: pointer; margin-bottom: 12px;
}
textarea { resize: vertical; min-height: 80px; font-family: var(--mono); font-size: 0.78rem; }
input[type="color"] { cursor: pointer; }
input[type="datetime-local"] { color-scheme: dark; }

.input-group { margin-bottom: 10px; }
.tool-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tool-name { font-size: 0.93rem; font-weight: 600; flex: 1; }
.tool-badge { font-size: 0.6rem; font-weight: 700; color: var(--accent); background: var(--accent-glow); padding: 2px 8px; border-radius: 4px; letter-spacing: 0.05em; text-transform: uppercase; }
.tool-body { }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.btn, .tool-btn {
  background: var(--accent);
  color: #08080c; font-family: var(--font);
  font-size: 0.82rem; font-weight: 700;
  border: none; border-radius: var(--radius);
  padding: 10px 16px; cursor: pointer;
  width: 100%; transition: all 0.15s;
  letter-spacing: 0.02em;
}
.btn:hover, .tool-btn:hover { background: var(--accent2); transform: translateY(-0.5px); box-shadow: 0 4px 16px rgba(20,217,196,0.2); }
.btn:active, .tool-btn:active { transform: translateY(0); }
.btn-secondary {
  background: var(--bg3);
  color: var(--text); border: 1px solid var(--border2);
}
.btn-secondary:hover { background: var(--bg4); border-color: var(--border3); box-shadow: none; transform: none; }

.result-box, .tool-result {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 0.8rem;
  margin-top: 12px;
  word-break: break-all;
  line-height: 1.7;
  min-height: 48px;
}
.result-wrap { position: relative; }
.result-wrap .share-btn {
  position: absolute; top: 4px; right: 4px; z-index: 2;
}
.result-box .key { color: var(--accent); }
.result-box .val { color: var(--text); }
.result-box .muted { color: var(--text3); }
.result-box .good { color: var(--green); }
.result-box .warn { color: var(--yellow); }
.result-box .bad { color: var(--red); }

.strength-bar {
  height: 3px; border-radius: 2px;
  background: var(--bg4); margin: 8px 0;
  overflow: hidden; position: relative;
}
.strength-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.35s ease, background 0.35s ease;
  width: 0%;
}

.perms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px; margin-bottom: 12px;
}
.perm-item {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 9px; cursor: pointer;
  transition: all 0.15s; font-size: 0.75rem;
  user-select: none;
}
.perm-item:hover { border-color: var(--border3); background: var(--bg4); }
.perm-item.active { border-color: rgba(20,217,196,0.3); background: var(--accent-glow); }
.perm-item input { display: none; }
.perm-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border2); flex-shrink: 0;
  transition: background 0.15s;
}
.perm-item.active .perm-dot { background: var(--accent); }
.perm-item .perm-label { flex: 1; }

.color-preview {
  width: 100%; height: 56px; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 10px;
  transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 1rem;
}

.meter { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text3); }

.ts-list { display: flex; flex-direction: column; gap: 3px; }
.ts-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px; font-size: 0.76rem;
}
.ts-label { color: var(--text2); font-size: 0.72rem; min-width: 120px; }
.ts-val { font-family: var(--mono); color: var(--accent); }

.faq { max-width: 700px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.15rem 0;
}
.faq-q {
  font-weight: 600; font-size: 0.93rem;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; transition: color 0.15s;
}
.faq-q:hover { color: var(--accent); }
.faq-q svg { flex-shrink: 0; transition: transform 0.25s; opacity: 0.4; }
.faq-item.open .faq-q svg { transform: rotate(180deg); }
.faq-a {
  color: var(--text2); font-size: 0.85rem; line-height: 1.7;
  margin-top: 0.7rem; display: none;
}
.faq-item.open .faq-a { display: block; }

footer {
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  color: var(--text3); font-size: 0.78rem;
}
footer a { color: var(--text2); text-decoration: none; margin: 0 0.5rem; transition: color 0.15s; }
footer a:hover { color: var(--accent); }
footer .footer-brand { color: var(--text); font-weight: 600; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 6px; }
.footer-links a { margin: 0; }
.footer-desc { color: var(--text3); font-size: 0.76rem; margin-bottom: 14px; }
.footer-copy { margin-top: 1.25rem; color: var(--text3); font-size: 0.7rem; }
.footer-mb10 { margin-bottom: 10px; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s;
}
.modal-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-xl); padding: 2rem;
  max-width: 600px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  animation: slideUp 0.2s;
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.modal h3 { font-size: 0.9rem; margin: 1.2rem 0 0.4rem; color: var(--accent); }
.modal p { color: var(--text2); font-size: 0.85rem; line-height: 1.7; margin-bottom: 0.5rem; }
.modal-close {
  float: right; background: none; border: none;
  color: var(--text3); font-size: 1.3rem; cursor: pointer;
  line-height: 1; padding: 2px 6px; border-radius: 4px;
  transition: all 0.15s;
}
.modal-close:hover { color: var(--text); background: var(--bg4); }

.badge-green {
  display: inline-block;
  background: rgba(0,214,143,0.10); color: var(--green);
  border: 1px solid rgba(0,214,143,0.20);
  font-size: 0.68rem; font-weight: 700; padding: 3px 8px;
  border-radius: 4px; letter-spacing: 0.04em;
}
.badge-yellow {
  background: rgba(240,201,41,0.10); color: var(--yellow);
  border: 1px solid rgba(240,201,41,0.20);
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
}

.json-output {
  white-space: pre-wrap; max-height: 280px; overflow-y: auto;
  font-size: 0.73rem;
}

.modal-footer { margin-top: 1.5rem; font-size: 0.78rem; color: var(--text3); }
.tax-disclaimer { font-size: 0.72rem; color: var(--text3); margin-top: 8px; }

.share-btn {
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text2); font-family: var(--font);
  padding: 8px 16px; border-radius: 6px; cursor: pointer;
  transition: all 0.15s; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem;
  line-height: 1;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.share-btn svg { width: 20px; height: 20px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); font-size: 0.85rem; font-weight: 500;
  padding: 10px 24px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  opacity: 0; transition: all 0.3s ease; z-index: 9999;
  pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast strong { color: var(--accent); }

.copy-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-size: 0.7rem; font-family: var(--font);
  padding: 2px 8px; border-radius: 5px; cursor: pointer;
  float: right; margin-top: -3px;
  transition: all 0.15s; font-weight: 500;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.tool-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.tool-link-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tool-link-card:hover {
  border-color: var(--border3);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.tool-link-icon {
  width: 36px; height: 36px;
  background: var(--accent-glow);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.tool-link-info h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 1px; letter-spacing: -0.01em; }
.tool-link-info p { font-size: 0.76rem; color: var(--text2); margin: 0; line-height: 1.4; }

@media (max-width: 768px) {
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-links { flex-wrap: wrap; gap: 0 8px; line-height: 2; }
  .ts-row { flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 0; }
  .ts-label { min-width: unset; }
  .modal { margin: 1rem; padding: 1.25rem; max-height: 85vh; }
  .perms-grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-links-grid { grid-template-columns: 1fr; }
  .hero-sub { font-size: 0.9rem; }
  .hero-features { gap: 0.75rem 1rem; }
  .hero-feat { font-size: 0.75rem; }
  .ad-zone-leaderboard { height: 60px; }
  .ad-zone-rect { height: 200px; }
  .result-box { font-size: 0.72rem; padding: 10px 10px; }
  .result-wrap .share-btn { top: 2px; right: 2px; }
  .color-preview { height: 42px; }
}

@media (max-width: 640px) {
  nav { padding: 0 0.5rem; gap: 0.5rem; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 5px 6px; font-size: 0.7rem; }
  .hero { padding: 3.5rem 1rem 2rem; }
  .section { padding: 2rem 0; }
  .container { padding: 0 1rem; }
  .tool-card { padding: 1rem; }
  .section-header { margin-bottom: 1.25rem; }
  .hero-badge { font-size: 0.65rem; padding: 4px 10px; }
  .privacy-note { font-size: 0.7rem; padding: 5px 10px; }
  h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  footer { padding: 1.5rem 1rem; }
  footer p { font-size: 0.7rem; }
  .tool-card h3 { font-size: 0.85rem; }
  input[type="text"], input[type="number"], select, textarea, .tool-input { font-size: 0.82rem; padding: 8px 10px; }
  .btn, .tool-btn { font-size: 0.78rem; padding: 9px 12px; }
  .section-title { font-size: 1.05rem; }
  .section-desc { font-size: 0.78rem; }
  .hero-features { gap: 0.5rem 0.75rem; }
  .share-btn { padding: 5px 10px; }
  .share-btn svg { width: 16px; height: 16px; }
  .toast { font-size: 0.78rem; padding: 8px 16px; white-space: normal; max-width: 90vw; text-align: center; }
}

@media (max-width: 480px) {
  .nav-links a { padding: 5px 4px; font-size: 0.65rem; }
  nav { padding: 0 0.25rem; gap: 0.25rem; }
  .nav-brand { font-size: 0.9rem; }
  .nav-brand svg { width: 15px; height: 15px; }
  .nav-privacy { font-size: 0.65rem; padding: 4px 5px; }
  footer p { font-size: 0.65rem; }
}
