/* Shared layout corrections, loaded after the existing theme and page styles. */
:root { --contact-bar-height: 0px; --page-gutter: max(40px, env(safe-area-inset-left), env(safe-area-inset-right)); }
html, body { min-width: 0; }
html { scroll-padding-bottom: calc(var(--contact-bar-height) + 16px); }
html.nav-open { overflow: hidden; }
.site-header { transition: transform 220ms ease; }
.site-header.is-scroll-hidden { transform: translateY(-100%); pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}
/* Fill the first viewport between the fixed navigation and contact bar. */
.reference-home > .ref-hero {
  height: calc(100svh - var(--header-height) - var(--contact-bar-height));
  height: calc(100dvh - var(--header-height) - var(--contact-bar-height));
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
}
@media (min-width: 761px) {
  .reference-home .ref-hero-copy { position: absolute; inset: 0; }
  .reference-home .ref-hero-media img { object-position: right bottom; }
}
.article-content { overflow-wrap: anywhere; }
.faq-permalink { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 24px 16px; }
.article-content :is(p, li, td, th) { max-width: 100%; }
:is(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (pointer: coarse), (max-width: 600px) {
  .site-header .round-tool { width: 44px; height: 44px; min-width: 44px; }
  .faq-category, .pagination a, .pagination span { min-height: 44px; }
  .contact-info-card:hover > div:last-child, .contact-info-card:focus-within > div:last-child { transform: none; }
}
@media (max-width: 360px) {
  .site-header .header-inner { gap: 8px; padding-inline: 12px; }
  .site-header .header-tools { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.site-shell { width: min(calc(100% - 2 * var(--page-gutter)), var(--shell)); }
.site-header .header-inner { padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); }
:is(.article-layout, .faq-layout, .inquiry-layout, .contact-page-layout, .ref-about-layout, .news-row, .download-row, .company-profile-grid, .company-culture-grid) > * { min-width: 0; }
:is(h1, h2, h3, .breadcrumb, .button, .download-row, .exsafe-footer-bottom, .contact-address, .menu-contact) { overflow-wrap: anywhere; }
.button { white-space: normal; text-align: center; }
.category-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.article-content :is(img, video) { max-width: 100% !important; height: auto !important; }
.article-content iframe { max-width: 100%; }
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; margin-block: 24px; }
.article-content .table-scroll table { display: table; min-width: 520px; margin: 0; }
.article-content pre { max-width: 100%; overflow-x: auto; }
.listing-card-media { height: auto; aspect-ratio: 4 / 3; }
.form-actions { flex-wrap: wrap; }
.form-field :is(input, select, textarea) { min-width: 0; max-width: 100%; font-size: 16px; }
.contact-address i { flex-shrink: 0; }
.contact-reference .contact-section::before { display: none; }
.contact-page-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
.product-detail-page .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
.contact-form-heading h2, .contact-details h2 { font-size: 32px; font-weight: 600; line-height: 1.3; }
.contact-details { padding-block: clamp(48px, 6vw, 82px); background: #f7fafc; }
.contact-details h2 { margin: 0; padding: 0 0 24px; border-bottom: 0; color: var(--ink); font-size: 32px; font-weight: 600; }
.contact-details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 18px; padding-block: 30px 0; }
.contact-info-card { display: flex; align-items: flex-start; gap: 16px; min-width: 0; min-height: 156px; padding: 26px 24px; border: 1px solid #dbe6ed; border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(27, 74, 102, .07); transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease; }
.contact-info-card:hover, .contact-info-card:focus-within { transform: translateY(-4px); border-color: var(--accent); background: var(--accent); box-shadow: 0 18px 38px rgba(0, 104, 183, .24); }
.contact-info-card > div:last-child { display: grid; grid-template-rows: auto minmax(38px, auto); gap: 4px; min-width: 0; transform-origin: left center; transition: transform 220ms ease; }
.contact-info-card--email > div:last-child { grid-template-rows: auto; }
.contact-info-card--email .contact-info-value + .contact-info-label { margin-top: 10px; }
.contact-info-card:hover > div:last-child, .contact-info-card:focus-within > div:last-child { transform: scale(1.06); }
.contact-info-icon { display: inline-flex; flex: 0 0 42px; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 50%; background: #eaf4fb; color: var(--accent); font-size: 18px; transition: color 220ms ease, background-color 220ms ease, transform 220ms ease; }
.contact-info-card:hover .contact-info-icon, .contact-info-card:focus-within .contact-info-icon { background: rgba(255, 255, 255, .18); color: #fff; transform: scale(1.08); }
.contact-info-label { display: flex; min-height: 20px; margin: 0; align-items: center; color: #6a7b84; font-size: 13px; line-height: 20px; }
.contact-info-value { display: block; min-height: 38px; margin: 0; padding-block: 5px; color: var(--accent); font-size: 24px; line-height: 1.5; overflow-wrap: anywhere; }
.contact-info-card p.contact-info-value { color: var(--ink); font-size: 16px; }
.contact-info-value:hover { color: var(--accent-deep); }
.contact-info-card:hover .contact-info-label, .contact-info-card:focus-within .contact-info-label { color: rgba(255, 255, 255, .78); }
.contact-info-card:hover .contact-info-value, .contact-info-card:focus-within .contact-info-value, .contact-info-card:hover p.contact-info-value, .contact-info-card:focus-within p.contact-info-value { color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .contact-info-card, .contact-info-card > div:last-child, .contact-info-icon { transition: none; }
  .contact-info-card:hover, .contact-info-card:focus-within, .contact-info-card:hover > div:last-child, .contact-info-card:focus-within > div:last-child, .contact-info-card:hover .contact-info-icon, .contact-info-card:focus-within .contact-info-icon { transform: none; }
}
@media (max-width: 980px) {
  .contact-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-info-card--phone { grid-column: 1 / -1; }
}
.exsafe-footer-group a { max-width: 100%; }
@media (min-width: 1600px) {
  :root { --page-gutter: max(80px, env(safe-area-inset-left), env(safe-area-inset-right)); }
}
/* Use one navigation breakpoint, including landscape tablets and browser zoom. */
@media (max-width: 1120px) {
  .site-header .primary-nav { display: none; position: absolute; inset: 100% 0 auto; height: auto; margin: 0; max-height: calc(100dvh - var(--header-height) - var(--contact-bar-height)); overflow-y: auto; overscroll-behavior: contain; background: #fff; padding: 12px max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); opacity: 1; pointer-events: auto; transform: none; white-space: normal; }
  .site-header .primary-nav.is-open { display: block; }
  .primary-nav > a, .nav-group > a, .mobile-nav-extra > a { display: flex; align-items: center; height: auto; min-height: 48px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .primary-nav a::after { display: none; }
  .nav-group { height: auto; }
  .nav-dropdown { position: static; display: block; width: auto; padding: 8px 0 12px 16px; border: 0; box-shadow: none; visibility: visible; opacity: 1; transform: none; }
  .nav-dropdown-title { display: none; }
  .nav-dropdown-links { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 20px; }
  .site-header .nav-dropdown-links a { min-height: 44px; padding: 8px 0; font-size: 13px; border: 0; gap: 10px; }
  .header-tools { margin-left: auto; }
  .site-header .nav-toggle { display: inline-flex; width: 44px; height: 44px; min-width: 44px; }
  .mobile-nav-extra { display: block; }
}
@media (max-width: 980px) {
  :root { --contact-bar-height: calc(58px + env(safe-area-inset-bottom)); --page-gutter: max(28px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  body { padding-bottom: var(--contact-bar-height); }
  .mobile-actions { display: grid; position: fixed; inset: auto 0 0; grid-template-columns: repeat(2,minmax(0,1fr)); min-height: var(--contact-bar-height); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); z-index: 28; }
  .mobile-actions a { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 58px; padding: 8px 12px; font-size: 14px; line-height: 1.35; text-align: center; }
  .mobile-actions a > i { flex-shrink: 0; }
  .mobile-actions a:last-child { background: var(--accent); color: #fff; }
  .article-layout, .faq-layout, .inquiry-layout { grid-template-columns: minmax(0,1fr); gap: 36px; }
  .article-aside { position: static; }
  .news-row { grid-template-columns: 150px minmax(0,1fr) auto; gap: 12px 22px; }
  .news-row-cover { grid-column: 1; grid-row: 1 / 4; width: 150px; height: 110px; }
  .news-row time { grid-column: 2; grid-row: 1; }
  .news-row > div { grid-column: 2 / 4; grid-row: 2; }
  .news-row > .text-link { grid-column: 3; grid-row: 1; }
  .news-row h2 { font-size: 22px; }
  .ref-news-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ref-news-copy { padding: 20px; }
  .reference-home > .ref-screen:not(.ref-hero) { min-height: 0; }
  .section-dots { display: none; }
  .exsafe-footer-group a { min-height: 44px; display: flex; align-items: center; }
  .contact-info-value { font-size: 20px; }
  .language-switch summary { min-width: 44px; min-height: 44px; justify-content: center; }
  .faq-search input, .products-search input { font-size: 16px; }
  .inner-banner { height: auto; min-height: 280px; }
}

@media (max-width: 600px) {
  .faq-category-list {
    flex-wrap: nowrap;
    gap: 0 20px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .faq-category { flex: 0 0 auto; }
}

@media (max-width: 760px) and (min-width: 601px) {
  .news-featured { grid-template-columns: minmax(0, 1fr); }
  .news-feature-link { display: grid; grid-template-columns: 38% minmax(0, 1fr); }
  .news-feature-cover { height: 100%; aspect-ratio: auto; }
}
@media (max-width: 600px) {
  :root { --page-gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  html { scrollbar-gutter: auto; overflow-x: clip; }
  html.nav-open { overflow: hidden; }
  body { overflow-x: clip; }
  .site-shell { width: min(calc(100% - 2 * var(--page-gutter)), var(--shell)); }
  .site-header .header-inner { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); gap: 10px; }
  .reference-home .ref-products {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }
  .reference-home .ref-product,
  .reference-home .ref-product:nth-child(2),
  .reference-home .ref-product:nth-child(3) {
    grid-column: auto;
    grid-template-columns: minmax(0, 42%) minmax(0, 58%);
    min-height: 218px;
  }
  .reference-home .ref-product-media {
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    min-height: 0;
    padding: 18px 8px 18px 12px;
  }
  .reference-home .ref-product-media img {
    width: 100%;
    height: 182px;
    object-fit: contain;
  }
  .reference-home .ref-product-copy {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    padding: 24px 18px 24px 10px;
  }
  .reference-home .ref-product-copy h2 {
    margin-bottom: 8px;
    font-size: 19px;
    line-height: 1.4;
  }
  .reference-home .ref-product-copy p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
  .reference-home .ref-product-copy > span { margin-top: 14px; }
  .reference-home .ref-about { padding-block: 48px; }
  .reference-home .ref-about-layout { gap: 30px; }
  .reference-home .ref-about-media { height: 230px; }
  .reference-home .ref-values { margin-block: 22px 26px; }
  .reference-home .ref-stats { gap: 24px 12px; }
  .ref-news-grid { grid-template-columns: minmax(0,1fr); }
  .reference-home .ref-news { padding-block: 50px; }
  .reference-home .ref-news-grid { gap: 14px; }
  .reference-home .ref-news-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 206px;
  }
  .reference-home .ref-news-image {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
    align-self: start;
    margin-top: 17px;
  }
  .reference-home .ref-news-copy {
    min-width: 0;
    padding: 17px 16px;
  }
  .reference-home .ref-news-meta {
    flex-direction: column;
    gap: 4px;
  }
  .reference-home .ref-news-copy h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 10px 0 8px;
    font-size: 17px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
  .reference-home .ref-news-copy p {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 10px;
    font-size: 12px;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .reference-home .ref-news-arrow { font-size: 20px; }
  .ref-news-image { height: auto; aspect-ratio: 16 / 9; }
  .ref-hero h1 { font-size: 38px; }
  .ref-stats strong { font-size: 26px; }
  .ref-stats strong span { display: inline-block; }
  .listing-card-media { padding: 16px; }
  .listing-card-copy { min-height: 0; padding-block: 20px; }
  .news-row { grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .news-row-cover { grid-column: 1 / -1; grid-row: 1; width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .news-row time { grid-column: 1; grid-row: 2; }
  .news-row > .text-link { grid-column: 2; grid-row: 2; }
  .news-row > div { grid-column: 1 / -1; grid-row: 3; }
  .news-row h2 { font-size: 21px; }
  .inquiry-form { grid-template-columns: minmax(0,1fr); }
  .download-row { grid-template-columns: 40px minmax(0,1fr); gap: 12px; }
  .download-row .button { max-width: 100%; }
  .article-aside { padding: 24px; }
  .contact-details { padding-block: 42px 56px; }
  .contact-details h2 { padding-bottom: 8px; font-size: 24px; }
  .contact-details-grid { grid-template-columns: 1fr; gap: 12px; padding-top: 22px; }
  .contact-info-card, .contact-info-card--phone { grid-column: auto; min-height: 0; padding: 20px 18px; }
  .contact-info-value { font-size: 20px; }
  .contact-info-card p.contact-info-value { font-size: 15px; }
  .inner-banner { min-height: 0; }
  .contact-form-heading h2 { font-size: 24px; }
  .product-detail-page .product-studio { min-height: 0; height: 280px; }
  .product-detail-page .product-summary h2 { font-size: 26px; }
  .product-detail-page .product-facts > div { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .product-detail-page .product-summary-action { width: 100%; }
  .form-actions .button { width: 100%; }
  .pagination { flex-wrap: wrap; }
}
@media (max-width: 360px) {
  :root { --page-gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .site-header .brand img.brand-logo-en { width: 128px; height: 40px; }
  .language-switch summary > span { display: none; }
  .nav-dropdown-links { grid-template-columns: minmax(0,1fr); }
  .ref-hero h1 { font-size: 34px; }
  .ref-stats strong { font-size: 24px; }
  .reference-home .ref-product,
  .reference-home .ref-product:nth-child(2),
  .reference-home .ref-product:nth-child(3) {
    grid-template-columns: 118px minmax(0, 1fr);
  }
  .reference-home .ref-product-copy { padding-right: 14px; }
  .reference-home .ref-news-card { grid-template-columns: 100px minmax(0, 1fr); }
  .contact-info-value { font-size: 18px; }
}
/* Short landscape screens need room below the fixed header and contact bar. */
@media (max-width: 980px) and (max-height: 540px) and (orientation: landscape) {
  :root { --header-height: 56px; --contact-bar-height: calc(44px + env(safe-area-inset-bottom)); }
  .site-header .brand img.brand-logo-en { width: 150px; height: 40px; }
  .mobile-actions a { min-height: 44px; }
  .inner-banner { min-height: 220px; }
  .inner-banner-content { padding-block: 24px; }
  .inner-banner h1 { font-size: 28px; }
}
@media (hover: none) {
  .contact-info-card:hover > div:last-child, .contact-info-card:focus-within > div:last-child { transform: none; }
  .ref-product:hover .ref-product-copy, .ref-product:hover .ref-product-media img { transform: none; }
}
@media (max-width: 980px) and (pointer: coarse) {
  body:has(main :is(input, select, textarea):focus) .mobile-actions { visibility: hidden; }
}
