app-header {
  display: block;
  flex: 0 0 auto;
  position: relative;
  z-index: 1000;
}

.app-header.top-header {
  min-height: 92px;
  padding: 14px 22px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  overflow: visible;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(118deg, #063d73 0%, #0868af 48%, #0d82c7 100%);
  border-bottom: 3px solid #56c4f2;
  box-shadow: 0 8px 28px rgba(4, 42, 79, 0.25);
}

.app-header::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: min(34vw, 480px);
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle at 70% 15%, rgba(125, 220, 255, 0.24), transparent 60%);
}

.app-header__identity {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 15px;
}

.app-header__logo-wrap {
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 24px rgba(2, 34, 68, 0.28);
  backdrop-filter: blur(8px);
}

.app-header__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: translateY(-5px);
  filter: drop-shadow(0 3px 6px rgba(1, 25, 52, 0.3));
}

.app-header__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.app-header__institution {
  color: #cfeeff;
  font-family: "Sora", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.app-header__title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
  margin: 0;
  color: #fff;
  font-family: "Sora", sans-serif;
  font-size: clamp(20px, 2.1vw, 29px);
  font-weight: 800;
  line-height: 1.15;
}

.app-header__product {
  color: #ffe57a;
  text-shadow: 0 2px 12px rgba(3, 33, 66, 0.28);
}

.app-header__divider {
  width: 1px;
  height: 24px;
  flex: 0 0 1px;
  background: rgba(255, 255, 255, 0.42);
}

.app-header__area {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header__subtitle {
  margin: 0;
  color: rgba(235, 247, 255, 0.88);
  font-size: 13px;
  line-height: 1.35;
}

.app-header__meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.app-header__actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.app-header__login-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  min-height: 60px;
  padding: 9px 16px 9px 10px;
  border: 1px solid rgba(190, 215, 231, 0.92);
  border-radius: 14px;
  color: #174b70;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 247, 251, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 8px 20px rgba(2, 34, 68, 0.18);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.app-header__login-button:hover {
  border-color: #9dbfd4;
  box-shadow:
    inset 0 1px 0 #fff,
    0 11px 25px rgba(2, 34, 68, 0.25);
  transform: translateY(-2px);
}

.app-header__login-button:active {
  box-shadow:
    inset 0 1px 0 #fff,
    0 5px 13px rgba(2, 34, 68, 0.24);
  transform: translateY(0) scale(0.98);
}

.app-header__login-button:focus-visible {
  outline: 3px solid #ffe57a;
  outline-offset: 3px;
}

.app-header__login-symbol {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, #5594ba, #245f8b);
  box-shadow: 0 4px 10px rgba(22, 80, 122, 0.2);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.app-header__login-symbol::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: #f8fcff;
}

.app-header__login-head {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid #3a7399;
  border-radius: 50%;
  transform: translateX(-50%);
}

.app-header__login-shoulders {
  position: absolute;
  z-index: 1;
  bottom: 5px;
  left: 50%;
  width: 23px;
  height: 12px;
  border: 2px solid #2c6288;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  transform: translateX(-50%);
}

.app-header__login-button:hover .app-header__login-symbol {
  box-shadow: 0 5px 13px rgba(22, 80, 122, 0.3);
  transform: scale(1.04);
}

.app-header__login-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.app-header__login-initials {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: none;
  place-items: center;
  color: #fff;
  font-family: "Sora", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-header__login-menu-indicator {
  display: none;
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 1.5px solid #587487;
  border-bottom: 1.5px solid #587487;
  transform: translateY(-2px) rotate(45deg);
}

.app-header__login-button[data-authenticated="true"] .app-header__login-symbol {
  background: linear-gradient(145deg, #2f719d, #174d74);
}

.app-header__login-button[data-authenticated="true"] .app-header__login-symbol::before,
.app-header__login-button[data-authenticated="true"] .app-header__login-head,
.app-header__login-button[data-authenticated="true"] .app-header__login-shoulders {
  display: none;
}

.app-header__login-button[data-authenticated="true"] .app-header__login-initials,
.app-header__login-button[data-authenticated="true"] .app-header__login-menu-indicator {
  display: grid;
}

.app-header__access-tooltip {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  right: 0;
  width: min(380px, calc(100vw - 24px));
  padding: 7px 10px;
  overflow: hidden;
  border: 1px solid rgba(174, 202, 219, 0.92);
  border-radius: 9px;
  color: #29485f;
  background: rgba(252, 254, 255, 0.98);
  box-shadow: 0 8px 20px rgba(3, 36, 65, 0.18);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 180ms ease;
}

.app-header__access-tooltip::before {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 100%;
  width: 8px;
  height: 8px;
  border-top: 1px solid rgba(174, 202, 219, 0.92);
  border-left: 1px solid rgba(174, 202, 219, 0.92);
  background: #fcfeff;
  transform: translateY(5px) rotate(45deg);
}

.app-header__login-button:hover + .app-header__access-tooltip,
.app-header__login-button:focus-visible + .app-header__access-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.app-header__login-copy strong {
  color: #174b70;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.app-header__login-copy small {
  color: #60798b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1.2;
}

.app-header__account-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(280px, calc(100vw - 24px));
  padding: 7px;
  border: 1px solid #c8d8e2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(10, 43, 66, 0.18);
}

.app-header__account-menu[hidden] {
  display: none;
}

.app-header__account-action {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  color: #35596f;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.app-header__account-action[hidden] {
  display: none;
}

.app-header__account-action:hover {
  background: #edf4f7;
}

.app-header__account-action:focus-visible {
  outline: 3px solid rgba(47, 125, 168, 0.28);
  outline-offset: 1px;
}

.app-header__account-action > span:first-child {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: #33799f;
  background: #e8f2f7;
  font-weight: 800;
}

.app-header__account-action strong,
.app-header__account-action small {
  display: block;
}

.app-header__account-action strong {
  color: #254d65;
  font-size: 11px;
}

.app-header__account-action small {
  margin-top: 2px;
  color: #758b98;
  font-size: 9px;
}

html[data-theme="dark"] .app-header__login-button {
  border-color: rgba(112, 145, 168, 0.56);
  color: #d9e9f3;
  background: linear-gradient(145deg, rgba(29, 45, 60, 0.98), rgba(19, 33, 47, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 20px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .app-header__login-button:hover {
  border-color: rgba(128, 174, 202, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 11px 25px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .app-header__login-symbol {
  background: linear-gradient(145deg, #609bc0, #2d668e);
}

html[data-theme="dark"] .app-header__login-symbol::before {
  background: #182b3b;
}

html[data-theme="dark"] .app-header__login-head {
  border-color: #92c1dc;
}

html[data-theme="dark"] .app-header__login-shoulders {
  border-color: #77aac9;
}

html[data-theme="dark"] .app-header__login-copy strong {
  color: #e4f0f7;
}

html[data-theme="dark"] .app-header__login-copy small {
  color: #9eb5c4;
}

html[data-theme="dark"] .app-header__login-menu-indicator {
  border-color: #a8bdca;
}

html[data-theme="dark"] .app-header__access-tooltip {
  border-color: #455d6f;
  color: #d3e2eb;
  background: rgba(25, 39, 52, 0.98);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .app-header__access-tooltip::before {
  border-color: #455d6f;
  background: #192734;
}

html[data-theme="dark"] .app-header__account-menu {
  border-color: #405666;
  background: #192934;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .app-header__account-action {
  color: #c6d8e2;
}

html[data-theme="dark"] .app-header__account-action:hover {
  background: #243a48;
}

html[data-theme="dark"] .app-header__account-action > span:first-child {
  color: #9bcce4;
  background: #284352;
}

html[data-theme="dark"] .app-header__account-action strong {
  color: #dceaf1;
}

html[data-theme="dark"] .app-header__account-action small {
  color: #8fa5b2;
}

.app-header__service,
.app-header__date {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(3, 48, 91, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.app-header__service strong,
.app-header__date strong {
  display: block;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.app-header__date {
  min-width: 188px;
}

.app-header__meta-label {
  display: block;
  margin-bottom: 2px;
  color: #b9def7;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.app-header__status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #66f0ba;
  box-shadow: 0 0 0 5px rgba(102, 240, 186, 0.13), 0 0 16px rgba(102, 240, 186, 0.65);
}

.app-header__meta-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: #9ad8ff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-header__mobile-actions {
  position: relative;
  z-index: 1;
}

.app-header__mobile-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1100px) {
  .app-header.top-header {
    min-height: auto;
    padding: 10px 12px;
    gap: 8px;
  }

  .app-header__identity {
    gap: 10px;
  }

  .app-header__logo-wrap {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    padding: 5px;
    border-radius: 12px;
  }

  .app-header__institution {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .app-header__title {
    gap: 8px;
    font-size: clamp(17px, 4.7vw, 22px);
  }

  .app-header__divider {
    height: 19px;
  }

  .app-header__subtitle {
    display: none;
  }

  .app-header__meta {
    display: none;
  }

  .app-header__actions {
    align-items: center;
  }

  .app-header__login-button {
    min-height: 50px;
    padding: 7px 12px 7px 9px;
  }

  .app-header__mobile-actions {
    display: flex;
    margin: 2px 0 0 58px;
  }

  .app-header__mobile-button {
    min-height: 36px;
    padding: 7px 11px;
  }
}

@media (max-width: 540px) {
  .app-header__area,
  .app-header__divider {
    display: none;
  }

  .app-header__mobile-actions {
    margin-left: 0;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .app-header.top-header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-block: 7px;
  }

  .app-header__logo-wrap {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .app-header__mobile-actions {
    margin: 0;
  }
}

@media (min-width: 1025px) {
  .app-header.top-header {
    min-height: 92px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .app-header.top-header {
    min-height: 72px;
    padding: 8px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .app-header__logo-wrap {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: 11px;
  }

  .app-header__logo {
    transform: none;
  }

  .app-header__institution {
    font-size: 9px;
  }

  .app-header__title {
    font-size: clamp(17px, 2.5vw, 21px);
  }

  .app-header__mobile-actions {
    margin: 0;
  }

  .app-header__mobile-button {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 11px;
    font-size: 12px;
  }
}

@media (max-width: 767px) {
  .app-header.top-header {
    min-height: 60px;
    height: 60px;
    padding: 6px max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left));
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    border-bottom-width: 2px;
  }

  .app-header__identity {
    gap: 8px;
  }

  .app-header__logo-wrap {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    padding: 4px;
    border-radius: 10px;
  }

  .app-header__logo {
    transform: none;
  }

  .app-header__institution,
  .app-header__divider,
  .app-header__area {
    display: none;
  }

  .app-header__title {
    font-size: clamp(18px, 5.5vw, 21px);
  }

  .app-header__mobile-actions {
    display: flex;
    gap: 6px;
    margin: 0;
  }

  .app-header__login-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
    border-radius: 11px;
  }

  .app-header__login-symbol {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .app-header__login-head {
    top: 7px;
    width: 9px;
    height: 9px;
  }

  .app-header__login-shoulders {
    width: 21px;
    height: 11px;
  }

  .app-header__login-copy {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .app-header__access-tooltip {
    display: none;
  }

  .app-header__account-menu {
    top: calc(100% + 6px);
    right: max(0px, env(safe-area-inset-right));
  }

  .app-header__mobile-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 11px;
  }

  .app-header__mobile-button svg {
    width: 21px;
    height: 21px;
  }

  .app-header__mobile-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (max-width: 767px) and (orientation: landscape) {
  .app-header.top-header {
    min-height: 56px;
    height: 56px;
    padding-block: 5px;
  }

  .app-header__logo-wrap {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-header__status-dot {
    box-shadow: 0 0 0 5px rgba(102, 240, 186, 0.13);
  }

  .app-header__login-button {
    transition: none;
  }

  .app-header__login-symbol {
    transition: none;
  }

  .app-header__access-tooltip {
    transition: none;
  }
}
