/* NEIS Circle hover sidebar — compact, height-aware desktop layout.
   Loaded after desktop-hover-rail-v1.css; original navigation and app layout stay unchanged. */
@media (min-width: 761px) {
  html body .rail.neis-hover-rail {
    --neis-rail-row: 42px;
    --neis-rail-gap: 3px;
    --neis-rail-nav-top: 12px;
    padding: 14px 12px 10px;
    align-items: stretch;
  }
  html body .rail.neis-hover-rail .neis-rail-brand {
    height: 48px;
    min-height: 48px;
    flex: 0 0 48px;
    align-self: stretch;
    gap: 10px;
  }
  html body .rail.neis-hover-rail .neis-rail-brand .logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    margin-inline-start: 7px;
    border-radius: 15px;
    font-size: 15px;
  }
  html body .rail.neis-hover-rail .neis-rail-brand-name { max-width: 155px; }
  html body .rail.neis-hover-rail .rail-nav {
    display: grid;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    grid-auto-rows: var(--neis-rail-row);
    align-content: start;
    align-items: stretch;
    justify-content: stretch;
    justify-items: stretch;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: var(--neis-rail-nav-top) 0 0;
    padding: 0;
    gap: var(--neis-rail-gap) 0;
    overflow-x: hidden;
    overflow-y: auto; /* only on unusually short desktop windows */
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  html body .rail.neis-hover-rail .rail-nav::-webkit-scrollbar { display: none; }
  html body .rail.neis-hover-rail .nav-btn {
    box-sizing: border-box;
    position: relative;
    align-self: stretch;
    justify-self: center;
    display: grid;
    grid-template-columns: 48px minmax(0,1fr);
    grid-template-rows: 1fr;
    align-items: center;
    justify-items: stretch;
    width: 48px;
    min-width: 0;
    max-width: none;
    height: var(--neis-rail-row);
    min-height: 0;
    max-height: var(--neis-rail-row);
    padding: 0;
    margin: 0;
    border-radius: 11px;
    transition: width 225ms cubic-bezier(.22,1,.36,1),
                background-color 160ms ease, color 160ms ease;
  }
  html body .rail.neis-hover-rail.is-expanded .rail-nav {
    align-content: start;
    justify-content: stretch;
    justify-items: stretch;
  }
  html body .rail.neis-hover-rail.is-expanded .nav-btn {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    grid-template-columns: 60px minmax(0,1fr);
  }
  html body .rail.neis-hover-rail .nav-btn > svg {
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    grid-area: 1 / 1;
    align-self: center;
    justify-self: center;
    margin: 0;
  }
  html body .rail.neis-hover-rail .nav-btn .neis-rail-label {
    grid-area: 1 / 2;
    font-size: 12px;
    font-weight: 620;
    letter-spacing: -.01em;
    padding-inline-end: 8px;
    text-align: start;
    line-height: 1.3;
    min-width: 0;
  }
  html body .rail.neis-hover-rail .neis-rail-footer {
    flex: 0 0 36px;
    min-height: 36px;
    height: 36px;
    margin-top: 6px;
  }
  html body .rail.neis-hover-rail.is-expanded .neis-rail-footer {
    padding-top: 4px;
    justify-content: flex-end;
  }
  html body .rail.neis-hover-rail .neis-rail-pin {
    height: 30px;
    min-width: 30px;
  }
  html body .rail.neis-hover-rail.is-expanded .neis-rail-pin {
    padding-inline: 9px;
  }
  html body .rail.neis-hover-rail .neis-rail-pin-label { font-size: 10.5px; }

  /* Visually separate selection without increasing row height. */
  html body .rail.neis-hover-rail .nav-btn.active {
    border-radius: 11px;
  }
  html body .rail.neis-hover-rail .nav-btn:hover:not(.active) {
    background: var(--soft);
    color: var(--ink);
  }
}
/* Fit all 13 original navigation items in a compact laptop window. */
@media (min-width: 761px) and (max-height: 760px) {
  html body .rail.neis-hover-rail {
    --neis-rail-row: 34px;
    --neis-rail-gap: 2px;
    --neis-rail-nav-top: 8px;
    padding-top: 10px;
    padding-bottom: 7px;
  }
  html body .rail.neis-hover-rail .neis-rail-brand {
    height: 42px; min-height: 42px; flex-basis: 42px;
  }
  html body .rail.neis-hover-rail .neis-rail-brand .logo {
    width: 40px; height: 40px; flex-basis: 40px;
    margin-inline-start: 10px;
    border-radius: 13px;
    font-size: 13px;
  }
  html body .rail.neis-hover-rail .nav-btn > svg { width: 17px; height: 17px; }
  html body .rail.neis-hover-rail .neis-rail-footer {
    height: 32px; min-height: 32px; flex-basis: 32px; margin-top: 5px;
  }
}
@media (min-width: 761px) and (max-height: 580px) {
  html body .rail.neis-hover-rail {
    --neis-rail-row: 29px;
    --neis-rail-gap: 1px;
    --neis-rail-nav-top: 5px;
    padding-top: 8px;
    padding-bottom: 6px;
  }
  html body .rail.neis-hover-rail .neis-rail-brand {
    height: 36px; min-height: 36px; flex-basis: 36px;
  }
  html body .rail.neis-hover-rail .neis-rail-brand .logo {
    width: 34px; height: 34px; flex-basis: 34px;
    margin-inline-start: 13px;
    border-radius: 11px;
    font-size: 12px;
  }
  html body .rail.neis-hover-rail .nav-btn > svg { width: 16px; height: 16px; }
  html body .rail.neis-hover-rail .nav-btn .neis-rail-label { font-size: 11px; }
  html body .rail.neis-hover-rail .neis-rail-footer {
    height: 28px; min-height: 28px; flex-basis: 28px; margin-top: 3px;
  }
}
@media (min-width: 761px) and (prefers-reduced-motion: reduce) {
  html body .rail.neis-hover-rail .nav-btn { transition: none !important; }
}
