/* Magnifita phase 1: shared header only. No lesson, account or admin layout rules. */
.site-header.mf31-header {
  --mf31-nav-ink: #193b4c;
  --mf31-nav-muted: #526b78;
  --mf31-nav-blue: #086ba9;
  --mf31-nav-line: #dce6eb;
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  width: min(1240px, calc(100% - 64px));
  min-width: 0;
  min-height: 88px;
  height: auto;
  gap: 18px;
  padding: 15px 0;
  margin: 0 auto;
  border: 0;
  border-bottom: 1px solid var(--mf31-nav-line);
  background: #fffefb;
  color: var(--mf31-nav-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
.mf31-header *, .mf31-header *::before, .mf31-header *::after { box-sizing: border-box; }
.mf31-header a { text-decoration: none; }
.mf31-header :is(a, summary, button):focus-visible { outline: 3px solid #b26215; outline-offset: 3px; }
.mf31-header .mf31-brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; min-width: 0; min-height: 44px; margin-right: auto; color: var(--mf31-nav-ink); }
.mf31-header .mf31-brand > span:last-child { min-width: 0; }
.mf31-header .mf31-brand strong { display: block; font: 700 29px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.8px; white-space: nowrap; color: var(--mf31-nav-ink); }
.mf31-header .mf31-brand small { display: block; margin-top: 5px; max-width: 180px; color: var(--mf31-nav-muted); font-size: 10px; line-height: 1.4; letter-spacing: .025em; }
.mf31-header .mf31-flag { display: block; width: 23px; height: 29px; flex: none; border-radius: 4px; background: linear-gradient(90deg, #168751 0 33.33%, #fff 33.33% 66.66%, #cf363d 66.66%); box-shadow: 0 1px 5px #193b4c1f; }
.mf31-header details { position: relative; margin: 0; padding: 0; border: 0; background: transparent; }
.mf31-header summary { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 44px; padding: 10px 11px; border: 0; border-radius: 10px; color: var(--mf31-nav-ink); background: transparent; font: 600 13px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; list-style: none; cursor: pointer; user-select: none; }
.mf31-header summary::-webkit-details-marker { display: none; }
.mf31-header summary::marker { content: ""; }
.mf31-header summary:hover, .mf31-header .mf31-dropdown[open] > summary { color: #075b8d; background: #edf6fb; }
.mf31-header .mf31-chevron { width: 13px; height: 13px; flex: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mf31-header .mf31-dropdown[open] > summary > .mf31-chevron { transform: rotate(180deg); }
.mf31-header .mf31-main { flex: 0 1 auto; }
.mf31-header .mf31-main > summary { display: none; }
.mf31-header .mf31-nav { display: flex; align-items: center; flex-wrap: nowrap; width: auto; margin: 0; padding: 0; gap: 1px; color: var(--mf31-nav-ink); }
.mf31-header .mf31-nav > a, .mf31-header .mf31-panel a { display: flex; align-items: center; justify-content: flex-start; min-height: 44px; padding: 10px 11px; border: 0; border-radius: 10px; background: transparent; color: var(--mf31-nav-ink); font: 600 13px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; box-shadow: none; }
.mf31-header .mf31-nav > a { white-space: nowrap; }
.mf31-header .mf31-nav > a:hover, .mf31-header .mf31-panel a:hover, .mf31-header a[aria-current="page"] { background: #edf6fb; color: #075b8d; }
.mf31-header .mf31-nav > .mf31-login { margin-left: 7px; padding-inline: 18px; border: 1px solid var(--mf31-nav-blue); background: var(--mf31-nav-blue); color: #fff; }
.mf31-header .mf31-nav > .mf31-login:hover { background: #075b8d; color: #fff; }
.mf31-header .mf31-panel { position: absolute; top: calc(100% + 9px); left: 0; z-index: 50; display: grid; gap: 2px; width: 264px; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid var(--mf31-nav-line); border-radius: 14px; background: #fff; box-shadow: 0 14px 38px #193b4c1a; overflow-wrap: anywhere; }
.mf31-header details:not([open]) > .mf31-panel { display: none; }
.mf31-header .mf31-panel a { width: 100%; white-space: normal; }
.mf31-header .mf31-panel > .mf31-panel-cta { margin-top: 5px; border-top: 1px solid var(--mf31-nav-line); border-radius: 0 0 8px 8px; color: #075b8d; }
.mf31-header .mf31-account > .mf31-panel, .mf31-header .mf31-language > .mf31-panel { left: auto; right: 0; }
.mf31-header .mf31-language { flex: none; }
.mf31-header .mf31-language > summary { gap: 7px; padding-inline: 9px; border: 1px solid var(--mf31-nav-line); }
.mf31-header .mf31-language > .mf31-panel { width: 192px; }
.mf31-header .mf31-globe { width: 18px; height: 18px; flex: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.mf31-header .language-selector { display: grid; gap: 2px; width: 100%; margin: 0; padding: 0; border: 0; font: inherit; }
.mf31-header .language-selector a { margin: 0; border: 0; background: transparent; }
.mf31-header .language-selector a[aria-current="true"] { color: #075b8d; background: #edf6fb; }
.mf31-header .language-pending { display: block; padding: 10px 11px; color: var(--mf31-nav-muted); font-size: 13px; }
.mf31-header .language-pending small { display: block; font-size: 11px; }
.mf31-header .mf31-user { display: block; padding: 10px 11px 12px; margin-bottom: 3px; border-bottom: 1px solid var(--mf31-nav-line); color: var(--mf31-nav-muted); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.mf31-header .mf27-logout-form { margin: 0; padding: 0; }
.mf31-header .mf27-logout { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 44px; margin: 0; padding: 10px 11px; border: 0; border-radius: 10px; background: transparent; color: var(--mf31-nav-ink); font: 600 13px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; box-shadow: none; }
.mf31-header .mf27-logout:hover { background: #edf6fb; color: #075b8d; }
.mf31-header .mf27-logout svg { width: 18px; height: 18px; margin-right: 8px; fill: none; stroke: currentColor; stroke-width: 1.6; }
@media (max-width: 1049px) {
  .site-header.mf31-header { min-height: 80px; width: min(1240px, calc(100% - 40px)); gap: 10px; padding-block: 13px; }
  .mf31-header .mf31-brand strong { font-size: 28px; }
  .mf31-header .mf31-main { position: static; order: 3; flex: none; }
  .mf31-header .mf31-main > summary { display: flex; min-width: 44px; justify-content: center; border: 1px solid var(--mf31-nav-line); }
  .mf31-header .mf31-menu-icon { width: 20px; height: 20px; flex: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
  .mf31-header .mf31-language { order: 2; }
  .mf31-header .mf31-main:not([open]) > .mf31-nav { display: none; }
  .mf31-header .mf31-nav { position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: auto; max-height: calc(100vh - 112px); max-height: calc(100dvh - 112px); padding: 10px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--mf31-nav-line); border-radius: 14px; background: #fff; box-shadow: 0 14px 38px #193b4c1a; }
  .mf31-header .mf31-nav > a, .mf31-header .mf31-nav summary { width: 100%; padding-inline: 13px; font-size: 14px; }
  .mf31-header .mf31-nav .mf31-panel { position: static; width: auto; max-width: none; padding: 4px 5px 6px 13px; border: 0; background: #f5f9fc; box-shadow: none; border-radius: 10px; }
  .mf31-header .mf31-nav > .mf31-login { margin: 5px 0 0; justify-content: center; }
}
@media (max-width: 600px) {
  .site-header.mf31-header { width: calc(100% - 32px); min-height: 76px; gap: 7px; padding-block: 12px; }
  .mf31-header .mf31-brand { gap: 8px; }
  .mf31-header .mf31-brand strong { font-size: 26px; letter-spacing: -.65px; }
  .mf31-header .mf31-brand small { display: none; }
  .mf31-header .mf31-flag { width: 19px; height: 26px; }
  .mf31-header .mf31-main > summary { width: 44px; height: 44px; padding: 10px; }
  .mf31-header .mf31-menu-label { display: none; }
  .mf31-header .mf31-language > summary { min-height: 44px; gap: 5px; padding-inline: 8px; }
  .mf31-header .mf31-language .mf31-globe { width: 17px; height: 17px; }
}
