*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
  color: var(--text-primary);
  font-size: clamp(1.375rem, 3.4vw, 1.875rem);
}

.site-main {
  flex: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  border-bottom: 1px solid var(--border);
  background: var(--chrome);
}

.site-header__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-lg);
  min-height: var(--header-h);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
  flex: 0 1 auto;
}

.site-brand__link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.site-brand__link:hover .site-logo {
  opacity: 0.92;
}

.site-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 200px;
  transition: opacity var(--transition);
}

.site-logo__gene,
.site-logo__re {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.site-logo__gene {
  fill: var(--text-primary);
}

.site-logo__re {
  fill: var(--accent);
}

.site-brand__tagline {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  max-width: min(36rem, 100%);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-shrink: 0;
  gap: var(--space-md);
  min-width: 0;
}

.site-header__lang-tools {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
  direction: ltr;
}

.site-header__meta-row {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  flex-shrink: 0;
  aspect-ratio: 1;
  background: var(--surface-inset);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--stroke-hairline);
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.theme-toggle:hover {
  color: var(--text-primary);
  box-shadow: var(--stroke-hairline-hover);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.theme-toggle__icon {
  display: block;
  flex-shrink: 0;
}

html[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

html[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}

@media (max-width: 640px) {
  .site-header__inner {
    padding-block: var(--space-xs);
    min-height: 0;
  }

  .site-logo {
    height: 24px;
    max-width: 160px;
  }

  .theme-toggle {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
  }

  .theme-toggle__icon {
    width: 17px;
    height: 17px;
  }

  .site-header__meta-row {
    gap: var(--space-xs);
  }
}

.site-header__lang-tools .lang-select {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 11rem;
}

.hero {
  padding: var(--space-xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.hero__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding-inline: var(--space-lg);
}

.hero__headline {
  margin: 0;
  max-width: 28ch;
}

.hero__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
  margin-top: var(--space-md);
}

.badge-free {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--success);
  background: transparent;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: var(--radius-pill);
}

.hero__note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 36rem;
}

.landing-home {
  display: none;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
}

.landing-home__inner {
  display: grid;
  gap: var(--space-xl);
}

.landing-home__intro {
  display: grid;
  gap: var(--space-md);
  max-width: var(--max-prose);
}

.landing-home__kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.landing-home__title {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.12;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.landing-home__lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
}

.landing-routes {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: var(--radius-card);
  background: var(--chrome);
  overflow: hidden;
  box-shadow: var(--stroke-hairline);
  isolation: isolate;
}

.landing-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.landing-route:last-child {
  border-bottom: none;
}

.landing-route:hover {
  background: var(--surface-hover);
}

.landing-route:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.landing-route__main {
  display: grid;
  gap: var(--space-xs);
  min-width: 0;
}

.landing-route__title {
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}

.landing-route__desc {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.landing-route__chev {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(-45deg);
  flex-shrink: 0;
  opacity: 0.65;
}

body.page-mode-landing #qrWorkspace,
body.page-mode-landing #toolWorkspace {
  display: none;
}

body.page-mode-landing .hero {
  display: none;
}

body.page-mode-landing .landing-home {
  display: block;
}

body.page-mode-static #qrWorkspace,
body.page-mode-static #toolWorkspace,
body.page-mode-static .landing-home {
  display: none;
}

body.page-mode-static .static-page {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-xl);
}

body.page-mode-static .static-page__header {
  display: none;
}

body.page-mode-static .static-page__section {
  margin-bottom: var(--space-lg);
}

body.page-mode-static .static-page__section h2 {
  font-size: 1.125rem;
  margin: 0 0 var(--space-sm);
}

body.page-mode-static .static-page__section p,
body.page-mode-static .static-page__section li {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9375rem;
}

body.page-mode-static .static-page__section ul {
  padding-left: 1.25rem;
  margin: 0 0 var(--space-sm);
}

.landing-seo-block,
.tool-seo-block {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg) 0;
}

.landing-seo-block__inner,
.tool-seo-block__inner {
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: var(--space-md);
  box-shadow: var(--stroke-hairline);
  isolation: isolate;
}

.landing-seo-block__inner h1,
.landing-seo-block__inner h2,
.tool-seo-block__inner h1 {
  margin: 0 0 var(--space-xs);
  font-size: 1rem;
}

.landing-seo-block__inner p,
.tool-seo-block__inner p {
  margin: 0 0 var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.landing-seo-block__links {
  margin: 0;
  padding-inline-start: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.4rem 1rem;
}

.landing-seo-block__links a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8125rem;
}

.landing-seo-block__links a:hover {
  text-decoration: underline;
}

.tool-editorial {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg) var(--space-xl);
}

.tool-editorial__header {
  margin: 0 0 var(--space-sm);
}

.tool-editorial__title {
  margin: 0;
  font-size: 1.125rem;
}

.tool-editorial h3 {
  margin: var(--space-md) 0 var(--space-xs);
  font-size: 1rem;
}

.tool-editorial p,
.tool-editorial li {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.tool-editorial p {
  margin: 0 0 var(--space-sm);
}

.tool-editorial ul {
  margin: 0 0 var(--space-sm);
  padding-inline-start: 1.25rem;
}

.tool-editorial__faq {
  display: grid;
  gap: 0.5rem;
}

.tool-editorial__faq-item {
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--stroke-hairline);
  padding: var(--space-sm) var(--space-md);
}

.tool-editorial__faq-item summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.tool-editorial__faq-item p {
  margin: var(--space-xs) 0 0;
}

.tool-editorial__related {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.4rem 1rem;
}

.tool-editorial__related a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8125rem;
}

.tool-editorial__related a:hover {
  text-decoration: underline;
}

.ad-wrap {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) 0;
  min-height: 5.5rem;
}

.ad-wrap ins.adsbygoogle {
  display: block;
  min-height: 5.5rem;
  width: 100%;
  max-width: 728px;
  margin-inline: auto;
}

.layout-shell {
  margin: 0;
  padding: var(--space-lg) 0 var(--space-xl);
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
  width: 100%;
  min-width: 0;
}

.layout-preview-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  min-width: 0;
}

@media (max-width: 959px) {
  .site-header__inner {
    padding-inline: var(--space-md);
  }

  .hero__inner {
    padding-inline: var(--space-md);
  }

  .ad-wrap {
    padding: 0 var(--space-md);
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    overflow: hidden;
  }

  .ad-wrap ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    overflow: hidden;
  }

  #adLeaderboard iframe,
  #adLeaderboard > div,
  #adLeaderboard ins.adsbygoogle > div {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
  }

  .site-brand__tagline {
    display: none;
  }

  .ad-sponsored {
    display: none;
  }

  .site-footer__inner {
    padding-inline: var(--space-md);
  }

  .layout-page {
    padding-inline: var(--space-md);
  }

  .layout-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding-top: var(--space-md);
    padding-bottom: var(--space-xl);
  }

  .layout-preview-column {
    width: 100%;
  }

  .layout-main,
  .layout-preview-column,
  .tool-options-panel,
  .tool-output-root {
    min-width: 0;
    width: 100%;
  }
}

@media (min-width: 960px) {
  .layout-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    align-items: start;
    gap: var(--space-xl);
    padding: var(--space-xl) 0 var(--space-2xl);
  }

  .layout-shell.layout-shell--wide-tool-output {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .layout-shell.layout-shell--wide-tool-output .tool-output-root {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: min(56vh, 34rem);
  }

  .layout-shell.layout-shell--wide-tool-output .tool-output-root > .preview-frame {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .layout-shell.layout-shell--wide-tool-output .tools-preview-docked__stage {
    flex: 1 1 auto;
    min-height: 0;
  }

  .layout-shell.layout-shell--equal-tool-panels {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .layout-shell.layout-shell--equal-tool-panels .layout-preview-column {
    position: static;
    top: auto;
  }

  .layout-preview-column {
    position: sticky;
    top: calc(var(--header-h) + var(--space-lg));
    align-self: start;
  }

  .layout-main {
    order: unset;
  }
}

.layout-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  min-width: 0;
}

#toolWorkspace .tool-output-root:empty {
  display: none;
}

#toolWorkspace .layout-preview-column--tool:has(.tool-output-root:empty) {
  display: none;
}

@media (min-width: 960px) {
  .layout-shell.layout-shell--tool-workspace:has(.tool-output-root:empty) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.layout-page {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg) var(--space-2xl);
  min-width: 0;
}

.site-footer {
  margin-top: auto;
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.site-footer__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding-inline: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.site-footer__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-lg) var(--space-xl);
  width: 100%;
}

.site-footer__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.site-footer__credit,
.site-footer__copyright {
  margin: 0;
}

.site-footer__copyright {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  opacity: 0.9;
}

.site-footer__credit-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer__credit-link:hover {
  color: var(--text-primary);
}

.site-footer__main .site-footer__links {
  justify-self: end;
  align-self: center;
}

@media (max-width: 640px) {
  .site-footer__main {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .site-footer__main .site-footer__links {
    justify-self: start;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
    width: 100%;
  }
}

.site-header__kofi {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.site-header__kofi:hover .site-header__kofi-img {
  opacity: 0.92;
}

.site-header__kofi-img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 112px;
  object-fit: contain;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.site-footer__links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer__links a:hover {
  color: var(--text-primary);
}

.ad-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.ad-card__label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0;
}

.ad-card__slot {
  flex: 1;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.ad-slot--leaderboard .ad-card__slot {
  min-height: 88px;
  max-height: 100px;
}

.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;
}
