/* Site-wide palette. Important declarations in this layer outrank legacy
   unlayered !important rules. Keep interaction rules after base colors. */
@layer site-theme {
  :where(:root) {
    --page-bg: #ffffff !important;
    --page-surface: #ffffff !important;
    --page-surface-soft: #f8fafc !important;
    --page-hover: #f8fafc !important;
    --page-text: #1e293b !important;
    --page-heading: #0f172a !important;
    --page-muted: #64748b !important;
    --page-border: #e2e8f0 !important;
    --page-accent: #f58220 !important;
    --page-link: #0284c7 !important;
    --page-on-accent: #ffffff !important;
    --page-selection: #334155 !important;
  }
  :root, body.site-theme {
    --td-orange: var(--page-accent) !important;
    --td-surface: var(--page-surface) !important;
    --td-text: var(--page-text) !important;
    --td-muted: var(--page-muted) !important;
  }
  :where(html, body.site-theme) {
    background: var(--page-bg) !important;
    color: var(--page-text) !important;
    color-scheme: light !important;
  }
  body.site-theme .theme-toggle { display: none !important; }

  /* News labels need enough contrast for their white text. */
  body.site-theme .news-badge,
  body.site-theme .news-badge--default,
  body.site-theme .news-badge--alert,
  body.site-theme .news-badge--japan,
  body.site-theme .news-badge--taiwan,
  body.site-theme .news-badge--notice {
    background: #0284c7 !important;
    color: #ffffff !important;
    border: 0 !important;
  }
  body.site-theme .news-badge:hover,
  body.site-theme .news-badge:focus-visible {
    background: #0369a1 !important;
    color: #ffffff !important;
  }

  /* Country labels sit on light pills, so their text must stay dark. */
  body.site-theme .culture-card__media > span,
  body.site-theme .culture-card__media > span strong,
  body.site-theme .culture-card__media > span em {
    background: rgba(255, 255, 255, 0.96) !important;
    color: #0f172a !important;
  }

  /* Compact country badge on job/article thumbnails. */
  body.site-theme .job-card__country {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 2 !important;
    display: inline-flex !important;
    width: fit-content !important;
    max-width: max-content !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1e293b !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(4px);
  }
  body.site-theme .job-card__country img {
    width: 20px !important;
    min-width: 20px !important;
    height: 14px !important;
    max-width: 20px !important;
    flex: 0 0 20px !important;
    object-fit: cover !important;
    border-radius: 2px !important;
  }

  body.site-theme .culture-card__media > span {
    width: fit-content !important;
    max-width: max-content !important;
    white-space: nowrap !important;
  }
  body.site-theme .culture-card__media > span img {
    width: 19px !important;
    min-width: 19px !important;
    height: 13px !important;
    max-width: 19px !important;
    flex: 0 0 19px !important;
    object-fit: cover !important;
    border-radius: 2px !important;
  }

  /* Keep introduction cards separated and aligned like the market cards. */
  body.site-theme .about-category-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }
  body.site-theme .about-profile-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 20px !important;
    padding: 16px !important;
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  }
  body.site-theme .about-profile-card__media {
    width: 240px !important;
    min-width: 240px !important;
    flex: 0 0 240px !important;
    aspect-ratio: auto !important;
    height: 140px !important;
    border-radius: 8px !important;
  }
  body.site-theme .about-profile-card__body {
    min-width: 0 !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0 !important;
  }

  @media (max-width: 767px) {
    body.site-theme .about-category-grid { gap: 16px !important; }
    body.site-theme .about-profile-card {
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 12px !important;
    }
    body.site-theme .about-profile-card__media {
      width: 100% !important;
      min-width: 0 !important;
      flex-basis: auto !important;
      height: auto !important;
      aspect-ratio: 16 / 9 !important;
    }
  }

  /* Give the news list more breathing room on tablet widths. */
  @media (min-width: 768px) and (max-width: 1199px) {
    .news-showcase__grid {
      grid-template-columns: minmax(0, 1fr) minmax(330px, 1fr) !important;
      gap: 12px !important;
    }
    .news-list__item {
      min-height: 0 !important;
      height: auto !important;
      padding: 12px 4px !important;
    }
    .news-list__item h3 {
      font-size: 13px !important;
      line-height: 1.45 !important;
      -webkit-line-clamp: 3 !important;
    }
  }

  /* Match introduction heading and breadcrumb treatment to market pages. */
  body.site-theme .about-category-page .about-category-heading {
    position: relative;
    width: 100%;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  body.site-theme .about-category-page .box-breadcrumb {
    border-bottom: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 4px !important;
  }
  body.site-theme .about-category-page .box-breadcrumb .breadcrumb {
    margin-bottom: 0 !important;
  }
  body.site-theme .about-category-page .box-posts-pages {
    padding-top: 8px !important;
  }

  /* Advisory category cards: compact, aligned header and equal-height content. */
  body.site-theme .advisory-study-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
  }
  body.site-theme .advisory-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
  }
  body.site-theme .advisory-card__header {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) 34px !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 14px 11px !important;
  }
  body.site-theme .advisory-card__header > span {
    grid-row: 1 / 3 !important;
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
    border-radius: 11px !important;
    font-size: 17px !important;
  }
  body.site-theme .advisory-card__header > div {
    grid-column: 2 !important;
    grid-row: 1 / 3 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 2px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    margin-top: 0 !important;
  }
  body.site-theme .advisory-card__header small {
    order: 2 !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    color: #64748b !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    letter-spacing: .35px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  body.site-theme .advisory-card__header h2 {
    order: 1 !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  body.site-theme .advisory-card__header > a {
    grid-column: 3 !important;
    grid-row: 1 / 3 !important;
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
    transition: color .22s ease, background-color .22s ease, transform .22s ease !important;
  }
  body.site-theme .advisory-card__header > a:hover,
  body.site-theme .advisory-card__header > a:focus-visible {
    color: #fff !important;
    background: #087fbd !important;
    transform: translateX(3px) !important;
  }
  body.site-theme .advisory-card__content {
    display: flex !important;
    flex: 1 !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 20px 24px 24px !important;
  }
  body.site-theme .advisory-card__visual {
    width: 100% !important;
    height: 160px !important;
    aspect-ratio: auto !important;
    flex: 0 0 160px !important;
    border-radius: 8px !important;
  }
  body.site-theme .advisory-card__visual--guide {
    color: #ffffff !important;
    background: linear-gradient(145deg, #0b2944, #087fbd) !important;
  }
  body.site-theme .advisory-card__visual--guide span,
  body.site-theme .advisory-card__visual--guide i { color: #ffffff !important; }
  body.site-theme .advisory-card__copy {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    row-gap: 8px !important;
    flex: 1 !important;
  }
  body.site-theme .advisory-card__copy h3 {
    grid-column: 1 / -1 !important;
    margin: 12px 0 8px !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
  }
  body.site-theme .advisory-card__copy p {
    min-width: 0 !important;
    margin: 0 !important;
  }
  body.site-theme .advisory-card__button {
    grid-column: 1 !important;
    grid-row: 3 !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  @media (max-width: 767px) {
    body.site-theme .advisory-card__header {
      grid-template-columns: 36px minmax(0, 1fr) 30px !important;
      gap: 7px !important;
      padding: 8px 10px 9px !important;
    }
    body.site-theme .advisory-card__header > span {
      width: 36px !important;
      height: 36px !important;
      flex-basis: 36px !important;
    }
    body.site-theme .advisory-card__header > a {
      width: 30px !important;
      height: 30px !important;
      flex-basis: 30px !important;
    }
    body.site-theme .advisory-card__header > div { gap: 1px !important; }
    body.site-theme .advisory-card__header > div,
    body.site-theme .advisory-card__header h2,
    body.site-theme .advisory-card__header small { max-width: 100% !important; }
    body.site-theme .advisory-card__header h2 { font-size: 16px !important; }
    body.site-theme .advisory-card__header small { font-size: 8px !important; letter-spacing: 0 !important; }
    body.site-theme .advisory-card__content { padding: 14px 12px 16px !important; }
    body.site-theme .advisory-card__copy { row-gap: 6px !important; }
    body.site-theme .advisory-card__copy p { font-size: 12px !important; line-height: 1.45 !important; }
    body.site-theme .advisory-card__button { grid-column: 1 !important; grid-row: 3 !important; padding: 7px 8px !important; font-size: 11px !important; }
  }

  /* Footer statistics and social links share one compact horizontal bar. */
  body.site-theme .corporate-footer__grid > .footer-column:last-child {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    padding: 12px 20px !important;
    border-top: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
  }
  @media (min-width: 768px) and (max-width: 1199px) {
    body.site-theme .corporate-footer__grid > .footer-column:last-child {
      flex-wrap: nowrap !important;
      gap: 12px !important;
      padding: 10px 14px !important;
      min-width: 0 !important;
    }
    body.site-theme .footer-stats {
      flex: 1 1 auto !important;
      min-width: 0 !important;
      justify-content: space-between !important;
      gap: 10px !important;
      font-size: 11px !important;
    }
    body.site-theme .footer-stats span {
      gap: 4px !important;
      font-size: 11px !important;
    }
    body.site-theme .footer-stats strong { margin-left: 2px !important; }
    body.site-theme .footer-socials {
      flex: 0 0 auto !important;
      gap: 7px !important;
    }
    body.site-theme .footer-socials a {
      width: 30px !important;
      height: 30px !important;
      min-width: 30px !important;
      min-height: 30px !important;
    }
  }

  /* Footer fallback for pages without the site-theme body class. */
  @media (min-width: 768px) and (max-width: 1199px) {
    .corporate-footer__grid > .footer-column:last-child {
      display: flex !important;
      align-items: center !important;
      justify-content: space-between !important;
      flex-wrap: nowrap !important;
      gap: 12px !important;
      min-width: 0 !important;
      padding: 10px 14px !important;
    }
    .corporate-footer__grid > .footer-column:last-child > h3 { display: none !important; }
    .footer-stats {
      display: flex !important;
      flex: 1 1 auto !important;
      align-items: center !important;
      justify-content: space-between !important;
      min-width: 0 !important;
      gap: 10px !important;
      margin: 0 !important;
    }
    .footer-stats span {
      min-width: 0 !important;
      gap: 4px !important;
      margin: 0 !important;
      padding: 0 !important;
      border: 0 !important;
      font-size: 11px !important;
      white-space: nowrap !important;
    }
    .footer-socials {
      display: flex !important;
      flex: 0 0 auto !important;
      gap: 7px !important;
      margin: 0 !important;
    }
  }

  @media (max-width: 767px) {
    .corporate-footer__grid > .footer-column:last-child {
      display: block !important;
      min-width: 0 !important;
      padding: 9px 10px !important;
    }
    .corporate-footer__grid > .footer-column:last-child > h3 { display: none !important; }
    .footer-stats {
      display: grid !important;
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      align-items: center !important;
      gap: 4px !important;
      width: 100% !important;
      margin: 0 !important;
    }
    .footer-stats span {
      display: flex !important;
      min-width: 0 !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 3px !important;
      margin: 0 !important;
      padding: 0 !important;
      border: 0 !important;
      overflow: hidden !important;
      font-size: 9px !important;
      white-space: nowrap !important;
      text-overflow: ellipsis !important;
    }
    .footer-stats strong { margin-left: 0 !important; }
    .footer-socials {
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 7px !important;
      width: 100% !important;
      margin: 8px 0 0 !important;
    }
    .footer-socials a {
      width: 28px !important;
      height: 28px !important;
      min-width: 28px !important;
      min-height: 28px !important;
    }
  }
  body.site-theme .corporate-footer__grid > .footer-column:last-child > h3 { display: none !important; }
  body.site-theme .footer-stats {
    display: flex !important; align-items: center !important; gap: 20px !important;
    margin: 0 !important; font-size: 13px !important; color: #475569 !important;
  }
  body.site-theme .footer-stats span {
    display: inline-flex !important; align-items: center !important; gap: 6px !important;
    margin: 0 !important; white-space: nowrap !important;
  }
  body.site-theme .footer-stats span i { color: #0284c7 !important; }
  body.site-theme .footer-socials {
    display: flex !important; align-items: center !important; gap: 12px !important; margin: 0 !important;
  }
  body.site-theme .footer-socials a {
    display: inline-flex !important; width: 32px !important; height: 32px !important;
    align-items: center !important; justify-content: center !important;
    border: 1px solid #e2e8f0 !important; border-radius: 50% !important;
    background: #ffffff !important; color: #0284c7 !important;
  }
  body.site-theme .footer-socials a:hover { background: #e0f2fe !important; color: #0369a1 !important; }
  body.site-theme .corporate-footer__bottom {
    margin-top: 12px !important; padding-top: 8px !important;
    border-top: 1px dashed #e2e8f0 !important; color: #64748b !important;
    font-size: 12px !important; text-align: center !important;
  }
  body.site-theme .about-category-page .about-category-heading {
    margin-bottom: 1.5rem !important;
    padding: 0 0 0.5rem !important;
    border-bottom: 2px solid #e5e5e5 !important;
  }
  body.site-theme .about-category-page .about-category-heading::after {
    content: none !important;
  }
  body.site-theme .about-category-page .about-category-heading::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    bottom: -2px !important;
    width: calc(30% - 150px) !important;
    height: 2px !important;
    border-radius: 0 !important;
    background: #0284c7 !important;
  }
  body.site-theme .about-category-page .about-category-heading h1 {
    margin: 10px 0 0 !important;
    color: #1490d2 !important;
    font-family: 'Myriad Pro Semibold', sans-serif !important;
    font-size: 18px !important;
    line-height: 1.4 !important;
    text-transform: uppercase !important;
  }
  /* Inherit through nested editor spans and legacy component wrappers. */
  :where(body.site-theme *) { color: inherit !important; }
  :where(body.site-theme h1, body.site-theme h2, body.site-theme h3,
    body.site-theme h4, body.site-theme h5, body.site-theme h6,
    body.site-theme .title, body.site-theme .post-title) {
    color: var(--page-heading) !important;
  }
  :where(body.site-theme :is(.job-card,.culture-card,.about-profile-card,
    .advisory-card,.content-row-card,.content-category-card,.news-list__item,
    .sidebar-card,.contact-form-card,.contact-office-card)
    :is(p,small,time,label,.description,.meta)) {
    color: var(--page-muted) !important;
  }
  :where(body.site-theme a) { color: var(--page-link) !important; }
  :where(body.site-theme :is(h1,h2,h3,h4,h5,h6,.title,.post-title) a) {
    color: inherit !important;
  }
  :where(body.site-theme :is(article,main,.box-single-post,.box-introudes-pages,
    .box-services-pages,.box-posts-pages,.box-works-pages,.contact-page-section,
    .advisory-study-section,.bg-intro,.bg-service,.homepage-full-sections)) {
    background: var(--page-bg) !important;
  }
  :where(body.site-theme :is(.card,.post-card,.post-item,.post-item-large,
    .post-item-small,.post-item-pages,.project-item,.box-service,.box-content,
    .job-card,.culture-card,.advisory-card,.about-profile-card,.about-bento-card,
    .content-row-card,.content-category-card,.related-post-card,.news-list__item,
    .featured-news,.sidebar-card,.sidebar-cta-card,.contact-form-card,
    .contact-office-card,.comment-review-section,.comment-empty,.block-post-related,
    .panel,.panel-heading,.card-header,.card-body,.modal-content,.dropdown-menu,
    .header-language__menu,.sub-menu,.search-overlay,.search-overlay__form,
    .box-breadcrumb,.breadcrumb,.box-header,.header-main,.header-topbar,
    .wsmobileheader,.corporate-footer,.corporate-footer__main,.box-footer,
    .ai-chatbot__panel,.ai-chatbot__welcome,.ai-chatbot__header,
    .ai-chatbot__quick,.ai-chatbot__composer,.ai-message--bot,
    .sidebar-card__header,.advisory--item,.block-sidebar-intro-work ul,
    .block-sidebar-video .block-list-video li,.box-categories-posts,
    .box-categories-posts .block-header-title,.box-categories-posts .block-warpper-content,
    .sidebar-cta-card .collapse,.sidebar-cta-card .collapsing)) {
    background: var(--page-surface) !important;
    border-color: var(--page-border) !important;
    color: var(--page-text) !important;
  }
  :where(body.site-theme :is(.wsmenu-list,.header-navigation,.site-header)) {
    background-color: var(--page-surface) !important;
  }
  :where(body.site-theme :is(.header-navigation,.header-language__menu,
    .header-contact,.footer-links,.breadcrumb) a) {
    color: var(--page-text) !important;
  }
  :where(body.site-theme :is(input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
    textarea,select,.form-control,.SumoSelect > .CaptionCont,.SumoSelect > .optWrapper)) {
    background: var(--page-surface) !important;
    border-color: var(--page-border) !important;
    color: var(--page-text) !important;
    caret-color: var(--page-heading);
  }
  :where(body.site-theme input, body.site-theme textarea)::placeholder {
    color: var(--page-muted) !important;
    opacity: .8;
  }
  :where(body.site-theme :is(table,td,th,.post-share,.news-list,.job-card__info li,
    .comment-item,.modal-header,.modal-footer,.contact-office-heading)) {
    border-color: var(--page-border) !important;
  }
  :where(body.site-theme :is(.table,.table-striped tbody tr:nth-of-type(odd),
    .ai-chatbot__messages)) { background: var(--page-bg) !important; }
  :where(body.site-theme :is(.section-eyebrow,.sidebar-card__icon,.about-bento-icon,
    .contact-office-icon,.header-contact i,.header-tools i)) {
    color: var(--page-accent) !important;
    background-color: var(--page-surface) !important;
  }
  /* Text on photographs and colored badges needs a stable light foreground. */
  :where(body.site-theme :is(.featured-news__caption,.activity-gallery-item__caption,
    .activity-gallery-item__overlay,.culture-card__media > span,.news-badge,
    .job-card__country,.job-card__hot,.ai-message--user)) {
    color: var(--page-on-accent) !important;
  }
  :where(body.site-theme :is(.featured-news__caption,.activity-gallery-item__caption,
    .activity-gallery-item__overlay) :is(h1,h2,h3,h4,h5,h6,a,p)) {
    color: inherit !important;
  }
  :where(body.site-theme :is(.project-item .overlay-content,.project-item .overlay-information)) {
    background: var(--page-surface) !important;
  }
  /* Preserve the article background cleanup in both themes. */
  :where(body.site-theme :is(.post-content,.panel-warpper-content,.text-justify) *) {
    background: transparent !important;
    background-color: transparent !important;
  }
  :where(body.site-theme :is(.post-content,.panel-warpper-content,.text-justify) a) {
    color: var(--page-link) !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
  }
  /* Card hover and keyboard navigation share the same palette. */
  :where(body.site-theme :is(.card,.post-card,.post-item,.post-item-large,
    .post-item-small,.post-item-pages,.item,.project-item,.box-service,.job-card,
    .culture-card,.advisory-card,.about-profile-card,.about-bento-card,
    .content-row-card,.content-category-card,.related-post-card,.news-list__item,
    .featured-news,.sidebar-cta-card):is(:hover,:focus-within)) {
    background: var(--page-hover) !important;
    border-color: var(--page-accent) !important;
    color: var(--page-text) !important;
  }
  :where(body.site-theme :is(.card,.post-card,.post-item,.post-item-large,
    .post-item-small,.post-item-pages,.item,.project-item,.box-service,.job-card,
    .culture-card,.advisory-card,.about-profile-card,.about-bento-card,
    .content-row-card,.content-category-card,.related-post-card,.news-list__item,
    .featured-news,.sidebar-cta-card):is(:hover,:focus-within)
    :is(h1,h2,h3,h4,h5,h6,.title,.post-title)) {
    color: var(--page-accent) !important;
  }
  :where(body.site-theme a:is(:hover,:focus-visible),
    body.site-theme .header-navigation li:is(:hover,:focus-within,.active) > a) {
    color: var(--page-accent) !important;
  }
  :where(body.site-theme a:is(:hover,:focus-visible) *) {
    color: inherit !important;
  }
  :where(body.site-theme :is(.sub-menu,.header-language__menu) a:is(:hover,:focus-visible)) {
    background: var(--page-hover) !important;
  }
  /* Controls and detail arrows: orange background with white label/icon. */
  :where(body.site-theme :is(button,input[type=submit],input[type=button],.btn,
    .header-cta,.contact-button,.post-share__button,.advisory-card__button,
    .about-profile-card__link,.content-row-card__link,.job-card__footer a,
    .readmore a,.btn-back-post,.sidebar-socials a,.footer-socials a,
    .ai-message__contact-link,.page-link,.pagination > li > a,.back-to-top)) {
    color: var(--page-link) !important;
    background-color: var(--page-surface) !important;
    border-color: var(--page-border) !important;
  }
  .ai-message__live-link { border: 0; cursor: pointer; font: inherit; }
  :where(body.site-theme :is(.btn-primary,.btn-danger,.contact-submit-button,
    .comment-submit-btn,.sidebar-form-submit,.header-cta,.contact-button,
    .post-share__button,.ai-chatbot__launcher,.ai-chatbot__composer button,
    .ai-chatbot__lead button,#footer-consult-form button,.job-filter__button.active,
    .pagination > .active > a)) {
    background: var(--page-accent) !important;
    color: var(--page-on-accent) !important;
  }
  :where(body.site-theme :is(button,input[type=submit],input[type=button],.btn,
    .header-cta,.contact-button,.post-share__button,.advisory-card__button,
    .about-profile-card__link,.content-row-card__link,.job-card__footer a,
    .readmore a,.btn-back-post,.sidebar-socials a,.footer-socials a,
    .ai-message__contact-link,.page-link,.pagination > li > a,.back-to-top):is(:hover,:focus-visible):not(:disabled):not(.disabled):not([aria-disabled=true])) {
    background: var(--page-accent) !important;
    border-color: var(--page-accent) !important;
    color: var(--page-on-accent) !important;
    filter: none !important;
  }
  :where(body.site-theme :is(button,.btn,.header-cta,.contact-button,
    .post-share__button,.advisory-card__button,.about-profile-card__link,
    .content-row-card__link,.job-card__footer a,.readmore a,.btn-back-post,
    .sidebar-socials a,.footer-socials a,.ai-message__contact-link,.back-to-top) *) {
    color: inherit !important;
  }
  :where(body.site-theme :is(a,button,input,textarea,select)):focus-visible {
    outline: 2px solid var(--page-accent) !important;
    outline-offset: 3px !important;
  }

  /* Footer social icons: normalize the Font Awesome glyph box without changing Zalo/TikTok. */
  body.site-theme .footer-socials .social-facebook,
  body.site-theme .footer-socials .social-youtube {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  body.site-theme .footer-socials .social-facebook i,
  body.site-theme .footer-socials .social-youtube i {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 18px !important;
    line-height: 18px !important;
    vertical-align: middle !important;
  }
  body.site-theme .footer-socials .social-facebook i { transform: translate(1px, 1px); }
  body.site-theme .footer-socials .social-youtube i { transform: translate(0, 1px); }

  body.site-theme .sidebar-socials .social-facebook,
  body.site-theme .sidebar-socials .social-youtube {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  body.site-theme .sidebar-socials .social-facebook i,
  body.site-theme .sidebar-socials .social-youtube i {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 18px !important;
    line-height: 18px !important;
    vertical-align: middle !important;
  }
  body.site-theme .sidebar-socials .social-facebook i { transform: translate(1px, 1px); }
  body.site-theme .sidebar-socials .social-youtube i { transform: translate(0, 1px); }

  /* Search overlay: the orange outline belongs to the rounded search shell, not the input. */
  body.site-theme .search-overlay__form {
    padding: 5px !important;
    border: 2px solid var(--td-orange) !important;
    border-radius: 999px !important;
    background: #fff !important;
    overflow: hidden !important;
  }
  body.site-theme .search-overlay__form input,
  body.site-theme .search-overlay__form input:focus {
    min-width: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }

  /* Use controlled visual bounds for Facebook/YouTube instead of Font Awesome font metrics. */
  body.site-theme .footer-socials .social-glyph,
  body.site-theme .sidebar-socials .social-glyph {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    color: currentColor !important;
  }
  body.site-theme .social-glyph--facebook {
    width: 13px !important;
    height: 20px !important;
    line-height: 1 !important;
    transform: translate(0, 0);
  }
  body.site-theme .social-glyph--facebook svg { display: block !important; width: 13px !important; height: 20px !important; }
  body.site-theme .social-glyph--youtube {
    position: relative !important;
    width: 19px !important;
    height: 14px !important;
    border-radius: 4px !important;
    background: currentColor !important;
    transform: translate(0, 0);
  }
  body.site-theme .social-glyph--youtube > span {
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    margin-left: 1px !important;
    border-top: 4px solid transparent !important;
    border-bottom: 4px solid transparent !important;
    border-left: 6px solid #fff !important;
  }
  :where(body.site-theme,body.site-theme *)::selection {
    background: var(--page-selection) !important;
    color: var(--page-on-accent) !important;
  }
}

@media (min-width: 1200px) {
  body.site-theme .corporate-footer__grid > .footer-company {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  body.site-theme .corporate-footer__grid > .footer-consult {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
  body.site-theme .corporate-footer__grid > .footer-column.footer-statistics:last-child {
    grid-column: auto !important;
    display: block !important;
    align-items: initial !important;
    justify-content: initial !important;
    flex-wrap: initial !important;
    gap: initial !important;
    padding: 0 !important;
    border-top: 0 !important;
    background: transparent !important;
  }
  body.site-theme .corporate-footer__grid > .footer-column.footer-statistics:last-child > h3 {
    display: block !important;
  }
  body.site-theme .corporate-footer__grid > .footer-column.footer-statistics:last-child .footer-stats {
    display: grid !important;
    grid-template-columns: 1fr !important;
    flex-direction: initial !important;
  }
}
/* Current footer desktop layout: three equal-height content columns. */
@media (min-width: 1200px) {
  body.site-theme .corporate-footer__grid {
    grid-template-columns: 35% 40% 25% !important;
    align-items: start !important;
  }
  body.site-theme .corporate-footer__grid > .footer-statistics {
    grid-column: auto !important;
    display: block !important;
    padding: 0 !important;
    border-top: 0 !important;
    background: transparent !important;
  }
  body.site-theme .footer-stats {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    align-items: initial !important;
  }
  body.site-theme .footer-stats span {
    display: flex !important;
    white-space: normal !important;
  }
  body.site-theme .footer-socials {
    margin-top: 20px !important;
  }
  body.site-theme .footer-action {
    min-height: 42px !important;
    padding: 8px 10px !important;
    font-size: 11px !important;
  }
}

/* Footer layout only: keep the current UI and place the three sections in columns. */
@media (min-width: 1200px) {
  body.site-theme .corporate-footer__grid {
    display: grid !important;
    grid-template-columns: 35% 40% 25% !important;
    align-items: start !important;
  }
  body.site-theme .corporate-footer__grid > .footer-column.footer-statistics:last-child {
    grid-column: 3 !important;
    grid-row: 1 !important;
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }
  body.site-theme .corporate-footer__grid > .footer-column.footer-statistics:last-child > h3 {
    display: block !important;
  }
  body.site-theme .corporate-footer__grid > .footer-column.footer-statistics:last-child .footer-stats {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
}

/* Footer layout correction: preserve existing appearance, only fix column placement. */
@media (min-width: 1200px) {
  body.site-theme .corporate-footer__grid {
    display: grid !important;
    grid-template-columns: 35% 40% 25% !important;
    align-items: start !important;
  }
  body.site-theme .corporate-footer__grid > .footer-company { grid-column: 1 !important; grid-row: 1 !important; }
  body.site-theme .corporate-footer__grid > .footer-consult { grid-column: 2 !important; grid-row: 1 !important; }
  body.site-theme .corporate-footer__grid > .footer-statistics { grid-column: 3 !important; grid-row: 1 !important; display: block !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
  body.site-theme .corporate-footer__grid > .footer-statistics > h3 { display: block !important; }
  body.site-theme .corporate-footer__grid > .footer-statistics .footer-stats { display: grid !important; grid-template-columns: 1fr !important; }
}
.corporate-footer__bottom .footer-socials { display: flex !important; align-items: center !important; justify-content: center !important; }

@media (min-width: 992px) {
  footer.corporate-footer .corporate-footer__grid { display:grid!important; grid-template-columns:minmax(0,35fr) minmax(0,40fr) minmax(0,25fr)!important; gap:24px!important; align-items:start!important; }
  footer.corporate-footer .corporate-footer__grid > .footer-company { grid-column:1!important; grid-row:1!important; }
  footer.corporate-footer .corporate-footer__grid > .footer-consult { grid-column:2!important; grid-row:1!important; padding-top:30px!important; min-width:0!important; }
  footer.corporate-footer .corporate-footer__grid > .footer-statistics { grid-column:3!important; grid-row:1!important; padding-top:30px!important; }
}
@media (max-width: 991px) {
  footer.corporate-footer .corporate-footer__grid { display:grid!important; grid-template-columns:1fr!important; gap:24px!important; }
  footer.corporate-footer .corporate-footer__grid > .footer-company,
  footer.corporate-footer .corporate-footer__grid > .footer-consult,
  footer.corporate-footer .corporate-footer__grid > .footer-statistics { grid-column:1!important; grid-row:auto!important; padding-top:0!important; min-width:0!important; }
  footer.corporate-footer .footer-statistics .footer-stats { display:grid!important; grid-template-columns:1fr!important; }
}
