/* Closed/default states retain the approved V5 composition. */
.theme-A .ha-slide[hidden],
.theme-A .language-menu[hidden] { display:none !important; }
.theme-A a[href],
.theme-A button,
.theme-A [data-preview-message] { cursor:pointer; }
.theme-A :where(a[href],button,input,textarea,select):focus-visible {
  outline:2px solid currentColor;
  outline-offset:4px;
}
.theme-A :where(input,textarea,select):focus-visible { outline-color:#665641; outline-offset:2px; }
.ha-screen-reader-only {
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}
.theme-A .language-menu [data-language] {
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  min-height:46px;
  padding:10px 12px;
  border:0;
  border-radius:4px;
  background:transparent;
  color:var(--ink);
  font:400 17px/26px var(--sans);
  text-align:left;
}
.theme-A .language-menu [data-language][aria-checked="true"] {
  background:var(--support);
  color:#1B2931;
  font-weight:500;
}
.theme-A .language-menu [data-language]:hover { background:#EDE8E0; }
.theme-A .language-menu [data-language]:focus-visible { outline-offset:-3px; }
.theme-A .language-menu [data-language="zh"],
.theme-A .language-menu [data-language="zh-CN"] { font-family:'Microsoft YaHei','PingFang SC',sans-serif; }
.theme-A .language.is-open .chevron { transform:rotate(180deg); }

/* Native dialog appears only after an unfinished destination is requested. */
.ha-preview-dialog {
  position:fixed;
  inset:0;
  width:min(520px,calc(100% - 40px));
  max-width:none;
  max-height:calc(100dvh - 40px);
  overflow:auto;
  margin:auto;
  padding:42px 32px 30px;
  border:1px solid var(--line,#D8D6CE);
  border-radius:12px;
  background:var(--bg,#FBFAF7);
  color:var(--ink,#242621);
  box-shadow:0 18px 60px #16171326;
  font:400 18px/1.6 var(--sans,'Source Sans 3',sans-serif);
}
.ha-preview-dialog::backdrop { background:#24262173; }
.ha-preview-dialog h2 {
  margin:0 0 16px;
  padding-right:18px;
  font:500 32px/1.2 var(--display,'Bodoni Moda',serif);
  letter-spacing:-.02em;
}
.ha-preview-dialog h2:focus { outline:none; }
.ha-preview-dialog p { margin:0; font:400 18px/1.55 var(--sans,'Source Sans 3',sans-serif); }
.ha-preview-close {
  position:absolute;
  right:8px;
  top:8px;
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  padding:0;
  border:0;
  border-radius:50%;
  background:transparent;
  color:inherit;
  font:400 28px/1 var(--sans,'Source Sans 3',sans-serif);
  cursor:pointer;
}
.ha-preview-dialog .ha-preview-done {
  margin-top:26px;
  min-height:48px;
  padding:10px 20px;
  border:1px solid #242621;
  border-radius:8px;
  background:#242621;
  color:#FBFAF7;
  font:500 18px/26px var(--sans,'Source Sans 3',sans-serif);
  cursor:pointer;
}
.ha-preview-close:hover { background:#EDE8E0; }

@media(max-width:1190px) {
  .theme-A header.ha-navigation-open { height:auto; }
  .theme-A header.ha-navigation-open .header-inner {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    min-height:108px;
    height:auto;
    padding-top:24px;
    padding-bottom:20px;
    row-gap:16px;
  }
  .theme-A header.ha-navigation-open .brand { order:1; }
  .theme-A header.ha-navigation-open .mobile-toggle { order:2; margin-left:auto; }
  .theme-A header.ha-navigation-open .header-inner nav {
    order:3;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:0;
    width:100%;
    padding:8px 0;
    border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);
    white-space:normal;
  }
  .theme-A header.ha-navigation-open .header-inner nav a {
    display:flex;
    align-items:center;
    min-height:48px;
    padding:10px 0;
    border:0;
    font-size:19px;
    line-height:28px;
  }
  .theme-A header.ha-navigation-open .header-inner nav a.active {
    text-decoration:underline;
    text-underline-offset:5px;
    text-decoration-thickness:1px;
  }
  .theme-A header.ha-navigation-open .language {
    order:4;
    display:block;
    width:100%;
    margin:0;
  }
  .theme-A header.ha-navigation-open .language-trigger { width:100%; min-height:48px; }
  .theme-A header.ha-navigation-open .language-trigger .chevron { margin-left:auto; }
  .theme-A header.ha-navigation-open .language-menu {
    position:static;
    width:100%;
    margin-top:10px;
    box-shadow:none;
  }
  .theme-A header.ha-navigation-open .language-menu [data-language] { min-height:48px; }
  .theme-A header.ha-navigation-open .mobile-toggle span:first-child { transform:translateY(4.25px) rotate(45deg); }
  .theme-A header.ha-navigation-open .mobile-toggle span:last-child { transform:translateY(-4.25px) rotate(-45deg); }
}
@media(max-width:800px) {
  .theme-A header.ha-navigation-open .header-inner { min-height:86px; padding-top:20px; }
  .ha-preview-dialog { padding:42px 24px 26px; }
  .ha-preview-dialog h2 { font-size:30px; }
}
@media(prefers-reduced-motion:reduce) {
  .theme-A .language .chevron,
  .theme-A .mobile-toggle span,
  .ha-preview-dialog { transition:none !important; animation:none !important; scroll-behavior:auto !important; }
}
