/* Website navigation only. Keep every drawing mode and its tools unchanged. */
#siteNavigation {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

#siteNavigation a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #cad8e6;
  border-radius: 6px;
  background: #f2f6fb;
  color: #294f73;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  touch-action: manipulation;
}

#siteNavigation a:hover {
  border-color: #90adc9;
  background: #e2edf8;
}

#siteNavigation a:focus-visible {
  outline: 2px solid #1769aa;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  /* A separate final row preserves all three mode buttons and the optional
   * "apply back to opening" row. Auto placement follows occupied grid rows. */
  #siteNavigation {
    order: 3;
    flex: 1 0 100%;
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  #siteNavigation a {
    min-width: 52px;
    min-height: 44px;
  }
}
