/* Shared contract for tenant-branded secondary pages. The source theme supplies
   each site's tokens; this bridge keeps generic routes readable and consistent. */
.tenant-internal-page {
  --tenant-footer-bg: var(--surface, #fff);
  --tenant-footer-text: var(--text-secondary, var(--muted, #60697a));
  --tenant-footer-heading: var(--text-primary, var(--ink, #171a22));
  color: var(--text-primary, var(--ink, #171a22));
}

.tenant-internal-page[data-tenant-theme="ytsave"] {
  background: var(--surface-muted, var(--paper, #f7f8fa));
}

body.showing-result[data-tenant-theme="ytsave"] .hero {
  max-width: 1240px;
}

body.showing-result[data-tenant-theme="ytsave"] .hero > .result-panel {
  width: 100%;
  max-width: 1120px;
}

.tenant-internal-page[data-tenant-theme="ytsave"] .site-header {
  width: min(1240px, 100%);
  background: transparent;
}

.tenant-internal-page[data-tenant-theme="ytsave"] .site-header .brand-logo {
  width: auto;
  max-width: 220px;
  max-height: 52px;
  object-fit: contain;
}

.tenant-internal-page[data-tenant-theme="ytsave"] footer {
  width: min(1240px, calc(100% - 40px));
  margin: 80px auto 20px;
  padding: clamp(28px, 4vw, 50px);
  border: 1px solid var(--border, var(--line, #e5e6eb));
  border-radius: var(--radius, 18px);
  background: var(--tenant-footer-bg);
  color: var(--tenant-footer-text);
  box-shadow: var(--shadow, 0 24px 70px rgba(25, 26, 34, .09));
}

.tenant-internal-page[data-tenant-theme="ytsave"] footer strong {
  color: var(--tenant-footer-heading);
}

.tenant-internal-page[data-tenant-theme="ytsave"] footer a,
.tenant-internal-page[data-tenant-theme="ytsave"] footer p,
.tenant-internal-page[data-tenant-theme="ytsave"] footer .copyright {
  color: var(--tenant-footer-text);
}

.tenant-internal-page[data-tenant-theme="ytsave"] footer a:hover {
  color: var(--brand-primary, var(--accent));
}

.tenant-internal-page[data-tenant-theme="ytsave"] footer .footer-legal {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 7px;
  padding: 0;
  border: 0;
  font-size: inherit;
}

.tenant-internal-page:is([data-tenant-theme="dwtt"], [data-tenant-theme="ffast"], [data-tenant-theme="socialvideosaver"]) {
  --tenant-footer-bg: var(--brand-secondary, #20252d);
  --tenant-footer-text: #dbe6ff;
  --tenant-footer-heading: #fff;
}

body:is([data-tenant-theme="dwtt"], [data-tenant-theme="ffast"], [data-tenant-theme="socialvideosaver"]) {
  --tenant-footer-heading: #fff;
}

[data-reference-layout] .footer-menu-group > strong {
  color: var(--tenant-footer-heading);
}

.tenant-internal-page[data-tenant-theme="ytsave"] footer .copyright {
  border-color: color-mix(in srgb, var(--tenant-footer-text) 24%, transparent);
}

/* Loaded after every tenant theme: keep dark platform marks from disappearing
   into a theme's generic dark icon tile. */
.service-card > .service-icon {
  background: var(--brand-bg, #f0f1f4);
  color: var(--brand-color, #30343d);
  border-color: color-mix(in srgb, var(--brand-color, #30343d) 18%, transparent);
}

.service-icon > .service-glyph {
  background: var(--brand-color, #30343d);
}

/* Surface components must own their text color instead of inheriting a
   contrasting page-level color from dark tenant themes. */
.service-card,
.source-control-card,
.extractor-row {
  color: var(--text-primary, var(--ink));
}

/* DWTT's reference system is navy + cyan. Keep shared catalog components in
   that system instead of leaking the generic rose directory treatment. */
body[data-tenant-theme="dwtt"] {
  --accent: var(--brand-primary, #00c9e8);
  --ink: var(--text-primary, #f8fbff);
  --muted: var(--text-secondary, #aebce1);
  --line: var(--border, #27345f);
}

body[data-tenant-theme="dwtt"] .site-header nav,
body[data-tenant-theme="dwtt"] .site-header nav a {
  color: var(--text-secondary, #aebce1);
}

body[data-tenant-theme="dwtt"] .site-header nav a:hover,
body[data-tenant-theme="dwtt"] .site-header nav a:focus-visible {
  color: var(--brand-primary, #00c9e8);
}

body[data-tenant-theme="dwtt"] .language-control .language,
body[data-tenant-theme="dwtt"] .api-link {
  border-color: color-mix(in srgb, var(--brand-primary, #00c9e8) 34%, var(--border, #27345f));
  background: var(--surface, #081238);
  color: var(--text-primary, #f8fbff);
  box-shadow: none;
}

body[data-tenant-theme="dwtt"] .language-control .language:hover,
body[data-tenant-theme="dwtt"] .language-control .language:focus-visible,
body[data-tenant-theme="dwtt"] .api-link:hover,
body[data-tenant-theme="dwtt"] .api-link:focus-visible {
  border-color: var(--brand-primary, #00c9e8);
  background: var(--surface-muted, #101d4b);
  color: #fff;
}

body[data-tenant-theme="dwtt"] .service-card,
body[data-tenant-theme="dwtt"] .source-control-card,
body[data-tenant-theme="dwtt"] .extractor-row {
  border-color: var(--border, #27345f);
  background: var(--surface, #081238);
  color: var(--text-primary, #f8fbff);
  box-shadow: none;
}

body[data-tenant-theme="dwtt"] .service-card strong,
body[data-tenant-theme="dwtt"] .extractor-row strong,
body[data-tenant-theme="dwtt"] .extractor-summary strong,
body[data-tenant-theme="dwtt"] .source-control-card {
  color: var(--text-primary, #f8fbff);
}

body[data-tenant-theme="dwtt"] .service-card small,
body[data-tenant-theme="dwtt"] .extractor-row small,
body[data-tenant-theme="dwtt"] .extractor-summary,
body[data-tenant-theme="dwtt"] .sources-hero > p,
body[data-tenant-theme="dwtt"] .source-control-card header > p,
body[data-tenant-theme="dwtt"] .source-control-card > small,
body[data-tenant-theme="dwtt"] .source-search > small,
body[data-tenant-theme="dwtt"] .catalog-page-size label {
  color: var(--text-secondary, #aebce1);
}

body[data-tenant-theme="dwtt"] .source-resolve,
body[data-tenant-theme="dwtt"] .source-search input,
body[data-tenant-theme="dwtt"] .source-filters select,
body[data-tenant-theme="dwtt"] .catalog-page-size select,
body[data-tenant-theme="dwtt"] .catalog-pagination a {
  border-color: var(--border, #27345f);
  background: var(--surface-muted, #101d4b);
  color: var(--text-primary, #f8fbff);
  box-shadow: none;
}

body[data-tenant-theme="dwtt"] .source-resolve input {
  background: transparent;
  color: var(--text-primary, #f8fbff);
}

body[data-tenant-theme="dwtt"] input::placeholder {
  color: color-mix(in srgb, var(--text-secondary, #aebce1) 82%, transparent);
  opacity: 1;
}

body[data-tenant-theme="dwtt"] .source-resolve button,
body[data-tenant-theme="dwtt"] .source-search button,
body[data-tenant-theme="dwtt"] .catalog-pagination a[aria-current="page"] {
  border-color: var(--brand-primary, #00c9e8);
  background: var(--brand-primary, #00c9e8);
  color: var(--brand-secondary, #050d2d);
}

body[data-tenant-theme="dwtt"] .adult-catalog-link {
  border-color: color-mix(in srgb, var(--brand-primary, #00c9e8) 45%, var(--border, #27345f));
  background: linear-gradient(135deg, var(--surface-muted, #101d4b), var(--surface, #081238));
  color: var(--text-primary, #f8fbff);
}

body[data-tenant-theme="dwtt"] .adult-catalog-link span,
body[data-tenant-theme="dwtt"] .adult-badge {
  color: var(--brand-primary, #00c9e8);
}

/* A short console must keep its intrinsic height beside longer editorial
   copy; grid's default stretch made it look like an oversized empty panel. */
[data-reference-layout] .focus-panel {
  align-items: center;
}

[data-reference-layout] .focus-panel .feature-console {
  height: auto;
  align-self: center;
}

[data-reference-layout] .reference-inner > .hero-copy h1 {
  color: var(--text-primary, #10162f) !important;
  opacity: 1;
}

/* Downf owns a centered, wide hero in its reference. It should read as a
   headline across the page, not as a narrow editorial column. */
[data-reference-layout="11"] .reference-centered .hero-copy {
  width: min(1100px, 100%);
  max-width: 1100px;
}

[data-reference-layout="11"] .reference-inner > .hero-copy h1 {
  max-width: 28ch;
  margin-inline: auto;
}

/* QuickT's reference hero is a saturated teal gradient. Copy outside the
   white downloader card must use the light-on-dark palette. */
[data-reference-layout="8"] .reference-home .hero-copy h1,
[data-reference-layout="8"] .reference-home .hero-copy p,
[data-reference-layout="8"] .reference-home .hero-copy .eyebrow,
[data-reference-layout="8"] .wide-url-workspace > .form-note,
[data-reference-layout="8"] .wide-url-workspace > .status {
  color: #fff !important;
  opacity: 1;
}

/* Every homepage owns one optimized editorial visual. It fills the intentional
   second column in the editorial introduction instead of creating a detached
   card or leaving that side of the section empty. */
.home-visual-section {
  display: grid !important;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: clamp(30px, 6vw, 76px);
  align-items: center;
}

.home-visual-section > .section-intro {
  min-width: 0;
}

.home-brand-visual {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: clamp(20px, 2.4vw, 32px);
  background: transparent;
}

.home-brand-visual > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* Footer branding belongs directly to the footer composition. Light variants
   need no card; dark variants use a crisp monochrome mark for contrast. */
[data-reference-layout] .footer-logo-plain {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 56px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

[data-reference-layout] .footer-logo-plain img {
  width: auto;
  max-width: 214px;
  max-height: 58px;
  object-fit: contain;
}

[data-reference-layout] .footer-variant-1 .footer-logo-plain img,
[data-reference-layout] .footer-variant-4 .footer-logo-plain img,
[data-reference-layout] .footer-variant-10 .footer-logo-plain img {
  filter: brightness(0) invert(1);
}

/* Layout ids extend beyond the five historical language variants. Keep every
   tenant panel readable instead of letting it collapse to content width. */
[data-reference-layout] .reference-language-menu {
  width: min(420px, calc(100vw - 24px));
  min-width: min(360px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  overflow: hidden;
  padding: 14px;
  color: var(--text-primary, #10162f);
  background: var(--surface, #fff);
}

[data-reference-layout] .reference-language-menu .language-panel-head {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 220px);
  gap: 14px;
  align-items: center;
  padding: 2px 2px 12px;
}

[data-reference-layout] .reference-language-menu .language-panel-head > div {
  display: grid;
  min-width: 0;
}

[data-reference-layout] .reference-language-menu .language-panel-head strong {
  color: var(--text-primary, #10162f);
  line-height: 1.35;
}

[data-reference-layout] .reference-language-menu .language-panel-head small,
[data-reference-layout] .reference-language-menu .language-option small {
  color: var(--text-secondary, #606986);
}

[data-reference-layout] .reference-language-menu .language-search,
[data-reference-layout] .reference-language-menu .language-search input {
  display: block;
  width: 100%;
  min-width: 0;
}

[data-reference-layout] .reference-language-menu .language-search input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border, #dbe0f5);
  border-radius: 999px;
  background: var(--surface-muted, #f3f5ff);
  color: var(--text-primary, #10162f);
}

[data-reference-layout] .reference-language-menu .language-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-height: min(480px, calc(100vh - 180px));
  overflow-x: hidden;
  overflow-y: auto;
}

[data-reference-layout] .reference-language-menu .language-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  opacity: 1;
  color: var(--text-primary, #10162f);
}

[data-reference-layout] .reference-language-menu .language-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-reference-layout] .reference-language-menu .language-option[hidden] {
  display: none !important;
}

.local-human-check {
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px !important;
  align-items: center;
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 4%, #fff);
  cursor: pointer;
}

.contact-form .local-human-check input[type="checkbox"] {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.local-human-check > span {
  display: grid;
  gap: 3px;
  color: var(--text-primary, var(--ink));
}

.local-human-check strong {
  color: inherit;
  font-size: 15px;
}

.local-human-check small {
  color: var(--text-secondary, var(--muted));
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 700px) {
  .home-brand-visual {
    width: 100%;
    border-radius: 20px;
  }

  .home-visual-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  [data-reference-layout] .reference-language-menu {
    position: fixed;
    top: 68px;
    right: 8px;
    left: 8px;
    width: auto;
    min-width: 0;
    max-width: none;
  }

  [data-reference-layout] .reference-language-menu .language-panel-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .tenant-internal-page .site-header {
    padding-inline: 16px;
    gap: 10px;
  }

  .tenant-internal-page .site-header .brand {
    width: 145px !important;
    max-width: 145px;
    flex: 0 1 145px;
    min-width: 0;
  }

  .tenant-internal-page .site-header .brand-logo {
    width: 100%;
    max-width: 145px;
    max-height: 44px;
    object-fit: contain;
  }

  .tenant-internal-page .site-header .header-actions {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .tenant-internal-page[data-reference-layout="0"] .site-header {
    grid-template-columns: minmax(0, 145px) auto auto;
    gap: 8px;
  }

  .tenant-internal-page[data-tenant-theme="ytsave"] .site-header {
    padding-inline: 16px;
  }

  .tenant-internal-page[data-tenant-theme="ytsave"] .site-header .brand-logo {
    max-width: 150px;
    max-height: 44px;
  }

  .tenant-internal-page[data-tenant-theme="ytsave"] footer {
    width: calc(100% - 28px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 28px 22px;
  }
}

@media (max-width: 480px) {
  .tenant-internal-page[data-tenant-theme="ytsave"] footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .tenant-internal-page[data-tenant-theme="ytsave"] footer .footer-apps a {
    background: color-mix(in srgb, var(--tenant-footer-bg) 86%, #fff);
    color: var(--tenant-footer-text);
  }
}
