.home-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding: 6px;
  border: 1px solid #dfe8ed;
  border-radius: 16px;
  background: #eef3f6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.home-tab[hidden] {
  display: none !important;
}

.home-tab {
  position: relative;
  min-width: 0;
  min-height: 54px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #587085;
  text-align: left;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.home-tab:hover {
  background: rgba(255,255,255,.62);
  color: #1b455d;
}

.home-tab:focus-visible {
  outline: 2px solid #07899e;
  outline-offset: 2px;
}

.home-tab.is-active {
  background: #fff;
  border-color: #c7dde4;
  color: #075f70;
  box-shadow: 0 5px 14px rgba(29, 61, 82, .08), inset 0 -3px 0 #07899e;
}

.home-tab span,
.home-tab small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-tab span {
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: -.01em;
}

.home-tab small {
  margin-top: 3px;
  color: #8293a1;
  font-size: .61rem;
  font-weight: 650;
}

.home-tab.is-active small {
  color: #5f7c8c;
}

.home-tab-panels {
  margin-top: 12px;
}

.home-tab-panel[hidden] {
  display: none !important;
}

.home-tab-panel > .section-block,
.home-tab-panel > .ulrich-card,
.home-tab-panel > .people-insight-card {
  margin-top: 0;
}

.home-tab-panel.is-active {
  animation: homeTabIn .18s ease-out;
}

@keyframes homeTabIn {
  from { opacity: .6; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Desktop Home is a single-screen workspace: hero, tabs, active panel, and note fit in 100vh. */
@media (min-width: 901px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .page {
    height: 100vh;
    min-height: 0;
  }

  .home-shell {
    height: 100vh;
    min-height: 0;
    padding: 12px 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .hero-card {
    min-height: 0;
    padding: 15px 20px;
    gap: 20px;
  }

  .hero-kicker-row { margin-bottom: 6px; }
  .hero-card h1 { font-size: clamp(1.42rem, 1.9vw, 2rem); }
  .hero-card p { margin-top: 6px; font-size: .78rem; line-height: 1.35; }
  .hero-personal { padding: 10px 12px; }
  .hero-personal .hero-date { margin-bottom: 5px; }

  .home-tabs {
    margin-top: 0;
    padding: 4px;
    gap: 6px;
    border-radius: 13px;
  }

  .home-tab {
    min-height: 42px;
    padding: 6px 11px;
    border-radius: 9px;
  }

  .home-tab span { font-size: .76rem; }
  .home-tab small { margin-top: 1px; font-size: .56rem; }

  .home-tab-panels {
    min-height: 0;
    height: 100%;
    margin-top: 0;
  }

  .home-tab-panel.is-active,
  .home-tab-panel.is-active > .section-block,
  .home-tab-panel.is-active > .ulrich-card,
  .home-tab-panel.is-active > .people-insight-card {
    height: 100%;
    min-height: 0;
  }

  .section-block,
  .ulrich-card,
  .people-insight-card {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .section-heading {
    gap: 14px;
    margin-bottom: 8px;
  }

  .section-heading.compact { margin-bottom: 8px; }
  .section-kicker { margin-bottom: 3px; font-size: .6rem; }
  .section-heading h2,
  .decision-card h2,
  .insight-header h2 { font-size: 1.04rem; }
  .section-heading p,
  .decision-card > p,
  .insight-header p { margin-top: 4px; font-size: .66rem; line-height: 1.3; }

  #panelHcRoles > .section-block {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .domain-grid {
    min-height: 0;
    height: 100%;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .domain-card {
    min-height: 0;
    padding: 9px 10px;
    border-radius: 13px;
    display: flex;
    flex-direction: column;
  }

  .domain-topline { margin-bottom: 5px; }
  .domain-icon { width: 28px; height: 28px; border-radius: 8px; }
  .domain-icon svg { width: 16px; height: 16px; }
  .analytics-layer-badge { margin-bottom: 4px; padding: 2px 6px; font-size: .49rem; }
  .domain-card h3 { margin: 5px 0 3px; font-size: .76rem; line-height: 1.18; }
  .domain-card > p { min-height: 0; font-size: .57rem; line-height: 1.28; }

  .workspace-tabs {
    margin-top: auto;
    padding-top: 6px;
    gap: 5px;
  }

  .workspace-tabs a,
  .workspace-tabs button {
    padding: 5px 7px;
    border-radius: 8px;
  }

  .workspace-tabs span { font-size: .58rem; }
  .workspace-tabs small { font-size: .49rem; }

  #panelHcInsight > .ulrich-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .ulrich-grid {
    min-height: 0;
    height: 100%;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .quadrant {
    min-height: 0;
    height: 100%;
    padding: 8px 10px;
  }

  .quadrant small { font-size: .53rem; line-height: 1.25; }
  .ulrich-note { margin-top: 6px; font-size: .54rem; line-height: 1.25; }

  #panelHcAnalytic > .people-insight-card {
    display: flex;
    flex-direction: column;
  }

  .insight-header { gap: 14px; }
  .insight-header h2 { margin: 2px 0 4px; }
  .insight-open-button { min-width: 155px; padding: 7px 10px; }

  .insight-summary-grid {
    margin-top: 8px;
    gap: 7px;
  }

  .insight-summary-item {
    min-height: 50px;
    padding: 6px 10px;
  }

  .insight-summary-item span { font-size: .55rem; }
  .insight-summary-item strong { margin: 0; font-size: .92rem; }
  .insight-summary-item small { font-size: .53rem; }

  .insight-body-grid {
    min-height: 0;
    flex: 1;
    margin-top: 8px;
    gap: 8px;
  }

  .insight-feed,
  .analytics-loop {
    min-height: 0;
    height: 100%;
    padding: 8px;
    border-radius: 11px;
  }

  .insight-feed-title,
  .analytics-loop-title { padding-bottom: 5px; }
  .insight-row { padding: 6px 7px; gap: 7px; }
  .insight-signal { width: 25px; height: 25px; border-radius: 7px; font-size: .68rem; }
  .insight-domain { font-size: .5rem; }
  .insight-row strong { font-size: .63rem; line-height: 1.2; }
  .insight-row p { margin-top: 2px; font-size: .53rem; line-height: 1.25; }
  .insight-state { min-height: 20px; padding: 3px 6px; font-size: .5rem; }

  .loop-step {
    padding: 4px 6px;
    gap: 6px;
  }

  .loop-step > span { width: 22px; height: 22px; font-size: .5rem; }
  .loop-step strong { font-size: .61rem; }
  .loop-step small { font-size: .5rem; }
  .analytics-loop > i { margin: 0; font-size: .58rem; line-height: 1; }

  .home-footer-note {
    margin-top: 0;
    padding: 6px 11px;
    border-radius: 11px;
  }

  .home-footer-note strong { font-size: .61rem; }
  .home-footer-note span { margin-top: 1px; font-size: .52rem; line-height: 1.25; }
  .home-footer-note a { font-size: .57rem; }
}

@media (min-width: 901px) and (max-height: 720px) {
  .home-shell { padding: 7px 0; gap: 5px; }
  .hero-card { padding: 10px 16px; }
  .hero-card h1 { font-size: 1.3rem; }
  .hero-card p { font-size: .7rem; }
  .hero-personal { padding: 7px 10px; }
  .home-tab { min-height: 36px; padding: 4px 10px; }
  .section-block,
  .ulrich-card,
  .people-insight-card { padding: 9px 11px; }
  .section-heading { margin-bottom: 5px; }
  .section-heading p,
  .insight-header p { font-size: .61rem; line-height: 1.2; }
  .domain-grid { gap: 6px; }
  .domain-card { padding: 7px 9px; }
  .domain-card > p { font-size: .53rem; line-height: 1.2; }
  .workspace-tabs { padding-top: 4px; }
  .insight-summary-grid,
  .insight-body-grid { margin-top: 5px; }
  .insight-row { padding: 4px 6px; }
  .loop-step { padding: 3px 5px; }
  .home-footer-note { padding: 4px 9px; }
}

@media (max-width: 760px) {
  .home-tabs {
    grid-template-columns: 1fr;
  }

  .home-tab {
    min-height: 48px;
  }
}

/* Compact domain-card layout: icon left, domain/title center, status right. */
.domain-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon meta status"
    "icon title status"
    "desc desc desc";
  column-gap: 10px;
  row-gap: 2px;
  align-items: start;
  padding: 11px 12px;
}

.domain-topline {
  display: contents;
}

.domain-number {
  grid-area: meta;
  align-self: end;
  font-size: .54rem;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.domain-number::before {
  content: "DOMAIN ";
}

.domain-status {
  grid-area: status;
  justify-self: end;
  align-self: start;
  padding: 4px 8px;
  font-size: .52rem;
  line-height: 1;
}

.domain-icon {
  grid-area: icon;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  align-self: start;
}

.domain-icon svg {
  width: 18px;
  height: 18px;
}

.domain-card h3 {
  grid-area: title;
  min-width: 0;
  margin: 1px 0 0;
  font-size: .82rem;
  line-height: 1.14;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.domain-card > p {
  grid-area: desc;
  min-height: 0;
  margin: 7px 0 0;
  font-size: .62rem;
  line-height: 1.32;
}

@media (min-width: 901px) {
  #panelHcRoles > .section-block {
    height: auto;
    align-self: start;
    grid-template-rows: auto auto;
  }

  .domain-grid {
    height: auto;
    grid-template-rows: repeat(2, auto);
    align-content: start;
  }

  .domain-card {
    min-height: 94px;
    padding: 10px 11px;
    border-radius: 13px;
  }

  .domain-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .domain-icon svg {
    width: 16px;
    height: 16px;
  }

  .domain-card h3 {
    font-size: .78rem;
  }

  .domain-card > p {
    margin-top: 6px;
    font-size: .58rem;
    line-height: 1.28;
  }
}

@media (min-width: 901px) and (max-height: 720px) {
  .domain-card {
    min-height: 84px;
    padding: 8px 10px;
    column-gap: 8px;
  }

  .domain-icon {
    width: 30px;
    height: 30px;
  }

  .domain-number,
  .domain-status {
    font-size: .49rem;
  }

  .domain-card h3 {
    font-size: .72rem;
  }

  .domain-card > p {
    margin-top: 5px;
    font-size: .53rem;
    line-height: 1.22;
  }
}

@media (max-width: 620px) {
  .domain-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .domain-card h3 {
    white-space: normal;
  }
}

/* Flat Home navigation tabs: text + inline descriptor with active underline. */
.home-tabs {
  display: flex !important;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 40px !important;
  margin-top: 0 !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-bottom: 1px solid #d8e2e8 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.home-tab {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 44px !important;
  padding: 10px 0 11px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #526b81;
  box-shadow: none !important;
  transform: none !important;
}

.home-tab:hover {
  background: transparent !important;
  color: #244c64;
  transform: none !important;
}

.home-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
}

.home-tab.is-active {
  color: #007f94 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.home-tab.is-active::after {
  background: #07899e;
}

.home-tab:focus-visible {
  outline: 2px solid #07899e;
  outline-offset: 3px;
}

.home-tab span,
.home-tab small {
  display: inline !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap;
}

.home-tab span {
  font-size: .88rem !important;
  font-weight: 850;
  letter-spacing: -.01em;
}

.home-tab small {
  margin: 0 !important;
  color: #8c9caf;
  font-size: .62rem !important;
  font-weight: 600;
}

.home-tab small::before { content: "("; }
.home-tab small::after { content: ")"; }
.home-tab.is-active small { color: #8b9caf !important; }

@media (min-width: 901px) and (max-height: 720px) {
  .home-tab {
    min-height: 38px !important;
    padding: 7px 0 9px !important;
  }

  .home-tab span { font-size: .82rem !important; }
  .home-tab small { font-size: .58rem !important; }
}

@media (max-width: 760px) {
  .home-tabs {
    gap: 24px !important;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .home-tabs::-webkit-scrollbar { display: none; }

  .home-tab {
    min-height: 42px !important;
    padding: 9px 0 10px !important;
  }

  .home-tab span { font-size: .82rem !important; }
  .home-tab small { font-size: .57rem !important; }
}
