/* ---------- Layouts (View menu) ---------- */
/* Compact: icon + name tiles with the existing link and note actions. */
body[data-layout="compact"] #services .grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
body.editing[data-layout="compact"] #services .grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
body[data-layout="compact"] #services .card {
  padding: 10px 12px;
  gap: 8px;
}
body[data-layout="compact"] #services .card .top {
  align-items: center;
  gap: 10px;
}
body[data-layout="compact"] #services .card .icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 18px;
}
body[data-layout="compact"] #services .card .icon .letter {
  font-size: 15px;
}
body[data-layout="compact"] #services .card .name {
  font-size: 0.92rem;
}
body[data-layout="compact"] #services .card .text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
body[data-layout="compact"] #services .card .text > .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-layout="compact"] #services .card .text > .status {
  margin-top: 0;
}
body[data-layout="compact"] #services .card .server-tag {
  width: 100%;
}
body[data-layout="compact"]
  #services
  .card
  :is(.description, .status-label, .usage) {
  display: none;
}
body[data-layout="compact"] #services .card .links {
  margin-top: auto;
  align-items: center;
}
body[data-layout="compact"] #services .card .links a.chip {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0;
}
body[data-layout="compact"] #services .card .links :is(.link-label, .amber, .grow) {
  display: none;
}
body[data-layout="compact"] #services .add-card {
  min-height: 56px;
  flex-direction: row;
  gap: 8px;
}

/* List: one row per service with links on the right. */
body[data-layout="list"] #services .grid {
  grid-template-columns: repeat(auto-fill, minmax(min(520px, 100%), 1fr));
  gap: 8px;
}
body[data-layout="list"] #services .card {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
}
body[data-layout="list"] #services .card:hover {
  transform: none;
}
body[data-layout="list"] #services .card .top {
  flex: 1;
  min-width: 0;
  align-items: center;
}
body[data-layout="list"] #services .card .icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 20px;
}
body[data-layout="list"] #services .card .description {
  -webkit-line-clamp: 1;
  margin-top: 1px;
}
body[data-layout="list"] #services .card .links {
  margin-top: 0;
  flex: 0 1 45%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  max-width: 45%;
}
body[data-layout="list"] #services .card .links .grow {
  display: none;
}
body[data-layout="list"] #services .card .name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body[data-layout="list"] #services .card .usage {
  display: none;
}
body[data-layout="list"] #services .add-card {
  min-height: 56px;
  flex-direction: row;
  gap: 8px;
}

/* ---------- Unlisted containers ---------- */
.unlisted {
  margin-top: 36px;
}
.unlisted summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  padding: 8px 0;
  color: var(--muted);
}
.unlisted summary::-webkit-details-marker {
  display: none;
}
.unlisted summary svg {
  transition: transform 0.2s;
}
.unlisted details[open] summary svg {
  transform: rotate(90deg);
}
.unlisted .grid {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.unlisted .card {
  padding: 12px 14px;
  gap: 8px;
  box-shadow: none;
}
.unlisted .card .name {
  font-size: 0.92rem;
}
.unlisted .card .image {
  font:
    0.75rem ui-monospace,
    monospace;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

