/* 1.3.67: refinement within the existing Modbus palette and page structure. */
:root {
  --mp-feedback-fast: 120ms;
  --mp-feedback-state: 200ms;
  --mp-feedback-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --mp-elevation-control: 0 2px 5px rgba(0, 95, 134, 0.12);
  --mp-elevation-panel: 0 8px 22px rgba(0, 95, 134, 0.12);
  --mp-weight-heading: 700;
  --mp-weight-control: 600;
  --mp-reading-muted: #547084; /* Existing frame-caption shade, reused for prose. */
}
::selection { background: var(--mp-yellow); color: var(--mp-ink); }
.site-main input, .site-main textarea { caret-color: var(--mp-blue); }
.site-main h1, .site-main h2, .site-main h3 { text-wrap: balance; overflow-wrap: anywhere; }
.site-main p { text-wrap: pretty; }
.site-main .mp-heading-clause { display: inline-block; width: max-content; max-width: 100%; vertical-align: top; text-wrap: pretty; word-break: normal; }
.site-main a { text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.mp-table-scroll, .site-main pre, .primary-menu {
  scrollbar-width: thin;
  scrollbar-color: var(--mp-blue) var(--mp-soft);
}
.site-main .pf-hex, .site-main code, .site-main pre,
.official-stats__grid strong, .resources-stats__grid strong { font-variant-numeric: tabular-nums; }

/* Remove ornamental labels, without changing routes, copy or section order. */
body .site-main .official-kicker,
body .site-main .official-section__kicker,
body.home .official-proof,
body.home .official-capability > span:first-child { display: none !important; }
.site-main .official-hero__title { font-weight: var(--mp-weight-heading); line-height: 1.16; }
.site-main .resources-hero h1,
.site-main .product-center-hero h1,
.site-main .official-archive-hero h1 { font-weight: var(--mp-weight-heading); line-height: 1.2; }
.site-main .official-section__head h2,
.site-main .official-business__copy h2,
.site-main .resources-section__head h2,
.site-main .section__title { font-weight: var(--mp-weight-heading); line-height: 1.3; }
.site-main .official-capability h3,
.site-main .official-post-card h3,
.site-main .official-resource-card h2,
.site-main .product-center-card h3,
.site-main .resources-quick-link strong,
.site-main .official-business__grid strong { font-weight: var(--mp-weight-control); line-height: 1.45; }
.site-main .official-post-card__meta a,
.site-main .official-resource-card__meta a,
.site-main .official-tax-row a { font-weight: 500; border-radius: 4px; color: var(--mp-blue-2); }
.site-main .official-section__head p, .site-main .official-business__copy p,
.site-main .official-business__grid span, .site-main .official-post-card p,
.site-main .official-post-card__meta, .site-main .official-resource-card__meta,
.site-main .official-article__meta, .site-main .official-stats__grid span,
.site-main .resources-stats__grid span { color: var(--mp-reading-muted); }
.site-main .official-stats__grid strong,
.site-main .resources-stats__grid strong { font-weight: var(--mp-weight-heading); line-height: 1.15; }
.site-main .official-stats__grid,
.site-main .resources-stats__grid { box-shadow: none; border-radius: 8px; }
.site-main .official-capability h3 { margin-top: 18px; }
.site-main .official-capability { min-height: 224px; }
.site-main .official-article__header h1 { font-weight: var(--mp-weight-heading); line-height: 1.3; }
.site-main .official-article__body, .site-main .article__body { line-height: 1.85; }
.site-main .official-article__body h2, .site-main .article__body h2 { font-weight: var(--mp-weight-heading); line-height: 1.4; }
.site-main .official-article__body h3, .site-main .article__body h3 { font-weight: var(--mp-weight-control); line-height: 1.5; }
@supports (word-break: auto-phrase) {
  html[lang^="zh"] .site-main h1, html[lang^="zh"] .site-main h2,
  html[lang^="zh"] .site-main h3 { word-break: auto-phrase; }
}
.site-main .official-business__copy, .site-main .official-business__grid,
.site-main .official-section__head > div { min-width: 0; }

/* Stable targets: hover changes emphasis, pressing confirms the action. */
body .site-header { box-shadow: 0 3px 12px rgba(0, 95, 134, 0.08) !important; }
body .site-header .official-branding__badge { font-weight: 500; box-shadow: none !important; }
body .site-header .official-header-cta { box-shadow: none; font-weight: var(--mp-weight-control); }
body .site-header .official-header-cta:hover { transform: none; }
body .site-header .official-primary-nav .primary-menu > .menu-item > a { font-weight: var(--mp-weight-control) !important; }
body .site-header #mbi-lang-fab .mbi-fab-trigger { box-shadow: var(--mp-elevation-control); font-weight: var(--mp-weight-control); }
body .site-header #mbi-lang-fab .mbi-fab-trigger:hover { transform: none; box-shadow: var(--mp-elevation-control); }
body .btn, body .button, body button.button, body input[type="submit"] {
  font-weight: var(--mp-weight-control);
  transition: color var(--mp-feedback-fast), background-color var(--mp-feedback-fast), border-color var(--mp-feedback-fast), box-shadow var(--mp-feedback-fast), transform var(--mp-feedback-fast) var(--mp-feedback-ease);
}
body .btn--primary, body .button, body button.button, body input[type="submit"] { box-shadow: var(--mp-elevation-control) !important; }
body .btn:hover, body .button:hover, body button.button:hover,
body input[type="submit"]:hover { transform: none; }
body .btn:active, body .button:active, body button.button:active,
body input[type="submit"]:active { transform: translateY(1px); box-shadow: none !important; }
.site-main .btn:focus-visible, .site-main .proto-tab:focus-visible,
.site-main .official-capability:focus-visible, .mp-sound-toggle:focus-visible {
  outline: 2px solid var(--mp-blue);
  outline-offset: 4px;
}
.site-main button:disabled, .site-main input[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
  box-shadow: none !important;
}
.site-main .official-post-card,
.site-main .official-resource-card,
.site-main .official-related__item,
.site-main .official-business__item,
.site-main .product-center-card,
.site-main .resources-card,
.site-main .product-cat-card,
.site-main .resources-quick-link,
.site-main .frame-learning-entry {
  transition: border-color var(--mp-feedback-state) var(--mp-feedback-ease), background-color var(--mp-feedback-state) var(--mp-feedback-ease);
  box-shadow: none !important;
}
.site-main .official-post-card:hover,
.site-main .official-resource-card:hover,
.site-main .official-related__item:hover,
.site-main .official-business__grid .official-business__item:hover,
.site-main .product-center-card:hover,
.site-main .resources-card:hover,
.site-main .product-cat-card:hover,
.site-main .resources-quick-link:hover,
.site-main .frame-learning-entry:hover { transform: none; box-shadow: none !important; }
.site-main .official-post-card h3 a:hover,
.site-main .official-resource-card h2 a:hover,
.site-main .official-related__item:hover strong,
.site-main .official-business__item:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.site-main .official-console { box-shadow: var(--mp-elevation-panel); }
.site-main .pf-full-hex { box-shadow: none !important; }
.site-main .official-console__top { font-family: var(--font-sans); }
.site-main .official-console__top em { font-style: normal; }
.site-main .proto-tab {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: var(--mp-weight-control);
  min-height: 44px;
  transition: color var(--mp-feedback-fast), background-color var(--mp-feedback-fast), border-color var(--mp-feedback-fast);
}
.site-main .proto-tab:active { filter: brightness(0.94); }
.site-main .pf-hex { font-weight: var(--mp-weight-heading); }
.site-main .pf-size, .site-main .pf-sub { font-size: 0.6875rem; line-height: 1.5; }
.site-main .pf-row--header .pf-cell { font-family: var(--font-sans); font-size: 0.6875rem; font-weight: var(--mp-weight-control); }
body .floating-contact__toggle, body .ai-search-toggle, body .scroll-to-top { box-shadow: var(--mp-elevation-control); }
body .floating-contact__toggle:hover, body .scroll-to-top:hover { transform: none; }

/* A short arrival ties a panel to the action that opens it. Never hide content
   by default, so script or animation failure does not strand the visitor. */
body header.mp-compact-nav .primary-menu.active,
body #mbi-lang-fab.open .mbi-fab-menu,
body .header-search-dropdown.active,
body .floating-contact.is-open .floating-contact__panel {
  animation: mp-control-open var(--mp-feedback-state) var(--mp-feedback-ease);
}
@keyframes mp-control-open { from { opacity: 0.65; } to { opacity: 1; } }

/* Sound is optional and belongs with preferences, away from the main actions. */
.footer__bottom { align-items: center; flex-wrap: wrap; }
body .site-footer .footer__brand-desc, body .site-footer .footer__trust-item,
body .site-footer .footer__bottom { color: rgba(255, 255, 255, 0.88); }
body .site-footer .mp-sound-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--mp-white);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background-color var(--mp-feedback-fast), border-color var(--mp-feedback-fast);
}
.mp-sound-toggle svg { flex: 0 0 16px; }
.mp-sound-toggle[aria-pressed="false"] .mp-sound-waves,
.mp-sound-toggle[aria-pressed="true"] .mp-sound-muted { display: none; }
body .site-footer .mp-sound-toggle:hover { background: rgba(255, 255, 255, 0.08); }
body .site-footer .mp-sound-toggle[aria-pressed="true"] { border-color: var(--mp-yellow); }
body .site-footer .mp-sound-toggle:disabled { opacity: 0.7; cursor: default; }
.site-footer .mp-sound-toggle:focus-visible { outline-color: var(--mp-yellow); }

@media (max-width: 760px) {
  .site-main .official-stats__grid > div { padding-top: 20px; padding-bottom: 20px; }
  .site-main .official-capability { min-height: 0; padding-top: 24px; padding-bottom: 24px; }
  .site-main .official-capability h3 { margin-top: 0; }
  .site-main .official-article__header h1 { font-size: 1.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  body .btn:active, body .button:active, body button.button:active,
  body input[type="submit"]:active { transform: none; }
  body header.mp-compact-nav .primary-menu.active,
  body #mbi-lang-fab.open .mbi-fab-menu,
  body .header-search-dropdown.active,
  body .floating-contact.is-open .floating-contact__panel { animation: none; }
}
