.app-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #111827;
  background: #1f2937;
  color: #f8fafc;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

.app-header-left,
.app-header .header-right {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header-left {
  flex: 1 1 auto;
  overflow: hidden;
}

.app-header .header-logo-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.app-header .header-logo {
  width: auto;
  height: 30px;
  display: block;
  object-fit: contain;
}

.app-header .app-header-menu {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.app-header .header-right {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.app-header .app-header-user {
  max-width: 220px;
  overflow: hidden;
  color: #e5e7eb;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header .ctrl-btn {
  min-height: 28px;
  padding: 4px 8px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #475569;
  border-radius: 8px;
  background: #334155;
  color: #f8fafc;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.app-header .ctrl-btn[hidden] {
  display: none;
}

.app-header .ctrl-btn:hover {
  border-color: #64748b;
  background: #3b4b60;
}

.app-header .ctrl-btn.is-active {
  border-color: #1e40af;
  background: #1d4ed8;
  color: #fff;
}

.app-header-context-button {
  flex: 0 0 auto;
}

.app-header-rate-alert { position: relative; flex: 0 0 auto; }
.app-header-rate-alert[hidden] { display: none; }
.app-header .app-header-rate-alert__toggle { border-color: #a16207; background: #713f12; color: #fef3c7; }
.app-header-rate-alert__panel { position: absolute; z-index: 1000; top: calc(100% + 8px); right: 0; width: min(520px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow: auto; padding: 12px; border: 1px solid #475569; border-radius: 10px; background: #111c2e; box-shadow: 0 14px 34px rgba(0,0,0,.38); color: #e5edf7; }
.app-header-rate-alert__panel[hidden] { display: none; }
.app-header-rate-alert__panel > strong { display: block; margin-bottom: 8px; font-size: 12px; }
.app-header-rate-alert__panel ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.app-header-rate-alert__panel a { display: block; padding: 8px; border-radius: 7px; color: #dbeafe; font-size: 12px; line-height: 1.4; text-decoration: none; }
.app-header-rate-alert__panel a:hover, .app-header-rate-alert__panel a:focus-visible { background: #1e293b; color: #fff; outline-color: #93c5fd; }

@media (max-width: 700px) {
  .app-header-rate-alert__panel { position: fixed; top: 62px; right: 8px; }
}
