.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: clamp(11.5rem, 15vw, 13rem) minmax(0, 1fr);
}

/* Column that fills the full height of the grid row (at least the window), with
   <main> taking the spare room, so the footer sits at the bottom of the window
   on short pages instead of right under the content. */
.app-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-content > main { flex: 1 0 auto; }

.tool-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  box-sizing: border-box;
  padding: 1.5rem 0.75rem;
  background: #f3f6fa;
  border-right: 1px solid #c8d1dc;
}

.sidebar-brand {
  display: block;
  margin: 0 0 1.25rem;
  color: #17365d;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
}

.tool-sidebar nav { display: grid; gap: 0.4rem; }

.tool-nav-link {
  display: block;
  padding: 0.65rem 0.6rem;
  color: #17365d;
  border-left: 4px solid transparent;
  border-radius: 0.25rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.tool-nav-link:hover { background: #e5edf5; text-decoration: underline; }

.tool-nav-link.active,
.tool-nav-link[aria-current="page"] {
  color: #102a49;
  background: #d9e8f5;
  border-left-color: #175f8c;
}

.sidebar-brand:focus-visible,
.tool-nav-link:focus-visible {
  outline: 3px solid #b45309;
  outline-offset: 2px;
}

@media (max-width: 52rem) {
  .app-layout { display: block; }
  .tool-sidebar {
    position: static;
    height: auto;
    padding: 0.9rem 1rem;
    border-right: 0;
    border-bottom: 1px solid #c8d1dc;
  }
  .sidebar-brand { margin-bottom: 0.65rem; }
  .tool-sidebar nav { display: flex; flex-wrap: wrap; gap: 0.35rem; }
  .tool-nav-link { border-left: 0; border-bottom: 4px solid transparent; }
  .tool-nav-link.active,
  .tool-nav-link[aria-current="page"] { border-bottom-color: #175f8c; }
}
