/* HBV HF21 S2: dual-mode member shell. Family mode uses a clear top navigation; advisor mode preserves the dense sidebar. */
:root[data-hbv-hf21-member="s2"] {
  --hf21-header-height: 72px;
}
.hf21-family-header { display: none; }

@media (min-width: 1181px) {
  html[data-hbv-hf21-member="s2"] body[data-hf21-view-mode="family"] .sidebar { display: none !important; }
  html[data-hbv-hf21-member="s2"] body[data-hf21-view-mode="family"] .main {
    width: 100% !important;
    margin-left: 0 !important;
  }
  html[data-hbv-hf21-member="s2"] body[data-hf21-view-mode="family"] .topbar { display: none !important; }
  html[data-hbv-hf21-member="s2"] body[data-hf21-view-mode="family"] .hf21-family-header {
    position: sticky;
    top: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: minmax(250px, .75fr) minmax(650px, 2.3fr) minmax(190px, .6fr);
    align-items: center;
    gap: 20px;
    height: var(--hf21-header-height);
    padding: 0 24px;
    border-bottom: 1px solid #dce5f1;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(18px);
    box-shadow: 0 4px 18px rgba(30,64,110,.045);
  }
  html[data-hbv-hf21-member="s2"] body[data-hf21-view-mode="family"] .workspace-bar {
    margin-top: 14px;
  }
}

.hf21-family-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: #113f7d;
  text-decoration: none;
}
.hf21-family-brand img { width: 36px; height: 36px; flex: none; }
.hf21-family-brand strong { display: block; font-size: 16px; white-space: nowrap; }
.hf21-family-brand small { display: block; margin-top: 3px; color: #718096; font-size: 10px; white-space: nowrap; }
.hf21-primary-nav { display: flex; justify-content: center; align-items: stretch; gap: 2px; min-width: 0; }
.hf21-nav-group { position: relative; }
.hf21-nav-trigger {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #26384f;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  cursor: pointer;
}
.hf21-nav-trigger:hover,
.hf21-nav-trigger:focus-visible,
.hf21-nav-group.active > .hf21-nav-trigger {
  background: #eaf2ff;
  color: #155eef;
  outline: none;
}
.hf21-nav-trigger[aria-haspopup="true"]::after { content: "⌄"; color: #8191a8; font-size: 11px; }
.hf21-nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 70;
  min-width: 220px;
  padding: 8px;
  border: 1px solid #dbe5f2;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(27,55,96,.16);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -5px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.hf21-nav-group.open .hf21-nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.hf21-nav-menu button,
.hf21-nav-menu a {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #26384f;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.hf21-nav-menu button:hover,
.hf21-nav-menu button:focus-visible,
.hf21-nav-menu a:hover,
.hf21-nav-menu a:focus-visible { background: #f2f6fc; color: #155eef; outline: none; }
.hf21-nav-menu i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #edf3fb; color: #315f9e; font-style: normal; font-size: 11px; font-weight: 900; }
.hf21-nav-menu b { display: block; font-size: 12px; }
.hf21-nav-menu small { display: block; margin-top: 2px; color: #718096; font-size: 9px; line-height: 1.35; }
.hf21-family-user { display: flex; justify-content: flex-end; align-items: center; gap: 9px; min-width: 0; }
.hf21-family-user-copy { min-width: 0; text-align: right; }
.hf21-family-user-copy b,
.hf21-family-user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf21-family-user-copy b { color: #172b47; font-size: 12px; }
.hf21-family-user-copy small { margin-top: 2px; color: #718096; font-size: 9px; }
.hf21-family-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: #eaf2ff; color: #155eef; font-size: 13px; font-weight: 900; }

/* Family dashboard follows the design proposal: broad summary plus decision tasks. */
@media (min-width: 1181px) {
  body[data-hf21-view-mode="family"] #page-dashboard { padding-top: 20px; }
  body[data-hf21-view-mode="family"] .dashboard-hero {
    grid-template-columns: minmax(0,1.65fr) minmax(280px,.65fr);
    min-height: 152px;
    padding: 28px 30px;
    border-radius: 18px;
    background: linear-gradient(120deg,#12366a,#153f79 68%,#1c5b9f);
  }
  body[data-hf21-view-mode="family"] .dashboard-hero h2 { font-size: 27px; margin: 8px 0; }
  body[data-hf21-view-mode="family"] .dashboard-hero .eyebrow { display: none; }
  body[data-hf21-view-mode="family"] .dashboard-hero-copy p { max-width: 780px; }
  body[data-hf21-view-mode="family"] .dashboard-hero-side { align-self: stretch; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  body[data-hf21-view-mode="family"] .dashboard-hero-kpi { min-width: 0; }
  body[data-hf21-view-mode="family"] .decision-head-actions { grid-column: 1/-1; }
  body[data-hf21-view-mode="family"] .dashboard-main-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1360px) and (min-width: 1181px) {
  html[data-hbv-hf21-member="s2"] body[data-hf21-view-mode="family"] .hf21-family-header { grid-template-columns: 220px minmax(0,1fr) 170px; gap: 10px; padding: 0 16px; }
  .hf21-nav-trigger { padding: 0 9px; font-size: 12px; }
  .hf21-family-brand small { display: none; }
}

@media (max-width: 1180px) {
  .hf21-family-header { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .hf21-nav-menu { transition: none; }
}
@media (forced-colors: active) {
  .hf21-nav-group.active > .hf21-nav-trigger { border: 2px solid CanvasText; }
}
@media print { .hf21-family-header { display: none !important; } }
