:root {
  color-scheme: dark;
  --bg: #080b14;
  --bg-soft: #0d1324;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --text: #f5f7fb;
  --muted: #a8b0c2;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #8ef4ff;
  --accent-2: #b68cff;
  --danger-soft: rgba(255, 197, 109, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 28px;
  --max: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root.light {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-soft: #ffffff;
  --panel: rgba(10, 18, 34, 0.06);
  --panel-strong: rgba(10, 18, 34, 0.1);
  --text: #0a1020;
  --muted: #526070;
  --line: rgba(10, 18, 34, 0.12);
  --accent: #006d7a;
  --accent-2: #6b3fd6;
  --danger-soft: rgba(180, 110, 0, 0.12);
  --shadow: 0 24px 70px rgba(24, 35, 55, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(142, 244, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 90% 12%, rgba(182, 140, 255, 0.18), transparent 30rem),
    var(--bg);
  color: var(--text);
}

a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.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;
}

.site-header, main, .site-footer {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101d;
  box-shadow: var(--shadow);
}
.brand-text { font-size: 1.35rem; }
.top-actions { display: flex; gap: 10px; align-items: center; }

.ghost-button, .theme-toggle, .primary-button, .hero-search button, .filter-chip, .favorite-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel);
  border-radius: 999px;
  padding: 10px 14px;
}

.theme-toggle { width: 44px; height: 44px; }
.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101d;
  font-weight: 800;
}

.hero {
  padding: 76px 0 42px;
  max-width: 930px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  font-weight: 800;
}
.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}
.hero-copy {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
  max-width: 720px;
}

.hero-search {
  display: flex;
  gap: 10px;
  padding: 8px;
  margin: 34px 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(16px);
}
.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 12px 16px;
}
.hero-search button { background: var(--panel-strong); }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}
.hero-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel);
}
.hero-stats strong { color: var(--text); }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 20px 0;
  backdrop-filter: blur(18px);
}
.section-heading h2 {
  margin: 0 0 18px;
  font-size: clamp(1.7rem, 4vw, 3rem);
  letter-spacing: -0.05em;
}
.inline-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 42px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101d;
  font-weight: 800;
}

.custom-chip {
  border-color: rgba(142, 244, 255, 0.42);
}

.local-suggestion-tool {
  outline: 1px solid rgba(142, 244, 255, 0.18);
}

.local-badge {
  color: var(--accent);
}
.quick-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.quick-controls label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.quick-controls select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  color: var(--text);
  background: var(--bg-soft);
}
.checkbox-row {
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  padding: 12px;
}
.checkbox-row input { width: 18px; height: 18px; }
.warning-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) 1fr;
  gap: 20px;
  background: var(--danger-soft);
}
.warning-panel h2 { margin: 0; }
.warning-panel p:last-child { color: var(--muted); line-height: 1.55; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
}
.card-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.tool-card h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}
.favorite-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.1rem;
  color: var(--muted);
}
.favorite-button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101d;
  font-weight: 900;
}
.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.card-meta, .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge, .tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 0.82rem;
}
.badge.primary { color: var(--text); background: var(--panel-strong); }
.tool-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  border-radius: 16px;
  padding: 12px 14px;
  text-decoration: none;
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
}
.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.privacy-dialog {
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: var(--shadow);
}
.privacy-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.privacy-dialog form { padding: 24px; }
.privacy-dialog p { color: var(--muted); line-height: 1.55; }
.suggest-dialog label {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  color: var(--muted);
}
.suggest-dialog input, .suggest-dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  color: var(--text);
  background: var(--panel);
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}
.form-note {
  min-height: 1.4em;
  overflow-wrap: anywhere;
}
.site-footer {
  color: var(--muted);
  padding: 42px 0;
  text-align: center;
}

@media (max-width: 880px) {
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-controls, .warning-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .site-header, main, .site-footer { width: min(100% - 20px, var(--max)); }
  .hero { padding-top: 42px; }
  .hero-search { border-radius: 24px; flex-direction: column; }
  .tools-grid { grid-template-columns: 1fr; }
  .inline-heading { align-items: start; flex-direction: column; }
  .topbar { gap: 12px; align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .quick-controls, .warning-panel { grid-template-columns: 1fr; }
  .brand-text { font-size: 1.1rem; }
}


.saved-suggestions {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.suggestions-title-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.suggestions-title-row h3 {
  font-size: 1rem;
  margin: 0;
}

.saved-suggestions-list {
  display: grid;
  gap: 10px;
}

.saved-suggestion-card {
  align-items: start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 14px;
}

.saved-suggestion-card h4 {
  margin: 0 0 6px;
}

.saved-suggestion-card p {
  margin: 0 0 8px;
}

.saved-suggestion-card a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.danger-button {
  border-color: rgba(248, 113, 113, 0.45);
}

@media (max-width: 640px) {
  .saved-suggestion-card,
  .suggestions-title-row {
    grid-template-columns: 1fr;
  }

  .suggestions-title-row {
    align-items: stretch;
  }
}
