:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c1f26;
  --text-muted: #5b6270;
  --border: #e2e5eb;
  --accent: #2f6feb;
  --accent-text: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 22, 30, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161c;
    --surface: #1c1f27;
    --text: #eceef2;
    --text-muted: #9aa1af;
    --border: #2b2f3a;
    --accent: #6ea1ff;
    --accent-text: #10131a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}
.site-header .brand:hover {
  text-decoration: none;
}

.site-header nav a {
  margin-left: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.lang-switch {
  display: flex;
  gap: 4px;
}
.lang-switch a {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.lang-switch a:hover {
  color: var(--text);
  text-decoration: none;
  border-color: var(--accent);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

h1 {
  font-size: 1.7rem;
  margin-bottom: 6px;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 28px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: block;
  color: var(--text);
}
.tool-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.tool-card h2 {
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.tool-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  max-width: 560px;
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.row {
  display: flex;
  gap: 12px;
}
.row .field {
  flex: 1;
}

button.primary {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover {
  opacity: 0.9;
}

.result {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.05rem;
}
.result .big {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.result .line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.ad-slot {
  margin: 28px 0;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

footer.site-footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
