/* 2026-03-29: unified tab-style header navigation + sibling site chips */

header .nav {
  grid-template-columns: minmax(158px, 214px) minmax(0, 1fr) minmax(260px, 460px);
  gap: 0.72rem;
  align-items: center;
}

header .brand {
  border-radius: 12px;
}

header .menu {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.38rem;
  padding: 4px;
  border: 1px solid #d2dff2;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 35, 78, 0.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
header .menu::-webkit-scrollbar { display: none; }

header .menu > a[href="#top"],
header .menu > a[href="index.html"],
header .menu > a[href="/index.html"] {
  display: none !important;
}

header .menu > a,
header .menu > .menu-dropdown > .menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 9px;
  white-space: nowrap;
  line-height: 1;
  font-weight: 700;
}

header .menu > a {
  border: 1px solid transparent;
  color: #20334f;
  font-size: 0.84rem;
  padding: 0 0.74rem;
}
header .menu > a:hover {
  border-color: #c6d5ec;
  background: #f5f9ff;
}
header .menu > a.active {
  background: #1f43a7;
  border-color: #19388b;
  color: #fff;
}

header .menu > .menu-dropdown > .menu-trigger {
  border: 1px solid #cad8ee;
  background: #f8fbff;
  color: #27466f;
  font-size: 0.82rem;
  padding: 0 0.82rem;
}
header .menu > .menu-dropdown > .menu-trigger:hover {
  border-color: #b5cae7;
  background: #f1f7ff;
}

header .menu > .menu-dropdown:first-of-type > .menu-trigger {
  border-color: #dab8c1;
  background: #fff4f6;
  color: #8f1f2d;
}
header .menu > .menu-dropdown:first-of-type > .menu-trigger.active {
  border-color: #721a27;
  background: #8f1f2d;
  color: #fff;
}

header .menu > .menu-dropdown:nth-of-type(2) > .menu-trigger {
  border-color: #b9cdee;
  background: #f1f7ff;
  color: #1f43a7;
}
header .menu > .menu-dropdown:nth-of-type(2) > .menu-trigger.active {
  border-color: #19388b;
  background: #1f43a7;
  color: #fff;
}

header .menu-panel {
  border-radius: 12px;
  border: 1px solid #cfddf0;
  box-shadow: 0 18px 32px rgba(11, 23, 45, 0.16);
}

header .nav-right {
  min-width: 0;
  gap: 0.44rem;
  align-items: center;
  justify-content: flex-end;
}

header .nav-right .home-link {
  display: none !important;
}

header .quick-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.28rem;
  margin-right: 0.08rem;
  transform: none !important;
  overflow-x: auto;
  max-width: min(44vw, 500px);
  padding-bottom: 2px;
  scrollbar-width: none;
}
header .quick-links::-webkit-scrollbar { display: none; }

header .quick-links a {
  text-decoration: none;
  display: inline-flex !important;
  flex: 0 0 auto;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 56px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid;
  line-height: 1;
  white-space: nowrap;
  padding: 3px 6px;
  box-shadow: none;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.16s ease;
}

header .quick-links a .quick-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  width: auto;
  height: 11px;
  padding: 0 3px;
  border-radius: 999px;
  font-size: 7px;
  letter-spacing: 0.02em;
  font-weight: 900;
  border: 1px solid transparent;
}

header .quick-links a .quick-label {
  display: inline-block;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

header .quick-links a.quick-ai {
  background: #edf4ff;
  border-color: #c4d5f8;
  color: #1f4ba2;
  min-width: 72px;
}
header .quick-links a.quick-ai .quick-emblem {
  background: #1f4ba2;
  border-color: #1a3f88;
  color: #fff;
  font-size: 6.8px;
  letter-spacing: 0;
  min-width: 40px;
}

header .quick-links a.quick-fin {
  background: #fff1f3;
  border-color: #e8c0c7;
  color: #8b1d2f;
  min-width: 82px;
}
header .quick-links a.quick-fin .quick-emblem {
  background: #8b1d2f;
  border-color: #6f1725;
  color: #fff;
}

header .quick-links a.quick-radar {
  background: #eef7ff;
  border-color: #c2daef;
  color: #15638a;
  min-width: 62px;
}
header .quick-links a.quick-radar .quick-emblem {
  background: #15638a;
  border-color: #104d6b;
  color: #fff;
}

header .quick-links a.quick-rss {
  background: #fff8e9;
  border-color: #ead7ad;
  color: #8a6113;
  min-width: 62px;
}
header .quick-links a.quick-rss .quick-emblem {
  background: #8a6113;
  border-color: #72500f;
  color: #fff;
}

header .quick-links a.quick-member {
  background: #1d438f;
  border-color: #173774;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-width: 62px;
  padding-right: 6px;
}
header .quick-links a.quick-member .quick-emblem {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
}
header .quick-links a.quick-member::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  background: url("/assets/openclaw/lobster-logo.svg") no-repeat center / contain;
  opacity: 0.18;
  pointer-events: none;
}

header .quick-links a.quick-admin {
  background: #8f1f2d;
  border-color: #711926;
  color: #fff;
  min-width: 62px;
}
header .quick-links a.quick-admin .quick-emblem {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
}

header .quick-links a:hover {
  transform: translateY(-1px);
  filter: saturate(1.03);
}
header .quick-links a.active {
  box-shadow: 0 0 0 2px rgba(31, 67, 167, 0.18);
}
header .quick-links a.quick-admin[hidden],
header .quick-links a.quick-admin[data-admin-entry][hidden] {
  display: none !important;
}

/* Console branding enhancement */
#consoleWorkspace {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
#consoleWorkspace::before {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -86px;
  width: clamp(300px, 34vw, 460px);
  aspect-ratio: 1 / 1;
  background: url("/assets/openclaw/lobster-logo.svg") no-repeat center / contain;
  opacity: 0.12;
  filter: saturate(1.16);
  pointer-events: none;
  z-index: 0;
}
#consoleWorkspace > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 1240px) {
  header .nav {
    grid-template-columns: minmax(138px, 186px) minmax(0, 1fr) minmax(220px, 360px);
  }
  header .quick-links a {
    height: 30px;
    padding: 2px 5px;
  }
  header .quick-links a .quick-label {
    font-size: 9.6px;
  }
}

@media (max-width: 768px) {
  header .nav {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
  header .menu {
    width: 100%;
    gap: 0.26rem;
    border-radius: 11px;
  }
  header .menu > a,
  header .menu > .menu-dropdown > .menu-trigger {
    min-height: 31px;
    font-size: 0.76rem;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }
  header .nav-right {
    width: 100%;
    justify-content: space-between;
  }
  header .quick-links {
    max-width: 76vw;
    gap: 0.3rem;
  }
  header .quick-links a {
    height: 30px;
    padding: 0 8px;
    border-radius: 9px;
  }
  header .quick-links a .quick-emblem {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }
  header .quick-links a .quick-label {
    font-size: 10px;
  }
}
