:root {
  --site-warning-height: 0px;
}

.site-warning {
  position: fixed;
  inset: 0 0 auto;
  z-index: 12000;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  border-bottom: 1px solid transparent;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
  font-family: var(--ui-font, "Segoe UI", system-ui, -apple-system, Arial, sans-serif);
}

.site-warning[hidden] {
  display: none !important;
}

.site-warning__inner {
  width: min(100%, 1800px);
  min-height: 44px;
  margin: 0 auto;
  padding: 9px max(16px, env(safe-area-inset-right)) 9px max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-warning__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.site-warning__text {
  min-width: 0;
  flex: 1;
  color: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.site-warning__close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  line-height: 1;
}

.site-warning__close:hover,
.site-warning__close:focus-visible {
  background: rgba(255, 255, 255, 0.5);
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.site-warning--info {
  border-bottom-color: #8ab8ef;
  background: #eaf3ff;
  color: #174f91;
}

.site-warning--important {
  border-bottom-color: #e1b849;
  background: #fff4c7;
  color: #704d00;
}

.site-warning--critical {
  border-bottom-color: #e28b8b;
  background: #fde5e5;
  color: #8d2020;
}

/* The banner is fixed. Reserve exactly its measured height and keep the
   existing sticky/fixed navigation below the complete top-banner stack. */
html.site-warning-visible body {
  padding-top: var(--site-warning-height);
}

html.site-warning-visible body.birthday-ticker-on {
  padding-top: calc(var(--site-warning-height) + 36px);
}

html.site-warning-visible .birthday-ticker,
html.site-warning-visible .birthday-confetti {
  top: var(--site-warning-height);
}

body.birthday-ticker-on .shell-sidebar {
  top: 36px;
}

html.site-warning-visible .shell-sidebar {
  top: var(--site-warning-height);
}

html.site-warning-visible body.birthday-ticker-on .shell-sidebar {
  top: calc(var(--site-warning-height) + 36px);
}

html.site-warning-visible .app {
  height: calc(100vh - var(--site-warning-height));
  height: calc(100dvh - var(--site-warning-height));
  min-height: 0;
}

html.site-warning-visible .app-header,
html.site-warning-visible .ts-toolbar {
  top: var(--site-warning-height);
}

html.site-warning-visible .ts-wrap {
  max-height: calc(100vh - 64px - var(--site-warning-height));
}

@media (max-width: 900px) {
  .site-warning__inner {
    align-items: flex-start;
    padding-block: 8px;
  }

  .site-warning__icon {
    margin-top: 3px;
  }

  .site-warning__text {
    padding-block: 3px;
    font-size: 13px;
  }

  .site-warning__close {
    width: 44px;
    height: 44px;
    margin: -4px -8px -4px 0;
  }

  html.site-warning-visible .ts-wrap {
    max-height: none;
  }
}

@media print {
  .site-warning {
    display: none !important;
  }

  html.site-warning-visible body {
    padding-top: 0 !important;
  }
}
