/* HFTCloud v2.8.1. Load after styles.css and theme.css. */
:root { --hc-header-clearance: 104px; }
html { scroll-padding-top: var(--hc-header-clearance); }

.hc-header {
  position: sticky;
  top: 0;
  z-index: 80;
  color: var(--hk-text-secondary);
  background: var(--hc-header-bg, rgba(1, 18, 7, .97));
  border-bottom: 1px solid var(--hk-border);
  box-shadow: 0 8px 28px var(--hc-header-shadow, rgba(0, 0, 0, .16));
  backdrop-filter: blur(16px);
}
.hc-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  width: min(1200px, calc(100% - 48px));
  min-height: 84px;
  margin-inline: auto;
  padding-block: 12px;
}
.hc-brand {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  justify-self: start;
}
.hc-brand img { width: 144px; height: auto; max-height: 35px; object-fit: contain; }
.hc-header-panel { display: contents; }
.hc-primary-links {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}
.hc-nav-link,
.hc-control-panel,
.hc-dropdown-toggle,
.hc-dropdown-panel a {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--hk-text-secondary);
  text-decoration: none;
  white-space: nowrap;
}
.hc-nav-link:hover,
.hc-nav-link:focus-visible,
.hc-control-panel:hover,
.hc-control-panel:focus-visible,
.hc-dropdown-toggle:hover,
.hc-dropdown[open] > .hc-dropdown-toggle,
.hc-dropdown-panel a:hover,
.hc-dropdown-panel a:focus-visible {
  color: var(--hk-text);
  background: var(--hk-surface-hover);
}
.hc-nav-link[aria-current],
.hc-dropdown-panel a[aria-current] {
  color: var(--hk-accent);
  background: var(--hk-accent-subtle);
}
.hc-nav-link[aria-current]::after {
  position: absolute;
  inset: auto 11px 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--hk-accent);
  content: "";
}
.hc-nav-group { position: relative; display: flex; align-items: stretch; min-width: 0; }
.hc-nav-group > .hc-nav-link { padding-right: 4px; }
.hc-dropdown { position: static; }
.hc-dropdown-toggle { padding-inline: 8px; cursor: pointer; list-style: none; }
.hc-dropdown-toggle::-webkit-details-marker { display: none; }
.hc-dropdown-toggle::marker { content: ""; }
.hc-dropdown[open] > .hc-dropdown-toggle svg { transform: rotate(180deg); }
.hc-dropdown-panel {
  position: absolute;
  z-index: 90;
  top: calc(100% + 10px);
  left: 0;
  display: grid;
  width: 248px;
  max-width: calc(100vw - 48px);
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--hk-border);
  border-radius: 12px;
  background: var(--hk-surface);
  box-shadow: var(--hk-shadow);
}
.hc-dropdown:not([open]) .hc-dropdown-panel { display: none; }
.hc-dropdown-panel a { justify-content: flex-start; white-space: normal; font-weight: 550; }
.hc-header-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 12px;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}
.hc-theme-control { display: flex; align-items: center; gap: 12px; }
.hc-control-label,
.hc-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}
.hc-theme-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--hk-border);
  border-radius: 11px;
  background: var(--hk-bg-alt);
}
.hc-theme-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--hk-text-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}
.hc-theme-option:hover { color: var(--hk-text); }
.hc-theme-option[aria-pressed="true"] {
  color: var(--hk-text);
  border-color: var(--hk-border-strong);
  background: var(--hk-surface-hover);
}
.hc-theme-option:disabled { cursor: default; opacity: .65; }
.hc-control-panel { gap: 5px; padding-inline: 10px; }
.hc-control-panel svg { flex: 0 0 auto; opacity: .7; }
.hc-menu-toggle {
  grid-column: 2;
  grid-row: 1;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--hk-border);
  border-radius: 10px;
  color: var(--hk-text-secondary);
  background: var(--hk-surface);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
}
.hc-menu-toggle:hover,
.hc-menu-toggle[aria-expanded="true"] { color: var(--hk-text); background: var(--hk-surface-hover); }
.hc-menu-icon-close { display: none; }
.hc-menu-toggle[aria-expanded="true"] .hc-menu-icon-open { display: none; }
.hc-menu-toggle[aria-expanded="true"] .hc-menu-icon-close { display: block; }
.hc-header svg { flex: 0 0 auto; }
.hc-header :is(a, button, summary):focus-visible { outline: 2px solid var(--hk-accent); outline-offset: 3px; box-shadow: none; }

@media (max-width: 1279px) and (min-width: 761px) {
  :root { --hc-header-clearance: 156px; }
  .hc-header-inner { grid-template-columns: auto minmax(0, 1fr); gap: 0 20px; min-height: 0; padding-block: 0; }
  .hc-brand { min-height: 76px; }
  .hc-header-actions { grid-column: 2; min-height: 76px; padding-block: 12px; }
  .hc-primary-links { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; min-height: 56px; padding-block: 6px; border-top: 1px solid var(--hk-border); }
}

@media (max-width: 760px) {
  :root { --hc-header-clearance: 92px; }
  .hc-header:not([data-hc-nav-ready]) { position: relative; }
  .hc-header-inner { grid-template-columns: minmax(0, 1fr) auto; width: calc(100% - 32px); min-height: 72px; gap: 0 16px; padding-block: 0; }
  .hc-brand { min-height: 72px; }
  .hc-brand img { width: 136px; max-height: 34px; }
  .hc-header[data-hc-nav-ready] .hc-menu-toggle { display: inline-flex; }
  .hc-header-panel { grid-column: 1 / -1; grid-row: 2; display: flex; flex-direction: column; gap: 16px; min-width: 0; width: 100%; padding: 12px 0 20px; border-top: 1px solid var(--hk-border); }
  .hc-header[data-hc-nav-ready] .hc-header-panel:not(.is-open) { display: none; }
  .hc-header[data-hc-nav-ready] .hc-header-panel.is-open { max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .hc-primary-links { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; }
  .hc-nav-link { justify-content: flex-start; padding: 12px; white-space: normal; }
  .hc-nav-link[aria-current]::after { inset: 10px auto 10px 0; width: 3px; height: auto; }
  .hc-nav-group { display: grid; grid-template-columns: minmax(0, 1fr) 44px; }
  .hc-nav-group > .hc-nav-link { grid-column: 1; grid-row: 1; }
  .hc-dropdown { display: contents; }
  .hc-dropdown-toggle { grid-column: 2; grid-row: 1; min-height: 44px; }
  .hc-dropdown-panel { position: static; grid-column: 1 / -1; width: auto; max-width: none; margin: 4px 0 8px 12px; background: var(--hk-bg-alt); box-shadow: none; }
  .hc-header-actions { align-self: stretch; flex-wrap: wrap; justify-content: stretch; gap: 12px; padding: 16px 0 0; border-top: 1px solid var(--hk-border); }
  .hc-theme-control { display: grid; grid-template-columns: 1fr; width: 100%; gap: 8px; }
  .hc-control-label { position: static; width: auto; height: auto; overflow: visible; margin: 0; clip-path: none; color: var(--hk-text-muted); font-weight: 500; }
  .hc-theme-switch { display: flex; width: 100%; }
  .hc-theme-option { flex: 1 1 0; font-size: 14px; }
  .hc-control-panel { flex: 1 1 130px; border: 1px solid var(--hk-border); }
  body.hc-menu-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hc-header * { transition: none; }
}
