/* Tato Talk shared language and color-theme controls. */
:root[data-theme="dark"] {
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #f8fafc !important;
  --surface: #ffffff !important;
  --surface-soft: rgba(255, 255, 255, 0.94) !important;
  --line: rgba(15, 23, 42, 0.13) !important;
  --text: #0f172a !important;
  --muted: #64748b !important;
}

.language button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  margin: 0;
  padding: 3px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.language button:hover,
.language button:focus-visible {
  color: #ffffff;
  outline: none;
  background: rgba(14, 165, 233, 0.34);
}

.language button.active,
.language button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--brand, #0ea5e9);
}

.theme-toggle {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.theme-toggle .theme-glyph {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.theme-toggle:hover .theme-glyph {
  transform: rotate(18deg);
}

.theme-toggle:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 3px;
}

.mobile-preferences {
  display: none;
}

:root[data-theme="light"] body {
  background: #f8fafc !important;
  color: #0f172a !important;
}

:root[data-theme="light"] .site-shell {
  background: linear-gradient(180deg, #f8fafc 0%, #eef6ff 44%, #f8fafc 100%) !important;
}

:root[data-theme="light"] .site-header {
  border-bottom-color: rgba(15, 23, 42, 0.12) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

:root[data-theme="light"] .brand,
:root[data-theme="light"] .desktop-nav,
:root[data-theme="light"] .desktop-nav a,
:root[data-theme="light"] .mobile-nav a {
  color: #334155 !important;
}

:root[data-theme="light"] .desktop-nav a:hover,
:root[data-theme="light"] .desktop-nav a[aria-current="page"],
:root[data-theme="light"] .mobile-nav a:hover,
:root[data-theme="light"] .mobile-nav a[aria-current="page"] {
  color: #0284c7 !important;
}

:root[data-theme="light"] .language,
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .menu-toggle {
  border-color: rgba(15, 23, 42, 0.14) !important;
  background: rgba(241, 245, 249, 0.94) !important;
  color: #475569 !important;
}

:root[data-theme="light"] .language button:hover,
:root[data-theme="light"] .language button:focus-visible,
:root[data-theme="light"] .language button.active,
:root[data-theme="light"] .language button[aria-pressed="true"] {
  color: #ffffff !important;
}

:root[data-theme="light"] .mobile-nav,
:root[data-theme="light"] .site-header.is-menu-open .desktop-nav {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: #ffffff !important;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12) !important;
}

:root[data-theme="light"] .hero,
:root[data-theme="light"] .page-hero,
:root[data-theme="light"] .site-main {
  color: #0f172a;
}

:root[data-theme="light"] .section,
:root[data-theme="light"] .news-section,
:root[data-theme="light"] .section.alt,
:root[data-theme="light"] .document-area {
  border-color: rgba(15, 23, 42, 0.1) !important;
  background: rgba(241, 245, 249, 0.78) !important;
}

:root[data-theme="light"] .feature,
:root[data-theme="light"] .step,
:root[data-theme="light"] .scenario,
:root[data-theme="light"] .chat-card,
:root[data-theme="light"] .news-item,
:root[data-theme="light"] .doc-toc,
:root[data-theme="light"] .document-card,
:root[data-theme="light"] .faq-item,
:root[data-theme="light"] .left,
:root[data-theme="light"] .right,
:root[data-theme="light"] .newsc > ul > li,
:root[data-theme="light"] .article-nav p {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.07) !important;
}

:root[data-theme="light"] .feature:hover,
:root[data-theme="light"] .step:hover,
:root[data-theme="light"] .newsc > ul > li:hover,
:root[data-theme="light"] .news-item:hover {
  border-color: rgba(14, 165, 233, 0.42) !important;
  background: #ffffff !important;
}

:root[data-theme="light"] .hero h1,
:root[data-theme="light"] .hero h1 span,
:root[data-theme="light"] .section h2,
:root[data-theme="light"] .feature h3,
:root[data-theme="light"] .step h3,
:root[data-theme="light"] .scenario strong,
:root[data-theme="light"] .page-hero h1,
:root[data-theme="light"] .document-card h2,
:root[data-theme="light"] .faq-item summary,
:root[data-theme="light"] .right > .title,
:root[data-theme="light"] .blog-list-heading h1,
:root[data-theme="light"] .newsc h3 a,
:root[data-theme="light"] .content h2,
:root[data-theme="light"] .content h3,
:root[data-theme="light"] .content h4,
:root[data-theme="light"] .chat-profile strong {
  color: #0f172a !important;
}

:root[data-theme="light"] .hero-copy,
:root[data-theme="light"] .section-intro,
:root[data-theme="light"] .feature p,
:root[data-theme="light"] .step p,
:root[data-theme="light"] .scenario p,
:root[data-theme="light"] .page-hero p,
:root[data-theme="light"] .doc-section p,
:root[data-theme="light"] .faq-item p,
:root[data-theme="light"] .blog-list-description,
:root[data-theme="light"] .newsc h3 + p,
:root[data-theme="light"] .post-time,
:root[data-theme="light"] .content,
:root[data-theme="light"] .article-nav p,
:root[data-theme="light"] .footer-row,
:root[data-theme="light"] .footer-inner {
  color: #475569 !important;
}

:root[data-theme="light"] .bubble {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

:root[data-theme="light"] .bubble.out {
  background: linear-gradient(100deg, #0284c7, #38bdf8) !important;
  color: #ffffff !important;
}

:root[data-theme="light"] .hero-secondary,
:root[data-theme="light"] .news-more a,
:root[data-theme="light"] .blog-detail-back,
:root[data-theme="light"] .quick-action {
  border-color: rgba(15, 23, 42, 0.16) !important;
  background: #ffffff !important;
  color: #334155 !important;
}

:root[data-theme="light"] .site-footer {
  border-top-color: rgba(15, 23, 42, 0.1) !important;
  background: #ffffff !important;
}

:root[data-theme="light"] .footer-links a:hover {
  color: #0284c7 !important;
}

:root[data-theme="light"] .skip-link {
  background: #0f172a !important;
  color: #ffffff !important;
}

@media (max-width: 900px) {
  .mobile-preferences {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  }

  .mobile-preferences .language {
    display: flex !important;
    width: fit-content;
  }

  .mobile-preferences .theme-toggle {
    display: grid !important;
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle .theme-glyph,
  .language button {
    transition: none;
  }
}
