:root {
  --qt-ink: #172033;
  --qt-muted: #5f6b7a;
  --qt-line: #dfe5ee;
  --qt-soft: #f5f7fb;
  --qt-surface: #ffffff;
  --qt-indigo: #4f46e5;
  --qt-indigo-dark: #3730a3;
  --qt-blue-soft: #eef2ff;
  --qt-green: #047857;
  --qt-green-soft: #ecfdf5;
  --qt-amber: #92400e;
  --qt-amber-soft: #fffbeb;
  --qt-radius: 16px;
  --qt-shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.qt-site {
  margin: 0;
  color: var(--qt-ink);
  background: var(--qt-soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

.qt-site a { color: inherit; }
.qt-site img { max-width: 100%; }
.qt-site button, .qt-site input, .qt-site select, .qt-site textarea { font: inherit; }

.qt-container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.qt-skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 100;
  transform: translateY(-180%);
  padding: .65rem 1rem;
  border-radius: 10px;
  background: var(--qt-ink);
  color: white;
  text-decoration: none;
}

.qt-skip-link:focus { transform: translateY(0); }

.qt-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 68px;
  border-bottom: 1px solid rgba(223, 229, 238, .92);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

.qt-header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.qt-brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--qt-ink);
  font-size: 1.08rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.qt-brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--qt-indigo);
  color: white;
  font-size: 1.05rem;
  box-shadow: 0 7px 18px rgba(79, 70, 229, .22);
}

.qt-nav { display: flex; align-items: center; gap: .2rem; }

.qt-nav a {
  padding: .55rem .68rem;
  border-radius: 9px;
  color: #4b5563;
  font-size: .88rem;
  font-weight: 650;
  text-decoration: none;
}

.qt-nav a:hover, .qt-nav a:focus-visible, .qt-nav a[aria-current="page"] {
  color: var(--qt-indigo-dark);
  background: var(--qt-blue-soft);
}

.qt-nav-actions { display: flex; align-items: center; gap: .45rem; }

.qt-nav-toggle, .qt-theme-toggle {
  width: 42px;
  height: 42px;
  display: none;
  place-items: center;
  border: 1px solid var(--qt-line);
  border-radius: 10px;
  background: white;
  color: var(--qt-ink);
  cursor: pointer;
}

.qt-theme-toggle { display: grid; }
.qt-theme-toggle svg { width: 21px; height: 21px; }
.qt-theme-toggle .hidden { display: none; }

.qt-main { min-height: 60vh; }

.qt-hero {
  padding: clamp(4.2rem, 9vw, 7.2rem) 0 clamp(3.5rem, 7vw, 5.4rem);
  background: linear-gradient(180deg, #fff 0%, #f7f8ff 100%);
  border-bottom: 1px solid var(--qt-line);
}

.qt-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.qt-eyebrow {
  margin: 0 0 .8rem;
  color: var(--qt-indigo-dark);
  font-size: .79rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.qt-hero h1, .qt-category-hero h1 {
  max-width: 820px;
  margin: 0;
  color: #111827;
  font-size: clamp(2.35rem, 6vw, 4.7rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.qt-lead {
  max-width: 720px;
  margin: 1.35rem 0 0;
  color: var(--qt-muted);
  font-size: clamp(1.03rem, 2vw, 1.2rem);
}

.qt-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.qt-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .72rem 1.08rem;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.qt-button-primary { background: var(--qt-indigo); color: white !important; }
.qt-button-primary:hover { background: var(--qt-indigo-dark); }
.qt-button-secondary { border-color: var(--qt-line); background: white; color: var(--qt-ink) !important; }
.qt-button-secondary:hover { border-color: #a5b4fc; background: var(--qt-blue-soft); }

.qt-hero-summary {
  padding: 1.45rem;
  border: 1px solid var(--qt-line);
  border-radius: var(--qt-radius);
  background: white;
  box-shadow: var(--qt-shadow);
}

.qt-check-list { margin: 0; padding: 0; list-style: none; }
.qt-check-list li { display: flex; gap: .7rem; padding: .6rem 0; color: #374151; }
.qt-check-list li::before { content: "\2713"; color: var(--qt-green); font-weight: 900; }

.qt-section { padding: clamp(3.2rem, 7vw, 5.4rem) 0; }
.qt-section-white { background: white; }
.qt-section-heading { max-width: 740px; margin-bottom: 1.8rem; }
.qt-section-heading h2 { margin: 0; font-size: clamp(1.75rem, 3.5vw, 2.55rem); line-height: 1.18; letter-spacing: -.025em; }
.qt-section-heading p { margin: .7rem 0 0; color: var(--qt-muted); }

.qt-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.qt-card-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.qt-card-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.qt-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.35rem;
  border: 1px solid var(--qt-line);
  border-radius: var(--qt-radius);
  background: var(--qt-surface);
  box-shadow: 0 6px 22px rgba(23, 32, 51, .045);
}

.qt-card:hover { border-color: #c7d2fe; box-shadow: 0 12px 30px rgba(23, 32, 51, .08); }
.qt-card h2, .qt-card h3 { margin: .45rem 0 .5rem; font-size: 1.12rem; line-height: 1.35; }
.qt-card p { margin: 0; color: var(--qt-muted); font-size: .94rem; }
.qt-card-link { margin-top: auto; padding-top: 1rem; color: var(--qt-indigo-dark) !important; font-weight: 750; text-decoration: none; }
.qt-card-link:hover { text-decoration: underline; }

.qt-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .58rem;
  border-radius: 999px;
  background: var(--qt-blue-soft);
  color: var(--qt-indigo-dark);
  font-size: .74rem;
  font-weight: 800;
}

.qt-badge-local { background: var(--qt-green-soft); color: var(--qt-green); }
.qt-badge-external { background: var(--qt-amber-soft); color: var(--qt-amber); }

.qt-workflow-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.qt-workflow {
  padding: 1.35rem;
  border-radius: var(--qt-radius);
  background: #18233a;
  color: white;
  text-decoration: none;
}
.qt-workflow:hover { background: #243252; }
.qt-workflow strong { display: block; margin-bottom: .45rem; font-size: 1.02rem; }
.qt-workflow span { color: #cbd5e1; font-size: .9rem; }

.qt-related-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 2.3rem);
  border: 1px solid #c7d2fe;
  border-radius: 20px;
  background: #f4f5ff;
}
.qt-related-product h2, .qt-related-product h3 { margin: 0 0 .55rem; color: #22245a; }
.qt-related-product p { margin: 0; color: #555d75; }
.qt-related-label { display: block; margin-bottom: .45rem; color: var(--qt-indigo-dark); font-size: .74rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }

.qt-trust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.qt-trust-item { padding: 1.2rem; border-left: 3px solid #a5b4fc; background: white; }
.qt-trust-item strong { display: block; margin-bottom: .25rem; }
.qt-trust-item span { color: var(--qt-muted); font-size: .91rem; }

.qt-category-hero { padding: 3.4rem 0 2.5rem; background: white; border-bottom: 1px solid var(--qt-line); }
.qt-category-hero h1 { font-size: clamp(2.15rem, 5vw, 3.65rem); }
.qt-breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.15rem; color: var(--qt-muted); font-size: .87rem; }
.qt-breadcrumbs a { color: var(--qt-indigo-dark); text-decoration: none; }
.qt-breadcrumbs a:hover { text-decoration: underline; }

.qt-prose { max-width: 820px; }
.qt-prose h2 { margin: 2.2rem 0 .65rem; font-size: 1.55rem; }
.qt-prose h3 { margin: 1.45rem 0 .45rem; font-size: 1.1rem; }
.qt-prose p, .qt-prose li { color: var(--qt-muted); }
.qt-prose a { color: var(--qt-indigo-dark); font-weight: 650; }

.qt-sequence { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; padding: 1rem 0; }
.qt-sequence a, .qt-sequence span { padding: .48rem .7rem; border-radius: 9px; background: white; border: 1px solid var(--qt-line); text-decoration: none; font-size: .9rem; }
.qt-sequence i { color: #94a3b8; font-style: normal; }

.qt-tool-breadcrumb { margin-bottom: 1rem; }
.qt-tool-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin: 1.2rem 0 1.5rem; }
.qt-tool-strip > div { padding: .8rem 1rem; border: 1px solid var(--qt-line); border-radius: 12px; background: #fafbff; }
.qt-tool-strip strong { display: block; color: var(--qt-ink); font-size: .88rem; }
.qt-tool-strip span { color: var(--qt-muted); font-size: .78rem; }

.qt-inline-cta { margin-top: 1.2rem; }
.qt-inline-cta[hidden] { display: none !important; }

/* Broad tool-directory homepage */
.qt-directory-hero {
  padding: clamp(4rem, 9vw, 6.6rem) 0 clamp(3.2rem, 7vw, 5rem);
  border-bottom: 1px solid var(--qt-line);
  background: linear-gradient(180deg, #fff 0%, #f7f8ff 100%);
  text-align: center;
}

.qt-directory-hero h1 {
  max-width: 840px;
  margin: 0 auto;
  color: #111827;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.qt-directory-hero .qt-lead { margin-inline: auto; }
.qt-directory-hero .qt-actions { justify-content: center; }

.qt-directory-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.qt-directory-jump a {
  display: inline-flex;
  padding: .45rem .7rem;
  border: 1px solid var(--qt-line);
  border-radius: 999px;
  background: white;
  color: #475569;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}

.qt-directory-jump a:hover { border-color: #a5b4fc; color: var(--qt-indigo-dark); }

.qt-tool-directory { scroll-margin-top: 84px; }
.qt-tool-section { padding: clamp(2.8rem, 6vw, 4.5rem) 0; }
.qt-tool-section + .qt-tool-section { border-top: 1px solid var(--qt-line); }
.qt-tool-section-white { background: white; }

.qt-tool-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.qt-tool-section-heading h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  letter-spacing: -.025em;
}

.qt-tool-section-heading p { max-width: 560px; margin: 0; color: var(--qt-muted); font-size: .92rem; }

.qt-directory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .9rem;
}

.qt-directory-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 250px;
  padding: 1.2rem;
  border: 1px solid var(--qt-line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 5px 18px rgba(23, 32, 51, .04);
}

.qt-directory-card:hover { border-color: #c7d2fe; box-shadow: 0 11px 28px rgba(23, 32, 51, .08); }
.qt-directory-card h3 { margin: .75rem 0 .45rem; color: #172033; font-size: 1.05rem; line-height: 1.35; }
.qt-directory-card p { margin: 0; color: var(--qt-muted); font-size: .88rem; line-height: 1.55; }
.qt-directory-card .qt-card-link { display: inline-flex; align-items: center; gap: .35rem; }

.qt-tool-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 850;
  letter-spacing: -.01em;
}
.qt-tool-icon-text { background: #fce7f3; color: #9d174d; }
.qt-tool-icon-image { background: #dcfce7; color: #166534; }
.qt-tool-icon-file { background: #ffedd5; color: #9a3412; }
.qt-tool-icon-utility { background: #e0e7ff; color: #3730a3; }

.qt-card-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }

.qt-guides-promo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.2rem);
  border: 1px solid #c7d2fe;
  border-radius: 18px;
  background: #f7f7ff;
}
.qt-guides-promo h2 { margin: 0 0 .45rem; color: #22245a; }
.qt-guides-promo p { margin: 0; max-width: 720px; color: #555d75; }

.qt-home-info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.qt-home-info-card { padding: 1.15rem; border-left: 3px solid #a5b4fc; background: white; }
.qt-home-info-card h3 { margin: 0 0 .35rem; font-size: 1rem; }
.qt-home-info-card p { margin: 0; color: var(--qt-muted); font-size: .88rem; }
.qt-home-info-card a { color: var(--qt-indigo-dark); font-weight: 750; }

.qt-home-faq { max-width: 850px; }
.qt-home-faq details { padding: 1rem 0; border-bottom: 1px solid var(--qt-line); }
.qt-home-faq summary { color: #172033; font-weight: 800; cursor: pointer; }
.qt-home-faq p { margin: .65rem 0 0; color: var(--qt-muted); }

.qt-games-dock {
  position: fixed;
  top: 50%;
  right: .7rem;
  z-index: 35;
  transform: translateY(-50%);
}
.qt-games-dock summary {
  padding: .7rem .55rem;
  border: 1px solid #c7d2fe;
  border-radius: 11px;
  background: white;
  color: var(--qt-indigo-dark);
  font-size: .76rem;
  font-weight: 850;
  writing-mode: vertical-rl;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(23, 32, 51, .1);
  list-style: none;
}
.qt-games-dock summary::-webkit-details-marker { display: none; }
.qt-games-panel {
  position: absolute;
  top: 50%;
  right: 2.65rem;
  width: 190px;
  display: grid;
  gap: .35rem;
  padding: .65rem;
  border: 1px solid var(--qt-line);
  border-radius: 12px;
  background: white;
  box-shadow: var(--qt-shadow);
  transform: translateY(-50%);
}
.qt-games-panel a {
  padding: .5rem .6rem;
  border-radius: 8px;
  color: #374151;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}
.qt-games-panel a:hover, .qt-games-panel a:focus-visible { background: var(--qt-blue-soft); color: var(--qt-indigo-dark); }

.qt-site-footer { min-height: 260px; margin-top: 4rem; border-top: 1px solid var(--qt-line); background: #111827; color: #d1d5db; }
.qt-footer-grid { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 2rem; padding: 3rem 0 2.3rem; }
.qt-footer-brand { color: white; font-weight: 800; }
.qt-footer-intro { max-width: 320px; margin: .7rem 0 0; color: #9ca3af; font-size: .9rem; }
.qt-footer-title { margin: 0 0 .75rem; color: white; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.qt-footer-links { display: grid; gap: .48rem; }
.qt-footer-links a { color: #cbd5e1; font-size: .88rem; text-decoration: none; }
.qt-footer-links a:hover { color: white; text-decoration: underline; }
.qt-footer-related { margin-top: .7rem; padding: .8rem; border: 1px solid #374151; border-radius: 10px; background: #182033; }
.qt-footer-related strong { color: white; }
.qt-footer-bottom { padding: 1rem 0 1.5rem; border-top: 1px solid #293548; color: #9ca3af; font-size: .82rem; }

.qt-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

:focus-visible { outline: 3px solid rgba(79, 70, 229, .4); outline-offset: 3px; }

.dark .qt-site-header { border-color: #334155; background: rgba(15, 23, 42, .96); }
.dark .qt-brand, .dark .qt-nav a { color: #e5e7eb; }
.dark .qt-nav a:hover, .dark .qt-nav a:focus-visible, .dark .qt-nav a[aria-current="page"] { background: #26324a; color: white; }
.dark .qt-nav-toggle, .dark .qt-theme-toggle { border-color: #475569; background: #1e293b; color: white; }
.dark .qt-tool-strip > div { border-color: #374151; background: #1f2937; }
.dark .qt-tool-strip strong { color: #f3f4f6; }
.dark .qt-tool-strip span { color: #cbd5e1; }
.dark .qt-directory-hero { border-color: #334155; background: #111827; }
.dark .qt-directory-hero h1, .dark .qt-tool-section-heading h2, .dark .qt-directory-card h3, .dark .qt-home-faq summary { color: #f8fafc; }
.dark .qt-directory-jump a, .dark .qt-directory-card, .dark .qt-home-info-card, .dark .qt-games-dock summary, .dark .qt-games-panel { border-color: #374151; background: #1f2937; }
.dark .qt-directory-card p, .dark .qt-home-info-card p, .dark .qt-home-faq p { color: #cbd5e1; }
.dark .qt-guides-promo { border-color: #4f46e5; background: #252650; }
.dark .qt-guides-promo h2 { color: #eef2ff; }
.dark .qt-guides-promo p { color: #c7d2fe; }
.dark .qt-related-product { border-color: #4f46e5; background: #252650; }
.dark .qt-related-product h2, .dark .qt-related-product h3 { color: #eef2ff; }
.dark .qt-related-product p, .dark .qt-related-label { color: #c7d2fe; }

@media (max-width: 900px) {
  .qt-nav-toggle { display: grid; }
  .qt-nav {
    position: absolute;
    top: 67px;
    left: 0;
    right: 0;
    display: none;
    padding: .75rem 1rem 1rem;
    border-bottom: 1px solid var(--qt-line);
    background: white;
    box-shadow: 0 16px 25px rgba(23, 32, 51, .09);
  }
  .qt-nav[data-open="true"] { display: grid; }
  .qt-nav a { padding: .75rem; }
  .dark .qt-nav { border-color: #334155; background: #0f172a; }
  .qt-hero-grid { grid-template-columns: 1fr; }
  .qt-card-grid, .qt-card-grid-4, .qt-workflow-grid, .qt-directory-grid, .qt-home-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qt-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qt-tool-section-heading { align-items: start; flex-direction: column; }
  .qt-games-dock { display: none; }
}

@media (max-width: 620px) {
  .qt-container { width: min(100% - 1.2rem, 1120px); }
  .qt-brand-text { font-size: 1rem; }
  .qt-hero { padding-top: 3.5rem; }
  .qt-card-grid, .qt-card-grid-2, .qt-card-grid-4, .qt-workflow-grid, .qt-trust-grid, .qt-tool-strip, .qt-footer-grid, .qt-directory-grid, .qt-home-info-grid { grid-template-columns: 1fr; }
  .qt-related-product { grid-template-columns: 1fr; }
  .qt-guides-promo { grid-template-columns: 1fr; }
  .qt-actions .qt-button { width: 100%; }
  .qt-directory-card { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
