@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('/fonts/roboto-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url('/fonts/roboto-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url('/fonts/roboto-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: optional;
  src: url('/fonts/montserrat-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: optional;
  src: url('/fonts/montserrat-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 800;
  font-display: optional;
  src: url('/fonts/montserrat-800.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --bg-main: #0B0C0F;
  --bg-card: #121419;
  --bg-card-hover: #171A20;
  --bg-elevated: #1A1D23;
  --bg-input: #101216;

  --border-color: #23262D;
  --border-hover: #313640;
  --border-focus: #C4E230;

  --text-main: #E9EBEF;
  --text-muted: #A2A9B4;
  --text-dim: #6E7682;

  --accent-primary: #C4E230;
  --accent-primary-hover: #D2EE4C;
  --accent-soft: rgba(196, 226, 48, 0.12);
  --accent-border: rgba(196, 226, 48, 0.35);
  --accent-contrast: #10140A;
  --accent-rose: #F87171;
  --accent-amber: #FBBF24;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
}

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

html {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  line-height: 1.6;
  overflow-x: clip;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text-main);
}

.gradient-text {
  color: var(--text-main);
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #2A2E36;
  border-radius: 6px;
  border: 2px solid var(--bg-main);
}
::-webkit-scrollbar-thumb:hover {
  background: #3A404A;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }
}

.site-main {
  flex: 1;
  padding: 2.25rem 0 4.5rem;
}

.page-copy {
  width: min(100%, 840px);
  max-width: 840px;
  margin: 4rem auto 0;
}

.page-copy-directory {
  margin-top: 3.5rem;
}

.page-end {
  width: min(100%, 840px);
  max-width: 840px;
  margin: 2.5rem auto 0;
}

.page-end-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.directory-start {
  margin-bottom: 2.5rem;
}

.directory-group-title-first {
  margin-top: 0;
}

.not-found-content {
  max-width: 760px;
  margin: 0 auto;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.glass-card:hover {
  border-color: var(--border-hover);
}

.glass-nav {
  background: rgba(11, 12, 15, 0.9);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto auto;
  align-items: center;
  gap: 1.1rem;
  min-height: 78px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
}

.brand-copy {
  min-width: 0;
}

.brand-title {
  display: block;
  color: var(--text-main);
  font-family: 'Montserrat', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-subtitle {
  display: block;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.header-search-main {
  width: 190px;
  flex: none;
}

.header-search {
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-search-field {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  gap: 0.65rem;
  padding: 0 0.9rem;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-dim);
  cursor: text;
}

.header-search-field:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.header-search-field svg {
  flex: 0 0 16px;
}

.header-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 0.78rem;
}

.header-search input::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

.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-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 44px;
  padding: 0.55rem 0.78rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.header-link:hover,
.header-link.is-active {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.header-link.is-active {
  color: var(--accent-primary);
}

.nav-caret {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 0.7;
  transform: translateY(-1px);
}

.header-tools-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.15rem;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.header-tools-cta:hover {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-main);
  cursor: pointer;
}

.mobile-menu-drawer {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.mobile-menu-drawer:not([hidden]) {
  display: flex;
}

.mobile-menu-link {
  display: block;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.mobile-menu-link.is-active {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  color: var(--text-main);
}

@media (max-width: 1120px) {
  .header-inner {
    grid-template-columns: minmax(190px, 1fr) auto auto;
  }

  .desktop-nav {
    display: none;
  }

  .header-search-main {
    width: min(240px, 32vw);
  }

  .header-tools-cta {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }
}

@media (max-width: 560px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) minmax(120px, 1fr) auto;
    gap: 0.65rem;
  }

  .brand-subtitle {
    display: none;
  }

  .brand-title {
    font-size: 0.88rem;
  }

  .header-search-main {
    width: auto;
  }

  .header-search-field {
    min-height: 42px;
    padding-inline: 0.7rem;
  }

  .header-search-main input {
    font-size: 0.75rem;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.site-footer {
  margin-top: auto;
  padding: 3.5rem 0 2rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-main);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.footer-logo {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 7px;
}

.footer-brand-name {
  color: var(--text-main);
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-description {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-heading {
  margin-bottom: 1.2rem;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--text-main);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-copy-spaced {
  margin-bottom: 0.75rem;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-dim);
  font-size: 0.825rem;
  text-align: center;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--accent-contrast);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.prose {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 100%;
}

.prose > * + * {
  margin-top: 1.05rem;
}

.prose h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2.5rem;
  line-height: 1.3;
}

.prose h3 {
  font-size: 1.075rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 1.75rem;
}

.prose h2 + p,
.prose h3 + p {
  margin-top: 0.75rem;
}

.homepage-fit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.homepage-fit-card {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

.homepage-fit-card h3 {
  margin: 0 0 0.4rem;
  color: var(--text-main);
  font-size: 0.98rem;
}

.homepage-fit-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .homepage-fit-grid {
    grid-template-columns: 1fr;
  }
}

.prose > :first-child {
  margin-top: 0;
}

.tool-feature-image {
  width: 100%;
  margin: 2rem 0 2.25rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.tool-feature-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.guide-image {
  width: 100%;
  margin: 1.75rem 0 2rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.guide-image img {
  display: block;
  width: 100%;
  height: auto;
}

.guide-image figcaption {
  padding: 0.8rem 1rem 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.5;
}

.prose strong {
  color: var(--text-main);
  font-weight: 600;
}

.prose a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-border);
}

.prose a:hover {
  border-bottom-color: var(--accent-primary);
}

.prose ul,
.prose ol {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.prose li {
  position: relative;
  padding-left: 1.4rem;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.prose ol {
  counter-reset: prose-counter;
}

.prose ol > li {
  counter-increment: prose-counter;
  padding-left: 1.75rem;
}

.prose ol > li::before {
  content: counter(prose-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.875rem;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}

.prose blockquote {
  margin-top: 1.5rem;
  padding: 1.25rem 1.35rem;
  background: #1a1c20;
  border: 1px solid var(--accent-primary);
  border-radius: 1.35rem;
  color: var(--text-muted);
}

.prose blockquote strong {
  display: inline-block;
  margin-right: 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 0.55rem;
  background: var(--accent-primary);
  color: var(--accent-contrast);
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  text-transform: uppercase;
  line-height: 1.1;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.note-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
}

.note-card h3 {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 0.35rem 0;
}

.note-card p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.stat-strip .stat {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.25rem;
  text-align: center;
}

.stat-strip .stat-value {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-strip .stat-label {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.775rem;
  color: var(--text-dim);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 0.9rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.tool-card:hover {
  border-color: var(--accent-border);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.tool-card .tool-preview {
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--accent-primary);
  word-break: break-word;
}

.tool-card .tool-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.tool-card .tool-note {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.tool-card .tool-meta {
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.directory-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.directory-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}

.directory-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 11px 14px 11px 38px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.directory-search input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.directory-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.filter-pill {
  padding: 8px 15px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.filter-pill[aria-pressed='true'] {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.directory-group-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 2.25rem 0 0.9rem 0;
}

.directory-group-title h2,
.directory-group-title h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.directory-group-title span {
  font-size: 0.775rem;
  color: var(--text-dim);
}

.directory-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.directory-empty-title {
  margin-bottom: 0.35rem;
  color: var(--text-main);
  font-weight: 600;
}

.directory-empty-copy {
  font-size: 0.875rem;
}

.section-heading {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.page-hero {
  max-width: 760px;
  margin: 0 auto 2.5rem auto;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0.9rem 0 0.85rem 0;
}

.page-hero p {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.65;
}


.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.related-links a {
  display: inline-block;
  padding: 7px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 500;
  text-decoration: none;
}

.related-links a:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.related-panel {
  padding: 1.5rem;
}

.related-panel-wide {
  padding: 1.75rem;
}

.related-panel-heading {
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.related-panel-heading-large {
  margin-bottom: 0.4rem;
  font-size: 1.2rem;
}

.related-panel-intro {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.related-panel-intro-wide {
  max-width: 70ch;
  font-size: 0.9rem;
}

.tool-chips-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.tool-chips-heading {
  margin-bottom: 0.75rem;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tool-chips-all {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.tool-chips-all a {
  color: var(--accent-primary);
  text-decoration: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.18s ease-out forwards;
}

.spin-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

button {
  font-family: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto;
  }
}

.generator-card {
  padding: 1.75rem;
  margin-bottom: 2.5rem;
}

.generator-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.generator-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.generator-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.generator-heading {
  color: var(--text-main);
  font-size: 1.35rem;
  font-weight: 600;
}

.styler-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 640px) {
  .generator-card {
    padding: 1.25rem;
  }
  .generator-search-row {
    grid-template-columns: 1fr;
  }
  .generator-search-row > button {
    width: 100%;
    justify-content: center;
    padding: 13px 0 !important;
  }
  .generator-controls-grid {
    grid-template-columns: 1fr;
  }
  .generator-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .generator-header-row > div {
    width: 100%;
    justify-content: space-between;
  }
  .generator-header-row .filter-input-wrapper {
    width: 100% !important;
  }
}

.styler-label {
  display: block;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.styler-group-label {
  margin-top: 1.5rem;
}

.styler-input-wrap {
  position: relative;
}

.styler-input-wrap input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 14px 44px 14px 18px;
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.styler-input-wrap input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.styler-input-wrap button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
}

.styler-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.styler-pill {
  padding: 7px 15px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.styler-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.styler-pill[aria-pressed='true'] {
  border-color: var(--accent-primary);
  background: var(--accent-soft);
  color: var(--accent-primary);
}

.styler-filter {
  position: relative;
  width: 220px;
}

.styler-filter svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.styler-filter input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 7px 12px 7px 34px;
  font-size: 0.825rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
}

.styler-saved-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.styler-saved-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.styler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.15rem;
  min-height: 320px;
}

.styler-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.7rem;
  padding: 1.15rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: border-color 0.16s ease;
}

.styler-card:hover {
  border-color: var(--border-hover);
}

.styler-card-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.styler-card-name {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.styler-card-note {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.styler-output {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
  margin: 0;
  width: 100%;
}

.styler-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
}

.styler-copy {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 16px;
  border-radius: var(--radius-md);
  font-size: 0.775rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.styler-copy:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.styler-save {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}

.styler-save.is-saved {
  color: var(--accent-rose);
}

.styler-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.styler-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.styler-more {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 11px 22px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}

.styler-more:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.styler-more-left {
  color: var(--text-dim);
  font-weight: 500;
}

.styler-toast {
  position: fixed;
  bottom: 120px;
  right: 24px;
  z-index: 999999;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-primary);
  color: var(--text-main);
  padding: 16px 24px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 1.05rem;
}

.styler-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.styler-modal[hidden] {
  display: none;
}

.styler-modal-panel {
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.styler-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.styler-modal-head h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.styler-modal-head button {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-family: inherit;
}

.styler-saved-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.styler-saved-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 0;
}

.styler-saved-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.styler-saved-row span {
  flex: 1;
  color: var(--text-main);
  font-size: 0.95rem;
  word-break: break-word;
}

.styler-saved-row button {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: inherit;
  padding: 4px 10px;
  cursor: pointer;
}

.styler-modal-actions {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 1.15rem;
}

.styler-copy-all {
  flex: 1;
  background: var(--accent-primary);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-md);
  padding: 10px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.styler-clear-all {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--accent-rose);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.tool-card {
  text-align: center;
  align-items: center;
}

@media (max-width: 640px) {
  .styler-filter {
    width: 100%;
  }
  .styler-grid {
    grid-template-columns: 1fr;
  }
}

/* Headings that link to a category hub keep the heading colour. */
.directory-group-title a,
.related-panel-heading a,
.tool-chips-heading a {
  color: inherit;
  text-decoration: none;
}

.directory-group-title a:hover,
.related-panel-heading a:hover,
.tool-chips-heading a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.hub-tools {
  margin-top: 2.5rem;
}

/* FAQ */
  .faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.18s ease;
  }

  .faq-item[open] {
    border-color: var(--border-hover);
  }

  .faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.3rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    list-style: none;
    background: var(--bg-elevated);
  }

  .faq-item summary::-webkit-details-marker {
    display: none;
  }
  .faq-item summary::marker {
    content: '';
  }

  .faq-item summary:hover {
    color: var(--text-main);
  }

  .faq-item summary:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
  }

  .faq-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
  }

  .faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    color: var(--accent-primary);
  }

  .faq-answer {
    padding: 1rem 1.3rem 1.35rem 1.3rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.935rem;
    line-height: 1.75;
  }
/* Tool chips */
  .chip-current {
    display: inline-block;
    padding: 7px 13px;
    border-radius: var(--radius-md);
    border: 1px solid var(--accent-border);
    background: var(--accent-soft);
    color: var(--accent-primary);
    font-size: 0.825rem;
    font-weight: 600;
  }

/* Article tables */
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 0.65rem 0.9rem; border: 1px solid var(--border-color); text-align: left; vertical-align: top; }
.prose th { background: var(--bg-elevated); color: var(--text-main); font-weight: 600; white-space: nowrap; }
.prose td { color: var(--text-muted); }

.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; margin-bottom: 0.75rem; }
.footer-bottom { flex-direction: column; }
