﻿:root {
  --bg: #f3f6fb;
  --surface: rgba(255, 255, 255, 0.92);
  --text: #152238;
  --muted: #5c6b82;
  --accent: #0f766e;
  --accent-dark: #0a5a54;
  --border: #dce5f2;
  --shadow: 0 12px 30px rgba(21, 34, 56, 0.08);
  --result-bg: #edf7f5;
  --result-text: #0d4a45;
  --topbar-bg: rgba(243, 246, 251, 0.84);
}

body[data-theme="dark"] {
  --bg: #0b1220;
  --surface: rgba(17, 25, 40, 0.9);
  --text: #e2e8f0;
  --muted: #9aa8be;
  --accent: #2dd4bf;
  --accent-dark: #14b8a6;
  --border: #243247;
  --shadow: 0 10px 30px rgba(1, 4, 9, 0.45);
  --result-bg: #11211f;
  --result-text: #8ce2d8;
  --topbar-bg: rgba(11, 18, 32, 0.84);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg) 48%), var(--bg);
}

.container { width: min(1140px, 92%); margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(10px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem 0; }
.brand { font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.header-search input[type="search"] {
  width: 210px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text);
  padding: 0 0.75rem;
  font-size: 0.9rem;
}
.header-search input[type="search"]::placeholder { color: var(--muted); }
.nav-right nav { display: flex; align-items: center; gap: 1rem; }
nav a { text-decoration: none; color: var(--muted); margin-left: 0; font-weight: 600; white-space: nowrap; }
nav a {
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
nav a.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
a, a:link, a:visited { color: var(--accent); }
a:hover, a:active { color: var(--accent-dark); }
a:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 45%, #ffffff); outline-offset: 2px; border-radius: 4px; }
.tool-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #178680);
  margin-top: auto;
}
.tool-link:link,
.tool-link:visited,
.tool-link:hover,
.tool-link:active { color: #fff; }

.theme-switch { border: 0; background: transparent; padding: 0; cursor: pointer; }
.theme-switch__track {
  width: 58px; height: 30px; border-radius: 999px; position: relative;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 90%, transparent);
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
}
.theme-switch__icon { font-size: 0.72rem; color: var(--muted); z-index: 1; }
.theme-switch__thumb {
  width: 24px; height: 24px; border-radius: 50%; background: #ffffff;
  position: absolute; left: 2px; top: 2px; box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transition: transform 0.22s ease;
}
body[data-theme="dark"] .theme-switch__thumb { transform: translateX(28px); background: #0f172a; border: 1px solid #243247; }

.hero { padding: 3.8rem 0 2.2rem; }
.hero-inner { display: grid; grid-template-columns: 1.2fr minmax(280px, 360px); gap: 1rem; align-items: start; }
.eyebrow { color: var(--accent); font-weight: 700; margin: 0; }
h1 { margin: 0.35rem 0; font-size: clamp(1.6rem, 2.8vw, 2.25rem); line-height: 1.18; max-width: 18ch; }
.subtitle { margin: 0; color: var(--muted); max-width: 660px; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1rem; }
.hero-pills span {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 0.35rem 0.68rem; font-size: 0.82rem; color: var(--muted);
}
.hero-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.hero-panel h3 { margin: 0 0 0.4rem; }
.hero-panel p { margin: 0; color: var(--muted); }
.hero-calculator {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0.9rem;
}
.hero-calculator__eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.hero-calculator__display {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: right;
  padding: 0 0.7rem;
  margin-bottom: 0.6rem;
}
.hero-calculator__keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}
.hero-calculator__keys button {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  border-radius: 9px;
  font-size: 0.95rem;
}
.hero-calculator__keys .wide {
  grid-column: span 2;
}
.hero-calculator__keys .accent {
  background: linear-gradient(135deg, var(--accent), #178680);
  color: #fff;
}

.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; padding-bottom: 2.2rem; }
.tool-directory {
  margin-top: -0.6rem;
  margin-bottom: 1.7rem;
}
.tool-directory--top { margin-top: 0; }
.tool-directory--page {
  margin-top: 1rem;
  margin-bottom: 0;
}
.tool-directory details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.7rem 0.9rem;
}
.tool-directory summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  list-style: none;
}
.tool-directory summary::-webkit-details-marker { display: none; }
.tool-directory summary::after { content: " +"; color: var(--accent); }
.tool-directory details[open] summary::after { content: " -"; }
.tool-directory ul { margin: 0.65rem 0 0; padding-left: 1rem; columns: 2; column-gap: 1.2rem; }
.tool-directory li { break-inside: avoid; margin: 0 0 0.35rem; }
.tool-directory-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.tool-directory-col {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 0.7rem 0.8rem;
}
.tool-directory-col ul {
  margin: 0.4rem 0 0;
  padding-left: 1rem;
  columns: 1;
}
.tool-directory-col li { margin: 0 0 0.28rem; }
.tool-directory__category {
  margin: 0;
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 1.15rem; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card h2 { margin: 0; font-size: 1.07rem; display: flex; align-items: center; gap: 0.42rem; }
.card p { margin: 0.42rem 0 0.9rem; color: var(--muted); }
.tools-grid .card p { min-height: 44px; }

.tool-form { display: grid; gap: 0.7rem; flex: 1; align-content: start; }
.tool-form--short .field-spacer { height: 74px; }
label { display: grid; gap: 0.35rem; color: var(--text); font-size: 0.92rem; font-weight: 600; }
input, select, button { font: inherit; border-radius: 10px; }
input, select {
  border: 1px solid var(--border); background: #fff; color: #152238; padding: 0.63rem 0.7rem;
}
body[data-theme="dark"] input, body[data-theme="dark"] select { background: #0f172a; color: #d6deea; }
.output { font-weight: 700; }

button {
  border: 0; height: 44px; min-height: 44px; max-height: 44px; width: 100%;
  padding: 0 1rem; white-space: nowrap; line-height: 1;
  font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), #178680);
}
button:hover { background: linear-gradient(135deg, var(--accent-dark), #116f69); }

.result {
  margin-top: 0.9rem; min-height: 48px; display: flex; align-items: center;
  padding: 0.72rem; border-radius: 10px; background: var(--result-bg); color: var(--result-text); font-weight: 600;
}

.trust-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem;
  padding: 0 0 2rem;
}
.seo-clusters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  padding: 0 0 1.8rem;
}
.cluster-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.95rem 1rem;
}
.cluster-card h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.cluster-card p { margin: 0 0 0.6rem; color: var(--muted); }
.cluster-card ul { margin: 0; padding-left: 1rem; }
.cluster-card li { margin: 0 0 0.3rem; }
.trust-grid article {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  padding: 0.95rem 1rem;
}
.trust-grid h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.trust-grid p { margin: 0; color: var(--muted); }

.faq { padding: 0 0 2.6rem; }
.faq h3 { margin: 0 0 0.7rem; }
.tool-notes {
  margin: 0.95rem 0 0.9rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
}
.tool-notes h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.tool-notes p {
  margin: 0.32rem 0;
  color: var(--muted);
}
.report-issue a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.copy-result-btn {
  margin-top: 0.55rem;
  width: auto;
  min-width: 132px;
  height: 36px;
  padding: 0 0.75rem;
  border-radius: 9px;
}
.ad-slot {
  margin: 0.85rem 0;
}
.ad-slot__label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ad-slot__box {
  min-height: 92px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.88rem;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}
.ad-slot--top .ad-slot__box {
  min-height: 110px;
}
.ad-slot--bottom .ad-slot__box {
  min-height: 96px;
}
.faq p {
  margin: 0.5rem 0;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}
.footer { border-top: 1px solid var(--border); padding: 1.2rem 0; color: var(--muted); }
.footer-links a { color: var(--muted); text-decoration: none; margin-right: 0.55rem; }
.cookie-banner {
  display: none !important;
  position: fixed;
  left: 1rem;
  right: 1rem;
  top: 1rem;
  bottom: auto;
  background: var(--panel, #ffffff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  z-index: 2147483647;
  pointer-events: auto;
}
.cookie-banner p { margin: 0; color: var(--muted); }
.cookie-banner button {
  width: auto;
  min-width: 90px;
  height: 38px;
  cursor: pointer;
  position: relative;
  z-index: 2147483647;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  gap: 1rem;
  padding-bottom: 2rem;
}

.tool-main-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.tool-main-card h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin: 0.2rem 0 0.5rem;
}

.tool-main-card p {
  color: var(--muted);
}
.scientific-calc {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-radius: 14px;
  padding: 0.85rem;
}
.scientific-display {
  width: 100%;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: right;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0 0.7rem;
  margin-bottom: 0.6rem;
}
.scientific-keys {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}
.scientific-keys button {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  border-radius: 9px;
  font-size: 0.88rem;
}
.scientific-keys .accent {
  background: linear-gradient(135deg, var(--accent), #178680);
}
.related-tools ul {
  margin: 0;
  padding-left: 1.15rem;
  list-style-position: outside;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem 0.9rem;
}
.related-tools li {
  min-width: 0;
  padding-right: 0.2rem;
  display: list-item;
  line-height: 1.35;
}
.related-tools a {
  display: inline;
  line-height: 1.35;
  overflow-wrap: normal;
  word-break: normal;
  padding: 0;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.18s ease;
}
.related-tools a:hover {
  color: var(--accent-dark);
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 620px) {
  .nav {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand switch"
      "search search"
      "links links";
    align-items: center;
    gap: 0.5rem 0.65rem;
  }
  .brand { grid-area: brand; }
  .nav-right { display: contents; }
  .header-search {
    grid-area: search;
  }
  .header-search input[type="search"] {
    width: 100%;
    max-width: none;
    height: 34px;
    font-size: 0.84rem;
  }
  #theme-toggle { grid-area: switch; justify-self: end; }
  .nav-right nav {
    grid-area: links;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
  }
  nav a {
    margin-left: 0;
    font-size: 0.83rem;
    white-space: nowrap;
  }
  .hero { padding-top: 2.7rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-pills { gap: 0.45rem; }
  .hero-pills span { font-size: 0.78rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-directory ul { columns: 1; }
  .tool-directory-grid { grid-template-columns: 1fr; }
  .related-tools ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scientific-keys { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-grid article { padding: 0.9rem; }
  .faq { padding-bottom: 2rem; }
  .faq p { font-size: 0.95rem; line-height: 1.5; }
}

@media (max-width: 480px) {
  .container { width: min(1140px, 94%); }
  .brand { font-size: 1.08rem; }
  .nav-right nav { gap: 0.45rem; }
  .hero { padding: 2.4rem 0 1.6rem; }
  h1 { line-height: 1.15; }
  .subtitle { font-size: 0.96rem; line-height: 1.55; }
  .card, .hero-panel, .trust-grid article, .faq p { border-radius: 14px; }
  .related-tools ul { grid-template-columns: 1fr; }
  .scientific-keys { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .brand { font-size: 1rem; }
  nav a { font-size: 0.78rem; }
  .theme-switch__track { width: 54px; }
  .hero-pills span { font-size: 0.74rem; padding: 0.3rem 0.56rem; }
}

