/* A personal layer over the existing navigation; no operational state is invented. */
.hub-shell .workspace-sidebar .hub-sidebar-head { margin-bottom: 18px; }
.workspace-personal-card { margin: 0 0 16px; border: 1px solid var(--menu-line); border-radius: 14px; background: linear-gradient(125deg, #9de3c709, transparent 75%); }
.workspace-personal-identity { display: flex; align-items: center; gap: 11px; width: 100%; padding: 13px 11px 9px; border: 0; background: transparent; color: var(--menu-text); text-align: start; cursor: pointer; }
.workspace-personal-identity > svg { flex: none; width: 14px; height: 14px; color: var(--menu-muted); }
.workspace-personal-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 43px; height: 43px; border: 1px solid #9de3c740; border-radius: 14px; overflow: hidden; background: linear-gradient(145deg, #26443b, #1b282b); color: #c9f0df; font-size: 14px; font-weight: 650; letter-spacing: .5px; }
.workspace-personal-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.workspace-personal-copy { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.workspace-personal-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 580; line-height: 1.5; color: var(--menu-text); }
.workspace-personal-eyebrow { display: block; font-size: 11px; font-weight: 560; letter-spacing: 1.1px; line-height: 1.5; color: var(--menu-muted); }
.workspace-personal-plan { align-self: flex-start; max-width: 100%; padding: 1px 7px; border-radius: 5px; background: #9de3c712; color: var(--menu-accent); font-size: 11px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-personal-company { padding: 8px 11px; margin: 0; border-top: 1px solid var(--menu-line); font-size: 11px; line-height: 1.5; color: var(--menu-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-personal-quick { display: flex; align-items: center; gap: 8px; min-height: 36px; max-width: 170px; padding: 3px 9px 3px 4px; margin-inline-start: auto; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); color: var(--text); font-size: 12px; cursor: pointer; }
.workspace-personal-quick > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-personal-avatar.is-small { width: 28px; height: 28px; border-radius: 50%; font-size: 11px; }
.workspace-profile-dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 28px); padding: 24px; overflow-y: auto; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 24px 100px #0005; }
.workspace-profile-dialog::backdrop { background: #060a10ad; backdrop-filter: blur(6px); }
.personal-icon-button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; min-height: 32px; padding: 5px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.personal-icon-button svg { width: 16px; height: 16px; }
.workspace-profile-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workspace-profile-head h2 { margin: 0; font-size: 22px; font-weight: 550; color: var(--text); }
.workspace-profile-subtitle { margin: 6px 0 24px; font-size: 12px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.workspace-profile-photo { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.workspace-personal-avatar.is-preview { width: 78px; height: 78px; border-radius: 24px; font-size: 24px; }
.workspace-profile-photo > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.workspace-profile-photo .button { display: inline-flex; align-items: center; gap: 7px; margin: 0; cursor: pointer; }
.workspace-profile-photo svg { width: 14px; height: 14px; }
.workspace-profile-photo small { flex-basis: 100%; color: var(--muted); font-size: 11px; line-height: 1.6; }
.workspace-profile-file { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.workspace-profile-file:focus-visible + button, .workspace-profile-photo:has(.workspace-profile-file:focus-visible) label { outline: 2px solid var(--mint); outline-offset: 3px; }
.personal-profile-remove { min-height: 36px; padding: 4px; border: 0; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.workspace-profile-form .field { display: flex; flex-direction: column; gap: 9px; }
.workspace-profile-form .field input { min-height: 44px; padding: 10px 12px; font-size: 14px; }
.workspace-profile-note { margin: 12px 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.workspace-profile-feedback { min-height: 20px; font-size: 12px; line-height: 1.7; color: var(--mint); }
.workspace-profile-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.workspace-profile-actions .button { min-height: 42px; }
.workspace-profile-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.workspace-profile-links a { display: flex; align-items: center; min-height: 32px; color: var(--muted); font-size: 12px; }
.workspace-personal-card svg, .workspace-personal-quick svg, .workspace-profile-dialog svg, .workspace-connection-button svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hub-shell :is(.workspace-personal-identity, .workspace-personal-quick, .personal-icon-button, .personal-profile-remove):focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.hub-shell[data-hub-theme=light] .workspace-personal-card { background: linear-gradient(125deg, #246f5408, transparent 75%); }
.hub-shell[data-hub-theme=light] .workspace-personal-plan { background: #246f5410; }
.hub-shell[data-hub-theme=light] .workspace-personal-avatar { background: linear-gradient(135deg, #e0eee6, #cde4d9); border-color: #246f5430; color: #285944; }
@media (min-width: 761px) {
  .hub-shell[data-hub-collapsed=true] .workspace-personal-card { margin: 0 0 18px; border: 0; background: none; }
  .hub-shell[data-hub-collapsed=true] .workspace-personal-identity { padding: 4px; justify-content: center; }
  .hub-shell[data-hub-collapsed=true] .workspace-personal-avatar { width: 42px; height: 42px; }
  .hub-shell[data-hub-collapsed=true] :is(.workspace-personal-copy, .workspace-personal-company, .workspace-personal-identity > svg) { display: none; }
}
@media (max-width: 760px) {
  .hub-shell .workspace-sidebar .hub-sidebar-head { margin-bottom: 18px; }
  .hub-shell .workspace-personal-identity { min-height: 84px; }
  .workspace-personal-quick { min-height: 40px; max-width: 150px; }
  .workspace-profile-dialog { padding: 22px 18px; border-radius: 16px; }
  .workspace-profile-photo { gap: 14px; }
  .workspace-profile-form .field input { font-size: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .workspace-personal-identity, .workspace-personal-quick { transition: background 160ms, border-color 160ms; }
  .workspace-profile-dialog[open] { animation: menu-palette-in 180ms ease both; }
}
body[data-hub-reduced-motion=true] :is(.workspace-personal-identity, .workspace-personal-quick, .workspace-profile-dialog) { animation: none; transition: none; }
@media (forced-colors: active) { .workspace-personal-card, .workspace-personal-avatar { border: 1px solid CanvasText; } }

/* Navigation fits the viewport. Long information belongs to pages or dialogs. */
.hub-shell .workspace-sidebar { overflow: visible; padding: 16px 14px 12px; }
.hub-shell .workspace-sidebar .hub-sidebar-head { flex: none; min-height: 36px; margin-bottom: 12px; }
.workspace-personal-card { flex: none; margin-bottom: 12px; }
.workspace-personal-identity { padding: 10px; }
.hub-shell .workspace-sidebar .workspace-search-button { flex: none; min-height: 40px; margin-bottom: 15px; }
.hub-shell .workspace-sidebar .main-nav { flex: 1; min-height: 0; gap: 4px; margin: 0; }
.hub-shell .workspace-sidebar .main-nav::before { display: none; }
.hub-shell .workspace-sidebar .nav-item { min-height: 44px; padding: 9px 12px; }
.hub-shell .workspace-sidebar .nav-item[data-area=config] { margin-top: auto; margin-bottom: 8px; border-top: 1px solid var(--menu-line); border-radius: 0 0 10px 10px; padding-top: 12px; }
.hub-shell .workspace-sidebar .sidebar-footer { flex: none; min-height: 36px; padding: 0; border: 0; }
.workspace-connection-button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 7px 11px; border: 1px solid var(--menu-line); border-radius: 8px; background: transparent; color: var(--menu-muted); font-size: 11px; text-align: start; cursor: pointer; }
.workspace-connection-button #side-status { flex: 1; margin: 0; min-width: 0; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-connection-button #side-dot { flex: none; width: 5px; height: 5px; }
.workspace-connection-button > svg { flex: none; width: 12px; height: 12px; }
.workspace-connection-button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.workspace-connection-facts { display: flex; flex-direction: column; gap: 10px; padding: 16px 0 22px; }
.workspace-connection-facts .status-pill { align-self: flex-start; max-width: 100%; padding: 8px 12px; font-size: 12px; white-space: normal; line-height: 1.6; }
.workspace-connection-build { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.workspace-connection-build summary { min-height: 36px; cursor: pointer; }
.workspace-connection-build #version-label { display: block; padding-top: 6px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .hub-shell .workspace-sidebar { overflow: visible; padding: 18px 16px 12px; }
  .hub-shell .workspace-sidebar .main-nav { flex: 1; }
  .hub-shell .workspace-sidebar .hub-sidebar-head { margin-bottom: 14px; }
  .hub-shell .workspace-personal-identity { min-height: 70px; }
  .workspace-connection-button { min-height: 44px; }
}
@media (max-height: 760px) {
  .hub-shell .workspace-sidebar { padding-block: 12px 10px; }
  .hub-shell .workspace-sidebar .hub-sidebar-head { min-height: 32px; margin-bottom: 9px; }
  .workspace-personal-eyebrow { display: none; }
  .workspace-personal-company { padding-block: 5px; }
  .workspace-personal-card { margin-bottom: 10px; }
  .workspace-personal-identity { min-height: 60px; padding-block: 8px; }
  .hub-shell .workspace-sidebar .workspace-search-button { margin-bottom: 10px; }
  .hub-shell .workspace-sidebar .main-nav { gap: 2px; }
  .hub-shell .workspace-sidebar .nav-item { min-height: 44px; padding-block: 7px; }
  .hub-shell .workspace-sidebar .nav-item[data-area=config] { padding-top: 8px; margin-bottom: 4px; }
}
@media (max-height: 620px) {
  .workspace-personal-company { display: none; }
  .hub-shell .workspace-sidebar .hub-sidebar-head { margin-bottom: 6px; }
  .hub-shell .workspace-personal-identity { min-height: 52px; padding-block: 6px; }
  .workspace-personal-card { margin-bottom: 6px; }
  .hub-shell .workspace-sidebar .workspace-search-button { margin-bottom: 6px; }
  .hub-shell .workspace-sidebar .main-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, 44px) minmax(44px, 1fr); gap: 2px; align-content: start; }
  .hub-shell .workspace-sidebar .nav-item { justify-content: center; min-width: 0; padding: 7px 3px; gap: 5px; text-align: center; }
  .hub-shell .workspace-sidebar .nav-item > svg, .hub-shell .workspace-sidebar .nav-item::after, .hub-shell .workspace-sidebar .nav-count { display: none; }
  .hub-shell .workspace-sidebar .workspace-nav-copy strong { font-size: 11px; }
  .hub-shell .workspace-sidebar .nav-item[data-area=config] { margin-top: 0; margin-bottom: 0; padding-top: 7px; align-self: end; }
}
@media (max-width: 760px) and (max-height: 480px) {
  .hub-shell .workspace-sidebar { inset-block: 0; inset-inline-start: 0; height: 100dvh; max-height: 100dvh; padding: 10px 12px; border-radius: 0 14px 14px 0; }
  .hub-shell .workspace-sidebar .hub-sidebar-head { min-height: 38px; margin-bottom: 7px; }
  .hub-shell .workspace-sidebar .brand-name { display: none; }
  .hub-shell .workspace-sidebar .workspace-search-button { position: absolute; top: 10px; inset-inline-end: 51px; min-height: 38px; width: 38px; padding: 9px; margin: 0; }
  .hub-shell .workspace-sidebar .workspace-search-button :is(span,kbd) { display: none; }
  .hub-shell .workspace-sidebar .hub-menu-close { top: 12px; inset-inline-end: 12px; }
  .hub-shell .workspace-personal-identity { min-height: 48px; padding: 6px 8px; }
  .workspace-personal-card { margin-bottom: 8px; }
  .workspace-personal-plan { display: none; }
  .hub-shell .workspace-sidebar .main-nav { grid-template-columns: repeat(3, minmax(0,1fr)); grid-template-rows: repeat(2,44px) minmax(44px,1fr); }
  .hub-shell .workspace-sidebar .nav-item[data-area=config] { grid-column: 2 / 4; }
}
@media (min-width: 761px) and (max-height: 620px) {
  .hub-shell[data-hub-collapsed=true] { --sidebar-width: 112px; }
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar .nav-item > svg { display: block; }
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar .nav-item { padding: 8px; }
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar .hub-sidebar-head { margin-bottom: 8px; }
  .hub-shell[data-hub-collapsed=true] .workspace-personal-card { margin-bottom: 8px; }
}

@media (min-width: 761px) and (max-height: 440px) {
  .hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar { padding: 10px 12px; }
  .hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar .hub-sidebar-head { min-height: 38px; margin-bottom: 7px; }
  .hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar .brand-name { display: none; }
  .hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar .workspace-search-button { position: absolute; top: 10px; inset-inline-end: 51px; min-height: 38px; width: 38px; padding: 9px; margin: 0; }
  .hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar .workspace-search-button :is(span,kbd) { display: none; }
  .hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar .main-nav { grid-template-columns: repeat(3, minmax(0,1fr)); grid-template-rows: repeat(2,44px) minmax(44px,1fr); }
  .hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar .nav-item[data-area=config] { grid-column: 2 / 4; }
  .hub-shell:not([data-hub-collapsed=true]) .workspace-personal-plan { display: none; }
}

@media (min-width: 761px) and (max-height: 380px) {
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar { padding: 8px 10px; }
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar .hub-sidebar-head { flex-direction: row; min-height: 32px; margin-bottom: 4px; }
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar .brand { display: none; }
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar .workspace-search-button { position: absolute; top: 8px; inset-inline-end: 10px; width: 32px; min-height: 32px; padding: 7px; margin: 0; }
  .hub-shell[data-hub-collapsed=true] .workspace-personal-card { margin-bottom: 4px; }
}


/* Six work menus plus settings: keep settings on the bottom row in short layouts. */
@media (max-height: 620px) {
  .hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar .nav-item[data-area=config] { grid-column: 1 / -1; grid-row: 4; }
}
@media (min-width: 761px) and (max-height: 660px) {
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar .nav-item[data-area=config] { grid-column: 1 / -1; grid-row: 4; }
}
@media (max-width: 760px) and (max-height: 480px), (min-width: 761px) and (max-height: 440px) {
  .hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar .nav-item[data-area=config],
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar .nav-item[data-area=config] { grid-row: 3; }
}

/* Keep short-height primary labels on one line in the three-column layout. */
@media (max-width: 760px) and (max-height: 480px), (min-width: 761px) and (max-height: 440px) {
 body.hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar .main-nav .nav-item { padding-inline: 1px; gap: 0; }
 body.hub-shell:not([data-hub-collapsed=true]) .workspace-sidebar .workspace-nav-copy strong { font-size: 11px; white-space: nowrap; }
}
