/* freeonlinetools.au — shared design system */

/* Metric-matched fallbacks — reduce CLS when web fonts load (or with font-display: optional) */
@font-face {
  font-family: "Plus Jakarta Fallback";
  src: local("Segoe UI"), local("Helvetica Neue"), local("Arial");
  size-adjust: 100%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Fraunces Fallback";
  src: local("Georgia");
  size-adjust: 105%;
  ascent-override: 88%;
  descent-override: 22%;
  line-gap-override: 0%;
}

/* Self-hosted latin fonts */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url("../fonts/plus-jakarta-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: optional;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-bg: #add8e6;
  --color-bg-elevated: #ffffff;
  --color-bg-muted: #c5e8f7;
  --color-body-shell: #add8e6;
  --color-surface: #ffffff;
  --color-border: #d4dce8;
  --color-border-strong: #b8c6d8;

  --color-text: #001840;
  --color-text-muted: #485870;
  --color-text-subtle: #6a7a90;

  --color-primary: #0888f0;
  --color-primary-hover: #0070e0;
  /* WCAG AA on white: small text / links */
  --color-primary-on-light: #005a9e;
  --color-primary-on-light-hover: #004880;
  /* WCAG AA: white text on filled buttons */
  --color-primary-button: #0066b3;
  --color-primary-button-hover: #005499;
  --color-primary-soft: rgba(8, 136, 240, 0.12);
  --color-accent: #10a0f8;
  --color-accent-soft: rgba(16, 160, 248, 0.14);

  --color-hero-from: #001840;
  --color-hero-to: #0068e0;
  --color-hero-mid: #0078e8;
  --color-hero-glow: rgba(24, 176, 248, 0.35);

  --font-sans: "Plus Jakarta Sans", "Plus Jakarta Fallback", system-ui, -apple-system, sans-serif;
  --font-display: "Fraunces", "Fraunces Fallback", Georgia, serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(26, 36, 32, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 36, 32, 0.08);
  --shadow-lg: 0 12px 40px rgba(26, 36, 32, 0.1);
  --shadow-card: 0 2px 8px rgba(26, 36, 32, 0.04), 0 8px 24px rgba(26, 36, 32, 0.06);

  --header-safe-top: env(safe-area-inset-top, 0px);
  --header-logo-height: 200px;
  --header-offset: calc(var(--header-safe-top) + 60px);
  --container: 1120px;
  --container-narrow: 720px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Dark shell page background (body gradient) */
  --body-shell-gradient: radial-gradient(
    circle at top,
    #0a1a3a 0%,
    #0a1a3a 20%,
    #0d224d 45%,
    #102a5f 70%,
    #1a3c7a 100%
  );
}

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

html {
  scroll-behavior: smooth;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-body-shell);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Dark site shell: fixed radial gradient on body (excludes bedtime / baby names) */
body.page:not(.bs-page):not(.bn-page) {
  background: var(--body-shell-gradient);
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-hover);
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: calc(60px + var(--header-safe-top));
  padding-top: var(--header-safe-top);
  display: flex;
  align-items: center;
  overflow: visible;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 60px;
  min-height: 0;
  gap: 0.75rem;
}

.header-logo,
.site-header .logo {
  height: 120px;
  display: flex;
  align-items: center;
  overflow: visible;
  flex-shrink: 0;
  text-decoration: none;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo:hover,
.header-logo:hover {
  opacity: 0.92;
}

.header-logo img,
.site-header .logo__img,
.site-footer .logo__img {
  display: block;
  height: var(--header-logo-height);
  max-height: var(--header-logo-height);
  width: auto;
  max-width: none;
  object-fit: contain;
  flex-shrink: 0;
}

.site-footer .header-logo {
  height: auto;
  overflow: visible;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-lang {
  margin-left: 0.25rem;
}

.site-lang__select {
  min-width: 7.5rem;
  max-width: 11rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface, #fff);
  cursor: pointer;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.nav-toggle {
  display: none;
  padding: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-text);
}

/* Hero (homepage) */
.hero {
  position: relative;
  padding: 4rem 0 5rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, var(--color-hero-from) 0%, var(--color-hero-to) 55%, var(--color-hero-mid) 100%);
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -15%;
  width: 60%;
  height: 140%;
  background: radial-gradient(ellipse, var(--color-hero-glow) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #93c5fd;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.hero h1,
.hero__heading {
  margin: 0 0 1rem;
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #f0f4f8;
}

.hero__heading {
  display: flex;
  flex-direction: column;
}

.hero__heading-line {
  display: block;
}

.hero__heading-line--light {
  color: #f0f4f8;
}

.hero__heading-line--accent {
  color: #00bfff;
}

.hero__lead {
  margin: 0 0 2rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  max-width: 32rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__card-stack {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1;
}

.hero__card {
  position: absolute;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.hero__card--1 {
  top: 8%;
  left: 0;
  width: 72%;
  transform: rotate(-4deg);
}

.hero__card--2 {
  top: 38%;
  right: 0;
  width: 68%;
  transform: rotate(3deg);
}

.hero__card--3 {
  bottom: 5%;
  left: 12%;
  width: 65%;
  transform: rotate(-1deg);
}

.hero__card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-subtle);
  margin-bottom: 0.25rem;
}

.hero__card-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.375rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn--primary {
  background: #ffffff;
  color: var(--color-hero-from);
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  background: #eff6ff;
  color: var(--color-hero-from);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn--teal {
  background: var(--color-primary-button);
  color: #ffffff;
}

.btn--teal:hover {
  background: var(--color-primary-button-hover);
  color: #ffffff;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section__header {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 2.5rem;
}

.section__eyebrow {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-on-light);
}

.section h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.section__desc {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
}

/* Tool grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.tool-card-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.tool-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 11.25rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.tools-grid .tool-card-wrapper:nth-child(odd) .tool-card,
.tools-grid .tool-card-wrapper:nth-child(even) .tool-card {
  background: var(--color-surface);
}

.tool-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.tool-card__top {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.tool-card__head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  text-decoration: none;
  color: inherit;
}

.tool-card__head:hover {
  color: inherit;
}

.tool-card__head:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.tool-card__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.tool-card__title,
.tool-card h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: calc(1.0625rem * 1.3 * 2);
}

.tool-card__head:hover .tool-card__title {
  color: var(--color-primary);
}

.tool-card__title a {
  color: var(--color-text);
}

.tool-card__title a:hover {
  color: var(--color-primary);
}

.tool-card__desc-panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-top: 0;
  --tool-desc-line-height: 1.55;
  --tool-desc-font-size: 0.875rem;
  --tool-desc-collapsed-lines: 1;
}

.tool-card__desc-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  min-height: 2.75rem;
}

.tool-card__desc-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  max-height: calc(var(--tool-desc-font-size) * var(--tool-desc-line-height) * var(--tool-desc-collapsed-lines));
}

.tool-card__desc-panel.is-expanded .tool-card__desc-viewport {
  max-height: none;
  overflow: visible;
}

.tool-card__desc {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tool-card__desc-panel:not(.is-expanded) .tool-card__desc {
  gap: 0.5rem;
}

.tool-card__desc p {
  margin: 0;
  font-size: var(--tool-desc-font-size);
  line-height: var(--tool-desc-line-height);
  color: var(--color-text-muted);
}

.tool-card__desc-panel:not(.is-expanded) .tool-card__desc p:not(:first-child) {
  display: none;
}

.tool-card__desc-panel:not(.is-expanded):not(.is-measuring) .tool-card__desc p:first-child {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
}

.tool-card__desc-panel.is-measuring .tool-card__desc-viewport {
  max-height: none !important;
  overflow: visible !important;
}

.tool-card__desc-panel.is-measuring .tool-card__desc p {
  display: block !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  overflow: visible !important;
}

.tool-card__desc-footer {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  margin-top: 0.35rem;
  min-height: 0;
}

.tool-card__desc-panel:not(.is-expanded) .tool-card__desc-footer {
  display: none;
}

.tool-card__desc-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-primary-on-light);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tool-card__desc-toggle[hidden] {
  display: none !important;
}

.tool-card__desc-toggle:hover {
  background: var(--color-primary-soft);
}

.tool-card__desc-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.tool-card__desc-toggle-icon {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.tool-card__desc-panel--no-toggle .tool-card__desc-toggle {
  display: none !important;
}

.tool-card__arrow {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary-on-light);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  min-height: 2.75rem;
  padding: 0.35rem 0;
}

.tool-card__arrow:hover {
  color: var(--color-primary-on-light-hover);
}

.tool-card__arrow:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.tool-card:hover .tool-card__arrow {
  color: var(--color-primary-on-light-hover);
}

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

.is-hidden {
  display: none !important;
}

/* Homepage categories */
.tools-search {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 40rem;
  margin: 0 auto 1.25rem;
}

/* Field look matches .contact-input (contact.css); only flex layout here */
.tools-search .contact-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
}

.tools-search__submit {
  flex: 0 0 auto;
  padding: 0.75rem 1rem;
  line-height: 1.4;
  white-space: nowrap;
}

.tools-category-picker {
  max-width: 40rem;
  margin: 0 auto 2rem;
}

.tools-search--category-picker {
  margin-bottom: 0;
}

.tools-search--category-picker .tools-category-picker__select {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
  cursor: pointer;
}

.tools-search__spacer {
  visibility: hidden;
  pointer-events: none;
}

.tools-category-picker__result {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface-raised, #f8f9fa);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 0.5rem;
}

.tools-category-picker__panel.is-hidden,
.tools-category-picker__panel[hidden] {
  display: none !important;
}

.tools-category-picker__title {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
}

.tools-category-picker__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tools-category-picker__list li {
  margin: 0;
  padding: 0.25rem 0 0.25rem 1rem;
}

.tools-category-picker__link {
  color: var(--color-link, var(--color-teal, #0d9488));
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.tools-category-picker__link:hover,
.tools-category-picker__link:focus-visible {
  text-decoration: underline;
}

body.dark-page .tools-category-picker__result {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.tools-search-empty {
  margin: 0 0 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.tools-by-category {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.tools-category-group__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.tools-category-group__heading {
  min-width: 0;
}

.tools-category-group__desc {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-text-muted);
  font-weight: 400;
}

.tools-category-group__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
}

.tools-category-group__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}

.tool-of-day {
  padding: 3rem 0;
  background: var(--color-bg-muted);
  border-block: 1px solid var(--color-border);
}

.tool-of-day__inner {
  max-width: var(--container);
  margin: 0 auto;
}

.tool-of-day__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  text-align: center;
}

.tool-of-day .tools-grid {
  max-width: 360px;
  margin: 0 auto;
}

/* Features strip */
.features {
  background: var(--color-bg-muted);
  border-block: 1px solid var(--color-border);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature {
  text-align: center;
  padding: 0.5rem;
}

.feature__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 1rem;
  padding: 0.625rem;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  color: var(--color-primary);
}

.feature h3,
.feature__title {
  margin: 0 0 0.375rem;
  font-size: 1rem;
  font-weight: 700;
}

.tools-noscript {
  margin: 2rem 0 0;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  list-style: none;
}

.tools-noscript li {
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.tools-noscript li:last-child {
  margin-bottom: 0;
}

.tools-noscript a {
  font-weight: 600;
  color: var(--color-primary);
}

.feature p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Tool page layout */
.page-hero {
  padding: 2.5rem 0 2rem;
  background: linear-gradient(180deg, var(--color-bg-muted) 0%, var(--color-body-shell) 100%);
  border-bottom: 1px solid var(--color-border);
}

.page-hero__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.page-hero__breadcrumb a {
  color: var(--color-text-muted);
}

.page-hero__breadcrumb a:hover {
  color: var(--color-primary);
}

.page-hero__breadcrumb span {
  color: var(--color-text-subtle);
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-hero__desc {
  margin: 0;
  max-width: 40rem;
  font-size: 1.0625rem;
  color: var(--color-text-muted);
}

.page-hero__desc p {
  margin: 0 0 0.875rem;
}

.page-hero__desc p:last-child {
  margin-bottom: 0;
}

.tool-panel {
  margin: 2rem 0 4rem;
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.tool-panel--placeholder {
  text-align: center;
  padding: 3rem 2rem;
}

.tool-panel--placeholder .placeholder-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.tool-panel--placeholder h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.tool-panel--placeholder p {
  margin: 0 0 1.5rem;
  color: var(--color-text-muted);
  max-width: 28rem;
  margin-inline: auto;
}

/* What's My IP */
.ip-tool {
  text-align: center;
}

.ip-tool__label {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.ip-tool__display {
  margin-bottom: 1.5rem;
  padding: 1.5rem 1rem;
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.ip-tool__value {
  display: block;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text);
  word-break: break-all;
}

.ip-tool__value--empty {
  color: var(--color-text-subtle);
}

.ip-tool__version {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-radius: 999px;
}

.ip-tool__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border-strong);
}

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

.ip-tool__status {
  margin: 0;
  max-width: 28rem;
  margin-inline: auto;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.ip-tool__status--error {
  color: #b91c1c;
}

/* What's My IP — history panel */
.ip-history-tool {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: left;
}

.ip-history__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.ip-history__title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--color-text);
}

.ip-history__meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.ip-history__list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-muted);
  max-height: 16rem;
  overflow-y: auto;
}

.ip-history__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.ip-history__item:last-child {
  border-bottom: none;
}

.ip-history__ip {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-all;
}

.ip-history__time {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.ip-history__badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  white-space: nowrap;
}

.ip-history__empty {
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-subtle);
  text-align: center;
}

.ip-history__footer {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.ip-history__note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* WHOIS Lookup */
.whois-tool {
  padding: 2rem;
}

.whois-form {
  margin-bottom: 1.5rem;
}

.whois-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.whois-form__row input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.whois-form__row input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.whois-form__hint {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.whois-form__hint strong {
  color: var(--color-text);
  font-weight: 600;
}

.whois-form__hint--wait {
  color: var(--color-primary);
  font-weight: 500;
}

.whois-alert {
  margin-bottom: 1.5rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.whois-alert--error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.whois-results__header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.whois-results__domain {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  word-break: break-all;
}

.whois-results__meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.whois-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.whois-summary__card {
  padding: 1rem 1.125rem;
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.whois-summary__label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.whois-summary__value {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-text);
  word-break: break-word;
}

.whois-summary__value a {
  color: var(--color-primary);
  text-decoration: none;
}

.whois-summary__value a:hover {
  text-decoration: underline;
}

.whois-section {
  margin-bottom: 1.75rem;
}

.whois-section__title {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.whois-dl {
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.whois-dl__row {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.whois-dl__row:last-child {
  border-bottom: none;
}

.whois-dl__row:nth-child(even) {
  background: var(--color-bg);
}

.whois-dl dt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.whois-dl dd {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text);
  word-break: break-word;
}

.whois-dl dd a {
  color: var(--color-primary);
  text-decoration: none;
}

.whois-dl dd a:hover {
  text-decoration: underline;
}

.whois-raw {
  margin-top: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.whois-raw summary {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}

.whois-raw summary:hover {
  color: var(--color-primary);
}

.whois-raw__body {
  margin: 0;
  padding: 1rem;
  max-height: 24rem;
  overflow: auto;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  white-space: pre-wrap;
  word-break: break-word;
}

.whois-form.is-loading .btn--teal {
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 560px) {
  .whois-dl__row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .whois-form__row .btn--teal {
    width: 100%;
  }
}

/* Password Generator */
.pg-tool {
  padding: 2rem;
}

.pg-form__submit {
  width: 100%;
  margin-top: 0.5rem;
}

.pg-options {
  margin: 0 0 1.25rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}

.pg-options legend {
  padding: 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.pg-check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
  font-size: 0.9375rem;
  color: var(--color-text);
  cursor: pointer;
}

.pg-check:last-child {
  margin-bottom: 0;
}

.pg-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary);
}

.pg-label-hint {
  font-weight: 400;
  color: var(--color-text-muted);
}

.pg-listbox {
  width: 100%;
  min-height: 6.5rem;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.pg-listbox:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.pg-alert {
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.pg-alert--error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.pg-result {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.pg-result__label {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.pg-result__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pg-result__output {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.875rem 1rem;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.pg-result__hint {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

@media (max-width: 560px) {
  .pg-result__row .btn--secondary {
    width: 100%;
  }
}

/* Form elements (for future tools) */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* AdSense F O T — above footer on tool pages */
.adsense-fot-footer {
  display: block;
  width: 100%;
  max-width: var(--container);
  margin: 1.25rem auto 0.5rem;
  padding: 0 1rem;
  box-sizing: border-box;
  min-height: 90px;
  overflow: hidden;
}

/* Buy Me a Coffee (tool pages) */
.tool-panel-footer {
  clear: both;
  margin: 1.5rem 0 0;
  padding-top: 0.25rem;
  width: 100%;
}

.tool-related-nearby {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: center;
  color: var(--color-text-muted);
}

.tool-related-nearby__label {
  font-weight: 600;
  color: var(--color-text);
}

.tool-related-nearby__link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.tool-related-nearby__link:hover {
  text-decoration: underline;
}

.tool-bmc {
  display: block;
  clear: both;
  margin: 0;
  padding-top: 0;
  text-align: center;
  width: 100%;
}

.tool-bmc__link {
  display: inline-block;
  line-height: 1.4;
  text-decoration: none;
}

.tool-bmc__img {
  display: block;
  height: 60px;
  width: 217px;
  margin: 0 auto;
}

/* Related tools */
.related-tools {
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--color-border);
}

.related-tools h2 {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.related-tools__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-tools__list a {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  text-decoration: none;
}

.related-tools__list a:hover {
  color: var(--color-primary-on-light);
  border-color: var(--color-primary-on-light);
  background: var(--color-primary-soft);
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 3rem 0 2rem;
  background: #020b18;
  color: #e2e8f4;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
  color: #7dd3fc;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(12rem, 1.1fr) minmax(0, 2fr);
  gap: 2rem 2.5rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.site-footer__tools {
  min-width: 0;
}

.site-footer__tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__tools-grid li {
  margin: 0;
}

.site-footer__tools-grid a {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
}

.site-footer__tools-grid a:hover {
  color: #7dd3fc;
}

.site-footer .logo {
  margin-bottom: 0.75rem;
}

.site-footer .logo:hover {
  opacity: 1;
}

.site-footer__tagline {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: 22rem;
  color: #f0f4f8;
}

.site-footer__external {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.site-footer__external-title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
}

.site-footer__external-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__external-list a {
  font-size: 0.9375rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.92);
}

.site-footer__external-list a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.site-footer h4 {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin-bottom: 0.5rem;
}

.site-footer li a {
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-footer__bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.875rem;
  color: rgba(240, 244, 248, 0.78);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1rem;
}

.site-footer__nav a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: #7dd3fc;
}

.site-footer__copy {
  margin: 0 0 0.35rem;
  text-align: center;
}

.site-footer__visits {
  margin: 0;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #c8d6e8;
}

.site-footer__admin {
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
}

.site-footer__admin a {
  font-weight: 600;
  color: #c8d6e8;
  text-decoration: none;
}

.site-footer__admin a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Page shell */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* Mobile nav */
@media (max-width: 768px) {
  :root {
    --header-offset: calc(var(--header-safe-top) + 60px);
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .tool-panel,
  .tool-panel[class*="-tool"] {
    margin: 1.25rem 0 2.5rem;
    padding: 1.25rem 1rem;
  }

  .tool-panel--placeholder {
    padding: 2rem 1rem;
  }

  .nav-toggle {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-offset);
    max-height: calc(100dvh - var(--header-offset));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav a {
    padding: 0.875rem 1rem;
  }

  .page .site-nav {
    background: #020b18;
    border-bottom-color: rgba(255, 255, 255, 0.12);
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero__lead {
    margin-bottom: 1.25rem;
    font-size: 1rem;
  }

  .hero__visual {
    margin-top: 0.25rem;
  }

  .hero__card-stack {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    margin: 0;
  }

  .hero__card {
    position: static;
    width: auto;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
    padding: 0.5rem 0.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
  }

  .hero__card-label {
    font-size: 0.5625rem;
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
    line-height: 1.2;
  }

  .hero__card-value {
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
  }

  .features__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .tools-search {
    flex-wrap: nowrap;
    gap: 0.5rem;
    max-width: 100%;
  }

  .tools-search .contact-input {
    font-size: 16px;
  }

  .tools-search__submit {
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
  }

  .tools-search--category-picker .tools-category-picker__select {
    font-size: 16px;
  }

  .site-footer {
    padding: 2rem 0 calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    margin-bottom: 1.75rem;
  }

  .site-footer__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .site-footer .logo {
    margin-bottom: 0.5rem;
  }

  .site-footer .header-logo img,
  .site-footer .logo__img {
    height: auto;
    max-height: 4.5rem;
    width: auto;
    margin: 0 auto;
  }

  .site-footer__external {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
  }

  .site-footer__tools h4 {
    text-align: center;
    margin-bottom: 0.75rem;
  }

  .site-footer__tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .site-footer__tools-grid a {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-align: center;
    padding: 0.5rem 0.4rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
  }

  .site-footer__tools-grid a:active {
    background: rgba(255, 255, 255, 0.12);
  }

  .site-footer__bottom {
    padding-top: 1.25rem;
  }

  .site-footer__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .site-footer__nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    text-align: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
  }

  .site-footer__nav a:active {
    background: rgba(255, 255, 255, 0.14);
  }

  .site-footer__copy,
  .site-footer__visits {
    font-size: 0.8125rem;
    line-height: 1.5;
    padding: 0 0.25rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  .tool-panel,
  .tool-panel[class*="-tool"] {
    padding: 1rem 0.875rem;
    border-radius: var(--radius-lg);
  }

  .site-footer {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .site-footer .header-logo img,
  .site-footer .logo__img {
    max-height: 3.75rem;
  }

  .site-footer__tools-grid {
    grid-template-columns: 1fr;
    gap: 0.375rem;
  }

  .site-footer__tools-grid a {
    justify-content: flex-start;
    text-align: left;
    padding: 0.625rem 0.75rem;
    min-height: 2.875rem;
    font-size: 0.8125rem;
  }

  .site-footer__nav {
    grid-template-columns: 1fr;
    gap: 0.375rem;
  }

  .site-footer__nav a {
    min-height: 2.875rem;
  }

  .hero {
    padding: 2.5rem 0 3rem;
  }

  .hero__card-stack {
    gap: 0.375rem;
  }

  .hero__card {
    padding: 0.4rem 0.35rem;
  }

  .hero__card-label {
    font-size: 0.5rem;
  }

  .hero__card-value {
    font-size: 0.625rem;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    padding: 1.25rem;
  }

  .tool-card__desc-toggle {
    width: 3rem;
    height: 3rem;
  }

  .tool-card__arrow {
    min-height: 3rem;
  }
}

@media (max-width: 390px) {
  .site-header__inner {
    gap: 0.5rem;
  }
}

/* Site-wide dark theme (excludes bedtime stories .bs-page, baby names .bn-page) */
.page:not(.bs-page):not(.bn-page) {
  --color-body-shell: #0a1a3a;
  --color-bg: transparent;
  --color-bg-muted: #0a1a2e;
  background: transparent;
  color: #f0f4f8;
}

.page:not(.bs-page):not(.bn-page) main {
  background: transparent;
}

/* Sitewide header shell (index, tools, bedtime, baby names) */
.page .site-header {
  background: #020b18;
  backdrop-filter: none;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.page .site-nav a {
  color: rgba(255, 255, 255, 0.82);
}

.page .site-nav a:hover,
.page .site-nav a.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.page .nav-toggle {
  color: #ffffff;
}

/* Homepage hero — let body gradient show through */
.page:not(.bs-page):not(.bn-page) .hero::before {
  background: transparent;
}

.page:not(.bs-page):not(.bn-page) .hero::after {
  background: radial-gradient(ellipse, rgba(0, 191, 255, 0.12) 0%, transparent 70%);
}

.page:not(.bs-page):not(.bn-page) .section h2,
.page:not(.bs-page):not(.bn-page) .tools-category-group__title {
  color: #ffffff;
}

.page:not(.bs-page):not(.bn-page) .section__desc,
.page:not(.bs-page):not(.bn-page) .feature p,
.page:not(.bs-page):not(.bn-page) .tools-search-empty,
.page:not(.bs-page):not(.bn-page) .tools-search-hint {
  color: rgba(255, 255, 255, 0.72);
}

.page:not(.bs-page):not(.bn-page) .section__eyebrow,
.page:not(.bs-page):not(.bn-page) .tool-of-day__label {
  color: #00bfff;
}

.page:not(.bs-page):not(.bn-page) .features {
  background: #0a1a2e;
  border-block-color: rgba(255, 255, 255, 0.12);
}

.page:not(.bs-page):not(.bn-page) .feature h3,
.page:not(.bs-page):not(.bn-page) .feature__title {
  color: #ffffff;
}

.page:not(.bs-page):not(.bn-page) .tool-of-day {
  background: #0a1a2e;
  border-block-color: rgba(255, 255, 255, 0.12);
}

.page:not(.bs-page):not(.bn-page) .tools-search-hint code,
.page:not(.bs-page):not(.bn-page) .page-hero__desc code {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f4;
}

.page:not(.bs-page):not(.bn-page) .btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.page:not(.bs-page):not(.bn-page) .btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: #00bfff;
}

/* Tool cards on dark pages: light cards, dark text */
.page:not(.bs-page):not(.bn-page) .tool-card {
  border-color: #b8c6d8;
  color: var(--color-text);
}

.page:not(.bs-page):not(.bn-page) .tools-grid .tool-card-wrapper:nth-child(odd) .tool-card {
  background: #fffef5;
}

.page:not(.bs-page):not(.bn-page) .tools-grid .tool-card-wrapper:nth-child(even) .tool-card {
  background: #f3fcf5;
}

.page:not(.bs-page):not(.bn-page) .tool-card__title,
.page:not(.bs-page):not(.bn-page) .tool-card h3 {
  color: var(--color-text);
}

.page:not(.bs-page):not(.bn-page) .tool-card__desc p,
.page:not(.bs-page):not(.bn-page) .tool-card p {
  color: var(--color-text-muted);
}

.page:not(.bs-page):not(.bn-page) .tool-card__desc-toggle {
  color: var(--color-primary-on-light);
}

.page:not(.bs-page):not(.bn-page) .tool-card__desc-toggle:hover {
  background: rgba(0, 90, 158, 0.1);
}

.page:not(.bs-page):not(.bn-page) .tool-card__arrow {
  color: var(--color-primary-on-light);
}

.page:not(.bs-page):not(.bn-page) .tool-card:hover {
  border-color: var(--color-primary-on-light);
}

.page:not(.bs-page):not(.bn-page) .tool-card:hover .tool-card__arrow {
  color: var(--color-primary-on-light-hover);
}

.page:not(.bs-page):not(.bn-page) .tool-card__icon {
  color: var(--color-primary-on-light);
  background: rgba(0, 90, 158, 0.1);
}

.page:not(.bs-page):not(.bn-page) .tools-search .contact-input {
  background: #ffffff;
  color: var(--color-text);
  border-color: #b8c6d8;
}

.page:not(.bs-page):not(.bn-page) .related-tools {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.page:not(.bs-page):not(.bn-page) .related-tools h2 {
  color: #ffffff;
}

.page:not(.bs-page):not(.bn-page) .tool-related-nearby {
  color: rgba(255, 255, 255, 0.78);
}

.page:not(.bs-page):not(.bn-page) .tool-related-nearby__label {
  color: #ffffff;
}

.page:not(.bs-page):not(.bn-page) .tool-related-nearby__link {
  color: #7dd3fc;
}

.page:not(.bs-page):not(.bn-page) .tool-related-nearby__link:hover {
  color: #ffffff;
}

.page:not(.bs-page):not(.bn-page) .related-tools__list a {
  color: #e8eef5;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
}

.page:not(.bs-page):not(.bn-page) .related-tools__list a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
}

/* Tool & content page hero band */
.page:not(.bs-page):not(.bn-page) .page-hero {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.page:not(.bs-page):not(.bn-page) .page-hero h1 {
  color: #ffffff;
}

.page:not(.bs-page):not(.bn-page) .page-hero__breadcrumb,
.page:not(.bs-page):not(.bn-page) .page-hero__breadcrumb a {
  color: rgba(255, 255, 255, 0.78);
}

.page:not(.bs-page):not(.bn-page) .page-hero__breadcrumb a:hover {
  color: #00bfff;
}

.page:not(.bs-page):not(.bn-page) .page-hero__breadcrumb span {
  color: rgba(255, 255, 255, 0.55);
}

.page:not(.bs-page):not(.bn-page) .page-hero__desc,
.page:not(.bs-page):not(.bn-page) .sm-hero__meta {
  color: rgba(255, 255, 255, 0.78);
}

.page:not(.bs-page):not(.bn-page) .tools-noscript {
  background: #0a1a2e;
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
}

.page:not(.bs-page):not(.bn-page) .tools-noscript a {
  color: #00bfff;
}

.page:not(.bs-page):not(.bn-page) .tool-search-results__summary {
  color: rgba(255, 255, 255, 0.78);
}

/* Blog list */
.page:not(.bs-page):not(.bn-page) .blog-list__title {
  color: #ffffff;
}

.page:not(.bs-page):not(.bn-page) .blog-list__meta,
.page:not(.bs-page):not(.bn-page) .blog-list__excerpt {
  color: rgba(255, 255, 255, 0.72);
}

.page:not(.bs-page):not(.bn-page) .blog-list__item {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.page:not(.bs-page):not(.bn-page) .blog-list__link:hover h2,
.page:not(.bs-page):not(.bn-page) .blog-list__link:hover .blog-list__title {
  color: #00bfff;
}

.page:not(.bs-page):not(.bn-page) .blog-post__meta {
  color: rgba(255, 255, 255, 0.72);
}

/* Contact / about bands on dark shell */
.page:not(.bs-page):not(.bn-page) .home-contact {
  background: #0a1a2e;
  border-top-color: rgba(255, 255, 255, 0.12);
}

.page:not(.bs-page):not(.bn-page) .home-contact__eyebrow {
  color: #00bfff;
}

.page:not(.bs-page):not(.bn-page) .home-contact__header h2 {
  color: #ffffff;
}

.page:not(.bs-page):not(.bn-page) .home-contact__tagline {
  color: rgba(255, 255, 255, 0.78);
}

.page:not(.bs-page):not(.bn-page) .home-about {
  background: linear-gradient(155deg, #020b18 0%, #0a1a2e 52%, #001840 100%);
}

/* Tool panels on dark pages: navy surface + white text (SEO description box unchanged) */
.page:not(.bs-page):not(.bn-page) .tool-panel,
.page:not(.bs-page):not(.bn-page) #tool-content {
  --color-bg: #0a1a2e;
  --color-bg-elevated: #0d2137;
  --color-bg-muted: #0d2137;
  --color-surface: #0d2137;
  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.85);
  --color-text-subtle: rgba(255, 255, 255, 0.72);
  --color-border: rgba(255, 255, 255, 0.2);
  --color-border-strong: rgba(255, 255, 255, 0.28);
  background: #0a1a2e;
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.page:not(.bs-page):not(.bn-page) .tool-panel :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="image"]):not([type="file"]),
  select,
  textarea
) {
  background-color: #ffffff;
  color: #001840;
  border-color: #d4dce8;
}

.page:not(.bs-page):not(.bn-page) .tool-panel :is(input, select, textarea):focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* Light-surface blocks inside dark tool panels keep dark text */
.page:not(.bs-page):not(.bn-page) .tool-panel :where(
  .panel,
  .child-mode,
  .ht-panel--preview,
  .ht-code,
  .ht-preview-wrap,
  .ec-alert,
  .api-result-card,
  .saa-card,
  .cnv-canvas,
  .cbs-story,
  .cr-recipe,
  [class*="form__card"],
  [class*="--preview"],
  [class*="--warn"],
  [class*="--warning"],
  [class*="badge--"]
),
.page:not(.bs-page):not(.bn-page) #tool-content :where(
  .panel,
  .child-mode,
  .ht-panel--preview,
  .ht-code,
  .ht-preview-wrap,
  .ec-alert,
  .api-result-card,
  .saa-card,
  .cnv-canvas,
  .cbs-story,
  .cr-recipe,
  [class*="form__card"],
  [class*="--preview"],
  [class*="--warn"],
  [class*="--warning"],
  [class*="badge--"]
) {
  --color-text: #001840;
  --color-text-muted: #485870;
  --color-text-subtle: #6a7a90;
  color: #001840;
}

/* Tool panels: secondary buttons on dark surfaces */
.page:not(.bs-page):not(.bn-page) .tool-panel .btn.btn--secondary:not([class*="--active"]),
.page:not(.bs-page):not(.bn-page) #tool-content .btn.btn--secondary:not([class*="--active"]) {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.page:not(.bs-page):not(.bn-page) .tool-panel .btn.btn--secondary:not([class*="--active"]):hover,
.page:not(.bs-page):not(.bn-page) #tool-content .btn.btn--secondary:not([class*="--active"]):hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: #00bfff;
}

.page:not(.bs-page):not(.bn-page) .tool-panel [class*="--active"].btn--secondary,
.page:not(.bs-page):not(.bn-page) #tool-content [class*="--active"].btn--secondary {
  border-color: #00bfff;
  color: #ffffff;
  background: rgba(0, 191, 255, 0.14);
}

.page:not(.bs-page):not(.bn-page) .tool-panel [class*="--active"].btn--secondary:hover,
.page:not(.bs-page):not(.bn-page) #tool-content [class*="--active"].btn--secondary:hover {
  background: rgba(0, 191, 255, 0.22);
  color: #ffffff;
  border-color: #7dd3fc;
}

/* Long-form SEO content — below hero intro, above tool UI (timezone reference) */
:root {
  --tool-seo-content-bg: #0a1a2e;
  --tool-seo-content-border: rgba(255, 255, 255, 0.14);
  --tool-seo-content-text: #ffeb3b;
  --tool-seo-content-link: #fff59d;
}

.tool-seo-content {
  padding: 0 0 1.25rem;
  margin-top: -0.25rem;
}

body.page main .tool-seo-content .tool-seo-content__body,
.tool-seo-content__body {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  background-color: var(--tool-seo-content-bg) !important;
  border: 1px solid var(--tool-seo-content-border) !important;
  border-radius: var(--radius-md, 8px);
}

body.page main .tool-seo-content .tool-seo-content__body p,
.tool-seo-content__body p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--tool-seo-content-text) !important;
}

.tool-seo-content__body p + p {
  margin-top: 0.875rem;
}

body.page main .tool-seo-content .tool-seo-content__body a,
.tool-seo-content__body a {
  color: var(--tool-seo-content-link) !important;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 600px) {
  .tool-seo-content__body {
    padding: 0.875rem 1rem;
  }

  .tool-seo-content__body p {
    font-size: 0.875rem;
  }
}

/* Back to top — mobile (injected by js/main.js) */
.back-to-top {
  display: none;
  position: fixed;
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 120;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  min-width: 3rem;
  padding: 0.5rem 0.625rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary-button), var(--color-primary));
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 40, 80, 0.35);
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.back-to-top.is-visible {
  display: flex;
}

.back-to-top__arrow {
  font-size: 1.125rem;
  line-height: 1;
}

.back-to-top__label {
  font-size: 0.625rem;
}

.back-to-top:hover {
  background: linear-gradient(135deg, var(--color-primary-button-hover), var(--color-primary-hover));
  box-shadow: 0 6px 18px rgba(0, 40, 80, 0.42);
  transform: translateY(-1px);
}

.back-to-top:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

@media (min-width: 769px) {
  .back-to-top {
    display: none !important;
  }
}

