/* Shared kconsole shell — kgilles-style fixed header + header auth slot */
:root {
  --site-header-h: 4.5rem;
  --console-brand: #0050d7;
}

body.shell-has-header {
  padding-top: var(--site-header-h);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: #fff;
  border-bottom: 1px solid #d8deea;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-sizing: border-box;
  min-height: var(--site-header-h);
  overflow: visible;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.site-brand img {
  width: 48px;
  height: 48px;
  pointer-events: none;
}

.site-brand .site-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
  overflow: visible;
}

.site-nav {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-right: 0.75rem;
}

.site-nav a {
  color: var(--console-brand);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.site-nav a.active {
  font-weight: 600;
  text-decoration: underline;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
  overflow: visible;
}

.lang-switch-mount {
  display: flex;
  align-items: center;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid #d8deea;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.lang-btn {
  border: none;
  background: transparent;
  color: #5c6378;
  font: 600 0.6875rem/1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.lang-btn:hover {
  color: var(--console-brand);
}

.lang-btn.active {
  background: #eef3ff;
  color: var(--console-brand);
}

.header-login-btn {
  font: 400 0.875rem/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #5c6378;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  white-space: nowrap;
}

.header-login-btn:hover {
  color: var(--console-brand);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-overlay.hidden {
  display: none;
}

.login-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 31, 54, 0.45);
}

.login-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  min-height: 320px;
  background: #f4f6fb;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(26, 31, 54, 0.2);
  overflow: hidden;
}

.login-overlay-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #5c6378;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.login-overlay-close:hover {
  color: var(--console-brand);
}

.login-overlay-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.login-overlay-auth-min {
  display: none !important;
}

.site-footer {
  border-top: 1px solid #d8deea;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #5c6378;
  background: #fff;
}

.site-footer a {
  color: #5c6378;
}

.site-footer a:hover {
  color: var(--console-brand);
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin: 0 0 0.65rem;
}

.site-footer-nav a {
  font-size: 0.8125rem;
  text-decoration: none;
}

.header-auth-slot {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  min-width: 4.5rem;
  min-height: 2.25rem;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.login-fallback {
  font: 400 0.875rem/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #5c6378;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
}

.login-fallback:hover {
  color: var(--console-brand);
}

.session-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #d8deea;
  background: #f4f6fb;
}

.header-auth .status {
  font-size: 0.875rem;
  color: #5c6378;
  white-space: nowrap;
}

.header-auth .logout {
  font-size: 0.875rem;
  color: var(--console-brand);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.shell-main.shell-locked {
  visibility: hidden;
  pointer-events: none;
  min-height: 40vh;
}

.auth-gate {
  max-width: 36rem;
  margin: 3rem auto;
  padding: 1.5rem;
  text-align: center;
  color: #5c6378;
  font-size: 1rem;
  line-height: 1.5;
}

.auth-gate.hidden {
  display: none;
}
