.collapse-summary {
  list-style: none;
}

.collapse-summary::-webkit-details-marker {
  display: none;
}

.collapse-summary::after {
  content: "⌄";
  flex: 0 0 auto;
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 160ms ease;
}

details:not([open]) > .collapse-summary::after {
  transform: rotate(-90deg);
}

.collapse-summary:focus-visible {
  outline: 3px solid #c7a45a47;
  outline-offset: 3px;
}

.restaurant-group {
  display: block;
  min-width: 0;
  align-self: start;
}

.restaurant-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 0;
}

.restaurant-summary > div {
  min-width: 0;
}

.restaurant-summary h3,
.restaurant-summary p {
  margin: .15rem 0;
}

.restaurant-content {
  display: block;
  position: static;
  width: 100%;
  min-width: 0;
  padding-bottom: 1rem;
}

.menu-section > .collapse-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem 0;
  font-size: 1.05rem;
}

.menu-section-content {
  display: grid;
  gap: .75rem;
}

.menu-item-group {
  min-width: 0;
  border-radius: .6rem;
  background: rgba(255,255,255,.55);
}

.menu-item-summary {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  align-items: center;
  gap: .75rem;
  padding: .85rem;
}

.menu-item-summary strong,
.menu-item-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-item-summary span {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

.menu-item-group > .menu-item {
  border-top: 1px solid var(--line);
  border-radius: 0 0 .6rem .6rem;
}

/* Keep user-entered names and generated URLs inside narrow dashboard cards. */
#dashboard .card,
#dashboard .card > *,
#dashboard .actions,
.team-member,
.team-member > *,
.service-table,
.menu-section,
.menu-section > .collapse-summary > span {
  min-width: 0;
  max-width: 100%;
}

#dashboard .card h3,
#dashboard .card strong,
#dashboard .card p,
#dashboard .card .actions > span,
.team-member h3,
.team-member p,
.service-table h3,
.menu-section > .collapse-summary > span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashboard select {
  min-width: 0;
  max-width: 100%;
}


.list-controls,
.reorder-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.grid > *,
.panel,
.panel-title,
.cards,
.team-layout > * {
  min-width: 0;
  max-width: 100%;
}

.list-controls {
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
}

.list-controls input,
.list-controls select {
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

.list-controls input {
  width: min(14rem, 100%);
}

.reorder-controls {
  justify-content: flex-end;
}

.menu-section-content > .reorder-controls,
.menu-item-group > .reorder-controls {
  padding: .5rem .75rem .75rem;
}

.menu-section-content > .reorder-controls {
  padding-inline: 0;
}

.panel-title + .cards,
.restaurant-panel-title + .cards,
.panel-title + .team-layout,
.panel-title + .menu-layout {
  margin-top: 1rem;
}

.reorder-controls button {
  padding: .35rem .6rem;
}

.drag-handle {
  padding: .3rem .45rem;
  border-radius: .4rem;
  color: var(--muted);
  cursor: grab;
  font-size: 1.25rem;
  line-height: 1;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.dragging {
  opacity: .5;
}

@media (max-width: 760px) {
  .panel-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .restaurant-summary {
    flex-direction: row;
    align-items: flex-start;
  }

  .restaurant-panel-title {
    gap: .75rem;
  }

  .restaurant-panel-title #restaurant-refresh {
    margin-left: auto;
  }

  .restaurant-content .card {
    width: 100%;
  }

  .menu-item-summary {
    grid-template-columns: minmax(0,1fr) auto;
  }

  .menu-item-summary span {
    grid-column: 1;
    grid-row: 2;
  }

  .menu-item-summary strong {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .menu-item-summary::after {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  #dashboard .card > .actions,
  .team-member > .team-actions {
    width: 100%;
  }

  .list-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
  }

  .list-controls input,
  .list-controls select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .list-controls button {
    width: auto;
    justify-self: start;
  }

  .panel-title > button {
    align-self: flex-start;
    width: auto;
  }

  #dashboard .panel {
    overflow-x: clip;
  }

  #dashboard .cards {
    width: 100%;
    margin-inline: 0;
  }

  .reorder-controls {
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 950px) {
  .operations > .panel-title {
    flex-direction: column;
    align-items: stretch;
  }

  .operations > .panel-title > div:first-child {
    width: 100%;
  }

  .operations .operations-controls {
    width: 100%;
    margin-top: .75rem;
  }

  .restaurant-panel-title {
    flex-direction: row;
    align-items: center;
  }

  .restaurant-panel-title h2 {
    min-width: 0;
    margin-block: 0;
  }

  .restaurant-panel-title #restaurant-refresh {
    flex: 0 0 auto;
    align-self: center;
  }
}
