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

body {
  background: #f3f4f6;
  color: #111827;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.nav { margin-bottom: 20px; }
.nav a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.nav a:hover { color: #111827; }

.header { margin-bottom: 28px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e5f2ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.logo-wordmark { font-weight: 700; letter-spacing: -0.06em; }

h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.subtitle { color: #6b7280; font-size: 0.95rem; max-width: 560px; }

.ad-banner-top { margin-bottom: 24px; min-height: 20px; }

/* Main card */
.counter-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(15,23,42,0.04);
  margin-bottom: 16px;
}

/* Textarea */
.textarea-wrap { position: relative; }

.main-textarea {
  width: 100%;
  min-height: 200px;
  padding: 14px;
  padding-right: 70px;
  resize: vertical;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #111827;
  background: #f9fafb;
  line-height: 1.6;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.main-textarea:focus {
  outline: none;
  border-color: #1d4ed8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(29,78,216,0.1);
}

.main-textarea::placeholder { color: #9ca3af; }

.btn-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-family: inherit;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s;
}

.btn-clear:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  transition: border-color 0.15s;
}

.stat-card:hover { border-color: #d1d5db; }

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #111827;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 3px;
  line-height: 1.3;
}

/* Keywords */
.keywords-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

.keywords-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 10px;
}

.keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.keyword-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f4ff;
  border: 1px solid #dbeafe;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
}

.keyword-count {
  background: #1d4ed8;
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 600;
}

.keywords-empty {
  font-size: 0.875rem;
  color: #9ca3af;
}

/* FAQ */
.faq { margin-top: 40px; }
.faq-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.faq-question {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  user-select: none;
  color: #111827;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after { content: '+'; color: #6b7280; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
details[open] > .faq-question::after { content: '−'; }
.faq-answer {
  padding: 12px 16px 14px;
  border-top: 1px solid #f3f4f6;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.6;
}
.faq-answer p { margin-bottom: 8px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer code {
  font-family: 'Courier New', monospace;
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.85em;
}

/* Related tools */
.related-tools { margin-top: 32px; }
.related-title { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.related-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s;
}
.related-card:hover { border-color: #1d4ed8; }
.related-name { font-size: 0.875rem; font-weight: 500; color: #111827; }
.related-desc { font-size: 0.78rem; color: #6b7280; }

/* Bottom ad + footer */
.ad-banner-bottom { text-align: center; padding: 24px 0 0; overflow: hidden; }

.footer {
  margin-top: 32px;
  text-align: center;
  font-size: 0.78rem;
  color: #9ca3af;
}
.footer a { color: #6b7280; text-decoration: none; }
.footer a:hover { color: #111827; }

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .page { padding: 16px 16px 60px; }
  .counter-card { padding: 16px; }
}
