:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-2: #155e75;
  --border: #dbe2ea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #f6f8fb 0%, #eef3f8 100%);
  color: var(--text);
}

.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.tool-header a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
}

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 18px;
}

.tool-card,
.related,
.ad-slot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.stack {
  display: grid;
  gap: 10px;
}

.advanced {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.92rem;
}

input,
select,
button {
  width: 100%;
  font: inherit;
  border-radius: 8px;
  padding: 10px 12px;
}

input,
select {
  border: 1px solid var(--border);
  background: #ffffff;
}

button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
}

button.secondary {
  width: auto;
  background: #ffffff;
  color: var(--accent);
}

button:disabled {
  opacity: 0.75;
  cursor: wait;
}

button:hover {
  filter: brightness(0.95);
}

.result h2 {
  margin: 12px 0 8px;
  font-size: 1rem;
}

.result-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-group {
  margin-bottom: 14px;
}

.result-group h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--accent-2);
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.word-list li {
  background: #ecfeff;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.92rem;
}

.score-list {
  margin: 0;
  padding-left: 18px;
}

.score-list li {
  margin: 0 0 6px;
}

.word-list a,
.score-list a {
  color: #1f2937;
  text-decoration: none;
  border-bottom: 1px dotted #9ca3af;
}

.word-list a:hover,
.score-list a:hover {
  border-bottom-color: #111827;
}

.result-more {
  margin-top: 8px;
}

.result-more-button {
  width: auto;
  max-width: 100%;
}

.related ul {
  margin: 0;
  padding-left: 18px;
}

.related li {
  margin: 0 0 6px;
}

.site-footer {
  text-align: center;
  padding: 18px 12px 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.site-footer .legal-links {
  margin-top: 6px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

@media (max-width: 680px) {
  .tool-header {
    padding: 12px;
  }

  main {
    padding: 12px;
  }

  .grid-2,
  .actions {
    grid-template-columns: 1fr;
  }

  button.secondary {
    width: 100%;
  }
}
