/* Desktop rows use ordinary CSS so no Tailwind rebuild is required. */
.nomen-desktop-menu { display: none; }
@media screen and (min-width: 768px) {
  .nomen-legacy-menu { display: none; }
  .nomen-desktop-menu { display: block; position: fixed; top: 0; left: 0; right: 0; z-index: 50; }
  .nomen-menu-root { display: flex; align-items: center; gap: 20px; height: 48px; padding: 0 16px; background: #881337; color: white; box-shadow: 0 1px 4px #0002; }
  .nomen-menu-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; flex-shrink: 0; }
  .nomen-menu-scroll { display: flex; align-items: center; gap: 20px; overflow-x: auto; white-space: nowrap; min-width: 0; height: 100%; }
  .nomen-menu-root > .nomen-menu-scroll { flex: 1; }
  .nomen-menu-item { flex-shrink: 0; padding: 5px 2px; background: transparent; color: inherit; font-weight: 600; border-bottom: 2px solid transparent; text-decoration: none; cursor: pointer; }
  .nomen-menu-item:hover, .nomen-menu-item[aria-expanded="true"] { border-bottom-color: currentColor; }
  .nomen-menu-item:focus-visible, .nomen-menu-logout:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
  .nomen-menu-row { height: 44px; border-bottom: 1px solid #cbd5e1; }
  .nomen-menu-row[hidden] { display: none; }
  .nomen-menu-level-1 { background: #ffe4e6; color: #4c0519; }
  .nomen-menu-level-2 { background: #fff1f2; color: #4c0519; }
  .nomen-menu-level-3 { background: #fff7f8; color: #4c0519; }
  .nomen-menu-logout { background: #9f1239; color: white; border-radius: 6px; padding: 5px 12px; cursor: pointer; }
  main.nomen-menu-content { padding-top: calc(var(--nomen-menu-height, 48px) + 24px); }
}
@media print { .nomen-desktop-menu { display: none !important; } }

/* Mobile drawer: native dialog provides modal focus and Escape handling. */
.nomen-mobile-menu { display: none; }
@media screen and (max-width: 767px) {
  .nomen-mobile-menu { display: block; }
  .nomen-mobile-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: #881337; color: white; }
  .nomen-mobile-bar > button { font-size: 26px; }
  .nomen-mobile-bar button { cursor: pointer; }
  .nomen-mobile-logout { background: #9f1239; border-radius: 6px; padding: 5px 12px; }
  main.nomen-menu-content { padding-top: 72px; }
}
.nomen-mobile-panel { position: fixed; inset: 0 auto 0 0; margin: 0; padding: 0; border: 0; width: min(288px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; overflow-y: auto; background: white; color: #111827; box-shadow: 4px 0 20px #0003; }
.nomen-mobile-panel::backdrop { background: #0006; }
.nomen-mobile-header { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid #e5e7eb; font-weight: 600; }
.nomen-mobile-header > span { flex: 1; }
.nomen-mobile-header button { cursor: pointer; font-size: 22px; }
.nomen-mobile-item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #f3f4f6; text-align: left; text-decoration: none; color: inherit; background: white; cursor: pointer; }
.nomen-mobile-item:hover { background: #fff1f2; }
.nomen-mobile-item:focus-visible, .nomen-mobile-header button:focus-visible { outline: 2px solid #881337; outline-offset: -2px; }
.nomen-mobile-panel [hidden] { display: none !important; }
@media print { .nomen-mobile-menu, .nomen-mobile-panel { display: none !important; } }

/* Identify the current point independently of its displayed name. */
.nomen-menu-item.nomen-selected-point,
.nomen-mobile-item.nomen-selected-point {
  background: #fef3c7;
  color: #78350f;
  border-radius: 6px;
  padding: 5px 10px;
  border-bottom-color: transparent;
}
.nomen-menu-item.nomen-selected-point:hover,
.nomen-mobile-item.nomen-selected-point:hover {
  background: #fde68a;
  color: #78350f;
}
.nomen-mobile-item.nomen-selected-point {
  padding: 12px 16px;
  border-radius: 0;
}

/* Identify the actual current submenu destination. */
.nomen-menu-item.nomen-current-page {
  background: #881337;
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  border-bottom-color: transparent;
}
.nomen-menu-item.nomen-current-page:hover {
  background: #4c0519;
  color: #fff;
}
