/* Shared navigation: a compact desktop island and a mobile dock. */
:root {
  --desktop-shell-scale: .82;
  --desktop-nav-space: 80px;
  --desktop-shell-collapsed-width: calc((100vw - 112px) / var(--desktop-shell-scale));
  --desktop-shell-width: calc((100vw - var(--desktop-nav-space) - 32px) / var(--desktop-shell-scale));
  --desktop-nav-height: 0px;
}
.main-nav { position: sticky; z-index: 10; top: 0; display: grid; grid-template-columns: minmax(0, 1fr); min-height: var(--desktop-nav-height); align-items: center; gap: 18px; background: rgba(5,5,5,.92); backdrop-filter: blur(18px); }
.nav-links { display: flex; align-items: center; gap: 24px; min-width: 0; }
.nav-item { padding: 10px 0; border: 0; background: transparent; color: #929292; font-size: 20px; font-weight: 620; line-height: 1.4; white-space: nowrap; text-decoration: none; }
.nav-item:hover { color: #d6d6d6; }
.nav-item.is-active { color: #fff; font-weight: 700; }
.nav-icon { display: none; }

.main-nav :is(button, a):focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
@media (min-width: 821px) {
  body:has(.main-nav:not([hidden])) { padding-left: var(--desktop-nav-space); }
  body { transition: padding-left .2s ease; }
  .app, .profile-page, .vacancies-page { transition: width .2s ease; }
  .main-nav { position: fixed; z-index: 100; inset: 16px auto auto 8px; display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 64px; min-height: 0; margin: 0; padding: 8px; border: 0; border-radius: 24px; background: #141414; box-shadow: none; backdrop-filter: none; transition: width .2s ease, border-radius .2s ease; }
  .main-nav .nav-links { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid #ffffff0a; }
  .main-nav .nav-item { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 48px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #929292; font-family: var(--sans); font-size: 15px; font-weight: 600; line-height: 1; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
  .main-nav .nav-item:hover { background: #1d1d1d; color: #fff; }
  .main-nav .nav-item.is-active { background: #2a2a2a; color: #ededed; box-shadow: none; }
  .main-nav .nav-icon { display: grid; flex: 0 0 22px; place-items: center; width: 22px; height: 22px; }
  .main-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .main-nav .nav-label { position: absolute; z-index: 1; top: 50%; left: calc(100% + 20px); padding: 8px 12px; border-radius: 12px; background: #2a2a2a; box-shadow: 0 8px 24px #0009; color: #ededed; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-6px, -50%); transition: opacity .12s ease, transform .12s ease; }
  .main-nav .nav-item:is(:hover, :focus-visible) .nav-label { opacity: 1; transform: translate(0, -50%); transition-delay: .2s; }
  .nav-actions { margin-top: 8px; }
  .nav-actions .nav-item { color: #727272; }

}
@media (max-width: 820px) {
  .nav-actions { display: none; }
  .main-nav { position: fixed; z-index: 90; inset: auto auto auto 50%; display: block; min-height: 0; transform: translateX(-50%); }
}
/* Shared mobile navigation, matching the matte stage pills. */
@media (max-width: 820px) {
  html { scroll-padding-bottom: calc(116px + env(safe-area-inset-bottom)); }

  .main-nav {
    width: min(calc(100% - 24px), 400px);
    padding: 8px 10px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 999px;
    background: #141414;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transform: translate(-50%, var(--navigation-offset, 0px));
  }

  .main-nav.is-settling { transition: transform .42s cubic-bezier(.22, 1, .36, 1); }

  .main-nav .nav-links {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
  }

  .main-nav .nav-item {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 56px;
    padding: 2px;
    place-items: center;
    align-content: center;
    gap: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #929292;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color .12s ease;
  }
  /* Keep names accessible while the mobile dock shows icons only. */
  .main-nav .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .main-nav .nav-item.is-active {
    background: transparent;
    box-shadow: none;
    color: #f5f5f5;
    font-weight: 600;
  }
  .main-nav .nav-icon {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 92px;
    height: 54.72px;
    border-radius: 999px;
    background: transparent;
    transition: background-color .12s ease, color .12s ease;
  }
  .main-nav .nav-icon svg {
    width: 33.12px;
    height: 33.12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .main-nav .nav-item.is-active .nav-icon {
    background: #2a2a2a;
    color: #ededed;
  }
  .main-nav .nav-item:active { color: #fff; }
  .main-nav .nav-item:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
  }
}

@media (max-width: 820px) and (hover: hover) and (pointer: fine) {
  .main-nav .nav-item:hover { background: transparent; color: #f5f5f5; }
}

@media (prefers-reduced-motion: reduce) {
  body, .app, .profile-page, .vacancies-page, .main-nav, .main-nav.is-settling, .main-nav .nav-item, .main-nav .nav-icon, .main-nav .nav-label { transition: none; }
}

/* Unread support reply: the user's move, so it uses the accent. */
.main-nav .nav-icon { position: relative; }
.main-nav .nav-icon.has-dot::after { content: ""; position: absolute; top: calc(50% - 12px); left: calc(50% + 6px); width: 8px; height: 8px; border: 2px solid #141414; border-radius: 50%; background: var(--accent); }
@media (min-width: 821px) {
  .main-nav .nav-item:hover .nav-icon.has-dot::after { border-color: #1d1d1d; }
}
.main-nav .nav-item.is-active .nav-icon.has-dot::after { border-color: #2a2a2a; }
@media (max-width: 820px) {
  .main-nav .nav-icon.has-dot::after { top: calc(50% - 17px); left: calc(50% + 9px); width: 10px; height: 10px; }
}

/* Logout confirmation shared by every application screen. */
body:has(#logout-dialog[open]) { overflow: hidden; }
#logout-dialog { box-sizing: border-box; width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 32px; overflow-y: auto; border: 0; border-radius: 32px; background: #111; color: #f5f5f5; font-family: var(--sans); }
#logout-dialog::backdrop { background: #000b; backdrop-filter: blur(6px); }
#logout-dialog h2 { margin: 0 0 12px; font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -.03em; }
.logout-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.logout-actions button { min-height: 52px; padding: 0 16px; border: 0; border-radius: 999px; background: #353535; color: #e4e4e4; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.logout-actions button[value="logout"] { color: #ff8585; }
.logout-actions button:hover { background: #414141; }
.logout-actions button:focus { outline: none; }
.logout-actions button:focus-visible { background: #484848; }
@media (max-width: 820px) {
  #logout-dialog { padding: 24px; }
}
.logout-error { margin: 16px 0 0; color: #f1a29b; font-size: 16px; line-height: 1.5; }
.logout-actions button:disabled { opacity: .6; cursor: wait; }
